#compdef agenote
# agenote zsh completion — generated by `agenote completions zsh`
# source: src/agenote/completions.py — do not edit by hand
# Usage: copy to $fpath, e.g. ~/.zsh/completions/_agenote && compinit

_agenote() {
    (( $+functions[_arguments] )) || autoload -U _arguments
    (( $+functions[_describe] )) || autoload -U _describe

    _arguments -C \
        '--domain[操作域]:domain:(human agenote)' \
        '--version[显示版本号]' \
        '(-h --help)-h[显示帮助]' \
        '(-h --help)--help[显示帮助]' \
        '1: :->subcmd' \
        '*::arg:->args'

    case "$state" in
        subcmd)
            _describe -t commands 'agenote commands' \
                '("add:添加经验卡片" "archive:归档卡片" "commit:提交知识库变更" "completions:生成 shell 补全脚本" "config:配置管理" "connect:双向链接两张卡片" "context:生成注入简报（只读免锁）" "deduplicate:检测重复卡片" "distill:工作流蒸馏" "doctor:环境自诊断（外部工具/配置/KB 结构）" "dream:从 reconcile 事实提炼候选新卡片" "extract:跨 agent 对话抽取为 Org 文件" "fields:列出已有字段值" "format:格式化卡片" "gaps:知识空白检测" "get:读取卡片详情" "health:知识库健康度报告" "inbox:快速捕获到 inbox.org" "inbox-archive:把 inbox 条目归档为经验卡片" "init:初始化知识库" "lint:格式校验与报告" "list:列出卡片" "memory:管理记忆系统" "merge:合并卡片" "reconcile:跨 agent memory 只读 reconcile" "reindex:重建知识库索引" "restore:恢复归档卡片" "review:审查卡片" "scan-memories:只读扫描各 agent 记忆库" "search:全文检索" "stats:知识库统计概览" "sweep:done/stable → stale 降级" "tags:按标签检索" "touch:更新卡片时间戳" "trace:回查 dream 候选的原始对话" "update:更新已有卡片" "viz:生成知识库可视化 Web 页面")' && return 0
            ;;
        args)
            case $words[1] in
                config)
                    _describe -t commands 'config subcommand' '("init:生成带注释的配置模板" "show:打印当前生效配置及来源")'
                    ;;
                completions)
                    _describe -t values 'shell' '("bash:bash completion" "zsh:zsh completion" "fish:fish completion")'
                    ;;
                get)
                    _arguments '--used[读取后记录使用]' '-h[显示帮助]' '--help[显示帮助]'
                    ;;
                add)
                    _arguments \
                        '--title[任务标题]:' \
                        '--category[类别]:' \
                        '--tech[技术栈]:' \
                        '--type[类型]:类型:(config debug feature refactor research workflow)' \
                        '--owner[执行者]:执行者:(ai collab human)' \
                        '--entry[条目语义]:条目语义:(ascended mistake note)' \
                        '--summary[一句话总结]:' \
                        '--stdin[从标准输入读取]'
                    ;;
                viz)
                    _arguments \
                        '--output[输出文件]:' \
                        '--open[生成后打开]' \
                        '--no-open[不打开浏览器]' \
                        '--serve[启动本地 HTTP 服务器]' \
                        '--port[监听端口]:' \
                        '--theme[主题]:主题:(light dark auto)'
                    ;;
                reconcile|extract)
                    _arguments '--source[来源]:来源:(claude codex crush omp opencode zcode all)' '--dry-run[只预览不落盘]'
                    ;;
                scan-memories)
                    _arguments '--source[来源]:来源:(claude codex hermes pi reasonix zcode all)' '--json[输出 JSON]'
                    ;;
                memory)
                    _arguments '--type[记忆类型]:记忆类型:(user feedback project environment reference)' '--source[导入来源]:来源:(claude codex hermes pi reasonix zcode all)' '--import[摄取导入]' '--conflicts[列出冲突队列]' '--dry-run[只预览不落盘]'
                    ;;
            esac
            ;;
    esac
}
_agenote "$@"
