chore: cleanup dead code and update CLI docs

- Remove cmdThreadRunning dead code (CLI uses --status running now)
- Remove step read from README (command not registered)
- Update cli-reference.ts to reflect new four-layer commands

Refs #463
This commit is contained in:
2026-05-24 11:41:02 +00:00
parent 5c0eabda8e
commit f115718564
3 changed files with 21 additions and 28 deletions
+1 -3
View File
@@ -16,7 +16,7 @@ workflow → thread → step → turn
- **Workflow** (layer 1): YAML template with roles and routing graph - **Workflow** (layer 1): YAML template with roles and routing graph
- **Thread** (layer 2): Single workflow execution instance - **Thread** (layer 2): Single workflow execution instance
- **Step** (layer 3): One moderator→agent→extract cycle - **Step** (layer 3): One moderator→agent→extract cycle
- **Turn** (layer 4): Agent-internal interactions (use `step read` or CAS to inspect) - **Turn** (layer 4): Agent-internal interactions (use `step show` or CAS to inspect)
This package has no library `src/index.ts` — it is consumed as a CLI binary only. This package has no library `src/index.ts` — it is consumed as a CLI binary only.
@@ -72,7 +72,6 @@ uwf thread stop 01ARZ3NDEKTSV4RRFFQ69G5FAV
|---------|-------------| |---------|-------------|
| `uwf step list <thread-id>` | List all steps in a thread chronologically | | `uwf step list <thread-id>` | List all steps in a thread chronologically |
| `uwf step show <step-hash>` | Show step metadata and frontmatter | | `uwf step show <step-hash>` | Show step metadata and frontmatter |
| `uwf step read <step-hash> [--before N]` | Read step output as markdown |
| `uwf step fork <step-hash>` | Fork a thread from a specific step | | `uwf step fork <step-hash>` | Fork a thread from a specific step |
Examples: Examples:
@@ -80,7 +79,6 @@ Examples:
```bash ```bash
uwf step list 01ARZ3NDEKTSV4RRFFQ69G5FAV uwf step list 01ARZ3NDEKTSV4RRFFQ69G5FAV
uwf step show 32GCDE899RRQ3 uwf step show 32GCDE899RRQ3
uwf step read 32GCDE899RRQ3 --before 3
uwf step fork 32GCDE899RRQ3 uwf step fork 32GCDE899RRQ3
``` ```
+1 -12
View File
@@ -9,7 +9,6 @@ import type {
AgentConfig, AgentConfig,
CasRef, CasRef,
ModeratorContext, ModeratorContext,
RunningThreadsOutput,
StartNodePayload, StartNodePayload,
StartOutput, StartOutput,
StepContext, StepContext,
@@ -23,12 +22,7 @@ import type {
import { createProcessLogger, generateUlid, type ProcessLogger } from "@uncaged/workflow-util"; import { createProcessLogger, generateUlid, type ProcessLogger } from "@uncaged/workflow-util";
import { config as loadDotenv } from "dotenv"; import { config as loadDotenv } from "dotenv";
import { parse, stringify } from "yaml"; import { parse, stringify } from "yaml";
import { import { createMarker, deleteMarker, isThreadRunning } from "../background/index.js";
createMarker,
deleteMarker,
isThreadRunning,
listRunningThreads,
} from "../background/index.js";
import { import {
appendThreadHistory, appendThreadHistory,
createUwfStore, createUwfStore,
@@ -1016,8 +1010,3 @@ export async function cmdThreadCancel(
return { thread: threadId, cancelled: true }; return { thread: threadId, cancelled: true };
} }
export async function cmdThreadRunning(storageRoot: string): Promise<RunningThreadsOutput> {
const threads = await listRunningThreads(storageRoot);
return { threads };
}
+19 -13
View File
@@ -15,7 +15,7 @@ uwf setup --provider <name> --base-url <url> \\
## Workflow Commands ## Workflow Commands
\`\`\` \`\`\`
uwf workflow put <file> # register a workflow from YAML file uwf workflow add <file> # register a workflow from YAML file
uwf workflow show <id> # show workflow by name or CAS hash uwf workflow show <id> # show workflow by name or CAS hash
uwf workflow list # list all registered workflows uwf workflow list # list all registered workflows
\`\`\` \`\`\`
@@ -24,20 +24,27 @@ uwf workflow list # list all registered workflows
\`\`\` \`\`\`
uwf thread start <workflow> -p <prompt> # create a thread (no execution) uwf thread start <workflow> -p <prompt> # create a thread (no execution)
uwf thread step <thread-id> # execute one moderator→agent→extract cycle uwf thread exec <thread-id> # execute one moderator→agent→extract cycle
[--agent <cmd>] # override agent command [--agent <cmd>] # override agent command
[-c, --count <number>] # run multiple steps (default: 1) [-c, --count <number>] # run multiple steps (default: 1)
[--background] # run in background
uwf thread show <thread-id> # show thread head pointer uwf thread show <thread-id> # show thread head pointer
uwf thread list # list active threads uwf thread list # list threads
[--all] # include archived threads [--status <status>] # filter: idle, running, or completed
uwf thread kill <thread-id> # terminate and archive a thread
uwf thread steps <thread-id> # list all steps in a thread
uwf thread read <thread-id> # render thread context as markdown uwf thread read <thread-id> # render thread context as markdown
[--quota <chars>] # max output characters (default 32000) [--quota <chars>] # max output characters (default 32000)
[--before <step-hash>] # load steps before this hash (exclusive) [--before <step-hash>] # load steps before this hash (exclusive)
[--start] # include start step in output [--start] # include start step in output
uwf thread fork <step-hash> # fork a thread from a specific step uwf thread stop <thread-id> # stop background execution (keep thread active)
uwf thread step-details <step-hash> # dump full detail node of a step as YAML uwf thread cancel <thread-id> # cancel thread (stop + move to history)
\`\`\`
## Step Commands
\`\`\`
uwf step list <thread-id> # list all steps in a thread
uwf step show <step-hash> # show details of a specific step
uwf step fork <step-hash> # fork a thread from a specific step
\`\`\` \`\`\`
## CAS Commands ## CAS Commands
@@ -78,10 +85,9 @@ uwf -V, --version # print version
## Key Concepts ## Key Concepts
- **Workflow**: YAML definition with roles, conditions, and a routing graph; stored as a CAS node identified by its XXH64 hash. - **Workflow**: YAML definition with roles, conditions, and a routing graph; stored as a CAS node identified by its XXH64 hash.
- **Thread**: A single workflow execution (ULID). State is an immutable CAS chain; active threads are indexed in \`threads.yaml\`. - **Thread**: A running instance of a workflow; points to a chain of CAS step nodes.
- **Step**: One moderator→agent→extract cycle. Run \`uwf thread step\` repeatedly until \`$END\`. - **Step**: One moderator→agent→extract cycle; stored as a CAS node with output + detail refs.
- **CAS**: Content-Addressed Storage — all nodes are immutable and identified by hash. - **Turn**: Agent-internal interaction (within a single step); stored per-turn in the detail node.
- **Role**: Named actor with goal, capabilities, procedure, output, and frontmatter schema; the moderator routes between roles. - **CAS**: Content-addressable store; every artifact (workflows, steps, details, turns) is hashed.
- **Edge Prompt**: Required instruction on each graph edge — the moderator's dispatch message to the agent.
`; `;
} }