@bastani/atomic 0.9.4 → 0.9.5-alpha.10

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 (759) hide show
  1. package/CHANGELOG.md +136 -2
  2. package/README.md +2 -2
  3. package/dist/builtin/cursor/CHANGELOG.md +6 -0
  4. package/dist/builtin/cursor/package.json +3 -3
  5. package/dist/builtin/cursor/src/model-mapper.ts +6 -3
  6. package/dist/builtin/intercom/CHANGELOG.md +31 -0
  7. package/dist/builtin/intercom/README.md +29 -21
  8. package/dist/builtin/intercom/broker/broker.ts +9 -120
  9. package/dist/builtin/intercom/broker/client.ts +29 -54
  10. package/dist/builtin/intercom/broker/delivered-message-cache.ts +44 -0
  11. package/dist/builtin/intercom/broker/paths.ts +42 -5
  12. package/dist/builtin/intercom/broker/pending-send-registry.ts +142 -0
  13. package/dist/builtin/intercom/broker/send-handler.ts +106 -0
  14. package/dist/builtin/intercom/broker/send-signature.ts +37 -0
  15. package/dist/builtin/intercom/broker/spawn.ts +78 -10
  16. package/dist/builtin/intercom/config.ts +6 -3
  17. package/dist/builtin/intercom/contact-supervisor-tool.ts +6 -4
  18. package/dist/builtin/intercom/foreground-detach-handoff.ts +136 -0
  19. package/dist/builtin/intercom/index-heavy.ts +50 -54
  20. package/dist/builtin/intercom/index.ts +320 -272
  21. package/dist/builtin/intercom/intercom-tool.ts +9 -3
  22. package/dist/builtin/intercom/lazy-heavy-proxy.ts +114 -0
  23. package/dist/builtin/intercom/lazy-subagent-ack.ts +20 -0
  24. package/dist/builtin/intercom/lazy-tool-execution.ts +39 -0
  25. package/dist/builtin/intercom/lifecycle-lease.ts +51 -0
  26. package/dist/builtin/intercom/lifecycle.ts +37 -20
  27. package/dist/builtin/intercom/package.json +12 -6
  28. package/dist/builtin/intercom/reply-routing.ts +17 -0
  29. package/dist/builtin/intercom/result-renderers.ts +1 -1
  30. package/dist/builtin/intercom/subagent-relay.ts +58 -12
  31. package/dist/builtin/intercom/types.ts +3 -3
  32. package/dist/builtin/intercom/ui/compose.ts +2 -2
  33. package/dist/builtin/intercom/ui/inline-message.ts +2 -2
  34. package/dist/builtin/intercom/ui/session-list.ts +2 -2
  35. package/dist/builtin/mcp/CHANGELOG.md +23 -0
  36. package/dist/builtin/mcp/OAUTH.md +1 -0
  37. package/dist/builtin/mcp/README.md +10 -6
  38. package/dist/builtin/mcp/apps-cancellation.ts +32 -0
  39. package/dist/builtin/mcp/call-tool-result.ts +9 -0
  40. package/dist/builtin/mcp/caller-wait.ts +50 -0
  41. package/dist/builtin/mcp/command-registration.ts +82 -0
  42. package/dist/builtin/mcp/direct-tool-executor.ts +279 -0
  43. package/dist/builtin/mcp/direct-tools.ts +40 -255
  44. package/dist/builtin/mcp/host-html-template.ts +4 -2
  45. package/dist/builtin/mcp/index.ts +274 -239
  46. package/dist/builtin/mcp/init.ts +96 -126
  47. package/dist/builtin/mcp/mcp-auth-flow.ts +247 -237
  48. package/dist/builtin/mcp/mcp-callback-server.ts +89 -68
  49. package/dist/builtin/mcp/mcp-oauth-provider.ts +23 -1
  50. package/dist/builtin/mcp/metadata-hydration.ts +52 -0
  51. package/dist/builtin/mcp/package.json +3 -3
  52. package/dist/builtin/mcp/proxy-auth.ts +4 -4
  53. package/dist/builtin/mcp/proxy-call.ts +111 -40
  54. package/dist/builtin/mcp/proxy-connect.ts +35 -15
  55. package/dist/builtin/mcp/proxy-info-modes.ts +106 -23
  56. package/dist/builtin/mcp/proxy-modes.ts +3 -3
  57. package/dist/builtin/mcp/session-cleanup-barrier.ts +43 -0
  58. package/dist/builtin/mcp/startup-warmup.ts +98 -0
  59. package/dist/builtin/mcp/state-lease.ts +12 -0
  60. package/dist/builtin/mcp/tool-result-renderer.ts +3 -3
  61. package/dist/builtin/mcp/ui-server.ts +8 -8
  62. package/dist/builtin/mcp/ui-session.ts +9 -18
  63. package/dist/builtin/subagents/CHANGELOG.md +60 -0
  64. package/dist/builtin/subagents/README.md +30 -29
  65. package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
  66. package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
  67. package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
  68. package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -2
  69. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
  70. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
  71. package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
  72. package/dist/builtin/subagents/agents/debugger.md +2 -2
  73. package/dist/builtin/subagents/agents/worker.md +2 -2
  74. package/dist/builtin/subagents/package.json +5 -5
  75. package/dist/builtin/subagents/prompts/review-loop.md +1 -1
  76. package/dist/builtin/subagents/skills/subagent/SKILL.md +37 -36
  77. package/dist/builtin/subagents/src/extension/api-lifecycle.ts +64 -0
  78. package/dist/builtin/subagents/src/extension/fanout-child.ts +44 -51
  79. package/dist/builtin/subagents/src/extension/index.ts +289 -320
  80. package/dist/builtin/subagents/src/extension/prompt-guidance.ts +7 -10
  81. package/dist/builtin/subagents/src/extension/schemas.ts +22 -5
  82. package/dist/builtin/subagents/src/extension/startup-maintenance.ts +89 -0
  83. package/dist/builtin/subagents/src/extension/tool-description.ts +29 -0
  84. package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +13 -2
  85. package/dist/builtin/subagents/src/intercom/result-intercom.ts +4 -4
  86. package/dist/builtin/subagents/src/runs/background/async-event-journal.ts +106 -0
  87. package/dist/builtin/subagents/src/runs/background/async-execution-common.ts +26 -20
  88. package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +13 -2
  89. package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +3 -0
  90. package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +1 -1
  91. package/dist/builtin/subagents/src/runs/background/completion-claims.ts +189 -0
  92. package/dist/builtin/subagents/src/runs/background/completion-dedupe.ts +44 -7
  93. package/dist/builtin/subagents/src/runs/background/completion-notification.ts +34 -0
  94. package/dist/builtin/subagents/src/runs/background/notify.ts +72 -22
  95. package/dist/builtin/subagents/src/runs/background/result-delivery-processor.ts +232 -0
  96. package/dist/builtin/subagents/src/runs/background/result-file-claims.ts +151 -0
  97. package/dist/builtin/subagents/src/runs/background/result-quarantine.ts +72 -0
  98. package/dist/builtin/subagents/src/runs/background/result-retry-scheduler.ts +48 -0
  99. package/dist/builtin/subagents/src/runs/background/result-status.ts +81 -0
  100. package/dist/builtin/subagents/src/runs/background/result-watcher-data.ts +59 -0
  101. package/dist/builtin/subagents/src/runs/background/result-watcher.ts +177 -233
  102. package/dist/builtin/subagents/src/runs/background/run-id-resolver.ts +3 -2
  103. package/dist/builtin/subagents/src/runs/background/stale-run-reconciler.ts +73 -14
  104. package/dist/builtin/subagents/src/runs/background/subagent-runner-streaming.ts +29 -15
  105. package/dist/builtin/subagents/src/runs/background/top-level-async.ts +1 -2
  106. package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +1 -0
  107. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +1 -0
  108. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +1 -0
  109. package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +7 -9
  110. package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +3 -13
  111. package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +2 -15
  112. package/dist/builtin/subagents/src/runs/foreground/execution-attempt-finalize.ts +2 -2
  113. package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +63 -46
  114. package/dist/builtin/subagents/src/runs/foreground/execution-detach-reservations.ts +48 -0
  115. package/dist/builtin/subagents/src/runs/foreground/execution-detach-route.ts +17 -0
  116. package/dist/builtin/subagents/src/runs/foreground/execution-run-sync.ts +39 -26
  117. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +3 -1
  118. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +3 -51
  119. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +6 -11
  120. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-input.ts +11 -2
  121. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +2 -0
  122. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +5 -112
  123. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +2 -0
  124. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +68 -118
  125. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +79 -7
  126. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +2 -2
  127. package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +3 -0
  128. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +2 -2
  129. package/dist/builtin/subagents/src/runs/shared/pi-spawn.ts +55 -12
  130. package/dist/builtin/subagents/src/shared/artifacts.ts +22 -11
  131. package/dist/builtin/subagents/src/shared/event-jsonl-writer.ts +294 -0
  132. package/dist/builtin/subagents/src/shared/exclusive-file-publication.ts +44 -0
  133. package/dist/builtin/subagents/src/shared/jsonl-writer.ts +1 -0
  134. package/dist/builtin/subagents/src/shared/model-info.ts +2 -2
  135. package/dist/builtin/subagents/src/shared/settings.ts +20 -10
  136. package/dist/builtin/subagents/src/shared/types-async.ts +3 -1
  137. package/dist/builtin/subagents/src/shared/types-config.ts +2 -0
  138. package/dist/builtin/subagents/src/shared/types-runtime.ts +3 -2
  139. package/dist/builtin/subagents/src/slash/slash-commands.ts +9 -12
  140. package/dist/builtin/subagents/src/slash/slash-live-state.ts +63 -32
  141. package/dist/builtin/subagents/src/tui/render-event-formatting.ts +15 -48
  142. package/dist/builtin/subagents/src/tui/render-layout.ts +9 -0
  143. package/dist/builtin/subagents/src/tui/render-result.ts +7 -0
  144. package/dist/builtin/subagents/src/tui/render-stable-output.ts +1 -0
  145. package/dist/builtin/subagents/src/tui/render-widget-graph.ts +27 -25
  146. package/dist/builtin/subagents/src/tui/render-widget.ts +177 -132
  147. package/dist/builtin/subagents/src/tui/render.ts +1 -1
  148. package/dist/builtin/web-access/CHANGELOG.md +14 -0
  149. package/dist/builtin/web-access/README.md +4 -0
  150. package/dist/builtin/web-access/content-tools.ts +8 -3
  151. package/dist/builtin/web-access/index-heavy.ts +1 -1
  152. package/dist/builtin/web-access/index.ts +190 -46
  153. package/dist/builtin/web-access/lifecycle-lease.ts +38 -0
  154. package/dist/builtin/web-access/package.json +2 -2
  155. package/dist/builtin/web-access/result-renderers.ts +1 -1
  156. package/dist/builtin/web-access/summary-review.ts +1 -1
  157. package/dist/builtin/web-access/web-search-activity.ts +1 -1
  158. package/dist/builtin/web-access/web-search-return.ts +7 -0
  159. package/dist/builtin/web-access/web-search-summary.ts +1 -1
  160. package/dist/builtin/web-access/web-search-tool.ts +4 -2
  161. package/dist/builtin/workflows/CHANGELOG.md +98 -0
  162. package/dist/builtin/workflows/README.md +20 -16
  163. package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +33 -9
  164. package/dist/builtin/workflows/builtin/goal-artifacts.ts +3 -1
  165. package/dist/builtin/workflows/builtin/goal-ledger.ts +3 -0
  166. package/dist/builtin/workflows/builtin/goal-prompts.ts +39 -5
  167. package/dist/builtin/workflows/builtin/goal-reducer.ts +21 -0
  168. package/dist/builtin/workflows/builtin/goal-reports.ts +23 -0
  169. package/dist/builtin/workflows/builtin/goal-review.ts +85 -6
  170. package/dist/builtin/workflows/builtin/goal-runner.ts +122 -49
  171. package/dist/builtin/workflows/builtin/goal-schemas.ts +22 -0
  172. package/dist/builtin/workflows/builtin/goal-types.ts +25 -1
  173. package/dist/builtin/workflows/builtin/goal.d.ts +5 -0
  174. package/dist/builtin/workflows/builtin/goal.ts +13 -2
  175. package/dist/builtin/workflows/builtin/index.d.ts +8 -0
  176. package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +16 -5
  177. package/dist/builtin/workflows/builtin/ralph-core.ts +100 -15
  178. package/dist/builtin/workflows/builtin/ralph-models.ts +98 -66
  179. package/dist/builtin/workflows/builtin/ralph-review-gate.ts +37 -5
  180. package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +159 -0
  181. package/dist/builtin/workflows/builtin/ralph-runner.ts +75 -165
  182. package/dist/builtin/workflows/builtin/ralph.d.ts +3 -0
  183. package/dist/builtin/workflows/builtin/ralph.ts +4 -1
  184. package/dist/builtin/workflows/builtin/review-convergence.ts +111 -0
  185. package/dist/builtin/workflows/builtin/shared-prompts.ts +20 -1
  186. package/dist/builtin/workflows/package.json +2 -2
  187. package/dist/builtin/workflows/skills/create-spec/SKILL.md +2 -0
  188. package/dist/builtin/workflows/skills/impeccable/SKILL.md +16 -13
  189. package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +1 -0
  190. package/dist/builtin/workflows/skills/impeccable/reference/adapt.native.md +58 -0
  191. package/dist/builtin/workflows/skills/impeccable/reference/android.md +40 -0
  192. package/dist/builtin/workflows/skills/impeccable/reference/animate.md +2 -0
  193. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -0
  194. package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +139 -0
  195. package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +69 -62
  196. package/dist/builtin/workflows/skills/impeccable/reference/critique.md +21 -7
  197. package/dist/builtin/workflows/skills/impeccable/reference/document.md +1 -1
  198. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +92 -0
  199. package/dist/builtin/workflows/skills/impeccable/reference/init.md +29 -7
  200. package/dist/builtin/workflows/skills/impeccable/reference/ios.md +45 -0
  201. package/dist/builtin/workflows/skills/impeccable/reference/layout.md +25 -1
  202. package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +23 -1
  203. package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +2 -1
  204. package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +75 -14
  205. package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +1 -1
  206. package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +31 -0
  207. package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +64 -0
  208. package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +118 -11
  209. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +16 -11
  210. package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +66 -0
  211. package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +42 -10
  212. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/fonts.mjs +30 -0
  213. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/page.mjs +4 -6
  214. package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +660 -0
  215. package/dist/builtin/workflows/skills/impeccable/scripts/hook-before-edit.mjs +516 -0
  216. package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +1764 -0
  217. package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +61 -0
  218. package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +4 -2
  219. package/dist/builtin/workflows/skills/impeccable/scripts/lib/is-generated.mjs +2 -2
  220. package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-component.mjs +13 -16
  221. package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +17 -11
  222. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +104 -37
  223. package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +9 -0
  224. package/dist/builtin/workflows/src/durable/backend.ts +12 -0
  225. package/dist/builtin/workflows/src/durable/child-primitive.ts +12 -8
  226. package/dist/builtin/workflows/src/durable/dbos-backend.ts +63 -2
  227. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +28 -0
  228. package/dist/builtin/workflows/src/durable/resume-catalog.ts +12 -0
  229. package/dist/builtin/workflows/src/durable/resume-runtime.ts +5 -2
  230. package/dist/builtin/workflows/src/durable/stage-primitive.ts +167 -28
  231. package/dist/builtin/workflows/src/durable/types.ts +30 -1
  232. package/dist/builtin/workflows/src/engine/primitives/task.ts +3 -1
  233. package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +1 -2
  234. package/dist/builtin/workflows/src/engine/run-returned-status.ts +50 -16
  235. package/dist/builtin/workflows/src/engine/run.ts +32 -32
  236. package/dist/builtin/workflows/src/engine/runtime.ts +5 -0
  237. package/dist/builtin/workflows/src/extension/extension-factory.ts +3 -0
  238. package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +9 -2
  239. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +137 -27
  240. package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +22 -6
  241. package/dist/builtin/workflows/src/extension/public-types.ts +1 -1
  242. package/dist/builtin/workflows/src/extension/workflow-command-completions.ts +13 -1
  243. package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +19 -4
  244. package/dist/builtin/workflows/src/extension/workflow-command-surfaces.ts +9 -0
  245. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +17 -17
  246. package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +48 -23
  247. package/dist/builtin/workflows/src/extension/workflow-schema.ts +15 -2
  248. package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +20 -8
  249. package/dist/builtin/workflows/src/extension/workflow-tool.ts +24 -8
  250. package/dist/builtin/workflows/src/runs/background/status.ts +4 -3
  251. package/dist/builtin/workflows/src/runs/foreground/executor-continuation.ts +13 -3
  252. package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +29 -8
  253. package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +1 -1
  254. package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +8 -0
  255. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +4 -3
  256. package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +2 -0
  257. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +18 -19
  258. package/dist/builtin/workflows/src/runs/foreground/stage-runner-unresolved-overflow.ts +38 -0
  259. package/dist/builtin/workflows/src/runs/foreground/stage-tool-execution-buffer.ts +47 -0
  260. package/dist/builtin/workflows/src/runs/shared/model-fallback-candidates.ts +1 -1
  261. package/dist/builtin/workflows/src/runs/shared/worktree-git.ts +155 -20
  262. package/dist/builtin/workflows/src/runs/shared/worktree-types.ts +6 -0
  263. package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -1
  264. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +2 -2
  265. package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +2 -2
  266. package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +18 -1
  267. package/dist/builtin/workflows/src/shared/persistence-restore.ts +23 -5
  268. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +4 -0
  269. package/dist/builtin/workflows/src/shared/resume-continuation.ts +2 -0
  270. package/dist/builtin/workflows/src/shared/returned-run-status.ts +116 -0
  271. package/dist/builtin/workflows/src/shared/workflow-failures-decisions.ts +2 -0
  272. package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +21 -3
  273. package/dist/builtin/workflows/src/tui/graph-view-state.ts +3 -0
  274. package/dist/builtin/workflows/src/tui/graph-view-types.ts +3 -0
  275. package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +1 -23
  276. package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +54 -9
  277. package/dist/builtin/workflows/src/tui/stage-chat-view-pending-tools.ts +9 -0
  278. package/dist/builtin/workflows/src/tui/stage-chat-view-render-settings.ts +27 -0
  279. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +5 -6
  280. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +5 -2
  281. package/dist/builtin/workflows/src/tui/status-list.ts +22 -15
  282. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +4 -4
  283. package/dist/bun/internal-intercom-broker.d.ts +6 -0
  284. package/dist/bun/internal-intercom-broker.d.ts.map +1 -0
  285. package/dist/bun/internal-intercom-broker.js +39 -0
  286. package/dist/bun/internal-intercom-broker.js.map +1 -0
  287. package/dist/bun/split-loader.d.ts +2 -0
  288. package/dist/bun/split-loader.d.ts.map +1 -0
  289. package/dist/bun/split-loader.js +50 -0
  290. package/dist/bun/split-loader.js.map +1 -0
  291. package/dist/cli/args.d.ts.map +1 -1
  292. package/dist/cli/args.js +2 -2
  293. package/dist/cli/args.js.map +1 -1
  294. package/dist/config.d.ts.map +1 -1
  295. package/dist/config.js +6 -4
  296. package/dist/config.js.map +1 -1
  297. package/dist/core/agent-session-auto-compaction.d.ts +26 -6
  298. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  299. package/dist/core/agent-session-auto-compaction.js +178 -19
  300. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  301. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  302. package/dist/core/agent-session-compaction.js +25 -4
  303. package/dist/core/agent-session-compaction.js.map +1 -1
  304. package/dist/core/agent-session-events.d.ts.map +1 -1
  305. package/dist/core/agent-session-events.js +12 -2
  306. package/dist/core/agent-session-events.js.map +1 -1
  307. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  308. package/dist/core/agent-session-extension-bindings.js +1 -1
  309. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  310. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  311. package/dist/core/agent-session-message-queue.js +1 -1
  312. package/dist/core/agent-session-message-queue.js.map +1 -1
  313. package/dist/core/agent-session-methods.d.ts +13 -4
  314. package/dist/core/agent-session-methods.d.ts.map +1 -1
  315. package/dist/core/agent-session-methods.js.map +1 -1
  316. package/dist/core/agent-session-models.d.ts +2 -2
  317. package/dist/core/agent-session-models.d.ts.map +1 -1
  318. package/dist/core/agent-session-models.js.map +1 -1
  319. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  320. package/dist/core/agent-session-prompt.js +2 -1
  321. package/dist/core/agent-session-prompt.js.map +1 -1
  322. package/dist/core/agent-session-retry.d.ts +2 -0
  323. package/dist/core/agent-session-retry.d.ts.map +1 -1
  324. package/dist/core/agent-session-retry.js +152 -4
  325. package/dist/core/agent-session-retry.js.map +1 -1
  326. package/dist/core/agent-session-services.d.ts +1 -0
  327. package/dist/core/agent-session-services.d.ts.map +1 -1
  328. package/dist/core/agent-session-services.js +4 -2
  329. package/dist/core/agent-session-services.js.map +1 -1
  330. package/dist/core/agent-session-types.d.ts +15 -1
  331. package/dist/core/agent-session-types.d.ts.map +1 -1
  332. package/dist/core/agent-session-types.js +1 -1
  333. package/dist/core/agent-session-types.js.map +1 -1
  334. package/dist/core/agent-session.d.ts +6 -0
  335. package/dist/core/agent-session.d.ts.map +1 -1
  336. package/dist/core/agent-session.js +6 -0
  337. package/dist/core/agent-session.js.map +1 -1
  338. package/dist/core/anthropic-thinking-guard.d.ts +5 -5
  339. package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
  340. package/dist/core/anthropic-thinking-guard.js +42 -32
  341. package/dist/core/anthropic-thinking-guard.js.map +1 -1
  342. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  343. package/dist/core/atomic-guide-command.js +15 -15
  344. package/dist/core/atomic-guide-command.js.map +1 -1
  345. package/dist/core/auth-storage.d.ts.map +1 -1
  346. package/dist/core/auth-storage.js +14 -9
  347. package/dist/core/auth-storage.js.map +1 -1
  348. package/dist/core/builtin-packages.d.ts.map +1 -1
  349. package/dist/core/builtin-packages.js +8 -4
  350. package/dist/core/builtin-packages.js.map +1 -1
  351. package/dist/core/compaction/compaction.d.ts +2 -0
  352. package/dist/core/compaction/compaction.d.ts.map +1 -1
  353. package/dist/core/compaction/compaction.js +79 -46
  354. package/dist/core/compaction/compaction.js.map +1 -1
  355. package/dist/core/compaction/context-assistant-turns.d.ts +42 -0
  356. package/dist/core/compaction/context-assistant-turns.d.ts.map +1 -0
  357. package/dist/core/compaction/context-assistant-turns.js +87 -0
  358. package/dist/core/compaction/context-assistant-turns.js.map +1 -0
  359. package/dist/core/compaction/context-compaction-critical.d.ts +15 -0
  360. package/dist/core/compaction/context-compaction-critical.d.ts.map +1 -0
  361. package/dist/core/compaction/context-compaction-critical.js +57 -0
  362. package/dist/core/compaction/context-compaction-critical.js.map +1 -0
  363. package/dist/core/compaction/context-compaction-eviction-alternates.d.ts +18 -0
  364. package/dist/core/compaction/context-compaction-eviction-alternates.d.ts.map +1 -0
  365. package/dist/core/compaction/context-compaction-eviction-alternates.js +186 -0
  366. package/dist/core/compaction/context-compaction-eviction-alternates.js.map +1 -0
  367. package/dist/core/compaction/context-compaction-eviction.d.ts +12 -0
  368. package/dist/core/compaction/context-compaction-eviction.d.ts.map +1 -0
  369. package/dist/core/compaction/context-compaction-eviction.js +222 -0
  370. package/dist/core/compaction/context-compaction-eviction.js.map +1 -0
  371. package/dist/core/compaction/context-compaction-prompt.d.ts.map +1 -1
  372. package/dist/core/compaction/context-compaction-prompt.js +1 -1
  373. package/dist/core/compaction/context-compaction-prompt.js.map +1 -1
  374. package/dist/core/compaction/context-compaction-runner.d.ts +7 -1
  375. package/dist/core/compaction/context-compaction-runner.d.ts.map +1 -1
  376. package/dist/core/compaction/context-compaction-runner.js +113 -21
  377. package/dist/core/compaction/context-compaction-runner.js.map +1 -1
  378. package/dist/core/compaction/context-compaction-types.d.ts +2 -0
  379. package/dist/core/compaction/context-compaction-types.d.ts.map +1 -1
  380. package/dist/core/compaction/context-compaction-types.js.map +1 -1
  381. package/dist/core/compaction/context-deletion-application.d.ts +5 -4
  382. package/dist/core/compaction/context-deletion-application.d.ts.map +1 -1
  383. package/dist/core/compaction/context-deletion-application.js +17 -15
  384. package/dist/core/compaction/context-deletion-application.js.map +1 -1
  385. package/dist/core/compaction/context-deletion-store.d.ts.map +1 -1
  386. package/dist/core/compaction/context-deletion-store.js +1 -1
  387. package/dist/core/compaction/context-deletion-store.js.map +1 -1
  388. package/dist/core/compaction/context-deletion-targets.d.ts +2 -1
  389. package/dist/core/compaction/context-deletion-targets.d.ts.map +1 -1
  390. package/dist/core/compaction/context-deletion-targets.js +36 -31
  391. package/dist/core/compaction/context-deletion-targets.js.map +1 -1
  392. package/dist/core/compaction/context-deletion-tool-helpers.d.ts.map +1 -1
  393. package/dist/core/compaction/context-deletion-tool-helpers.js +116 -43
  394. package/dist/core/compaction/context-deletion-tool-helpers.js.map +1 -1
  395. package/dist/core/compaction/context-transcript-analysis.d.ts +4 -2
  396. package/dist/core/compaction/context-transcript-analysis.d.ts.map +1 -1
  397. package/dist/core/compaction/context-transcript-analysis.js +36 -40
  398. package/dist/core/compaction/context-transcript-analysis.js.map +1 -1
  399. package/dist/core/copilot-anthropic-sse-repair.d.ts +23 -0
  400. package/dist/core/copilot-anthropic-sse-repair.d.ts.map +1 -0
  401. package/dist/core/copilot-anthropic-sse-repair.js +340 -0
  402. package/dist/core/copilot-anthropic-sse-repair.js.map +1 -0
  403. package/dist/core/copilot-gemini-reasoning.d.ts +16 -8
  404. package/dist/core/copilot-gemini-reasoning.d.ts.map +1 -1
  405. package/dist/core/copilot-gemini-reasoning.js +27 -22
  406. package/dist/core/copilot-gemini-reasoning.js.map +1 -1
  407. package/dist/core/copilot-hosts.d.ts +12 -0
  408. package/dist/core/copilot-hosts.d.ts.map +1 -0
  409. package/dist/core/copilot-hosts.js +33 -0
  410. package/dist/core/copilot-hosts.js.map +1 -0
  411. package/dist/core/copilot-model-catalog.d.ts.map +1 -1
  412. package/dist/core/copilot-model-catalog.js +3 -2
  413. package/dist/core/copilot-model-catalog.js.map +1 -1
  414. package/dist/core/copilot-model-synthesis.d.ts.map +1 -1
  415. package/dist/core/copilot-model-synthesis.js +3 -1
  416. package/dist/core/copilot-model-synthesis.js.map +1 -1
  417. package/dist/core/extensions/agent-events.d.ts +1 -1
  418. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  419. package/dist/core/extensions/agent-events.js.map +1 -1
  420. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  421. package/dist/core/extensions/loader-core.js +6 -0
  422. package/dist/core/extensions/loader-core.js.map +1 -1
  423. package/dist/core/extensions/loader-virtual-modules.d.ts +8 -1
  424. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  425. package/dist/core/extensions/loader-virtual-modules.js +10 -4
  426. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  427. package/dist/core/extensions/provider-types.d.ts +2 -7
  428. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  429. package/dist/core/extensions/provider-types.js.map +1 -1
  430. package/dist/core/footer-data-provider.d.ts +6 -0
  431. package/dist/core/footer-data-provider.d.ts.map +1 -1
  432. package/dist/core/footer-data-provider.js +72 -29
  433. package/dist/core/footer-data-provider.js.map +1 -1
  434. package/dist/core/http-dispatcher.d.ts.map +1 -1
  435. package/dist/core/http-dispatcher.js +5 -5
  436. package/dist/core/http-dispatcher.js.map +1 -1
  437. package/dist/core/messages.d.ts +9 -0
  438. package/dist/core/messages.d.ts.map +1 -1
  439. package/dist/core/messages.js +100 -18
  440. package/dist/core/messages.js.map +1 -1
  441. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  442. package/dist/core/model-registry-builtins.js +5 -0
  443. package/dist/core/model-registry-builtins.js.map +1 -1
  444. package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
  445. package/dist/core/model-registry-custom-loader.js +49 -8
  446. package/dist/core/model-registry-custom-loader.js.map +1 -1
  447. package/dist/core/model-registry-dynamic.d.ts.map +1 -1
  448. package/dist/core/model-registry-dynamic.js +11 -5
  449. package/dist/core/model-registry-dynamic.js.map +1 -1
  450. package/dist/core/model-registry-loader.d.ts.map +1 -1
  451. package/dist/core/model-registry-loader.js +8 -0
  452. package/dist/core/model-registry-loader.js.map +1 -1
  453. package/dist/core/model-registry-schemas.d.ts +93 -8
  454. package/dist/core/model-registry-schemas.d.ts.map +1 -1
  455. package/dist/core/model-registry-schemas.js +24 -12
  456. package/dist/core/model-registry-schemas.js.map +1 -1
  457. package/dist/core/model-registry-types.d.ts +7 -6
  458. package/dist/core/model-registry-types.d.ts.map +1 -1
  459. package/dist/core/model-registry-types.js.map +1 -1
  460. package/dist/core/model-registry.d.ts +5 -0
  461. package/dist/core/model-registry.d.ts.map +1 -1
  462. package/dist/core/model-registry.js +23 -0
  463. package/dist/core/model-registry.js.map +1 -1
  464. package/dist/core/model-resolver-cli.d.ts.map +1 -1
  465. package/dist/core/model-resolver-cli.js +33 -5
  466. package/dist/core/model-resolver-cli.js.map +1 -1
  467. package/dist/core/model-resolver-initial.d.ts +6 -1
  468. package/dist/core/model-resolver-initial.d.ts.map +1 -1
  469. package/dist/core/model-resolver-initial.js +12 -7
  470. package/dist/core/model-resolver-initial.js.map +1 -1
  471. package/dist/core/model-resolver-scope.d.ts +9 -0
  472. package/dist/core/model-resolver-scope.d.ts.map +1 -1
  473. package/dist/core/model-resolver-scope.js +12 -4
  474. package/dist/core/model-resolver-scope.js.map +1 -1
  475. package/dist/core/model-resolver.d.ts +4 -3
  476. package/dist/core/model-resolver.d.ts.map +1 -1
  477. package/dist/core/model-resolver.js +2 -2
  478. package/dist/core/model-resolver.js.map +1 -1
  479. package/dist/core/openai-responses-payload-sanitizer.d.ts +7 -0
  480. package/dist/core/openai-responses-payload-sanitizer.d.ts.map +1 -0
  481. package/dist/core/openai-responses-payload-sanitizer.js +74 -0
  482. package/dist/core/openai-responses-payload-sanitizer.js.map +1 -0
  483. package/dist/core/package-manager-auto-resources.d.ts +2 -2
  484. package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
  485. package/dist/core/package-manager-auto-resources.js +32 -52
  486. package/dist/core/package-manager-auto-resources.js.map +1 -1
  487. package/dist/core/package-manager-resolver.d.ts.map +1 -1
  488. package/dist/core/package-manager-resolver.js +23 -14
  489. package/dist/core/package-manager-resolver.js.map +1 -1
  490. package/dist/core/package-manager-resource-collector.d.ts +3 -3
  491. package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
  492. package/dist/core/package-manager-resource-collector.js +76 -73
  493. package/dist/core/package-manager-resource-collector.js.map +1 -1
  494. package/dist/core/package-manager-resource-files.d.ts +9 -8
  495. package/dist/core/package-manager-resource-files.d.ts.map +1 -1
  496. package/dist/core/package-manager-resource-files.js +92 -81
  497. package/dist/core/package-manager-resource-files.js.map +1 -1
  498. package/dist/core/prompt-templates-async.d.ts +3 -0
  499. package/dist/core/prompt-templates-async.d.ts.map +1 -0
  500. package/dist/core/prompt-templates-async.js +118 -0
  501. package/dist/core/prompt-templates-async.js.map +1 -0
  502. package/dist/core/provider-context-usage.d.ts +11 -0
  503. package/dist/core/provider-context-usage.d.ts.map +1 -0
  504. package/dist/core/provider-context-usage.js +58 -0
  505. package/dist/core/provider-context-usage.js.map +1 -0
  506. package/dist/core/resource-loader-assets.d.ts +3 -3
  507. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  508. package/dist/core/resource-loader-assets.js +66 -83
  509. package/dist/core/resource-loader-assets.js.map +1 -1
  510. package/dist/core/resource-loader-context-files.d.ts +1 -0
  511. package/dist/core/resource-loader-context-files.d.ts.map +1 -1
  512. package/dist/core/resource-loader-context-files.js +13 -10
  513. package/dist/core/resource-loader-context-files.js.map +1 -1
  514. package/dist/core/resource-loader-core.d.ts +1 -1
  515. package/dist/core/resource-loader-core.d.ts.map +1 -1
  516. package/dist/core/resource-loader-core.js +5 -5
  517. package/dist/core/resource-loader-core.js.map +1 -1
  518. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  519. package/dist/core/resource-loader-extensions.js +4 -0
  520. package/dist/core/resource-loader-extensions.js.map +1 -1
  521. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  522. package/dist/core/resource-loader-reload.js +54 -7
  523. package/dist/core/resource-loader-reload.js.map +1 -1
  524. package/dist/core/resource-loader-types.d.ts +7 -1
  525. package/dist/core/resource-loader-types.d.ts.map +1 -1
  526. package/dist/core/resource-loader-types.js.map +1 -1
  527. package/dist/core/sdk-types.d.ts +2 -0
  528. package/dist/core/sdk-types.d.ts.map +1 -1
  529. package/dist/core/sdk-types.js.map +1 -1
  530. package/dist/core/sdk.d.ts.map +1 -1
  531. package/dist/core/sdk.js +9 -6
  532. package/dist/core/sdk.js.map +1 -1
  533. package/dist/core/session-entry-normalization.d.ts +7 -0
  534. package/dist/core/session-entry-normalization.d.ts.map +1 -0
  535. package/dist/core/session-entry-normalization.js +14 -0
  536. package/dist/core/session-entry-normalization.js.map +1 -0
  537. package/dist/core/session-manager-core.d.ts.map +1 -1
  538. package/dist/core/session-manager-core.js +1 -0
  539. package/dist/core/session-manager-core.js.map +1 -1
  540. package/dist/core/session-manager-history.d.ts +2 -2
  541. package/dist/core/session-manager-history.d.ts.map +1 -1
  542. package/dist/core/session-manager-history.js +127 -108
  543. package/dist/core/session-manager-history.js.map +1 -1
  544. package/dist/core/settings-manager-basic-accessors.d.ts +3 -2
  545. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  546. package/dist/core/settings-manager-basic-accessors.js +6 -0
  547. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  548. package/dist/core/settings-manager-core.d.ts.map +1 -1
  549. package/dist/core/settings-manager-core.js +3 -2
  550. package/dist/core/settings-manager-core.js.map +1 -1
  551. package/dist/core/settings-storage.d.ts.map +1 -1
  552. package/dist/core/settings-storage.js +2 -1
  553. package/dist/core/settings-storage.js.map +1 -1
  554. package/dist/core/settings-types.d.ts +2 -1
  555. package/dist/core/settings-types.d.ts.map +1 -1
  556. package/dist/core/settings-types.js.map +1 -1
  557. package/dist/core/skills-async.d.ts +3 -0
  558. package/dist/core/skills-async.d.ts.map +1 -0
  559. package/dist/core/skills-async.js +269 -0
  560. package/dist/core/skills-async.js.map +1 -0
  561. package/dist/core/slash-commands.d.ts +2 -0
  562. package/dist/core/slash-commands.d.ts.map +1 -1
  563. package/dist/core/slash-commands.js +141 -0
  564. package/dist/core/slash-commands.js.map +1 -1
  565. package/dist/core/tools/bash.d.ts.map +1 -1
  566. package/dist/core/tools/bash.js +11 -8
  567. package/dist/core/tools/bash.js.map +1 -1
  568. package/dist/core/trust-manager.d.ts +9 -0
  569. package/dist/core/trust-manager.d.ts.map +1 -1
  570. package/dist/core/trust-manager.js +44 -2
  571. package/dist/core/trust-manager.js.map +1 -1
  572. package/dist/index-extensions.d.ts +1 -1
  573. package/dist/index-extensions.d.ts.map +1 -1
  574. package/dist/index-extensions.js.map +1 -1
  575. package/dist/index.d.ts +2 -1
  576. package/dist/index.d.ts.map +1 -1
  577. package/dist/index.js +2 -1
  578. package/dist/index.js.map +1 -1
  579. package/dist/main-deferred-startup.d.ts +33 -0
  580. package/dist/main-deferred-startup.d.ts.map +1 -0
  581. package/dist/main-deferred-startup.js +44 -0
  582. package/dist/main-deferred-startup.js.map +1 -0
  583. package/dist/main-early-input.d.ts +41 -0
  584. package/dist/main-early-input.d.ts.map +1 -0
  585. package/dist/main-early-input.js +154 -0
  586. package/dist/main-early-input.js.map +1 -0
  587. package/dist/main-session.d.ts.map +1 -1
  588. package/dist/main-session.js +1 -0
  589. package/dist/main-session.js.map +1 -1
  590. package/dist/main.d.ts +0 -6
  591. package/dist/main.d.ts.map +1 -1
  592. package/dist/main.js +47 -39
  593. package/dist/main.js.map +1 -1
  594. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  595. package/dist/modes/interactive/components/chat-session-host-actions.js +0 -1
  596. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  597. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  598. package/dist/modes/interactive/components/chat-session-host-events.js +15 -0
  599. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  600. package/dist/modes/interactive/components/settings-selector-options.d.ts.map +1 -1
  601. package/dist/modes/interactive/components/settings-selector-options.js +3 -1
  602. package/dist/modes/interactive/components/settings-selector-options.js.map +1 -1
  603. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  604. package/dist/modes/interactive/components/thinking-selector.js +2 -1
  605. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  606. package/dist/modes/interactive/interactive-agent-events.d.ts.map +1 -1
  607. package/dist/modes/interactive/interactive-agent-events.js +37 -2
  608. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  609. package/dist/modes/interactive/interactive-auth-login.d.ts.map +1 -1
  610. package/dist/modes/interactive/interactive-auth-login.js +0 -1
  611. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  612. package/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
  613. package/dist/modes/interactive/interactive-autocomplete.js +21 -9
  614. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  615. package/dist/modes/interactive/interactive-child-ordering.d.ts +7 -0
  616. package/dist/modes/interactive/interactive-child-ordering.d.ts.map +1 -0
  617. package/dist/modes/interactive/interactive-child-ordering.js +26 -0
  618. package/dist/modes/interactive/interactive-child-ordering.js.map +1 -0
  619. package/dist/modes/interactive/interactive-deferred-startup.d.ts +8 -1
  620. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
  621. package/dist/modes/interactive/interactive-deferred-startup.js +86 -26
  622. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  623. package/dist/modes/interactive/interactive-editor-actions.d.ts.map +1 -1
  624. package/dist/modes/interactive/interactive-editor-actions.js +13 -13
  625. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  626. package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
  627. package/dist/modes/interactive/interactive-extension-runtime.js +16 -0
  628. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  629. package/dist/modes/interactive/interactive-hotkeys-debug.d.ts.map +1 -1
  630. package/dist/modes/interactive/interactive-hotkeys-debug.js +4 -3
  631. package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
  632. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  633. package/dist/modes/interactive/interactive-input-handling.js +360 -230
  634. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  635. package/dist/modes/interactive/interactive-mode-base.d.ts +19 -4
  636. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  637. package/dist/modes/interactive/interactive-mode-base.js +46 -4
  638. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  639. package/dist/modes/interactive/interactive-mode-deps.d.ts +3 -3
  640. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  641. package/dist/modes/interactive/interactive-mode-deps.js +3 -3
  642. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  643. package/dist/modes/interactive/interactive-mode-surface.d.ts +27 -17
  644. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  645. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  646. package/dist/modes/interactive/interactive-mode-types.d.ts +8 -1
  647. package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
  648. package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
  649. package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
  650. package/dist/modes/interactive/interactive-model-routing.js +14 -10
  651. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  652. package/dist/modes/interactive/interactive-onboarding.d.ts +0 -9
  653. package/dist/modes/interactive/interactive-onboarding.d.ts.map +1 -1
  654. package/dist/modes/interactive/interactive-onboarding.js +24 -201
  655. package/dist/modes/interactive/interactive-onboarding.js.map +1 -1
  656. package/dist/modes/interactive/interactive-process-lifecycle.d.ts.map +1 -1
  657. package/dist/modes/interactive/interactive-process-lifecycle.js +43 -9
  658. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  659. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  660. package/dist/modes/interactive/interactive-render-chat.js +93 -10
  661. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  662. package/dist/modes/interactive/interactive-resource-disclosure.d.ts.map +1 -1
  663. package/dist/modes/interactive/interactive-resource-disclosure.js +3 -2
  664. package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
  665. package/dist/modes/interactive/interactive-resource-rendering.d.ts.map +1 -1
  666. package/dist/modes/interactive/interactive-resource-rendering.js +10 -8
  667. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  668. package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
  669. package/dist/modes/interactive/interactive-session-routing.js +9 -5
  670. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  671. package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
  672. package/dist/modes/interactive/interactive-session-runtime.js +1 -1
  673. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  674. package/dist/modes/interactive/interactive-slash-commands.d.ts.map +1 -1
  675. package/dist/modes/interactive/interactive-slash-commands.js +1 -1
  676. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  677. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  678. package/dist/modes/interactive/interactive-startup.js +102 -98
  679. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  680. package/dist/modes/interactive/theme/global-theme.d.ts.map +1 -1
  681. package/dist/modes/interactive/theme/global-theme.js +26 -2
  682. package/dist/modes/interactive/theme/global-theme.js.map +1 -1
  683. package/dist/modes/interactive/theme/theme-class.d.ts +1 -1
  684. package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
  685. package/dist/modes/interactive/theme/theme-class.js +2 -0
  686. package/dist/modes/interactive/theme/theme-class.js.map +1 -1
  687. package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
  688. package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
  689. package/dist/modes/interactive/theme/theme-loading.js +3 -0
  690. package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
  691. package/dist/modes/interactive/theme/theme.d.ts +1 -1
  692. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  693. package/dist/modes/interactive/theme/theme.js +1 -1
  694. package/dist/modes/interactive/theme/theme.js.map +1 -1
  695. package/dist/utils/child-process.d.ts +8 -1
  696. package/dist/utils/child-process.d.ts.map +1 -1
  697. package/dist/utils/child-process.js +39 -6
  698. package/dist/utils/child-process.js.map +1 -1
  699. package/dist/utils/clipboard-image.d.ts.map +1 -1
  700. package/dist/utils/clipboard-image.js +3 -0
  701. package/dist/utils/clipboard-image.js.map +1 -1
  702. package/dist/utils/event-loop.d.ts +7 -0
  703. package/dist/utils/event-loop.d.ts.map +1 -0
  704. package/dist/utils/event-loop.js +14 -0
  705. package/dist/utils/event-loop.js.map +1 -0
  706. package/dist/utils/fs-watch.d.ts +24 -1
  707. package/dist/utils/fs-watch.d.ts.map +1 -1
  708. package/dist/utils/fs-watch.js +60 -5
  709. package/dist/utils/fs-watch.js.map +1 -1
  710. package/dist/utils/json.d.ts +4 -0
  711. package/dist/utils/json.d.ts.map +1 -1
  712. package/dist/utils/json.js +8 -0
  713. package/dist/utils/json.js.map +1 -1
  714. package/dist/utils/module-require.d.ts +11 -0
  715. package/dist/utils/module-require.d.ts.map +1 -1
  716. package/dist/utils/module-require.js +14 -1
  717. package/dist/utils/module-require.js.map +1 -1
  718. package/dist/utils/split-launcher.d.ts +38 -0
  719. package/dist/utils/split-launcher.d.ts.map +1 -0
  720. package/dist/utils/split-launcher.js +63 -0
  721. package/dist/utils/split-launcher.js.map +1 -0
  722. package/docs/changelog.mdx +19 -0
  723. package/docs/compaction.md +100 -64
  724. package/docs/custom-provider.md +18 -5
  725. package/docs/development.md +4 -0
  726. package/docs/extensions.md +11 -2
  727. package/docs/json.md +3 -1
  728. package/docs/keybindings.md +2 -2
  729. package/docs/models.md +69 -10
  730. package/docs/providers.md +3 -2
  731. package/docs/quickstart.md +15 -11
  732. package/docs/rpc.md +5 -3
  733. package/docs/sdk.md +1 -1
  734. package/docs/settings.md +33 -3
  735. package/docs/subagents.md +40 -5
  736. package/docs/terminal-setup.md +4 -0
  737. package/docs/tools.md +1 -1
  738. package/docs/usage.md +8 -6
  739. package/docs/windows.md +4 -0
  740. package/docs/workflows.md +59 -36
  741. package/examples/extensions/preset.ts +2 -2
  742. package/examples/extensions/subagent/README.md +2 -2
  743. package/examples/extensions/subagent/index.ts +1 -2
  744. package/examples/extensions/subagent/schemas.ts +4 -1
  745. package/examples/sdk/12-full-control.ts +1 -1
  746. package/npm-shrinkwrap.json +538 -51
  747. package/package.json +10 -9
  748. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-behavior.ts +0 -75
  749. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-component.ts +0 -202
  750. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-edit.ts +0 -97
  751. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-editor.ts +0 -160
  752. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-frame.ts +0 -72
  753. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-render-modes.ts +0 -161
  754. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-render-selectors.ts +0 -203
  755. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-selectors.ts +0 -234
  756. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-state.ts +0 -103
  757. package/dist/builtin/subagents/src/runs/foreground/chain-clarify-types.ts +0 -29
  758. package/dist/builtin/subagents/src/runs/foreground/chain-clarify.ts +0 -9
  759. package/dist/builtin/subagents/src/runs/foreground/chain-execution-clarify.ts +0 -117
package/docs/models.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.atomic/agent/models.json` (legacy `~/.pi/agent/models.json` is also read).
4
4
 
5
+ When both files exist, Atomic reads the legacy `.pi` file first and the primary `.atomic` file second. For `modelOverrides`, entries are layered by provider and model ID: disjoint legacy entries remain available, while an exact primary provider/model entry replaces the complete legacy override entry. Atomic does not field-merge one override entry across files; use `{}` in the primary file to restore the built-in model values for that exact entry.
6
+
5
7
  Built-in subscription providers such as Cursor (experimental) are selected with the same `provider/model` syntax, for example `cursor/composer-2`. Cursor image input is scoped to known multimodal Cursor Claude, Composer, Gemini, GPT, and Kimi model families (`claude-`, `composer-`, `gemini-`, `gpt-`, `kimi-`), plus `grok-4.3`; text-only Cursor models still reject images. Cursor image payloads must be non-empty standard base64, with MIME-style line wrapping whitespace accepted and stripped before serialization. Live private-API model metadata may fall back to estimated labels. Because Cursor support targets undocumented private endpoints with Cursor CLI-compatible headers, maintainers and users should explicitly accept the risk that it may conflict with Cursor's terms, break without notice, or affect the Cursor account used to authenticate.
6
8
 
7
9
  When Cursor omits token limits, Atomic derives them from its bundled `@earendil-works/pi-ai` model catalog and treats explicit `1M` Cursor labels as a 1,000,000-token context floor; unmatched Cursor-only models keep conservative estimates instead of disappearing from `/model`.
@@ -13,6 +15,7 @@ When Cursor omits token limits, Atomic derives them from its bundled `@earendil-
13
15
  - [Supported APIs](#supported-apis)
14
16
  - [Provider Configuration](#provider-configuration)
15
17
  - [Model Configuration](#model-configuration)
18
+ - [Request-wide Cost Tiers](#request-wide-cost-tiers)
16
19
  - [Overriding Built-in Providers](#overriding-built-in-providers)
17
20
  - [Per-model Overrides](#per-model-overrides)
18
21
  - [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
@@ -143,7 +146,7 @@ Set `api` at provider level (default for all models) or model level (override pe
143
146
  | `headers` | Custom headers (see value resolution below) |
144
147
  | `authHeader` | Set `true` to add `Authorization: Bearer <apiKey>` automatically |
145
148
  | `models` | Array of model configurations |
146
- | `modelOverrides` | Per-model overrides for built-in models on this provider |
149
+ | `modelOverrides` | Per-model overrides for matching built-in or extension-registered models on this provider |
147
150
 
148
151
  ### Value Resolution
149
152
 
@@ -203,16 +206,64 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
203
206
  | `contextWindow` | No | `128000` | Default/effective context window size in tokens |
204
207
  | `contextWindowOptions` | No | omitted | Additional/selectable context windows in tokens (see below) |
205
208
  | `maxTokens` | No | `16384` | Maximum output tokens |
206
- | `cost` | No | all zeros | `{"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0}` (per million tokens) |
209
+ | `cost` | No | all zeros | Complete base rates per million tokens plus optional request-wide `tiers` (see below) |
207
210
  | `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
208
211
 
209
212
  Current behavior:
210
213
  - `/model`, `--list-models`, and the interactive footer display entries by model `id`.
211
214
  - The configured `name` is used for model matching and secondary model detail text. It does not replace the footer/status-bar model id.
212
215
 
216
+ ### Request-wide Cost Tiers
217
+
218
+ Custom models can declare request-wide long-context pricing under `cost.tiers`. The base `cost` and every tier must provide all four rates: `input`, `output`, `cacheRead`, and `cacheWrite`, in cost per million tokens. Each tier also requires `inputTokensAbove`.
219
+
220
+ ```json
221
+ {
222
+ "id": "long-context-model",
223
+ "cost": {
224
+ "input": 1,
225
+ "output": 2,
226
+ "cacheRead": 0.25,
227
+ "cacheWrite": 0.5,
228
+ "tiers": [
229
+ {
230
+ "inputTokensAbove": 272000,
231
+ "input": 2,
232
+ "output": 3,
233
+ "cacheRead": 0.5,
234
+ "cacheWrite": 1
235
+ }
236
+ ]
237
+ }
238
+ }
239
+ ```
240
+
241
+ Atomic chooses one rate set for the entire request. It calculates aggregate input as `input + cacheRead + cacheWrite`, selects only tiers whose threshold is **strictly exceeded**, and uses the matching tier with the highest `inputTokensAbove`. Exactly 272,000 aggregate input tokens in the example still use the base rates; 272,001 use every rate from the tier, including the tier's output rate.
242
+
243
+ For `modelOverrides`, `cost` is partial: any supplied scalar rate replaces that scalar while omitted scalar rates remain inherited. A scalar-only cost override also preserves inherited tiers. Supplying `tiers` replaces the whole inherited tier array; use `"tiers": []` to clear it explicitly. Every supplied replacement tier must still be complete.
244
+
245
+ ```json
246
+ {
247
+ "providers": {
248
+ "openai": {
249
+ "modelOverrides": {
250
+ "gpt-5.6-sol": {
251
+ "cost": {
252
+ "input": 4,
253
+ "tiers": []
254
+ }
255
+ }
256
+ }
257
+ }
258
+ }
259
+ }
260
+ ```
261
+
262
+ This override changes only the base input rate, retains the model's other base rates, and clears its inherited long-context tiers.
263
+
213
264
  ### Thinking Level Map
214
265
 
215
- Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are Atomic thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
266
+ Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are Atomic thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. A level is selectable only when the active model supports it; `xhigh` and `max` are not universal provider capabilities.
216
267
 
217
268
  Values are tristate:
218
269
 
@@ -233,7 +284,8 @@ Example for a model that only supports off, high, and max reasoning:
233
284
  "low": null,
234
285
  "medium": null,
235
286
  "high": "high",
236
- "xhigh": "max"
287
+ "xhigh": null,
288
+ "max": "max"
237
289
  }
238
290
  }
239
291
  ```
@@ -366,7 +418,7 @@ Merge semantics:
366
418
 
367
419
  ## Per-model Overrides
368
420
 
369
- Use `modelOverrides` to customize specific built-in models without replacing the provider's full model list.
421
+ Use `modelOverrides` to customize specific models without replacing the provider's full model list. Overrides apply to matching built-in models and to models later registered by an extension through `pi.registerProvider()`.
370
422
 
371
423
  ```json
372
424
  {
@@ -387,13 +439,20 @@ Use `modelOverrides` to customize specific built-in models without replacing the
387
439
  }
388
440
  ```
389
441
 
390
- `modelOverrides` supports these fields per model: `name`, `reasoning`, `input`, `cost` (partial), `contextWindow`, `contextWindowOptions`, `maxTokens`, `headers`, `compat`.
442
+ `modelOverrides` supports these fields per model: `name`, `reasoning`, `thinkingLevelMap`, `input`, `cost` (partial scalar rates plus optional full tier-array replacement), `contextWindow`, `contextWindowOptions`, `maxTokens`, `headers`, `compat`.
443
+
444
+ When both `~/.pi/agent/models.json` and `~/.atomic/agent/models.json` define `modelOverrides`, Atomic merges their nested provider/model maps in that order. Different model IDs survive from both files. For the same provider and model ID, the primary `.atomic` entry replaces the entire legacy `.pi` override entry rather than deep-merging individual fields. This complete-entry rule includes `headers`: a primary exact override without headers removes headers that came from the legacy override, but does not erase a surviving custom model definition's own headers. An empty primary override (`{}`) therefore restores the model's built-in values for that entry.
445
+
446
+ Within a single file, custom model definitions replace matching built-in entries after built-in overrides are applied. `modelOverrides` composes only with built-in and extension-registered models; it does not modify a same-ID custom model definition.
391
447
 
392
448
  Behavior notes:
393
- - `modelOverrides` are applied to built-in provider models.
394
- - Unknown model IDs are ignored.
395
- - You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
396
- - If `models` is also defined for a provider, custom models are merged after built-in overrides. A custom model with the same `id` replaces the overridden built-in model entry.
449
+ - Atomic retains the parsed override map even when an extension registers the matching provider/model after `models.json` is loaded.
450
+ - Layered primary/legacy compatibility merges override maps by provider and model ID; disjoint entries survive, while a primary exact entry replaces the complete legacy entry without cross-file field-level merging.
451
+ - For matching built-in and extension-registered models, the model definition is the base and `modelOverrides` wins configured fields. Extension-registered model headers are shallow-merged with override headers, with override headers winning duplicate names. A same-ID custom model replaces the built-in override result, including its complete header record.
452
+ - A scalar-only `cost` override preserves inherited tiers. Supplying `cost.tiers` replaces the complete tier array, including `[]` to clear it; omitted scalar cost fields remain inherited.
453
+ - Provider-level request headers remain a separate provider layer and are combined at request time.
454
+ - Unknown model IDs are ignored unless a matching model is subsequently registered by an extension.
455
+ - If `models` is also defined for a provider in `models.json`, those custom models are merged after built-in overrides. A custom model with the same `id` replaces the overridden built-in model entry.
397
456
 
398
457
  ## Anthropic Messages Compatibility
399
458
 
package/docs/providers.md CHANGED
@@ -38,12 +38,13 @@ Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party h
38
38
  ### GitHub Copilot
39
39
 
40
40
  - Press Enter for github.com, or enter your GitHub Enterprise Server domain
41
- - When using `COPILOT_GITHUB_TOKEN` instead of `/login`, Atomic uses the token's `proxy-ep` when present, honors `COPILOT_API_TARGET` or `GITHUB_COPILOT_BASE_URL` overrides, derives `copilot-api.<tenant>.ghe.com` from `GITHUB_SERVER_URL=*.ghe.com`, derives `https://api.enterprise.githubcopilot.com` from other non-`github.com` server URLs, and otherwise falls back to the public Copilot routing hub `https://api.githubcopilot.com` instead of the account-specific individual endpoint.
41
+ - When using `COPILOT_GITHUB_TOKEN` instead of `/login`, Atomic uses the token's `proxy-ep` when present, honors `COPILOT_API_TARGET` or `GITHUB_COPILOT_BASE_URL` overrides, derives the tenant-specific GHE routing host from `GITHUB_SERVER_URL=*.ghe.com`, derives `https://api.enterprise.githubcopilot.com` from other non-`github.com` server URLs, and otherwise falls back to the public Copilot routing hub `https://api.githubcopilot.com` instead of the account-specific individual endpoint.
42
42
  - If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
43
43
  - GitHub Copilot models are populated dynamically from Copilot's live CAPI `/models` catalog when Copilot auth is available. Atomic synthesizes only picker-enabled, non-disabled `chat` entries with plain ids (for example `github-copilot/claude-sonnet-5` and `github-copilot/mai-code-1-flash-picker`); namespaced enterprise deployments containing `/` are skipped rather than exposed as `github-copilot/*` models. Models that advertise long-context limits, such as `github-copilot/gpt-5.5`, `github-copilot/claude-opus-4.8`, and `github-copilot/gemini-3.1-pro-preview`, expose an opt-in long-context choice through `--context-window`, the `/model` selection flow, per-model `defaultContextWindows`, SDK, and RPC controls. The long-context option advertises the model's full context window (for example `1m` or `1.05m` — GitHub's `max_context_window_tokens`), matching how the native `openai/*` and `anthropic/*` providers report these models and what the chat footer shows. GitHub's lower server-side prompt cap (`max_prompt_tokens`, for example `936k` or `922k`) is retained internally as the effective input budget that drives compaction thresholds and overflow recovery, and GitHub's live output cap (`max_output_tokens`) replaces Atomic's bundled `maxTokens` fallback for provider requests. If CAPI advertises `capabilities.supports.reasoning_effort` as an array, Atomic also gates `/model` and thinking-level cycling to only those live levels for both dynamic Copilot models and bundled `pi-ai` Copilot models; budget-only or boolean-only reasoning metadata leaves the existing thinking map untouched. Active interactive sessions refresh from this metadata as soon as the catalog is applied, so a startup fallback model does not keep stale reasoning levels until restart. This lets Atomic display the branded context window, request the catalog-advertised output budget, and avoid offering unsupported Copilot reasoning levels.
44
44
  - Selecting long context sets Atomic's displayed window to the model's full capacity while compaction triggers against the effective prompt-token budget, and makes Copilot requests include `X-GitHub-Api-Version: 2026-06-01`. Atomic does not send a body field, `contextTier`, or model-id variant; GitHub automatically applies the server-side `long_context` tier when prompt tokens exceed the default budget.
45
45
  - Long-context Copilot requests consume more AI credits and require Copilot long-context/usage-based billing entitlement. A prompt that reaches the model's normal prompt cap is compacted and retried automatically. Only when GitHub rejects a prompt *below* that cap — for example because the account lacks the long-context/usage-based billing entitlement and is dropped to a smaller server tier — does Atomic surface a friendly entitlement/server-cap/cost hint rather than silently truncating context.
46
46
  - **Gemini models** (`github-copilot/gemini-3.1-pro-preview`, `github-copilot/gemini-3.5-flash`, …) are served through Copilot's CAPI gateway, which re-translates the OpenAI request into Google's GenAI format and enforces Gemini's stricter `FunctionDeclaration` schema (it rejects a tool-parameter `anyOf`/`oneOf` whose branch is a complex object, returning `400 invalid request body`). Atomic automatically sanitizes outbound tool/function JSON Schemas for these models into the supported subset — resolving object/array-bearing unions to their most expressive branch, converting `const`/literal unions to `enum`, collapsing nullable unions to `nullable`, and dropping non-portable keywords such as `additionalProperties`, `patternProperties`, `format`, and numeric/length bounds. Gemini also serializes array/object tool-call **arguments** as flattened indexed keys (`keywords[0]`, `keywords[1]`, …); Atomic reconstructs these back into proper arrays/objects before validation so tool calls (including `structured_output` and MCP tools) don't fail and loop. Both transforms are transparent and scoped to GitHub Copilot Gemini models only; no configuration is required and other providers/models are unaffected.
47
+ - **Claude/Anthropic Messages models** served through GitHub Copilot use Copilot SSE transport. If Copilot cleanly ends a `/v1/messages` stream after Anthropic terminal stop-reason evidence but omits the required `message_stop` event, Atomic adds that one terminal event before provider parsing so the turn can finish normally, including when the final complete SSE frame reaches EOF without a trailing blank-line separator. The repair covers public Copilot hosts and GHE tenant routes such as `copilot-api.<enterprise>.ghe.com`, and is otherwise limited to closed, non-error Copilot Anthropic event streams; malformed, truncated, already well-formed, non-Copilot/look-alike host, non-SSE, Gemini, and OpenAI-style streams continue through the normal parser and retry behavior.
47
48
 
48
49
  ### Cursor (experimental)
49
50
 
@@ -56,7 +57,7 @@ Current limitations:
56
57
  - For image-capable Cursor models, Atomic serializes user images and mixed text/image MCP tool results into Cursor's private request format. Image payloads must be non-empty standard base64; MIME-style line wrapping whitespace is accepted and stripped before serialization.
57
58
  - Model metadata is cached token-free in `~/.atomic/agent/cursor-model-catalog.json` and can be used at startup before fresh credentials are available. Estimated labels are used only when no valid cache exists and allowed live `GetUsableModels` discovery failures occur; refresh-time discovery is best-effort so rotated credentials are still persisted.
58
59
  - Cursor's private model discovery does not return token-limit metadata. Atomic preserves any positive limits Cursor does send, then resolves a model's context window and max output tokens from its bundled `@earendil-works/pi-ai` model catalog by matching the Cursor model ID's family/version. Explicit `1M` Cursor ids or labels on any fast/thinking sibling for the same family are treated as a 1,000,000-token context floor even when the closest reference match advertises a smaller base window. Cursor-only models with no pi-ai match (for example `composer-*` and `default`/Auto) keep a conservative 200k context / 64k output estimate. This only sets limits; it never changes which Cursor models are listed.
59
- - Cursor thinking levels are derived from the discovered Cursor variants for each model group. Atomic only exposes `xhigh` when Cursor advertises a true `xhigh` or `max` variant for that group; if an older saved `xhigh` selection is restored for a model that currently only has lower-effort variants, the request falls back to the nearest concrete Cursor variant instead of sending an invalid id.
60
+ - Cursor thinking levels are derived from the discovered variants for each model group. Atomic exposes `xhigh` only when Cursor advertises an `xhigh` or `max` variant, and exposes the distinct `max` level only when Cursor advertises an actual `max` variant. If an older saved `xhigh` or `max` selection is restored for a model that currently has only lower-effort variants, the request falls back to the nearest concrete Cursor variant instead of sending an invalid id.
60
61
  - The implementation avoids a localhost proxy and keeps credentials OAuth-only. Cursor's HTTP/2 transport uses the bundled `@bastani/atomic-natives` Rust/N-API client, so it does not require Node.js on `PATH`. The native client currently opens request-scoped HTTP/2 sessions; pooling may be added in a future release.
61
62
  - Cursor request encoding intentionally omits a `previousWorkspaceUris` current-directory entry by default so local absolute working-directory paths are not sent as workspace context. HTTP/2 Connect request/framing code is isolated, buffered across arbitrary chunks, tested with injected fakes, and uses a minimal production protobuf codec with field-order-independent exec ids, protobuf `Value` plus raw UTF-8/JSON tool arguments, historical tool-result correlation, checkpoint token-details parsing, paused-stream abort/idle cleanup, catalog-aware fast/thinking model grouping, and credential/PKCE-redacted protocol errors.
62
63
 
@@ -80,9 +80,13 @@ See [Providers](/providers) for all supported providers, environment variables,
80
80
 
81
81
  ## First session
82
82
 
83
- On a fresh install with no prior Atomic startup state, Atomic starts with a first-run workflow prompt. Returning users with prior startup state are marked onboarded automatically and continue directly into the normal chat UI; stored credentials by themselves do not skip onboarding. Paste a ticket description, GitHub issue, path to a spec, or task prompt and Atomic hands it to the normal coding-agent session. The handoff raises the selected model to high reasoning when supported and first asks the parent agent to estimate scope from the seed text alone: tickets, issues, and especially specs often list enough work items, files, tests, docs, migrations, or acceptance criteria to classify likely size without immediately inspecting the repo. That text-only pass is treated as a routing confidence signal, not final planning. If the task is clearly tiny/small and high-confidence, the parent can route directly; if the seed references context that must be read or the scope is medium, large, unclear, or risky, it inspects only the necessary issue/spec/path/repo area and can use targeted read-only subagents such as `codebase-locator`, `codebase-analyzer`, and `codebase-pattern-finder` at their normal defaults. It then chooses `goal` for focused work or `ralph` for broader/riskier work, starts the selected workflow, and continues normally. If you paste the task before logging in or selecting a usable model, Atomic keeps only an in-memory copy, asks you to run `/login`, and resumes with the latest saved task after login or `/model` selection makes the session ready; `/new` starts a fresh unresolved onboarding session and drops that saved in-memory task. If you want normal chat instead, type `/chat` or `/chat <message>`; other slash commands such as `/login`, `/model`, and `/atomic` still work and do not dismiss onboarding.
83
+ On a fresh install with no prior Atomic startup state, Atomic shows a one-time first-run explanation after any What's New notes and directly above the input box describing Atomic as a verifiable coding agent runtime for building and running agent workflows you can feel confident in. Returning users with prior startup state are marked onboarded automatically and continue directly into the normal chat UI; stored credentials by themselves do not skip the first-run explanation. The composer is the normal Atomic input from the start: type a message, run `/login` first if no provider is connected, open `/atomic`, or launch a workflow command without a special onboarding transition.
84
84
 
85
- Once Atomic starts, the fastest way to get value is to kick off a built-in workflow or invoke a skill. Workflows are the default path for non-trivial tasks and for requests with inherent structure plus a verifiable objective, including implementation, build, debugging, bug-fix, migration, new-feature, scoped multi-file, or docs/code-change work where validation matters. If a prompt says `do X until Y`, `repeat until`, `iterate until`, `review/fix until passing`, or `run checks and fix until green`, it already describes a workflow-shaped loop with a stop condition.
85
+ Once Atomic starts, use the least orchestration that fits your intent. Keep interactive or exploratory work in chat; use single, chain, or parallel subagents for bounded specialist delegation; and use workflows for clearly delegated, well-defined autonomous jobs that are likely long-running/background-oriented or materially need durable stages, artifacts/checkpoints, resumability, HIL, gates, retries, or bounded loops. Multiple steps, files, tests, validation, or parallelism alone do not require a workflow.
86
+
87
+ Loop or stop-condition phrasing is a key workflow signal. Requests such as `do X until Y`, `repeat until`, `iterate until`, `review/fix until passing`, `run checks and fix until green`, or `keep going until done` should generally use a workflow when the user is delegating execution, so the stop condition, retries, evidence, and convergence are tracked.
88
+
89
+ When workflow execution fits, Atomic may always author a custom TypeScript `workflow({...})` inline with normal coding tools if that shape best achieves the task; it is not limited to installed workflows or direct modes.
86
90
 
87
91
  Atomic turns repeatable engineering loops into executable stages with inspectable evidence instead of relying on a markdown checklist the model may or may not follow.
88
92
 
@@ -95,8 +99,8 @@ Atomic ships with four workflows you can run immediately. Use `/workflow list` t
95
99
  | Workflow | When to use | Example |
96
100
  |---|---|---|
97
101
  | `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?"` |
98
- | `goal` | Bounded one-off changes when you already know the work surface, exact outcome, and validation for example bug fixes, debugging, tests, lint/typecheck, docs builds, observable behavior, scoped multi-file edits, or a review/fix/test loop that should continue until passing. Keeps the run focused with a goal ledger, reviewer gates, final status `complete`, `blocked`, or `needs_human`, and optional final-stage PR creation with `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"` |
99
- | `ralph` | Planned or broad implementation work from a spec file, GitHub issue, or crisp ticket description, including migrations and new features. Ralph researches as needed, delegates implementation through sub-agents, reviews, records a QA proof video for UI/full-stack changes when practical, iterates until approval or the loop limit, 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"` |
102
+ | `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"` |
103
+ | `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"` |
100
104
  | `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"` |
101
105
 
102
106
  <p align="center"><img src="images/workflow-list.png" alt="Workflow List" width="600" /></p>
@@ -115,13 +119,13 @@ Use the goal workflow to update the CLI docs for --json, include one example, ru
115
119
 
116
120
  Atomic picks the workflow, fills in inputs from the request, and confirms before launch.
117
121
 
118
- For planned work, make `ralph` the default implementation loop after research or spec creation. Give it a spec file, GitHub issue, or crisp ticket description; it refines the prompt, researches as needed, delegates implementation, reviews, records a QA proof video for UI/full-stack changes when practical, and iterates. Add `create_pr=true` only when you want the final PR handoff after the review gate approves.
122
+ For a clearly delegated broad autonomous implementation job that benefits from a research/review loop, `ralph` is one available builtin. Give it a spec file, GitHub issue, or crisp ticket description; it refines the prompt, researches as needed, delegates implementation, reviews, records a QA proof video for UI/full-stack changes when practical, and iterates. Add `create_pr=true` only when you want the final PR handoff after the review gate approves.
119
123
 
120
- For smaller one-off tasks, use `goal` with a concrete task description that names the work surface, desired outcome, and validation. It is the default for small-to-medium non-trivial changes with verifiable done criteria, especially bug fixes, debugging, scoped multi-file edits, and prompts that say to review/fix, test/fix, or iterate until passing. It keeps the run bounded, captures receipts in a goal ledger, gates completion through reviewers, stops as `complete`, `blocked`, or `needs_human`, and can optionally run only the final PR handoff with `create_pr=true` after approval.
124
+ For an autonomous one-off job that materially benefits from a durable goal ledger, bounded worker turns, and reviewer gates, use `goal` with a concrete task description that names the work surface, desired outcome, and validation. An ordinary small-to-medium change does not require it merely because it has tests, validation, or multiple files, but loop or stop-condition wording is a key workflow signal when the user delegates execution. Goal captures receipts, stops as `complete`, `blocked`, or `needs_human`, and can optionally run only the final PR handoff with `create_pr=true` after approval.
121
125
 
122
126
  ### Monitor and steer a run
123
127
 
124
- Named workflow runs execute in the background. After launch you get a run id; use it to inspect, attach, pause, or resume. First-run `goal`/`ralph` handoffs show the exact `/workflow status <run-id>` and `/workflow connect <run-id>` commands in the dispatched card, and you can also ask in the current chat for status or to steer the run at any point.
128
+ Named workflow runs execute in the background. After launch you get a run id; use it to inspect, attach, pause, or resume.
125
129
 
126
130
  ```text
127
131
  /workflow status <run-id> # inspect one run's progress
@@ -147,15 +151,15 @@ Skills are reusable expert instructions. Trigger one with `/skill:<name>` follow
147
151
  | `create-spec` | Turn research into an implementation-ready plan. | `/skill:create-spec from research/docs/2026-03-rate-limit.md` |
148
152
  | `prompt-engineer` | Tighten a vague prompt before a long run. | `/skill:prompt-engineer Draft a sharper repo-research prompt for payment retries end to end.` |
149
153
  | `tdd` | Test-first feature or bug work. | `/skill:tdd` |
150
- | `impeccable` | Critique or refine frontend and product UI. | `/skill:impeccable` |
154
+ | `impeccable` | Critique or refine web/native frontend and product UI; includes detector hooks. | `/skill:impeccable` |
151
155
  | `playwright-cli` | Drive a real browser for end-to-end UI checks, screenshots, and reviewable proof videos. | `/skill:playwright-cli` |
152
156
  | `effective-liteparse` | Pull text, tables, or values out of PDF, DOCX, PPTX, XLSX, and image files locally. | `/skill:effective-liteparse` |
153
157
 
154
- Use `/skill:research-codebase` for a focused area and `/workflow deep-research-codebase` when the answer spans the whole repo. A typical planned flow is `/skill:research-codebase` `/skill:create-spec` `/workflow ralph` with the spec path, a GitHub issue, or a crisp ticket description. For smaller one-off tasks, use `/workflow goal` with a concrete objective that identifies the work surface, states the exact outcome, and names the validation that proves it is done; add `create_pr=true` only when you want Goal's final `pull-request` stage after approval.
158
+ Use `/skill:research-codebase` for a focused area and `/workflow deep-research-codebase` when a clearly delegated repo-wide research job benefits from durable stages and artifacts. Keep conversation-led planning and implementation inline, or use bounded subagents while the parent remains in control. When an autonomous implementation job needs durable execution, use `/workflow goal` for a goal ledger, bounded worker turns, and reviewer-gated completion, or `/workflow ralph` for a research-first pipeline with delegated implementation and iterative review. Task size alone does not select either workflow. Add `create_pr=true` only when you want the workflow's final pull-request stage after approval.
155
159
 
156
160
  ### Create your own workflow in natural language
157
161
 
158
- You do not have to write TypeScript to add a new workflow. Describe what you want in plain chat and Atomic will design and write it for you using the [Workflows](/workflows) reference as the source of truth:
162
+ Named workflows may be builtin, project, user, or package supplied. You do not have to hand-write TypeScript to add a new workflow. Describe what you want in plain chat and Atomic will design and write it for you using the [Workflows](/workflows) reference as the source of truth:
159
163
 
160
164
  ```text
161
165
  Create a reusable Atomic workflow called review-changes. It takes one
@@ -218,7 +222,7 @@ Restart Atomic, or run `/reload`, after changing context files.
218
222
 
219
223
  ### Reference files
220
224
 
221
- Type `@` in any interactive editor, including first-run onboarding, to fuzzy-search files; or pass files on the command line:
225
+ Type `@` in any interactive editor to fuzzy-search files; or pass files on the command line:
222
226
 
223
227
  ```bash
224
228
  atomic @README.md "Summarize this"
package/docs/rpc.md CHANGED
@@ -347,9 +347,9 @@ Set the reasoning/thinking level for models that support it.
347
347
  {"type": "set_thinking_level", "level": "high"}
348
348
  ```
349
349
 
350
- Levels: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`
350
+ Levels: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"`.
351
351
 
352
- Note: `"xhigh"` is only supported by OpenAI codex-max models.
352
+ `xhigh` and `max` are available only when the active model's capability mapping supports them; unsupported levels are clamped by the session model controls.
353
353
 
354
354
  Response:
355
355
  ```json
@@ -1076,12 +1076,14 @@ The `reason` field is `"manual"`, `"threshold"`, or `"overflow"`.
1076
1076
  }
1077
1077
  ```
1078
1078
 
1079
- If `reason` was `"overflow"` and compaction succeeds, `willRetry` is `true` and the agent will automatically retry the prompt.
1079
+ If `reason` was `"overflow"` and compaction succeeds, `willRetry` is `true` and the agent will automatically retry the prompt. Public prompt/RPC callers wait for that post-compaction continuation before the prompt is considered complete.
1080
1080
 
1081
1081
  If compaction was aborted, `result` is `null` and `aborted` is `true`.
1082
1082
 
1083
1083
  If compaction failed (e.g., API quota exceeded), `result` is `null`, `aborted` is `false`, and `errorMessage` contains the error description.
1084
1084
 
1085
+ If overflow recovery exhausts the same-model compact-and-retry attempt, `compaction_end` includes `"unresolvedOverflow": true` and an `errorMessage`. Workflow orchestration treats that signal as a context-length failure that can advance configured model fallback tiers.
1086
+
1085
1087
  ### context_compaction_start / context_compaction_end
1086
1088
 
1087
1089
  The compatibility RPC command `context_compact` emits these events. It uses the same deletion-only Verbatim Compaction path as `compact`, but reports the historical context-compaction event names. The result contains `deletedTargets`, `protectedEntryIds`, `stats`, `promptVersion`, and optional `backupPath`.
package/docs/sdk.md CHANGED
@@ -417,7 +417,7 @@ const available = await modelRegistry.getAvailable();
417
417
 
418
418
  const { session } = await createAgentSession({
419
419
  model: opus,
420
- thinkingLevel: "medium", // off, minimal, low, medium, high, xhigh
420
+ thinkingLevel: "medium", // off, minimal, low, medium, high, xhigh, max (when supported by the model)
421
421
  contextWindow: 1_000_000, // optional; must be supported by the selected model unless non-strict fallback is acceptable
422
422
  contextWindowStrict: true, // optional; return contextWindowError instead of warning/fallback when unsupported
423
423
 
package/docs/settings.md CHANGED
@@ -21,6 +21,10 @@ If no extension or saved decision applies, `defaultProjectTrust` controls the fa
21
21
 
22
22
  Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.atomic/agent/trust.json` only; the current session is not reloaded, so restart Atomic for changes to take effect.
23
23
 
24
+ If a bare directory starts without trust-gated inputs, Atomic may run the interactive session as implicitly trusted. Inert state directories such as `.atomic/todos/` and `.atomic/sessions/` do not require trust and do not disable deferred resource startup. On the normal interactive TTY fast path, Atomic paints the shell and makes the input editor responsive before scanning bundled extension packages, skills, prompts, themes, context files, and system-prompt files. After the input handler is ready, Atomic starts extension/resource loading in the background. If the first submitted prompt arrives before that loading settles, Atomic keeps the prompt spinner visible and waits at the readiness gate before calling the model so extension tools, prompt templates, skills, resources, and extension-registered provider updates are available on that first turn. Deferred loading uses async discovery and cooperative yields around resource-loading work, so visible typing, Enter, Ctrl+C, rendering, and the normal prompt spinner remain responsive while the background work finishes. Startup does not show a resource-loading spinner before the user submits a prompt. Explicit provider/model selection, explicit resource flags, system-prompt inputs, metadata commands, non-TTY modes, and unresolved project-trust prompts stay on the synchronous path because those operations need complete resources before the session is created. When resources finish loading, Atomic shows the normal resources disclosure so newly added skills, prompts, themes, and extensions are visible. If trust-requiring config appears later, Atomic prompts again on the next launch until you explicitly save a persistent trust decision; the only automatic persistence of implicit startup trust is the existing `/reload` flow after reload discovers trust-requiring resources in an already-trusted session.
25
+
26
+ Settings and trust JSON files may start with a UTF-8 BOM, as commonly written by older Windows tools; Atomic strips that leading marker before parsing.
27
+
24
28
  ## All Settings
25
29
 
26
30
  ### Model & Thinking
@@ -29,9 +33,10 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
29
33
  |---------|------|---------|-------------|
30
34
  | `defaultProvider` | string | - | Default provider (e.g., `"anthropic"`, `"openai"`) |
31
35
  | `defaultModel` | string | - | Default model ID |
32
- | `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"` |
36
+ | `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"`; the active model must support the selected level |
33
37
  | `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
34
38
  | `thinkingBudgets` | object | - | Custom token budgets per thinking level |
39
+ | `fallbackModels` | string[] | - | Ordered main-chat fallback models, written as `"provider/model"` with optional model-supported reasoning suffixes such as `:high`, `:xhigh`, or `:max` |
35
40
 
36
41
  #### thinkingBudgets
37
42
 
@@ -46,6 +51,28 @@ Use `/trust` in interactive mode to save a project trust decision for future ses
46
51
  }
47
52
  ```
48
53
 
54
+ #### fallbackModels
55
+
56
+ `fallbackModels` gives ordinary main-chat turns an ordered model fallback chain. Atomic starts with the selected/default model. If that model exhausts the normal same-model auto-retry loop for a retryable provider/model failure, Atomic switches to the next configured fallback model and continues the same turn. If `retry.enabled` is `false`, Atomic skips same-model retries and moves directly to the next fallback for retryable failures. Non-retryable task failures, cancellations, and context-overflow compaction paths do not trigger model fallback.
57
+
58
+ Fallback entries should be fully qualified `provider/model` ids. Add a reasoning suffix to a candidate to override the effort for that fallback only; valid suffixes are `:off`, `:minimal`, `:low`, `:medium`, `:high`, `:xhigh`, and `:max`. Atomic clamps or hides levels that the selected model's capability map does not support.
59
+
60
+ ```json
61
+ {
62
+ "defaultProvider": "openai-codex",
63
+ "defaultModel": "gpt-5.5",
64
+ "defaultThinkingLevel": "high",
65
+ "fallbackModels": [
66
+ "anthropic/claude-opus-4-8:xhigh",
67
+ "github-copilot/gpt-5.5:high"
68
+ ]
69
+ }
70
+ ```
71
+
72
+ Fallback attempts are visible as model changes in the session transcript and as a fallback status in the UI. Switching providers can change latency, billing, data-handling terms, and subscription/credit usage. Configure only providers you are comfortable sending the current conversation and tool context to.
73
+
74
+ `enabledModels` is separate: it only controls the interactive Ctrl+P model cycle list and is not used as an implicit fallback chain.
75
+
49
76
  ### Codex Fast Mode
50
77
 
51
78
  Use `/fast` in interactive mode to edit these settings. Atomic applies fast mode only to supported `openai/*` and `openai-codex/*` providers, not `github-copilot/*` or other OpenAI-compatible providers. Chat and workflow-stage scopes are independent. When fast mode is active for the current supported model, Atomic shows `fast` after the model name in the chat footer and workflow stage model labels. Enable the workflow scope deliberately for broad fan-outs because each eligible stage can consume priority-tier requests.
@@ -74,7 +101,7 @@ Use `/fast` in interactive mode to edit these settings. Atomic applies fast mode
74
101
  | `collapseChangelog` | boolean | `false` | Show condensed changelog after updates |
75
102
  | `enableInstallTelemetry` | boolean | `true` | Send an anonymous install/update version ping after first install or changelog-detected updates. This does not control update checks |
76
103
  | `firstRunOnboardingStartedVersion` | string | - | Internal first-run onboarding start marker used when no prior Atomic startup state identifies the user as returning |
77
- | `onboardedVersion` | string | - | Internal one-time first-run onboarding completion marker. Returning-user detection from prior startup state, `/chat`, or a successful first-run seed handoff into the normal agent session sets it |
104
+ | `onboardedVersion` | string | - | Internal one-time first-run onboarding completion marker. Returning-user detection from prior startup state or displaying the first-run workflow-engine explanation sets it |
78
105
  | `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
79
106
  | `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
80
107
  | `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
@@ -240,13 +267,14 @@ When multiple sources specify a session directory, precedence is `--session-dir`
240
267
 
241
268
  | Setting | Type | Default | Description |
242
269
  |---------|------|---------|-------------|
243
- | `enabledModels` | string[] | - | Model patterns for CTRL+P cycling (same format as `--models` CLI flag) |
270
+ | `enabledModels` | string[] | - | Model patterns for CTRL+P cycling (same format as `--models` CLI flag). In interactive TTY startup, these patterns are resolved again after deferred extension/resource loading so extension-provided providers can match without blocking first paint. |
244
271
  | `defaultContextWindow` | number \| string | model default | Optional global fallback context window for models that expose selectable context windows. Accepts raw token counts or compact labels such as `400k` and `1m`. Unsupported values are ignored for models that do not support them. |
245
272
  | `defaultContextWindows` | object | `{}` | Per-model preferred context windows keyed as `provider/modelId`. The interactive `/model` context picker writes this setting so a Copilot-specific prompt cap such as `936k` does not leak into Anthropic, Cursor, or other providers. |
246
273
 
247
274
  ```json
248
275
  {
249
276
  "enabledModels": ["claude-*", "gpt-4o", "gemini-2*"],
277
+ "fallbackModels": ["anthropic/claude-opus-4-8:xhigh", "github-copilot/gpt-5.5:high"],
250
278
  "defaultContextWindow": "1m",
251
279
  "defaultContextWindows": {
252
280
  "github-copilot/claude-opus-4.8": "936k",
@@ -258,6 +286,8 @@ When multiple sources specify a session directory, precedence is `--session-dir`
258
286
 
259
287
  Context-window settings are independent of `defaultThinkingLevel`: selecting a larger context window does not change reasoning effort. Interactive users can change the active model's budget through the `/model` selection flow, which prompts for a context window whenever the chosen model supports more than one window and persists the effective selection under `defaultContextWindows["provider/modelId"]`. Atomic treats `defaultContextWindow` as a broad fallback only: if the active model does not support that value, the model's own default is used without a startup warning; targeted `defaultContextWindows` entries still warn when they become unsupported for their exact model. Larger provider context windows can carry higher usage cost. For catalog-advertised GitHub Copilot long-context models (including dynamically populated plain catalog ids such as `github-copilot/claude-sonnet-5`, while namespaced enterprise deployment ids containing `/` are skipped), selecting `1m` raises Atomic's local prompt budget to the largest advertised long-context tier at or below that rounded request (for example `922k` or `936k`) and sends `X-GitHub-Api-Version: 2026-06-01`; GitHub then applies the long-context tier server-side by prompt token count. That tier consumes more Copilot AI credits and requires Copilot long-context/usage-based billing entitlement, otherwise requests over the server cap are rejected with a friendly hint. Custom providers and explicit model overrides can still declare their own selectable `contextWindowOptions`.
260
288
 
289
+ `fallbackModels` is independent of both context-window defaults and `enabledModels`: it is consulted only after a retryable main-chat provider/model failure, and each fallback candidate applies its own model-specific context-window defaults when selected.
290
+
261
291
  ### Markdown
262
292
 
263
293
  | Setting | Type | Default | Description |
package/docs/subagents.md CHANGED
@@ -5,7 +5,7 @@ description: "Run focused Atomic child agents"
5
5
 
6
6
  # Subagents
7
7
 
8
- Atomic bundles `@bastani/subagents`, an extension for running focused child agents with their own context. Use it when a task benefits from isolation, parallel investigation, background execution, or a specialist pass for locating code, analyzing behavior, researching references, debugging, or simplifying code.
8
+ Atomic bundles `@bastani/subagents`, an extension for bounded specialist delegation with separate context while the parent remains in control. Use a single agent, chain, or parallel fan-out when isolation or a specialist pass materially helps with locating code, analyzing behavior, researching references, reproducing actual failures, or simplifying code. Keep interactive, exploratory, conceptual, and conversation-led work inline when direct user steering is more useful.
9
9
 
10
10
  You do not need to install anything separately when you use `@bastani/atomic`.
11
11
 
@@ -25,10 +25,26 @@ Run a parallel review composition: one pass for current behavior, one for failur
25
25
  Research the upstream library behavior online, then compare it with our local implementation.
26
26
  ```
27
27
 
28
- Atomic decides whether to call the bundled `subagent` tool, which specialist fits each part, and whether the work should run as a single child, parallel group, chain, foreground run, or background run.
28
+ Atomic decides whether delegation adds value, which specialist fits each bounded part, and whether the work should run as a single child, parallel group, chain, foreground run, or selective background run. Multiple steps, files, tests, validation, or parallelism alone do not require a workflow; clearly delegated long-running autonomous work that needs durable stages, checkpoints, resumability, HIL, gates, retries, or loops is usually better served by a workflow.
29
+
30
+ ## Subagent execution is non-interactive
31
+
32
+ Supported subagent launches start immediately without opening a preview/editor prompt or waiting for terminal input. This applies to single, parallel, chain, foreground, background, fanout, prompt-template, and human-entered `/run`, `/chain`, `/parallel`, and `/run-chain` execution. Ask any necessary questions in the parent conversation before delegating.
33
+
34
+ The human slash commands remain registered and continue to use their separate parsing and event-bridge path, including background and fork flags.
29
35
 
30
36
  Subagents now run and return their results directly. Atomic does not infer acceptance gates from prompt wording, inject `acceptance-report` instructions into child prompts, parse or strip `acceptance-report` blocks, or reject completed child runs because changed-file, test, or review evidence is missing. Put any evidence or validation requirements directly in the task text you give the parent or child agent.
31
37
 
38
+ ## Foreground supervisor coordination
39
+
40
+ When a foreground child sends `intercom.ask`, `intercom.send`, or `contact_supervisor` coordination, Atomic first probes for the exact foreground owner. Only an exact live child reserves the request; Atomic then sends a generation-scoped detach commit and waits for that child to acknowledge it before placing the message in the parent's model-visible steering queue. Unmatched and background-child messages retain the existing queued-until-idle behavior. Blocking `need_decision` and `interview_request` calls remain actionable through Intercom's pending/reply tracker, and the exact threaded reply resumes the retained child without delayed duplicate delivery.
41
+
42
+ Only the matching foreground child releases the parent `subagent` tool. It stays alive under the normal watchdog, cancellation, drain, and stdio cleanup lifecycle; its eventual completion replaces the detached placeholder. Fire-and-forget `intercom.send` and `progress_update` also release foreground supervision promptly, but do not create a reply waiter.
43
+
44
+ Interactive parent sessions lazily register with Intercom when needed; a foreground launch awaits the parent's broker/inbound-handler readiness before the child process can coordinate. Bridged foreground and background children register before agent work begins. Disabled, unavailable, noninteractive, unused-parent, and management-only `list`/`get`/`create`/`update`/`delete`/`status`/`interrupt`/`doctor` paths do not force heavy runtime loading or broker startup. `resume` remains launch-capable and retains the readiness gate. Optional Intercom import, broker, or connection failures are diagnosed without aborting launch, and later calls can retry. Cancellation or session replacement invalidates the handshake generation, so stale acknowledgements cannot surface or detach a child.
45
+
46
+ Atomic's implementation adapts the prompt foreground release and later-result recovery contracts proven in `nicobailon/pi-subagents` commits `1b55c8c`, `589e51e`, `68fb528`, and `9dfe3df`; it retains Atomic's broker and raw-TypeScript architecture rather than copying upstream's filesystem transport.
47
+
32
48
  ## Migration from acceptance gates
33
49
 
34
50
  If you have older subagent calls, saved chains, or custom agents that used the removed gate fields:
@@ -78,7 +94,7 @@ Useful prompt templates include `/parallel-review`, `/review-loop`, `/parallel-r
78
94
 
79
95
  ## Background work and control
80
96
 
81
- Foreground subagents stream progress in the conversation. Background subagents keep working after control returns to you and report completion later.
97
+ Foreground subagents stream progress in the conversation and are the right default when the parent needs the result before proceeding. Use background subagents selectively for genuinely long-running or independently useful bounded delegation; they keep working after control returns and report completion later.
82
98
 
83
99
  Natural-language examples:
84
100
 
@@ -103,7 +119,11 @@ subagent({ action: "doctor" })
103
119
 
104
120
  Use `interrupt` when you want a resumable stop. Use `resume` to send a follow-up to a reachable async child, or to revive a completed child from its saved session when the run has enough metadata. Use `doctor` for read-only setup diagnostics.
105
121
 
106
- Background runs are detached. If Atomic has no useful independent work while a background subagent runs, it should end the turn instead of polling in a loop; the run will notify the originating session when it completes.
122
+ Background runs are detached. Their acknowledgement explicitly says the run was launched and completion is pending: the launch tool call itself is terminal, while the detached child continues and will notify the originating session when it completes. If Atomic has no useful independent work in the meantime, it should end the turn instead of polling in a loop.
123
+
124
+ Completion delivery distinguishes two compatibility surfaces. Intercom delivery is confirmation-based and preserves a successful phase across watcher replacement, so another phase can retry without replaying the parent message. The in-process `subagent:async-complete` event remains a synchronous compatibility emission: returning without an explicit synchronous rejection counts as local acceptance even when no listener is installed. Equivalent result-file aliases coalesce by canonical run identity, while aliases that reuse that identity with different user-visible output or parent targets are retained under collision-resistant names in the non-scanned `.undelivered` directory instead of being delivered or deleted as duplicates. Modern results whose status is not terminal are rechecked with capped exponential delays and still recover if terminal status appears later. Delivery failures also back off; after a finite sequence of attempts with no phase progress, Atomic retains the still-owned result in `.undelivered` and logs its path rather than retrying forever or deleting the payload.
125
+
126
+ When a workflow graph overlay is open, Atomic also publishes the live async subagent summary into the shared status surface. The below-editor async widget remains available when the workflow overlay is hidden, and the overlay statusline keeps the run count/state visible while the graph fills the terminal.
107
127
 
108
128
  ## Context and execution modes
109
129
 
@@ -116,6 +136,21 @@ For adversarial review or research, prefer fresh context so the specialist inspe
116
136
 
117
137
  For parallel implementation work, `worktree: true` can give each child an isolated git worktree so concurrent edits do not clobber each other.
118
138
 
139
+ Fresh child processes use normal Atomic package discovery when an agent omits `extensions`, so bundled lightweight MCP, web-access, and Intercom wrappers are available just as they are in the parent. An explicit `extensions` field (including an empty list) intentionally switches the child to extension-allowlist mode and excludes unlisted builtins; it does not inherit the parent's normal discovery set.
140
+
141
+ Top-level parallel calls support up to 50 subagents after expanding each task's optional `count`. The extension's `parallel.maxTasks` setting defaults to 50 and can enforce a lower task limit; `parallel.concurrency` independently controls how many of those children run at once.
142
+
143
+ When a subagent call, parallel task, chain step, or background run uses a `cwd`, Atomic validates that working directory before starting the child runtime. Missing or non-directory paths are reported as `cwd` problems instead of lower-level process-spawn errors, so failures point at the requested child workspace rather than at the runtime binary.
144
+
145
+ Single-agent calls also accept `reads: string[] | false`. Atomic prepends those files as read context for foreground and background execution through the same path resolver, including `/run agent[reads=a.md+b.md]`. Relative entries resolve against the effective child `cwd` (including a relative top-level `cwd` resolved from the parent); absolute entries are unchanged. Invalid values fail before either child runtime starts.
146
+
147
+ Single-agent calls accept `progress: boolean` in foreground, background, and revived/resumed mode. `progress: true` creates a run-scoped `progress.md` under isolated subagent artifact storage and instructs the child to maintain it without writing `progress.md` into the child `cwd`; `progress: false` disables an agent's `defaultProgress`. When `progress` is omitted, the agent's default is inherited, except that inherited progress is suppressed for read-only tasks (`progress: true` still explicitly opts in). Foreground runs remove this run-owned progress storage after the child exits when `artifacts: false`, including children temporarily detached for intercom coordination. This is separate from `includeProgress: true`, which only includes detailed runtime progress telemetry in the final tool result and does not create or maintain a file.
148
+
149
+ ```ts
150
+ subagent({ agent: "worker", task: "Implement the approved fix.", progress: true })
151
+ subagent({ agent: "worker", task: "Implement it in the background.", progress: true, async: true })
152
+ ```
153
+
119
154
  ## Nested and fanout boundaries
120
155
 
121
156
  Child-safety boundaries are enforced by the bundled subagent extension:
@@ -187,7 +222,7 @@ Each candidate can also carry its own reasoning effort — see [Reasoning levels
187
222
 
188
223
  ## Reasoning levels
189
224
 
190
- Set the reasoning (thinking) effort for each model candidate with a `model_name:thinking_effort` suffix on `model` and on every `fallbackModels` entry. Valid efforts are `off`, `minimal`, `low`, `medium`, `high`, and `xhigh` — the same shorthand used by `atomic --model sonnet:high`.
225
+ Set the reasoning (thinking) effort for each model candidate with a `model_name:thinking_effort` suffix on `model` and on every `fallbackModels` entry. Valid efforts are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max` — the same shorthand used by `atomic --model sonnet:high`. `xhigh` and `max` are used only when the selected model's capability map supports them.
191
226
 
192
227
  ```markdown
193
228
  ---
@@ -2,6 +2,10 @@
2
2
 
3
3
  Atomic uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier key detection. Most modern terminals support this protocol, but some require configuration.
4
4
 
5
+ ## Startup typing
6
+
7
+ On normal interactive TTY startup, Atomic starts a short-lived raw keyboard capture before deferred resources finish loading and keeps it active until the TUI input handler is mounted. Text typed before the prompt box is fully mounted is replayed into the editor. Enter-submitted ordinary prompts are queued for the prompt loop once startup is ready; command-like submissions such as `/settings` or `!pwd` are replayed as standalone editor submissions through normal command routing. If a command-like submission is captured, later captured submissions wait behind it and replay in original input order after that command is routed, so a later ordinary prompt cannot run before the earlier command and commands are not merged with following prompts. Startup work that can affect correctness, such as project trust prompts, resume/session selectors, cross-project session confirmations, explicit resource flags, metadata commands, non-TTY input, or explicit provider/model selection, still stays on the synchronous path instead of using this pre-session capture.
8
+
5
9
  ## Kitty, iTerm2
6
10
 
7
11
  Work out of the box.
package/docs/tools.md CHANGED
@@ -32,7 +32,7 @@ The `bash` tool executes shell commands in the session workspace, with optional
32
32
 
33
33
  When a session-managed background bash job completes or fails, Atomic sends an `async-job-result` custom follow-up into the conversation automatically (`display: true`, delivered as a follow-up turn). Small results are inlined, and results whose raw output stays below the persistence threshold remain fully inline even if the formatted follow-up header pushes the message over the preview limit; persisted large results include a preview plus the retained `fullOutputPath` (persisted before the normal polling truncation limit so 12KB–50KB outputs remain recoverable). If the model explicitly polls a completed job with `__atomic_bash_job <id>` before the queued follow-up is delivered, or cancels a job with `__atomic_bash_job_cancel <id>`, Atomic acknowledges the result and suppresses duplicate auto-delivery while keeping the job pollable until normal bounded retention/TTL cleanup. Suppression is tied to the retained job rather than a short timer, so disposed-session jobs cannot later fall back into another session after a long-running command completes. Session delivery attempts are non-blocking across sessions: a live streaming session can defer its own follow-up until the stream boundary without delaying unrelated completed jobs. Session disposal removes that session's pending async delivery handlers; a shared manager remains alive while other live sessions still own active jobs, then cleans up when the last session is disposed. Direct SDK/tool-factory uses only get automatic delivery when they provide an async job manager/delivery handler; otherwise async jobs remain manually pollable.
34
34
 
35
- When explicitly enabled in settings, built-in bash interceptor rules block common shell substitutes for first-class tools (`cat`/`grep`/`find`/in-place `sed`/redirection, etc.) only when the corresponding tool is available. Enabled bash tool calls are also offered to `user_bash` extension handlers before local execution. Atomic checks the original command, the internal-URL-expanded command, configured-prefix forms, `spawnHook`-rewritten commands, and a leading `cd path && command` or `cd path; command`-stripped form only when structured `cwd` was omitted, so interceptors can route commands by effective working directory without overriding explicit `cwd`. The bash schema accepts `cwd`, `env`, `timeout`, `pty`, and `async`; `cwd` and `env` are honored by the local executor, `timeout` defaults to 300s and is clamped to 1..3600s, and normal sessions enable tracked async jobs with bounded retention. `bashInterceptor.enabled` defaults to `false`; interception is not auto-enabled.
35
+ When explicitly enabled in settings, built-in bash interceptor rules block common shell substitutes for first-class tools (`cat`/`grep`/`find`/in-place `sed`/redirection, etc.) only when the corresponding tool is available. Enabled bash tool calls are also offered to `user_bash` extension handlers before local execution. Atomic checks the original command, the internal-URL-expanded command, configured-prefix forms, `spawnHook`-rewritten commands, and a leading `cd path && command` or `cd path; command`-stripped form only when structured `cwd` was omitted, so interceptors can route commands by effective working directory without overriding explicit `cwd`. The bash schema accepts `cwd`, `env`, `timeout`, `pty`, and `async`; `cwd` and `env` are honored by the local executor. Omitting `timeout` uses the 300-second default. An explicit timeout must be finite, greater than zero, and no more than Atomic's deliberate 3600-second ceiling; invalid values fail before execution instead of being defaulted or clamped. Valid fractional values are rounded down with a one-second floor. Normal sessions enable tracked async jobs with bounded retention. `bashInterceptor.enabled` defaults to `false`; interception is not auto-enabled.
36
36
 
37
37
  ```json
38
38
  {
package/docs/usage.md CHANGED
@@ -19,7 +19,7 @@ The editor can be replaced temporarily by built-in UI such as `/settings` or by
19
19
 
20
20
  | Feature | How |
21
21
  |---------|-----|
22
- | File reference | Type `@` to fuzzy-search project files, including during first-run onboarding |
22
+ | File reference | Type `@` to fuzzy-search project files |
23
23
  | Path completion | Press Tab to complete paths |
24
24
  | Multi-line input | SHIFT+Enter, or CTRL+Enter on Windows Terminal |
25
25
  | Images | Paste with CTRL+V, ALT+V on Windows, or drag into the terminal |
@@ -64,7 +64,7 @@ You can submit messages while the agent is still working:
64
64
 
65
65
  - **Enter** queues a steering message, delivered after the current assistant turn finishes executing its tool calls.
66
66
  - **ALT+Enter** queues a follow-up message, delivered after the agent finishes all work.
67
- - **Escape** aborts and restores queued messages to the editor.
67
+ - **Escape** or **Ctrl+C** aborts the running agent and restores queued messages to the editor. When idle, Ctrl+C clears the editor (press twice to exit).
68
68
  - **ALT+Up** retrieves queued messages back to the editor.
69
69
 
70
70
  On Windows Terminal, ALT+Enter is fullscreen by default. Remap it as described in [Terminal setup](/terminal-setup) if you want Atomic to receive the shortcut.
@@ -85,6 +85,8 @@ atomic --name "Refactor" # Set the session display name
85
85
  atomic --fork <path|id> # Fork a session into a new session file
86
86
  ```
87
87
 
88
+ When `--session-id` does not match an exact session in the current project, Atomic warns that no session was found and then creates the requested new session. Reusing an existing exact ID opens it without that warning.
89
+
88
90
  Useful session commands:
89
91
 
90
92
  - `/session` shows the current session file and ID.
@@ -172,7 +174,7 @@ When a print-mode turn correctly finishes by calling an opt-in terminating struc
172
174
  | `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
173
175
  | `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
174
176
  | `--api-key <key>` | API key, overriding environment variables |
175
- | `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
177
+ | `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`; model capability mapping still governs availability |
176
178
  | `--models <patterns>` | Comma-separated patterns for CTRL+P cycling |
177
179
  | `--list-models [search]` | List available models |
178
180
 
@@ -183,7 +185,7 @@ When a print-mode turn correctly finishes by calling an opt-in terminating struc
183
185
  | `-c`, `--continue` | Continue the most recent session |
184
186
  | `-r`, `--resume` | Browse and select a session |
185
187
  | `--session <path\|id>` | Use a specific session file or partial UUID |
186
- | `--session-id <id>` | Use an exact project session ID, creating it if missing |
188
+ | `--session-id <id>` | Use an exact project session ID; warn and create it when missing |
187
189
  | `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
188
190
  | `--session-dir <dir>` | Custom session storage directory |
189
191
  | `--name <name>`, `-n <name>` | Set the session display name |
@@ -281,7 +283,7 @@ atomic --tools read,search,find,ls -p "Review the code"
281
283
 
282
284
  | Variable | Description |
283
285
  |----------|-------------|
284
- | `ATOMIC_CODING_AGENT_DIR` | Override config directory; default is `~/.atomic/agent` |
286
+ | `ATOMIC_CODING_AGENT_DIR` | Override config directory; default is `~/.atomic/agent`. Bundled intercom runtime/config files live under its `intercom/` subdirectory |
285
287
  | `ATOMIC_CODING_AGENT_SESSION_DIR` | Override session storage directory; overridden by `--session-dir` |
286
288
  | `ATOMIC_PACKAGE_DIR` | Override package directory, useful for Nix/Guix store paths |
287
289
  | `ATOMIC_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
@@ -290,7 +292,7 @@ atomic --tools read,search,find,ls -p "Review the code"
290
292
  | `PI_CACHE_RETENTION` | Provider/upstream-specific prompt-cache retention knob; set to `long` where supported |
291
293
  | `VISUAL`, `EDITOR` | External editor for CTRL+G |
292
294
 
293
- `PI_*` aliases are also supported for app-specific `ATOMIC_*` variables for legacy compatibility. `PI_CACHE_RETENTION` is not one of those aliases and has no `ATOMIC_*` equivalent. Use `PI_CACHE_RETENTION=long` when configuring prompt-cache retention for providers/upstreams that support long-lived caches.
295
+ `PI_*` aliases are also supported for app-specific `ATOMIC_*` variables for legacy compatibility. For example, intercom honors `PI_CODING_AGENT_DIR` when `ATOMIC_CODING_AGENT_DIR` is unset and still reads legacy `~/.pi/agent/intercom/config.json` when the Atomic config is absent. `PI_CACHE_RETENTION` is not one of those aliases and has no `ATOMIC_*` equivalent. Use `PI_CACHE_RETENTION=long` when configuring prompt-cache retention for providers/upstreams that support long-lived caches. Intercom's default broker starter works across Node-based installs, Bun source checkouts, and standalone Atomic binaries without requiring `npx`, `tsx`, or `bun` to be present on `PATH`; custom broker commands remain explicit opt-in overrides.
294
296
 
295
297
  ## Design Principles
296
298