Commit Graph

24 Commits

Author SHA1 Message Date
xiaoju a38ca7e8db chore: upgrade json-cas deps to ^0.3.0 2026-05-18 15:27:01 +00:00
xiaoju ade6227ffe feat: add uwf cas reindex command
Rebuilds _index from all .bin nodes. Use after upgrading to json-cas 0.2.0
on an existing CAS directory.
2026-05-18 14:24:23 +00:00
xiaoju 6758adc1d5 refactor: use listByType for schema list, upgrade json-cas to 0.2.0
Replace O(n) full CAS scan with O(1) type-index lookup.

Refs #328
2026-05-18 14:16:15 +00:00
xiaoju 0f6859678c refactor: merge cas get/cat into get, default hides timestamp
- Remove `cas cat` command
- `cas get` now returns {type, payload} by default
- Add `--timestamp` flag to include timestamp

Refs #328
2026-05-18 14:03:10 +00:00
xiaoju 6eace09826 refactor: remove table output format, keep json and yaml only
Table format adds complexity without readability gain over yaml.

Refs #328
2026-05-18 13:57:46 +00:00
xiaoju 36d120b745 fix: table format — horizontal for arrays, vertical for objects
Arrays: horizontal table with HEADER row
Objects: vertical KEY/VALUE table
Primitives: fall back to yaml

小橘 🍊(NEKO Team)
2026-05-18 13:43:50 +00:00
xiaomo bb0f2ca678 Merge pull request 'feat: --format json/yaml/table for all non-interactive commands' (#329) from feat/328-format-option into main 2026-05-18 13:40:19 +00:00
xiaoju 7dd6ab5328 feat: --format json/yaml/table for all non-interactive commands
Add program-level --format option (default: json) inherited by all
subcommands. json output unchanged, yaml via yaml package, table
renders aligned columns for arrays, falls back to yaml for objects.

Closes #328

小橘 🍊(NEKO Team)
2026-05-18 13:33:41 +00:00
xiaoju c4c9f96117 fix: uwf cas commands output JSON, include meta-schema in schema list
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)
2026-05-18 13:24:19 +00:00
xiaoju 17103c1ee1 refactor: outputSchema only accepts inline JSON Schema
- Remove CAS ref string support from workflow YAML outputSchema
- Simplify validate.ts: no string check for outputSchema
- Auto-set title from role name (workflow.role format)

Refs #319

小橘 🍊(NEKO Team)
2026-05-18 13:17:29 +00:00
xiaoju b304f65876 feat: auto-set outputSchema title from role name
When uwf workflow put processes inline JSON Schema for a role,
auto-inject title=roleName if not already set. Makes uwf cas schema list
show meaningful names like 'planner', 'coder' instead of (unnamed).

小橘 🍊(NEKO Team)
2026-05-18 13:05:28 +00:00
xiaoju c9010a024f fix: remove cas list, add title to schemas
- Remove uwf cas list (CAS grows unbounded, listing all hashes is useless)
- Add title to Workflow/StartNode/StepNode schemas so schema list shows names

小橘 🍊(NEKO Team)
2026-05-18 13:01:17 +00:00
xiaoju 52282e1960 feat: built-in uwf cas commands replacing json-cas passthrough
- get, cat, put, has, list, refs, walk, schema list, schema get
- All commands auto-resolve store to ~/.uncaged/workflow/cas
- No external json-cas CLI dependency needed
- Agent-friendly: uwf cas --help shows all available subcommands

Refs #319, Closes #320

小橘 🍊(NEKO Team)
2026-05-18 12:40:15 +00:00
Scott Wei 7a579ee67a feat: uwf cas — passthrough to json-cas with uwf store path
uwf cas get <hash>, uwf cas list, etc. all auto-set --store to
~/.uncaged/workflow/cas so agents don't need to remember the path.

小橘 🍊(NEKO Team)
2026-05-18 20:14:59 +08:00
Scott Wei 7c230383ad improve: multi-column model list + friendly post-setup message
- Model list now renders in columns to fit terminal width
- Interactive setup ends with usage hints instead of JSON dump

小橘 🍊(NEKO Team)
2026-05-18 19:56:09 +08:00
xiaoju e604fa5f47 feat: add uwf setup command
- Interactive mode: prompts for provider, API key, model (with /models discovery)
- Non-interactive mode: --provider --base-url --api-key --model flags
- Writes config.yaml (providers, models, agents, defaults)
- Writes .env (API keys with auto-generated env var names)
- Merges into existing config non-destructively
- Includes 13 preset providers (international + China + local)

小橘 🍊(NEKO Team)
2026-05-18 11:49:42 +00:00
xiaoju 3d1b2268b4 chore: bump json-cas deps to ^0.1.3 2026-05-18 10:48:06 +00:00
xiaoju 8bebe9da0f chore: bump json-cas-fs to ^0.1.2 (fix workspace:^ in published pkg) 2026-05-18 10:44:30 +00:00
xiaoju 53a7355f0b chore: fix json-cas workspace:^ refs to ^0.1.1 2026-05-18 10:30:31 +00:00
xiaoju d90e29ad05 fix: address 3 critical PR review issues
1. threads.yaml race condition: reload threads index after agent subprocess
   completes before updating head pointer (cli-uwf/commands/thread.ts)

2. evaluateJsonata not awaited: jsonata evaluate() returns Promise for async
   expressions — now properly awaited (uwf-moderator/evaluate.ts)

3. resolveWorkflowHash dead code: function always returns a value, removed
   impossible null return type and dead null-check branches at call sites
   (cli-uwf/store.ts, commands/thread.ts, commands/workflow.ts)
2026-05-18 10:05:11 +00:00
xiaoju 0727e0e8d5 fix: reload CAS store after agent spawn + share schemas via uwf-protocol
The agent subprocess writes StepNode to CAS on disk, but the parent
process had an in-memory cache from createFsStore init. Fix: re-create
store after agent spawn to pick up new nodes.

Also centralized JSON Schemas in uwf-protocol so cli-uwf and agent-kit
produce identical type hashes.

E2E smoke test passing: workflow put → thread start → 3x step → done

Refs #309
2026-05-18 09:33:52 +00:00
xiaoju b165049a13 feat: implement thread step — moderator → agent → update head
- Walk CAS chain to build ModeratorContext with expanded output
- Call uwf-moderator evaluate() for role decision
- Agent resolution: --agent > config overrides > default
- Spawn agent CLI, capture StepNode hash
- Update threads.yaml, check done via second evaluate
- Archive on $END

Refs #309, #315
2026-05-18 09:19:37 +00:00
xiaoju 0d5678c961 feat: add thread start/show/list/kill commands
- thread start: ULID generation, StartNode to CAS, threads.yaml
- thread show: active (done:false) or archived (done:true)
- thread list: active threads, --all includes history
- thread kill: archive to history.jsonl

Refs #309, #313
2026-05-18 09:09:10 +00:00
xiaoju a8e2aa85f8 feat: add @uncaged/cli-uwf with workflow put/show/list commands
Refs #309, #312
2026-05-18 09:03:55 +00:00