@bastani/atomic 0.9.3 → 0.9.4-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 (312) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/dist/builtin/cursor/CHANGELOG.md +30 -0
  3. package/dist/builtin/cursor/package.json +4 -4
  4. package/dist/builtin/intercom/CHANGELOG.md +30 -0
  5. package/dist/builtin/intercom/package.json +2 -2
  6. package/dist/builtin/mcp/CHANGELOG.md +30 -0
  7. package/dist/builtin/mcp/package.json +4 -4
  8. package/dist/builtin/subagents/CHANGELOG.md +51 -0
  9. package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
  10. package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
  11. package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
  12. package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -2
  13. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
  14. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
  15. package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
  16. package/dist/builtin/subagents/agents/debugger.md +1 -1
  17. package/dist/builtin/subagents/agents/worker.md +2 -2
  18. package/dist/builtin/subagents/package.json +4 -4
  19. package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +11 -1
  20. package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +11 -1
  21. package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +2 -0
  22. package/dist/builtin/subagents/src/runs/background/subagent-runner-step.ts +27 -4
  23. package/dist/builtin/subagents/src/runs/background/subagent-runner-streaming.ts +25 -0
  24. package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +1 -0
  25. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +1 -0
  26. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +1 -0
  27. package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +1 -0
  28. package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +2 -0
  29. package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +3 -1
  30. package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +22 -0
  31. package/dist/builtin/subagents/src/runs/foreground/execution-run-sync.ts +15 -5
  32. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +5 -1
  33. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +2 -0
  34. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +4 -1
  35. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +4 -1
  36. package/dist/builtin/subagents/src/runs/shared/attempt-watchdog.ts +126 -0
  37. package/dist/builtin/subagents/src/runs/shared/model-candidate-filter.ts +53 -0
  38. package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +52 -53
  39. package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +2 -0
  40. package/dist/builtin/subagents/src/shared/model-info.ts +16 -0
  41. package/dist/builtin/subagents/src/shared/types-config.ts +2 -0
  42. package/dist/builtin/web-access/CHANGELOG.md +30 -0
  43. package/dist/builtin/web-access/package.json +2 -2
  44. package/dist/builtin/workflows/CHANGELOG.md +54 -0
  45. package/dist/builtin/workflows/README.md +4 -4
  46. package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +24 -22
  47. package/dist/builtin/workflows/builtin/goal-runner.ts +12 -23
  48. package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +4 -4
  49. package/dist/builtin/workflows/builtin/ralph-models.ts +53 -75
  50. package/dist/builtin/workflows/package.json +2 -2
  51. package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +4 -2
  52. package/dist/builtin/workflows/src/engine/run-returned-status.ts +41 -0
  53. package/dist/builtin/workflows/src/engine/run.ts +6 -4
  54. package/dist/builtin/workflows/src/extension/config-file-loader.ts +1 -1
  55. package/dist/builtin/workflows/src/extension/config-loader.ts +1 -1
  56. package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +37 -12
  57. package/dist/builtin/workflows/src/runs/shared/model-fallback-failures.ts +59 -1
  58. package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +1 -1
  59. package/dist/builtin/workflows/src/shared/store-public-types.ts +3 -2
  60. package/dist/builtin/workflows/src/shared/store-run-methods.ts +6 -1
  61. package/dist/bun/cli.d.ts.map +1 -1
  62. package/dist/bun/cli.js +3 -2
  63. package/dist/bun/cli.js.map +1 -1
  64. package/dist/cli/file-processor.d.ts.map +1 -1
  65. package/dist/cli/file-processor.js +13 -25
  66. package/dist/cli/file-processor.js.map +1 -1
  67. package/dist/cli.d.ts.map +1 -1
  68. package/dist/cli.js +15 -5
  69. package/dist/cli.js.map +1 -1
  70. package/dist/config.d.ts +10 -3
  71. package/dist/config.d.ts.map +1 -1
  72. package/dist/config.js +18 -1
  73. package/dist/config.js.map +1 -1
  74. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  75. package/dist/core/agent-session-auto-compaction.js +8 -1
  76. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  77. package/dist/core/agent-session-events.d.ts.map +1 -1
  78. package/dist/core/agent-session-events.js +14 -8
  79. package/dist/core/agent-session-events.js.map +1 -1
  80. package/dist/core/agent-session-export.d.ts.map +1 -1
  81. package/dist/core/agent-session-export.js +4 -2
  82. package/dist/core/agent-session-export.js.map +1 -1
  83. package/dist/core/agent-session-extension-bindings.d.ts +5 -1
  84. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  85. package/dist/core/agent-session-extension-bindings.js +18 -7
  86. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  87. package/dist/core/agent-session-methods.d.ts +9 -2
  88. package/dist/core/agent-session-methods.d.ts.map +1 -1
  89. package/dist/core/agent-session-methods.js.map +1 -1
  90. package/dist/core/agent-session-prompt.d.ts +2 -0
  91. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  92. package/dist/core/agent-session-prompt.js +15 -2
  93. package/dist/core/agent-session-prompt.js.map +1 -1
  94. package/dist/core/agent-session-retry.d.ts +2 -0
  95. package/dist/core/agent-session-retry.d.ts.map +1 -1
  96. package/dist/core/agent-session-retry.js +66 -7
  97. package/dist/core/agent-session-retry.js.map +1 -1
  98. package/dist/core/agent-session-state.d.ts.map +1 -1
  99. package/dist/core/agent-session-state.js +2 -2
  100. package/dist/core/agent-session-state.js.map +1 -1
  101. package/dist/core/agent-session-tool-hooks.d.ts +7 -1
  102. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  103. package/dist/core/agent-session-tool-hooks.js +26 -4
  104. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  105. package/dist/core/agent-session-tree.d.ts.map +1 -1
  106. package/dist/core/agent-session-tree.js +3 -1
  107. package/dist/core/agent-session-tree.js.map +1 -1
  108. package/dist/core/agent-session-types.d.ts +4 -0
  109. package/dist/core/agent-session-types.d.ts.map +1 -1
  110. package/dist/core/agent-session-types.js.map +1 -1
  111. package/dist/core/agent-session.d.ts +1 -0
  112. package/dist/core/agent-session.d.ts.map +1 -1
  113. package/dist/core/agent-session.js +1 -0
  114. package/dist/core/agent-session.js.map +1 -1
  115. package/dist/core/copilot-model-catalog.d.ts +38 -74
  116. package/dist/core/copilot-model-catalog.d.ts.map +1 -1
  117. package/dist/core/copilot-model-catalog.js +177 -68
  118. package/dist/core/copilot-model-catalog.js.map +1 -1
  119. package/dist/core/copilot-model-static-fallbacks.d.ts +43 -0
  120. package/dist/core/copilot-model-static-fallbacks.d.ts.map +1 -0
  121. package/dist/core/copilot-model-static-fallbacks.js +50 -0
  122. package/dist/core/copilot-model-static-fallbacks.js.map +1 -0
  123. package/dist/core/copilot-model-synthesis.d.ts +10 -0
  124. package/dist/core/copilot-model-synthesis.d.ts.map +1 -0
  125. package/dist/core/copilot-model-synthesis.js +89 -0
  126. package/dist/core/copilot-model-synthesis.js.map +1 -0
  127. package/dist/core/extensions/api-types.d.ts +2 -1
  128. package/dist/core/extensions/api-types.d.ts.map +1 -1
  129. package/dist/core/extensions/api-types.js.map +1 -1
  130. package/dist/core/extensions/index.d.ts +1 -1
  131. package/dist/core/extensions/index.d.ts.map +1 -1
  132. package/dist/core/extensions/index.js.map +1 -1
  133. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  134. package/dist/core/extensions/loader-core.js +3 -3
  135. package/dist/core/extensions/loader-core.js.map +1 -1
  136. package/dist/core/extensions/loader-virtual-modules.d.ts +11 -0
  137. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  138. package/dist/core/extensions/loader-virtual-modules.js +79 -11
  139. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  140. package/dist/core/extensions/session-events.d.ts +7 -1
  141. package/dist/core/extensions/session-events.d.ts.map +1 -1
  142. package/dist/core/extensions/session-events.js.map +1 -1
  143. package/dist/core/http-dispatcher.d.ts +5 -3
  144. package/dist/core/http-dispatcher.d.ts.map +1 -1
  145. package/dist/core/http-dispatcher.js +56 -10
  146. package/dist/core/http-dispatcher.js.map +1 -1
  147. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  148. package/dist/core/model-registry-builtins.js +40 -6
  149. package/dist/core/model-registry-builtins.js.map +1 -1
  150. package/dist/core/model-registry.d.ts.map +1 -1
  151. package/dist/core/model-registry.js +4 -3
  152. package/dist/core/model-registry.js.map +1 -1
  153. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  154. package/dist/core/model-resolver-defaults.js +1 -1
  155. package/dist/core/model-resolver-defaults.js.map +1 -1
  156. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  157. package/dist/core/resource-loader-reload.js +6 -3
  158. package/dist/core/resource-loader-reload.js.map +1 -1
  159. package/dist/core/resource-loader-types.d.ts +6 -0
  160. package/dist/core/resource-loader-types.d.ts.map +1 -1
  161. package/dist/core/resource-loader-types.js.map +1 -1
  162. package/dist/core/session-manager-core.d.ts +2 -12
  163. package/dist/core/session-manager-core.d.ts.map +1 -1
  164. package/dist/core/session-manager-core.js +8 -16
  165. package/dist/core/session-manager-core.js.map +1 -1
  166. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  167. package/dist/core/settings-manager-basic-accessors.js +1 -1
  168. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  169. package/dist/core/settings-manager-resource-accessors.d.ts +1 -0
  170. package/dist/core/settings-manager-resource-accessors.d.ts.map +1 -1
  171. package/dist/core/settings-manager-resource-accessors.js +11 -0
  172. package/dist/core/settings-manager-resource-accessors.js.map +1 -1
  173. package/dist/core/settings-manager-ui-accessors.d.ts +2 -0
  174. package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
  175. package/dist/core/settings-manager-ui-accessors.js +9 -0
  176. package/dist/core/settings-manager-ui-accessors.js.map +1 -1
  177. package/dist/core/settings-types.d.ts +2 -0
  178. package/dist/core/settings-types.d.ts.map +1 -1
  179. package/dist/core/settings-types.js.map +1 -1
  180. package/dist/core/timings.d.ts +7 -5
  181. package/dist/core/timings.d.ts.map +1 -1
  182. package/dist/core/timings.js +42 -24
  183. package/dist/core/timings.js.map +1 -1
  184. package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
  185. package/dist/core/tools/bash-pty-native.js +2 -2
  186. package/dist/core/tools/bash-pty-native.js.map +1 -1
  187. package/dist/core/tools/read-selectors.d.ts.map +1 -1
  188. package/dist/core/tools/read-selectors.js +19 -1
  189. package/dist/core/tools/read-selectors.js.map +1 -1
  190. package/dist/core/tools/read.d.ts.map +1 -1
  191. package/dist/core/tools/read.js +12 -23
  192. package/dist/core/tools/read.js.map +1 -1
  193. package/dist/core/tools/search-native.d.ts.map +1 -1
  194. package/dist/core/tools/search-native.js +2 -2
  195. package/dist/core/tools/search-native.js.map +1 -1
  196. package/dist/index-extensions.d.ts +1 -1
  197. package/dist/index-extensions.d.ts.map +1 -1
  198. package/dist/index-extensions.js.map +1 -1
  199. package/dist/index.d.ts +1 -1
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/index.js.map +1 -1
  202. package/dist/main-session.d.ts.map +1 -1
  203. package/dist/main-session.js +14 -5
  204. package/dist/main-session.js.map +1 -1
  205. package/dist/main.d.ts.map +1 -1
  206. package/dist/main.js +56 -32
  207. package/dist/main.js.map +1 -1
  208. package/dist/modes/interactive/components/assistant-message.d.ts +3 -1
  209. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  210. package/dist/modes/interactive/components/assistant-message.js +22 -15
  211. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  212. package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -0
  213. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  214. package/dist/modes/interactive/components/chat-message-renderer.js +5 -5
  215. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  216. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  217. package/dist/modes/interactive/components/chat-session-host-events.js +8 -0
  218. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  219. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  220. package/dist/modes/interactive/components/chat-session-host-rendering.js +1 -0
  221. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  222. package/dist/modes/interactive/components/user-message.d.ts +6 -2
  223. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  224. package/dist/modes/interactive/components/user-message.js +16 -5
  225. package/dist/modes/interactive/components/user-message.js.map +1 -1
  226. package/dist/modes/interactive/interactive-agent-events.d.ts.map +1 -1
  227. package/dist/modes/interactive/interactive-agent-events.js +6 -1
  228. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  229. package/dist/modes/interactive/interactive-deferred-startup.d.ts +2 -0
  230. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -0
  231. package/dist/modes/interactive/interactive-deferred-startup.js +59 -0
  232. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -0
  233. package/dist/modes/interactive/interactive-editor-actions.d.ts.map +1 -1
  234. package/dist/modes/interactive/interactive-editor-actions.js +1 -0
  235. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  236. package/dist/modes/interactive/interactive-extension-context.d.ts.map +1 -1
  237. package/dist/modes/interactive/interactive-extension-context.js +1 -0
  238. package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
  239. package/dist/modes/interactive/interactive-mode-base.d.ts +3 -0
  240. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  241. package/dist/modes/interactive/interactive-mode-base.js +6 -0
  242. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  243. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  244. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  245. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  246. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  247. package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -0
  248. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  249. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  250. package/dist/modes/interactive/interactive-mode-types.d.ts +2 -0
  251. package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
  252. package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
  253. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  254. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  255. package/dist/modes/interactive/interactive-mode.js +1 -0
  256. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  257. package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
  258. package/dist/modes/interactive/interactive-model-routing.js +2 -4
  259. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  260. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  261. package/dist/modes/interactive/interactive-render-chat.js +4 -3
  262. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  263. package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
  264. package/dist/modes/interactive/interactive-session-runtime.js +5 -2
  265. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  266. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  267. package/dist/modes/interactive/interactive-startup.js +11 -1
  268. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  269. package/dist/modes/print-mode.d.ts.map +1 -1
  270. package/dist/modes/print-mode.js +15 -13
  271. package/dist/modes/print-mode.js.map +1 -1
  272. package/dist/modes/rpc/rpc-client.d.ts +28 -51
  273. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  274. package/dist/modes/rpc/rpc-client.js +27 -51
  275. package/dist/modes/rpc/rpc-client.js.map +1 -1
  276. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  277. package/dist/modes/rpc/rpc-command-handler.js +19 -0
  278. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  279. package/dist/modes/rpc/rpc-types.d.ts +26 -0
  280. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  281. package/dist/modes/rpc/rpc-types.js.map +1 -1
  282. package/dist/rpc-entry.d.ts +3 -0
  283. package/dist/rpc-entry.d.ts.map +1 -0
  284. package/dist/rpc-entry.js +12 -0
  285. package/dist/rpc-entry.js.map +1 -0
  286. package/dist/utils/image-convert.d.ts +1 -0
  287. package/dist/utils/image-convert.d.ts.map +1 -1
  288. package/dist/utils/image-convert.js +21 -15
  289. package/dist/utils/image-convert.js.map +1 -1
  290. package/dist/utils/image-process.d.ts +18 -0
  291. package/dist/utils/image-process.d.ts.map +1 -0
  292. package/dist/utils/image-process.js +83 -0
  293. package/dist/utils/image-process.js.map +1 -0
  294. package/dist/utils/mime.d.ts.map +1 -1
  295. package/dist/utils/mime.js +41 -0
  296. package/dist/utils/mime.js.map +1 -1
  297. package/dist/utils/module-require.d.ts +11 -0
  298. package/dist/utils/module-require.d.ts.map +1 -0
  299. package/dist/utils/module-require.js +16 -0
  300. package/dist/utils/module-require.js.map +1 -0
  301. package/docs/compaction.md +2 -0
  302. package/docs/development.md +10 -0
  303. package/docs/extensions.md +11 -0
  304. package/docs/models.md +3 -3
  305. package/docs/providers.md +2 -1
  306. package/docs/rpc.md +60 -2
  307. package/docs/sdk.md +1 -1
  308. package/docs/settings.md +8 -5
  309. package/docs/subagents.md +6 -0
  310. package/docs/workflows.md +9 -5
  311. package/npm-shrinkwrap.json +4266 -0
  312. package/package.json +23 -13
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-require.d.ts","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAErE","sourcesContent":["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { isBunBinary } from \"../config.ts\";\n\n/**\n * createRequire anchored so bare-specifier resolution works in every runtime.\n *\n * In the compiled binary the bundle is CJS (bytecode), where import.meta.url\n * is rewritten to the original build-machine source path; requiring through it\n * would resolve node_modules against paths that do not exist on user machines.\n * Anchor to the executable instead so resolution walks from the node_modules\n * shipped next to the binary.\n */\nexport function createModuleRequire(moduleUrl: string): NodeJS.Require {\n\treturn createRequire(isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl);\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { createRequire } from "node:module";
2
+ import { pathToFileURL } from "node:url";
3
+ import { isBunBinary } from "../config.js";
4
+ /**
5
+ * createRequire anchored so bare-specifier resolution works in every runtime.
6
+ *
7
+ * In the compiled binary the bundle is CJS (bytecode), where import.meta.url
8
+ * is rewritten to the original build-machine source path; requiring through it
9
+ * would resolve node_modules against paths that do not exist on user machines.
10
+ * Anchor to the executable instead so resolution walks from the node_modules
11
+ * shipped next to the binary.
12
+ */
13
+ export function createModuleRequire(moduleUrl) {
14
+ return createRequire(isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl);
15
+ }
16
+ //# sourceMappingURL=module-require.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-require.js","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACpD,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { isBunBinary } from \"../config.ts\";\n\n/**\n * createRequire anchored so bare-specifier resolution works in every runtime.\n *\n * In the compiled binary the bundle is CJS (bytecode), where import.meta.url\n * is rewritten to the original build-machine source path; requiring through it\n * would resolve node_modules against paths that do not exist on user machines.\n * Anchor to the executable instead so resolution walks from the node_modules\n * shipped next to the binary.\n */\nexport function createModuleRequire(moduleUrl: string): NodeJS.Require {\n\treturn createRequire(isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl);\n}\n"]}
@@ -100,6 +100,8 @@ By default, `reserveTokens` is 16384 tokens. Configure it in `~/.atomic/agent/se
100
100
 
101
101
  You can also trigger compaction manually with `/compact`. Custom summary instructions are not accepted because Verbatim Compaction is deletion-only and retained transcript content stays verbatim.
102
102
 
103
+ If auto-compaction runs while a turn still has queued work (for example a failed tool-call result or a follow-up queued during compaction), Atomic resumes through the same continuation lifecycle as a normal queued turn: provider retry handling runs, additional queued messages drain, and any post-compaction resume failure is surfaced instead of being swallowed silently.
104
+
103
105
  ### Image Context and Compaction
104
106
 
105
107
  Image content blocks (screenshots, pasted images, image-bearing tool results) are expensive: providers fold image tokens into their reported prompt/input usage, so image-heavy conversations reach the compaction threshold sooner. Atomic accounts for this in two complementary ways:
@@ -68,6 +68,16 @@ bun --cwd packages/coding-agent run test -- test/specific.test.ts
68
68
 
69
69
  The file-length gate scans tracked `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, `.cjs`, and `.rs` files via `git ls-files`, falls back to a recursive walk outside Git, and counts physical lines with a no-final-newline correction. Only generated/vendored path globs (`node_modules`, `dist`, `target`, `binaries`, `.git`, `vendor`, minified bundles, and the bundled third-party `packages/workflows/skills/impeccable/**` skill) plus first-five-line generated markers are excluded; there is no grandfather/baseline allowlist for authored files.
70
70
 
71
+ ## Release shrinkwrap
72
+
73
+ `@bastani/atomic` ships `packages/coding-agent/npm-shrinkwrap.json` for deterministic package-manager installs. Main stays versionless at `0.0.0`; `scripts/cut-release.ts` stamps the real version in an off-main worktree and regenerates the shrinkwrap there before tagging.
74
+
75
+ The shrinkwrap generator is hermetic for Atomic-owned packages. It derives `@bastani/atomic-natives` and generated native optional package entries from local package metadata plus deterministic registry tarball URLs, so release publishing does not depend on npm metadata for native packages that were just published.
76
+
77
+ ```bash
78
+ bun run scripts/generate-coding-agent-shrinkwrap.mjs --check
79
+ ```
80
+
71
81
  ## Project Structure
72
82
 
73
83
  ```
@@ -402,6 +402,17 @@ pi.on("session_start", async (event, ctx) => {
402
402
  });
403
403
  ```
404
404
 
405
+ #### session_info_changed
406
+
407
+ Fired when the current session display name is set via `/name`, RPC, or `pi.setSessionName()`.
408
+
409
+ ```typescript
410
+ pi.on("session_info_changed", async (event, ctx) => {
411
+ // event.name - current normalized name, or undefined if cleared
412
+ ctx.ui.notify(`Session renamed: ${event.name ?? "(none)"}`, "info");
413
+ });
414
+ ```
415
+
405
416
  #### session_before_switch
406
417
 
407
418
  Fired before starting a new session (`/new`) or switching sessions (`/resume`).
package/docs/models.md CHANGED
@@ -271,15 +271,15 @@ Users can select a supported context window independently from thinking level:
271
271
  atomic --model custom/long-context-model --thinking high --context-window 1m
272
272
  ```
273
273
 
274
- In interactive mode, run `/model` and pick a model; when the chosen model exposes more than one window, Atomic immediately prompts for the context window as a follow-up step — a GitHub Copilot CLI-style picker that lists numbered `Default` and `Long context` tiers with their token counts (for example `272k tokens` / `922k tokens` for `github-copilot/gpt-5.5`, or `200k tokens` / `936k tokens` for the Claude/Gemini long-context models) — so you can choose one of the active model's supported budgets. Persisted interactive selections are stored per model under `defaultContextWindows["provider/modelId"]` (raw token counts and compact labels such as `400k` or `1m` are accepted), so a Copilot-specific prompt cap does not leak into Anthropic, Cursor, or other providers. GitHub Copilot long-context requests treat `1m` as a branded budget request and resolve it to the model's largest advertised long-context tier not exceeding the request (for example `936k` for Copilot Claude Opus), while other providers continue to require one of their own exact supported windows or use their natural scalar default. Successful explicit startup selections are recorded as `context_window_change` entries even when the chosen value equals the scalar default, preserving the user's explicit budget choice across future settings changes and resume.
274
+ In interactive mode, run `/model` and pick a model; when the chosen model exposes more than one window, Atomic immediately prompts for the context window as a follow-up step — a GitHub Copilot CLI-style picker that lists numbered `Default` and `Long context` tiers with their token counts (for example `272k tokens` / `922k tokens` for `github-copilot/gpt-5.5`, or `200k tokens` / `936k tokens` for Claude/Gemini long-context models such as `github-copilot/claude-sonnet-5`) — so you can choose one of the active model's supported budgets. Persisted interactive selections are stored per model under `defaultContextWindows["provider/modelId"]` (raw token counts and compact labels such as `400k` or `1m` are accepted), so a Copilot-specific prompt cap does not leak into Anthropic, Cursor, or other providers. GitHub Copilot long-context requests treat `1m` as a branded budget request and resolve it to the model's largest advertised long-context tier not exceeding the request (for example `936k` for Copilot Claude models), while other providers continue to require one of their own exact supported windows or use their natural scalar default. Successful explicit startup selections are recorded as `context_window_change` entries even when the chosen value equals the scalar default, preserving the user's explicit budget choice across future settings changes and resume.
275
275
 
276
276
  Use larger context windows deliberately. Some providers charge more for larger windows, and Atomic preserves each model's default unless the user explicitly opts in through `--context-window`, the `/model` selection flow, per-model `defaultContextWindows`, or the optional global `defaultContextWindow` fallback.
277
277
 
278
278
  #### GitHub Copilot context windows
279
279
 
280
- GitHub Copilot context windows are measured in **input (prompt) tokens**, exactly like every other provider's `contextWindow`, and are derived **dynamically from GitHub's live CAPI model catalog** (`GET {baseUrl}/models`) rather than a hardcoded model list — so models GitHub adds, removes, or retiers are reflected automatically. Atomic fetches the catalog only when you actually have the GitHub Copilot provider authenticated and caches it on disk for 30 minutes.
280
+ GitHub Copilot context windows are measured in **input (prompt) tokens**, exactly like every other provider's `contextWindow`, and are derived **dynamically from GitHub's live CAPI model catalog** (`GET {baseUrl}/models`) rather than a hardcoded model list — so plain Copilot model ids GitHub adds, removes, or retiers are reflected automatically. Atomic fetches the catalog only when you actually have the GitHub Copilot provider authenticated, caches it on disk for 30 minutes, and refreshes the active interactive session's model metadata as soon as that catalog is applied. Dynamic model creation is intentionally limited to picker-enabled, non-disabled `chat` entries with plain, non-namespaced ids; enterprise/org-deployed catalog ids containing `/` (for example `octodemo/Octodemo_Foundry/DeepSeek-V3.2`) are skipped instead of being exposed as `github-copilot/*` models. The same catalog also supplies Copilot output-token caps and selectable thinking levels: when CAPI advertises `capabilities.limits.max_output_tokens`, Atomic uses that live value as the model's `maxTokens` instead of the bundled fallback; when CAPI advertises `capabilities.supports.reasoning_effort` as an array, Atomic hides unsupported thinking levels for both dynamically synthesized Copilot models and bundled `pi-ai` Copilot models. Models that only advertise thinking budgets or a boolean reasoning-effort flag keep their existing thinking-level behavior.
281
281
 
282
- Each selectable Copilot window is a prompt/input budget. Atomic reads `capabilities.limits.max_prompt_tokens` for the full prompt cap and treats `capabilities.limits.max_context_window_tokens` as the model's total context capacity (prompt plus output reserve) and a compatibility fallback only when the prompt cap is absent. Models with tiered pricing expose their per-tier prompt budgets through `billing.token_prices.<tier>.context_max`: the `default` tier becomes the base window and a larger `long_context` tier is offered as a selectable option. For example `github-copilot/gpt-5.5` resolves to a `272k` default / `922k` long window, and the Claude/Gemini long-context models resolve to `200k` default / `936k` long. When the request is a rounded budget such as `1m`, Atomic selects the largest advertised Copilot long-context prompt tier at or below that budget instead of falling back to the base `200k`/`272k` window. Offline, unauthenticated, or non-Copilot sessions leave the built-in scalar window untouched and show no picker.
282
+ Each selectable Copilot window is a prompt/input budget. Atomic reads `capabilities.limits.max_prompt_tokens` for the full prompt cap, `capabilities.limits.max_output_tokens` for the maximum response/output cap, and treats `capabilities.limits.max_context_window_tokens` as the model's total context capacity (prompt plus output reserve) and a compatibility fallback only when the prompt cap is absent. Models with tiered pricing expose their per-tier prompt budgets through `billing.token_prices.<tier>.context_max`: the `default` tier becomes the base window and a larger `long_context` tier is offered as a selectable option. For example `github-copilot/gpt-5.5` resolves to a `272k` default / `922k` long prompt budget, `github-copilot/mai-code-1-flash-picker` advertises a `128k` prompt cap with a `256k` total context window, and `github-copilot/claude-sonnet-5` plus other Claude/Gemini long-context models resolve to `200k` default / `936k` long. When the request is a rounded budget such as `1m`, Atomic selects the largest advertised Copilot long-context prompt tier at or below that budget instead of falling back to the base `200k`/`272k` window. Offline, unauthenticated, or non-Copilot sessions leave the built-in scalar window and output-token cap untouched and show no picker.
283
283
 
284
284
  Selecting the long-context window does two client-side things:
285
285
 
package/docs/providers.md CHANGED
@@ -38,8 +38,9 @@ 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
42
  - If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
42
- - Supported built-in Copilot long-context models, including `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, so the branded window is displayed without overrunning the server limit.
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.
43
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.
44
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.
45
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.
package/docs/rpc.md CHANGED
@@ -335,7 +335,7 @@ Unsupported or malformed selections return the standard RPC error response:
335
335
  }
336
336
  ```
337
337
 
338
- Larger provider context windows may consume more credits/cost. For allowlisted GitHub Copilot long-context models (including `github-copilot/gpt-5.5` and `github-copilot/gemini-3.1-pro-preview`), selecting `1m` raises Atomic's local budget and sends `X-GitHub-Api-Version: 2026-06-01`; GitHub applies the long-context billing 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 GitHub's server cap are rejected with a friendly hint.
338
+ Larger provider context windows may consume more credits/cost. For catalog-advertised GitHub Copilot long-context models (including `github-copilot/gpt-5.5`, `github-copilot/claude-sonnet-5`, and `github-copilot/gemini-3.1-pro-preview`), selecting `1m` raises Atomic's local budget and sends `X-GitHub-Api-Version: 2026-06-01`; GitHub applies the long-context billing 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 GitHub's server cap are rejected with a friendly hint.
339
339
 
340
340
  ### Thinking
341
341
 
@@ -722,6 +722,64 @@ Response:
722
722
  }
723
723
  ```
724
724
 
725
+ #### get_entries
726
+
727
+ Get all session entries in append order (excluding the session header). The session is an append-only tree of entries with stable ids, so an entry id works as a durable cursor: pass the last entry id you have seen as `since` to get only entries strictly after it, even across client restarts. Unlike `get_messages`, this includes pre-compaction history and abandoned branches.
728
+
729
+ ```json
730
+ {"type": "get_entries"}
731
+ ```
732
+
733
+ With a cursor:
734
+ ```json
735
+ {"type": "get_entries", "since": "abc123"}
736
+ ```
737
+
738
+ Response:
739
+ ```json
740
+ {
741
+ "type": "response",
742
+ "command": "get_entries",
743
+ "success": true,
744
+ "data": {
745
+ "entries": [
746
+ {"type": "message", "id": "def456", "parentId": "abc123", "timestamp": "...", "message": {"role": "user", "...": "..."}}
747
+ ],
748
+ "leafId": "def456"
749
+ }
750
+ }
751
+ ```
752
+
753
+ `leafId` is the id of the current leaf entry (`null` for an empty session), so a client can tell in one round trip whether the active branch moved. If `since` does not match any entry id, the response is `success: false`.
754
+
755
+ #### get_tree
756
+
757
+ Get the session as a tree of entries. Each node is `{entry, children, label?, labelTimestamp?}`. A well-formed session has a single root; orphaned entries (broken parent chain) also appear as roots.
758
+
759
+ ```json
760
+ {"type": "get_tree"}
761
+ ```
762
+
763
+ Response:
764
+ ```json
765
+ {
766
+ "type": "response",
767
+ "command": "get_tree",
768
+ "success": true,
769
+ "data": {
770
+ "tree": [
771
+ {
772
+ "entry": {"type": "message", "id": "abc123", "parentId": null, "...": "..."},
773
+ "children": [
774
+ {"entry": {"type": "message", "id": "def456", "parentId": "abc123", "...": "..."}, "children": []}
775
+ ]
776
+ }
777
+ ],
778
+ "leafId": "def456"
779
+ }
780
+ }
781
+ ```
782
+
725
783
  #### get_last_assistant_text
726
784
 
727
785
  Get the text content of the last assistant message.
@@ -984,7 +1042,7 @@ Emitted when the active context-window token budget changes through RPC `set_con
984
1042
  }
985
1043
  ```
986
1044
 
987
- Larger provider context windows may consume more credits/cost. Prefer the model default unless the additional repository/session context is useful for the current task. For allowlisted GitHub Copilot long-context models such as `github-copilot/gpt-5.5` and `github-copilot/gemini-3.1-pro-preview`, a `1m` selection raises Atomic's local budget and sends `X-GitHub-Api-Version: 2026-06-01`; GitHub applies the long-context billing tier server-side by prompt size, consumes more Copilot AI credits, and requires long-context/usage-based billing entitlement.
1045
+ Larger provider context windows may consume more credits/cost. Prefer the model default unless the additional repository/session context is useful for the current task. For catalog-advertised GitHub Copilot long-context models such as `github-copilot/gpt-5.5`, `github-copilot/claude-sonnet-5`, and `github-copilot/gemini-3.1-pro-preview`, a `1m` selection raises Atomic's local budget and sends `X-GitHub-Api-Version: 2026-06-01`; GitHub applies the long-context billing tier server-side by prompt size, consumes more Copilot AI credits, and requires long-context/usage-based billing entitlement.
988
1046
 
989
1047
  ### compaction_start / compaction_end
990
1048
 
package/docs/sdk.md CHANGED
@@ -439,7 +439,7 @@ If no model is provided:
439
439
 
440
440
  Context-window selection is independent from `thinkingLevel`. `contextWindow` accepts a raw token count such as `400_000` or `1_000_000`; for most providers the value must be present in the model's supported context windows (`model.contextWindowOptions` plus the scalar default). GitHub Copilot is the only provider with rounded long-context budget handling: when a tiered Copilot model advertises a long tier below the branded request (for example `936_000` for a `1_000_000` request), Atomic selects the largest advertised Copilot long tier at or below the request instead of falling back to the short tier. Settings lookup first checks the selected model's `defaultContextWindows["provider/modelId"]` entry, then the optional global `defaultContextWindow` fallback; unsupported model-specific settings keep the model default and return `contextWindowWarning`, while unsupported global fallback values are ignored silently as not applicable to the active model. When you pass `contextWindowStrict: true`, an unsupported explicit selection is reported as `contextWindowError` so callers can fail before prompting. A successful explicit `contextWindow` startup option is journaled as a `context_window_change` entry even when it equals the scalar model default, so the user's explicit budget choice survives future settings changes and resume.
441
441
 
442
- At runtime, use `session.getAvailableContextWindows()` to inspect supported values, `session.supportsContextWindowSelection()` to check whether more than one value is selectable, and `session.setContextWindow(tokens, { persistDefault })` to change the active model budget. `setContextWindow()` journals a `context_window_change` entry only when the active value changes. Passing `{ persistDefault: true }` also writes the effective selected budget to `defaultContextWindows["provider/modelId"]` in settings instead of the global fallback, so a Copilot prompt cap such as `936k` does not leak into Anthropic, Cursor, or other providers. Tree navigation replays the target branch's `context_window_change` state into the active model without adding another journal entry or changing settings. Larger provider context windows may consume more credits/cost, so opt into larger values deliberately. For allowlisted GitHub Copilot long-context models (including `github-copilot/gpt-5.5` and `github-copilot/gemini-3.1-pro-preview`), selecting `1m` raises Atomic's local budget to the model's advertised `922k`/`936k` tier and sends `X-GitHub-Api-Version: 2026-06-01`; GitHub applies the long-context tier server-side by prompt token count, consumes more Copilot AI credits, and requires long-context/usage-based billing entitlement.
442
+ At runtime, use `session.getAvailableContextWindows()` to inspect supported values, `session.supportsContextWindowSelection()` to check whether more than one value is selectable, and `session.setContextWindow(tokens, { persistDefault })` to change the active model budget. `setContextWindow()` journals a `context_window_change` entry only when the active value changes. Passing `{ persistDefault: true }` also writes the effective selected budget to `defaultContextWindows["provider/modelId"]` in settings instead of the global fallback, so a Copilot prompt cap such as `936k` does not leak into Anthropic, Cursor, or other providers. Tree navigation replays the target branch's `context_window_change` state into the active model without adding another journal entry or changing settings. Larger provider context windows may consume more credits/cost, so opt into larger values deliberately. For catalog-advertised GitHub Copilot long-context models (including `github-copilot/gpt-5.5`, `github-copilot/claude-sonnet-5`, and `github-copilot/gemini-3.1-pro-preview`), selecting `1m` raises Atomic's local budget to the model's advertised `922k`/`936k` tier and sends `X-GitHub-Api-Version: 2026-06-01`; GitHub applies the long-context tier server-side by prompt token count, consumes more Copilot AI credits, and requires long-context/usage-based billing entitlement.
443
443
 
444
444
  The package root exports the same context-window helpers and types used by the runtime: `parseContextWindowValue()`, `formatContextWindow()`, `validateContextWindowValue()`, `normalizeContextWindowOptions()`, `getModelDefaultContextWindow()`, `getSupportedContextWindows()`, `withContextWindowOptions()`, `selectContextWindow()`, `ContextWindowParseResult`, `ContextWindowSelection`, `ContextWindowSelectionError`, and `ContextWindowSelectionOptions`. Importing from `@bastani/atomic` also includes the `@earendil-works/pi-ai` `Model<Api>` augmentation for `contextWindowOptions` and `defaultContextWindow`, so SDK consumers can use the helper types without importing internal source paths.
445
445
 
package/docs/settings.md CHANGED
@@ -78,6 +78,8 @@ Use `/fast` in interactive mode to edit these settings. Atomic applies fast mode
78
78
  | `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
79
79
  | `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
80
80
  | `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
81
+ | `outputPad` | number | `1` | Horizontal padding for chat message output (user messages, assistant messages, thinking blocks). `0` or `1` |
82
+ | `externalEditor` | string | - | Command for the Ctrl+G external editor; takes precedence over `$VISUAL`/`$EDITOR`. Defaults to Notepad on Windows and `nano` elsewhere |
81
83
  | `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
82
84
  | `showHardwareCursor` | boolean | `false` | Show the terminal cursor while TUI positions it for IME support |
83
85
 
@@ -132,12 +134,12 @@ Set `ATOMIC_SKIP_VERSION_CHECK=1` to disable the Atomic version update check. Us
132
134
  | `retry.maxRetries` | number | `3` | Maximum agent-level retry attempts |
133
135
  | `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff (2s, 4s, 8s) |
134
136
  | `retry.provider.timeoutMs` | number | SDK default | Provider/SDK request timeout in milliseconds |
135
- | `retry.provider.maxRetries` | number | `5` | Provider/SDK retry attempts (also retries dropped connections / `Connection error`) |
137
+ | `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts. Leave unset/`0` to let Atomic's agent-level retry handle transient failures |
136
138
  | `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay before failing (60s) |
137
139
 
138
140
  When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs` (e.g., Google's "quota will reset after 5h"), the request fails immediately with an informative error instead of waiting silently. Set to `0` to disable the cap.
139
141
 
140
- `retry.provider.maxRetries` defaults to `5` so transient socket drops (sandbox proxies, prod edge idle-closes) retry instead of failing as `Connection error`. The `maxRetryDelayMs` cap keeps this safe: connection errors back off briefly, while quota/rate-limit replies asking for a long delay still fail fast instead of blocking on usage limits. Set to `0` to disable provider-level retries.
142
+ `retry.provider.maxRetries` follows upstream Pi's behavior and defaults to `0` SDK/provider retries. Atomic still performs agent-level retries via `retry.maxRetries`; set `retry.provider.maxRetries` explicitly only when you want the underlying provider SDK to retry before Atomic observes the failure.
141
143
 
142
144
  ```json
143
145
  {
@@ -147,7 +149,7 @@ When a provider requests a retry delay longer than `retry.provider.maxRetryDelay
147
149
  "baseDelayMs": 2000,
148
150
  "provider": {
149
151
  "timeoutMs": 3600000,
150
- "maxRetries": 5,
152
+ "maxRetries": 0,
151
153
  "maxRetryDelayMs": 60000
152
154
  }
153
155
  }
@@ -160,7 +162,7 @@ When a provider requests a retry delay longer than `retry.provider.maxRetryDelay
160
162
  |---------|------|---------|-------------|
161
163
  | `httpIdleTimeoutMs` | number | `600000` | HTTP header/body idle timeout in milliseconds. Must be a non-negative finite number; decimals are rounded down. Set to `0` to disable the idle timeout. |
162
164
 
163
- Atomic applies this timeout to the global HTTP dispatcher used by `fetch` and provider SDK HTTP clients. The default is 600,000 ms (10 minutes), which keeps slow long-context requests working while reclaiming stale idle connections. The dispatcher also applies a fixed 10-second connect-phase timeout so an unreachable or firewall-blocked host fails fast instead of hanging until the OS TCP timeout.
165
+ Atomic applies this timeout to the global HTTP dispatcher used by `fetch` and provider SDK HTTP clients. The default is 600,000 ms (10 minutes), which keeps slow long-context requests working while reclaiming stale idle connections. Atomic does not impose a separate fixed connect-phase timeout; connection failures surface through the provider and agent retry/error paths.
164
166
 
165
167
  The `/settings` picker offers these presets:
166
168
 
@@ -248,12 +250,13 @@ When multiple sources specify a session directory, precedence is `--session-dir`
248
250
  "defaultContextWindow": "1m",
249
251
  "defaultContextWindows": {
250
252
  "github-copilot/claude-opus-4.8": "936k",
253
+ "github-copilot/claude-sonnet-5": "936k",
251
254
  "github-copilot/gpt-5.5": "922k"
252
255
  }
253
256
  }
254
257
  ```
255
258
 
256
- 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 GitHub Copilot allowlisted long-context models (including `github-copilot/gpt-5.5` and `github-copilot/gemini-3.1-pro-preview`), 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`.
259
+ 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`.
257
260
 
258
261
  ### Markdown
259
262
 
package/docs/subagents.md CHANGED
@@ -175,6 +175,12 @@ Dynamic fanout `collect.outputSchema` validates the collected result array after
175
175
 
176
176
  Agents can define ordered `fallbackModels` for retryable provider or model failures such as rate limits, quota/auth problems, unavailable models, network timeouts, or 5xx errors. Atomic tries the requested primary model first, then configured fallbacks, and finally appends the current user-selected model as the last fallback candidate when available.
177
177
 
178
+ A candidate that cannot serve the current request — for example an HTTP 400/413/422 bad/unprocessable/payload-too-large request, an unsupported tool or parameter, a context-length/context-window overflow, or a `too large` / `invalid_request` error — is treated as request/context incompatible and the chain advances to the next candidate rather than stopping. This means that if none of the configured candidates are applicable to the request, Atomic falls back to the currently selected user model instead of failing outright.
179
+
180
+ Each foreground and background model candidate is bounded by a per-attempt idle watchdog (default 5 minutes without child stdout, stderr, or JSON child events) and an absolute wall-clock cap (default 60 minutes). An in-flight tool execution counts as activity, so a slow, quiet tool call (a long build or test run that streams nothing until it finishes) is not mistaken for a stalled attempt; only the wall-clock cap bounds such attempts. If either watchdog trips, Atomic terminates that child attempt, records a retryable timeout in `modelAttempts`, and continues to the next fallback candidate. The defaults can be overridden with `ATOMIC_SUBAGENT_ATTEMPT_IDLE_TIMEOUT_MS` and `ATOMIC_SUBAGENT_ATTEMPT_TIMEOUT_MS`; `ATOMIC_SUBAGENT_ATTEMPT_KILL_GRACE_MS` controls SIGTERM-to-SIGKILL escalation. Setting the idle or wall-clock variable to `0` (or a negative value) disables that timeout entirely; non-numeric values are ignored and the default applies. The kill-grace period cannot be disabled — `0`, negative, or non-numeric values fall back to its default so escalation always stays bounded.
181
+
182
+ When registry availability shows that a known candidate provider has no configured auth, Atomic records a skipped model attempt before spawning a child. Unknown/custom providers are still attempted, and the current user-selected model appended as the final fallback is never filtered out by this pre-spawn check.
183
+
178
184
  Fallbacks do not retry ordinary task failures, validation failures, tool failures, cancellations, or workflow-code errors. Because a fallback may send the same prompt and context to a different provider, choose models that match your cost, privacy, and data-handling requirements.
179
185
 
180
186
  Each candidate can also carry its own reasoning effort — see [Reasoning levels](#reasoning-levels).
package/docs/workflows.md CHANGED
@@ -696,7 +696,7 @@ Example config:
696
696
  "resumeInFlight": "ask",
697
697
  "workflowNotifications": {
698
698
  "enabled": true,
699
- "notifyOn": ["completed", "failed", "awaiting_input"]
699
+ "notifyOn": ["completed", "failed", "blocked", "awaiting_input"]
700
700
  }
701
701
  }
702
702
  ```
@@ -711,7 +711,7 @@ Runtime config defaults:
711
711
  | `statusFile` | `false` | Write a derived status file; defaults under `.atomic/workflows/status.json` when enabled |
712
712
  | `resumeInFlight` | `"ask"` | Behavior when discovering resumable in-flight work |
713
713
  | `workflowNotifications.enabled` | `true` | Emit terminal workflow lifecycle notices into the active main chat |
714
- | `workflowNotifications.notifyOn` | `["completed", "failed", "awaiting_input"]` | Lifecycle states to track; terminal `completed`/`failed` states create main-chat notices, while `awaiting_input` is tracked for dedupe/restore without waking the main agent |
714
+ | `workflowNotifications.notifyOn` | `["completed", "failed", "blocked", "awaiting_input"]` | Lifecycle states to track; terminal `completed`/`failed`/`blocked` states create main-chat notices, while `awaiting_input` is tracked for dedupe/restore without waking the main agent |
715
715
 
716
716
  Invalid JSON or invalid shapes produce `CONFIG_INVALID` diagnostics. Missing config files are ignored.
717
717
 
@@ -1007,7 +1007,7 @@ The default file backend needs no environment variable or database. It writes on
1007
1007
 
1008
1008
  ## Lifecycle Notices and Human Input
1009
1009
 
1010
- Atomic emits deduplicated main-chat notices when top-level workflow runs complete or fail. Nested child workflow completion/failure is reflected inside the expanded parent graph instead of producing separate top-level completion cards. These terminal notices are queued into the active main chat as steering/context messages (`triggerTurn: true`, `deliverAs: "steer"`) so the model can react without the user manually polling status. Awaiting-input workflow states are tracked for dedupe/restore, but they do not enqueue main-chat connect cards or wake the model; prompt state remains visible through workflow status/connect surfaces. Configure lifecycle behavior with `workflowNotifications.enabled` (default `true`) and `workflowNotifications.notifyOn` (default `["completed", "failed", "awaiting_input"]`).
1010
+ Atomic emits deduplicated main-chat notices when top-level workflow runs complete, fail, or end blocked. Nested child workflow completion/failure is reflected inside the expanded parent graph instead of producing separate top-level completion cards. These terminal notices are queued into the active main chat as steering/context messages (`triggerTurn: true`, `deliverAs: "steer"`) so the model can react without the user manually polling status. Awaiting-input workflow states are tracked for dedupe/restore, but they do not enqueue main-chat connect cards or wake the model; prompt state remains visible through workflow status/connect surfaces. Configure lifecycle behavior with `workflowNotifications.enabled` (default `true`) and `workflowNotifications.notifyOn` (default `["completed", "failed", "blocked", "awaiting_input"]`).
1011
1011
 
1012
1012
  Human input is runtime-only: call `ctx.ui.input`, `ctx.ui.confirm`, `ctx.ui.select`, `ctx.ui.editor`, or `ctx.ui.custom<T>` at the point where the workflow actually needs a decision. No builder-level declaration is required or supported.
1013
1013
 
@@ -1290,6 +1290,8 @@ Workflow outputs are runtime contracts for completed workflow runs and for paren
1290
1290
 
1291
1291
  **Return convention:** outputs are return-object keys. Atomic never infers child workflow outputs from stage names, stage order, or the final assistant message. If a parent should read `child.outputs.foo`, the child workflow's `run` must both declare `outputs: { foo: schema }` and return `{ foo: value }`. `result` is not special and is never added for you: to expose `result`, declare it in `outputs` and return `{ result }` exactly like any other output. Returning a key that is not declared in `outputs` fails the run with `atomic-workflows: workflow "<name>" returned undeclared output "<key>"; declare it in outputs or remove it from the run return`.
1292
1292
 
1293
+ **Reserved `status` output convention:** if a workflow declares and returns a top-level `status` output with the string value `"failed"` or `"blocked"`, Atomic treats that as the workflow's terminal run status instead of recording a successful completion. When present, a non-empty top-level `summary` string becomes the run error/reason shown in lifecycle notices and status surfaces. Use this convention only when the workflow is intentionally reporting its own terminal state (for example, a deterministic release gate that returns `{ status: "blocked", summary: "required checks are pending" }`). Do not use a top-level `status` field for unrelated external state such as a deployment/check you merely inspected; choose a domain-specific name like `deployment_status` or `gate_status` instead.
1294
+
1293
1295
  The `outputs` object is a schema contract, not an automatic stage selector. To expose values from any stage, capture the stage/task/child result in normal TypeScript and return it from `run` under the desired key:
1294
1296
 
1295
1297
  ```ts
@@ -1812,7 +1814,9 @@ export default workflow({
1812
1814
 
1813
1815
  For lower-level integrations, `@bastani/workflows` also exports `setupGitWorktree({ gitWorktreeDir, baseBranch, cwd })`, returning `{ worktreeRoot, cwd, repositoryRoot, created }` with the same validation, symlink-preserving path handling, and cwd-preservation behavior used by workflow stages.
1814
1816
 
1815
- `fallbackModels` retries transient provider/model failures with the primary `model` first, then each fallback, then the current Atomic-selected model when available. It is for rate limits, quota/auth/provider outages, unavailable models, network timeouts, and 5xx errors — not workflow-code errors, tool failures, validation failures, or cancellations.
1817
+ `fallbackModels` retries transient provider/model failures with the primary `model` first, then each fallback, then the current Atomic-selected model when available. It is for rate limits, quota/auth/provider outages, unavailable models, network timeouts, generic transport errors such as `Connection error.` / `fetch failed`, and 5xx errors — not workflow-code errors, tool failures, validation failures, or cancellations.
1818
+
1819
+ A candidate that is **request/context incompatible** with the current turn — for example an HTTP 400/413/422 bad/unprocessable/payload-too-large request, an unsupported tool or parameter, a context-length/context-window overflow, or a `too large` / `invalid_request` / `bad_request` error — also advances the chain to the next candidate rather than stopping. This ensures that if none of the configured candidates can serve the request, the workflow stage falls back to the currently selected user model instead of hard-failing. Refusals, content-filter/safety blocks, cancellations, and task failures still stop the chain and are never retried on another model.
1816
1820
 
1817
1821
  When a finished stage's session is reattached for a follow-up (for example a post-completion follow-up, or after the CLI is reloaded), the stage resumes on the model the session last settled on — the one that actually worked — instead of replaying the chain from the primary. If that model fails again with a transient/retryable error, the full chain is retried from the primary.
1818
1822
 
@@ -1847,7 +1851,7 @@ A `model`/`fallbackModels` entry may also request a context-window budget with a
1847
1851
  ```ts
1848
1852
  await ctx.task("review", {
1849
1853
  task: "Review the diff",
1850
- model: "anthropic/claude-fable-5:xhigh",
1854
+ model: "anthropic/claude-fable-5:high",
1851
1855
  // The copilot opus fallback runs at its largest advertised (long-context) window.
1852
1856
  // Use (long) for a size-agnostic marker, or a rounded long-tier label like (1m).
1853
1857
  fallbackModels: ["github-copilot/claude-opus-4.8 (long):xhigh", "anthropic/claude-opus-4-8:xhigh"],