@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.
- package/.agents/skills/ado-commit/SKILL.md +2 -0
- package/.agents/skills/ado-create-pr/SKILL.md +2 -0
- package/.agents/skills/advanced-evaluation/SKILL.md +2 -0
- package/.agents/skills/ast-grep/SKILL.md +2 -0
- package/.agents/skills/bdi-mental-states/SKILL.md +2 -0
- package/.agents/skills/bun/SKILL.md +156 -122
- package/.agents/skills/context-compression/SKILL.md +2 -0
- package/.agents/skills/context-degradation/SKILL.md +2 -0
- package/.agents/skills/context-fundamentals/SKILL.md +2 -0
- package/.agents/skills/context-optimization/SKILL.md +2 -0
- package/.agents/skills/create-spec/SKILL.md +2 -0
- package/.agents/skills/docx/SKILL.md +2 -0
- package/.agents/skills/evaluation/SKILL.md +2 -0
- package/.agents/skills/explain-code/SKILL.md +2 -0
- package/.agents/skills/filesystem-context/SKILL.md +2 -0
- package/.agents/skills/find-skills/SKILL.md +2 -0
- package/.agents/skills/gh-commit/SKILL.md +2 -0
- package/.agents/skills/gh-create-pr/SKILL.md +2 -0
- package/.agents/skills/hosted-agents/SKILL.md +2 -0
- package/.agents/skills/impeccable/SKILL.md +117 -304
- package/.agents/skills/impeccable/agents/openai.yaml +4 -0
- package/.agents/skills/{adapt/SKILL.md → impeccable/reference/adapt.md} +2 -11
- package/.agents/skills/{animate/SKILL.md → impeccable/reference/animate.md} +15 -15
- package/.agents/skills/{audit/SKILL.md → impeccable/reference/audit.md} +8 -22
- package/.agents/skills/{bolder/SKILL.md → impeccable/reference/bolder.md} +9 -13
- package/.agents/skills/impeccable/reference/brand.md +114 -0
- package/.agents/skills/{clarify/SKILL.md → impeccable/reference/clarify.md} +2 -11
- package/.agents/skills/{colorize/SKILL.md → impeccable/reference/colorize.md} +23 -12
- package/.agents/skills/impeccable/reference/craft.md +152 -29
- package/.agents/skills/{critique/SKILL.md → impeccable/reference/critique.md} +25 -37
- package/.agents/skills/{delight/SKILL.md → impeccable/reference/delight.md} +9 -11
- package/.agents/skills/{distill/SKILL.md → impeccable/reference/distill.md} +2 -13
- package/.agents/skills/impeccable/reference/document.md +427 -0
- package/.agents/skills/impeccable/reference/extract.md +1 -1
- package/.agents/skills/{harden/SKILL.md → impeccable/reference/harden.md} +1 -43
- package/.agents/skills/{layout/SKILL.md → impeccable/reference/layout.md} +27 -11
- package/.agents/skills/impeccable/reference/live.md +594 -0
- package/.agents/skills/impeccable/reference/motion-design.md +12 -2
- package/.agents/skills/impeccable/reference/onboard.md +234 -0
- package/.agents/skills/{optimize/SKILL.md → impeccable/reference/optimize.md} +4 -12
- package/.agents/skills/{overdrive/SKILL.md → impeccable/reference/overdrive.md} +9 -21
- package/.agents/skills/{critique → impeccable}/reference/personas.md +1 -1
- package/.agents/skills/{polish/SKILL.md → impeccable/reference/polish.md} +31 -23
- package/.agents/skills/impeccable/reference/product.md +62 -0
- package/.agents/skills/{quieter/SKILL.md → impeccable/reference/quieter.md} +7 -11
- package/.agents/skills/impeccable/reference/shape.md +151 -0
- package/.agents/skills/impeccable/reference/teach.md +156 -0
- package/.agents/skills/{typeset/SKILL.md → impeccable/reference/typeset.md} +19 -11
- package/.agents/skills/impeccable/reference/typography.md +31 -14
- package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +87 -17
- package/.agents/skills/impeccable/scripts/command-metadata.json +94 -0
- package/.agents/skills/impeccable/scripts/design-parser.mjs +820 -0
- package/.agents/skills/impeccable/scripts/detect-csp.mjs +198 -0
- package/.agents/skills/impeccable/scripts/is-generated.mjs +69 -0
- package/.agents/skills/impeccable/scripts/live-accept.mjs +595 -0
- package/.agents/skills/impeccable/scripts/live-browser.js +4781 -0
- package/.agents/skills/impeccable/scripts/live-inject.mjs +445 -0
- package/.agents/skills/impeccable/scripts/live-poll.mjs +186 -0
- package/.agents/skills/impeccable/scripts/live-server.mjs +694 -0
- package/.agents/skills/impeccable/scripts/live-wrap.mjs +571 -0
- package/.agents/skills/impeccable/scripts/live.mjs +247 -0
- package/.agents/skills/impeccable/scripts/load-context.mjs +141 -0
- package/.agents/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/.agents/skills/impeccable/scripts/pin.mjs +214 -0
- package/.agents/skills/init/SKILL.md +2 -0
- package/.agents/skills/liteparse/SKILL.md +1 -0
- package/.agents/skills/memory-systems/SKILL.md +2 -0
- package/.agents/skills/multi-agent-patterns/SKILL.md +2 -0
- package/.agents/skills/opentui/SKILL.md +1 -0
- package/.agents/skills/pdf/SKILL.md +2 -0
- package/.agents/skills/playwright-cli/SKILL.md +51 -5
- package/.agents/skills/playwright-cli/references/playwright-tests.md +1 -1
- package/.agents/skills/playwright-cli/references/running-code.md +10 -0
- package/.agents/skills/playwright-cli/references/session-management.md +56 -0
- package/.agents/skills/playwright-cli/references/spec-driven-testing.md +305 -0
- package/.agents/skills/playwright-cli/references/test-generation.md +49 -3
- package/.agents/skills/pptx/SKILL.md +2 -0
- package/.agents/skills/project-development/SKILL.md +2 -0
- package/.agents/skills/prompt-engineer/SKILL.md +2 -0
- package/.agents/skills/research-codebase/SKILL.md +2 -0
- package/.agents/skills/ripgrep/SKILL.md +2 -0
- package/.agents/skills/skill-creator/LICENSE.txt +1 -1
- package/.agents/skills/skill-creator/SKILL.md +2 -0
- package/.agents/skills/sl-commit/SKILL.md +2 -0
- package/.agents/skills/sl-submit-diff/SKILL.md +2 -0
- package/.agents/skills/tdd/SKILL.md +4 -0
- package/.agents/skills/tool-design/SKILL.md +2 -0
- package/.agents/skills/typescript-advanced-types/SKILL.md +2 -1
- package/.agents/skills/typescript-expert/SKILL.md +7 -1
- package/.agents/skills/typescript-react-reviewer/SKILL.md +2 -1
- package/.agents/skills/workflow-creator/SKILL.md +75 -72
- package/.agents/skills/workflow-creator/references/session-config.md +48 -1
- package/.agents/skills/xlsx/SKILL.md +2 -0
- package/.opencode/opencode.json +6 -2
- package/README.md +39 -38
- package/dist/lib/atomic-temp.d.ts +8 -0
- package/dist/lib/atomic-temp.d.ts.map +1 -0
- package/dist/lib/terminal-env.d.ts +9 -0
- package/dist/lib/terminal-env.d.ts.map +1 -0
- package/dist/sdk/providers/claude.d.ts.map +1 -1
- package/dist/sdk/providers/copilot.d.ts +24 -14
- package/dist/sdk/providers/copilot.d.ts.map +1 -1
- package/dist/sdk/runtime/executor.d.ts +8 -0
- package/dist/sdk/runtime/executor.d.ts.map +1 -1
- package/dist/sdk/runtime/port-discovery.d.ts +71 -0
- package/dist/sdk/runtime/port-discovery.d.ts.map +1 -0
- package/dist/sdk/runtime/tmux.d.ts +10 -0
- package/dist/sdk/runtime/tmux.d.ts.map +1 -1
- package/dist/sdk/types.d.ts +1 -0
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +15 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/commands/cli/chat/index.test.ts +194 -2
- package/src/commands/cli/chat/index.ts +83 -28
- package/src/lib/atomic-temp.test.ts +86 -0
- package/src/lib/atomic-temp.ts +62 -0
- package/src/lib/terminal-env.test.ts +343 -0
- package/src/lib/terminal-env.ts +100 -0
- package/src/scripts/clean-dist.test.ts +53 -0
- package/src/scripts/clean-dist.ts +37 -0
- package/src/sdk/providers/claude.ts +42 -20
- package/src/sdk/providers/copilot.test.ts +365 -0
- package/src/sdk/providers/copilot.ts +117 -15
- package/src/sdk/runtime/cc-debounce.ts +2 -2
- package/src/sdk/runtime/executor.test.ts +322 -1
- package/src/sdk/runtime/executor.ts +159 -96
- package/src/sdk/runtime/port-discovery.test.ts +573 -0
- package/src/sdk/runtime/port-discovery.ts +496 -0
- package/src/sdk/runtime/tmux.ts +22 -2
- package/src/sdk/types.ts +1 -0
- package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +24 -6
- package/src/sdk/workflows/builtin/open-claude-design/opencode/index.ts +52 -13
- package/src/sdk/workflows/builtin/ralph/claude/index.ts +31 -3
- package/src/sdk/workflows/builtin/ralph/copilot/index.ts +16 -0
- package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +70 -3
- package/src/sdk/workflows/builtin/ralph/opencode/index.ts +50 -6
- package/src/services/system/auth.test.ts +53 -0
- package/src/services/system/auth.ts +31 -28
- package/src/services/system/detect.ts +1 -1
- package/.agents/skills/shape/SKILL.md +0 -96
- /package/.agents/skills/{critique → impeccable}/reference/cognitive-load.md +0 -0
- /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
|
|
22
|
-
|
|
23
|
-
| `getting-started.md`
|
|
24
|
-
| `agent-setup-recipe.md`
|
|
25
|
-
| `failure-modes.md`
|
|
26
|
-
| `workflow-inputs.md`
|
|
27
|
-
| `agent-sessions.md`
|
|
28
|
-
| `control-flow.md`
|
|
29
|
-
| `state-and-data-flow.md`
|
|
30
|
-
| `running-workflows.md`
|
|
31
|
-
| `computation-and-validation.md` | When adding deterministic computation, response parsing, validation, quality gates, or file I/O
|
|
32
|
-
| `session-config.md`
|
|
33
|
-
| `user-input.md`
|
|
34
|
-
| `registry-and-validation.md`
|
|
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
|
|
106
|
-
|
|
107
|
-
| Prompt clarity and structure
|
|
108
|
-
| Session prompt structure
|
|
109
|
-
| Context failure prevention
|
|
110
|
-
| Transcript compression
|
|
111
|
-
| Multi-session architecture
|
|
112
|
-
| Cross-run persistence
|
|
113
|
-
| Custom tools and capabilities | `tool-design`
|
|
114
|
-
| File-based coordination
|
|
115
|
-
| Remote execution
|
|
116
|
-
| Token efficiency
|
|
117
|
-
| Quality gates
|
|
118
|
-
| LLM-as-judge review
|
|
119
|
-
| Task-model fit
|
|
120
|
-
| Deliberative reasoning
|
|
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
|
|
294
|
-
|
|
295
|
-
Named, with prompt
|
|
296
|
-
Named, structured
|
|
297
|
-
Interactive picker
|
|
298
|
-
List (atomic builtins) | `atomic workflow list`, `atomic workflow list -a <agent>`
|
|
299
|
-
List (user cli)
|
|
300
|
-
List (single-workflow) | Not applicable — the file *is* the workflow
|
|
301
|
-
Inspect inputs
|
|
302
|
-
Status (one or all)
|
|
303
|
-
Kill non-interactively | `atomic session kill <id> -y`
|
|
304
|
-
Detached (background)
|
|
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
|
|
351
|
-
|
|
352
|
-
| Agent session (send prompt, get response)
|
|
353
|
-
| Background (headless) session
|
|
354
|
-
| Sequential execution
|
|
355
|
-
| Parallel execution
|
|
356
|
-
| Parallel background tasks
|
|
357
|
-
| Conditional branching
|
|
358
|
-
| Bounded loops with visible graph nodes
|
|
359
|
-
| Return data from session
|
|
360
|
-
| Data flow between sessions
|
|
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
|
|
363
|
-
| Subagent orchestration
|
|
364
|
-
| Per-session configuration
|
|
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
|
|
413
|
-
|
|
414
|
-
| What are the distinct **LLM interactions**?
|
|
415
|
-
| Can any LLM calls run in parallel?
|
|
416
|
-
| Should any parallel LLM calls run in the background?
|
|
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?
|
|
419
|
-
| Are there conditional paths?
|
|
420
|
-
| What data flows between steps?
|
|
421
|
-
| Does the workflow need user input?
|
|
422
|
-
| Do any steps need a specific model?
|
|
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
|
|
437
|
-
|
|
438
|
-
| Claude
|
|
439
|
-
| Copilot
|
|
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
|
|
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
|
package/.opencode/opencode.json
CHANGED
|
@@ -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
|
-
- [
|
|
372
|
-
- [
|
|
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
|
-
- [`
|
|
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)
|
|
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
|
|
1251
|
-
|
|
|
1252
|
-
| `defineWorkflow`
|
|
1253
|
-
| `createRegistry`
|
|
1254
|
-
| `listWorkflows(reg)`
|
|
1255
|
-
| `getWorkflow(reg, …)`
|
|
1256
|
-
| `getName / getAgent / getInputSchema / getDescription / getSource / getMinSDKVersion`
|
|
1257
|
-
| `validateInputs(wf, raw)`
|
|
1258
|
-
| `runWorkflow({ workflow, inputs, detach? })`
|
|
1259
|
-
| `listSessions / getSession / stopSession / attachSession / detachSession`
|
|
1260
|
-
| `getSessionStatus / getSessionTranscript`
|
|
1261
|
-
| `nextWindow / previousWindow / gotoOrchestrator`
|
|
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,CAAC,MAAM,EAAE,MAAM,CAAC,CAGxB;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAQzC;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAUD,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAED,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,OAAO,IAAI,UAAU,EAC3B,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/claude.ts"],"names":[],"mappings":"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"}
|
|
@@ -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
|
-
*
|
|
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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
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
|
|
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;
|
|
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,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAEpC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ9E;AAED,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,SAAS,CAe1D;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,IAAI,oBAAoB,CAS9D;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"}
|