RFC: uwf cas — 内置 CAS 子命令替代 json-cas 透传 #319

Closed
opened 2026-05-18 12:33:22 +00:00 by xiaoju · 1 comment
Owner

背景

当前 uwf cas 是 passthrough 给 json-cas CLI,问题:

  1. Agent 看不到具体有哪些命令(uwf cas --help 没有子命令列表)
  2. 依赖 json-cas CLI 在 PATH 中
  3. 无法裁剪,暴露了 workflow 不需要的命令

方案

@uncaged/json-cas + @uncaged/json-cas-fs API 直接实现 CAS 子命令,不依赖 cli-json-cas。

Phase 拆分

Phase 1: 核心读写命令

  • uwf cas get <hash> — 读节点 JSON
  • uwf cas cat <hash> [--payload] — 读节点(可只输 payload)
  • uwf cas put <type> <file.json> — 写节点,输出 hash
  • uwf cas has <hash> — 检查存在
  • Testing issue: 待创建

Phase 2: 查询与遍历

  • uwf cas list — 列出所有 hash
  • uwf cas refs <hash> — 列出引用
  • uwf cas walk <hash> [--format tree] — 递归遍历
  • Testing issue: 待创建

Phase 3: Schema 命令

  • uwf cas schema list — 列出所有 schema
  • uwf cas schema get <hash> — 查看 schema
  • Testing issue: 待创建

完成标准

  • 所有 Phase 的 testing issue 已 close
  • 旧的 passthrough 代码已移除
  • uwf cas --help 显示完整子命令列表
## 背景 当前 `uwf cas` 是 passthrough 给 `json-cas` CLI,问题: 1. Agent 看不到具体有哪些命令(`uwf cas --help` 没有子命令列表) 2. 依赖 `json-cas` CLI 在 PATH 中 3. 无法裁剪,暴露了 workflow 不需要的命令 ## 方案 用 `@uncaged/json-cas` + `@uncaged/json-cas-fs` API 直接实现 CAS 子命令,不依赖 cli-json-cas。 ## Phase 拆分 ### Phase 1: 核心读写命令 - `uwf cas get <hash>` — 读节点 JSON - `uwf cas cat <hash> [--payload]` — 读节点(可只输 payload) - `uwf cas put <type> <file.json>` — 写节点,输出 hash - `uwf cas has <hash>` — 检查存在 - Testing issue: 待创建 ### Phase 2: 查询与遍历 - `uwf cas list` — 列出所有 hash - `uwf cas refs <hash>` — 列出引用 - `uwf cas walk <hash> [--format tree]` — 递归遍历 - Testing issue: 待创建 ### Phase 3: Schema 命令 - `uwf cas schema list` — 列出所有 schema - `uwf cas schema get <hash>` — 查看 schema - Testing issue: 待创建 ## 完成标准 - [ ] 所有 Phase 的 testing issue 已 close - [ ] 旧的 passthrough 代码已移除 - [ ] `uwf cas --help` 显示完整子命令列表
Author
Owner

Closing: CAS subcommands implemented and merged (PR #323+)

— 小橘 🍊(NEKO Team)

Closing: CAS subcommands implemented and merged (PR #323+) — 小橘 🍊(NEKO Team)
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#319