@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,6 +1,6 @@
1
1
  ---
2
2
  name: workflow-creator
3
- description: Create multi-agent workflows for Atomic CLI using defineWorkflow().run().compile() with ctx.stage() for session orchestration across Claude, Copilot, and OpenCode SDKs, AND invoke existing workflows on behalf of the user. Use whenever the user wants to create, edit, debug, or RUN workflows ("run the ralph workflow", "kick off deep-research-codebase", "start the gen-spec workflow"), build agent pipelines, define multi-stage automations, set up review loops, declare workflow inputs, run background/headless stages, or mentions .atomic/workflows/, defineWorkflow, ctx.stage, ctx.inputs, headless, background stages, the atomic workflow picker, or `atomic workflow -n`.
3
+ description: Create multi-agent workflows for Atomic CLI using defineWorkflow().run().compile() with ctx.stage() for session orchestration across Claude, Copilot, and OpenCode SDKs, AND invoke, monitor, and tear down existing workflows on behalf of the user. Use whenever the user wants to create, edit, debug, or RUN workflows ("run the ralph workflow", "kick off deep-research-codebase", "start the gen-spec workflow"), check on a running workflow ("is it done yet?", "what's the status?", "did it error out?"), kill a workflow or session, build agent pipelines, define multi-stage automations, set up review loops, declare workflow inputs, run background/headless stages, or mentions .atomic/workflows/, defineWorkflow, ctx.stage, ctx.inputs, headless, background stages, the atomic workflow picker, `atomic workflow -n`, `atomic workflow inputs`, `atomic workflow status`, or `atomic session kill`.
4
4
  ---
5
5
 
6
6
  # Workflow Creator
@@ -208,13 +208,38 @@ Workflows that accept a free-form prompt should declare it explicitly: `{ name:
208
208
  | Named, with prompt | `atomic workflow -n hello -a claude "fix the bug"` | Scripted runs; requires the workflow to declare a `prompt` input |
209
209
  | Named, structured | `atomic workflow -n gen-spec -a claude --research_doc=notes.md` | Scripted structured runs |
210
210
  | Interactive picker | `atomic workflow -a claude` | Discovery; shows fuzzy list + form |
211
- | List | `atomic workflow -l` | Browse everything by source |
211
+ | List | `atomic workflow list` | Browse everything by source |
212
+ | Inspect inputs | `atomic workflow inputs <name> -a claude` | Print a workflow's input schema as JSON — agents use this instead of reading source |
213
+ | Status (one or all) | `atomic workflow status [<session-id>]` | Query state — `in_progress`, `error`, `completed`, `needs_review` (HIL pause). JSON by default |
214
+ | Kill non-interactively | `atomic session kill <id> -y` | Tear down a workflow/chat session without the confirmation prompt — the form agents use |
212
215
  | Detached (background) | `atomic workflow -n ralph -a claude -d "..."` | Scripted/CI runs where the caller shouldn't block on the TUI — the orchestrator keeps running on the atomic tmux socket; attach later with `atomic workflow session connect <name>` |
213
216
 
214
217
  Any of the named shapes above (positional or structured) accepts `-d` / `--detach` to run without attaching. Use it when you're automating from a script and want the CLI to return as soon as the session is spawned.
215
218
 
216
219
  **Builtin workflows are reserved** — local/global workflows cannot shadow them. Pick distinct names.
217
220
 
221
+ ### Declaring SDK compatibility (`minSDKVersion`)
222
+
223
+ Opt-in version gate for workflows that depend on a specific SDK release. **Default is unset — do not add it to new workflows unless you have a concrete reason.**
224
+
225
+ ```ts
226
+ defineWorkflow({
227
+ name: "uses-new-api",
228
+ minSDKVersion: "0.6.0", // refuse to load on older CLI
229
+ })
230
+ ```
231
+
232
+ | Behaviour | Unset (default) | Set to a version newer than the installed CLI |
233
+ |---|---|---|
234
+ | Loader | Always loads | Refuses to load, returns `IncompatibleSDKError` |
235
+ | `atomic workflow -l` | Normal row | `⚠ needs v<X> (installed v<Y>)` — dim name, visible |
236
+ | Picker | Normal row | `⚠ update required` glyph + preview explains the gap; Enter is disabled |
237
+ | `atomic workflow -n <name>` | Runs | Errors with an upgrade hint, non-zero exit |
238
+
239
+ When to set it: the workflow calls into a newly-added SDK surface (new `stage()` option, new helper export, new provider method) that older installs don't ship. Omit it for workflows that use only stable APIs — most workflows qualify.
240
+
241
+ The point of the field is to convert a silent "workflow vanished after upgrade" failure into a visible, actionable row the user can fix. See `references/discovery-and-verification.md` for semver semantics and the visible-diagnostic contract.
242
+
218
243
  ### Structural Rules
219
244
 
220
245
  Hard constraints enforced by the builder, loader, and runtime:
@@ -398,9 +423,18 @@ Once you've confirmed the workflow exists, you need to know two things about its
398
423
  1. **Does it declare a `prompt` input?** If so, it's free-form — you pass a positional string.
399
424
  2. **Does it declare structured inputs?** If so, you pass `--<field>=<value>` flags, one per required field.
400
425
 
401
- Read the workflow file at `.atomic/workflows/<name>/<agent>/index.ts` and inspect the `inputs` array. The `atomic workflow list` output is good for discovery but doesn't print the full schema for accurate field types, requireds, and enum values, read the source.
426
+ **Use `atomic workflow inputs <name> -a <agent>` to get the schema.** This prints a JSON envelope with every field's `name`, `type`, `required`, `default`, `description`, and (for enums) `values` exactly what AskUserQuestion needs. The `freeform: true` flag tells you whether the workflow takes a positional prompt vs. structured flags, with a synthetic `prompt` field included so the JSON shape is uniform either way.
427
+
428
+ ```bash
429
+ atomic workflow inputs gen-spec -a claude
430
+ # {"workflow":"gen-spec","agent":"claude","freeform":false,
431
+ # "inputs":[{"name":"research_doc","type":"string","required":true,...},
432
+ # {"name":"focus","type":"enum","values":["minimal","standard","exhaustive"],"default":"standard"}]}
433
+ ```
402
434
 
403
- Once you know the schema, use the **AskUserQuestion tool** to collect any values the user hasn't already provided in their message. One question per missing input field. For enum fields, pass the declared `values` as multiple-choice options so the user sees exactly what's allowed. Keep questions tight and purposeful if the user's message already answers a question, don't ask it again.
435
+ Why this command instead of reading the source file: `inputs` is the contract the CLI actually validates against. It survives refactors, handles built-in workflows that aren't in the project tree, and never falls out of sync with the runtime. Reading TypeScript source is a fallback for the rare case where the command can't resolve the workflow.
436
+
437
+ Once you have the schema, use the **AskUserQuestion tool** to collect any values the user hasn't already provided in their message. One question per missing input field. For enum fields, pass the declared `values` as multiple-choice options so the user sees exactly what's allowed. Keep questions tight and purposeful — if the user's message already answers a question, don't ask it again.
404
438
 
405
439
  Skip AskUserQuestion entirely when:
406
440
  - The user already supplied every required value in their message ("run ralph on 'add OAuth to the API'" — the prompt is right there).
@@ -413,13 +447,46 @@ Skip AskUserQuestion entirely when:
413
447
  - Exact match in the list → continue.
414
448
  - Close match → confirm via AskUserQuestion before proceeding.
415
449
  - No match → tell the user what's available and offer to author it (see previous section). If they decline, stop.
416
- 3. **Discover the inputs schema** — read the workflow source file and inspect `inputs`.
450
+ 3. **Discover the inputs schema** — run `atomic workflow inputs <name> -a <agent>` and parse the JSON.
417
451
  4. **Ask for missing inputs** — use AskUserQuestion, one question per unanswered required field. Enums become multiple-choice.
418
452
  5. **Invoke** — build one of these commands:
419
453
  - Free-form: `atomic workflow -n <name> "<prompt>"`
420
454
  - Structured: `atomic workflow -n <name> --<field1>=<value1> --<field2>=<value2>`
421
455
  6. **Report the session name** the CLI printed and tell the user: "attach any time with `atomic workflow session connect <session>` — or `atomic workflow session list` to see what's running."
422
456
 
457
+ ### Monitoring a running workflow
458
+
459
+ Detached workflows return immediately with a session name; the actual work runs in the background on the atomic tmux socket. Use `atomic workflow status` to check whether the workflow is still running, has completed, errored out, or paused for human input — without attaching to its TUI.
460
+
461
+ ```bash
462
+ atomic workflow status atomic-wf-claude-gen-spec-a1b2c3d4
463
+ # {"id":"atomic-wf-claude-gen-spec-a1b2c3d4","overall":"in_progress","alive":true,
464
+ # "sessions":[{"name":"orchestrator","status":"running",...}],...}
465
+ ```
466
+
467
+ Four overall states the agent must handle distinctly:
468
+
469
+ | Status | Meaning | What you should do |
470
+ |---|---|---|
471
+ | `in_progress` | The orchestrator is running and no stage is paused | Wait, or report progress to the user |
472
+ | `needs_review` | At least one stage is paused for human input (HIL) — Copilot `ask_user`, OpenCode `question.asked`, Copilot/MCP elicitation | **Surface this to the user immediately** — they need to attach with `atomic workflow session connect <id>` to respond, otherwise the workflow stalls indefinitely |
473
+ | `completed` | Workflow finished successfully | Report success and summarize the output |
474
+ | `error` | Fatal error or a stage failed | Report the `fatalError` field and offer to investigate logs |
475
+
476
+ `needs_review` outranks `completed` so a HIL pause near the end is never reported as done while still waiting on a human. A dead orchestrator with a stale snapshot is automatically downgraded to `error`.
477
+
478
+ Omit the id to list every running workflow at once: `atomic workflow status`. Useful when checking on multiple parallel runs, or when the user just asks "what's running?".
479
+
480
+ ### Cleaning up sessions
481
+
482
+ When the user is done with a workflow — or you launched one detached and it's no longer needed — tear it down with `-y` so no confirmation prompt blocks you:
483
+
484
+ ```bash
485
+ atomic session kill atomic-wf-claude-gen-spec-a1b2c3d4 -y
486
+ ```
487
+
488
+ The `-y` flag is mandatory for agent use. Without it, the CLI calls `@clack/prompts confirm`, which expects a TTY and will hang indefinitely in a non-interactive context. Same flag works for `atomic workflow session kill` and `atomic chat session kill`. Without an id, `kill -y` tears down every in-scope session — only do that when the user has asked to stop everything.
489
+
423
490
  ### Worked examples
424
491
 
425
492
  **Example A — workflow exists, structured inputs**
@@ -428,10 +495,10 @@ Skip AskUserQuestion entirely when:
428
495
 
429
496
  1. Run `atomic workflow list`. Output includes `gen-spec` under local. Good.
430
497
  2. Target resolved exactly: `gen-spec`.
431
- 3. Read the workflow source inputs are `research_doc` (required string — already given), `focus` (required enum of `minimal|standard|exhaustive`, no default), `notes` (optional text).
498
+ 3. Run `atomic workflow inputs gen-spec -a claude`. Parse the JSON: `research_doc` (required string — already given), `focus` (required enum of `minimal|standard|exhaustive`, default `standard`), `notes` (optional text).
432
499
  4. Ask via AskUserQuestion once: "What focus level for the spec?" with choices `minimal`, `standard`, `exhaustive`. User picks `standard`. Skip `notes` since it's optional.
433
500
  5. Run: `atomic workflow -n gen-spec --research_doc=research/docs/2026-04-11-auth.md --focus=standard`
434
- 6. The CLI prints a session name like `atomic-wf-claude-gen-spec-a1b2c3d4`. Tell the user: "Started in the background. Attach with `atomic workflow session connect atomic-wf-claude-gen-spec-a1b2c3d4` or check progress with `atomic workflow session list`."
501
+ 6. The CLI prints a session name like `atomic-wf-claude-gen-spec-a1b2c3d4`. Tell the user: "Started in the background. Attach with `atomic workflow session connect atomic-wf-claude-gen-spec-a1b2c3d4`, check progress with `atomic workflow status atomic-wf-claude-gen-spec-a1b2c3d4`, or stop it with `atomic session kill atomic-wf-claude-gen-spec-a1b2c3d4 -y`."
435
502
 
436
503
  **Example B — workflow does not exist**
437
504
 
@@ -448,6 +515,9 @@ Skip AskUserQuestion entirely when:
448
515
 
449
516
  - **Skipping `atomic workflow list`** — leads to guessing and `workflow not found` errors. It's a one-line command; always run it.
450
517
  - **Inventing a workflow name** — if it's not in the list, it doesn't exist. Say so and offer to author it.
518
+ - **Reading the workflow source file to discover inputs** — use `atomic workflow inputs <name> -a <agent>` instead. JSON, no TS parsing required, always in sync with the runtime. Source-file reads are a fallback, not a default.
451
519
  - **Asking everything at once** — let AskUserQuestion drive one question per field. Enum fields are multiple-choice, not free text.
452
520
  - **Re-asking what the user already said** — read their message first.
453
- - **Forgetting to report the session name** — the user needs it to reattach.
521
+ - **Forgetting to report the session name** — the user needs it to reattach and to query status later.
522
+ - **Leaving `needs_review` unreported** — when `atomic workflow status` returns `needs_review`, surface it to the user right away. The workflow is blocked on human input and will sit forever otherwise.
523
+ - **Calling `session kill` without `-y`** — the prompt hangs in a non-interactive context. Always pass `-y` from an agent.
@@ -108,6 +108,81 @@ At load time, the runtime verifies:
108
108
  - The export has `__brand === "WorkflowDefinition"`
109
109
  - The definition has a `name` and a `run` callback
110
110
 
111
+ ## SDK version compatibility
112
+
113
+ Workflows may opt in to a minimum Atomic CLI version by declaring
114
+ `minSDKVersion` on `defineWorkflow()`. The field is **optional and
115
+ unset by default** — workflows that don't declare it are treated as
116
+ compatible with every CLI release.
117
+
118
+ ```ts
119
+ export default defineWorkflow({
120
+ name: "uses-new-stage-option",
121
+ description: "...",
122
+ minSDKVersion: "0.6.0",
123
+ })
124
+ .for<"claude">()
125
+ .run(async (ctx) => { /* ... */ })
126
+ .compile();
127
+ ```
128
+
129
+ ### When to set it
130
+
131
+ Set `minSDKVersion` when the workflow uses an SDK surface that older
132
+ CLIs don't ship — for example a new `ctx.stage()` option, a newly
133
+ exported helper, or a new provider method. The version you declare is
134
+ the **earliest release you tested against**, not a future wish list.
135
+
136
+ Skip it when the workflow only touches stable APIs. Most workflows
137
+ qualify. A needlessly high `minSDKVersion` is worse than no gate —
138
+ it'll lock users out for no reason.
139
+
140
+ ### Accepted format
141
+
142
+ `MAJOR.MINOR.PATCH` with an optional numeric prerelease, matching the
143
+ shape of Atomic's own releases:
144
+
145
+ | Example | Parses | Notes |
146
+ |---|---|---|
147
+ | `"0.6.0"` | ✅ | Standard release |
148
+ | `"1.2.3"` | ✅ | Standard release |
149
+ | `"0.6.0-0"` | ✅ | Prerelease; ranks below the equivalent stable release (semver-compliant) |
150
+ | `"0.6"` | ❌ | Missing patch; treated as unparseable and ignored |
151
+ | `"latest"` | ❌ | Unparseable; ignored |
152
+
153
+ Unparseable strings are silently accepted (the workflow loads as if
154
+ `minSDKVersion` were unset) so a typo never blocks a workflow —
155
+ the visible load error path is friendlier than a hard refusal with no
156
+ context.
157
+
158
+ ### What happens when the gate trips
159
+
160
+ A workflow whose `minSDKVersion` exceeds the installed CLI is kept in
161
+ discovery but marked **incompatible** — it never silently vanishes:
162
+
163
+ | Surface | Behaviour |
164
+ |---|---|
165
+ | `WorkflowLoader.loadWorkflow()` | Returns `{ ok: false, stage: "load", error: IncompatibleSDKError }` carrying `requiredVersion` + `currentVersion` |
166
+ | `loadWorkflowsMetadata()` | Yields an entry with `status: { kind: "incompatible", requiredVersion, currentVersion, message }` |
167
+ | `atomic workflow -l` | Row is dimmed, with an inline `⚠ needs v<X> (installed v<Y>)` badge after the name |
168
+ | `atomic workflow -a <agent>` picker | Row shows a `⚠` gutter glyph; preview pane explains the version gap and remediation; Enter does not advance to the prompt phase; bottom hint dims `↵ select` to `↵ unavailable` |
169
+ | `atomic workflow -n <name> -a <agent>` | Exits non-zero, prints the `IncompatibleSDKError` message (`requires Atomic SDK v<X>, but v<Y> is installed. Update Atomic, or re-save the workflow against the current SDK.`) |
170
+
171
+ Load failures that aren't version-related (syntax error, missing
172
+ `.compile()`, invalid default export) follow the same visible-entry
173
+ contract but surface as `status: { kind: "error", stage, message }`
174
+ with a `✗ broken` badge.
175
+
176
+ ### Why this exists
177
+
178
+ The previous default was to silently drop any workflow that failed to
179
+ load. That turned the "I bumped `@bastani/atomic` and a user/global
180
+ workflow quietly stopped showing up" scenario into a ghost bug — the
181
+ user had no breadcrumb to follow. The `minSDKVersion` field lets
182
+ workflow authors opt in to a clear upgrade path, and the visible
183
+ diagnostic rows make the failure discoverable even for workflows that
184
+ never declared the field.
185
+
111
186
  ## TypeScript configuration
112
187
 
113
188
  Standard module resolution handles all imports. The project's `tsconfig.json` should use `"moduleResolution": "bundler"` (Bun's default).
@@ -4,7 +4,7 @@
4
4
  * executor interface with the React-based session graph TUI.
5
5
  */
6
6
  import { type CliRenderer } from "@opentui/core";
7
- import type { PanelSession, PanelOptions } from "./orchestrator-panel-types.ts";
7
+ import type { PanelSession, PanelOptions, SessionData } from "./orchestrator-panel-types.ts";
8
8
  export declare class OrchestratorPanel {
9
9
  private store;
10
10
  private renderer;
@@ -54,5 +54,27 @@ export declare class OrchestratorPanel {
54
54
  waitForAbort(): Promise<void>;
55
55
  /** Tear down the terminal renderer and release resources. Idempotent. */
56
56
  destroy(): void;
57
+ /**
58
+ * Subscribe to store mutations. Returned function unsubscribes.
59
+ *
60
+ * Used by the orchestrator process to mirror the in-memory panel
61
+ * state to a `status.json` file on disk so out-of-process consumers
62
+ * (e.g. `atomic workflow status`) can read the live workflow state.
63
+ */
64
+ subscribe(fn: () => void): () => void;
65
+ /**
66
+ * Read-only snapshot of the fields needed by the on-disk status
67
+ * writer. Defined here (not in PanelStore) because the store keeps
68
+ * full mutable references; this projection drops the renderer-only
69
+ * promise resolvers and version counter.
70
+ */
71
+ getSnapshot(): {
72
+ workflowName: string;
73
+ agent: string;
74
+ prompt: string;
75
+ fatalError: string | null;
76
+ completionReached: boolean;
77
+ sessions: readonly SessionData[];
78
+ };
57
79
  }
58
80
  //# sourceMappingURL=orchestrator-panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator-panel.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/orchestrator-panel.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;GAGG;AAEH,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAOpE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAIhF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO;IAsCP;;;;;OAKG;WACU,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQtE,0EAA0E;IAC1E,MAAM,CAAC,kBAAkB,CACvB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,YAAY,GACpB,iBAAiB;IAOpB;;;OAGG;IACH,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YAAY,EAAE,EACxB,MAAM,EAAE,MAAM,GACb,IAAI;IAIP,iDAAiD;IACjD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIhC,gEAAgE;IAChE,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIlC,8EAA8E;IAC9E,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjD,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxC,cAAc,CAAC,IAAI,EAAE,MAAM,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,gBAAgB,CACjB;IACP,OAAO,CAAC,gBAAgB,CAAuC;IAE/D,OAAO;IAyCP;;;;OAIG;WACU,MAAM,CACjB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,mBAAmB,CAAC;IAgB/B,0EAA0E;IAC1E,MAAM,CAAC,kBAAkB,CACvB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,0BAA0B,GAClC,mBAAmB;IAItB;;;;OAIG;IACH,gBAAgB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAIxD,8CAA8C;IAC9C,OAAO,IAAI,IAAI;IAef,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;CAMrB"}
1
+ {"version":3,"file":"workflow-picker-panel.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/workflow-picker-panel.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAEL,KAAK,WAAW,EAIjB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,yBAAyB,CAAC;AASjC,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,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1C,OAAO,CAAC,KAAK,CAAgE;gBAEjE,OAAO,EAAE,eAAe;IAIpC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,CAAC,CAAC,SAAS,SAAS,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;IAIjD;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAW5D;;;;;OAKG;IACH,OAAO,IAAI,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC;CAoCpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAC5B,KAAK,CAAC,CAAC,SAAS,SAAS,aAAa,EAAE,GAAG,SAAS,aAAa,EAAE,EAEnE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAK/C"}
@@ -19,6 +19,18 @@ export declare class InvalidWorkflowError extends Error {
19
19
  readonly path: string;
20
20
  constructor(path: string);
21
21
  }
22
+ /**
23
+ * Thrown when a workflow declares a `minSDKVersion` newer than the
24
+ * bundled CLI. Carries both versions so the CLI can render an
25
+ * actionable "update atomic or re-save the workflow" hint rather than
26
+ * a generic load error.
27
+ */
28
+ export declare class IncompatibleSDKError extends Error {
29
+ readonly path: string;
30
+ readonly requiredVersion: string;
31
+ readonly currentVersion: string;
32
+ constructor(path: string, requiredVersion: string, currentVersion: string);
33
+ }
22
34
  /** Extract a human-readable message from an unknown thrown value. */
23
35
  export declare function errorMessage(error: unknown): string;
24
36
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sdk/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qEAAqE;AACrE,qBAAa,sBAAuB,SAAQ,KAAK;aACnB,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK;gBAApC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK;CAIjE;AAED,qEAAqE;AACrE,qBAAa,wBAAyB,SAAQ,KAAK;aACrB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAUzC;AAED,8EAA8E;AAC9E,qBAAa,oBAAqB,SAAQ,KAAK;aACjB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAOzC;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sdk/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qEAAqE;AACrE,qBAAa,sBAAuB,SAAQ,KAAK;aACnB,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK;gBAApC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK;CAIjE;AAED,qEAAqE;AACrE,qBAAa,wBAAyB,SAAQ,KAAK;aACrB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAUzC;AAED,8EAA8E;AAC9E,qBAAa,oBAAqB,SAAQ,KAAK;aACjB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAOzC;AAED;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aAE3B,IAAI,EAAE,MAAM;aACZ,eAAe,EAAE,MAAM;aACvB,cAAc,EAAE,MAAM;gBAFtB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM;CAQzC;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD"}
@@ -61,29 +61,72 @@ export declare function discoverWorkflows(projectRoot?: string, agentFilter?: Ag
61
61
  * Find a specific workflow by name and agent.
62
62
  */
63
63
  export declare function findWorkflow(name: string, agent: AgentType, projectRoot?: string): Promise<DiscoveredWorkflow | null>;
64
+ /**
65
+ * Load status for a {@link WorkflowWithMetadata} entry.
66
+ *
67
+ * - `ok` — the workflow compiled cleanly and is ready to run.
68
+ * - `incompatible` — the workflow declared a `minSDKVersion` newer
69
+ * than the bundled CLI. The CLI renders it with an
70
+ * "update required" badge so users see the mismatch
71
+ * rather than a silent disappearance.
72
+ * - `error` — any other load failure (syntax error, missing
73
+ * `.compile()`, invalid default export, etc.).
74
+ * Rendered with a "failed to load" badge plus the
75
+ * underlying message.
76
+ */
77
+ export type WorkflowMetadataStatus = {
78
+ kind: "ok";
79
+ } | {
80
+ kind: "incompatible";
81
+ requiredVersion: string;
82
+ currentVersion: string;
83
+ message: string;
84
+ } | {
85
+ kind: "error";
86
+ stage: "resolve" | "validate" | "load";
87
+ message: string;
88
+ };
64
89
  /**
65
90
  * A discovered workflow enriched with the metadata the picker needs to
66
- * render it: the human description and the declared input schema.
91
+ * render it: the human description, the declared input schema, and the
92
+ * load status.
67
93
  *
68
94
  * Populated by {@link loadWorkflowsMetadata}, which runs each discovered
69
- * workflow through {@link WorkflowLoader.loadWorkflow} and extracts just
70
- * the display-relevant fields — the full compiled definition is
71
- * discarded after extraction so re-imports during execution are cheap.
95
+ * workflow through {@link WorkflowLoader.loadWorkflow} and extracts the
96
+ * display-relevant fields — the full compiled definition is discarded
97
+ * after extraction so re-imports during execution are cheap.
98
+ *
99
+ * Broken entries still materialise with empty `description` / `inputs`
100
+ * and a non-`ok` {@link status}, so the picker can render them as
101
+ * visible "update required" / "failed to load" rows instead of
102
+ * silently omitting them (the previous behaviour, which made user and
103
+ * global workflows vanish whenever the base SDK shape drifted between
104
+ * releases).
72
105
  */
73
106
  export interface WorkflowWithMetadata extends DiscoveredWorkflow {
74
- /** Workflow description, empty string when none was declared. */
107
+ /** Workflow description, empty string when none was declared or the workflow failed to load. */
75
108
  description: string;
76
- /** Picker-ready input schema; free-form workflows materialize a prompt field. */
109
+ /** Picker-ready input schema; empty for free-form or failed-to-load workflows. */
77
110
  inputs: readonly WorkflowInput[];
111
+ /** Load outcome — non-`ok` entries are rendered as visible diagnostics in the picker/list. */
112
+ status: WorkflowMetadataStatus;
78
113
  }
79
114
  /**
80
- * Load metadata (description + picker-ready inputs) for a batch of discovered workflows.
115
+ * Load metadata (description + picker-ready inputs + status) for a batch
116
+ * of discovered workflows.
117
+ *
118
+ * **Failed workflows are kept in the returned list**, not dropped. Each
119
+ * broken entry carries a {@link WorkflowMetadataStatus} explaining the
120
+ * failure so the picker and `atomic workflow -l` can surface it as an
121
+ * actionable diagnostic. This is the only way end users discover that a
122
+ * workflow from an older SDK release has gone incompatible after an
123
+ * `atomic` upgrade — silent filtering would leave them with a missing
124
+ * entry and no breadcrumb.
81
125
  *
82
- * Workflows that fail to import are **skipped silently** so one broken
83
- * entry can never prevent the picker from rendering. Callers that need
84
- * to surface load errors (e.g. `atomic workflow -n broken`) should use
85
- * {@link WorkflowLoader.loadWorkflow} directly — that path produces
86
- * structured error reports.
126
+ * Callers that want to execute a workflow should still route through
127
+ * {@link WorkflowLoader.loadWorkflow} this function throws away the
128
+ * compiled definition so re-running the loader on a confirmed pick is
129
+ * unavoidable.
87
130
  */
88
131
  export declare function loadWorkflowsMetadata(discovered: DiscoveredWorkflow[]): Promise<WorkflowWithMetadata[]>;
89
132
  //# sourceMappingURL=discovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,GAAG,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AAM;QACrB,kCAAkC;QAClC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,KAAK,IAAI,CAAC;QACzD,uDAAuD;QACvD,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;QAC/C,iCAAiC;QACjC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;KAC3F;IAMD,uCAAuC;IACvC,SAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAoB3C;IAsBD;;;OAGG;IACH,SAAsB,QAAQ,CAC5B,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAiB7C;IAMD;;;OAGG;IACH,SAAsB,IAAI,CACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyDtC;IAMD;;;;;OAKG;IACH,SAAsB,YAAY,CAChC,IAAI,EAAE,IAAI,EACV,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC,CA6B/D;CACF"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Workflow status snapshot — bridges the in-process panel state with
3
+ * out-of-process consumers (e.g. `atomic workflow status`).
4
+ *
5
+ * The orchestrator subscribes to its `PanelStore` and writes a fresh
6
+ * snapshot to `~/.atomic/sessions/<workflowRunId>/status.json` every
7
+ * time the store mutates. Consumers read that file to derive the
8
+ * overall workflow state without needing IPC into the orchestrator.
9
+ */
10
+ import type { SessionData, SessionStatus } from "../components/orchestrator-panel-types.ts";
11
+ /** File name used for the status snapshot inside each workflow's session directory. */
12
+ export declare const STATUS_FILE_NAME = "status.json";
13
+ /** High-level workflow state surfaced to the agent / CLI consumer. */
14
+ export type WorkflowOverallStatus = "in_progress" | "error" | "completed" | "needs_review";
15
+ /** Per-session entry mirrored from the orchestrator's panel store. */
16
+ export interface WorkflowStatusSession {
17
+ name: string;
18
+ status: SessionStatus;
19
+ parents: string[];
20
+ error?: string;
21
+ startedAt: number | null;
22
+ endedAt: number | null;
23
+ }
24
+ /**
25
+ * Snapshot persisted to disk for `atomic workflow status` to read.
26
+ * Schema is versioned so future readers can stay backwards-compatible.
27
+ */
28
+ export interface WorkflowStatusSnapshot {
29
+ schemaVersion: 1;
30
+ workflowRunId: string;
31
+ tmuxSession: string;
32
+ workflowName: string;
33
+ agent: string;
34
+ prompt: string;
35
+ /** Overall state derived from per-session status + completion flags. */
36
+ overall: WorkflowOverallStatus;
37
+ /** True when the orchestrator has shown its completion banner. */
38
+ completionReached: boolean;
39
+ /** Fatal-error message set via `panel.showFatalError`, if any. */
40
+ fatalError: string | null;
41
+ /** Wall-clock time of the snapshot in ISO-8601 format. */
42
+ updatedAt: string;
43
+ sessions: WorkflowStatusSession[];
44
+ }
45
+ /**
46
+ * Inputs the writer needs to render a snapshot — a strict subset of
47
+ * `PanelStore` so the writer doesn't depend on the renderer module.
48
+ */
49
+ export interface StatusWriterInputs {
50
+ workflowRunId: string;
51
+ tmuxSession: string;
52
+ workflowName: string;
53
+ agent: string;
54
+ prompt: string;
55
+ fatalError: string | null;
56
+ completionReached: boolean;
57
+ sessions: readonly SessionData[];
58
+ }
59
+ /**
60
+ * Derive the overall workflow state from per-session statuses + the
61
+ * orchestrator-level completion / fatal-error flags.
62
+ *
63
+ * Precedence (highest first):
64
+ * 1. `error` — fatal error or any session ended in error
65
+ * 2. `needs_review` — at least one session is awaiting human input (HIL)
66
+ * 3. `completed` — completion banner reached and nothing errored
67
+ * 4. `in_progress` — default
68
+ *
69
+ * `needs_review` outranks `completed` so an agent that pauses for HIL
70
+ * right at the end is never reported as done while still waiting.
71
+ */
72
+ export declare function deriveOverallStatus(input: {
73
+ sessions: readonly SessionData[];
74
+ completionReached: boolean;
75
+ fatalError: string | null;
76
+ }): WorkflowOverallStatus;
77
+ /** Build a snapshot from the writer inputs (pure — exported for tests). */
78
+ export declare function buildSnapshot(input: StatusWriterInputs, now?: () => Date): WorkflowStatusSnapshot;
79
+ /** Absolute path of the status file for a given workflow run directory. */
80
+ export declare function statusFilePath(sessionDir: string): string;
81
+ /**
82
+ * Write a snapshot to `<sessionDir>/status.json`. Uses an atomic
83
+ * write-then-rename so concurrent readers never see partial JSON.
84
+ * Errors are swallowed — the orchestrator must keep running even if
85
+ * the status file can't be persisted.
86
+ */
87
+ export declare function writeSnapshot(sessionDir: string, snapshot: WorkflowStatusSnapshot): Promise<void>;
88
+ /**
89
+ * Read a snapshot from disk. Returns `null` when the file doesn't
90
+ * exist or fails to parse — callers fall back to deriving status from
91
+ * the live tmux session list.
92
+ */
93
+ export declare function readSnapshot(sessionDir: string): Promise<WorkflowStatusSnapshot | null>;
94
+ /**
95
+ * Extract the `workflowRunId` (the trailing 8-hex segment) from a
96
+ * tmux session name shaped `atomic-wf-<agent>-<name>-<id>`. Returns
97
+ * `null` for non-workflow sessions or names that don't end in a
98
+ * UUID-style suffix.
99
+ */
100
+ export declare function workflowRunIdFromTmuxName(name: string): string | null;
101
+ //# sourceMappingURL=status-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-writer.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/status-writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE5F,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C,sEAAsE;AACtE,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,OAAO,GACP,WAAW,GACX,cAA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3B,GAAG,qBAAqB,CAQxB;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAC3B,KAAK,EAAE,kBAAkB,EACzB,GAAG,GAAE,MAAM,IAAuB,GACjC,sBAAsB,CAyBxB;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,sBAAsB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAUxC;AAeD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQrE"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Tiny semver comparator used to check a workflow's declared
3
+ * `minSDKVersion` against the bundled CLI {@link VERSION}.
4
+ *
5
+ * Accepts the subset of semver we actually ship: `MAJOR.MINOR.PATCH`
6
+ * with an optional numeric prerelease (e.g. `0.5.21`, `0.5.21-0`).
7
+ * Anything more exotic (build metadata, alpha tags) is treated as a
8
+ * plain string and compared lexicographically on the prerelease tail,
9
+ * which is good enough for "is the installed CLI new enough?".
10
+ *
11
+ * Isolated from the `semver` npm package so the workflow loader stays
12
+ * dependency-free — this check runs for every discovered workflow on
13
+ * every CLI launch.
14
+ */
15
+ /**
16
+ * Return a negative number if `a < b`, positive if `a > b`, 0 if equal.
17
+ * Unparseable inputs compare as equal so we never block a workflow over
18
+ * a typo in its `minSDKVersion` — the visible load error is friendlier
19
+ * than a hard refusal.
20
+ */
21
+ export declare function compareVersions(a: string, b: string): number;
22
+ /**
23
+ * True when the current CLI is new enough to run a workflow that
24
+ * declared `minRequired`. A null/undefined requirement always
25
+ * satisfies — workflows that don't opt in are treated as compatible.
26
+ */
27
+ export declare function satisfiesMinVersion(current: string, minRequired: string | null | undefined): boolean;
28
+ //# sourceMappingURL=version-compat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-compat.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/version-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAoBH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAe5D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAGT"}
@@ -293,6 +293,22 @@ export interface WorkflowOptions<I extends readonly WorkflowInput[] = readonly W
293
293
  * and enforce them on `ctx.inputs`.
294
294
  */
295
295
  inputs?: I;
296
+ /**
297
+ * Minimum Atomic CLI version this workflow is known to work with.
298
+ *
299
+ * When set, the CLI refuses to load the workflow on an older install
300
+ * and surfaces an actionable "update required" entry in the picker
301
+ * and `atomic workflow -l` output instead of silently dropping it.
302
+ *
303
+ * Leave unset (the default) to opt out entirely — the workflow will
304
+ * be treated as compatible with every CLI version. Use this when you
305
+ * consume a new SDK feature (new provider API, a new field on the
306
+ * stage options, etc.) that older installs can't honour.
307
+ *
308
+ * Accepts `MAJOR.MINOR.PATCH` with an optional numeric prerelease
309
+ * (`0.6.0`, `0.6.0-0`). Invalid strings are ignored.
310
+ */
311
+ minSDKVersion?: string;
296
312
  }
297
313
  /**
298
314
  * A compiled workflow definition — the sealed output of defineWorkflow().compile().
@@ -303,6 +319,11 @@ export interface WorkflowDefinition<A extends AgentType = AgentType, N extends s
303
319
  readonly description: string;
304
320
  /** Declared input schema — empty array for free-form workflows. */
305
321
  readonly inputs: readonly WorkflowInput[];
322
+ /**
323
+ * Minimum Atomic SDK version required. `null` when the workflow
324
+ * declared no requirement — treated as compatible with every CLI.
325
+ */
326
+ readonly minSDKVersion: string | null;
306
327
  /** The workflow's entry point. Called by the executor with a WorkflowContext. */
307
328
  readonly run: (ctx: WorkflowContext<A, N>) => Promise<void>;
308
329
  }