fix: uwf cas — JSON output + meta-schema in schema list #326

Merged
xiaomo merged 1 commits from fix/319-cas-json-output into main 2026-05-18 13:25:16 +00:00
Owner

What

所有 uwf cas 子命令统一 JSON 输出,与其他 uwf 命令一致。

Changes

  • cas.ts — 所有命令返回数据结构,不再直接 console.log
  • cli.ts — 统一用 writeJson() 输出
  • schema list 包含 meta-schema(之前被跳过)
  • 移除 --json flag 和 --format tree(统一 JSON,不需要人类格式)

输出示例

uwf cas has 0000000000000{"exists":false}

uwf cas schema list
→ [{"hash":"...","title":"(meta-schema)"},{"hash":"...","title":"Workflow"},...]

uwf cas put <type> <data>
→ {"hash":"..."}

Refs #319

## What 所有 `uwf cas` 子命令统一 JSON 输出,与其他 uwf 命令一致。 ## Changes - `cas.ts` — 所有命令返回数据结构,不再直接 console.log - `cli.ts` — 统一用 `writeJson()` 输出 - `schema list` 包含 meta-schema(之前被跳过) - 移除 `--json` flag 和 `--format tree`(统一 JSON,不需要人类格式) ## 输出示例 ```bash uwf cas has 0000000000000 → {"exists":false} uwf cas schema list → [{"hash":"...","title":"(meta-schema)"},{"hash":"...","title":"Workflow"},...] uwf cas put <type> <data> → {"hash":"..."} ``` Refs #319
xiaoju added 1 commit 2026-05-18 13:24:38 +00:00
All cas subcommands now output JSON via writeJson(), consistent with
other uwf commands. schema list includes meta-schema. Removed --json
flag and --format tree (tree is human-only, not machine-friendly).

Refs #319

小橘 🍊(NEKO Team)
xiaomo approved these changes 2026-05-18 13:25:15 +00:00
xiaomo left a comment
Owner

LGTM 统一 JSON 输出 + 命令函数返回数据而非直接打印,职责分离更清晰。meta-schema 纳入 list 也对。

LGTM ✅ 统一 JSON 输出 + 命令函数返回数据而非直接打印,职责分离更清晰。meta-schema 纳入 list 也对。
xiaomo merged commit 7c955fa749 into main 2026-05-18 13:25:16 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#326