@bastani/atomic 0.6.5 → 0.6.6-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 (148) hide show
  1. package/.agents/skills/ado-commit/SKILL.md +2 -0
  2. package/.agents/skills/ado-create-pr/SKILL.md +2 -0
  3. package/.agents/skills/advanced-evaluation/SKILL.md +2 -0
  4. package/.agents/skills/ast-grep/SKILL.md +2 -0
  5. package/.agents/skills/bdi-mental-states/SKILL.md +2 -0
  6. package/.agents/skills/bun/SKILL.md +156 -122
  7. package/.agents/skills/context-compression/SKILL.md +2 -0
  8. package/.agents/skills/context-degradation/SKILL.md +2 -0
  9. package/.agents/skills/context-fundamentals/SKILL.md +2 -0
  10. package/.agents/skills/context-optimization/SKILL.md +2 -0
  11. package/.agents/skills/create-spec/SKILL.md +2 -0
  12. package/.agents/skills/docx/SKILL.md +2 -0
  13. package/.agents/skills/evaluation/SKILL.md +2 -0
  14. package/.agents/skills/explain-code/SKILL.md +2 -0
  15. package/.agents/skills/filesystem-context/SKILL.md +2 -0
  16. package/.agents/skills/find-skills/SKILL.md +2 -0
  17. package/.agents/skills/gh-commit/SKILL.md +2 -0
  18. package/.agents/skills/gh-create-pr/SKILL.md +2 -0
  19. package/.agents/skills/hosted-agents/SKILL.md +2 -0
  20. package/.agents/skills/impeccable/SKILL.md +117 -304
  21. package/.agents/skills/impeccable/agents/openai.yaml +4 -0
  22. package/.agents/skills/{adapt/SKILL.md → impeccable/reference/adapt.md} +2 -11
  23. package/.agents/skills/{animate/SKILL.md → impeccable/reference/animate.md} +15 -15
  24. package/.agents/skills/{audit/SKILL.md → impeccable/reference/audit.md} +8 -22
  25. package/.agents/skills/{bolder/SKILL.md → impeccable/reference/bolder.md} +9 -13
  26. package/.agents/skills/impeccable/reference/brand.md +114 -0
  27. package/.agents/skills/{clarify/SKILL.md → impeccable/reference/clarify.md} +2 -11
  28. package/.agents/skills/{colorize/SKILL.md → impeccable/reference/colorize.md} +23 -12
  29. package/.agents/skills/impeccable/reference/craft.md +152 -29
  30. package/.agents/skills/{critique/SKILL.md → impeccable/reference/critique.md} +25 -37
  31. package/.agents/skills/{delight/SKILL.md → impeccable/reference/delight.md} +9 -11
  32. package/.agents/skills/{distill/SKILL.md → impeccable/reference/distill.md} +2 -13
  33. package/.agents/skills/impeccable/reference/document.md +427 -0
  34. package/.agents/skills/impeccable/reference/extract.md +1 -1
  35. package/.agents/skills/{harden/SKILL.md → impeccable/reference/harden.md} +1 -43
  36. package/.agents/skills/{layout/SKILL.md → impeccable/reference/layout.md} +27 -11
  37. package/.agents/skills/impeccable/reference/live.md +594 -0
  38. package/.agents/skills/impeccable/reference/motion-design.md +12 -2
  39. package/.agents/skills/impeccable/reference/onboard.md +234 -0
  40. package/.agents/skills/{optimize/SKILL.md → impeccable/reference/optimize.md} +4 -12
  41. package/.agents/skills/{overdrive/SKILL.md → impeccable/reference/overdrive.md} +9 -21
  42. package/.agents/skills/{critique → impeccable}/reference/personas.md +1 -1
  43. package/.agents/skills/{polish/SKILL.md → impeccable/reference/polish.md} +31 -23
  44. package/.agents/skills/impeccable/reference/product.md +62 -0
  45. package/.agents/skills/{quieter/SKILL.md → impeccable/reference/quieter.md} +7 -11
  46. package/.agents/skills/impeccable/reference/shape.md +151 -0
  47. package/.agents/skills/impeccable/reference/teach.md +156 -0
  48. package/.agents/skills/{typeset/SKILL.md → impeccable/reference/typeset.md} +19 -11
  49. package/.agents/skills/impeccable/reference/typography.md +31 -14
  50. package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +87 -17
  51. package/.agents/skills/impeccable/scripts/command-metadata.json +94 -0
  52. package/.agents/skills/impeccable/scripts/design-parser.mjs +820 -0
  53. package/.agents/skills/impeccable/scripts/detect-csp.mjs +198 -0
  54. package/.agents/skills/impeccable/scripts/is-generated.mjs +69 -0
  55. package/.agents/skills/impeccable/scripts/live-accept.mjs +595 -0
  56. package/.agents/skills/impeccable/scripts/live-browser.js +4781 -0
  57. package/.agents/skills/impeccable/scripts/live-inject.mjs +445 -0
  58. package/.agents/skills/impeccable/scripts/live-poll.mjs +186 -0
  59. package/.agents/skills/impeccable/scripts/live-server.mjs +694 -0
  60. package/.agents/skills/impeccable/scripts/live-wrap.mjs +571 -0
  61. package/.agents/skills/impeccable/scripts/live.mjs +247 -0
  62. package/.agents/skills/impeccable/scripts/load-context.mjs +141 -0
  63. package/.agents/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  64. package/.agents/skills/impeccable/scripts/pin.mjs +214 -0
  65. package/.agents/skills/init/SKILL.md +2 -0
  66. package/.agents/skills/liteparse/SKILL.md +1 -0
  67. package/.agents/skills/memory-systems/SKILL.md +2 -0
  68. package/.agents/skills/multi-agent-patterns/SKILL.md +2 -0
  69. package/.agents/skills/opentui/SKILL.md +1 -0
  70. package/.agents/skills/pdf/SKILL.md +2 -0
  71. package/.agents/skills/playwright-cli/SKILL.md +51 -5
  72. package/.agents/skills/playwright-cli/references/playwright-tests.md +1 -1
  73. package/.agents/skills/playwright-cli/references/running-code.md +10 -0
  74. package/.agents/skills/playwright-cli/references/session-management.md +56 -0
  75. package/.agents/skills/playwright-cli/references/spec-driven-testing.md +305 -0
  76. package/.agents/skills/playwright-cli/references/test-generation.md +49 -3
  77. package/.agents/skills/pptx/SKILL.md +2 -0
  78. package/.agents/skills/project-development/SKILL.md +2 -0
  79. package/.agents/skills/prompt-engineer/SKILL.md +2 -0
  80. package/.agents/skills/research-codebase/SKILL.md +2 -0
  81. package/.agents/skills/ripgrep/SKILL.md +2 -0
  82. package/.agents/skills/skill-creator/LICENSE.txt +1 -1
  83. package/.agents/skills/skill-creator/SKILL.md +2 -0
  84. package/.agents/skills/sl-commit/SKILL.md +2 -0
  85. package/.agents/skills/sl-submit-diff/SKILL.md +2 -0
  86. package/.agents/skills/tdd/SKILL.md +4 -0
  87. package/.agents/skills/tool-design/SKILL.md +2 -0
  88. package/.agents/skills/typescript-advanced-types/SKILL.md +2 -1
  89. package/.agents/skills/typescript-expert/SKILL.md +7 -1
  90. package/.agents/skills/typescript-react-reviewer/SKILL.md +2 -1
  91. package/.agents/skills/workflow-creator/SKILL.md +75 -72
  92. package/.agents/skills/workflow-creator/references/session-config.md +48 -1
  93. package/.agents/skills/xlsx/SKILL.md +2 -0
  94. package/.opencode/opencode.json +6 -2
  95. package/README.md +39 -38
  96. package/dist/lib/atomic-temp.d.ts +8 -0
  97. package/dist/lib/atomic-temp.d.ts.map +1 -0
  98. package/dist/lib/terminal-env.d.ts +9 -0
  99. package/dist/lib/terminal-env.d.ts.map +1 -0
  100. package/dist/sdk/providers/claude.d.ts.map +1 -1
  101. package/dist/sdk/providers/copilot.d.ts +24 -14
  102. package/dist/sdk/providers/copilot.d.ts.map +1 -1
  103. package/dist/sdk/runtime/executor.d.ts +8 -0
  104. package/dist/sdk/runtime/executor.d.ts.map +1 -1
  105. package/dist/sdk/runtime/port-discovery.d.ts +71 -0
  106. package/dist/sdk/runtime/port-discovery.d.ts.map +1 -0
  107. package/dist/sdk/runtime/tmux.d.ts +10 -0
  108. package/dist/sdk/runtime/tmux.d.ts.map +1 -1
  109. package/dist/sdk/types.d.ts +1 -0
  110. package/dist/sdk/types.d.ts.map +1 -1
  111. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -1
  112. package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +1 -1
  113. package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +1 -1
  114. package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +1 -1
  115. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +15 -0
  116. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +1 -1
  117. package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +1 -1
  118. package/package.json +10 -10
  119. package/src/commands/cli/chat/index.test.ts +194 -2
  120. package/src/commands/cli/chat/index.ts +83 -28
  121. package/src/lib/atomic-temp.test.ts +86 -0
  122. package/src/lib/atomic-temp.ts +62 -0
  123. package/src/lib/terminal-env.test.ts +343 -0
  124. package/src/lib/terminal-env.ts +100 -0
  125. package/src/scripts/clean-dist.test.ts +53 -0
  126. package/src/scripts/clean-dist.ts +37 -0
  127. package/src/sdk/providers/claude.ts +42 -20
  128. package/src/sdk/providers/copilot.test.ts +365 -0
  129. package/src/sdk/providers/copilot.ts +117 -15
  130. package/src/sdk/runtime/cc-debounce.ts +2 -2
  131. package/src/sdk/runtime/executor.test.ts +322 -1
  132. package/src/sdk/runtime/executor.ts +159 -96
  133. package/src/sdk/runtime/port-discovery.test.ts +573 -0
  134. package/src/sdk/runtime/port-discovery.ts +496 -0
  135. package/src/sdk/runtime/tmux.ts +22 -2
  136. package/src/sdk/types.ts +1 -0
  137. package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +24 -6
  138. package/src/sdk/workflows/builtin/open-claude-design/opencode/index.ts +52 -13
  139. package/src/sdk/workflows/builtin/ralph/claude/index.ts +31 -3
  140. package/src/sdk/workflows/builtin/ralph/copilot/index.ts +16 -0
  141. package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +70 -3
  142. package/src/sdk/workflows/builtin/ralph/opencode/index.ts +50 -6
  143. package/src/services/system/auth.test.ts +53 -0
  144. package/src/services/system/auth.ts +31 -28
  145. package/src/services/system/detect.ts +1 -1
  146. package/.agents/skills/shape/SKILL.md +0 -96
  147. /package/.agents/skills/{critique → impeccable}/reference/cognitive-load.md +0 -0
  148. /package/.agents/skills/{critique → impeccable}/reference/heuristics-scoring.md +0 -0
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: workflow-creator
3
3
  description: Create AND run Atomic CLI workflows (`defineWorkflow().run().compile()` with `ctx.stage()`) across Claude, Copilot, and OpenCode SDKs. Use for **authoring** when the user wants to build, edit, debug, or design agent pipelines — multi-stage automations, review/fix loops, parallel fan-out, headless/background stages, `defineWorkflow`, `ctx.stage`, `ctx.inputs`, declared `WorkflowInput` schemas, `runWorkflow`, `createRegistry`, `listWorkflows`, the SDK's metadata accessors (`getName`, `getInputSchema`, `getAgent`), `validateInputs`, the interactive workflow picker (`WorkflowPicker` from `@bastani/atomic/workflows/components`), single or multi-workflow composition roots. Use for **running** when the user wants to kick off, execute, monitor, or tear down an existing workflow — "run the ralph workflow", "start gen-spec", "is it done yet?", "what's the status?", "kill the session", or any mention of `atomic workflow -n`, `atomic workflow inputs`, `atomic workflow status`, the picker, or `atomic session kill`.
4
+ metadata:
5
+ provider: atomic
4
6
  ---
5
7
 
6
8
  # Workflow Creator
@@ -18,20 +20,20 @@ Two user journeys live in this skill:
18
20
 
19
21
  Load references on demand. **Only `getting-started.md` is always-load.** Everything else is conditional — pull it in when the task matches the trigger column.
20
22
 
21
- | File | Load when |
22
- |---|---|
23
- | `getting-started.md` | **Always** — quick-start examples for all 3 SDKs, SDK exports, `SessionContext` field reference |
24
- | `agent-setup-recipe.md` | When the user is starting from zero (empty terminal, no project, "set me up", "how do I get started"). Deterministic env-detect → install → scaffold → smoke-test playbook with typed-error recovery hints |
25
- | `failure-modes.md` | Before shipping any multi-session workflow. 16 catalogued failures (silent + loud) with wrong-vs-right patterns and a pre-ship design checklist |
26
- | `workflow-inputs.md` | When declaring structured inputs or documenting how a workflow is invoked — `WorkflowInput` schema, field-type selection, picker + CLI flag semantics, builtin-protection rules |
27
- | `agent-sessions.md` | When writing SDK calls — `s.session.query()` (Claude), `s.session.send()` (Copilot), `s.client.session.prompt()` (OpenCode); includes session-lifecycle pitfalls and when to use `sendAndWait` with explicit timeouts |
28
- | `control-flow.md` | When using loops, conditionals, parallel execution (`Promise.all`), headless fan-out, or review/fix patterns |
29
- | `state-and-data-flow.md` | When passing data between sessions — `s.save()`, `s.transcript()`, `s.getMessages()`, file persistence, transcript compression |
30
- | `running-workflows.md` | When the user asks you to **run** an existing workflow rather than author one |
31
- | `computation-and-validation.md` | When adding deterministic computation, response parsing, validation, quality gates, or file I/O |
32
- | `session-config.md` | When configuring model, tools, permissions, hooks, or structured output per SDK |
33
- | `user-input.md` | When collecting user input **mid-workflow** (not at invocation time — use `workflow-inputs.md` for that) |
34
- | `registry-and-validation.md` | When setting up `createRegistry()` and iterating it via `listWorkflows`, understanding key scheme, validate-on-register rules, and same-name collision detection (only relevant for the multi-workflow cli) |
23
+ | File | Load when |
24
+ | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `getting-started.md` | **Always** — quick-start examples for all 3 SDKs, SDK exports, `SessionContext` field reference |
26
+ | `agent-setup-recipe.md` | When the user is starting from zero (empty terminal, no project, "set me up", "how do I get started"). Deterministic env-detect → install → scaffold → smoke-test playbook with typed-error recovery hints |
27
+ | `failure-modes.md` | Before shipping any multi-session workflow. 16 catalogued failures (silent + loud) with wrong-vs-right patterns and a pre-ship design checklist |
28
+ | `workflow-inputs.md` | When declaring structured inputs or documenting how a workflow is invoked — `WorkflowInput` schema, field-type selection, picker + CLI flag semantics, builtin-protection rules |
29
+ | `agent-sessions.md` | When writing SDK calls — `s.session.query()` (Claude), `s.session.send()` (Copilot), `s.client.session.prompt()` (OpenCode); includes session-lifecycle pitfalls and when to use `sendAndWait` with explicit timeouts |
30
+ | `control-flow.md` | When using loops, conditionals, parallel execution (`Promise.all`), headless fan-out, or review/fix patterns |
31
+ | `state-and-data-flow.md` | When passing data between sessions — `s.save()`, `s.transcript()`, `s.getMessages()`, file persistence, transcript compression |
32
+ | `running-workflows.md` | When the user asks you to **run** an existing workflow rather than author one |
33
+ | `computation-and-validation.md` | When adding deterministic computation, response parsing, validation, quality gates, or file I/O |
34
+ | `session-config.md` | When configuring model, tools, permissions, hooks, or structured output per SDK |
35
+ | `user-input.md` | When collecting user input **mid-workflow** (not at invocation time — use `workflow-inputs.md` for that) |
36
+ | `registry-and-validation.md` | When setting up `createRegistry()` and iterating it via `listWorkflows`, understanding key scheme, validate-on-register rules, and same-name collision detection (only relevant for the multi-workflow cli) |
35
37
 
36
38
  ## Scaffold a new workflow from scratch
37
39
 
@@ -102,22 +104,22 @@ budgets). Use `prompt-engineer` to improve individual session prompts —
102
104
  clarity, XML structure, few-shot examples, chain-of-thought — and the
103
105
  context engineering skills below to design information flow between sessions.
104
106
 
105
- | Design Concern | Skill | Trigger |
106
- |---|---|---|
107
- | Prompt clarity and structure | `prompt-engineer` | Every workflow — clear instructions, XML tags, examples, chain-of-thought |
108
- | Session prompt structure | `context-fundamentals` | Every workflow — token budgeting, prompt positioning, progressive disclosure |
109
- | Context failure prevention | `context-degradation` | Long conversations, accumulated state, multi-turn loops |
110
- | Transcript compression | `context-compression` | Passing large transcripts between sessions |
111
- | Multi-session architecture | `multi-agent-patterns` | Coordination topology, handoff protocols, error propagation |
112
- | Cross-run persistence | `memory-systems` | Retaining knowledge across separate executions |
113
- | Custom tools and capabilities | `tool-design` | Sessions exposing custom tools |
114
- | File-based coordination | `filesystem-context` | Sessions sharing state via files |
115
- | Remote execution | `hosted-agents` | Sandboxed or remote environments |
116
- | Token efficiency | `context-optimization` | Compaction triggers, observation masking, cache-friendly ordering |
117
- | Quality gates | `evaluation` | Review loops or quality checkpoints |
118
- | LLM-as-judge review | `advanced-evaluation` | Automated review sessions judging other sessions' output |
119
- | Task-model fit | `project-development` | Validating whether a task is viable for agent automation |
120
- | Deliberative reasoning | `bdi-mental-states` | Explainable reasoning chains or formal cognitive models |
107
+ | Design Concern | Skill | Trigger |
108
+ | ----------------------------- | ---------------------- | ---------------------------------------------------------------------------- |
109
+ | Prompt clarity and structure | `prompt-engineer` | Every workflow — clear instructions, XML tags, examples, chain-of-thought |
110
+ | Session prompt structure | `context-fundamentals` | Every workflow — token budgeting, prompt positioning, progressive disclosure |
111
+ | Context failure prevention | `context-degradation` | Long conversations, accumulated state, multi-turn loops |
112
+ | Transcript compression | `context-compression` | Passing large transcripts between sessions |
113
+ | Multi-session architecture | `multi-agent-patterns` | Coordination topology, handoff protocols, error propagation |
114
+ | Cross-run persistence | `memory-systems` | Retaining knowledge across separate executions |
115
+ | Custom tools and capabilities | `tool-design` | Sessions exposing custom tools |
116
+ | File-based coordination | `filesystem-context` | Sessions sharing state via files |
117
+ | Remote execution | `hosted-agents` | Sandboxed or remote environments |
118
+ | Token efficiency | `context-optimization` | Compaction triggers, observation masking, cache-friendly ordering |
119
+ | Quality gates | `evaluation` | Review loops or quality checkpoints |
120
+ | LLM-as-judge review | `advanced-evaluation` | Automated review sessions judging other sessions' output |
121
+ | Task-model fit | `project-development` | Validating whether a task is viable for agent automation |
122
+ | Deliberative reasoning | `bdi-mental-states` | Explainable reasoning chains or formal cognitive models |
121
123
 
122
124
  ## How Workflows Work
123
125
 
@@ -290,18 +292,18 @@ The dev's CLI is **never** re-execed. The SDK ships an internal orchestrator ent
290
292
  atomic workflow -n <name> -a <agent> [inputs...]
291
293
  ```
292
294
 
293
- Surface | Command | When
294
- ---|---|---
295
- Named, with prompt | `… -n hello -a claude "fix the bug"` | Requires workflow to declare a `prompt` input
296
- Named, structured | `… -n gen-spec -a claude --research_doc=notes.md` | Structured inputs via `--<field>` flags
297
- Interactive picker | `atomic workflow -a claude` | Discovery — fuzzy list + form; this is the intentional no-`-n` path
298
- List (atomic builtins) | `atomic workflow list`, `atomic workflow list -a <agent>` | Browse registered builtins, optionally filtered
299
- List (user cli) | Iterate `listWorkflows(registry)` and add a `list` Commander subcommand yourself | No built-in `--list` flag
300
- List (single-workflow) | Not applicable — the file *is* the workflow
301
- Inspect inputs | `atomic workflow inputs <name> -a claude` | Print input schema as JSON
302
- Status (one or all) | `atomic workflow status [<session-id>]` | Query state — `in_progress`, `error`, `completed`, `needs_review`
303
- Kill non-interactively | `atomic session kill <id> -y` | Tear down without confirmation prompt — `-y` is mandatory for agents
304
- Detached (background) | `… -d` / `… --detach` | Runs without attaching; reattach with `atomic workflow session connect <name>`
295
+ | Surface | Command | When |
296
+ | ---------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
297
+ | Named, with prompt | `… -n hello -a claude "fix the bug"` | Requires workflow to declare a `prompt` input |
298
+ | Named, structured | `… -n gen-spec -a claude --research_doc=notes.md` | Structured inputs via `--<field>` flags |
299
+ | Interactive picker | `atomic workflow -a claude` | Discovery — fuzzy list + form; this is the intentional no-`-n` path |
300
+ | List (atomic builtins) | `atomic workflow list`, `atomic workflow list -a <agent>` | Browse registered builtins, optionally filtered |
301
+ | List (user cli) | Iterate `listWorkflows(registry)` and add a `list` Commander subcommand yourself | No built-in `--list` flag |
302
+ | List (single-workflow) | Not applicable — the file *is* the workflow |
303
+ | Inspect inputs | `atomic workflow inputs <name> -a claude` | Print input schema as JSON |
304
+ | Status (one or all) | `atomic workflow status [<session-id>]` | Query state — `in_progress`, `error`, `completed`, `needs_review` |
305
+ | Kill non-interactively | `atomic session kill <id> -y` | Tear down without confirmation prompt — `-y` is mandatory for agents |
306
+ | Detached (background) | `… -d` / `… --detach` | Runs without attaching; reattach with `atomic workflow session connect <name>` |
305
307
 
306
308
  Any of the named shapes above (positional or structured) accepts
307
309
  `-d` / `--detach` to run without attaching. Use it when you're automating
@@ -347,21 +349,22 @@ Enforced by the builder, loader, and runtime:
347
349
 
348
350
  Every workflow pattern maps directly to TypeScript code:
349
351
 
350
- | Workflow Concept | Programmatic Pattern |
351
- |---|---|
352
- | Agent session (send prompt, get response) | `ctx.stage({ name }, {}, {}, async (s) => { /* use s.client, s.session */ })` — **must** include an LLM call (Rule 9) |
353
- | Background (headless) session | `ctx.stage({ name, headless: true }, {}, {}, async (s) => { /* same API */ })` — invisible in graph, tracked by background counter |
354
- | Sequential execution | `await ctx.stage(...)` followed by `await ctx.stage(...)` |
355
- | Parallel execution | `Promise.all([ctx.stage(...), ctx.stage(...)])` |
356
- | Parallel background tasks | `Promise.all([ctx.stage({ name: "a", headless: true }, ...), ctx.stage({ name: "b", headless: true }, ...)])` |
357
- | Conditional branching | `if (...) { await ctx.stage({ name: "fix" }, {}, {}, ...) }` |
358
- | Bounded loops with visible graph nodes | `for (let i = 1; i <= N; i++) { await ctx.stage({ name: \`step-\${i}\` }, {}, {}, ...) }` |
359
- | Return data from session | `const h = await ctx.stage(opts, {}, {}, async (s) => { return value; }); h.result` |
360
- | Data flow between sessions | `s.save()` to persist → `s.transcript(handle)` or `s.transcript("name")` to retrieve |
361
- | Pure deterministic computation (no LLM call) | Plain TypeScript at the top level of `.run()`. **Never** a standalone stage — see Rule 9 and F22. |
362
- | Deterministic work tied to an LLM call | Inside the same stage callback, before/after the query. E.g. `s.session.query(...)` → parse → validate → `s.save(parsed)`. |
363
- | Subagent orchestration | Claude: `--agent` via `chatFlags` (interactive) or `agent` SDK option (headless); Copilot: `{ agent: "name" }` in sessionOpts; OpenCode: `agent` param in `s.client.session.prompt()` |
364
- | Per-session configuration | Pass `clientOpts` (2nd arg) and `sessionOpts` (3rd arg) to `ctx.stage()` |
352
+ | Workflow Concept | Programmatic Pattern |
353
+ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
354
+ | Agent session (send prompt, get response) | `ctx.stage({ name }, {}, {}, async (s) => { /* use s.client, s.session */ })` — **must** include an LLM call (Rule 9) |
355
+ | Background (headless) session | `ctx.stage({ name, headless: true }, {}, {}, async (s) => { /* same API */ })` — invisible in graph, tracked by background counter |
356
+ | Sequential execution | `await ctx.stage(...)` followed by `await ctx.stage(...)` |
357
+ | Parallel execution | `Promise.all([ctx.stage(...), ctx.stage(...)])` |
358
+ | Parallel background tasks | `Promise.all([ctx.stage({ name: "a", headless: true }, ...), ctx.stage({ name: "b", headless: true }, ...)])` |
359
+ | Conditional branching | `if (...) { await ctx.stage({ name: "fix" }, {}, {}, ...) }` |
360
+ | Bounded loops with visible graph nodes | `for (let i = 1; i <= N; i++) { await ctx.stage({ name: \`step-\${i}\` }, {}, {}, ...) }` |
361
+ | Return data from session | `const h = await ctx.stage(opts, {}, {}, async (s) => { return value; }); h.result` |
362
+ | Data flow between sessions | `s.save()` to persist → `s.transcript(handle)` or `s.transcript("name")` to retrieve |
363
+ | Pure deterministic computation (no LLM call) | Plain TypeScript at the top level of `.run()`. **Never** a standalone stage — see Rule 9 and F22. |
364
+ | Deterministic work tied to an LLM call | Inside the same stage callback, before/after the query. E.g. `s.session.query(...)` → parse → validate → `s.save(parsed)`. |
365
+ | Subagent orchestration | Claude: `--agent` via `chatFlags` (interactive) or `agent` SDK option (headless); Copilot: `{ agent: "name" }` in sessionOpts; OpenCode: `agent` param in `s.client.session.prompt()` |
366
+ | Per-session configuration | Pass `clientOpts` (2nd arg) and `sessionOpts` (3rd arg) to `ctx.stage()` |
367
+ | Per-session permission posture (autonomous) | Claude: `chatFlags: ["--dangerously-skip-permissions"]` (interactive) or `permissionMode: "bypassPermissions"` on `s.session.query()` (headless). Copilot: `onPermissionRequest: approveAll` (default — auto-applied). OpenCode: pass `permission: [{ permission: "*", pattern: "*", action: "allow" }]` in `sessionOpts` on **every stage** so the posture is visible in the workflow source, not buried in runtime defaults. See `references/session-config.md` §"OpenCode session permission ruleset". |
365
368
 
366
369
  ### When to use a stage vs. plain TypeScript
367
370
 
@@ -409,17 +412,17 @@ transcript compression), and `references/computation-and-validation.md`
409
412
 
410
413
  Map the user's intent to sessions and patterns:
411
414
 
412
- | Question | Maps to |
413
- |----------|---------|
414
- | What are the distinct **LLM interactions**? | Each LLM conversation → one `ctx.stage()` call (Rule 9) |
415
- | Can any LLM calls run in parallel? | `Promise.all([ctx.stage(...), ...])` |
416
- | Should any parallel LLM calls run in the background? | `ctx.stage({ name, headless: true }, ...)` — invisible in graph, ideal for data-gathering |
415
+ | Question | Maps to |
416
+ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
417
+ | What are the distinct **LLM interactions**? | Each LLM conversation → one `ctx.stage()` call (Rule 9) |
418
+ | Can any LLM calls run in parallel? | `Promise.all([ctx.stage(...), ...])` |
419
+ | Should any parallel LLM calls run in the background? | `ctx.stage({ name, headless: true }, ...)` — invisible in graph, ideal for data-gathering |
417
420
  | Does any step need **pure deterministic code** (no LLM)? | Plain TypeScript at the top of `.run()` — **not** a dedicated stage. Bundle it inside the nearest stage callback if it's directly tied to that stage's query. |
418
- | Do any steps need to repeat? | `for`/`while` loop with `ctx.stage()` inside |
419
- | Are there conditional paths? | `if`/`else` wrapping `ctx.stage()` calls |
420
- | What data flows between steps? | `s.save()` → `s.transcript(handle)` / `s.getMessages(handle)` |
421
- | Does the workflow need user input? | SDK-specific user input APIs (see `references/user-input.md`) |
422
- | Do any steps need a specific model? | SDK-specific session config (see `references/session-config.md`) |
421
+ | Do any steps need to repeat? | `for`/`while` loop with `ctx.stage()` inside |
422
+ | Are there conditional paths? | `if`/`else` wrapping `ctx.stage()` calls |
423
+ | What data flows between steps? | `s.save()` → `s.transcript(handle)` / `s.getMessages(handle)` |
424
+ | Does the workflow need user input? | SDK-specific user input APIs (see `references/user-input.md`) |
425
+ | Do any steps need a specific model? | SDK-specific session config (see `references/session-config.md`) |
423
426
 
424
427
  Then walk the **Design Advisory Skills** table above (§"Design Advisory
425
428
  Skills") — for each row whose trigger applies to your workflow, pull that
@@ -433,11 +436,11 @@ Pass the agent as a runtime argument to `.for()` on the builder — this
433
436
  narrows all context types and gives correct `s.client`/`s.session` types.
434
437
  Call `.for()` **before** `.run()`:
435
438
 
436
- | Agent | Builder Chain | Primary Session API |
437
- |-------|---------------|---------------------|
438
- | Claude | `defineWorkflow({...}).for("claude")` | `s.session.query(prompt)` — sends prompt to the Claude TUI pane |
439
- | Copilot | `defineWorkflow({...}).for("copilot")` | `s.session.send({ prompt })` — the runtime wraps `send` to block until `session.idle` with no timeout (see `failure-modes.md` §F10); do not use `sendAndWait` in Atomic workflows |
440
- | OpenCode | `defineWorkflow({...}).for("opencode")` | `s.client.session.prompt({ sessionID: s.session.id, parts: [...] })` |
439
+ | Agent | Builder Chain | Primary Session API |
440
+ | -------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
441
+ | Claude | `defineWorkflow({...}).for("claude")` | `s.session.query(prompt)` — sends prompt to the Claude TUI pane |
442
+ | Copilot | `defineWorkflow({...}).for("copilot")` | `s.session.send({ prompt })` — the runtime wraps `send` to block until `session.idle` with no timeout (see `failure-modes.md` §F10); do not use `sendAndWait` in Atomic workflows |
443
+ | OpenCode | `defineWorkflow({...}).for("opencode")` | `s.client.session.prompt({ sessionID: s.session.id, parts: [...] })` |
441
444
 
442
445
  The runtime manages client/session lifecycle automatically. For native SDK
443
446
  types and advanced APIs, import directly from the provider packages
@@ -289,18 +289,65 @@ await ctx.stage({ name: "..." }, {
289
289
  ### Session options (`sessionOpts` — 3rd arg to `ctx.stage()`)
290
290
 
291
291
  These are forwarded to `client.session.create()`. Use them to set a title,
292
- parentID, or workspaceID for the session:
292
+ parentID, workspaceID, or most importantly — a `permission` ruleset for
293
+ the session:
293
294
 
294
295
  ```ts
295
296
  await ctx.stage({ name: "..." }, {}, {
296
297
  title: "Feature implementation",
297
298
  parentID: "parent-session-id",
298
299
  workspaceID: "workspace-id",
300
+ // Recommended default — autonomous stages should approve every tool call.
301
+ // Mirrors Copilot's `approveAll` and Claude's `bypassPermissions`. Omit
302
+ // (or narrow) only when a stage must gate specific tools behind HIL.
303
+ permission: [{ permission: "*", pattern: "*", action: "allow" }],
299
304
  }, async (s) => {
300
305
  // s.session is the created OpencodeSession, s.session.id is the session ID
301
306
  });
302
307
  ```
303
308
 
309
+ ### OpenCode session permission ruleset (recommended default)
310
+
311
+ Every opencode stage in the builtin and example workflows passes
312
+ `permission: [{ permission: "*", pattern: "*", action: "allow" }]`
313
+ explicitly. **Do the same for new opencode workflows.** This is OpenCode's
314
+ equivalent of:
315
+
316
+ | Agent | Autonomous-default knob |
317
+ | -------- | --------------------------------------------------------------- |
318
+ | Claude | `chatFlags: ["--dangerously-skip-permissions"]` (interactive) / `permissionMode: "bypassPermissions"` (headless `s.session.query()` options) |
319
+ | Copilot | `onPermissionRequest: approveAll` (defaults on automatically) |
320
+ | OpenCode | `permission: [{ permission: "*", pattern: "*", action: "allow" }]` (default in the runtime; **set explicitly so workflow authors can see and override per stage**) |
321
+
322
+ Why explicit:
323
+
324
+ - The runtime applies the same allow-all ruleset as a fallback, but
325
+ **workflow authors should see the permission decision in the workflow
326
+ source** — not learn it by reading the executor.
327
+ - A workflow author who needs a stricter ruleset (e.g. deny `bash` on a
328
+ production machine, ask before `edit` on a sensitive directory) can
329
+ override the field per stage. The runtime only applies the default when
330
+ `permission` is `undefined` in the session opts.
331
+ - Mirroring the explicit pattern keeps the three SDK variants visually
332
+ symmetric — every stage in every agent shows its permission posture in
333
+ the same place (3rd arg to `ctx.stage()`).
334
+
335
+ To narrow per stage, pass any other ruleset shape:
336
+
337
+ ```ts
338
+ // Deny shell commands in this stage; ask for everything else.
339
+ await ctx.stage({ name: "review" }, {}, {
340
+ title: "review",
341
+ permission: [
342
+ { permission: "bash", pattern: "*", action: "deny" },
343
+ { permission: "*", pattern: "*", action: "ask" },
344
+ ],
345
+ }, async (s) => { /* ... */ });
346
+ ```
347
+
348
+ The full type lives in `@opencode-ai/sdk/v2` as `PermissionRuleset`
349
+ (`Array<{ permission: string; pattern?: string; action: "allow" | "deny" | "ask" }>`).
350
+
304
351
  ### Session prompting
305
352
 
306
353
  Use `s.client` and `s.session.id` inside the callback:
@@ -2,6 +2,8 @@
2
2
  name: xlsx
3
3
  description: "Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved."
4
4
  license: Proprietary. LICENSE.txt has complete terms
5
+ metadata:
6
+ provider: atomic
5
7
  ---
6
8
 
7
9
  # Requirements for Outputs
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "$schema": "https://opencode.ai/config.json",
3
- "permission": "allow",
4
3
  "mcp": {
5
4
  "github": {
6
5
  "type": "remote",
@@ -17,5 +16,10 @@
17
16
  ],
18
17
  "enabled": false
19
18
  }
20
- }
19
+ },
20
+ "instructions": [
21
+ "/home/alilavaee/.atomic/AGENTS.md",
22
+ "/home/vscode/.atomic/AGENTS.md"
23
+ ],
24
+ "permission": "allow"
21
25
  }
package/README.md CHANGED
@@ -128,6 +128,7 @@ Minimal example (Claude + Rust):
128
128
  "ghcr.io/devcontainers/features/github-cli:1": {}
129
129
  },
130
130
  "remoteEnv": {
131
+ "GH_TOKEN": "${localEnv:GH_TOKEN}",
131
132
  "ANTHROPIC_API_KEY": "${localEnv:ANTHROPIC_API_KEY}"
132
133
  }
133
134
  }
@@ -302,15 +303,15 @@ Detached mode is what you want for scripted / CI automation and long-running tas
302
303
 
303
304
  Atomic ships **two** things that share one workflow runtime. You can use either on its own or both together:
304
305
 
305
- | | Atomic CLI | Atomic SDK |
306
- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
307
- | **What it is** | Global `atomic` binary | `@bastani/atomic/workflows` TypeScript library |
308
- | **Install** | `bun install -g @bastani/atomic` (or `install.sh` / `install.ps1`) | `bun add @bastani/atomic` inside your project |
309
- | **Entrypoint** | `atomic <command>` | `bun run src/<agent>-worker.ts` |
310
- | **Code required?** | No — everything is pre-built. You can also ask the agent inside `atomic chat` to use the `workflow-creator` skill, decide when a complex task needs its own workflow, and build/run that workflow on the fly. | No to start — describe the workflow in natural language and use the `workflow-creator` skill to generate it. Then refine it in natural language or edit the TypeScript workflow and composition root directly, with full visibility into exactly what will run. |
306
+ | | Atomic CLI | Atomic SDK |
307
+ | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
308
+ | **What it is** | Global `atomic` binary | `@bastani/atomic/workflows` TypeScript library |
309
+ | **Install** | `bun install -g @bastani/atomic` (or `install.sh` / `install.ps1`) | `bun add @bastani/atomic` inside your project |
310
+ | **Entrypoint** | `atomic <command>` | `bun run src/<agent>-worker.ts` |
311
+ | **Code required?** | No — everything is pre-built. You can also ask the agent inside `atomic chat` to use the `workflow-creator` skill, decide when a complex task needs its own workflow, and build/run that workflow on the fly. | No to start — describe the workflow in natural language and use the `workflow-creator` skill to generate it. Then refine it in natural language or edit the TypeScript workflow and composition root directly, with full visibility into exactly what will run. |
311
312
  | **What you get** | `atomic chat` (agent REPL), three autonomous built-in workflows (`ralph`, `deep-research-codebase`, `open-claude-design`), session management, the live workflow panel, Atomic skills (`/init`, `/research-codebase`, `/create-spec`, …) | `defineWorkflow`, `createRegistry`, `runWorkflow`, metadata accessors (`getName`, `getInputSchema`, …), session primitives (`listSessions`, `getSessionStatus`, `attachSession` / `detachSession`, `nextWindow` / `previousWindow` / `gotoOrchestrator`), typed errors (`MissingDependencyError`, `SessionNotFoundError`, …), `ctx.stage`, `s.save` / `s.transcript`, headless stages |
312
- | **When to reach for** | You want autonomous execution of a standard pattern out of the box, interactive chat with your agent's full toolset, or a CLI agent that can create a purpose-built workflow before doing complex work. | You want to control the outer loop yourself — review flows, deployment gates, custom research pipelines — with full visibility into the TypeScript your team will run identically. |
313
- | **Read next** | [Quick Start](#quick-start) (steps 1–3) | [Quick Start step 4](#4-build-your-own-workflow--sdk) and [Building your own atomic-powered app](#building-your-own-atomic-powered-app) |
313
+ | **When to reach for** | You want autonomous execution of a standard pattern out of the box, interactive chat with your agent's full toolset, or a CLI agent that can create a purpose-built workflow before doing complex work. | You want to control the outer loop yourself — review flows, deployment gates, custom research pipelines — with full visibility into the TypeScript your team will run identically. |
314
+ | **Read next** | [Quick Start](#quick-start) (steps 1–3) | [Quick Start step 4](#4-build-your-own-workflow--sdk) and [Building your own atomic-powered app](#building-your-own-atomic-powered-app) |
314
315
 
315
316
  Both surfaces call the same runtime underneath (tmux/psmux session graph, provider SDKs, detach/reattach) — they're two entry points, not two products. Neither depends on the other: you can `bun add @bastani/atomic` in a project without ever installing the global binary, and you can use `atomic chat` and the built-in workflows without writing any TypeScript.
316
317
 
@@ -368,14 +369,14 @@ These are workflows you'd author with `defineWorkflow` and run from your own `sr
368
369
  - [`atomic completions` — Shell Completions](#atomic-completions--shell-completions)
369
370
  - [Atomic-Provided Skills (invokable from any agent chat)](#atomic-provided-skills-invokable-from-any-agent-chat)
370
371
  - [Building your own atomic-powered app](#building-your-own-atomic-powered-app)
371
- - [One factory, three input shapes](#one-factory-three-input-shapes)
372
- - [One method: `run()`](#one-method-run)
372
+ - [Primitives, not a wrapper](#primitives-not-a-wrapper)
373
+ - [Programmatic invocation](#programmatic-invocation)
373
374
  - [Embedding under a parent CLI — `runWorkflow` inside any Commander tree](#embedding-under-a-parent-cli--runworkflow-inside-any-commander-tree)
374
- - [`entry` — for bundled apps and tests](#entry--for-bundled-apps-and-tests)
375
+ - [`WorkflowPicker` component](#workflowpicker-component)
375
376
  - [Registry rules](#registry-rules)
376
377
  - [Input precedence](#input-precedence)
377
378
  - [Builtin workflows via the `atomic` CLI](#builtin-workflows-via-the-atomic-cli)
378
- - [Migration from 0.x (directory-scanning) to current](#migration-from-0x-directory-scanning-to-current)
379
+ - [Migration from 0.x (directory-scanning) and the `createWorkflowCli` wrapper](#migration-from-0x-directory-scanning-and-the-createworkflowcli-wrapper)
379
380
  - [Configuration](#configuration)
380
381
  - [`.atomic/settings.json`](#atomicsettingsjson)
381
382
  - [Agent-Specific Files](#agent-specific-files)
@@ -437,19 +438,19 @@ The [`examples/`](./examples) directory contains small, complete user apps you c
437
438
 
438
439
  **Design principle — when does `-a/--agent` belong on your CLI?** Each agent-scoped worker file imports a single workflow pinned to one agent (`import workflow from "./claude/index.ts"`), so there's nothing to disambiguate — no `-a` flag. Only reach for `-a/--agent` when one CLI dispatches across workflows that exist in multiple agent variants — e.g. a `cli.ts` that registers `hello` for claude *and* copilot. The atomic CLI itself uses `-a` for exactly that reason: its builtin registry has cross-agent variants of `ralph`, `deep-research-codebase`, and `open-claude-design`.
439
440
 
440
- | Example | What it demonstrates |
441
- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
442
- | `hello-world` | Minimal single-session workflow with structured inputs (greeting, style, optional notes) |
443
- | `sequential-describe-summarize` | Two stages passing data via `s.save()` → `s.transcript(handle)` — the canonical handoff pattern |
444
- | `parallel-hello-world` | `Promise.all()` fan-out and transcript merge |
445
- | `headless-test` | Visible seed → 3 parallel headless stages → visible merge → headless verdict |
446
- | `hil-favorite-color` | Human-in-the-loop prompt mid-workflow |
447
- | `hil-favorite-color-headless` | HIL pause inside a headless stage |
448
- | `structured-output-demo` | Per-SDK structured output (JSON-schema validation, Zod) |
449
- | `reviewer-tool-test` | Custom reviewer tool wiring (Copilot — copilot-worker.ts only) |
450
- | `review-fix-loop` | Draft → loop(review → fix) with bounded iterations and early exit on a `CLEAN` verdict — a reliable review gate showing how a stage's return value (`handle.result`) drives TypeScript control flow |
451
- | `multi-workflow` | Two Claude workflows under one `cli.ts` — uses `listWorkflows(registry)` to register one Commander subcommand per workflow with each workflow's declared inputs as `--<flag>` options. |
452
- | `commander-embed` | Mount an atomic workflow under a parent Commander CLI by calling `runWorkflow({ workflow, inputs })` inside a Commander action, alongside a plain Commander sibling command. No re-entry boilerplate — the SDK ships its own orchestrator entry script. |
441
+ | Example | What it demonstrates |
442
+ | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
443
+ | `hello-world` | Minimal single-session workflow with structured inputs (greeting, style, optional notes) |
444
+ | `sequential-describe-summarize` | Two stages passing data via `s.save()` → `s.transcript(handle)` — the canonical handoff pattern |
445
+ | `parallel-hello-world` | `Promise.all()` fan-out and transcript merge |
446
+ | `headless-test` | Visible seed → 3 parallel headless stages → visible merge → headless verdict |
447
+ | `hil-favorite-color` | Human-in-the-loop prompt mid-workflow |
448
+ | `hil-favorite-color-headless` | HIL pause inside a headless stage |
449
+ | `structured-output-demo` | Per-SDK structured output (JSON-schema validation, Zod) |
450
+ | `reviewer-tool-test` | Custom reviewer tool wiring (Copilot — copilot-worker.ts only) |
451
+ | `review-fix-loop` | Draft → loop(review → fix) with bounded iterations and early exit on a `CLEAN` verdict — a reliable review gate showing how a stage's return value (`handle.result`) drives TypeScript control flow |
452
+ | `multi-workflow` | Two Claude workflows under one `cli.ts` — uses `listWorkflows(registry)` to register one Commander subcommand per workflow with each workflow's declared inputs as `--<flag>` options. |
453
+ | `commander-embed` | Mount an atomic workflow under a parent Commander CLI by calling `runWorkflow({ workflow, inputs })` inside a Commander action, alongside a plain Commander sibling command. No re-entry boilerplate — the SDK ships its own orchestrator entry script. |
453
454
  | `pane-navigation` | Driver CLI for the SDK pane-navigation primitives (`nextWindow`, `previousWindow`, `gotoOrchestrator`, `attachSession`, `detachSession`). Spawns a 3-stage workflow detached and exposes `start / list / status / next / prev / home / attach / stop` subcommands. Catches `SessionNotFoundError` for friendly errors. |
454
455
 
455
456
  Run any of them with:
@@ -1247,19 +1248,19 @@ Native slash commands (`/help`, `/clear`, `/compact`, `/model`, `/theme`, `/agen
1247
1248
 
1248
1249
  The SDK ships pure functions you compose into whatever CLI shape you want:
1249
1250
 
1250
- | Primitive | Purpose |
1251
- | ----------------------- | ------------------------------------------------------------------------------------------------------ |
1252
- | `defineWorkflow` | Author a workflow with `.for(agent).run(...).compile()`. Pass `source: import.meta.path`. |
1253
- | `createRegistry` | Build an immutable registry of workflows for iteration / lookup. |
1254
- | `listWorkflows(reg)` | Snapshot every workflow in a registry. |
1255
- | `getWorkflow(reg, …)` | Resolve `(agent, name)` → workflow. |
1256
- | `getName / getAgent / getInputSchema / getDescription / getSource / getMinSDKVersion` | Read workflow metadata. |
1257
- | `validateInputs(wf, raw)` | Run the same validation pipeline atomic uses (required, defaults, enum, integer). |
1258
- | `runWorkflow({ workflow, inputs, detach? })` | Spawn the orchestrator tmux session and (optionally) attach. Resolves with `{ id, tmuxSessionName }`. |
1259
- | `listSessions / getSession / stopSession / attachSession / detachSession` | Manage running tmux sessions on the shared atomic socket. |
1260
- | `getSessionStatus / getSessionTranscript` | Read the orchestrator-written status snapshot or per-session messages from disk. |
1261
- | `nextWindow / previousWindow / gotoOrchestrator` | **Pane navigation** — pure tmux verbs that update the session's current-window pointer. Never auto-attach; an attached client sees the change live, otherwise a subsequent `attachSession` lands on the new window. |
1262
- | `MissingDependencyError / SessionNotFoundError / WorkflowNotCompiledError / InvalidWorkflowError / IncompatibleSDKError` | **Typed errors** thrown by the primitives above. Catch with `instanceof` to render friendly CLI messages without parsing message text. |
1251
+ | Primitive | Purpose |
1252
+ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1253
+ | `defineWorkflow` | Author a workflow with `.for(agent).run(...).compile()`. Pass `source: import.meta.path`. |
1254
+ | `createRegistry` | Build an immutable registry of workflows for iteration / lookup. |
1255
+ | `listWorkflows(reg)` | Snapshot every workflow in a registry. |
1256
+ | `getWorkflow(reg, …)` | Resolve `(agent, name)` → workflow. |
1257
+ | `getName / getAgent / getInputSchema / getDescription / getSource / getMinSDKVersion` | Read workflow metadata. |
1258
+ | `validateInputs(wf, raw)` | Run the same validation pipeline atomic uses (required, defaults, enum, integer). |
1259
+ | `runWorkflow({ workflow, inputs, detach? })` | Spawn the orchestrator tmux session and (optionally) attach. Resolves with `{ id, tmuxSessionName }`. |
1260
+ | `listSessions / getSession / stopSession / attachSession / detachSession` | Manage running tmux sessions on the shared atomic socket. |
1261
+ | `getSessionStatus / getSessionTranscript` | Read the orchestrator-written status snapshot or per-session messages from disk. |
1262
+ | `nextWindow / previousWindow / gotoOrchestrator` | **Pane navigation** — pure tmux verbs that update the session's current-window pointer. Never auto-attach; an attached client sees the change live, otherwise a subsequent `attachSession` lands on the new window. |
1263
+ | `MissingDependencyError / SessionNotFoundError / WorkflowNotCompiledError / InvalidWorkflowError / IncompatibleSDKError` | **Typed errors** thrown by the primitives above. Catch with `instanceof` to render friendly CLI messages without parsing message text. |
1263
1264
 
1264
1265
  **Single workflow (most common):**
1265
1266
 
@@ -0,0 +1,8 @@
1
+ export declare const ATOMIC_TEMP_ENV_KEYS: readonly ["TMPDIR", "TMP", "TEMP"];
2
+ export declare function atomicTempDir(homeDir?: string): string;
3
+ export declare function ensureAtomicTempDir(dir?: string): string;
4
+ export declare function atomicTempEnv(dir?: string): Record<string, string>;
5
+ export declare function atomicTempPath(prefix: string, extension: string, id?: string, dir?: string): string;
6
+ export declare function atomicContentTempPath(prefix: string, extension: string, content: string, dir?: string): string;
7
+ export declare function withAtomicTempEnv<T>(fn: () => Promise<T>, dir?: string): Promise<T>;
8
+ //# sourceMappingURL=atomic-temp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomic-temp.d.ts","sourceRoot":"","sources":["../../src/lib/atomic-temp.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,oCAAqC,CAAC;AAEvE,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAkB,GAAG,MAAM,CAEjE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAwB,GAAG,MAAM,CAMzE;AAED,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAA8B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEzF;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,EAAE,GAAE,MAAqB,EACzB,GAAG,GAAE,MAA8B,GAClC,MAAM,CAER;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAA8B,GAClC,MAAM,CAGR;AAED,wBAAsB,iBAAiB,CAAC,CAAC,EACvC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,GAAG,GAAE,MAA8B,GAClC,OAAO,CAAC,CAAC,CAAC,CAgBZ"}
@@ -0,0 +1,9 @@
1
+ export declare const TERMINAL_ENV_KEYS: readonly ["LANG", "LC_ALL", "LC_CTYPE", "TERM", "COLORTERM"];
2
+ export type TerminalEnvKey = (typeof TERMINAL_ENV_KEYS)[number];
3
+ export declare function normalizedTerminalEnv(baseEnv?: NodeJS.ProcessEnv): Record<string, string>;
4
+ export declare function mergeTerminalEnv(envVars?: Record<string, string>, baseEnv?: NodeJS.ProcessEnv): Record<string, string>;
5
+ export declare function pickTerminalEnv(env: Record<string, string>): Partial<Record<TerminalEnvKey, string>>;
6
+ export declare function buildSpawnEnv(explicitEnv: Record<string, string>, baseEnv?: NodeJS.ProcessEnv): Record<string, string>;
7
+ export declare function buildLauncherEnv(explicitEnv: Record<string, string>, baseEnv?: NodeJS.ProcessEnv): Record<string, string>;
8
+ export declare function buildTmuxEnv(explicitEnv: Record<string, string>, baseEnv?: NodeJS.ProcessEnv): Record<string, string>;
9
+ //# sourceMappingURL=terminal-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-env.d.ts","sourceRoot":"","sources":["../../src/lib/terminal-env.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,iBAAiB,8DAMpB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0BxB;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACpC,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM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AAO,CAAC,UAAU,CAAC,GAC5B,OAAO,CAAC,cAAc,EAAE,CAAC;IAiDtB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAClC;AAQD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,+DAejC,CAAC"}
@@ -4,24 +4,34 @@
4
4
  * Checks that Copilot workflow source files use the runtime-managed
5
5
  * `s.client` and `s.session` instead of manual SDK client creation.
6
6
  */
7
- import type { SessionConfig as CopilotSessionConfig } from "@github/copilot-sdk";
7
+ import type { CopilotClientOptions, SessionConfig as CopilotSessionConfig } from "@github/copilot-sdk";
8
8
  /**
9
- * Env inherited by the Copilot CLI subprocess the SDK spawns.
9
+ * Return `true` when `candidate` is a Node.js / npm-loader JavaScript shim
10
+ * that should not be passed to the Copilot SDK as the CLI executable.
10
11
  *
11
- * `NODE_NO_WARNINGS=1` silences the
12
- * `ExperimentalWarning: SQLite is an experimental feature` banner that
13
- * Node prints via the CLI's bundled `require("node:sqlite")`. The SDK
14
- * pipes the subprocess's stderr through `process.stderr` with a
15
- * `[CLI subprocess]` prefix, so without this override the warning
16
- * leaks into every `atomic chat -a copilot` and `atomic workflow -a
17
- * copilot` invocation.
12
+ * Filesystem errors for a given candidate are treated as "not a shim" so
13
+ * that the SDK can surface the real error (e.g. permission denied, ENOENT).
14
+ */
15
+ export declare function isCopilotShim(candidate: string): boolean;
16
+ /**
17
+ * Build the subprocess environment for the Copilot CLI process.
18
+ * Normalises locale to UTF-8 and suppresses Node.js deprecation warnings.
19
+ */
20
+ export declare function copilotSubprocessEnv(baseEnv?: NodeJS.ProcessEnv): Record<string, string | undefined>;
21
+ /**
22
+ * Enumerate every existing `cmd` candidate across PATH order.
23
+ */
24
+ export declare function enumeratePathCandidates(cmd: string, pathEnv: string): string[];
25
+ export declare function resolveCopilotCliPath(): string | undefined;
26
+ /**
27
+ * Build options suitable for `new CopilotClient(...)`.
18
28
  *
19
- * The SDK uses `options.env ?? process.env` as-is (no merge) when
20
- * spawning, so we must fold the existing env in ourselves. Returns a
21
- * fresh object per call so callers can layer additional env without
22
- * mutating shared state.
29
+ * Includes:
30
+ * - `env` from {@link copilotSubprocessEnv} (UTF-8 locale + `NODE_NO_WARNINGS=1`).
31
+ * - `cliPath` from {@link resolveCopilotCliPath} when resolvable; omitted
32
+ * otherwise so the SDK falls back to its bundled CLI.
23
33
  */
24
- export declare function copilotSubprocessEnv(): Record<string, string | undefined>;
34
+ export declare function copilotSdkLaunchOptions(): CopilotClientOptions;
25
35
  /**
26
36
  * Fold the atomic-managed additional instructions into a caller's
27
37
  * `systemMessage` value on `client.createSession`. Behavior:
@@ -1 +1 @@
1
- {"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/copilot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGjF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAEzE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,oBAAoB,CAAC,eAAe,CAAC,EAC/C,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAAC,eAAe,CAAC,CASvC;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,+DAelC,CAAC"}
1
+ {"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/copilot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,IAAI,oBAAoB,EACtC,MAAM,qBAAqB,CAAC;AAwC7B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAYxD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM,C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