xiaoju
669af841e1
refactor: address review feedback for CLI restructure
...
- Extract shared module (shared.ts) — walkChain, expandDeep, etc. deduplicated
- Hide step read command (half-baked, not ready for users)
- Remove cmdThreadKill dead code
- Revert unrelated protocol type change
- Revert unrelated package.json change
- Fix unused imports (biome)
Refs #463
2026-05-24 11:32:47 +00:00
xiaoju
650313b1c2
feat(step): expand detail CAS refs by default in step list
...
Previously step list showed raw CAS refs for detail fields.
Now detail is recursively expanded (like output already was),
since every turn is individually hashed and walkable.
Refs #463
2026-05-24 11:12:22 +00:00
xiaoju
c40007eeaf
fix(agent-claude-code): add missing workflow-util dependency
...
The claude-code agent imports createLogger from @uncaged/workflow-util
but was missing the dependency declaration, causing test failures.
2026-05-24 11:04:02 +00:00
xiaoju
1f13b1e79c
fix(cli): resolve lint errors and unused imports ( #463 )
...
Fix all lint errors flagged by biome check to ensure clean codebase.
## Changes
### Removed Unused Imports
- `packages/cli-workflow/src/commands/thread.ts`:
- Removed `StartEntry` (moved to step.ts)
- Removed `StepEntry` (moved to step.ts)
- Removed `ThreadForkOutput` (moved to step.ts)
- Removed `ThreadStepsOutput` (moved to step.ts)
- `packages/cli-workflow/src/cli.ts`:
- Removed unused `yamlStringify` import from yaml package
### Fixed Unused Parameter
- `packages/cli-workflow/src/commands/step.ts`:
- Prefixed unused `before` parameter with underscore in `cmdStepRead`
- Parameter is part of the function signature for future use (awaiting #462 )
### Fixed Import Order
- `packages/cli-workflow/src/__tests__/thread.test.ts`:
- Reordered imports to follow biome's organization rules
- Moved cmdStepShow import before cmdThreadRead imports
## Test Results
- ✅ `bun run check` passes (typecheck + lint + log tags)
- ✅ All 124 tests passing
- ✅ Build completes successfully
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-24 10:50:49 +00:00
xiaoju
031c3aa632
docs(cli): add deprecation handlers and update documentation ( #463 )
...
Complete the CLI refactoring with deprecation error handlers, updated
help text, and comprehensive migration guide.
## Changes
### Deprecation Handlers
Add error handlers for all removed commands with helpful migration messages:
- `workflow put` → suggests `workflow add`
- `thread step` → suggests `thread exec`
- `thread steps` → suggests `step list`
- `thread step-details` → suggests `step show`
- `thread fork` → suggests `step fork`
- `thread kill` → suggests `thread stop` or `thread cancel`
- `thread running` → suggests `thread list --status running`
Error messages follow the format:
```
Error: Command 'X' has been removed.
Use 'Y' instead.
For more information, see: uwf help Y
```
### Help Documentation
Updated CLI help text to explain four-layer architecture:
- Main help shows architecture diagram with Chinese labels
- Command group descriptions reference layers:
- `workflow` → "Workflow definitions (layer 1: templates)"
- `thread` → "Thread execution (layer 2: instances)"
- `step` → "Step results (layer 3: single cycle)"
- Deprecated commands appear in help with [DEPRECATED] tag
### README Updates
Comprehensive documentation updates:
- Added "Four-Layer Architecture" section with diagram
- Updated all command tables with new command names
- Added complete migration guide with:
- Renamed commands table
- Merged commands table
- Split commands table
- Moved commands table
- Example deprecation error output
- Updated "Internal Structure" to show new step.ts module
## Testing
- ✅ All 124 tests pass
- ✅ Build completes successfully
- ✅ Deprecation handlers tested manually
- ✅ Help output verified for main, thread, and step commands
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-24 10:46:31 +00:00
xiaoju
7b50969307
refactor(cli): reorganize CLI commands into four-layer model ( #463 )
...
Implement comprehensive CLI refactoring to clarify the four-layer model:
workflow → thread → step → turn
## Breaking Changes
### Renamed Commands
- `uwf workflow put` → `uwf workflow add`
- `uwf thread step` → `uwf thread exec`
### Removed Commands
- `uwf thread running` (merged into `thread list --status running`)
- `uwf thread kill` (split into `thread stop` and `thread cancel`)
### Moved Commands
- `uwf thread steps` → `uwf step list`
- `uwf thread step-details` → `uwf step show`
- `uwf thread fork` → `uwf step fork`
## New Commands
### Thread Commands
- `uwf thread list --status <idle|running|completed>` - Filter threads by status
- `uwf thread stop <thread-id>` - Stop background execution (keep thread active)
- `uwf thread cancel <thread-id>` - Cancel thread (stop + archive to history)
### Step Command Group (New)
- `uwf step list <thread-id>` - List all steps in a thread
- `uwf step show <step-hash>` - Show step details
- `uwf step read <step-hash> [--before N]` - Read step output as markdown
- `uwf step fork <step-hash>` - Fork thread from a step
## Implementation Details
### Files Modified
- `packages/cli-workflow/src/commands/workflow.ts` - Renamed cmdWorkflowPut → cmdWorkflowAdd
- `packages/cli-workflow/src/commands/thread.ts`:
- Renamed cmdThreadStep → cmdThreadExec
- Added cmdThreadStop and cmdThreadCancel (split from cmdThreadKill)
- Updated cmdThreadList to support --status filter with idle/running/completed
- Removed cmdThreadSteps, cmdThreadStepDetails, cmdThreadFork
- `packages/cli-workflow/src/commands/step.ts` - New module with:
- cmdStepList (moved from cmdThreadSteps)
- cmdStepShow (moved from cmdThreadStepDetails)
- cmdStepFork (moved from cmdThreadFork)
- cmdStepRead (new, stub implementation pending #462 )
- `packages/cli-workflow/src/cli.ts` - Updated all CLI command registrations
### Tests Updated
- `packages/cli-workflow/src/__tests__/thread-step-count.test.ts` - Updated references from "thread step" to "thread exec"
- `packages/cli-workflow/src/__tests__/thread.test.ts` - Updated imports to use cmdStepShow from step.ts
## Test Results
All 124 tests pass in cli-workflow package.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-05-24 10:40:32 +00:00