@bastani/atomic 0.5.20 → 0.5.21-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.agents/skills/workflow-creator/SKILL.md +78 -8
  2. package/.agents/skills/workflow-creator/references/discovery-and-verification.md +75 -0
  3. package/dist/sdk/components/orchestrator-panel.d.ts +23 -1
  4. package/dist/sdk/components/orchestrator-panel.d.ts.map +1 -1
  5. package/dist/sdk/components/workflow-picker-panel.d.ts.map +1 -1
  6. package/dist/sdk/define-workflow.d.ts.map +1 -1
  7. package/dist/sdk/errors.d.ts +12 -0
  8. package/dist/sdk/errors.d.ts.map +1 -1
  9. package/dist/sdk/runtime/discovery.d.ts +55 -12
  10. package/dist/sdk/runtime/discovery.d.ts.map +1 -1
  11. package/dist/sdk/runtime/executor.d.ts.map +1 -1
  12. package/dist/sdk/runtime/loader.d.ts.map +1 -1
  13. package/dist/sdk/runtime/status-writer.d.ts +101 -0
  14. package/dist/sdk/runtime/status-writer.d.ts.map +1 -0
  15. package/dist/sdk/runtime/version-compat.d.ts +28 -0
  16. package/dist/sdk/runtime/version-compat.d.ts.map +1 -0
  17. package/dist/sdk/types.d.ts +21 -0
  18. package/dist/sdk/types.d.ts.map +1 -1
  19. package/dist/sdk/workflows/index.d.ts +1 -1
  20. package/dist/sdk/workflows/index.d.ts.map +1 -1
  21. package/dist/version.d.ts +2 -0
  22. package/dist/version.d.ts.map +1 -0
  23. package/package.json +1 -1
  24. package/src/cli.ts +57 -3
  25. package/src/commands/cli/session.test.ts +43 -0
  26. package/src/commands/cli/session.ts +18 -8
  27. package/src/commands/cli/workflow-command.test.ts +10 -4
  28. package/src/commands/cli/workflow-inputs.test.ts +322 -0
  29. package/src/commands/cli/workflow-inputs.ts +219 -0
  30. package/src/commands/cli/workflow-status.test.ts +451 -0
  31. package/src/commands/cli/workflow-status.ts +330 -0
  32. package/src/commands/cli/workflow.test.ts +10 -3
  33. package/src/commands/cli/workflow.ts +57 -18
  34. package/src/sdk/components/orchestrator-panel.tsx +36 -1
  35. package/src/sdk/components/workflow-picker-panel.tsx +167 -18
  36. package/src/sdk/define-workflow.ts +1 -0
  37. package/src/sdk/errors.ts +20 -0
  38. package/src/sdk/runtime/discovery.ts +94 -20
  39. package/src/sdk/runtime/executor.ts +37 -0
  40. package/src/sdk/runtime/loader.ts +29 -2
  41. package/src/sdk/runtime/status-writer.test.ts +245 -0
  42. package/src/sdk/runtime/status-writer.ts +201 -0
  43. package/src/sdk/runtime/version-compat.ts +68 -0
  44. package/src/sdk/types.ts +21 -0
  45. package/src/sdk/workflows/index.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,IAAI,oBAAoB,EACtC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EACd,OAAO,IAAI,eAAe,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,4BAA4B;AAC5B,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAI1D;;;GAGG;AACH,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,wBAAwB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpE,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ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OAQG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC;IACX;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM;IAC5F,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,iFAAiF;IACjF,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D"}
@@ -17,7 +17,7 @@ export { validateOpenCodeWorkflow } from "../providers/opencode.ts";
17
17
  export type { TmuxResult, TmuxSession, SessionType } from "../runtime/tmux.ts";
18
18
  export { SOCKET_NAME, isTmuxInstalled, getMuxBinary, resetMuxBinaryCache, isInsideTmux, isInsideAtomicSocket, createSession, createWindow, createPane, sendLiteralText, sendSpecialKey, sendKeysAndSubmit, capturePane, capturePaneVisible, capturePaneScrollback, killSession, killWindow, sessionExists, listSessions, attachSession, spawnMuxAttach, switchClient, getCurrentSession, attachOrSwitch, detachAndAttachAtomic, selectWindow, setSessionEnv, getSessionEnv, parseSessionName, waitForOutput, tmuxRun, normalizeTmuxCapture, normalizeTmuxLines, paneLooksReady, paneHasActiveTask, paneIsIdle, waitForPaneReady, attemptSubmitRounds, } from "../runtime/tmux.ts";
19
19
  export { AGENTS, discoverWorkflows, findWorkflow, loadWorkflowsMetadata, WORKFLOWS_GITIGNORE, } from "../runtime/discovery.ts";
20
- export type { DiscoveredWorkflow, WorkflowWithMetadata, } from "../runtime/discovery.ts";
20
+ export type { DiscoveredWorkflow, WorkflowWithMetadata, WorkflowMetadataStatus, } from "../runtime/discovery.ts";
21
21
  export { WorkflowLoader } from "../runtime/loader.ts";
22
22
  export { executeWorkflow } from "../runtime/executor.ts";
23
23
  export type { WorkflowRunOptions } from "../runtime/executor.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,YAAY,EAAE,qBAAqB,IAAI,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,YAAY,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAG7F,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC5I,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACL,WAAW,EACX,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,e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,EACjB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION: string;
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,QAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.5.20",
3
+ "version": "0.5.21-1",
4
4
  "description": "Configuration management CLI and SDK for coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli.ts CHANGED
@@ -9,11 +9,13 @@
9
9
  * atomic chat session list List running chat/workflow sessions
10
10
  * atomic chat session connect <id> Attach to a session
11
11
  * atomic workflow list List available workflows
12
+ * atomic workflow inputs <name> -a <agent> Print a workflow's input schema (JSON)
13
+ * atomic workflow status [<id>] Query workflow status (JSON)
12
14
  * atomic workflow session list List running sessions
13
15
  * atomic workflow session connect <id> Attach to a session
14
16
  * atomic session list List all running sessions
15
17
  * atomic session connect [id] Interactive session picker
16
- * atomic session kill [id] Kill a session (or all when no id)
18
+ * atomic session kill [id] [-y] Kill a session (or all when no id); -y skips prompt
17
19
  * atomic config set <key> <value> Set configuration value
18
20
  * atomic --version Show version
19
21
  * atomic --help Show help
@@ -88,9 +90,16 @@ function addSessionSubcommand(parent: Command, scope: "chat" | "workflow" | "all
88
90
  collectAgent,
89
91
  [] as string[],
90
92
  )
93
+ .option("-y, --yes", "Skip the confirmation prompt (for non-interactive callers like agents)")
91
94
  .action(async (sessionId, localOpts) => {
92
95
  const { sessionKillCommand } = await import("./commands/cli/session.ts");
93
- const exitCode = await sessionKillCommand(sessionId, localOpts.agent, scope);
96
+ const exitCode = await sessionKillCommand(
97
+ sessionId,
98
+ localOpts.agent,
99
+ scope,
100
+ undefined,
101
+ { yes: localOpts.yes === true },
102
+ );
94
103
  process.exit(exitCode);
95
104
  });
96
105
 
@@ -220,9 +229,12 @@ Examples:
220
229
  $ atomic workflow -n gen-spec -a claude --research_doc=notes.md --focus=standard
221
230
  Run a structured-input workflow
222
231
  $ atomic workflow -n ralph -a claude -d "fix bug" Run detached in the background
232
+ $ atomic workflow inputs <name> -a claude Print a workflow's input schema (JSON)
233
+ $ atomic workflow status List status for all running workflows
234
+ $ atomic workflow status <id> Query a single workflow's status
223
235
  $ atomic workflow session list List running sessions
224
236
  $ atomic workflow session connect <id> Attach to a session
225
- $ atomic workflow session kill [id] Kill a workflow session (or all)`,
237
+ $ atomic workflow session kill [id] -y Kill a workflow session (or all), no prompt`,
226
238
  )
227
239
  .action(async (localOpts, cmd) => {
228
240
  const { workflowCommand } = await import("./commands/cli/workflow.ts");
@@ -249,6 +261,48 @@ Examples:
249
261
  process.exit(exitCode);
250
262
  });
251
263
 
264
+ // Workflow inputs subcommand: atomic workflow inputs <name> -a <agent>
265
+ // Exposes the declared input schema so an orchestrating agent can build
266
+ // a valid `atomic workflow -n ...` invocation without reading source.
267
+ workflowCmd
268
+ .command("inputs")
269
+ .description("Print a workflow's declared input schema (JSON by default)")
270
+ .argument("<name>", "Workflow name")
271
+ .requiredOption("-a, --agent <name>", `Agent backend (${agentChoices})`)
272
+ .option("--format <format>", "Output format: json | text", "json")
273
+ .action(async (name, localOpts) => {
274
+ const { workflowInputsCommand } = await import(
275
+ "./commands/cli/workflow-inputs.ts"
276
+ );
277
+ const exitCode = await workflowInputsCommand({
278
+ name,
279
+ agent: localOpts.agent,
280
+ format: localOpts.format === "text" ? "text" : "json",
281
+ });
282
+ process.exit(exitCode);
283
+ });
284
+
285
+ // Workflow status subcommand: atomic workflow status [<id>]
286
+ // Returns one of in_progress | error | completed | needs_review.
287
+ // Defaults to JSON so agents can parse it without screen-scraping.
288
+ workflowCmd
289
+ .command("status")
290
+ .description(
291
+ "Query workflow status (in_progress, error, completed, needs_review)",
292
+ )
293
+ .argument("[session_id]", "Workflow tmux session id (omit to list all)")
294
+ .option("--format <format>", "Output format: json | text", "json")
295
+ .action(async (sessionId, localOpts) => {
296
+ const { workflowStatusCommand } = await import(
297
+ "./commands/cli/workflow-status.ts"
298
+ );
299
+ const exitCode = await workflowStatusCommand({
300
+ id: sessionId,
301
+ format: localOpts.format === "text" ? "text" : "json",
302
+ });
303
+ process.exit(exitCode);
304
+ });
305
+
252
306
  // Workflow session subcommands: atomic workflow session list / connect
253
307
  addSessionSubcommand(workflowCmd, "workflow");
254
308
 
@@ -711,4 +711,47 @@ describe("sessionKillCommand", () => {
711
711
  process.stdout.write = origWrite;
712
712
  }
713
713
  });
714
+
715
+ // (l) -y on named kill: skip prompt and kill immediately
716
+ test("yes flag skips the prompt for a named kill and calls killSession", async () => {
717
+ const now = new Date().toISOString();
718
+ tmuxMocks.listSessions.mockReturnValue([
719
+ { name: "target-session", windows: 1, created: now, attached: false, type: "chat" as const },
720
+ ]);
721
+ const origWrite = process.stdout.write;
722
+ process.stdout.write = (() => true) as typeof process.stdout.write;
723
+ try {
724
+ const code = await sessionKillCommand(
725
+ "target-session",
726
+ [],
727
+ "all",
728
+ makeDeps(),
729
+ { yes: true },
730
+ );
731
+ expect(code).toBe(0);
732
+ expect(tmuxMocks.confirm).not.toHaveBeenCalled();
733
+ expect(tmuxMocks.killSession).toHaveBeenCalledWith("target-session");
734
+ } finally {
735
+ process.stdout.write = origWrite;
736
+ }
737
+ });
738
+
739
+ // (m) -y on kill-all: skip prompt and kill every in-scope session
740
+ test("yes flag skips the prompt for kill-all and kills every in-scope session", async () => {
741
+ const now = new Date().toISOString();
742
+ tmuxMocks.listSessions.mockReturnValue([
743
+ { name: "session-a", windows: 1, created: now, attached: false, type: "chat" as const, agent: "claude" },
744
+ { name: "session-b", windows: 1, created: now, attached: false, type: "workflow" as const, agent: "opencode" },
745
+ ]);
746
+ const origWrite = process.stdout.write;
747
+ process.stdout.write = (() => true) as typeof process.stdout.write;
748
+ try {
749
+ const code = await sessionKillCommand(undefined, [], "all", makeDeps(), { yes: true });
750
+ expect(code).toBe(0);
751
+ expect(tmuxMocks.confirm).not.toHaveBeenCalled();
752
+ expect(tmuxMocks.killSession).toHaveBeenCalledTimes(2);
753
+ } finally {
754
+ process.stdout.write = origWrite;
755
+ }
756
+ });
714
757
  });
@@ -277,13 +277,19 @@ export async function sessionPickerCommand(agents: string[] = [], scope: Session
277
277
  *
278
278
  * - If `sessionId` is provided: confirm and kill that one session.
279
279
  * - If `sessionId` is omitted: confirm and kill all sessions in scope.
280
+ *
281
+ * Pass `yes: true` (the `-y/--yes` flag on the CLI) to skip the
282
+ * confirmation prompt — useful for orchestrating agents that need to
283
+ * tear down a workflow session non-interactively.
280
284
  */
281
285
  export async function sessionKillCommand(
282
286
  sessionId: string | undefined,
283
287
  agents: string[] = [],
284
288
  scope: SessionScope = "all",
285
289
  deps: SessionDeps = defaultDeps,
290
+ options: { yes?: boolean } = {},
286
291
  ): Promise<number> {
292
+ const skipConfirm = options.yes === true;
287
293
  const paint = createPainter();
288
294
 
289
295
  if (!deps.isTmuxInstalled()) {
@@ -318,10 +324,12 @@ export async function sessionKillCommand(
318
324
  return 1;
319
325
  }
320
326
 
321
- const answer = await deps.confirm({
322
- message: `Kill session '${sessionId}'?`,
323
- initialValue: false,
324
- });
327
+ const answer = skipConfirm
328
+ ? true
329
+ : await deps.confirm({
330
+ message: `Kill session '${sessionId}'?`,
331
+ initialValue: false,
332
+ });
325
333
 
326
334
  if (deps.isCancel(answer)) {
327
335
  cancel("Cancelled.");
@@ -353,10 +361,12 @@ export async function sessionKillCommand(
353
361
 
354
362
  const noun = targets.length === 1 ? "session" : "sessions";
355
363
  const scopePrefix = scope === "all" ? "" : `${scope} `;
356
- const answer = await deps.confirm({
357
- message: `Kill all ${targets.length} ${scopePrefix}${noun}?`,
358
- initialValue: false,
359
- });
364
+ const answer = skipConfirm
365
+ ? true
366
+ : await deps.confirm({
367
+ message: `Kill all ${targets.length} ${scopePrefix}${noun}?`,
368
+ initialValue: false,
369
+ });
360
370
 
361
371
  if (deps.isCancel(answer)) {
362
372
  cancel("Cancelled.");
@@ -300,7 +300,11 @@ describe("workflowCommand --list", () => {
300
300
  expect(cap.stdout).not.toContain("copilot-only");
301
301
  });
302
302
 
303
- test("excludes workflows missing .compile() from the list", async () => {
303
+ test("shows workflows missing .compile() with a broken marker", async () => {
304
+ // Broken workflows used to vanish from the list silently. Surfacing
305
+ // them with a visible "✗ broken" badge is the remediation for the
306
+ // "my workflow disappeared after upgrading" class of bug reports —
307
+ // the user can now see the file still exists and needs a fix.
304
308
  await writeCompiledWorkflow({ name: "good", agent: "copilot" });
305
309
  await writeCompiledWorkflow({
306
310
  name: "not-compiled",
@@ -324,10 +328,11 @@ export default defineWorkflow({ name: "not-compiled" })
324
328
 
325
329
  expect(code).toBe(0);
326
330
  expect(cap.stdout).toContain("good");
327
- expect(cap.stdout).not.toContain("not-compiled");
331
+ expect(cap.stdout).toContain("not-compiled");
332
+ expect(cap.stdout).toContain("✗ broken");
328
333
  });
329
334
 
330
- test("excludes workflows with type errors from the list", async () => {
335
+ test("shows workflows with type errors with a broken marker", async () => {
331
336
  await writeCompiledWorkflow({ name: "valid", agent: "copilot" });
332
337
  await writeCompiledWorkflow({
333
338
  name: "broken-syntax",
@@ -345,7 +350,8 @@ export default defineWorkflow({ name: "not-compiled" })
345
350
 
346
351
  expect(code).toBe(0);
347
352
  expect(cap.stdout).toContain("valid");
348
- expect(cap.stdout).not.toContain("broken-syntax");
353
+ expect(cap.stdout).toContain("broken-syntax");
354
+ expect(cap.stdout).toContain("✗ broken");
349
355
  });
350
356
 
351
357
  test("renders the empty state when no workflows exist and no agent filter is set", async () => {
@@ -0,0 +1,322 @@
1
+ /**
2
+ * Unit tests for the workflow-inputs CLI command.
3
+ *
4
+ * Focused on the pure helpers (`buildInputsPayload` + `renderInputsText`)
5
+ * since they carry the schema-shaping logic. The thin command wrapper
6
+ * is exercised end-to-end by the existing workflow-command harness.
7
+ */
8
+
9
+ import { describe, test, expect, beforeAll, afterAll, mock } from "bun:test";
10
+ import {
11
+ buildInputsPayload,
12
+ renderInputsText,
13
+ workflowInputsCommand,
14
+ type WorkflowInputsDeps,
15
+ } from "./workflow-inputs.ts";
16
+ import type {
17
+ WorkflowInput,
18
+ DiscoveredWorkflow,
19
+ WorkflowDefinition,
20
+ } from "../../sdk/workflows/index.ts";
21
+
22
+ let originalNoColor: string | undefined;
23
+ beforeAll(() => {
24
+ originalNoColor = process.env.NO_COLOR;
25
+ process.env.NO_COLOR = "1";
26
+ });
27
+ afterAll(() => {
28
+ if (originalNoColor === undefined) delete process.env.NO_COLOR;
29
+ else process.env.NO_COLOR = originalNoColor;
30
+ });
31
+
32
+ describe("buildInputsPayload", () => {
33
+ test("synthesises a 'prompt' field for free-form workflows", () => {
34
+ const out = buildInputsPayload("ralph", "claude", "loop", []);
35
+ expect(out.freeform).toBe(true);
36
+ expect(out.inputs).toHaveLength(1);
37
+ expect(out.inputs[0]!.name).toBe("prompt");
38
+ expect(out.inputs[0]!.type).toBe("text");
39
+ });
40
+
41
+ test("clones structured inputs without mutating callers' arrays", () => {
42
+ const schema: WorkflowInput[] = [
43
+ { name: "research_doc", type: "string", required: true },
44
+ {
45
+ name: "focus",
46
+ type: "enum",
47
+ values: ["minimal", "standard"],
48
+ default: "standard",
49
+ },
50
+ ];
51
+ const out = buildInputsPayload("gen-spec", "claude", "spec", schema);
52
+ expect(out.freeform).toBe(false);
53
+ expect(out.inputs).toHaveLength(2);
54
+ expect(out.inputs[0]!.name).toBe("research_doc");
55
+ expect(out.inputs[1]!.values).toEqual(["minimal", "standard"]);
56
+ // mutating the output must not leak into the input
57
+ out.inputs[0]!.required = false;
58
+ expect(schema[0]!.required).toBe(true);
59
+ });
60
+
61
+ test("propagates description and agent into the payload", () => {
62
+ const out = buildInputsPayload("foo", "copilot", "describe me", []);
63
+ expect(out.workflow).toBe("foo");
64
+ expect(out.agent).toBe("copilot");
65
+ expect(out.description).toBe("describe me");
66
+ });
67
+ });
68
+
69
+ describe("renderInputsText", () => {
70
+ test("free-form workflows show the positional-prompt run hint", () => {
71
+ const payload = buildInputsPayload("ralph", "claude", "loop", []);
72
+ const out = renderInputsText(payload);
73
+ expect(out).toContain("ralph");
74
+ expect(out).toContain("claude");
75
+ expect(out).toContain("free-form");
76
+ expect(out).toContain('atomic workflow -n ralph -a claude "<prompt>"');
77
+ });
78
+
79
+ test("renders placeholder hint when a field declares one", () => {
80
+ const schema: WorkflowInput[] = [
81
+ {
82
+ name: "note",
83
+ type: "text",
84
+ placeholder: "short summary goes here",
85
+ },
86
+ ];
87
+ const payload = buildInputsPayload("foo", "claude", "", schema);
88
+ const out = renderInputsText(payload);
89
+ expect(out).toContain("placeholder:");
90
+ expect(out).toContain("short summary goes here");
91
+ });
92
+
93
+ test("structured workflows render flag names, types, required, defaults, and enum values", () => {
94
+ const schema: WorkflowInput[] = [
95
+ {
96
+ name: "research_doc",
97
+ type: "string",
98
+ required: true,
99
+ description: "path to research notes",
100
+ },
101
+ {
102
+ name: "focus",
103
+ type: "enum",
104
+ values: ["minimal", "standard", "exhaustive"],
105
+ default: "standard",
106
+ },
107
+ ];
108
+ const payload = buildInputsPayload("gen-spec", "claude", "spec", schema);
109
+ const out = renderInputsText(payload);
110
+
111
+ expect(out).toContain("--research_doc");
112
+ expect(out).toContain("(required)");
113
+ expect(out).toContain("[string]");
114
+ expect(out).toContain("path to research notes");
115
+
116
+ expect(out).toContain("--focus");
117
+ expect(out).toContain("[enum]");
118
+ expect(out).toContain("minimal, standard, exhaustive");
119
+ expect(out).toContain("default: standard");
120
+
121
+ // run hint references both flags
122
+ expect(out).toContain("--research_doc=<string>");
123
+ expect(out).toContain("--focus=<enum>");
124
+ });
125
+ });
126
+
127
+ // ─── workflowInputsCommand ─────────────────────────────────────────
128
+
129
+ function captureOutput(): {
130
+ stdout: () => string;
131
+ stderr: () => string;
132
+ restore: () => void;
133
+ } {
134
+ const outChunks: string[] = [];
135
+ const errChunks: string[] = [];
136
+ const origOut = process.stdout.write;
137
+ const origErr = process.stderr.write;
138
+ process.stdout.write = ((c: string | Uint8Array) => {
139
+ outChunks.push(typeof c === "string" ? c : new TextDecoder().decode(c));
140
+ return true;
141
+ }) as typeof process.stdout.write;
142
+ process.stderr.write = ((c: string | Uint8Array) => {
143
+ errChunks.push(typeof c === "string" ? c : new TextDecoder().decode(c));
144
+ return true;
145
+ }) as typeof process.stderr.write;
146
+ return {
147
+ stdout: () => outChunks.join(""),
148
+ stderr: () => errChunks.join(""),
149
+ restore: () => {
150
+ process.stdout.write = origOut;
151
+ process.stderr.write = origErr;
152
+ },
153
+ };
154
+ }
155
+
156
+ function fakeDiscovered(name: string): DiscoveredWorkflow {
157
+ return {
158
+ name,
159
+ agent: "claude",
160
+ path: `/fake/path/${name}.ts`,
161
+ source: "builtin",
162
+ };
163
+ }
164
+
165
+ function fakeDefinition(
166
+ name: string,
167
+ description: string,
168
+ inputs: WorkflowInput[],
169
+ ): WorkflowDefinition {
170
+ return {
171
+ __brand: "WorkflowDefinition",
172
+ name,
173
+ description,
174
+ inputs,
175
+ minSDKVersion: null,
176
+ run: async () => {},
177
+ } as WorkflowDefinition;
178
+ }
179
+
180
+ function makeDeps(overrides: Partial<WorkflowInputsDeps> = {}): WorkflowInputsDeps {
181
+ return {
182
+ findWorkflow: mock(async () => fakeDiscovered("gen-spec")) as unknown as
183
+ WorkflowInputsDeps["findWorkflow"],
184
+ loadWorkflow: mock(async (plan) => ({
185
+ ok: true,
186
+ value: {
187
+ ...plan,
188
+ warnings: [],
189
+ definition: fakeDefinition("gen-spec", "spec generator", [
190
+ { name: "research_doc", type: "string", required: true },
191
+ ]),
192
+ },
193
+ })) as unknown as WorkflowInputsDeps["loadWorkflow"],
194
+ ...overrides,
195
+ };
196
+ }
197
+
198
+ describe("workflowInputsCommand", () => {
199
+ test("returns 1 with a JSON error envelope on unknown agent", async () => {
200
+ const cap = captureOutput();
201
+ try {
202
+ const code = await workflowInputsCommand(
203
+ { name: "gen-spec", agent: "bogus", format: "json" },
204
+ makeDeps(),
205
+ );
206
+ expect(code).toBe(1);
207
+ const parsed = JSON.parse(cap.stdout());
208
+ expect(parsed.error).toContain("Unknown agent");
209
+ } finally {
210
+ cap.restore();
211
+ }
212
+ });
213
+
214
+ test("returns 1 with a JSON error envelope when the workflow is missing", async () => {
215
+ const deps = makeDeps({
216
+ findWorkflow: mock(async () => null) as unknown as
217
+ WorkflowInputsDeps["findWorkflow"],
218
+ });
219
+ const cap = captureOutput();
220
+ try {
221
+ const code = await workflowInputsCommand(
222
+ { name: "missing", agent: "claude", format: "json" },
223
+ deps,
224
+ );
225
+ expect(code).toBe(1);
226
+ const parsed = JSON.parse(cap.stdout());
227
+ expect(parsed.error).toContain("not found");
228
+ } finally {
229
+ cap.restore();
230
+ }
231
+ });
232
+
233
+ test("returns 1 when the loader fails to load the workflow", async () => {
234
+ const deps = makeDeps({
235
+ loadWorkflow: mock(async () => ({
236
+ ok: false,
237
+ stage: "load" as const,
238
+ error: new Error("boom"),
239
+ message: "boom",
240
+ })) as unknown as WorkflowInputsDeps["loadWorkflow"],
241
+ });
242
+ const cap = captureOutput();
243
+ try {
244
+ const code = await workflowInputsCommand(
245
+ { name: "gen-spec", agent: "claude", format: "json" },
246
+ deps,
247
+ );
248
+ expect(code).toBe(1);
249
+ const parsed = JSON.parse(cap.stdout());
250
+ expect(parsed.error).toBe("boom");
251
+ } finally {
252
+ cap.restore();
253
+ }
254
+ });
255
+
256
+ test("prints the JSON payload on success", async () => {
257
+ const cap = captureOutput();
258
+ try {
259
+ const code = await workflowInputsCommand(
260
+ { name: "gen-spec", agent: "claude", format: "json" },
261
+ makeDeps(),
262
+ );
263
+ expect(code).toBe(0);
264
+ const parsed = JSON.parse(cap.stdout());
265
+ expect(parsed.workflow).toBe("gen-spec");
266
+ expect(parsed.agent).toBe("claude");
267
+ expect(parsed.inputs).toHaveLength(1);
268
+ expect(parsed.inputs[0].name).toBe("research_doc");
269
+ } finally {
270
+ cap.restore();
271
+ }
272
+ });
273
+
274
+ test("prints the text render on success when format is 'text'", async () => {
275
+ const cap = captureOutput();
276
+ try {
277
+ const code = await workflowInputsCommand(
278
+ { name: "gen-spec", agent: "claude", format: "text" },
279
+ makeDeps(),
280
+ );
281
+ expect(code).toBe(0);
282
+ const out = cap.stdout();
283
+ expect(out).toContain("gen-spec");
284
+ expect(out).toContain("--research_doc");
285
+ } finally {
286
+ cap.restore();
287
+ }
288
+ });
289
+
290
+ test("writes errors to stderr when format is 'text'", async () => {
291
+ const deps = makeDeps({
292
+ findWorkflow: mock(async () => null) as unknown as
293
+ WorkflowInputsDeps["findWorkflow"],
294
+ });
295
+ const cap = captureOutput();
296
+ try {
297
+ const code = await workflowInputsCommand(
298
+ { name: "missing", agent: "claude", format: "text" },
299
+ deps,
300
+ );
301
+ expect(code).toBe(1);
302
+ expect(cap.stderr()).toContain("not found");
303
+ } finally {
304
+ cap.restore();
305
+ }
306
+ });
307
+
308
+ test("defaults format to 'json' when omitted", async () => {
309
+ const cap = captureOutput();
310
+ try {
311
+ const code = await workflowInputsCommand(
312
+ { name: "gen-spec", agent: "claude" },
313
+ makeDeps(),
314
+ );
315
+ expect(code).toBe(0);
316
+ // JSON parses cleanly
317
+ JSON.parse(cap.stdout());
318
+ } finally {
319
+ cap.restore();
320
+ }
321
+ });
322
+ });