若麒
2f9558c161
refactor(auth): remove deprecated AK/SK auth for knowledge retrieve
...
AK/SK signing was used only by `knowledge retrieve`'s deprecated fallback,
which the api-key auth gate now makes unreachable. Drop it; the command is
pure api-key.
- knowledge/retrieve: remove the AK/SK path + --access-key-id/secret/workspace-id
flags; api-key only
- delete client/ak-sign.ts and its signRequest/AkSignConfig exports
- drop access_key_id/access_key_secret from config schema, loader, and
`config show` / `config set`
- remove the now-unused PascalCase KnowledgeRetrieve request/response types
2026-06-28 22:24:59 +08:00
若麒
91e6c6f553
refactor(runtime): resolve/middleware kernel + declarative arg validation
...
把 main 从一堆 if + process.exit 重构为「argv 解析成数据 → 交给统一管线执行」。
内核
- resolve(argv) → Resolution(version/help/run/usageError):路由即数据,dispatch 只 switch
- compose 洋葱中间件 (versionCheck/telemetry/auth/runCommand),命令仍收 (config, flags)
- registry.locate() 统一 leaf/group/unknown,取代 isGroupPath + 抛异常的 resolve
- 删除 command-help.ts 全局可变单例:help 渲染收口到错误边界
错误模型
- 新增 UsageError(写错了 → exit 2) 与 IncompleteCommandError(没写完 → 打 help、exit 0)
- version / help / onboarding / 组帮助统一由 resolve 产出、dispatch 分派
参数与校验
- parseFlags 重写:无 positional、新增 switch 类型、值/类型/重复校验
- 无条件必填 → 解析器声明式强制 (OptionDef.required)
- 跨 flag / 条件约束 → 新增 command.validate(flags) 钩子
(text-chat / search-web / speech / vision / video-ref)
- 移除全部交互式输入 (promptText/Select/Confirm),缺输入直接打 help
输出
- detectOutputFormat 默认 text,不再按 TTY 切 json
测试
- 删除 3 个 stale cli 测试,runtime 单测重写 (29 passed),e2e 适配新行为
2026-06-26 16:50:12 +08:00
zeyu.fz
c070699fb2
test(knowledge): 移除 API-KEY 与 AK/SK 测试相关代码
2026-06-11 11:45:13 +08:00
zeyu.fz
6317da8454
feat(cli): 重构知识库检索命令,支持API-KEY和AK/SK鉴权
...
- 增加API-KEY鉴权路径,采用DashScope协议(snake_case)请求后端接口
- 保留AK/SK鉴权路径,但打印废弃警告,采用PascalCase请求后端
- 命令参数调整,新增dense-similarity-top-k、sparse-similarity-top-k等API-KEY专用选项
- 废弃部分旧参数如顶层top-k,提醒用户改用rerank-top-n
- 统一输出格式以及静默模式下文本结果的打印逻辑优化
- 添加相关类型定义,完善请求与响应结构的类型支持
- CLI端增加dry-run模式,展示实际请求参数与地址
- E2E测试覆盖API-KEY和AK/SK两条路径,包含帮助提示、错误场景及关键参数测试
- 更新依赖的核心包导出与接口,新增knowledgeRetrieveEndpoint方法接口调用
2026-06-08 18:43:50 +08:00
若麒
1533e2013e
Initial commit
2026-05-28 18:37:07 +08:00