@bastani/atomic 0.10.14 → 0.10.15-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +1 -1
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
@@ -1,52 +1,100 @@
1
1
  ---
2
2
  title: "Environment variables"
3
3
  sidebarTitle: "Environment variables"
4
- description: "Reference for Atomic environment variables, exact value parsing rules, legacy Pi aliases, color controls, and shell metadata."
4
+ description: "Reference for Atomic environment variables, value parsing rules, web access and proxy variables, storage overrides, terminal controls, and subprocess metadata."
5
5
  ---
6
6
 
7
- Atomic reads environment variables for configuration, provider credentials, terminal overrides, and subprocess context. When an `ATOMIC_*` variable and its legacy `PI_*` alias are both set, the `ATOMIC_*` variable always takes precedence (for example, `ATOMIC_NO_PTY=0` overrides `PI_NO_PTY=1`).
7
+ Atomic reads environment variables for configuration, provider credentials, web access, proxies, terminal overrides, and subprocess context. When an `ATOMIC_*` variable and its legacy `PI_*` alias are both set, `ATOMIC_*` takes precedence (for example, `ATOMIC_NO_PTY=0` overrides `PI_NO_PTY=1`).
8
+
9
+ <Note>
10
+ **Empty-string `PI_*` fallback exception:** For most variables, an explicit empty string (`""`) counts as set and stops fallback to `PI_*`. Two variables are exceptions—setting `ATOMIC_CACHE_RETENTION=""` or `ATOMIC_OAUTH_CALLBACK_HOST=""` falls through to `PI_CACHE_RETENTION` or `PI_OAUTH_CALLBACK_HOST` when set.
11
+ </Note>
8
12
 
9
13
  ## How boolean and numeric values are parsed
10
14
 
11
- Variables use different parsing rules depending on their category:
15
+ Variables follow strict parsing rules based on their category:
12
16
 
13
- - **Exact `"1"` only** (`"true"` and `"yes"` do not enable): `ATOMIC_DEBUG`, `ATOMIC_TIMING`, `ATOMIC_REDUCED_MOTION`, `ATOMIC_EXPERIMENTAL`, `ATOMIC_NO_PTY`, `ATOMIC_HARDWARE_CURSOR`, `ATOMIC_CLEAR_ON_SHRINK`, `ATOMIC_CLIPBOARD_OSC52`, `ATOMIC_ALLOW_BROWSER_COOKIES`, `ATOMIC_ALLOW_PRIVATE_URL_READS`, `ATOMIC_TUI_DEBUG`, `ATOMIC_TUI_DEBUG_REDRAW`, and `HERDR_ENV`.
14
- - **`"1"`, `"true"`, or `"yes"` (case-insensitive):** `ATOMIC_OFFLINE` (`"0"` and `"false"` keep Atomic online), `ATOMIC_SKIP_VERSION_CHECK` (`"0"` and `"false"` keep startup version checks enabled), and `ATOMIC_TELEMETRY` (any other defined value, including `"0"`, `"false"`, `"no"`, or `""`, disables version-adoption pings and disables provider attribution headers for OpenRouter, NVIDIA, and OpenCode).
15
- - **`"1"`/`"true"` or `"0"`/`"false"` (case-insensitive, trimmed):** `ATOMIC_INTERCOM_JOIN_AT_STARTUP` (other values are ignored).
16
- - **Any defined value (including empty string `""`):** `NO_COLOR` and `NODE_DISABLE_COMPILE_CACHE`. Unset these variables instead of setting them to `"0"`.
17
- - **Exact `"0"`:** `ATOMIC_EVENT_LOOP_BLOCK_STACKS` (trimmed) and `ATOMIC_TASK_CGROUP` (exact `"0"`, not trimmed).
18
- - **Numeric values:** Invalid or negative values silently fall back to the default (or disable stall logging for `ATOMIC_EVENT_LOOP_BLOCK_MS`).
17
+ | Rule | Accepted values | Variables |
18
+ | --- | --- | --- |
19
+ | Exact `"1"` only | Only `"1"` enables (`"true"` and `"yes"` do not) | `ATOMIC_DEBUG`, `ATOMIC_TIMING`, `ATOMIC_REDUCED_MOTION`, `ATOMIC_EXPERIMENTAL`, `ATOMIC_NO_PTY`, `ATOMIC_HARDWARE_CURSOR`, `ATOMIC_CLEAR_ON_SHRINK`, `ATOMIC_CLIPBOARD_OSC52`, `ATOMIC_ALLOW_BROWSER_COOKIES`, `ATOMIC_ALLOW_PRIVATE_URL_READS`, `ATOMIC_TUI_DEBUG`, `ATOMIC_TUI_DEBUG_REDRAW`, `HERDR_ENV` |
20
+ | Truthy flag | `"1"`, `"true"`, or `"yes"` (case-insensitive) | `ATOMIC_OFFLINE` (`"0"`/`"false"` keep online), `ATOMIC_SKIP_VERSION_CHECK` (`"0"`/`"false"` keep enabled), `ATOMIC_STARTUP_BENCHMARK`, `ATOMIC_TELEMETRY` (any other defined value including `"0"`, `"false"`, `"no"`, or `""` disables version-adoption pings and provider attribution headers for OpenRouter, NVIDIA, and OpenCode) |
21
+ | Explicit boolean | `"1"`/`"true"` or `"0"`/`"false"` (case-insensitive, trimmed; other values ignored) | `ATOMIC_INTERCOM_JOIN_AT_STARTUP` |
22
+ | Any defined value | Any value, including `""` (unset instead of setting to `"0"`) | `NO_COLOR`, `NODE_DISABLE_COMPILE_CACHE` |
23
+ | Exact `"0"` to disable | Exact `"0"` disables (`ATOMIC_EVENT_LOOP_BLOCK_STACKS` is trimmed; `ATOMIC_TASK_CGROUP` is not) | `ATOMIC_EVENT_LOOP_BLOCK_STACKS`, `ATOMIC_TASK_CGROUP` |
24
+ | Numeric | Positive or non-negative numbers per variable; invalid or negative values fall back to the default (or disable stall logging for `ATOMIC_EVENT_LOOP_BLOCK_MS`) | `ATOMIC_TUI_ESC_TIMEOUT`, `ATOMIC_EVENT_LOOP_BLOCK_MS`, `ATOMIC_HEAP_MB`, `ATOMIC_STDIN_TIMEOUT_MS`, `ATOMIC_TOOL_ABORT_GRACE_MS`, `ATOMIC_CODEMODE_MAX_WORKERS` |
19
25
 
20
26
  ## Core and session variables
21
27
 
22
28
  | Atomic variable | Legacy alias | Accepted values and behavior |
23
29
  | --- | --- | --- |
24
- | `ATOMIC_CODING_AGENT_DIR` | `PI_CODING_AGENT_DIR` | Path to the agent and config directory (default `~/.atomic/agent`). Read each time a session or extension load starts, so caches follow the active value. An [SDK](/sdk) session's `agentDir` option ([SDK directories](/sdk/reference#directories)) takes precedence |
30
+ | `ATOMIC_CODING_AGENT_DIR` | `PI_CODING_AGENT_DIR` | Path to the agent and config directory (default `~/.atomic/agent`). Read each time a session or extension load starts, so caches follow the active value. Setting this variable also suppresses interactive first-run setup. An [SDK](/sdk) session's `agentDir` option ([SDK directories](/sdk/reference#directories)) takes precedence |
25
31
  | `ATOMIC_OFFLINE` | `PI_OFFLINE` | `1`, `true`, or `yes` (case-insensitive) disables automatic network activity: update checks, package updates, telemetry, model catalog refreshes, and downloads of `fd`, `rg`, and [Git](/getting-started/installation#git). `0` and `false` keep Atomic online |
26
- | `ATOMIC_CACHE_RETENTION` | `PI_CACHE_RETENTION` | Case-sensitive `long` (default in Atomic CLI and SDK sessions), `short`, or `none`. Unrecognized non-empty values fall back to `short`. Standalone [`@bastani/atomic-ai`](/libraries/ai) defaults to `short`. See [Prompt-cache retention](#prompt-cache-retention) |
32
+ | `ATOMIC_CACHE_RETENTION` | `PI_CACHE_RETENTION` | Case-sensitive `long` (default in Atomic CLI and SDK sessions), `short`, or `none`. Unrecognized non-empty values fall back to `short`; an empty string falls through to `PI_CACHE_RETENTION`. Standalone [`@bastani/atomic-ai`](/libraries/ai) defaults to `short`. See [Prompt-cache retention](#prompt-cache-retention) |
27
33
  | `ATOMIC_MODEL_CATALOG_URL` | `PI_MODEL_CATALOG_URL` | Base URL for `<url>/api.json` model catalog refreshes (default `https://models.dev`). Refreshes run at most once every four hours per provider (or on `atomic update --models`), keeping the bundled catalog if download fails. See [Configure custom models](/models) |
28
34
  | `ATOMIC_SHARE_VIEWER_URL` | `PI_SHARE_VIEWER_URL` | Base URL of the viewer that `/share` links open (default `https://bastani.ai/session/`; the gist ID is appended after `#`) |
29
35
  | `ATOMIC_SKIP_VERSION_CHECK` | `PI_SKIP_VERSION_CHECK` | `1`, `true`, or `yes` (case-insensitive) skips automatic startup version checks; `0` and `false` keep checks enabled. Explicit self-update still checks |
30
36
  | `ATOMIC_SELF_UPDATE_COMMAND` | `PI_SELF_UPDATE_COMMAND` | Command `atomic update` runs to update Atomic itself, split on whitespace, with `{packageName}`, `{version}`, and `{installSpec}` placeholders. Takes precedence over `selfUpdateCommand`. See [Custom update command](/reference/cli#custom-update-command) |
31
37
  | `ATOMIC_TELEMETRY` | `PI_TELEMETRY` | `1`/`true`/`yes` enables version-adoption pings; any other defined value (including `0`, `false`, `no`, or `""`) disables pings and disables provider attribution headers for OpenRouter, NVIDIA, and OpenCode. Does not disable update checks |
32
- | `ATOMIC_OAUTH_CALLBACK_HOST` | `PI_OAUTH_CALLBACK_HOST` | Bind host for the local OAuth callback server during `/login` (default `127.0.0.1`) |
38
+ | `ATOMIC_OAUTH_CALLBACK_HOST` | `PI_OAUTH_CALLBACK_HOST` | Bind host for the local OAuth callback server during `/login` (default `127.0.0.1`). An empty string falls through to `PI_OAUTH_CALLBACK_HOST` |
33
39
  | `ATOMIC_PACKAGE_DIR` | `PI_PACKAGE_DIR` | Override package asset directory (useful for Nix or Guix store paths) |
34
40
  | `ATOMIC_TODO_PATH` | `PI_TODO_PATH` | Override directory used by the built-in `todo` tool (default `.atomic/todos`) |
35
- | `ATOMIC_ALLOW_BROWSER_COOKIES` | None | Exact `1` allows Gemini Web browser cookie reading without setting `allowBrowserCookies: true` in `~/.atomic/web-search.json` ([Web access](/web-access)). Setting `0` does not override `web-search.json` |
36
41
  | `ATOMIC_ALLOW_PRIVATE_URL_READS` | None | Exact `1` allows the `read` tool to fetch `localhost`, `.localhost`, private IP addresses, and cloud metadata endpoints (blocked by default) |
37
42
  | `ATOMIC_BLUEPRINT_GITHUB_BASE_URL` | None | Replace `https://github.com` when fetching blueprint `uses:` actions |
38
43
  | `VISUAL`, `EDITOR` | None | External editor for `Ctrl+G` when `externalEditor` is unset in settings. Falls back to `notepad` on Windows or `nano` on macOS and Linux when all three are unset |
39
44
 
45
+ ## Web access and proxy variables
46
+
47
+ ### Web search and content fetching
48
+
49
+ | Variable | Accepted values and behavior |
50
+ | --- | --- |
51
+ | `EXA_API_KEY` | API key for Exa web search in `web_search`; overrides `exaApiKey` in `~/.atomic/web-search.json`. See [Web access](/web-access) |
52
+ | `PERPLEXITY_API_KEY` | API key for Perplexity web search in `web_search`; overrides `perplexityApiKey` in `~/.atomic/web-search.json`. See [Web access](/web-access) |
53
+ | `GEMINI_API_KEY` | API key for Google Gemini model requests and Gemini API web search and video analysis. See [Web access](/web-access) and [Model providers](/providers#environment-variables-or-auth-file) |
54
+ | `ATOMIC_ALLOW_BROWSER_COOKIES` | Exact `1` allows Gemini Web browser cookie reading without setting `allowBrowserCookies: true` in `~/.atomic/web-search.json` ([Web access](/web-access)). Setting `0` does not override `web-search.json` |
55
+
56
+ ### Proxy variables
57
+
58
+ | Variable | Accepted values and behavior |
59
+ | --- | --- |
60
+ | `HTTP_PROXY`, `http_proxy` | Proxy URL for outbound HTTP requests; also used for `https://` requests when `HTTPS_PROXY` is unset. Takes precedence over `httpProxy` in [Network proxy settings](/settings#network-proxy) |
61
+ | `HTTPS_PROXY`, `https_proxy` | Proxy URL for outbound HTTPS requests (including model providers, OpenAI Codex WebSocket, and PostgreSQL HTTP proxies). Takes precedence over `httpProxy` in [Network proxy settings](/settings#network-proxy) |
62
+ | `NO_PROXY`, `no_proxy` | Comma-separated hostnames, domain suffixes, or addresses that bypass the proxy |
63
+ | `ALL_PROXY`, `all_proxy` | Fallback proxy URL read by the standalone binary when the protocol-specific variable is unset; not read by npm-installed `atomic` on Node.js |
64
+
65
+ Both npm-installed `atomic` and the standalone binary route `https://` requests through `HTTP_PROXY` when `HTTPS_PROXY` is unset, and skip hosts listed in `NO_PROXY`. Because the standalone binary uses Bun's HTTP client while npm installs use Node.js, proxy variables behave differently in these edge cases:
66
+
67
+ | Setup | npm-installed `atomic` (Node.js) | Standalone binary (Bun) |
68
+ | --- | --- | --- |
69
+ | `ALL_PROXY` naming an `http://` or `https://` proxy | Not read | Used when the request's own variable is unset |
70
+ | Empty lowercase variable (`http_proxy=""`, `no_proxy=""`) with uppercase set | Empty value wins: no proxy, no exemptions | Uppercase value is used |
71
+ | CIDR block in `NO_PROXY` (`10.0.0.0/8`) | Not matched | Exempts addresses in the range |
72
+ | Proxy variables changed while Atomic runs | Read at startup and when `httpIdleTimeoutMs` changes | Read on every request |
73
+ | `http://` endpoint through a proxy | Sent through a `CONNECT` tunnel | Sent to the proxy with the full URL |
74
+ | SOCKS proxy (`socks5://`) in `HTTP_PROXY` or `HTTPS_PROXY` | Supported | Requests fail with `UnsupportedProxyProtocol` |
75
+
76
+ The OpenAI Codex WebSocket uses the same proxy as other requests. In the standalone binary, it also reads proxy variables from a credential's [`env`](/providers#auth-file); an `ALL_PROXY` naming a SOCKS proxy is skipped for WebSocket and those requests fall back to SSE.
77
+
40
78
  ## Storage and team variables
41
79
 
80
+ Sessions default to `~/.atomic/workflows/journal.sqlite`. With a custom `ATOMIC_CODING_AGENT_DIR`, they default to `<agentDir>/workflows/journal.sqlite` unless an eligible custom directory adopted an existing parent store (see [Storage home](/storage#storage-home)).
81
+
42
82
  | Atomic variable | Legacy alias | Accepted values and behavior |
43
83
  | --- | --- | --- |
44
- | `ATOMIC_CODING_AGENT_SESSION_DIR` | None | Non-empty path selects a JSONL session directory (`--session-dir` and `--no-session` take precedence; see [CLI session options](/reference/cli#session-options)). Relative paths resolve from the working directory; empty values leave [session settings](/settings#sessions) in effect. Combining a non-empty value with `--storage`, `--storage-file`, or `ATOMIC_SESSIONS_STORAGE` fails startup with `StorageConfigError` (`conflicting-overrides`) |
45
- | `ATOMIC_STORAGE` | None | Shared storage selection JSON for sessions without their own selection and for Intercom (`{ "dir": "..." }` is forbidden here). Overrides [settings](/settings#sessions) but not `--storage`, session flags, or session-specific env vars. See [Selecting storage per process](/storage#selecting-storage-per-process) and [SDK storage](/sdk/storage) |
46
- | `ATOMIC_SESSIONS_STORAGE` | None | Session-only storage selection JSON in the same form as [`sessions.storage`](/settings#sessions) (accepts `{ "dir": "..." }`). Conflicts with a non-empty `ATOMIC_CODING_AGENT_SESSION_DIR` |
84
+ | `ATOMIC_CODING_AGENT_SESSION_DIR` | None | Non-empty path selects a JSONL session directory (`--session-dir` and `--no-session` take precedence; see [CLI session options](/reference/cli#session-options)). Relative paths resolve from the working directory; empty values leave [session settings](/settings#sessions) in effect |
85
+ | `ATOMIC_STORAGE` | None | Shared storage selection JSON in the same form as [`storage`](/settings#sessions) (including adapters; `{ "dir": "..." }` is forbidden here). Overrides settings, but not `--storage`, session flags, or session-specific env vars. Relative paths resolve from [storage home](/storage#storage-home) |
86
+ | `ATOMIC_SESSIONS_STORAGE` | None | Session-only storage selection JSON in the same form as [`sessions.storage`](/settings#sessions) (accepts `{ "dir": "..." }`). Relative paths resolve from [storage home](/storage#storage-home) |
47
87
  | `ATOMIC_INTERCOM_GROUP` | `PI_INTERCOM_GROUP` | Static home Intercom group for this session. See [Intercom reference](/intercom/reference#configuration) |
48
88
  | `ATOMIC_INTERCOM_JOIN_AT_STARTUP` | `PI_INTERCOM_JOIN_AT_STARTUP` | `1`/`true` or `0`/`false` (case-insensitive, trimmed) overrides whether interactive sessions join Intercom at startup regardless of Intercom config |
49
89
 
90
+ - **Conflicts:** Combining a non-empty `ATOMIC_CODING_AGENT_SESSION_DIR` with `--storage`, `--storage-file`, or `ATOMIC_SESSIONS_STORAGE` fails startup with `StorageConfigError` (`conflicting-overrides`).
91
+ - **In-memory storage:** Pass `{ "memory": true }` in `ATOMIC_STORAGE` or `ATOMIC_SESSIONS_STORAGE` for process-local memory storage. Atomic never falls back to memory automatically after a storage failure.
92
+ - See [Selecting storage per process](/storage#selecting-storage-per-process), [CLI session options](/reference/cli#session-options), and [SDK storage](/sdk/storage).
93
+
94
+ <Warning>
95
+ **Removed libSQL team variables (startup fails if set):** `ATOMIC_PROFILE`, `ATOMIC_TEAM_URL`, `ATOMIC_TEAM_TOKEN`, `ATOMIC_TEAM_TOKEN_FILE`, and `ATOMIC_TEAM_PREFIX` were removed along with libSQL support. Setting any of them to a non-empty value aborts startup with `TeamProfileConfigError` (`libsql-removed`) before any store opens so CI jobs do not silently fall back to local storage. Unset them and switch to PostgreSQL via `atomic storage join <postgres-url>` or `ATOMIC_STORAGE`. See [Moving off libSQL](/storage#moving-off-libsql).
96
+ </Warning>
97
+
50
98
  ## Terminal and display variables
51
99
 
52
100
  | Variable | Legacy alias | Accepted values and behavior |
@@ -55,14 +103,14 @@ Variables use different parsing rules depending on their category:
55
103
  | `FORCE_COLOR` | None | `0` or `false` disables all colors and text styles (same as `NO_COLOR`). `1`, `true`, empty string `""`, or `2` caps true-color themes at 256 colors (never upgrades a terminal's detected color depth). `3` keeps the terminal's detected color mode. Ignored when `NO_COLOR` is set |
56
104
  | `ATOMIC_REDUCED_MOTION` | None | Exact `1` skips startup animations and keeps the working `∀` static while elapsed time still updates |
57
105
  | `ATOMIC_HARDWARE_CURSOR` | `PI_HARDWARE_CURSOR` | Exact `1` enables the hardware terminal cursor when `showHardwareCursor` is unset in settings |
58
- | `ATOMIC_CLEAR_ON_SHRINK` | `PI_CLEAR_ON_SHRINK` | Exact `1` clears empty rows when rendered content shrinks; `terminal.clearOnShrink` in [Settings](/settings) takes precedence |
106
+ | `ATOMIC_CLEAR_ON_SHRINK` | `PI_CLEAR_ON_SHRINK` | Exact `1` clears empty rows when rendered content shrinks; `terminal.clearOnShrink` in [Settings](/settings#terminal-and-images) takes precedence |
59
107
  | `ATOMIC_CLIPBOARD_OSC52` | `PI_CLIPBOARD_OSC52` | Exact `1` also forwards copied text via OSC 52 after local clipboard writes (useful for remote multiplexers or IDE daemons without SSH env vars) |
60
108
  | `ATOMIC_TUI_ESC_TIMEOUT` | `PI_TUI_ESC_TIMEOUT` | Positive finite milliseconds the terminal waits after a lone `ESC` before treating it as Escape (default `100` over SSH, `10` otherwise; invalid values fall back to default). Increase if Alt keys register as Escape |
61
109
  | `ATOMIC_HYPERLINKS` | `PI_HYPERLINKS` | `1`, `0`, or `auto` overrides OSC 8 hyperlink detection; explicit `terminal.hyperlinks` in settings takes precedence |
62
110
  | `ATOMIC_TRUE_COLOR` | `PI_TRUE_COLOR` | `1`, `0`, or `auto` overrides 24-bit color detection; explicit `terminal.trueColor` in settings takes precedence |
63
111
  | `ATOMIC_IMAGE_PROTOCOL` | `PI_IMAGE_PROTOCOL` | Case-insensitive `kitty`, `iterm2`, `none` (or `0`), or `auto` overrides inline image detection; explicit `terminal.images` in settings takes precedence |
64
112
  | `ATOMIC_PROGRAM_STATUS` | `PI_PROGRAM_STATUS` | Exact `1` forces OSC 7501 program-status reports; exact `0` disables them; any other value or unset reports only after terminal confirmation ([Program status](/terminal-setup#program-status)) |
65
- | `COLORFGBG` | None | Fallback terminal background hint when OSC 11 background queries are unavailable. Uses the last `;`-separated integer. Indices `0` to `6` and `8` map to dark, and other integers map to light. See [Themes](/themes) |
113
+ | `COLORFGBG` | None | Fallback terminal background hint when OSC 11 background queries are unavailable. Uses the last `;`-separated integer: indices `0` to `6` and `8` map to dark, and other integers map to light. See [Themes](/themes) |
66
114
  | `HERDR_ENV`, `HERDR_BIN_PATH`, `HERDR_PANE_ID`, `HERDR_SOCKET_PATH` | None | Set by Herdr inside managed panes. Exact `HERDR_ENV=1` with non-empty `HERDR_BIN_PATH`, `HERDR_PANE_ID`, and `HERDR_SOCKET_PATH` enables built-in pane status reporting; `HERDR_ENV=1` is also required for Herdr automation. See [Herdr](/herdr) |
67
115
 
68
116
  ## Diagnostics and performance
@@ -71,6 +119,7 @@ Variables use different parsing rules depending on their category:
71
119
  | --- | --- | --- |
72
120
  | `ATOMIC_DEBUG` | `PI_DEBUG` | Exact `1` turns on [debug mode](/development#debugging) for this run (same as `--debug`; footer shows a `debug` badge). `ATOMIC_DEBUG=0` does not override `debug: true` in settings |
73
121
  | `ATOMIC_TIMING` | `PI_TIMING` | Exact `1` prints startup timings to stderr and resume timings for `atomic --session` ([Inspecting snapshots](/worktree-snapshots#inspecting-snapshots)) |
122
+ | `ATOMIC_STARTUP_BENCHMARK` | `PI_STARTUP_BENCHMARK` | `1`, `true`, or `yes` (case-insensitive) launches interactive mode, measures startup until the editor is ready for input, exits cleanly, and prints the timings. Fails with `StartupBenchmarkConfigError` (`unsupported-mode`) in print (`-p`), JSON (`--mode json`), or standalone RPC (`--mode rpc`) modes |
74
123
  | `ATOMIC_STARTUP_TRACE` | `PI_STARTUP_TRACE` | File path to append JSONL startup milestones (process start, first paint, session ready, first provider request) with timestamps across the terminal UI and background session process |
75
124
  | `ATOMIC_EVENT_LOOP_BLOCK_MS` | None | Positive integer milliseconds: log terminal UI or background session event-loop stalls at least this long to `event-loop-blocks.jsonl` in the agent directory (`0` or invalid disables). See [Finding what freezes the UI](/development#finding-what-freezes-the-ui) |
76
125
  | `ATOMIC_EVENT_LOOP_BLOCK_LOG` | None | Alternate output file for `ATOMIC_EVENT_LOOP_BLOCK_MS`; relative paths resolve from the startup directory |
@@ -84,26 +133,14 @@ Variables use different parsing rules depending on their category:
84
133
  | `ATOMIC_TOOL_ABORT_GRACE_MS` | None | Milliseconds (digits only) an interrupted tool call may keep running before the turn moves on with `Operation aborted` (default `10000`, max `2147483647`, `0` stops waiting immediately; invalid values fall back to `10000`). See [Message queue](/usage#message-queue) |
85
134
  | `ATOMIC_CODEMODE_MAX_WORKERS` | `PI_CODEMODE_MAX_WORKERS` | Positive integer maximum live codemode workers per Atomic process (default `2`, each capped at 256 MiB; invalid values fall back to `2`). Extra scripts queue until a slot opens. See [Codemode](/codemode) |
86
135
  | `ATOMIC_HOST_SPAWN` | None | Set to `child-process` to launch helper processes (Git snapshots, `rg`, `fd`, worktree setup, and standalone shell commands) through standard Node child spawning instead of Atomic's native spawner. Useful for troubleshooting process-spawning issues on Linux or Windows |
87
- | `ATOMIC_TASK_CGROUP` | None | Exact `0` disables Linux cgroup v2 process-tree containment for background shell tasks. See [Lifetime, retention, and cleanup](/background-tasks#lifetime-retention-and-cleanup) |
136
+ | `ATOMIC_TASK_CGROUP` | None | Exact `0` disables Linux cgroup v2 process-tree containment for background shell tasks. See [Lifetime, retention, and process cleanup](/background-tasks/reference#lifetime-retention-and-cleanup) |
88
137
  | `NODE_COMPILE_CACHE` | None | Override the directory for Node's persistent compile cache, enabled automatically on Node.js to speed up startup. On Windows, a cold default cache warms in a background helper during interactive runs; setting `NODE_COMPILE_CACHE` lets Node write it on exit instead |
89
138
  | `NODE_DISABLE_COMPILE_CACHE` | None | Any defined value (including empty string `""`) prevents Node from enabling the compile cache |
90
- | `NAPI_RS_NATIVE_LIBRARY_PATH` | None | Path to a custom `@bastani/atomic-natives` `.node` addon binary; bypasses the release version check |
91
-
92
- ## Retired workflow variables
93
-
94
- Unset `ATOMIC_WORKFLOWS_JOURNAL`, `ATOMIC_WORKFLOW_JOURNAL_PATH`, and `ATOMIC_WORKFLOW_ARTIFACT_DIR` when upgrading from 0.9.x. Atomic still inspects `ATOMIC_WORKFLOWS_JOURNAL` and `ATOMIC_WORKFLOW_JOURNAL_PATH` only when checking whether a custom agent directory should adopt an existing parent storage home; otherwise they are not used and existing files are left untouched. `ATOMIC_WORKFLOW_ARTIFACT_DIR`, `ATOMIC_WORKFLOW_DEBUG`, and `ATOMIC_DEBUG_POOLED_WATCH` are ignored; use `ATOMIC_DEBUG=1` for current diagnostics.
95
-
96
- ## Session storage
97
-
98
- Sessions default to `~/.atomic/workflows/journal.sqlite`. With a custom `ATOMIC_CODING_AGENT_DIR`, they default to `<agentDir>/workflows/journal.sqlite` (unless an eligible custom directory adopted an existing parent store; see [Storage home](/storage#storage-home)).
99
-
100
- `ATOMIC_CODING_AGENT_SESSION_DIR` selects JSONL session files. Relative paths resolve against the working directory, and an empty value leaves settings in effect. Combining a non-empty value with `--storage`, `--storage-file`, or `ATOMIC_SESSIONS_STORAGE` fails startup with `StorageConfigError` (`conflicting-overrides`).
101
-
102
- `ATOMIC_STORAGE` and `ATOMIC_SESSIONS_STORAGE` accept the same JSON selections as [`storage` and `sessions.storage`](/settings#sessions), including adapters, with relative paths resolving from the storage home (`{ "dir": "..." }` is allowed in `ATOMIC_SESSIONS_STORAGE` and forbidden in `ATOMIC_STORAGE`). Use `{ "memory": true }` for process-local memory (never selected automatically after a storage failure). See [Selecting storage per process](/storage#selecting-storage-per-process), [CLI session options](/reference/cli#session-options), and [SDK storage](/sdk/storage).
139
+ | `NAPI_RS_NATIVE_LIBRARY_PATH` | None | Path to a locally compiled native addon (`.node` file), such as a custom build on [Termux](/termux); bypasses Atomic's release version check |
103
140
 
104
141
  ## Prompt-cache retention
105
142
 
106
- Atomic defaults to **long** prompt-cache retention in main chat and subagents where the provider and model support it. Set `ATOMIC_CACHE_RETENTION` before launch to choose `short`, `none`, or `long` (`PI_CACHE_RETENTION` is a legacy alias):
143
+ Atomic defaults to **long** prompt-cache retention in main chat and subagents where the provider and model support it. Set `ATOMIC_CACHE_RETENTION` before launch to choose `short`, `none`, or `long` (`PI_CACHE_RETENTION` is a legacy alias; setting `ATOMIC_CACHE_RETENTION=""` falls through to `PI_CACHE_RETENTION`):
107
144
 
108
145
  ```bash
109
146
  ATOMIC_CACHE_RETENTION=short atomic
@@ -111,19 +148,17 @@ ATOMIC_CACHE_RETENTION=short atomic
111
148
 
112
149
  Values are **case-sensitive** (`"long"`, `"short"`, or `"none"`). Any unrecognized non-empty value silently falls back to **`short`** (not `long`).
113
150
 
114
- Use `short` for shorter caching (five minutes on Anthropic), `none` to disable Atomic's optional cache controls where supported, or `long` to request extended retention (one hour on Anthropic). Providers can still apply automatic caching depending on the model.
151
+ - **`short`:** shorter retention (5 minutes on Anthropic).
152
+ - **`long`:** extended retention (1 hour on Anthropic).
153
+ - **`none`:** disables Atomic's optional cache controls where supported (providers may still apply automatic caching).
115
154
 
116
- When unset, OpenAI models without known extended-retention support (such as GPT-4o) use ordinary caching, and Bedrock Claude models without known one-hour support (such as Claude 3.7) use five-minute caching. Supported OpenAI models and Bedrock Claude 4.5+ keep extended caching. For Bedrock application inference profiles, set an accurate model name in [`models.json`](/models) so Atomic recognizes its capabilities. Custom OpenAI-compatible models can set `compat.supportsLongCacheRetention` in `models.json` (see [`models.json` field reference](/models-configuration)).
155
+ When unset, OpenAI models without known extended-retention support (such as GPT-4o) use ordinary caching, and Bedrock Claude models without known one-hour support (such as Claude 3.7) use five-minute caching. Supported OpenAI models and Bedrock Claude 4.5+ keep extended caching. For Bedrock application inference profiles, set an accurate model name in [`models.json`](/models) so Atomic recognizes its capabilities. Custom OpenAI-compatible models can set `compat.supportsLongCacheRetention` in [`models.json`](/models-configuration).
117
156
 
118
157
  In [SDK](/sdk) requests, explicit `cacheRetention` takes precedence over `ATOMIC_CACHE_RETENTION`, and request-scoped `env` overrides credential-scoped and process environments. Requests that disable caching (such as branch summaries) stay uncached. Direct calls to standalone [`@bastani/atomic-ai`](/libraries/ai) APIs default an unset `ATOMIC_CACHE_RETENTION` to `short` and enable `long` only when set to `"long"`, so disabling caching there requires passing `cacheRetention: "none"` explicitly.
119
158
 
120
- [Anthropic's prompt-caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing) charges **2x base input price for one-hour writes** versus **1.25x for five-minute writes**. Extended retention helps when prompts are reused after five minutes; `short` can cost less when cache hits happen within five minutes or prompts are rarely reused.
121
-
122
- ## Subprocess attribution and worktree phase
123
-
124
- Atomic sets `AI_AGENT=atomic` for itself and every subprocess it launches, replacing any caller-supplied value without mutating the caller's environment object. Scripts can inspect it to detect an Atomic-owned invocation.
125
-
126
- During subagent worktree cleanup, Atomic sets `ATOMIC_SUBAGENT_WORKTREE_PHASE=finishing` on its own Git invocations (and clears any inherited value on other Git calls) so custom Git hooks or filters do not wait on that child's terminal notification. See [Subagents](/subagents).
159
+ <Tip>
160
+ **Anthropic cache-write pricing:** [Anthropic's prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing) bills **2x base input price for 1-hour (`long`) writes** versus **1.25x for 5-minute (`short`) writes**. Use `long` when prompts are reused after five minutes, and `short` when turns happen rapidly within five minutes or prompts are rarely reused.
161
+ </Tip>
127
162
 
128
163
  ## TLS certificates
129
164
 
@@ -133,9 +168,12 @@ Requests refused for an untrusted certificate fail immediately without retrying
133
168
 
134
169
  ## Provider credentials
135
170
 
136
- Provider API keys and cloud auth variables (such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `AZURE_OPENAI_API_KEY`, `GEMINI_API_KEY`, and AWS/Bedrock credentials) are documented in [Providers](/providers#environment-variables-or-auth-file).
171
+ Provider API keys and cloud auth variables (such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `AZURE_OPENAI_API_KEY`, `GEMINI_API_KEY`, and AWS/Bedrock credentials) are documented in [Model providers](/providers#environment-variables-or-auth-file).
137
172
 
138
- `ANTHROPIC_AUTH_TOKEN` supplies a header-only bearer token (`Authorization: Bearer ...`) for Anthropic-compatible gateways without requiring an API key, across main chat turns, subagents, and branch summaries.
173
+ Additional provider auth overrides:
174
+
175
+ - **`ANTHROPIC_AUTH_TOKEN`:** supplies a header-only bearer token (`Authorization: Bearer ...`) for Anthropic-compatible gateways without requiring an API key, across main chat turns, subagents, and branch summaries.
176
+ - **`KIMI_CODE_OAUTH_HOST` / `KIMI_OAUTH_HOST`:** overrides the OAuth host for Kimi Code device-code sign-in and token refresh (default `https://auth.kimi.com`; trailing slashes are stripped). `KIMI_CODE_OAUTH_HOST` takes precedence when both are set.
139
177
 
140
178
  ## Bash and PowerShell session environment
141
179
 
@@ -153,3 +191,15 @@ Before overlaying those eight current snapshot values, Atomic clears all ten res
153
191
  `ATOMIC_SESSION_FILE` and `PI_SESSION_FILE` are no longer populated because session IDs identify records inside the active store rather than assuming a file path. The snapshot is captured when each command runs, so resumed sessions and model changes are always reflected. SDK [`createBashTool()` and `createPowerShellTool()`](/sdk/reference#tools) expose these variables by default; pass `exposeSessionEnvironment: false` to omit them.
154
192
 
155
193
  See [CLI environment variables](/reference/cli#environment-variables) and [RPC direct bash](/rpc/protocol#bash) for execution and streaming behavior.
194
+
195
+ ## Subprocess attribution and worktree phase
196
+
197
+ Atomic sets `AI_AGENT=atomic` for itself and every subprocess it launches, replacing any caller-supplied value without mutating the caller's environment object. Scripts can inspect it to detect an Atomic-owned invocation.
198
+
199
+ During subagent worktree cleanup, Atomic sets `ATOMIC_SUBAGENT_WORKTREE_PHASE=finishing` on its own Git invocations (and clears any inherited value on other Git calls) so custom Git hooks or filters do not wait on that child's terminal notification. See [Subagents](/subagents).
200
+
201
+ ## Retired workflow variables
202
+
203
+ Unset `ATOMIC_WORKFLOWS_JOURNAL`, `ATOMIC_WORKFLOW_JOURNAL_PATH`, and `ATOMIC_WORKFLOW_ARTIFACT_DIR` when upgrading from 0.9.x. Atomic inspects `ATOMIC_WORKFLOWS_JOURNAL` and `ATOMIC_WORKFLOW_JOURNAL_PATH` only when checking whether a custom agent directory should adopt an existing parent storage home; otherwise they are unused and existing files are left untouched. `ATOMIC_WORKFLOW_ARTIFACT_DIR`, `ATOMIC_WORKFLOW_DEBUG`, and `ATOMIC_DEBUG_POOLED_WATCH` are ignored; use `ATOMIC_DEBUG=1` for current diagnostics.
204
+
205
+ Unlike these ignored 0.9.x workflow variables, the removed libSQL team variables (`ATOMIC_PROFILE`, `ATOMIC_TEAM_URL`, `ATOMIC_TEAM_TOKEN`, `ATOMIC_TEAM_TOKEN_FILE`, `ATOMIC_TEAM_PREFIX`) hard-fail startup; see [Storage and team variables](#storage-and-team-variables).
@@ -4,7 +4,7 @@ sidebarTitle: "Extension API"
4
4
  description: "Reference for ExtensionContext, ExtensionToolContext, ExtensionCommandContext, ExtensionAPI methods, and typed errors."
5
5
  ---
6
6
 
7
- This page documents `ExtensionContext`, `ExtensionToolContext`, `ExtensionCommandContext`, `ExtensionAPI` methods, and typed errors. For setup and discovery, see [Extensions overview](/extensions). For patterns and custom tools, see [Write an extension](/extensions/authoring). For embedding Atomic and loading inline extension factories, see [SDK overview](/sdk), [SDK extensions](/sdk/reference#extensions), and [Structured decisions](/sdk/structured-decisions).
7
+ This page documents `ExtensionContext`, `ExtensionToolContext`, `ExtensionCommandContext`, `ExtensionAPI` methods, and typed errors. For setup and discovery, see [Build extensions](/extensions). For patterns and custom tools, see [Write an extension](/extensions/authoring). For embedding Atomic and loading inline extension factories, see [SDK overview](/sdk), [SDK extensions](/sdk/reference#extensions), and [Structured decisions](/sdk/structured-decisions).
8
8
 
9
9
  ## ExtensionContext
10
10
 
@@ -12,7 +12,7 @@ All event handlers, tool callbacks, and command handlers receive `ctx: Extension
12
12
 
13
13
  ### ctx.ui
14
14
 
15
- UI methods for user interaction. See [Extension UI](/extensions/ui#custom-ui) for full details.
15
+ UI methods for user interaction. See [Build custom UI](/extensions/ui#custom-ui) and the [UI API compatibility matrix](/extensions/ui#ui-api-compatibility-matrix).
16
16
 
17
17
  ### ctx.mode
18
18
 
@@ -20,11 +20,11 @@ Current run mode: `"tui" | "rpc" | "json" | "print"`. Use `ctx.mode === "tui"` t
20
20
 
21
21
  ### ctx.hasUI
22
22
 
23
- `false` in print mode (`-p`) and JSON mode; `true` in interactive and RPC modes. In RPC mode, dialog methods (`select`, `confirm`, `input`, `editor`) run through the extension UI sub-protocol and fire-and-forget methods (`notify`, `setStatus`, `setWidget`, `setTitle`, `setEditorText`) send requests to the client. Some TUI-specific methods are no-ops or return defaults (see [RPC extension UI](/rpc/extension-ui#extension-ui-protocol)).
23
+ `false` in print (`-p`) and JSON modes; `true` in interactive and RPC modes. In RPC mode, dialog methods (`select`, `confirm`, `input`, `editor`) run through the extension UI sub-protocol and fire-and-forget methods (`notify`, `setStatus`, `setWidget`, `setTitle`, `setEditorText`) send requests to the client. See [RPC extension UI](/rpc/extension-ui#extension-ui-protocol).
24
24
 
25
25
  ### ctx.hasHumanInput
26
26
 
27
- `boolean` indicating whether a human-input adapter is available independently of terminal rendering.
27
+ `boolean` indicating whether a host input adapter is bound to answer interactive prompts (`confirm`, `select`, `input`, `editor`, `questionnaire`), even when no terminal UI is present—for example when an SDK host supplies `extensionBindings.humanInput` in a headless run. When both `ctx.hasUI` and `ctx.hasHumanInput` are `false` (default print and JSON modes), dialog methods and `ctx.ui.custom()` reject with `HumanInputUnavailable`.
28
28
 
29
29
  ### ctx.isPresentationOnly
30
30
 
@@ -85,9 +85,23 @@ To inspect older history without loading the entire session into memory:
85
85
 
86
86
  ### ctx.modelRegistry / ctx.model / ctx.scopedModels {#ctx-modelregistry-ctx-model-ctx-scopedmodels}
87
87
 
88
- Access models, authentication state, and provider-aware requests.
88
+ Access models, authentication state, and provider-aware requests through `ctx.modelRegistry` (`ModelRegistry`):
89
89
 
90
- Use `ctx.modelRegistry.complete()` for non-streaming model calls and `ctx.modelRegistry.streamSimple()` or `ctx.modelRegistry.stream()` for streaming calls. All three run through Atomic's active provider configuration and request-time authentication, including extension-registered providers (global standalone helpers do not see extension providers):
90
+ | Method | Purpose |
91
+ | --- | --- |
92
+ | `getAll()` / `getAvailable()` | List all configured chat models, or only those with configured auth |
93
+ | `find(provider, modelId)` | Look up one chat model by provider and ID |
94
+ | `getModelsOfType(type, provider?)` / `getAvailableOfType(type, provider?, options?)` | List models of type `"chat" \| "image" \| "classifier" \| "compactor"` |
95
+ | `getModelOfType(type, provider, id)` / `getClassifierModel(provider, modelId)` | Look up one typed model |
96
+ | `complete(model, context, options?)` | Non-streaming chat completion using active provider config and request-time auth |
97
+ | `stream(model, context, options?)` / `streamSimple(model, context, options?)` | Streaming chat completion with provider-specific or provider-neutral options |
98
+ | `classify(model, context, options?)` | Run a registered classifier model |
99
+ | `generateImages(model, context, options?)` | Run a registered image model (returns `stopReason`, `errorMessage`, and `error` instead of rejecting) |
100
+ | `hasConfiguredAuth(model)` / `getProviderAuthStatus(provider)` / `isUsingOAuth(model)` | Inspect provider authentication state |
101
+ | `getApiKeyAndHeaders(model)` / `getProvider(provider)` | Inspect resolved request auth or the underlying `Provider` object |
102
+ | `refresh(options?)` | Reload `models.json` and dynamic provider catalogs; returns `{ aborted, errors }` |
103
+
104
+ Always prefer `ctx.modelRegistry.complete()`, `streamSimple()`, `stream()`, `classify()`, and `generateImages()` over standalone library helpers so active provider configuration, request-time authentication, and extension-registered providers all apply:
91
105
 
92
106
  ```typescript
93
107
  const model = ctx.modelRegistry.find("github-copilot", "gpt-5.5");
@@ -96,11 +110,7 @@ if (!model) throw new Error("Model not found");
96
110
  const response = await ctx.modelRegistry.complete(model, { messages }, { signal: ctx.signal });
97
111
  ```
98
112
 
99
- Use `ctx.modelRegistry.generateImages(model, context, options)` to call an image model with request-time authentication. It returns generated blocks and usage and reports provider failures via `stopReason`, `errorMessage`, and `error` instead of rejecting.
100
-
101
- For `openai-images` models, `options` accepts `size`, `quality`, `n`, `background`, `outputFormat` (`png`, `jpeg`, `webp`, `gif`, `svg`), `outputCompression`, `frameCount`, `frameDurationMs`, `complexity`, `svg`, `moderation`, and `safetyIdentifier`. Image inputs with `role: "markup"` or `role: "mask"` map to those edit roles, and the first remaining image is the base image. GIF, SVG, `complexity`, and frame options require a GPT Image 2.6 model declaring those capabilities.
102
-
103
- `outputFormat: "svg"` works without passing `svg`: when an account requires `svg.model`, Atomic retries once with `gpt-6.1-sol` (`DEFAULT_SVG_AUTHOR_MODEL` from `@bastani/atomic-ai`) and reports it in `result.svgModel`, retrying once more without `svg` if rejected as unsupported. An explicit `svg: { model, reasoning }` object is sent verbatim. Leave `timeoutMs` unset (10-minute default) or set at least `180000` for SVG requests.
113
+ For image generation (including OpenAI GPT Image 2.6 formats such as GIF and SVG, edit roles, and `imageGenerationErrorFromData()`), look up an image model with `getModelOfType("image", ...)` and call `generateImages()`—see [Image generation](/libraries/ai#image-generation) and [Providers reference](/providers/reference):
104
114
 
105
115
  ```typescript
106
116
  const flare = ctx.modelRegistry.getModelOfType("image", "openai-images", "gpt-image-2.6-flare");
@@ -114,13 +124,9 @@ const logo = await ctx.modelRegistry.generateImages(
114
124
  if (logo.stopReason !== "stop") throw new Error(logo.errorMessage);
115
125
  ```
116
126
 
117
- When image generation fails, rebuild `result.error` (`ImageGenerationErrorData`) with `imageGenerationErrorFromData()` from `@bastani/atomic-ai` and branch on its class, type guards (`isImageGenerationError`, `isImageGenerationConfigError`, `findImageGenerationError`, `isRetryableImageGenerationError`), or `code`. Cancelled requests resolve with `stopReason: "aborted"` and no `error`. See [Image generation](/libraries/ai#image-generation).
127
+ For SDK-side runtime credential overrides (`modelRuntime.setRuntimeApiKey()`), see [API keys and OAuth in the SDK](/sdk/reference#api-keys-and-oauth).
118
128
 
119
- Use `getApiKeyAndHeaders()` only when inspecting credentials before dispatch. `await ctx.modelRegistry.refresh(options)` returns `{ aborted, errors }` with per-provider errors. Calling `ModelRuntime.setRuntimeApiKey(providerId, apiKey, options)` stores a runtime credential without refreshing the catalog; call `refresh({ providers: [providerId], signal })` explicitly if needed (see [API keys and OAuth in the SDK](/sdk/reference#api-keys-and-oauth)).
120
-
121
- OpenRouter Chat Completions and Anthropic Messages requests send `x-session-id` by default when `sessionId` is supplied and prompt caching is active; set `compat.sendSessionAffinityHeaders: false` or `cacheRetention: "none"` to opt out.
122
-
123
- `ctx.scopedModels` is the read-only list of models scoped to the current session (matching `/scoped-models`, resolved from `--models` and `enabledModels`; empty when unscoped). Each entry is `{ model, thinkingLevel? }`, resolved at access time so it stays current in default interactive mode as well as embedded sessions. Every read returns fresh frozen copies (`ScopedModel` and `ExtensionScopedModels` are exported from `@bastani/atomic`):
129
+ `ctx.scopedModels` is the read-only list of models scoped to the current session (matching `/scoped-models`, resolved from `--models` and `enabledModels`; empty when unscoped). Each entry is `{ model, thinkingLevel? }`, resolved at access time and returned as fresh frozen copies (`ScopedModel` and `ExtensionScopedModels` are exported from `@bastani/atomic`):
124
130
 
125
131
  ```typescript
126
132
  import type { ExtensionScopedModels, ScopedModel } from "@bastani/atomic";
@@ -224,9 +230,14 @@ Returns Atomic's current system prompt string. Inside `before_agent_start`, it r
224
230
 
225
231
  ### ctx.getSkillCatalog()
226
232
 
227
- Optional method returning the loader-owned `SkillCatalog`. Use `catalog.resolve(selector)` to look up exact skill selectors.
233
+ Optional method returning the active session's `SkillCatalog`, which exposes:
234
+
235
+ - `candidates`: all discovered `SkillCandidate` entries (`{ id, skill, selector }`).
236
+ - `commands`: all invocable `/skill:...` command entries (`{ name, description, sourceInfo, candidateId, skill }`).
237
+ - `resolve(selector)`: resolves an exact skill selector to `{ ok: true, candidate }` or `{ ok: false, kind: "unknown" | "ambiguous", selector, message, candidates }`.
238
+ - `modelSkills()`: returns the skills visible in the model's system prompt.
228
239
 
229
- Note that source-qualified selectors such as `"tdd@builtin"` exist **only** when two or more distinct skill files collide on `"tdd"`. When only one file defines `"tdd"`, `catalog.resolve("tdd@builtin")` returns `{ ok: false, kind: "unknown" }` and you should resolve `"tdd"` instead:
240
+ Source-qualified selectors such as `"tdd@builtin"` exist **only** when two or more distinct skill files collide on `"tdd"`. When only one file defines `"tdd"`, `catalog.resolve("tdd@builtin")` returns `{ ok: false, kind: "unknown" }` and you should resolve `"tdd"` instead:
230
241
 
231
242
  ```typescript
232
243
  atomic.on("session_start", (_event, ctx) => {
@@ -240,14 +251,17 @@ atomic.on("session_start", (_event, ctx) => {
240
251
 
241
252
  `atomic.getCommands()` returns the same advertised `/skill:name` and `/skill:name@source` names. See [Skill commands](/skills#skill-commands).
242
253
 
243
- ### Additional optional context getters
254
+ ### Additional optional context properties
244
255
 
245
- These optional methods are present when supported by the host:
256
+ These optional members are present when supported by the host:
246
257
 
247
258
  - **`ctx.getHttpIdleTimeoutMs?(): number`:** Returns the session's `httpIdleTimeoutMs` setting in milliseconds (`0` means idle timeout is disabled).
248
259
  - **`ctx.getPackageAgents?(): readonly PackageAgentFile[]`:** Returns enabled subagent definition files contributed by installed packages (only from project packages when the project is trusted).
249
260
  - **`ctx.getExtensionPaths?(): string[]`:** Returns the file paths of loaded extensions.
250
261
  - **`ctx.isSessionSummaryEnabled?(): boolean`:** Returns whether background session summaries are enabled.
262
+ - **`ctx.internalResourceRouter`:** Session-scoped internal resource router (for resolving schemes such as `artifact://`).
263
+ - **`ctx.subagentPolicy`:** Read-only `SubagentChildPolicy` when this session is an admitted in-process subagent child.
264
+ - **`ctx.intercomPolicy`:** Read-only `IntercomPolicyView` describing the session's Intercom home group and reach when configured by the host.
251
265
 
252
266
  ## ExtensionToolContext
253
267
 
@@ -420,8 +434,8 @@ Options (`SendMessageOptions`):
420
434
  - `triggerTurn`: start a model turn immediately if idle (required for `"interrupt"`, ignored for `"nextTurn"`).
421
435
  - `excludeFromContext`: render and persist the message without adding it to model context.
422
436
  - `interruptAbortMessage`: custom abort text when `deliverAs: "interrupt"` stops an active turn.
423
- - `persistWhenStreaming`: persist the custom message immediately even while a turn is streaming.
424
- - `stageAdmissionKey`: optional deduplication key for staged recovery deliveries.
437
+ - `persistWhenStreaming`: commits one visible display-only card immediately while a turn is streaming, then delivers a separate hidden model-facing reconciliation message at the next safe turn boundary. The hidden reconciliation survives queue clearing without interrupting the active response.
438
+ - `stageAdmissionKey`: stable deduplication key so deliveries that are retried or replayed during restart recovery (see [`session_recovery_replay`](/extensions/events#session_recovery_restore)) are admitted at most once.
425
439
 
426
440
  In print (`-p`) and JSON modes, Atomic waits for messages queued before a command handler returns (and the turns they trigger) before exiting.
427
441
 
@@ -490,7 +504,7 @@ Set a string bookmark label on an entry (shown in `/tree`), or pass `undefined`
490
504
 
491
505
  ### atomic.registerCommand(name, options)
492
506
 
493
- Register a slash command. If multiple extensions register the same command name, **all** colliding commands receive numeric suffixes in load order (`/review:1`, `/review:2`), and no bare `/review` command remains.
507
+ Register a slash command. If multiple extensions register the same command name, **all** colliding commands receive numeric suffixes in load order (`/review:1`, `/review:2`), skipping any suffixed name already taken by another registration, and no bare `/review` command remains.
494
508
 
495
509
  `getArgumentCompletions(prefix)` may return `AutocompleteItem[] | null` or `Promise<AutocompleteItem[] | null>`:
496
510
 
@@ -536,15 +550,24 @@ Register a TUI renderer for custom messages with `customType`. Options include `
536
550
 
537
551
  ### atomic.registerToolRenderer(resolver) {#atomic-registertoolrenderer-resolver}
538
552
 
539
- Register a resolver `(toolName, next) => renderers` supplying `renderCall`, `renderResult`, and optional `renderShell` for any tool (including MCP tools in resumed sessions before their server connects). Resolvers run in extension load order; `next()` returns the remaining resolvers' choice and then the tool's own renderers. See [Custom rendering](/extensions/authoring#custom-rendering).
540
-
541
- <div id="pi-registermarkdowntransformer-transformer" />
553
+ Register a resolver `(toolName, next) => renderers` supplying `renderCall`, `renderResult`, and optional `renderShell` and `label` overrides for any tool (including MCP tools in resumed sessions before their server connects). Resolvers run in extension load order; `next()` returns the remaining resolvers' choice and then the tool's own renderers. See [Custom rendering](/extensions/authoring#custom-rendering).
542
554
 
543
555
  ### atomic.registerMarkdownTransformer(transformer, options?)
544
556
 
545
- Register a synchronous, display-only Markdown transformer for interactive rendering. Transformers run in load order (one per extension; a second call replaces the first). Optional `options.messageTypes` selects which message kinds to transform (default `["user", "assistant", "assistant-thinking"]`; also supports `"custom"`, `"summary"`, `"changelog"`).
557
+ <Warning>
558
+ Display Markdown transformers do **not** run in default interactive CLI mode because extensions execute in an isolated worker process. They run only in embedded in-process TUI sessions.
559
+ </Warning>
560
+
561
+ Register a synchronous, display-only Markdown transformer for interactive rendering. Transformers run in load order (one per extension; a second call replaces the first).
562
+
563
+ Optional `options.messageTypes` selects which Markdown surfaces to transform (default `["user", "assistant", "assistant-thinking"]`):
564
+
565
+ - `"user"`, `"assistant"`, `"assistant-thinking"`: transcript messages (default).
566
+ - `"custom"`: custom messages without a custom renderer, plus expanded skill blocks (content without Atomic's header).
567
+ - `"summary"`: expanded branch summaries (content without Atomic's header).
568
+ - `"changelog"`: startup "What's New" and `/changelog`.
546
569
 
547
- Context fields passed to the transformer: `messageType`, `isStreaming`, `availableWidth`, `messageId` (`undefined` for live messages and changelog), and `timestamp` (`undefined` for live messages and changelog). Display transformers do not run when extensions execute in the separate interactive worker process.
570
+ Context fields passed to the transformer: `messageType`, `isStreaming`, `availableWidth`, `messageId` (`undefined` for live messages and changelog), and `timestamp` (`undefined` for live messages and changelog).
548
571
 
549
572
  ```typescript
550
573
  atomic.registerMarkdownTransformer((markdown, { messageType, isStreaming }) => {
@@ -568,7 +591,7 @@ atomic.registerShortcut("ctrl+shift+p", {
568
591
 
569
592
  Conflict policy:
570
593
 
571
- - **17 reserved built-in actions cannot be overridden** (`app.interrupt`, `app.clear`, `app.exit`, `app.suspend`, `app.thinking.cycle`, `app.model.cycleForward`, `app.model.cycleBackward`, `app.model.select`, `app.tools.expand`, `app.thinking.toggle`, `app.editor.external`, `app.message.followUp`, `tui.input.submit`, `tui.select.confirm`, `tui.select.cancel`, `tui.input.copy`, `tui.editor.deleteToLineEnd`). Registering their keys skips with a warning.
594
+ - **17 reserved built-in actions cannot be overridden** (`app.interrupt`, `app.clear`, `app.exit`, `app.suspend`, `app.thinking.cycle`, `app.model.cycleForward`, `app.model.cycleBackward`, `app.model.select`, `app.tools.expand`, `app.thinking.toggle`, `app.editor.external`, `app.message.followUp`, `tui.input.submit`, `tui.select.confirm`, `tui.select.cancel`, `tui.input.copy`, `tui.editor.deleteToLineEnd`). Registering a literal key bound to one of these skips with a warning; using `keybinding` silently strips reserved keys without warning.
572
595
  - **Non-reserved built-in shortcuts** are overridden by extensions (with a warning) unless `preferEditor: true` is set, which yields to the editor binding.
573
596
  - **Between two extensions**, the **last** registered shortcut wins (with a warning).
574
597
  - Optional `keybinding` selects keys from an existing named action in `keybindings.json` instead of a hardcoded key; an empty action binding disables the shortcut.
@@ -589,13 +612,17 @@ if (atomic.getFlag("plan")) {
589
612
  }
590
613
  ```
591
614
 
592
- Flag rules:
615
+ Flag rules and CLI parsing behavior:
593
616
 
617
+ - Registered flags appear automatically under `Extension CLI Flags:` in `atomic --help`. Both `--name value` and `--name=value` forms are accepted.
594
618
  - `default`, if supplied, must match `type` (`boolean` or `string`) or `registerFlag()` throws.
595
619
  - Across extensions, the **first** extension registering a flag name wins.
596
620
  - `atomic.getFlag(name)` reads **only** flags registered by that same extension; it returns `undefined` for other extensions' flags or built-in CLI flags.
621
+ - Passing a `type: "string"` flag without a value produces `Extension flag "--<name>" requires a value`. Passing an unregistered `--flag` produces `Unknown option(s): --<name>`.
597
622
 
598
- <div id="pi-registeragentpanelsource-source" />
623
+ <Warning>
624
+ **Boolean flag parsing pitfalls:** CLI arguments are parsed before extensions load, so an unknown flag followed by a non-flag word (`atomic --plan "fix bug"`) consumes `"fix bug"` as the flag's value. When `plan` later resolves as `type: "boolean"`, `"fix bug"` is **silently discarded** and `plan` is set to `true`. Likewise, `--plan=false` still sets a boolean flag to `true`. Place positional prompts before boolean extension flags, or separate them with `--` (`atomic --plan -- "fix bug"`).
625
+ </Warning>
599
626
 
600
627
  ### atomic.registerAgentPanelSource(source) {#atomic-registeragentpanelsource-source}
601
628
 
@@ -694,9 +721,7 @@ atomic.events.emit("my:event", { ok: true });
694
721
  unsubscribe();
695
722
  ```
696
723
 
697
- Do not retain `atomic.events` across `/reload` (calling `on()` or `emit()` on a retired handle throws). Pass `atomic.events` to [`sessionScopedExtensionState`](/extensions/authoring#session-scoped-in-memory-state) to preserve in-memory state across reloads.
698
-
699
- Embedded hosts implementing `ExtensionRuntime` must implement `trackEventBusSubscription(unsubscribe)` and return `markdownTransformers` (plus optional `renderLatex`, `fullscreenScrollbar`, `fullscreenWheelScrollLines`) from `ExtensionUIContext.getChatRenderSettings()`. See [SDK extensions](/sdk/reference#extensions).
724
+ Do not retain `atomic.events` across `/reload` (calling `on()` or `emit()` on a retired handle throws; during retired `session_shutdown` cleanup, `emit()` is silently ignored). Pass `atomic.events` to [`sessionScopedExtensionState`](/extensions/authoring#session-scoped-in-memory-state) to preserve in-memory state across reloads.
700
725
 
701
726
  ### Native providers
702
727
 
@@ -793,7 +818,11 @@ await atomic.registerProvider("corporate-ai", {
793
818
  - `apiKey`: literal key or environment variable reference (`$ENV_VAR` or `${ENV_VAR}`; required when defining models unless `oauth` is set).
794
819
  - `api`: API protocol (`"anthropic-messages"`, `"openai-completions"`, `"openai-responses"`, etc.).
795
820
  - `headers`, `authHeader`: extra headers, or `authHeader: true` to send `Authorization: Bearer`.
796
- - `models`: array of `ProviderModelConfig` entries (`type?: "chat" | "image" | "classifier"`, defaulting to `"chat"`). Chat models support `reasoning`, `thinkingLevelMap`, `contextWindow`, `maxTokens`, `samplingParams`, `samplingParamsByThinkingLevel`, `promptCache`, and `compat`; image models support `output` and `capabilities`; classifier models support `contextWindow` and `compat`. Individual models may set `baseUrl`.
821
+ - `models`: array of `ProviderModelConfig` entries (`type?: "chat" | "image" | "classifier" | "compactor"`, defaulting to `"chat"`). Every model type supports base fields `id`, `name`, `input`, `cost`, plus optional `api`, `baseUrl`, `inputLimits`, and per-model `headers`:
822
+ - **Chat (`type?: "chat"`):** `reasoning`, `contextWindow`, `maxTokens`, plus optional `thinkingLevelMap`, `samplingParams`, `samplingParamsByThinkingLevel`, `promptCache`, and `compat`.
823
+ - **Image (`type: "image"`):** `output` (`("text" | "image")[]`) and optional `capabilities`.
824
+ - **Classifier (`type: "classifier"`):** `contextWindow` and optional `compat`.
825
+ - **Compactor (`type: "compactor"`):** optional `api` (`CompactorApi`), `endpointPath`, `compactionParams`, `timeoutMs`, and `maxTokens` (when omitted, compacted output has no default size limit; see [Custom compactors](/compaction/custom-compactors)).
797
826
  - `refreshModels?(context)`: dynamically refresh the provider's model catalog (replaces extension-provided models on success).
798
827
  - `images`, `classifiers`: custom image or classifier API handlers keyed by API name.
799
828
  - `streamSimple`: custom streaming implementation for non-standard APIs.
@@ -823,7 +852,7 @@ Remove a previously registered provider and its models, restoring any built-in m
823
852
 
824
853
  ### atomic.registerMcpServer(name, config) {#atomic-registermcpserver-name-config}
825
854
 
826
- Contribute an MCP server whose configuration is computed at runtime (for example, a dynamically bound local port). `name` must match `^[A-Za-z0-9_-]+$`, and `config` follows the [`mcp.json`](/mcp-servers#configure-servers) schema (`url`, `command`, `args`, `env`, `cwd`, `headers`, OAuth settings, `exposure`, positive `timeout` in seconds, `${VAR}` / `$env:VAR` URL interpolation). `type: "sse"` is rejected (use streamable HTTP).
855
+ Contribute an MCP server whose configuration is computed at runtime (for example, a dynamically bound local port). `name` must be a non-empty string matching `^[A-Za-z0-9_-]+$`, and `config` must be a plain object following the [`mcp.json`](/mcp-servers#configure-servers) schema (`url`, `command`, `args`, `env`, `cwd`, `headers`, OAuth settings, `exposure`, positive `timeout` in seconds, `${VAR}` / `$env:VAR` URL interpolation). `type: "sse"` is rejected (use streamable HTTP).
827
856
 
828
857
  ```typescript
829
858
  export default function (atomic: ExtensionAPI) {
@@ -837,27 +866,41 @@ export default function (atomic: ExtensionAPI) {
837
866
  }
838
867
  ```
839
868
 
840
- Call from the extension factory or `session_start`; servers connect immediately without `/reload`, and re-registering the same name replaces the previous registration. Extension-registered servers override package-manifest servers while user and trusted-project `mcp.json` entries take precedence over both (set `"enabled": false` on a file-configured entry to disable it).
869
+ Registration rules:
870
+
871
+ - Call from the extension factory or `session_start`; servers connect immediately without `/reload`, and re-registering the exact same name replaces the previous registration.
872
+ - `registerMcpServer()` throws if `name` is empty/whitespace, if `config` is not a plain object, or if `name` collides with a different registered server after normalizing `-` to `_` (for example `my-api` vs `my_api`).
873
+ - If no loaded extension consumes MCP servers (for example under `--no-mcp` or when built-in MCP support was replaced), Atomic emits an extension error naming the unhandled server.
874
+ - Extension-registered servers override package-manifest servers while user and trusted-project `mcp.json` entries take precedence over both (set `"enabled": false` on a file-configured entry to disable it).
875
+ - `auth.provider` is allowed on extension-registered servers (requiring HTTPS or a loopback URL) and global `mcp.json`, not project config or package manifests. Shell `atomic mcp` commands do not load extensions.
876
+
877
+ Inspection and change notifications:
841
878
 
842
- `auth.provider` is allowed on extension-registered servers (requiring HTTPS or a loopback URL) and global `mcp.json`, not project config or package manifests. Shell `atomic mcp` commands do not load extensions. Call `atomic.getMcpServerContributions()` to inspect all package and extension server contributions.
879
+ - `atomic.getMcpServerContributions?.()` returns all package and extension server contributions for the current session.
880
+ - `atomic.onMcpServerContributionsChanged?.(listener)` subscribes to post-startup `registerMcpServer()` changes and returns an unsubscribe function.
843
881
 
844
882
  ## Error handling
845
883
 
846
884
  - Uncaught errors in most event handlers are logged and the session continues.
847
885
  - In interactive mode, an error thrown in `session_start` or `resources_discover` is shown once with the extension's path and error while keeping the session open and the extension loaded. In print mode (`-p`), standalone RPC mode (`--mode rpc`), and SDK sessions, startup fails with `ExtensionStartupError` naming each failing extension.
848
886
  - If a `tool_call` handler throws an error, Atomic blocks the tool call and reports the error to the model instead of running the tool.
887
+ - If a `user_bash` handler throws an error (or returns an invalid result shape), Atomic re-throws the error and aborts the `!` command.
888
+ - Uncaught errors from `session_shutdown` handlers are collected into an `AggregateError("Extension shutdown failed")` with `code: "ShutdownFailed"` and re-thrown.
849
889
  - Inside tool `execute()`, throw an `Error` to report failure; Atomic catches it, sends it to the model with `isError: true`, and continues.
850
890
 
851
- ### Typed errors from built-in tools and providers
891
+ ### Typed errors from built-in tools, host input, and providers
852
892
 
853
- These error classes and type guards are exported from `@bastani/atomic` (see [Session and storage errors](/sdk/reference#session-and-storage-errors) for session, storage, and startup errors). Branch on the class, its type guard, or `code` rather than `message`. Each tool/provider error includes `hint`, `retryable`, and `toJSON()` for cross-process serialization (credentials in URLs are stripped). Use `rehydrateShellToolError()` and `rehydrateLlamaServerError()` to rebuild serialized instances.
893
+ These error classes, codes, and type guards are exported from `@bastani/atomic` (see [Session and storage errors](/sdk/reference#session-and-storage-errors) for session, storage, and startup errors). Branch on the class, its type guard, or `code` rather than `message`. Built-in tool and provider error classes include `hint`, `retryable`, and `toJSON()` for cross-process serialization (credentials in URLs are stripped). Use `rehydrateShellToolError()`, `rehydrateLlamaServerError()`, `rehydrateEditToolError()`, and `rehydrateWriteSelectorError()` to rebuild serialized instances.
854
894
 
855
- | Class | `code` | When | Key fields / notes |
895
+ | Class / Error | `code` | When | Key fields / notes |
856
896
  | --- | --- | --- | --- |
897
+ | `EditToolError` (`EditInputError`, `EditMatchError`, `EditTargetError`) | `edits-empty`, `old-text-empty`, `text-splits-character`, `text-not-found`, `text-not-unique`, `edits-overlap`, `no-change`, `target-inaccessible`, `target-not-utf8` | Built-in `edit` failed before modifying the file. | Non-retryable without a new call; guard with `isEditToolError` / subclass guards. |
898
+ | `WriteSelectorError` | `sqlite-query-parameters`, `sqlite-not-found`, `conflict-*`, `unsupported-scheme` | Built-in `write` refused an archive, SQLite, `conflict://`, or URL selector before writing. | Guard with `isWriteSelectorError(error)`. |
899
+ | `FileToolAbortedError` | `aborted` | Built-in `edit` or `write` aborted via `AbortSignal`. | `name === "AbortError"`, `retryable: false`; guard with `isFileToolAbortedError(error)`. |
857
900
  | `ShellTimeoutError` (`ShellToolError`) | `shell-timeout` | `createLocalBashOperations()` hit the command timeout (`phase: "draining-output"` means the shell exited while background children kept stdout/stderr open). | `timeoutMs`, `elapsedMs`, `phase`, `shellExit`. Redirect background output or increase `timeout`. |
901
+ | Host input errors (`Error & { code }`) | `HumanInputUnavailable`, `HumanInputCancelled`, `InvalidHostInput`, `SessionClosed` | Dialog (`select`, `confirm`, `input`, `editor`) or `custom()` called without an available UI / `humanInput` adapter, cancelled by host/session teardown, invalid adapter response, or closed session. | Check `error.code` (for example `HumanInputUnavailable` in print/JSON mode without `humanInput`). |
858
902
  | `LlamaServerUnreachableError` (`LlamaServerError`) | `server-unreachable` | A `llama.cpp` router request failed before any response (connection refused, DNS error, TLS mismatch). | `serverUrl`, `detail`; `retryable: true`. Start `llama serve` or fix URL with `/login llama.cpp` / `LLAMA_BASE_URL`. |
859
903
  | `LlamaServerRequestError` (`LlamaServerError`) | `request-rejected` | The runtime refused to send a `llama.cpp` request (credentials in URL or blocked port such as `6000`). | `serverUrl`, `detail`; `retryable: false`. Use a plain `http`/`https` URL without embedded credentials. |
860
904
  | `OAuthRefreshRejectedError` | *(OAuth refresh)* | Thrown by an extension's `oauth.refreshToken()` when the provider permanently rejects stored credentials (such as `invalid_grant`). | Prompts the user to re-authenticate with `/login <provider>`. |
861
905
  | `DecisionModelUnavailableError` | *(decision model)* | `ctx.getDecisionModel()` called in a host without decision-model support (`reason: "host-unsupported"`). | Check host support or handle gracefully before invoking decision helpers. |
862
- | `NativeModuleUnavailableError` | *(native addon)* | Optional native N-API bindings (`@bastani/atomic-natives`) are unavailable on the host runtime. | Exported from `@bastani/atomic` for callers checking native-module fallbacks. |
863
906
  | `MissingSessionCwdError` | `session-cwd-missing` | `ctx.switchSession()` targeted a session whose recorded working directory no longer exists. | Guard with `isMissingSessionCwdError(error)`. |