diff --git a/README.md b/README.md index e1abab0..6bac153 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ uncaged-workflow run solve-issue --prompt "Fix bug #42" ## CLI Usage ```bash -uncaged-workflow help # Show all commands +uncaged-workflow # Print full command usage (exits with status 1) uncaged-workflow workflow list # List registered workflows uncaged-workflow run # Start a workflow thread uncaged-workflow thread list # List all threads @@ -56,7 +56,7 @@ uncaged-workflow thread show # Inspect a thread uncaged-workflow skill # Agent-consumable reference docs ``` -See `uncaged-workflow help` for the full command reference. +Run `uncaged-workflow` with no arguments to print usage, or `uncaged-workflow skill cli` for the full CLI skill reference. ## Development diff --git a/packages/cli-workflow/__tests__/help.test.ts b/packages/cli-workflow/__tests__/help.test.ts index a6e9aba..b5113de 100644 --- a/packages/cli-workflow/__tests__/help.test.ts +++ b/packages/cli-workflow/__tests__/help.test.ts @@ -1,21 +1,11 @@ import { describe, expect, test } from "bun:test"; import { formatCliUsage, runCli } from "../src/cli-dispatch.js"; -import { - formatSkillDoc, - formatSkillIndex, - formatSkillTopic, - getSkillTopics, -} from "../src/skill.js"; +import { formatSkillIndex, formatSkillTopic, getSkillTopics } from "../src/skill.js"; const STORAGE_ROOT = "/tmp/help-test-storage"; -describe("help command", () => { - test("help returns 0", async () => { - const code = await runCli(STORAGE_ROOT, ["help"]); - expect(code).toBe(0); - }); - - test("no args prints usage (not red) and returns 1", async () => { +describe("runCli usage", () => { + test("no args prints usage and returns 1", async () => { const code = await runCli(STORAGE_ROOT, []); expect(code).toBe(1); }); @@ -70,13 +60,6 @@ describe("--help flag on groups", () => { }); }); -describe("legacy help --skill compat", () => { - test("help --skill still works (lists topics)", async () => { - const code = await runCli(STORAGE_ROOT, ["help", "--skill"]); - expect(code).toBe(0); - }); -}); - describe("getSkillTopics", () => { test("returns all topics", () => { const topics = getSkillTopics(); @@ -128,8 +111,13 @@ describe("formatCliUsage", () => { }); }); -describe("formatSkillTopic('cli') — legacy formatSkillDoc", () => { - const doc = formatSkillDoc(); +const cliSkillDoc = formatSkillTopic("cli"); +if (cliSkillDoc === null) { + throw new Error("BUG: cli skill topic missing"); +} + +describe("formatSkillTopic('cli')", () => { + const doc = cliSkillDoc; test("contains title", () => { expect(doc).toContain("# uncaged-workflow CLI Reference"); diff --git a/packages/cli-workflow/src/cli-dispatch.ts b/packages/cli-workflow/src/cli-dispatch.ts index 2306cfb..84778d7 100644 --- a/packages/cli-workflow/src/cli-dispatch.ts +++ b/packages/cli-workflow/src/cli-dispatch.ts @@ -1,29 +1,11 @@ import type { CommandEntry, DispatchFn } from "./cli-command-types.js"; -import { printCliError, printCliLine, printCliWarn } from "./cli-output.js"; +import { printCliError, printCliLine } from "./cli-output.js"; import { getCommandRegistry } from "./cli-registry.js"; import { formatCliUsage as formatCliUsageWithGroups } from "./cli-usage.js"; -import { createCasDispatcher, dispatchGc } from "./commands/cas/index.js"; +import { createCasDispatcher } from "./commands/cas/index.js"; import { createInitDispatcher } from "./commands/init/index.js"; -import { - createThreadDispatcher, - dispatchFork, - dispatchKill, - dispatchLive, - dispatchPause, - dispatchPs, - dispatchResume, - dispatchRun, - dispatchThreadList, -} from "./commands/thread/index.js"; -import { - createWorkflowDispatcher, - dispatchAdd, - dispatchHistory, - dispatchList, - dispatchRemove, - dispatchRollback, - dispatchShow, -} from "./commands/workflow/index.js"; +import { createThreadDispatcher, dispatchLive, dispatchRun } from "./commands/thread/index.js"; +import { createWorkflowDispatcher } from "./commands/workflow/index.js"; import { formatSkillIndex, formatSkillTopic, getSkillTopics } from "./skill.js"; export type { CommandEntry, CommandGroup, DispatchFn } from "./cli-command-types.js"; @@ -54,15 +36,11 @@ function dispatchGroup( return entry.handler(storageRoot, argv.slice(1)); } -function printDeprecation(oldCmd: string, newCmd: string): void { - printCliWarn(`⚠ "${oldCmd}" is deprecated, use "${newCmd}" instead`); -} - export function formatCliUsage(): string { return formatCliUsageWithGroups(getCommandRegistry(), getSkillTopics()); } -const dispatchWorkflow = createWorkflowDispatcher({ dispatchGroup, printDeprecation }); +const dispatchWorkflow = createWorkflowDispatcher({ dispatchGroup }); const dispatchThread = createThreadDispatcher({ dispatchGroup }); const dispatchCas = createCasDispatcher({ dispatchGroup }); const dispatchInit = createInitDispatcher({ dispatchGroup }); @@ -85,43 +63,16 @@ async function dispatchSkill(_storageRoot: string, argv: string[]): Promise { - printCliWarn('⚠ "help" is deprecated, use "skill" instead'); - const skillIdx = argv.indexOf("--skill"); - if (skillIdx !== -1) { - return showSkillDocOrIndex(argv[skillIdx + 1]); - } - printCliLine(formatCliUsage()); - return 0; -} - const COMMAND_TABLE: Record = { workflow: dispatchWorkflow, thread: dispatchThread, cas: dispatchCas, init: dispatchInit, - help: dispatchHelp, skill: dispatchSkill, run: dispatchRun, live: dispatchLive, }; -const DEPRECATED_ALIASES: Record = { - add: { newCmd: "workflow add", handler: dispatchAdd }, - list: { newCmd: "workflow list", handler: dispatchList }, - show: { newCmd: "workflow show", handler: dispatchShow }, - remove: { newCmd: "workflow rm", handler: dispatchRemove }, - ps: { newCmd: "thread ps", handler: dispatchPs }, - kill: { newCmd: "thread kill", handler: dispatchKill }, - pause: { newCmd: "thread pause", handler: dispatchPause }, - resume: { newCmd: "thread resume", handler: dispatchResume }, - threads: { newCmd: "thread list", handler: dispatchThreadList }, - fork: { newCmd: "thread fork", handler: dispatchFork }, - gc: { newCmd: "cas gc", handler: dispatchGc }, - history: { newCmd: "workflow history", handler: dispatchHistory }, - rollback: { newCmd: "workflow rollback", handler: dispatchRollback }, -}; - export async function runCli(storageRoot: string, argv: string[]): Promise { if (argv.length === 0) { printCliLine(formatCliUsage()); @@ -139,12 +90,6 @@ export async function runCli(storageRoot: string, argv: string[]): Promise = { }; export function createWorkflowDispatcher(deps: WorkflowDispatchDeps) { - const { dispatchGroup, printDeprecation } = deps; + const { dispatchGroup } = deps; return async function dispatchWorkflow(storageRoot: string, argv: string[]): Promise { const result = dispatchGroup("workflow", WORKFLOW_SUBCOMMAND_TABLE, storageRoot, argv); if (result !== null) { @@ -150,7 +150,6 @@ export function createWorkflowDispatcher(deps: WorkflowDispatchDeps) { } const sub = argv[0]; if (sub === "remove") { - printDeprecation("workflow remove", "workflow rm"); return dispatchRemove(storageRoot, argv.slice(1)); } printCliError(`${usageText()}\n\nerror: unknown workflow subcommand: ${sub}`); diff --git a/packages/cli-workflow/src/commands/workflow/types.ts b/packages/cli-workflow/src/commands/workflow/types.ts index b1448ba..cbc678d 100644 --- a/packages/cli-workflow/src/commands/workflow/types.ts +++ b/packages/cli-workflow/src/commands/workflow/types.ts @@ -14,5 +14,4 @@ export type CmdAddSuccess = { export type WorkflowDispatchDeps = { dispatchGroup: DispatchGroupFn; - printDeprecation: (oldCmd: string, newCmd: string) => void; }; diff --git a/packages/cli-workflow/src/skill.ts b/packages/cli-workflow/src/skill.ts index ac70c92..e6222bd 100644 --- a/packages/cli-workflow/src/skill.ts +++ b/packages/cli-workflow/src/skill.ts @@ -229,10 +229,3 @@ uncaged-workflow live --latest Bundles are immutable and identified by XXH64 hash. Re-registering a workflow with a new bundle creates a new version. Use \`workflow history\` and \`workflow rollback\` to manage versions. `; } - -// ── Legacy compat ────────────────────────────────────────────────────── - -/** @deprecated Use formatSkillTopic("cli") instead */ -export function formatSkillDoc(): string { - return formatSkillCli(); -} diff --git a/packages/workflow-template-develop/src/roles/coder.ts b/packages/workflow-template-develop/src/roles/coder.ts index 1cce9be..89b0786 100644 --- a/packages/workflow-template-develop/src/roles/coder.ts +++ b/packages/workflow-template-develop/src/roles/coder.ts @@ -15,7 +15,7 @@ Run \`uncaged-workflow skill develop\` for thread ID lookup, CAS commands, and m ## Reading phase details -Each planner phase has a content-hash and title. Read full details with \`uncaged-workflow cas get \`. +Each planner phase has a content-hash and title. Read full details with \`uncaged-workflow cas get \`. The thread ID (26-char Crockford Base32) appears in the first message. If unsure, run \`uncaged-workflow thread list\`. diff --git a/packages/workflow-template-develop/src/roles/planner.ts b/packages/workflow-template-develop/src/roles/planner.ts index cc311cd..63b3a75 100644 --- a/packages/workflow-template-develop/src/roles/planner.ts +++ b/packages/workflow-template-develop/src/roles/planner.ts @@ -18,7 +18,7 @@ Run \`uncaged-workflow skill develop\` for thread ID lookup, CAS commands, and m ## Storing phase details — MANDATORY -For each phase, store its full detail text in CAS via \`uncaged-workflow cas put ''\`. The command prints a content-hash — use that as the phase identifier. +For each phase, store its full detail text in CAS via \`uncaged-workflow cas put ''\`. The command prints a content-hash — use that as the phase identifier. The thread ID (26-char Crockford Base32) appears in the first message. If unsure, run \`uncaged-workflow thread list\`. diff --git a/packages/workflow/README.md b/packages/workflow/README.md index 517b0a8..fe84528 100644 --- a/packages/workflow/README.md +++ b/packages/workflow/README.md @@ -27,7 +27,7 @@ import { createWorkflow, readWorkflowRegistry, executeThread } from "@uncaged/wo | **Types** | `WorkflowDefinition`, `WorkflowFn`, `AgentFn`, `AgentBinding`, `Moderator`, `RoleDefinition`, `ThreadContext`, `LlmProvider`, `Result` shape via `ok` / `err`, `START` / `END` | | **Bundle** | `buildDescriptor`, `extractBundleExports`, `validateWorkflowBundle`, `validateWorkflowDescriptor`, `WorkflowDescriptor`, `WorkflowRoleDescriptor` | | **Registry** | `readWorkflowRegistry`, `writeWorkflowRegistry`, `registerWorkflowVersion`, `workflowRegistryPath`, YAML helpers | -| **CAS** | `createCasStore`, `createThreadCas`, Merkle helpers (`putStepMerkleNode`, `getContentMerklePayload`, …), `hashWorkflowBundleBytes` | +| **CAS** | `createCasStore`, Merkle helpers (`putStepMerkleNode`, `getContentMerklePayload`, …), `hashWorkflowBundleBytes` | | **Engine** | `createWorkflow`, `executeThread`, `parseThreadDataJsonl`, fork helpers, `garbageCollectCas` | | **Extract / LLM tools** | `llmExtract`, `reactExtract`, `createExtract`, `getExtractProvider` | | **Agent bridge** | `workflowAsAgent` — expose a registered workflow as an agent-backed role | diff --git a/packages/workflow/__tests__/cas.test.ts b/packages/workflow/__tests__/cas.test.ts index e18c30f..99d77cb 100644 --- a/packages/workflow/__tests__/cas.test.ts +++ b/packages/workflow/__tests__/cas.test.ts @@ -3,15 +3,9 @@ import { mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { createCasStore, createThreadCas } from "../src/cas/cas.js"; +import { createCasStore } from "../src/cas/cas.js"; import { hashString } from "../src/cas/hash.js"; -describe("cas module exports", () => { - test("createThreadCas is a deprecated alias of createCasStore", () => { - expect(createThreadCas).toBe(createCasStore); - }); -}); - describe("createCasStore", () => { let casDir: string; diff --git a/packages/workflow/src/cas/cas.ts b/packages/workflow/src/cas/cas.ts index 32df91d..e5502f5 100644 --- a/packages/workflow/src/cas/cas.ts +++ b/packages/workflow/src/cas/cas.ts @@ -62,6 +62,3 @@ export function createCasStore(casDir: string): CasStore { }, }; } - -/** @deprecated Use {@link createCasStore} — CAS is global, not per-thread. */ -export const createThreadCas = createCasStore; diff --git a/packages/workflow/src/cas/index.ts b/packages/workflow/src/cas/index.ts index 532efb1..68aa997 100644 --- a/packages/workflow/src/cas/index.ts +++ b/packages/workflow/src/cas/index.ts @@ -1,4 +1,4 @@ -export { createCasStore, createThreadCas } from "./cas.js"; +export { createCasStore } from "./cas.js"; export { hashString, hashWorkflowBundleBytes } from "./hash.js"; export { createContentMerkleNode, diff --git a/packages/workflow/src/index.ts b/packages/workflow/src/index.ts index 617ba9e..2844fe9 100644 --- a/packages/workflow/src/index.ts +++ b/packages/workflow/src/index.ts @@ -14,7 +14,6 @@ export { type CasStore, createCasStore, createContentMerkleNode, - createThreadCas, getContentMerklePayload, hashString, hashWorkflowBundleBytes,