Commit Graph

1074 Commits

Author SHA1 Message Date
xiaomo 661fdbb263 Merge pull request 'refactor(cli): Phase 4 cleanup — dedup, extract, deprecate' (#103) from refactor/97-phase4-cleanup into main 2026-05-08 01:17:17 +00:00
xingyue 201abf98ce refactor(cli): Phase 4 cleanup — dedup, extract, deprecate
- bundle-store.ts: remove private pathExists, import from fs-utils
- thread-scan.ts: extract parseFirstJsonLineObject helper, dedup first-line parsing
- commands/workflow/add-argv.ts: extract parseAddArgv from add.ts
- commands/thread/fork-argv.ts: extract parseForkArgv from fork.ts
- commands/cas/*.ts: remove unused _threadId params from cmdCas* functions
- cli-dispatch.ts: add deprecation warning to help command
- commands/init/templates.ts: extract template strings from template.ts
- cli-color.ts: extract shouldUseColor, highlightLiveRole, dimGreyLine from live.ts
- 242 tests pass, biome clean

Closes #97
2026-05-08 09:14:40 +08:00
xiaomo 665965fd01 Merge pull request 'refactor(cli): split cli-dispatch.ts into group dispatchers + usage module' (#101) from refactor/96-phase3-split-dispatch into main 2026-05-08 01:07:04 +00:00
xingyue 6a99f84025 refactor(cli): split cli-dispatch.ts into group dispatchers + usage module
- cli-dispatch.ts: 775 → 149 lines (top-level routing only)
- cli-usage.ts: usage formatting (formatCliUsage, formatUsageCommandLines)
- cli-command-types.ts: shared types (DispatchFn, CommandEntry, CommandGroup)
- cli-registry.ts: getCommandRegistry() assembling all group tables
- cli-usage-context.ts: decouple usage from registry (avoids circular deps)
- commands/{workflow,thread,cas,init}/dispatch.ts: group-specific dispatch
  functions + subcommand tables
- 242 tests pass, CLI output identical, biome clean

Refs #96
2026-05-08 09:04:27 +08:00
xiaomo f61474bec0 Merge pull request 'refactor(cli): merge kill/pause/resume into control.ts + extract readWorkerCtl' (#100) from refactor/95-phase2-control-merge into main 2026-05-08 00:58:11 +00:00
xingyue 9bdb18afd0 refactor(cli): merge kill/pause/resume into control.ts + extract readWorkerCtl
- Merge three near-identical files (kill.ts, pause.ts, resume.ts) into
  commands/thread/control.ts with parameterized cmdThreadControl()
- Extract readWorkerCtl() into worker-spawn.ts to eliminate duplicated
  WorkerCtl parsing logic
- Update cli-dispatch.ts and test imports
- Net reduction: ~59 lines

Refs #95
2026-05-08 08:55:25 +08:00
xiaomo 2af299f3ce Merge pull request 'refactor(cli): restructure cmd-*.ts into commands/ subdirectories' (#98) from refactor/93-phase1-directory-restructure into main 2026-05-08 00:48:30 +00:00
xiaoju d9f79c60a1 Merge pull request 'chore: remove unused build scripts' (#99) from chore/remove-build-scripts into main 2026-05-08 00:46:54 +00:00
xiaoju 485bfcb0b6 chore: remove unused build scripts
All packages are pure Bun/TS — no build step needed.
The build scripts were all placeholder `echo 'TODO'` anyway.
2026-05-08 00:46:35 +00:00
xiaoju a47ed06ea5 Merge pull request 'docs: create README.md, update architecture.md for current structure' (#89) from docs/88-readme-architecture-cleanup into main 2026-05-08 00:42:16 +00:00
xingyue 2ef004eecf refactor(cli): restructure cmd-*.ts into commands/ subdirectories
Reorganize flat cmd-*.ts files into commands/{workflow,thread,cas,init}/
subdirectories that strictly mirror the CLI subcommand hierarchy:

- workflow/: add, list, show, rm, history, rollback
- thread/: run, list, show, rm, fork, ps, kill, live, pause, resume
- cas/: get, put, list, rm, gc
- init/: workspace, template

Each group has an index.ts re-export. Split multi-command files
(cmd-cas.ts, cmd-thread.ts, cmd-init.ts) into per-subcommand files.
Rename cmd-help.ts → skill.ts to match the primary command name.

Update all import paths in cli-dispatch.ts and test files.

Pure structural change — no logic modifications.

Ref: #93, closes #94
2026-05-08 00:36:54 +08:00
xiaoju 2616259a0f Merge pull request 'feat(reviewer): enrich prompt with conventions + CLI awareness' (#92) from feat/91-reviewer-prompt into main 2026-05-07 16:27:08 +00:00
xiaoju 23b2c3b47d feat(reviewer): enrich prompt with conventions awareness + strict verdicts
- Read preparer's conventions from thread context
- Review checklist: correctness, conventions, consistency, edge cases
- No nits: every issue is blocking, approve only at zero issues
- Generic prompt, no workflow-specific concepts

Closes #91

小橘 🍊
2026-05-07 16:25:31 +00:00
xiaoju 7d3954097d docs: fix deprecated CLI commands in README
- workflow add (was: add)
- workflow list (was: list)
- thread list (was: threads)
- thread show (was: thread)

小橘 🍊
2026-05-07 16:15:29 +00:00
xiaoju 4a925b98af docs: create README.md, update architecture.md for current structure
- Create root README.md with project intro, concepts, packages, quickstart
- Remove workflow-role-* references from docs/architecture.md
- Roles now live inside template packages (src/roles/)
- Clean up untracked dist/packages/workflow-role-* remnants

Fixes #88
2026-05-07 16:10:37 +00:00
xingyue bfea771a52 Merge pull request 'fix(cli): improve usage format + fix skill index title' (#86) from fix/85-usage-format into main 2026-05-07 15:33:27 +00:00
xiaoju 5e411a1f19 fix(cli): improve usage output format + fix skill index title
- Usage: grouped sections with titles, aligned descriptions
- Header: 'uncaged-workflow — workflow engine CLI'
- Footer: 'Use <command> --help for subcommand details.'
- Fix skill index title: 'uncaged-workflow skill' (was: help --skill)
- 242 tests pass

Closes #85

小橘 🍊
2026-05-07 15:31:48 +00:00
xingyue 21238f7825 Merge pull request 'fix(cli): usage not red + skill subcommand + --help flag' (#84) from fix/83-cli-ux into main 2026-05-07 15:19:08 +00:00
xiaoju 6b3aa4ce35 fix(cli): usage not red + skill subcommand + --help flag on groups
1. No-args usage uses printCliLine (not printCliError), exit 1
2. 'skill [topic]' as first-class command (help --skill kept as compat)
3. 'workflow --help', 'thread --help' etc. show group subcommands
4. Role prompts updated: 'uncaged-workflow skill develop'

240 tests (6 new), build clean.

Closes #83

小橘 🍊
2026-05-07 15:17:20 +00:00
xingyue f042c9d640 Merge pull request 'feat(cli): help --skill <topic> for context-specific agent docs' (#82) from feat/81-skill-topics into main 2026-05-07 15:08:41 +00:00
xiaoju 66bca9ef03 feat(cli): help --skill <topic> — context-specific docs for agents
- help --skill (no args) → lists available topics
- help --skill cli → full CLI reference (was: help --skill)
- help --skill develop → thread ID, CAS, meta output guide for roles
- help --skill author → bundle structure, descriptor, role definition
- Role prompts updated: planner/coder reference 'help --skill develop'
- Legacy formatSkillDoc() preserved for compat
- 234 tests (15 new), build clean

Closes #81

小橘 🍊
2026-05-07 15:03:08 +00:00
xiaoju 309af39447 Merge pull request 'fix(cli): review nits — live --latest args + dispatchInit consistency' (#79) from fix/75-nits into main 2026-05-07 14:54:28 +00:00
xiaoju 86a422f7e2 fix(cli): nits from review — live --latest in args, dispatchInit uses dispatchGroup
小橘 🍊
2026-05-07 14:54:02 +00:00
xiaoju 648f0c6dec Merge pull request 'refactor: merge role packages into templates + slim prompts' (#78) from refactor/75-merge-roles-phase1 into main 2026-05-07 14:52:25 +00:00
xiaoju 8456a8337b refactor: slim planner & coder prompts with help --skill
Replace inline CLI tutorials (thread ID lookup, cas put/get examples)
with a single 'uncaged-workflow help --skill' reference. Keeps minimal
task-specific instructions (what to store, what to report).

Closes #77
Refs #75, #72

小橘 🍊
2026-05-07 14:47:14 +00:00
xiaoju 9c8b98a551 refactor: merge 7 workflow-role-* packages into templates
- planner/coder/reviewer/tester/committer → workflow-template-develop/src/roles/
- preparer/submitter → workflow-template-solve-issue/src/roles/
- Moved tests, updated imports, removed role packages
- 219 tests pass, build clean

Closes #76
Refs #75, #73

小橘 🍊
2026-05-07 14:45:11 +00:00
xiaoju c3272be760 Merge pull request 'refactor(cli): auto-generate skill doc from command registry' (#74) from refactor/71-auto-gen-skill-doc into main 2026-05-07 14:39:51 +00:00
xiaomo c44b773a86 refactor(cli): auto-generate skill doc from command registry (#71) 2026-05-07 14:35:53 +00:00
xingyue 2776f8e419 Merge pull request 'feat(cli): add WORKFLOW_STORAGE_ROOT env var support' (#68) from feat/63-workflow-storage-root into main 2026-05-07 14:30:03 +00:00
xiaoju 7b0e256c13 feat(cli): add WORKFLOW_STORAGE_ROOT env var support
Add user-facing WORKFLOW_STORAGE_ROOT environment variable to override
the default storage directory (~/.uncaged/workflow). The existing
UNCAGED_WORKFLOW_STORAGE_ROOT (internal/test) takes priority.

- Update storage-env.ts with priority chain: internal > user > default
- Add env var documentation to CLI help text
- Add 5 tests covering all priority/fallback scenarios

Fixes #63
2026-05-07 22:29:26 +08:00
xiaomo c663ba9e9c Merge pull request 'feat(cli): help --skill command for agent-consumable docs' (#70) from feat/69-help-skill into main 2026-05-07 14:25:31 +00:00
xiaoju 71b413f20c feat(planner): add phase granularity guidance to reduce over-splitting
Simple tasks were getting 3 phases when 1 would suffice. Added explicit
complexity-to-phase-count mapping in the planner system prompt.

小橘 🍊
2026-05-07 14:20:37 +00:00
xiaomo 61be1c662a feat(cli): help --skill command for agent-consumable docs (#69) 2026-05-07 14:20:06 +00:00
xiaomo 84e8d70da4 Merge pull request 'refactor(cli): group commands by noun-verb pattern' (#67) from refactor/cli-noun-verb-grouping into main 2026-05-07 14:09:46 +00:00
xiaomo 8976f4cf3b fix(cli): move 'remove' from workflow table to deprecation path
Per review nit: 'workflow rm' is canonical, 'workflow remove' now shows
deprecation warning. Consistent with top-level 'remove' → 'workflow rm'.
2026-05-07 14:09:37 +00:00
xiaomo 07730dd24c refactor(cli): group commands by noun-verb pattern (RFC #54)
Phase 1: workflow subcommand group (add/list/show/rm/history/rollback)
Phase 2: thread subcommand group (run/list/show/rm/fork/ps/kill/live/pause/resume)
Phase 3: cas gc + top-level aliases + deprecation warnings for old flat commands

- Follow existing CAS_SUBCOMMAND_TABLE pattern for workflow and thread groups
- Top-level 'run' and 'live' stay as shortcuts (no deprecation)
- Old flat commands print deprecation warning then delegate
- Update usage string to show grouped format
- Update tests to use new grouped syntax
2026-05-07 14:03:35 +00:00
xiaoju 4eff4d2370 Merge pull request 'feat: developer + submitter roles, solve-issue as parent workflow' (#62) from feat/59-solve-issue-refactor into main 2026-05-07 13:51:56 +00:00
xiaoju 1d6da18b18 feat: developer + submitter roles, solve-issue refactored to parent workflow
- Developer role (react extract): delegates to workflowAsAgent("develop")
- Submitter role: push branch + create PR
- solve-issue now 3-role parent: preparer → developer → submitter
- Removed direct planner/coder/reviewer/committer from solve-issue
- 188 tests passing

Fixes #59
2026-05-07 13:51:37 +00:00
xiaomo c342ff3737 Merge pull request 'feat(cli): live command — real-time thread monitoring' (#57) from feat/37-live-command into main 2026-05-07 13:45:09 +00:00
xingyue 8fe26417cf feat(cli): add --latest, --debug, --role flags to live command (#37 Phase 2)
- --latest: auto-find most recent thread by start timestamp
- --debug: display .info.jsonl debug log with tags
- --role: filter output to specific role
- Add live-argv.ts for flag parsing
- Add fixtures and test coverage for all flags

Testing: #50
2026-05-07 21:44:19 +08:00
xingyue 990200230b feat(cli): add live command for real-time thread monitoring (#37 Phase 1)
- Add cmd-live.ts: tail .data.jsonl with formatted output
- Display role steps with timestamp, role name, truncated content, meta
- fs.watch for running threads, auto-exit on completion
- Write WorkflowResult to .data.jsonl in worker.ts for completion detection
- Add live.test.ts with JSONL fixtures

Testing: #49
2026-05-07 21:42:32 +08:00
xiaoju 4eaefd9974 Merge pull request 'feat: tester role + develop workflow template' (#61) from feat/58-develop-workflow into main 2026-05-07 13:42:16 +00:00
xiaoju 1a685583bd feat: tester role + develop workflow template
- New workflow-role-tester: runs tests/build/lint, reports pass/fail
- Committer: removed push, only creates branch and commits
- New workflow-template-develop: planner → coder ⟲ → reviewer ⟲ → tester → committer
- 173 tests passing

Fixes #58
2026-05-07 13:42:01 +00:00
xiaomo 19769efea6 Merge pull request 'feat(cli): init command — scaffold workflow workspace' (#56) from feat/36-init-command into main 2026-05-07 13:37:56 +00:00
xiaoju 7f64541c5b Merge pull request 'feat: ReAct ExtractFn with tool-use' (#53) from feat/44-react-extract into main 2026-05-07 13:28:22 +00:00
xiaoju 43a6600378 feat: ReAct ExtractFn with tool-use
- RoleDefinition.extractMode: "single" | "react"
- reactExtract: multi-turn LLM with cas_get tool for DAG traversal
- Max 10 tool-call rounds, schema validation on final output
- create-workflow routes to reactExtract when extractMode is "react"
- All existing roles set to "single" (no behavior change)
- 162 tests passing

Fixes #44
2026-05-07 13:28:00 +00:00
xingyue 74e3f5434c feat(cli): complete AGENTS.md generation (#36 Phase 3)
- Replace placeholder with comprehensive coding agent instructions
- Covers: project structure, core concepts, dev workflow, coding
  conventions, template reuse, build/test, common pitfalls
- Add test coverage for AGENTS.md sections and terms

Testing: #48
2026-05-07 21:23:41 +08:00
xiaoju 220c9c5224 Merge pull request 'feat: global extract provider config' (#52) from feat/43-extract-provider-config into main 2026-05-07 13:21:57 +00:00
xiaoju cae59b589e feat: global extract provider config
- workflow.yaml supports config section (maxDepth, extract provider)
- ExtractProviderConfig with env: prefix for apiKey resolution
- getExtractProvider(storageRoot) returns LlmProvider from config
- workflowAsAgent uses config maxDepth (fallback 3)
- Registry read/write preserves config
- 158 tests passing

Fixes #43
2026-05-07 13:21:38 +00:00
xingyue 703ac9dfcc feat(cli): add init template command (#36 Phase 2)
- Implement cmdInitTemplate: find workspace root, generate template package
- Generate roles.ts, moderator.ts, index.ts with hello-world boilerplate
- Detect workspace by walking up to find package.json with workspaces
- Error on existing template dir or outside workspace
- Add init-template.test.ts

Testing: #47
2026-05-07 21:21:23 +08:00