xiaoju
26cf51366f
feat: Phase 3 — engine read path + runtime context builder
...
- Add buildThreadContext(headHash, cas) to workflow-runtime
- Expand extract phase to return { meta, contentPayload, refs[] }
- Add parseCasThreadNode() to workflow-cas for node type parsing
- Update createWorkflow to write ContentMerkleNode with artifact refs
- Tests: 4 pass (build-context + extract-refs)
- Biome format pass on all files
Refs #155 , closes #158
小橘 <xiaoju@shazhou.work >
2026-05-09 08:00:24 +00:00
xingyue
9bbdfc41bd
feat(execute): create @uncaged/workflow-execute + CLI migration
...
Phase 7: Engine + extract + workflow-as-agent merged into execute package.
All CLI imports migrated from @uncaged/workflow to specific packages.
105 CLI tests pass, 0 failures.
Changes:
- New @uncaged/workflow-execute package (engine/, extract/, workflow-as-agent)
- CLI src/ and __tests__/ rewritten to import from split packages
- bundle-validator updated to allow @uncaged/workflow-cas imports
- ensure-uncaged-workflow-symlink creates symlinks for all new packages
Ref: #143 , closes #150
2026-05-09 11:35:03 +08:00
xiaoju
495c000356
refactor(workflow): split @uncaged/workflow-runtime from engine (Phase 1)
...
Create packages/workflow-runtime with the minimal runtime subset:
- Types (WorkflowFn, RoleOutput, AgentBinding, etc.)
- createWorkflow (pure orchestration, zero I/O)
- validateWorkflowDescriptor
- Result/ok/err, START/END constants
Zero external dependencies (zod as peer only).
Zero node:fs/node:path imports.
Engine (@uncaged/workflow) now depends on workflow-runtime and
provides CAS/merkle/extract implementations via injection.
Refs #121 , relates #122
2026-05-08 06:29:49 +00:00
xiaoju
2b38e583be
chore: enforce folder module discipline in @uncaged/cli-workflow
...
Each commands/ subfolder (cas, init, thread, workflow) now has:
- types.ts for all type definitions
- index.ts with pure re-exports only
- External imports go through index.ts
Closes #108
2026-05-08 01:42:32 +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
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
84de74721d
feat: Merkle node format + content → CAS
...
- MerkleNode type: { type, payload, children } serialized as YAML
- RoleOutput.content → contentHash (CAS hash of Merkle content node)
- Engine stores content in global CAS before writing to .data.jsonl
- create-workflow puts content as Merkle node, merges contentHash into refs
- fork/parse adapted for contentHash format
- buildAgentPrompt now async, reads content from CAS
- Bundle validator allows @uncaged/workflow import
- 150 tests passing
BREAKING: .data.jsonl no longer contains inline content
Fixes #41
2026-05-07 13:14:01 +00:00
xiaoju
12d58a8206
feat: migrate CAS to global storage
...
- Add getGlobalCasDir() to storage-root.ts
- cmd-cas.ts uses global CAS dir, threadId kept for CLI compat
- thread rm no longer deletes .cas/ directories
- Rename createThreadCas → createCasStore (deprecated alias kept)
- 134 tests passing
BREAKING: CAS moves from <thread>.cas/ to <storageRoot>/cas/
Fixes #30
2026-05-07 10:40:14 +00:00
xiaoju
3467b772e6
refactor: named exports (run + descriptor), remove build pipeline
...
- Bundle contract: export const run + export const descriptor (no default export)
- add only accepts .esm.js, extracts descriptor via dynamic import → .yaml
- Removed: build-pipeline, generate-types, json-schema-to-ts
- Worker loads mod.run instead of mod.default
- Biome: no more noDefaultExport overrides for bundles
- 62 tests pass, biome clean
Closes #8
小橘 <xiaoju@shazhou.work >
2026-05-06 06:39:15 +00:00
xiaoju
e670047e6a
feat: build pipeline — .ts → .esm.js + .yaml + .d.ts 三件套
...
- add command auto-detects .ts vs .esm.js input
- .ts: Bun.build → bundle + descriptor extraction + JSON Schema → .d.ts
- .esm.js: requires .yaml alongside, .d.ts optional
- JSON Schema → TypeScript type converter
- hello-world example workflow
- 63 tests pass, biome clean
Closes #7
小橘 <xiaoju@shazhou.work >
2026-05-06 06:26:14 +00:00
xiaoju
47e8fdf5b3
chore: replace hand-written xxhashjs.d.ts with @types/xxhashjs
...
小橘 <xiaoju@shazhou.work >
2026-05-06 06:21:46 +00:00
xiaoju
0becafeb44
feat: Phase 3 — version history/rollback + pause/resume threads
...
- CLI: history, rollback, pause, resume commands
- Registry: rollbackWorkflowToHistoryHash
- Engine: awaitAfterEachYield hook for pause gate
- Worker: ThreadPauseGate with Promise-based latch
- TCP IPC: bidirectional response for kill/pause/resume
- 44 tests pass, biome clean
小橘 <xiaoju@shazhou.work >
2026-05-06 05:36:33 +00:00
xiaoju
9943f21f5c
refactor: WorkflowFn input → ThreadInput, remove threadId from bundle contract
...
- WorkflowFn first param is now ThreadInput { prompt, steps }
- threadId removed from WorkflowFnOptions and ThreadContext (engine-only)
- createRoleModerator seeds context from input.steps (fork/resume ready)
- New test: pre-filled steps skip already-completed roles
Closes #6
小橘 <xiaoju@shazhou.work >
2026-05-06 05:27:14 +00:00
xiaoju
9a4cec2b2d
docs(rfc-001): WorkflowFn input → ThreadInput for fork/resume support
...
- First param is now { prompt, steps } instead of bare prompt
- steps: [] for new thread, pre-filled for fork/resume
- createRoleModerator naturally handles resume via moderator routing
- No special replay logic needed
小橘 <xiaoju@shazhou.work >
2026-05-06 05:25:00 +00:00
xiaoju
7582a88d6b
feat: Phase 2 — Thread lifecycle, execution engine, worker, CLI
...
- types.ts: START/END, RoleMeta, ThreadContext, Role, Moderator, WorkflowDefinition
- engine.ts: executeThread with JSONL persistence + AbortSignal
- worker.ts: per-bundle process, TCP IPC, kill individual threads
- CLI: run/ps/kill/threads/thread/thread rm commands
- 32 tests pass, biome clean
小橘 <xiaoju@shazhou.work >
2026-05-06 04:59:54 +00:00