@bastani/atomic 0.9.10 → 0.9.11-alpha.2

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 (204) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/builtin/cursor/CHANGELOG.md +6 -0
  3. package/dist/builtin/cursor/package.json +3 -3
  4. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  5. package/dist/builtin/intercom/package.json +3 -3
  6. package/dist/builtin/mcp/CHANGELOG.md +6 -0
  7. package/dist/builtin/mcp/package.json +3 -3
  8. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  9. package/dist/builtin/subagents/package.json +4 -4
  10. package/dist/builtin/web-access/CHANGELOG.md +6 -0
  11. package/dist/builtin/web-access/package.json +2 -2
  12. package/dist/builtin/workflows/CHANGELOG.md +23 -0
  13. package/dist/builtin/workflows/README.md +8 -3
  14. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +1 -1
  15. package/dist/builtin/workflows/package.json +2 -2
  16. package/dist/builtin/workflows/src/durable/backend.ts +2 -2
  17. package/dist/builtin/workflows/src/durable/child-primitive.ts +3 -0
  18. package/dist/builtin/workflows/src/durable/completed-catalog.ts +182 -33
  19. package/dist/builtin/workflows/src/durable/completed-inspection.ts +9 -4
  20. package/dist/builtin/workflows/src/durable/dbos-embedded-postgres-root.ts +173 -0
  21. package/dist/builtin/workflows/src/durable/dbos-embedded-postgres.ts +36 -12
  22. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +31 -8
  23. package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +9 -3
  24. package/dist/builtin/workflows/src/durable/factory.ts +35 -6
  25. package/dist/builtin/workflows/src/durable/local-command.ts +11 -2
  26. package/dist/builtin/workflows/src/durable/resume-runtime.ts +6 -2
  27. package/dist/builtin/workflows/src/durable/stage-primitive.ts +48 -10
  28. package/dist/builtin/workflows/src/durable/types.ts +11 -0
  29. package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +9 -9
  30. package/dist/builtin/workflows/src/engine/run-durable-topology.ts +89 -0
  31. package/dist/builtin/workflows/src/engine/run.ts +18 -16
  32. package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +14 -2
  33. package/dist/builtin/workflows/src/extension/public-types.ts +3 -4
  34. package/dist/builtin/workflows/src/extension/render-call.ts +4 -0
  35. package/dist/builtin/workflows/src/extension/render-result.ts +31 -1
  36. package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +3 -0
  37. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +5 -2
  38. package/dist/builtin/workflows/src/extension/workflow-schema.ts +3 -2
  39. package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +1 -0
  40. package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +88 -2
  41. package/dist/builtin/workflows/src/extension/workflow-tool.ts +13 -0
  42. package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +3 -0
  43. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +6 -3
  44. package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +2 -2
  45. package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +4 -1
  46. package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +2 -3
  47. package/dist/cli/args.d.ts.map +1 -1
  48. package/dist/cli/args.js +2 -0
  49. package/dist/cli/args.js.map +1 -1
  50. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  51. package/dist/core/agent-session-compaction.js +7 -1
  52. package/dist/core/agent-session-compaction.js.map +1 -1
  53. package/dist/core/agent-session-events.d.ts.map +1 -1
  54. package/dist/core/agent-session-events.js +2 -1
  55. package/dist/core/agent-session-events.js.map +1 -1
  56. package/dist/core/agent-session-retry.d.ts.map +1 -1
  57. package/dist/core/agent-session-retry.js +7 -0
  58. package/dist/core/agent-session-retry.js.map +1 -1
  59. package/dist/core/agent-session-runtime.d.ts +13 -0
  60. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  61. package/dist/core/agent-session-runtime.js +12 -0
  62. package/dist/core/agent-session-runtime.js.map +1 -1
  63. package/dist/core/agent-session-services.d.ts.map +1 -1
  64. package/dist/core/agent-session-services.js +3 -0
  65. package/dist/core/agent-session-services.js.map +1 -1
  66. package/dist/core/agent-session-tree.d.ts.map +1 -1
  67. package/dist/core/agent-session-tree.js +4 -1
  68. package/dist/core/agent-session-tree.js.map +1 -1
  69. package/dist/core/agent-session-types.d.ts +15 -0
  70. package/dist/core/agent-session-types.d.ts.map +1 -1
  71. package/dist/core/agent-session-types.js.map +1 -1
  72. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  73. package/dist/core/atomic-guide-command.js +2 -0
  74. package/dist/core/atomic-guide-command.js.map +1 -1
  75. package/dist/core/auth-storage-backends.d.ts +4 -0
  76. package/dist/core/auth-storage-backends.d.ts.map +1 -1
  77. package/dist/core/auth-storage-backends.js +48 -3
  78. package/dist/core/auth-storage-backends.js.map +1 -1
  79. package/dist/core/auth-storage.d.ts.map +1 -1
  80. package/dist/core/auth-storage.js +27 -11
  81. package/dist/core/auth-storage.js.map +1 -1
  82. package/dist/core/codex-errors.d.ts +3 -0
  83. package/dist/core/codex-errors.d.ts.map +1 -0
  84. package/dist/core/codex-errors.js +12 -0
  85. package/dist/core/codex-errors.js.map +1 -0
  86. package/dist/core/compaction/branch-summarization.d.ts +5 -1
  87. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  88. package/dist/core/compaction/branch-summarization.js +7 -8
  89. package/dist/core/compaction/branch-summarization.js.map +1 -1
  90. package/dist/core/compaction/compaction-runner.d.ts +3 -1
  91. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  92. package/dist/core/compaction/compaction-runner.js +6 -1
  93. package/dist/core/compaction/compaction-runner.js.map +1 -1
  94. package/dist/core/compaction/range-planner.d.ts +3 -0
  95. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  96. package/dist/core/compaction/range-planner.js +2 -1
  97. package/dist/core/compaction/range-planner.js.map +1 -1
  98. package/dist/core/model-registry.js +2 -2
  99. package/dist/core/model-registry.js.map +1 -1
  100. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  101. package/dist/core/model-resolver-defaults.js +2 -0
  102. package/dist/core/model-resolver-defaults.js.map +1 -1
  103. package/dist/core/prompt-templates.d.ts +1 -0
  104. package/dist/core/prompt-templates.d.ts.map +1 -1
  105. package/dist/core/prompt-templates.js +6 -4
  106. package/dist/core/prompt-templates.js.map +1 -1
  107. package/dist/core/remote-catalog-provider.d.ts +1 -1
  108. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  109. package/dist/core/remote-catalog-provider.js +25 -6
  110. package/dist/core/remote-catalog-provider.js.map +1 -1
  111. package/dist/core/sdk-exports.d.ts +1 -1
  112. package/dist/core/sdk-exports.d.ts.map +1 -1
  113. package/dist/core/sdk-exports.js.map +1 -1
  114. package/dist/core/sdk.d.ts.map +1 -1
  115. package/dist/core/sdk.js +4 -1
  116. package/dist/core/sdk.js.map +1 -1
  117. package/dist/core/session-manager-core.d.ts +1 -0
  118. package/dist/core/session-manager-core.d.ts.map +1 -1
  119. package/dist/core/session-manager-core.js +7 -4
  120. package/dist/core/session-manager-core.js.map +1 -1
  121. package/dist/core/session-manager-validation.d.ts.map +1 -1
  122. package/dist/core/session-manager-validation.js +3 -16
  123. package/dist/core/session-manager-validation.js.map +1 -1
  124. package/dist/core/slash-commands.js +1 -1
  125. package/dist/core/slash-commands.js.map +1 -1
  126. package/dist/core/summarization-retry.d.ts +11 -0
  127. package/dist/core/summarization-retry.d.ts.map +1 -0
  128. package/dist/core/summarization-retry.js +21 -0
  129. package/dist/core/summarization-retry.js.map +1 -0
  130. package/dist/core/tools/read.js +1 -1
  131. package/dist/core/tools/read.js.map +1 -1
  132. package/dist/index.d.ts +1 -1
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js.map +1 -1
  135. package/dist/main.d.ts.map +1 -1
  136. package/dist/main.js +2 -0
  137. package/dist/main.js.map +1 -1
  138. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  139. package/dist/modes/interactive/components/chat-session-host-events.js +16 -0
  140. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  141. package/dist/modes/interactive/components/footer.js +2 -2
  142. package/dist/modes/interactive/components/footer.js.map +1 -1
  143. package/dist/modes/interactive/interactive-agent-events.js +6 -0
  144. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  145. package/dist/modes/interactive/interactive-auth-routing.d.ts +2 -1
  146. package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
  147. package/dist/modes/interactive/interactive-auth-routing.js +10 -5
  148. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  149. package/dist/modes/interactive/interactive-autocomplete.js +12 -2
  150. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  151. package/dist/modes/interactive/interactive-model-catalog-startup.d.ts +13 -0
  152. package/dist/modes/interactive/interactive-model-catalog-startup.d.ts.map +1 -0
  153. package/dist/modes/interactive/interactive-model-catalog-startup.js +24 -0
  154. package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -0
  155. package/dist/modes/interactive/interactive-model-routing.js +4 -3
  156. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  157. package/dist/modes/interactive/interactive-queueing.js +3 -2
  158. package/dist/modes/interactive/interactive-queueing.js.map +1 -1
  159. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  160. package/dist/modes/interactive/interactive-startup.js +4 -7
  161. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  162. package/dist/modes/interactive/interactive-summarization-retry-events.d.ts +8 -0
  163. package/dist/modes/interactive/interactive-summarization-retry-events.d.ts.map +1 -0
  164. package/dist/modes/interactive/interactive-summarization-retry-events.js +40 -0
  165. package/dist/modes/interactive/interactive-summarization-retry-events.js.map +1 -0
  166. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +3 -1
  167. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  168. package/dist/modes/interactive-engine/extension-ui-bridge.js +6 -0
  169. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  170. package/dist/modes/interactive-engine/isolated-runtime.d.ts +4 -5
  171. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  172. package/dist/modes/interactive-engine/isolated-runtime.js +14 -24
  173. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  174. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +15 -0
  175. package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -0
  176. package/dist/modes/interactive-engine/remote-model-catalog.js +67 -0
  177. package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -0
  178. package/dist/modes/rpc/rpc-client-api.d.ts +9 -1
  179. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  180. package/dist/modes/rpc/rpc-client-api.js +12 -0
  181. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  182. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  183. package/dist/modes/rpc/rpc-command-handler.js +35 -0
  184. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  185. package/dist/modes/rpc/rpc-types.d.ts +78 -7
  186. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  187. package/dist/modes/rpc/rpc-types.js.map +1 -1
  188. package/docs/docs.json +9 -1
  189. package/docs/extensions.md +3 -3
  190. package/docs/json.md +7 -1
  191. package/docs/models/artificial-analysis-index.md +82 -0
  192. package/docs/models/model-selection.md +63 -0
  193. package/docs/models/pareto-efficiency.md +64 -0
  194. package/docs/prompt-templates.md +1 -0
  195. package/docs/providers.md +9 -1
  196. package/docs/quickstart.md +1 -1
  197. package/docs/rpc.md +76 -0
  198. package/docs/sdk.md +3 -0
  199. package/docs/tui.md +2 -2
  200. package/docs/workflows.md +26 -13
  201. package/examples/extensions/README.md +1 -1
  202. package/examples/extensions/sandbox/package-lock.json +3 -3
  203. package/npm-shrinkwrap.json +37 -37
  204. package/package.json +7 -7
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: "Benchmark Sources"
3
+ description: "The external benchmarks that inform Atomic model selection — Artificial Analysis and DeepSWE — broken down per benchmark: what each measures and when to reference it."
4
+ ---
5
+
6
+ # Benchmark Sources
7
+
8
+ Atomic's model-selection docs are keyed to two live external benchmark sources rather than a hand-maintained table of scores. This page lists each benchmark, what it measures, and **when to reference it** for a given workflow role — so the docs stay useful as new models ship without a manual rewrite every time.
9
+
10
+ <Warning>
11
+ No single benchmark is the source of truth. Use these as inputs and validate against Atomic's own workflow evals — public suites test different task distributions than real engineering loops. When Atomic's numbers disagree with a public index, Atomic's evals win. **Last reviewed: 2026-07-17.**
12
+ </Warning>
13
+
14
+ ## The two sources at a glance
15
+
16
+ | Source | URL | What it is | Reference it for |
17
+ | --- | --- | --- | --- |
18
+ | DeepSWE | [deepswe.datacurve.ai](https://deepswe.datacurve.ai/) | Long-horizon, contamination-free software-engineering tasks (113 tasks, 91 repos, 5 languages), all run on `mini-swe-agent` for consistency | The primary signal for coding-agent routing: real `pass@1`, cost, output tokens, and agent steps on engineering-loop work |
19
+ | Artificial Analysis | [artificialanalysis.ai](https://artificialanalysis.ai/) | Cross-provider intelligence, coding, and agentic indices plus per-capability breakdowns | Cross-domain intelligence, tool use, knowledge reliability, long context, and non-coding capabilities |
20
+
21
+ ## DeepSWE — coding-agent performance
22
+
23
+ DeepSWE is the closest public proxy for what Atomic actually does. Tasks are written from scratch (not scraped from PRs), so no model has seen the solutions; solutions require substantially more code than SWE-bench-style suites; and verifiers test behavior rather than implementation.
24
+
25
+ - **Metric:** `pass@1`, plus average cost per task, output tokens, and agent steps.
26
+ - **When to reference:** default weighting for debugger, worker, and any code-writing role. This is the table that drives [Model Selection](/models/model-selection) and [Pareto Efficiency](/models/pareto-efficiency).
27
+ - **Watch:** cost and step count, not just score — a model that passes but takes 268 steps (e.g. sonnet-5) is a poor worker even at a good pass rate.
28
+
29
+ ## Artificial Analysis — intelligence and capability breakdown
30
+
31
+ Artificial Analysis separates performance by benchmark, which lets a workflow pick the model that is strong at the *specific* thing a role needs. Reference the individual evaluations, not just the composite index.
32
+
33
+ ### Composite indices
34
+
35
+ - **Intelligence Index (v4.1)** — composite of the nine evaluations below. Use as a first-pass filter when a new model appears.
36
+ - **Coding Index** — coding-weighted sub-index. Cross-check against DeepSWE.
37
+ - **Agentic Index** — tool use, planning, autonomy, complex problem solving. The best AA signal for orchestrator and reviewer roles.
38
+
39
+ ### Individual evaluations — what each measures and when to reference
40
+
41
+ | Benchmark | Measures | Reference it for |
42
+ | --- | --- | --- |
43
+ | GDPval-AA v2 | Agentic real-world work tasks | Orchestrator / planner roles doing economically realistic work |
44
+ | τ³-Banking | Agentic tool use | Tool-heavy workflows and function-calling reliability |
45
+ | Terminal-Bench v2.1 | Agentic coding & terminal use | Debugger and shell-driven workers |
46
+ | SciCode | Coding (scientific) | Code-writing roles in technical domains |
47
+ | Humanity's Last Exam | Reasoning & knowledge | Hard planning / judgment gates |
48
+ | GPQA Diamond | Scientific reasoning | Research roles in technical domains |
49
+ | CritPt | Physics reasoning | Physics/engineering-heavy tasks |
50
+ | AA-Omniscience | Knowledge accuracy & non-hallucination | Research and any role where a confident wrong answer is costly |
51
+ | AA-LCR | Long-context reasoning | Large-codebase research and long-session work |
52
+
53
+ ### Capability indices
54
+
55
+ Artificial Analysis also publishes per-domain capability indices — **Agentic, Coding, Finance & Accounting, Strategy & Ops, Legal, Healthcare & Medical, Engineering, Economics**. When a workflow is domain-specific, pick by the matching capability index rather than the general Intelligence Index.
56
+
57
+ ## Role → benchmark map
58
+
59
+ A quick lookup for which benchmark to weight per role:
60
+
61
+ | Role | Primary benchmark | Secondary |
62
+ | --- | --- | --- |
63
+ | Debugger | DeepSWE pass@1 | Terminal-Bench v2.1 |
64
+ | Worker / cheap loop | DeepSWE cost & steps | — |
65
+ | Reviewer / judgment gate | DeepSWE pass@1 | AA Agentic Index |
66
+ | Planner / orchestrator | AA Agentic Index, GDPval-AA v2 | τ³-Banking (tool use) |
67
+ | Research | AA-LCR (long context) | AA-Omniscience (reliability) |
68
+ | Domain-specific work | Matching AA capability index | — |
69
+
70
+ ## Keeping the docs fresh
71
+
72
+ flora131's guidance on this issue: point the model at the live benchmark URLs and describe what each measures and when to reference it, rather than hardcoding scores that go stale on every release.
73
+
74
+ 1. Treat the model-selection pages as timestamped snapshots that read *from* the live sources above.
75
+ 2. When a new model appears on DeepSWE or Artificial Analysis, add it by pulling its numbers from the source — the frontier may move (as the gpt-5.6 family did).
76
+ 3. Mark a model **unmeasured** only if it is absent from both sources; unmeasured models may still be operational defaults.
77
+ 4. Prefer generating the docs and any future routing policy from the same underlying data, so documentation and routing cannot drift apart.
78
+
79
+ ## Related
80
+
81
+ - [Model Selection](/models/model-selection)
82
+ - [Pareto Efficiency](/models/pareto-efficiency)
@@ -0,0 +1,63 @@
1
+ ---
2
+ title: "Model Selection"
3
+ description: "Practical guidance for choosing models by workflow role, grounded in live coding-agent benchmarks (DeepSWE) and intelligence benchmarks (Artificial Analysis)."
4
+ ---
5
+
6
+ # Model Selection
7
+
8
+ This page gives workflow authors and runtime policy code a practical way to answer:
9
+
10
+ - Which model should a workflow use by default?
11
+ - Which model should it use for judgment gates, debugging, planning, research, cheap worker loops, and fallback diversity?
12
+ - Which models are dominated on cost/accuracy and should be avoided unless they have a specific role fit?
13
+
14
+ It is a **static reference**. It does not change runtime model routing — routing is configured elsewhere. Treat these recommendations as a starting point and validate against your own workflow evals.
15
+
16
+ <Note>
17
+ The table below is a snapshot of the [DeepSWE](https://deepswe.datacurve.ai/) leaderboard (v1.1, best effort per model), a long-horizon coding-agent benchmark reporting `pass@1` and average dollars per task. Benchmarks and pricing drift and new models ship constantly, so **treat the live leaderboards as authoritative** and refresh this page from them rather than hand-maintaining scores. See [Benchmark sources & when to reference each](/models/artificial-analysis-index). **Last compiled: 2026-07-17.**
18
+ </Note>
19
+
20
+ ## Recommendation chart
21
+
22
+ The Pareto frontier — models where nothing else is both cheaper and more accurate — is currently **gpt-5.6-sol** (accuracy ceiling), **gpt-5.6-terra**, **kimi-k3**, **gpt-5.6-luna**, **grok-4.5**, and **muse-spark-1.1**. Everything else is dominated and earns a place only through role fit or provider diversity. For the frontier reasoning, see [Pareto Efficiency](/models/pareto-efficiency).
23
+
24
+ | Model [level] | pass@1 | $/task | Verdict | Use it for |
25
+ | --- | --- | --- | --- | --- |
26
+ | gpt-5.6-sol [max] | 73% | $8.39 | Accuracy ceiling / frontier | Judgment gates where a wrong verdict wastes a whole loop, and the hardest debugging; current top scorer |
27
+ | gpt-5.6-terra [max] | 70% | $4.95 | Frontier — best top-tier value | High-accuracy default for reviewers and planners; matches fable-5's accuracy at ~4× lower cost |
28
+ | kimi-k3 [max] | 69% | $4.65 | Frontier | Near-top accuracy at the lowest top-tier cost; open weights, so also a provider-diversity pick |
29
+ | gpt-5.6-luna [max] | 67% | $3.03 | Frontier — best value on the board | The workhorse: research, orchestrator, worker + code-simplifier subagents |
30
+ | gpt-5.5 [xhigh] | 67% | $7.23 | Superseded | luna matches 67% for $3.03 — less than half the cost |
31
+ | claude-fable-5 [max] | 70% | $21.63 | Drop | terra matches 70% for $4.95; kept only where Anthropic-family behavior is specifically wanted |
32
+ | claude-opus-4.8 [max] | 59% | $13.22 | Fallback only | Dominated on cost/accuracy, but retained for Anthropic provider diversity and its long-context niche |
33
+ | grok-4.5 [high] | 54% | $2.42 | Frontier (budget) | Cheap, capable worker; adds xAI provider diversity |
34
+ | claude-sonnet-5 [max] | 54% | $26.40 | Drop everywhere | Worst value on the chart; 268 steps of meandering |
35
+ | muse-spark-1.1 [xhigh] | 53% | $2.36 | Frontier (cheapest defensible) | Cheapest model still on the frontier; open weights diversity |
36
+ | gpt-5.4 [xhigh] | 52% | $5.65 | Superseded | grok-4.5 and luna dominate it on cost and accuracy |
37
+ | glm-5.2 [max] | 44% | $3.92 | Diversity only | Reviewer-C primary (a third model family decorrelates review errors); budget fallback elsewhere |
38
+ | gemini-3.5-flash [medium] | 37% | $7.34 | Drop from reasoning | Token hose (276k output tokens); kept only at :low in retrieval chains where token price rules |
39
+ | kimi-k2.7-code | 31% | $2.82 | Drop | Dominated by muse-spark-1.1 (both cheaper reach); superseded by kimi-k3 |
40
+ | claude-sonnet-4.6 [high] | 30% | $5.52 | Drop everywhere | Removed from all chains |
41
+ | gemini-3.1-pro [high] | 12% | $9.48 | Drop everywhere | Value destruction; removed from all chains |
42
+
43
+ <Note>
44
+ Scores above are DeepSWE `pass@1` with ±CI omitted for readability; see the [live leaderboard](https://deepswe.datacurve.ai/) for confidence intervals, output-token, and step counts. A model absent from both DeepSWE and Artificial Analysis should be marked **unmeasured** rather than assigned a guessed score — unmeasured models may still remain operational defaults.
45
+ </Note>
46
+
47
+ ## Scenario-based guidance
48
+
49
+ Pick by the cost of being wrong in each role, not by raw accuracy. Match the role to the benchmark that best measures it (see [Benchmark sources](/models/artificial-analysis-index)).
50
+
51
+ - **Reviewer / judgment gates** — a wrong verdict discards an entire loop, so pay for accuracy: `gpt-5.6-sol [max]` primary, `gpt-5.6-terra` as reviewer-B, and a different family (`kimi-k3` or `glm-5.2`) as reviewer-C for decorrelated errors. Benchmark to weight: DeepSWE pass@1 and the AA Agentic Index.
52
+ - **Planner** — `gpt-5.6-terra [max]` for high-accuracy planning at reasonable cost; `gpt-5.6-sol` when the plan gates an expensive loop.
53
+ - **Debugger** — `gpt-5.6-sol [max]` primary; deep reasoning pays off where root-causing is expensive. Benchmark to weight: DeepSWE pass@1, Terminal-Bench.
54
+ - **Research** — `gpt-5.6-luna [max]` as the workhorse, with `kimi-k3` in the fallback chain for provider diversity. Benchmark to weight: AA-LCR (long context), AA-Omniscience (factual reliability).
55
+ - **Orchestrator / worker / cheap loops** — `gpt-5.6-luna [max]` for the main worker and code-simplifier subagents; `grok-4.5 [high]` or `muse-spark-1.1 [xhigh]` for trivial mechanical one-shots.
56
+ - **Design** — a quality-first, unbenchmarked domain; keep a top-tier model (`gpt-5.6-sol` or `claude-fable-5`) here and rely on human judgment rather than a score.
57
+ - **Interactive coding sessions** — `gpt-5.6-terra [max]` as a balanced default.
58
+
59
+ ## Related
60
+
61
+ - [Pareto Efficiency](/models/pareto-efficiency) — cost-vs-accuracy frontier, dominated models, and provider-diversity exceptions.
62
+ - [Benchmark sources & when to reference each](/models/artificial-analysis-index) — what Artificial Analysis and DeepSWE measure, per benchmark, and how to keep these docs fresh from the live source.
63
+ - [Custom models](/models) — how to add model entries for supported provider APIs.
@@ -0,0 +1,64 @@
1
+ ---
2
+ title: "Pareto Efficiency"
3
+ description: "Cost-vs-accuracy frontier for model selection: which models dominate, which are dominated, and when diversity overrides efficiency."
4
+ ---
5
+
6
+ # Pareto Efficiency
7
+
8
+ A model is **Pareto-efficient** (on the frontier) if no other model is both cheaper and more accurate. Everything not on the frontier is **dominated** — some other option matches or beats it on accuracy for less money — and should be avoided unless it earns a slot through a specific role fit or provider diversity.
9
+
10
+ The axes here are `pass@1` (accuracy) and `average dollars per task` (cost), taken from the [DeepSWE](https://deepswe.datacurve.ai/) coding-agent leaderboard. For the full table and role guidance, see [Model Selection](/models/model-selection).
11
+
12
+ <Note>
13
+ Figures are a snapshot of DeepSWE v1.1 (best effort per model). The frontier moves whenever a new model ships or prices change — DeepSWE publishes a live cost-vs-score scatter, so **read the frontier off the live chart** rather than trusting a static list. **Last compiled: 2026-07-17.**
14
+ </Note>
15
+
16
+ ## The frontier
17
+
18
+ Six models currently sit on the frontier, spanning "cheapest defensible worker" to "accuracy ceiling":
19
+
20
+ - **gpt-5.6-sol [max]** — the accuracy axis (73% pass@1, $8.39). Nothing scores higher.
21
+ - **gpt-5.6-terra [max]** — 70% for $4.95. Matches claude-fable-5's accuracy at roughly a quarter of the cost.
22
+ - **kimi-k3 [max]** — 69% for $4.65. Near-top accuracy at the lowest top-tier price; open weights.
23
+ - **gpt-5.6-luna [max]** — 67% for $3.03. The best value on the board for high-accuracy work.
24
+ - **grok-4.5 [high]** — 54% for $2.42. A cheap, capable mid-tier worker.
25
+ - **muse-spark-1.1 [xhigh]** — 53% for $2.36. The cheapest model still on the frontier.
26
+
27
+ ## What changed — the frontier moved
28
+
29
+ The previous generation's frontier (gpt-5.5 and claude-fable-5) is now **dominated** by the gpt-5.6 family:
30
+
31
+ - **claude-fable-5 [max]** (70%, $21.63) — matched on accuracy by **gpt-5.6-terra** (70%, $4.95) at ~4× lower cost.
32
+ - **gpt-5.5 [xhigh]** (67%, $7.23) — matched on accuracy by **gpt-5.6-luna** (67%, $3.03) at less than half the cost.
33
+
34
+ This is the reason to key these docs to the live benchmarks: a single release cycle reshaped the entire recommendation.
35
+
36
+ ## Dominated models — and why
37
+
38
+ - **claude-fable-5 [max]** — superseded by gpt-5.6-terra on cost for equal accuracy.
39
+ - **gpt-5.5 [xhigh]** and **gpt-5.4 [xhigh]** — superseded by gpt-5.6-luna / grok-4.5.
40
+ - **claude-opus-4.8 [max]**, **claude-sonnet-5 [max]** — dominated on cost/accuracy; sonnet-5 is the worst value on the chart.
41
+ - **kimi-k2.7-code** — superseded by kimi-k3 and undercut by muse-spark-1.1.
42
+ - **claude-sonnet-4.6 [high]**, **gemini-3.1-pro [high]** — dominated; not in any chain.
43
+ - **gemini-3.5-flash [medium]** — dropped from reasoning roles (token hose at 276k output tokens); retained only at `[low]` in retrieval chains where token price dominates.
44
+
45
+ ## Diversity and role-fit exceptions
46
+
47
+ Efficiency is not the only axis. A dominated model can still earn a slot when it decorrelates errors or fills a niche:
48
+
49
+ - **glm-5.2** — kept as reviewer-C because a third model family decorrelates review errors, even though it is dominated on raw efficiency.
50
+ - **kimi-k3** — frontier on efficiency *and* an open-weights provider-diversity option; a strong reviewer-C or fallback.
51
+ - **claude-opus-4.8 [max]** — retained for Anthropic provider diversity and its long-context niche.
52
+ - **claude-fable-5** — kept where Anthropic-family behavior is specifically wanted, e.g. the quality-first, unbenchmarked design chain.
53
+ - **Unmeasured models** — any family in use on `main` without DeepSWE or Artificial Analysis coverage should be marked unmeasured. Being unmeasured is not the same as being dominated; such models may remain operational defaults until measured.
54
+
55
+ ## How to use this
56
+
57
+ 1. Default to a frontier model for the role's accuracy needs (see [Model Selection](/models/model-selection)).
58
+ 2. Only reach for a dominated model when you have an explicit reason — provider diversity, a long-context or token-price niche, or an unbenchmarked domain like design.
59
+ 3. Re-read the frontier off the [DeepSWE live chart](https://deepswe.datacurve.ai/) when prices or benchmarks change, and update the timestamp on these pages.
60
+
61
+ ## Related
62
+
63
+ - [Model Selection](/models/model-selection)
64
+ - [Benchmark sources & when to reference each](/models/artificial-analysis-index)
@@ -69,6 +69,7 @@ Templates support positional arguments, defaults, and simple slicing:
69
69
  - `$1`, `$2`, ... positional args
70
70
  - `$@` or `$ARGUMENTS` for all args joined
71
71
  - `${1:-default}` uses arg 1 when present/non-empty, otherwise `default`
72
+ - `${@:-default}` or `${ARGUMENTS:-default}` uses all arguments when present/non-empty, otherwise `default`
72
73
  - `${@:N}` for args from the Nth position (1-indexed)
73
74
  - `${@:N:L}` for `L` args starting at N
74
75
 
package/docs/providers.md CHANGED
@@ -20,13 +20,15 @@ Use `/login` in interactive mode, then select a provider:
20
20
  - GitHub Copilot
21
21
  - Cursor (experimental)
22
22
 
23
- Use `/logout` to clear credentials. Tokens are stored in `~/.atomic/agent/auth.json` and auto-refresh when expired.
23
+ Use `/logout` to clear credentials. Logout immediately invalidates authentication in the active interactive engine and removes the selected provider from both `~/.atomic/agent/auth.json` and any effective legacy `~/.pi/agent/auth.json`, so the provider remains logged out after restart. Environment variables, command-line credentials, and `models.json` configuration cannot be cleared by Atomic; when one of those sources still authenticates the provider, the logout status names the remaining source. Stored tokens auto-refresh when expired.
24
24
 
25
25
  ### OpenAI Codex
26
26
 
27
27
  - Requires ChatGPT Plus or Pro subscription
28
28
  - Officially endorsed by OpenAI: [Codex for OSS](https://developers.openai.com/community/codex-for-oss)
29
29
 
30
+ If the Codex backend reports that an OAuth/auth token was invalidated or revoked, retry the request once in case the rejection is transient. If it persists, run `/logout` and select **OpenAI ChatGPT Plus/Pro**, then run `/login`, authenticate that subscription again, and retry the request. Atomic displays these recovery steps with the provider error; it does not automatically delete the stored credential or repeatedly retry a definitive authentication rejection.
31
+
30
32
  ### Codex Fast Mode
31
33
 
32
34
  Run `/fast` in interactive mode to enable OpenAI priority service tier separately for normal chat and workflow-stage sessions. The command is shown only when the current model scope includes a supported `openai/*` or `openai-codex/*` model. Workflow stages use the workflow setting, not the chat setting. When enabled for the active supported model, the UI appends `fast` after the model name in the chat footer and workflow stage model labels. Fast mode intentionally does not apply to `github-copilot/*`, Azure OpenAI, OpenRouter, or custom OpenAI-compatible providers. Use workflow fast mode deliberately because parallel workflow fan-out can multiply priority-tier usage.
@@ -74,6 +76,8 @@ export ANTHROPIC_API_KEY=sk-ant-...
74
76
  atomic
75
77
  ```
76
78
 
79
+ After a successful API-key or OAuth login, Atomic refreshes provider credentials and model discovery in the active session. Newly authenticated models are immediately available in `/model` without restarting Atomic, including providers with dynamically discovered catalogs.
80
+
77
81
  | Provider | Environment Variable | `auth.json` key |
78
82
  |----------|----------------------|------------------|
79
83
  | Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
@@ -104,6 +108,8 @@ atomic
104
108
  | MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
105
109
  | Moonshot AI | `MOONSHOT_API_KEY` | `moonshotai` |
106
110
  | Moonshot AI (China) | `MOONSHOT_API_KEY` | `moonshotai-cn` |
111
+ | Qwen Token Plan | `QWEN_TOKEN_PLAN_API_KEY` | `qwen-token-plan` |
112
+ | Qwen Token Plan (China) | `QWEN_TOKEN_PLAN_CN_API_KEY` | `qwen-token-plan-cn` |
107
113
  | Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
108
114
  | Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` | `xiaomi-token-plan-cn` |
109
115
  | Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
@@ -126,6 +132,8 @@ Store credentials in `~/.atomic/agent/auth.json`:
126
132
  "opencode": { "type": "api_key", "key": "..." },
127
133
  "opencode-go": { "type": "api_key", "key": "..." },
128
134
  "together": { "type": "api_key", "key": "..." },
135
+ "qwen-token-plan": { "type": "api_key", "key": "sk-sp-..." },
136
+ "qwen-token-plan-cn": { "type": "api_key", "key": "sk-sp-..." },
129
137
  "xiaomi": { "type": "api_key", "key": "..." },
130
138
  "xiaomi-token-plan-cn": { "type": "api_key", "key": "..." },
131
139
  "xiaomi-token-plan-ams": { "type": "api_key", "key": "..." },
@@ -102,7 +102,7 @@ Atomic ships with ten workflows you can run immediately. Use `/workflow list` to
102
102
  | `generate-and-filter` | Generate, dedupe, filter, optionally judge, and shortlist candidates. | `/workflow generate-and-filter prompt="Propose names for the new command"` |
103
103
  | `tournament` | Compare whole solutions through balanced pairwise judging. | `/workflow tournament prompt="Design the retry strategy"` |
104
104
  | `loop-until-done` | Iterate with a durable ledger until completion or bound exhaustion. | `/workflow loop-until-done prompt="Repair failures until the test suite passes"` |
105
- | `deep-research-codebase` | Broad, cross-cutting research before you decide what to change. Scout → research-history → parallel specialist waves → aggregator. | `/workflow deep-research-codebase prompt="How do payment retries work end to end?"` |
105
+ | `deep-research-codebase` | Heavy research for tasks requiring comprehensive, whole-repository context. | `/workflow deep-research-codebase prompt="How do payment retries work end to end?"` |
106
106
  | `goal` | Clearly delegated autonomous work that materially benefits from a durable goal ledger, bounded worker turns, named validation, and reviewer gates. It stops as `complete`, `blocked`, or `needs_human`, with optional final-stage PR creation through `create_pr=true` after approval. | `/workflow goal objective="Update the CLI docs for --json, include one example, run the docs build, and finish when the build passes"` |
107
107
  | `ralph` | Clearly delegated autonomous work that materially benefits from a durable research-first pipeline, delegated implementation, and iterative review. Ralph can start from a spec file, GitHub issue, or crisp ticket description and optionally lets only the final stage attempt PR creation with `create_pr=true`. | `/workflow ralph prompt="Implement specs/2026-03-rate-limit.md and validate burst traffic returns 429"` |
108
108
  | `open-claude-design` | UI and design-system work with separate forked generate and feedback chains; renders a live `preview.html` you can iterate against. | `/workflow open-claude-design prompt="Refresh the settings page hierarchy as a page"` |
package/docs/rpc.md CHANGED
@@ -277,6 +277,33 @@ Response contains an array of full [Model](#model) objects:
277
277
  }
278
278
  ```
279
279
 
280
+ #### logout_provider
281
+
282
+ Remove a provider's stored credential in the authoritative agent process, refresh its available-model catalog, and return the remaining authentication status and new catalog. Environment variables and `models.json` authentication are reported but are not modified.
283
+
284
+ ```json
285
+ {"type": "logout_provider", "provider": "github-copilot"}
286
+ ```
287
+
288
+ Response:
289
+
290
+ ```json
291
+ {
292
+ "type": "response",
293
+ "command": "logout_provider",
294
+ "success": true,
295
+ "data": {
296
+ "provider": "github-copilot",
297
+ "authStatus": {"configured": false},
298
+ "models": [],
299
+ "scopedModels": []
300
+ }
301
+ }
302
+ ```
303
+
304
+ `models` preserves the refreshed catalog order. `scopedModels` is optional. If authentication remains through an environment variable, `authStatus.source` is `"environment"` and `authStatus.label` names the variable.
305
+
306
+
280
307
  ### Context Window
281
308
 
282
309
  #### get_available_context_windows
@@ -374,6 +401,24 @@ Response:
374
401
  }
375
402
  ```
376
403
 
404
+ #### get_available_thinking_levels
405
+
406
+ Return the thinking levels supported by the current model, in cycle order.
407
+
408
+ ```json
409
+ {"type": "get_available_thinking_levels"}
410
+ ```
411
+
412
+ Response:
413
+ ```json
414
+ {
415
+ "type": "response",
416
+ "command": "get_available_thinking_levels",
417
+ "success": true,
418
+ "data": {"levels": ["off", "low", "medium", "high"]}
419
+ }
420
+ ```
421
+
377
422
  ### Queue Modes
378
423
 
379
424
  #### set_steering_mode
@@ -894,6 +939,9 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
894
939
  | `compaction_end` | Verbatim line compaction completes |
895
940
  | `auto_retry_start` | Auto-retry begins (after transient error) |
896
941
  | `auto_retry_end` | Auto-retry completes (success or final failure) |
942
+ | `summarization_retry_scheduled` | Retry scheduled for a transient compaction or branch-summary provider error |
943
+ | `summarization_retry_attempt_start` | Retried summarization request starts |
944
+ | `summarization_retry_finished` | Summarization retry loop completes |
897
945
  | `extension_error` | Extension threw an error |
898
946
 
899
947
  ### agent_start
@@ -1130,6 +1178,34 @@ On final failure (max retries exceeded):
1130
1178
  }
1131
1179
  ```
1132
1180
 
1181
+
1182
+ ### summarization_retry_scheduled / summarization_retry_attempt_start / summarization_retry_finished
1183
+
1184
+ Emitted when compaction planning or branch summarization retries after a transient provider error. These events use the same retry settings as automatic assistant-turn retries.
1185
+
1186
+ ```json
1187
+ {
1188
+ "type": "summarization_retry_scheduled",
1189
+ "attempt": 1,
1190
+ "maxAttempts": 3,
1191
+ "delayMs": 2000,
1192
+ "errorMessage": "terminated"
1193
+ }
1194
+ ```
1195
+
1196
+ ```json
1197
+ {
1198
+ "type": "summarization_retry_attempt_start",
1199
+ "source": "compaction",
1200
+ "reason": "threshold"
1201
+ }
1202
+ ```
1203
+
1204
+ For branch summaries, `source` is `"branchSummary"` and no `reason` is present. The loop then emits:
1205
+
1206
+ ```json
1207
+ {"type": "summarization_retry_finished"}
1208
+ ```
1133
1209
  ### extension_error
1134
1210
 
1135
1211
  Emitted when an extension throws an error.
package/docs/sdk.md CHANGED
@@ -351,6 +351,9 @@ session.subscribe((event) => {
351
351
  case "compaction_end":
352
352
  case "auto_retry_start":
353
353
  case "auto_retry_end":
354
+ case "summarization_retry_scheduled":
355
+ case "summarization_retry_attempt_start":
356
+ case "summarization_retry_finished":
354
357
  break;
355
358
  }
356
359
  });
package/docs/tui.md CHANGED
@@ -934,9 +934,9 @@ class VimEditor extends CustomEditor {
934
934
 
935
935
  export default function (pi: ExtensionAPI) {
936
936
  pi.on("session_start", (_event, ctx) => {
937
- // Factory receives theme and keybindings from the app
937
+ // Factory receives the TUI, theme, and keybindings from the app
938
938
  ctx.ui.setEditorComponent((tui, theme, keybindings) =>
939
- new VimEditor(theme, keybindings)
939
+ new VimEditor(tui, theme, keybindings)
940
940
  );
941
941
  });
942
942
  }
package/docs/workflows.md CHANGED
@@ -95,7 +95,8 @@ Atomic will:
95
95
 
96
96
  - ask clarifying questions when stage purpose, inputs, models, or handoffs are ambiguous,
97
97
  - write a `.atomic/workflows/<name>.ts` file using `workflow({...})`,
98
- - pick `ctx.task` / `ctx.chain` / `ctx.parallel` / `ctx.ui` per the [WorkflowContext primitives](#workflowcontext) and [task options](#task-and-stage-options) reference, and
98
+ - pick `ctx.task` / `ctx.chain` / `ctx.parallel` / `ctx.ui` per the [WorkflowContext primitives](#workflowcontext) and [task options](#task-and-stage-options) reference,
99
+ - use `ctx.tool(name, args, fn)` for workflow-owned side effects so completed operations are durably checkpointed and do not run again after resume (see [`ctx.tool`](#ctxtool--durable-cached-tool-execution)),
99
100
  - run `/workflow reload` so Atomic rediscovers the workflow resource and you can launch it immediately.
100
101
 
101
102
 
@@ -304,7 +305,7 @@ For the builtin result tables below, `deep-research-codebase`, `goal`, and `ralp
304
305
  | `generate-and-filter` | Candidate fan-out → rubric dedupe/filter → optional judge → shortlist. | Explore more options than you need and select the strongest distinct few. |
305
306
  | `tournament` | Whole-task attempts → balanced pairwise judges → bracket reducer. | Compare subjective or approach-sensitive solutions. |
306
307
  | `loop-until-done` | Durable ledger → iteration/evaluator loop → success or inspectable bound exhaustion. | Continue until explicit evidence proves completion. |
307
- | `deep-research-codebase` | Scout + research-history chain parallel specialist waves → aggregator. Indexes the whole repo and synthesizes findings. | Broad or cross-cutting research before you decide what to change. Prefer `/skill:research-codebase` for one subsystem. |
308
+ | `deep-research-codebase` | Heavy research for tasks requiring comprehensive, whole-repository context. | Tasks that genuinely require comprehensive whole-repository coverage. |
308
309
  | `goal` | Persisted goal ledger → bounded worker turns → receipts → three-reviewer gate → deterministic reducer → final report → optional final-stage PR handoff after approval. | Clearly delegated autonomous work that materially benefits from a durable goal ledger, bounded worker turns, named validation, and reviewer-gated completion; optionally allow only the final `pull-request` stage to attempt PR creation with `create_pr=true` after Goal reaches `complete`. |
309
310
  | `ralph` | Raw prompt → research-prompt-refinement → codebase/online research → sub-agent orchestration → multi-model parallel review → optional final-stage PR handoff. | Clearly delegated autonomous work that materially benefits from a durable research-first pipeline, delegated implementation, and iterative review; optionally allow only the final `pull-request` stage to attempt PR creation with `create_pr=true`. |
310
311
  | `open-claude-design` | Combined discovery/init (`/skill:impeccable shape` + `/skill:impeccable init` in one `discovery` stage) → design-system/reference research (`ds-*`) → curated gallery reference-discovery using that context → separate forked `generate-*` and `user-feedback-*` chains → rich HTML handoff (`exporter` → `final-display`). The discovery stage asks what to build, the output type, and which references to emulate, then lets impeccable init detect/create/reconcile `PRODUCT.md` and `DESIGN.md` (references take precedence over project context). Renders a live `preview.html` you can iterate against in the browser (opens through impeccable `live` / the `playwright-cli` skill when available). | UI, page, component, theme, or design-token work that benefits from a guided brief, beautiful references, and generation + user feedback loops. |
@@ -746,6 +747,7 @@ Author workflows to create at least one tracked stage by calling `ctx.task()`, `
746
747
  - **Schema-backed gates** - Prefer schema-backed workflow stages (`ctx.stage(..., { schema })`, `ctx.chain` items, or `ctx.parallel` items) for review/gate decisions whenever the workflow must evaluate model output; a schema-enabled item receives the structured-output tool automatically. See [Evaluation and Quality Gates](#evaluation-and-quality-gates).
747
748
  - **Stages are model stages** - Treat atomic workflow units as language model stages, not deterministic tools.
748
749
  - **Small deterministic-gate stages** - When deterministic gates are needed, create small dedicated stages that instruct a model to run a specific tool or perform a specific check. This keeps gates adaptive to the current codebase while preserving explicit workflow structure.
750
+ - **Checkpoint workflow-owned side effects** - Prefer `ctx.tool(name, args, fn)` for filesystem writes, network mutations, external API actions, and other side effects orchestrated directly by the workflow definition. Atomic durably caches a completed call's serializable result, so resume returns that result without rerunning `fn`. Keep pure computation and side-effect-free transformations as ordinary TypeScript. Do not wrap agent-stage internals or every function call indiscriminately.
749
751
 
750
752
  ### Context engineering guidance
751
753
 
@@ -1321,7 +1323,8 @@ The `run` function receives `ctx: WorkflowRunContext`. Prefer its high-level pri
1321
1323
  | Independent concurrent branches | `ctx.parallel(steps, options?)` |
1322
1324
  | Reusable child workflow | Call `ctx.workflow(workflowDefinition, options?)` |
1323
1325
  | Human input during a workflow run | `ctx.ui.input/confirm/select/editor/custom` |
1324
- | Pure deterministic computation, parsing, or file I/O | Plain TypeScript in `run` or helpers |
1326
+ | Pure deterministic computation, parsing, or side-effect-free transformation | Plain TypeScript in `run` or helpers |
1327
+ | Workflow-owned filesystem writes, network mutations, external API actions, or other side effects | `ctx.tool(name, args, fn)` so a completed operation is durably cached and resume does not rerun it |
1325
1328
  | Fine-grained session control | `ctx.stage(name, options?)` |
1326
1329
 
1327
1330
  ### `ctx.inputs`
@@ -2192,11 +2195,12 @@ List or inspect unfamiliar workflows before running them. If required inputs are
2192
2195
  workflow({ action: "list" })
2193
2196
  workflow({ action: "get", workflow: "deep-research-codebase" })
2194
2197
  workflow({ action: "inputs", workflow: "deep-research-codebase" })
2198
+ workflow({ action: "models" })
2195
2199
  ```
2196
2200
 
2197
2201
  The workflow tool action surface is:
2198
2202
 
2199
- - discovery: `list`, `get`, `inputs`
2203
+ - discovery: `list`, `get`, `inputs`, plus `models` for the configured model catalog
2200
2204
  - execution: named `run` with validated `workflow` and `inputs`
2201
2205
  - inspection: `status`, `stages`, `stage`, `transcript`
2202
2206
  - messaging and run control: `send`, `pause`, `interrupt`, `quit`, `resume`
@@ -2204,6 +2208,8 @@ The workflow tool action surface is:
2204
2208
 
2205
2209
  From interactive chat, named workflow launches run in the background so the parent chat stays available. Run `/workflow connect <run>` to see agents working and chat with and steer each stage. Inspection and control calls (`status`, `stages`, `stage`, `transcript`, `send`, `pause`, `resume`, `interrupt`, `quit`) remain available while work runs.
2206
2210
 
2211
+ `workflow({ action: "models" })` returns the registry's configured-auth catalog snapshot in registry order. Each entry includes `provider`, `id`, `fullId`, an `isCurrent` marker, and `availableThinkingLevels` derived from the real model's `reasoning` and `thinkingLevelMap` metadata. This is not proof of credentials, entitlements, OAuth freshness, or live provider access, and it exposes no authentication details.
2212
+
2207
2213
  Named launches wait only for **startup admission**, not for workflow completion. Atomic returns `status: "running"` after durable registration, reusable-worktree setup, and other pre-body setup succeed, while the workflow body and stages continue in the background. If setup fails before the workflow body is admitted — for example, `git_worktree_dir` points inside the invoking checkout — the original `workflow` tool call instead returns a structured `status: "failed"` result with the allocated run id and concrete setup error. No background-start claim or orphan run is retained, so the caller can correct the inputs and retry immediately. Failures after admission remain ordinary background lifecycle outcomes reported through status and lifecycle notices.
2208
2214
 
2209
2215
  A model may launch in the foreground only when the user explicitly requests it or foreground execution is technically required, and it must tell the user before launching.
@@ -2348,6 +2354,7 @@ Control behavior:
2348
2354
  - `interrupt` is resumable: it pauses live work when pausable stages exist and keeps the run in live history/status.
2349
2355
  - `pause` is useful for pausing a live run or a single live stage without treating it as a destructive abort.
2350
2356
  - `resume` can target a stage with `stageId`; the target may be a stage id, unique prefix, or stage name. `message` is forwarded to paused work. For a live interrupted streaming prompt, Atomic preserves the existing prompt loop without duplicating the user message and injects `Continue where you left off. If you believe you are finished with your original task (or a redefined task if the user told you), stop.` when required before normal readiness-gate completion. For a paused stage that was idle waiting for a new stage-chat turn, a non-empty message resumes the stage and starts exactly one fresh prompt containing that message; an empty resume releases the pause without creating a prompt.
2357
+ - An explicit workflow-tool `resume` target that is absent from the current session store triggers targeted DBOS discovery before Atomic returns `Run not found`. Eligible exact IDs and unique prefixes resume under the original workflow ID; durable prefix collisions return every matching ID. Resource-loading and durable-backend failures remain visible. Ordinary workflow-tool `status` listing stays session-local and does not eagerly hydrate durable history.
2351
2358
  - `quit` gracefully pauses in-flight work, marks the run resumable, and leaves it available to `/workflow resume`.
2352
2359
  - `reload` refreshes discovered workflow resources in-process; the optional `reason` is echoed in the result.
2353
2360
 
@@ -2427,11 +2434,13 @@ The readiness prompt can be answered in the attached stage UI or with `workflow(
2427
2434
 
2428
2435
  ## Durable Workflows and Cross-Session Resume
2429
2436
 
2430
- Atomic workflows use **DBOS/Postgres as their sole persistent workflow backend**. Atomic configures and launches DBOS lazily on the first workflow action, reuses that process-wide instance, and awaits readiness before workflow execution, resume, inspection, or deletion can access durable state. `DBOS_SYSTEM_DATABASE_URL` may select an existing database; DBOS initialization, query, and write failures fail the workflow action and never select another backend.
2437
+ Atomic workflows use **DBOS/Postgres as their sole persistent workflow backend**. Atomic configures and launches DBOS lazily on the first workflow action, reuses that process-wide instance, and awaits readiness before workflow execution, resume, inspection, or deletion can access durable state. `DBOS_SYSTEM_DATABASE_URL` may select an existing database; DBOS query and write failures fail the workflow action and never select another backend.
2431
2438
 
2432
2439
  **Zero-configuration local database.** Without `DBOS_SYSTEM_DATABASE_URL`, Atomic runs DBOS against its own embedded Postgres built from npm-distributed binaries — no Docker daemon or system Postgres install. The cluster lives under `~/.atomic/postgres/v18` on dedicated port `5439`; the first workflow action initializes it once and starts it with `pg_ctl` as a detached daemon that survives Atomic exiting, is shared by every concurrent Atomic session, and is never stopped by Atomic.
2433
2440
 
2434
- When the embedded binaries are unavailable for the platform, Atomic falls back to DBOS's reusable `dbos-db` Docker container; if neither is usable, the workflow action fails with one actionable message: set `DBOS_SYSTEM_DATABASE_URL` to an existing Postgres.
2441
+ **Running as root (Linux).** PostgreSQL refuses to run as UID 0, so a root Atomic process (containers, CI sandboxes, eval harnesses) resolves an unprivileged system account (`postgres`, `nobody`, or `daemon`), keeps the cluster under `/var/lib/atomic-postgres` instead (a root home directory is untraversable for that account), and runs every Postgres command with dropped privileges. When the embedded binaries themselves sit under an untraversable prefix (for example a root-owned `~/.nvm` global install), Atomic copies the Postgres runtime into the cluster directory once and reuses it.
2442
+
2443
+ When the embedded binaries are unavailable for the platform, Atomic falls back to DBOS's reusable `dbos-db` Docker container. If no durable backend can be provisioned at all, workflows **degrade to a process-local in-memory backend with a loud warning** instead of refusing to run: the run executes normally, but its state does not survive the process and `/workflow resume` after exit has nothing to restore. Set `DBOS_SYSTEM_DATABASE_URL` to an existing Postgres to restore durability.
2435
2444
 
2436
2445
  **Multiple concurrent Atomic sessions.** Every Atomic process launches DBOS with a unique executor id, and running root workflows carry owner/heartbeat metadata refreshed by ordinary ≤30-second stage-timing checkpoints. **Running workflows are never resume targets**: a running row with a fresh heartbeat is hidden from every session's picker and refused by direct `/workflow resume <id>` — resuming a workflow that is executing elsewhere would double-dispatch it. Once the heartbeat goes stale (about two minutes after a crash), the workflow surfaces as a red `crashed` row.
2437
2446
 
@@ -2441,7 +2450,7 @@ When two sessions race to resume the same paused workflow, a durable first-write
2441
2450
 
2442
2451
  - **Only `ctx.*` blocks are checkpointed**: code outside `ctx.*` is not durable.
2443
2452
  - **Durable side effects**: Atomic flushes `ctx.tool` and `ctx.ui` writes before exposing completed results, so resume does not repeat an already-completed effect.
2444
- - **Durable graph operations**: stage, task, chain, parallel, and child-workflow checkpoints include current topology, timing, model, output, and retained chat-session references. Completed inspection reconstructs the graph directly from DBOS.
2453
+ - **Durable graph operations**: stage, task, chain, parallel, and child-workflow checkpoints include source-stage lineage plus owning-run/boundary metadata, timing, model, output, and retained chat-session references. Fresh-process resume and completed inspection reconstruct nested child runs and parallel DAG edges directly from DBOS.
2445
2454
  - **DBOS-only discovery**: `/workflow resume`, `/workflows`, completed inspection, deletion, and targeted lookup hydrate/query DBOS. Session JSONL remains only a chat transcript referenced by a current checkpoint; it is not a workflow catalog or discovery source.
2446
2455
  - **Current format only**: Atomic encodes and decodes one current DBOS format. Prior local files and older DBOS records are not read, converted, or cleaned up. Unsupported or malformed records are ignored as foreign data.
2447
2456
  - **Child side-effect scoping**: nested workflow effects are checkpointed under the durable root with stable child scopes.
@@ -2451,11 +2460,11 @@ When two sessions race to resume the same paused workflow, a durable first-write
2451
2460
 
2452
2461
  **Resume after editing a workflow.** Replay identity combines the workflow id with stable content hashes and call order. Editing, inserting, or reordering `ctx.*` calls can intentionally invalidate matches. Finish or delete retained runs before deploying incompatible workflow changes.
2453
2462
 
2454
- Durable `/workflow resume` preserves completed stage metadata, active-stage elapsed time, total run elapsed time, and graph topology. While an LM stage or task is active, repeated durable checkpoints refresh its accumulated pause-adjusted duration even when its session file does not change, and refresh the run's total accumulated elapsed time alongside it; graceful quit and recoverable failure additionally persist the exact run total at the boundary.
2463
+ Durable `/workflow resume` preserves completed stage metadata, active-stage elapsed time, total run elapsed time, and graph topology. While an LM stage or task is active, repeated durable checkpoints refresh its accumulated pause-adjusted duration even when its session file does not change, and refresh the run's total accumulated elapsed time alongside it. Graceful quit forces an exact stage and run timing checkpoint even inside the ordinary 30-second update bucket; normal completion also persists the final accumulated run total.
2455
2464
 
2456
- Each new Atomic process that reopens the unfinished session mid-chat starts from the latest saved baseline and uses the same continuation prompt shown above, so repeated process-boundary resumes keep status, graph, stored, and lifecycle duration cumulative without double-counting pauses from earlier process segments — a resumed mid-running stage timer continues from its previously accumulated elapsed time instead of restarting at zero, and the total workflow duration shown in the main-chat dashboard and status surfaces reports prior-session elapsed plus current-session elapsed.
2465
+ Each new Atomic process that reopens unfinished work starts from the latest saved baseline, so repeated process-boundary resumes keep status, graph, and lifecycle duration cumulative without double-counting pauses. A stage paused at ten seconds resumes at ten seconds, and the main-chat dashboard reports prior-session elapsed plus current-session elapsed. Completed inspection uses that same accumulated run timing rather than DBOS record wall-clock age.
2457
2466
 
2458
- Replayed `ctx.stage`, `ctx.task`, `ctx.chain`, `ctx.parallel`, and child-workflow checkpoints keep their original summaries, timing, session/model metadata, and parallel fanout parentage instead of appearing as freshly flattened replay nodes.
2467
+ Replayed `ctx.stage`, `ctx.task`, `ctx.chain`, `ctx.parallel`, and child-workflow checkpoints keep their original summaries, timing, session/model metadata, nested owning-run boundaries, and parallel fanout parentage instead of appearing as freshly flattened replay nodes. If a project-local workflow created and reloaded during a chat is absent from a fresh process's registry, resume rediscovers it from the persisted original invocation directory.
2459
2468
 
2460
2469
  ### `ctx.tool` — durable cached tool execution
2461
2470
 
@@ -2488,7 +2497,7 @@ export default workflow({
2488
2497
 
2489
2498
  The `/workflow resume` command mirrors `/resume` ergonomics and `/workflows` is its alias. With no id, it builds one newest-first picker from eligible live runs and current DBOS resumable/completed records. DBOS is the authoritative catalog; selected records are hydrated and revalidated before resume or inspection. Running workflows never appear: fresh-heartbeat rows are excluded in every session to prevent double dispatch, and stale ones surface as `crashed`.
2490
2499
 
2491
- Rows carry semantic colors — completed green, paused yellow, failed/blocked/crashed red — and the open picker live-updates on local run changes plus a bounded cross-session poll, so state transitions appear (and freshly running workflows disappear) without reopening it.
2500
+ Rows carry semantic colors — completed green, paused yellow, failed/blocked/crashed red — and show checkpoint progress without the redundant pending-prompt count. The open picker live-updates on local run changes plus a bounded cross-session poll, so state transitions appear (and freshly running workflows disappear) without reopening it.
2492
2501
 
2493
2502
  Ctrl+D deletes a highlighted inactive durable or completed row after confirmation. Deletion rechecks same-process activity and the authoritative DBOS status, refuses a `running` workflow, and leaves host and stage chat transcripts untouched. The history surface matches `/resume` retention semantics: eligible runs remain searchable regardless of age or count, with no automatic history garbage collection. The picker mounts before asynchronous catalog hydration completes and merges DBOS rows when ready.
2494
2503
 
@@ -2496,7 +2505,7 @@ Only current-format DBOS records are selectable. Atomic hides unsupported or mal
2496
2505
 
2497
2506
  Selecting a paused, failed, blocked, or crash-recovery target follows the existing resume path unchanged: Atomic re-dispatches the workflow with its cached inputs and the **original workflow id**, so previously completed `ctx.tool`, `ctx.ui`, stage/task/chain/parallel items, and child workflow boundaries replay from durable checkpoints rather than executing again. Selecting a completed target follows a separate open path.
2498
2507
 
2499
- Atomic reconstructs a completed run/stage snapshot from authoritative checkpoints, remaps persisted source-stage parent references to the reconstructed stage ids in two passes, and opens the detail/chat overlay without calling the durable resume dispatcher or re-running workflow stages, tools, tasks, prompts, or workflow code.
2508
+ Atomic reconstructs completed root and nested child-run snapshots from authoritative checkpoints, remaps persisted source-stage and boundary references to reconstructed stage ids, and opens the full expanded hierarchy without calling the durable resume dispatcher or re-running workflow stages, tools, tasks, prompts, or workflow code.
2500
2509
 
2501
2510
  Completed detail state is read-only. A retained stage chat may be reopened for follow-up without resuming workflow execution or mutating its DBOS handle. Current checkpoints always include supported topology; foreign checkpoints are excluded rather than displayed with inferred edges.
2502
2511
 
@@ -2509,6 +2518,8 @@ Completed detail state is read-only. A retained stage chat may be reopened for f
2509
2518
 
2510
2519
  Explicit full IDs take precedence, while prefixes resolve across top-level live, resumable durable, and completed targets as one namespace. An exact loadable paused top-level live target resumes directly from in-session state without enumerating the durable completed-history catalog; this keeps explicit live resume responsive even when retained durable history is large and preserves live-over-durable precedence for duplicate IDs. Nested child runs remain excluded from this top-level target namespace even when addressed by an exact ID.
2511
2520
 
2521
+ The non-interactive `workflow({ action: "resume", runId: "<id-or-prefix>" })` surface uses the same durable resumable-target lookup behavior for explicit targets. If the target is absent locally, Atomic loads workflow resources, queries the authoritative DBOS resumable catalog, and only then reports a missing run. This targeted hydration does not change `workflow({ action: "status" })`: an empty session-local status before explicit resume does not imply that DBOS deleted the workflow.
2522
+
2512
2523
  Prefixes and other targets continue through the combined catalog so ambiguity and completed-inspection behavior remain unchanged. Ambiguous prefixes use the existing-style ambiguity diagnostic. A completed backend row with no checkpoints or no usable retained stage conversation is hidden from the picker; an explicit target reports that it is stale or missing required durable checkpoint/session data. A completed run remains inspectable when at least one stage has a usable transcript; missing, empty, directory, context-empty, or partially malformed transcript paths are omitted from stage chat attachment.
2513
2524
 
2514
2525
  Validation uses the final retained transcript for a repeated stage replay key, so an obsolete superseded checkpoint path does not hide an otherwise valid completed run. Reopening inspection refreshes a changed authoritative retained-chat handle. Session-cache-only rows are likewise hidden because the backend is authoritative. Cancelled, killed, non-resumable failed, and other terminal non-success states are never added. Normal `/resume`, `atomic -r`, and `--continue` behavior for internal workflow stage sessions is unchanged.
@@ -2526,7 +2537,7 @@ Validation uses the final retained transcript for a repeated stage replay key, s
2526
2537
 
2527
2538
  ### Configuring DBOS/Postgres
2528
2539
 
2529
- DBOS/Postgres durability requires no setup on supported local platforms. To use an existing Postgres database, set `DBOS_SYSTEM_DATABASE_URL` before starting Atomic; otherwise Atomic provisions embedded Postgres, with Docker as a platform fallback. The DBOS SDK ships with `@bastani/atomic`. If the SDK cannot load or Postgres cannot be reached or provisioned, Atomic fails the workflow action with an actionable diagnostic instead of falling back to the legacy per-workflow file store under `~/.atomic/workflow-durable`.
2540
+ DBOS/Postgres durability requires no setup on supported local platforms. To use an existing Postgres database, set `DBOS_SYSTEM_DATABASE_URL` before starting Atomic; otherwise Atomic provisions embedded Postgres (with drop-privilege support when running as root on Linux), with Docker as a platform fallback. The DBOS SDK ships with `@bastani/atomic`. If no durable backend can be provisioned, workflows run on a process-local in-memory backend with a loud non-durable warning never on the legacy per-workflow file store under `~/.atomic/workflow-durable` — and cross-process resume is unavailable until Postgres provisioning is fixed.
2530
2541
 
2531
2542
  ```bash
2532
2543
  export DBOS_SYSTEM_DATABASE_URL="postgresql://user:password@localhost:5432/atomic_dbos_sys"
@@ -2597,6 +2608,8 @@ Run `/workflow reload` after adding, editing, renaming, or deleting workflow mod
2597
2608
 
2598
2609
  Reload builds a complete replacement registry before publishing it. Concurrent requests are serialized and coalesced, stale discovery from an earlier session cannot overwrite newer state, and a fatal refresh failure retains the previous registry. Reload is safe while workflows are running: existing runs keep the definition and runtime snapshot they started with, while subsequent list/get/inputs/help/completion/invocation calls use the newly published registry.
2599
2610
 
2611
+ The `/workflow` argument-completion popup reads that same live registry. Project, user, package-provided, and built-in workflow names therefore appear immediately after reload both after `/workflow ` and after `/workflow inputs `; restarting Atomic is not required.
2612
+
2600
2613
  A successful rescan may still contain per-resource diagnostics. Both reload surfaces show `CONFIG_INVALID`, `IMPORT_FAILED`, `INVALID_DEFINITION`, `PATH_NOT_FOUND`, and duplicate-name diagnostics instead of reporting bare success while silently skipping a resource. Valid sibling workflows remain available. Fix the reported source/path and reload again; no process restart is required.
2601
2614
 
2602
2615
  ## Workflow Configuration
@@ -160,7 +160,7 @@ export default function (pi: ExtensionAPI) {
160
160
  parameters: Type.Object({
161
161
  name: Type.String({ description: "Name to greet" }),
162
162
  }),
163
- async execute(toolCallId, params, onUpdate, ctx, signal) {
163
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
164
164
  return {
165
165
  content: [{ type: "text", text: `Hello, ${params.name}!` }],
166
166
  details: {},
@@ -68,9 +68,9 @@
68
68
  "license": "MIT"
69
69
  },
70
70
  "node_modules/shell-quote": {
71
- "version": "1.8.4",
72
- "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.4.tgz",
73
- "integrity": "sha512-VsC6n6vz1ihYYyZZwX7YZSF5l5x36ca17OC+a69h94YqB7X6XLwf+5MOgynYir2SLFUbl8gIYvBo8K8RoNQ6bQ==",
71
+ "version": "1.10.0",
72
+ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.10.0.tgz",
73
+ "integrity": "sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==",
74
74
  "license": "MIT",
75
75
  "engines": {
76
76
  "node": ">= 0.4"