@bastani/atomic 0.10.9 → 0.10.10-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +226 -163
  3. package/dist/_shared/dist-KOELCESV.js +2 -2
  4. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  5. package/dist/_shared/lib-4PES5P4V.js +2 -2
  6. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +27 -12
  7. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
  8. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
  9. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  10. package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
  11. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  12. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
  13. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
  14. package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
  15. package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
  16. package/dist/_shared/runtime-O4KCSG4C.js +5 -5
  17. package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
  18. package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
  19. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  20. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  21. package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
  22. package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
  23. package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
  24. package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
  25. package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
  26. package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
  27. package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +150 -62
  28. package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
  29. package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
  30. package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
  31. package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
  32. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
  33. package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
  34. package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
  35. package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
  36. package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
  37. package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
  38. package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
  39. package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
  40. package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
  41. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  42. package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
  43. package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
  44. package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
  45. package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
  46. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  47. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  48. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  49. package/dist/builtin/intercom/README.md +87 -116
  50. package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
  51. package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
  52. package/dist/builtin/intercom/group.ts +7 -3
  53. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  54. package/dist/builtin/intercom/package.json +1 -1
  55. package/dist/builtin/mcp/README.md +61 -27
  56. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  57. package/dist/builtin/mcp/package.json +1 -1
  58. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  59. package/dist/builtin/subagents/README.md +74 -141
  60. package/dist/builtin/subagents/package.json +1 -1
  61. package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
  62. package/dist/builtin/web-access/CHANGELOG.md +9 -0
  63. package/dist/builtin/web-access/README.md +61 -88
  64. package/dist/builtin/web-access/index.bundle.mjs +387 -351
  65. package/dist/builtin/web-access/package.json +1 -1
  66. package/dist/cli/args.js +2 -2
  67. package/dist/cli/auth-cli.code.js +4 -4
  68. package/dist/cli/auth-cli.impl.js +3 -3
  69. package/dist/cli/auth-cli.js +3 -3
  70. package/dist/cli/blueprint-command.code.js +2 -2
  71. package/dist/cli/blueprint-command.impl.js +3 -3
  72. package/dist/cli/blueprint-command.js +3 -3
  73. package/dist/cli/intercom-command.code.js +3 -3
  74. package/dist/cli/intercom-command.impl.js +3 -3
  75. package/dist/cli/intercom-command.js +3 -3
  76. package/dist/cli/list-models.code.js +3 -3
  77. package/dist/cli/list-models.impl.js +3 -3
  78. package/dist/cli/list-models.js +3 -3
  79. package/dist/cli/session-picker.code.js +2 -2
  80. package/dist/cli/session-picker.impl.js +3 -3
  81. package/dist/cli/session-picker.js +3 -3
  82. package/dist/cli/startup-ui.code.js +2 -2
  83. package/dist/cli/startup-ui.impl.js +3 -3
  84. package/dist/cli/startup-ui.js +3 -3
  85. package/dist/cli/storage-command.impl.js +3 -3
  86. package/dist/cli/storage-command.js +3 -3
  87. package/dist/cli/storage-search-session.code.js +2 -2
  88. package/dist/cli/storage-search-session.impl.js +3 -3
  89. package/dist/cli/storage-search-session.js +3 -3
  90. package/dist/cli/team-command.code.js +2 -2
  91. package/dist/cli/team-command.impl.js +3 -3
  92. package/dist/cli/team-command.js +3 -3
  93. package/dist/cli.js +2 -2
  94. package/dist/core/agent-session-methods.d.ts +4 -1
  95. package/dist/core/agent-session-methods.js.map +1 -1
  96. package/dist/core/agent-session.d.ts +3 -0
  97. package/dist/core/compaction/compactor.d.ts +20 -14
  98. package/dist/core/compaction/errors.d.ts +120 -0
  99. package/dist/core/compaction/index.d.ts +1 -0
  100. package/dist/core/compaction/model-resolver.d.ts +2 -2
  101. package/dist/core/debug.impl.js +3 -3
  102. package/dist/core/debug.js +3 -3
  103. package/dist/core/export-html/card-projection.impl.js +3 -3
  104. package/dist/core/export-html/card-projection.js +3 -3
  105. package/dist/core/export-html/index.code.js +2 -2
  106. package/dist/core/export-html/index.impl.js +3 -3
  107. package/dist/core/export-html/index.js +3 -3
  108. package/dist/core/export-html/json-spans.impl.js +3 -3
  109. package/dist/core/export-html/json-spans.js +3 -3
  110. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  111. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  112. package/dist/core/export-html/tool-renderer.code.js +1 -1
  113. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  114. package/dist/core/export-html/tool-renderer.js +3 -3
  115. package/dist/core/extensions/api-types.d.ts +1 -1
  116. package/dist/core/extensions/api-types.js.map +1 -1
  117. package/dist/core/extensions/index.d.ts +1 -1
  118. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  119. package/dist/core/extensions/jiti-loader.js +3 -3
  120. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  121. package/dist/core/extensions/jiti-static-loader.js +3 -3
  122. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  123. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  124. package/dist/core/extensions/loader-host-modules.js +3 -3
  125. package/dist/core/extensions/loader-virtual-modules.js +1 -1
  126. package/dist/core/extensions/provider-types.d.ts +18 -6
  127. package/dist/core/extensions/provider-types.js.map +1 -1
  128. package/dist/core/extensions/runner-context.js +1 -1
  129. package/dist/core/intercom-broker-control-host.code.js +1 -1
  130. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  131. package/dist/core/intercom-broker-control-host.js +3 -3
  132. package/dist/core/intercom-broker-control.code.js +3 -3
  133. package/dist/core/intercom-broker-control.impl.js +3 -3
  134. package/dist/core/intercom-broker-control.js +3 -3
  135. package/dist/core/model-config.d.ts +40 -0
  136. package/dist/core/model-registry.js +1 -1
  137. package/dist/core/model-resolver-scope.d.ts +4 -4
  138. package/dist/core/model-runtime.d.ts +1 -1
  139. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  140. package/dist/core/package-manager-storage-adapters.js +3 -3
  141. package/dist/core/provider-composer-internal.d.ts +11 -2
  142. package/dist/core/sdk.code.js +3 -3
  143. package/dist/core/sdk.impl.js +3 -3
  144. package/dist/core/sdk.js +3 -3
  145. package/dist/core/session-manager-core.js +5 -5
  146. package/dist/core/session-manager-list.impl.js +3 -3
  147. package/dist/core/session-manager-list.js +3 -3
  148. package/dist/core/session-manager.code.js +1 -1
  149. package/dist/core/session-manager.impl.js +3 -3
  150. package/dist/core/session-manager.js +3 -3
  151. package/dist/core/session-storage.impl.js +3 -3
  152. package/dist/core/session-storage.js +3 -3
  153. package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
  154. package/dist/core/storage/index.js +2 -2
  155. package/dist/core/storage/node-sqlite-thread.js +2 -2
  156. package/dist/core/storage/node-sqlite.js +2 -2
  157. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  158. package/dist/core/storage/offline-snapshot-file.js +3 -3
  159. package/dist/core/storage/provider.js +2 -2
  160. package/dist/core/storage/selection.js +2 -2
  161. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  162. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  163. package/dist/core/storage/session/branch-fork-source.js +3 -3
  164. package/dist/core/storage/session/card-view.impl.js +3 -3
  165. package/dist/core/storage/session/card-view.js +3 -3
  166. package/dist/core/storage/session/child-reader.code.js +3 -3
  167. package/dist/core/storage/session/child-reader.impl.js +3 -3
  168. package/dist/core/storage/session/child-reader.js +3 -3
  169. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  170. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  171. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  172. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  173. package/dist/core/storage/session/expanded-child-details.js +3 -3
  174. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  175. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  176. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  177. package/dist/core/storage/session/fork-row-index.js +3 -3
  178. package/dist/core/storage/session/fork-staging.code.js +2 -2
  179. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  180. package/dist/core/storage/session/fork-staging.js +3 -3
  181. package/dist/core/storage/session/fork-window.code.js +3 -3
  182. package/dist/core/storage/session/fork-window.impl.js +3 -3
  183. package/dist/core/storage/session/fork-window.js +3 -3
  184. package/dist/core/storage/session/history-pages.impl.js +3 -3
  185. package/dist/core/storage/session/history-pages.js +3 -3
  186. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  187. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  188. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  189. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  190. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  191. package/dist/core/storage/session/memory-session-store.js +3 -3
  192. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  193. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  194. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  195. package/dist/core/storage/session/released-history-files.code.js +3 -3
  196. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  197. package/dist/core/storage/session/released-history-files.js +3 -3
  198. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  199. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  200. package/dist/core/storage/session/session-resume.impl.js +3 -3
  201. package/dist/core/storage/session/session-resume.js +3 -3
  202. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  203. package/dist/core/storage/session/snapshot-cut.js +3 -3
  204. package/dist/core/storage/session/snapshot-history.code.js +3 -3
  205. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  206. package/dist/core/storage/session/snapshot-history.js +3 -3
  207. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  208. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  209. package/dist/core/storage/session/sql-session-store.js +3 -3
  210. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  211. package/dist/core/storage/session/tree-outline.js +3 -3
  212. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  213. package/dist/core/storage/session/tree-presentation.js +3 -3
  214. package/dist/core/storage/storage-status.impl.js +3 -3
  215. package/dist/core/storage/storage-status.js +3 -3
  216. package/dist/core/storage/team.impl.js +3 -3
  217. package/dist/core/storage/team.js +3 -3
  218. package/dist/core/structured-output/index.code.js +1 -1
  219. package/dist/core/structured-output/index.impl.js +3 -3
  220. package/dist/core/structured-output/index.js +3 -3
  221. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  222. package/dist/core/tasks/task-completion-entry.js +3 -3
  223. package/dist/core/tasks/task-file-history.code.js +3 -3
  224. package/dist/core/tasks/task-file-history.impl.js +3 -3
  225. package/dist/core/tasks/task-file-history.js +3 -3
  226. package/dist/core/tasks/task-reference-archive.code.js +4 -4
  227. package/dist/core/tasks/task-reference-archive.js +3 -3
  228. package/dist/core/tasks/task-reference-identity.code.js +1 -1
  229. package/dist/core/tasks/task-reference-identity.js +3 -3
  230. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  231. package/dist/core/tasks/task-reference-stream.js +3 -3
  232. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  233. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  234. package/dist/core/tasks/task-view-source.impl.js +3 -3
  235. package/dist/core/tasks/task-view-source.js +3 -3
  236. package/dist/core/tools/read-url.code.js +2 -2
  237. package/dist/core/tools/read-url.impl.js +3 -3
  238. package/dist/core/tools/read-url.js +3 -3
  239. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  240. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  241. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  242. package/dist/core/worktree-snapshot/errors.js +3 -3
  243. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  244. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  245. package/dist/extensions/codemode/execute.code.js +1 -1
  246. package/dist/extensions/codemode/execute.impl.js +3 -3
  247. package/dist/extensions/codemode/execute.js +3 -3
  248. package/dist/extensions/codemode/renderer.code.js +2 -2
  249. package/dist/extensions/codemode/renderer.impl.js +3 -3
  250. package/dist/extensions/codemode/renderer.js +3 -3
  251. package/dist/extensions/mcp/cli.code.js +2 -2
  252. package/dist/extensions/mcp/cli.impl.js +3 -3
  253. package/dist/extensions/mcp/cli.js +3 -3
  254. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  255. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  256. package/dist/extensions/mcp/cli.lazy.js +3 -3
  257. package/dist/extensions/mcp/runtime.code.js +1 -1
  258. package/dist/extensions/mcp/runtime.impl.js +3 -3
  259. package/dist/extensions/mcp/runtime.js +3 -3
  260. package/dist/index-extensions.d.ts +1 -1
  261. package/dist/index.d.ts +8 -1
  262. package/dist/index.js +7 -7
  263. package/dist/main-first-time-setup.code.js +2 -2
  264. package/dist/main-first-time-setup.impl.js +3 -3
  265. package/dist/main-first-time-setup.js +3 -3
  266. package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
  267. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  268. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  269. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  270. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  271. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  272. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  273. package/dist/modes/interactive/theme/color-utils.d.ts +5 -5
  274. package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
  275. package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
  276. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
  277. package/dist/modes/print-mode.js +1 -1
  278. package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
  279. package/dist/modes/rpc/rpc-types.d.ts +29 -2
  280. package/dist/package-manager-cli.code.js +5 -5
  281. package/dist/package-manager-cli.impl.js +3 -3
  282. package/dist/package-manager-cli.js +3 -3
  283. package/dist/rpc-entry.js +1 -1
  284. package/dist/startup-files.json +1 -1
  285. package/dist/startup-stages/5.js +1 -1
  286. package/dist/startup-stages/7.js +1 -1
  287. package/dist/startup-stages/8.js +1 -2
  288. package/dist/startup-stages/9.js +2 -1
  289. package/dist/utils/native-module.d.ts +44 -0
  290. package/dist/utils/startup-database-spare.code.js +3 -3
  291. package/dist/utils/startup-database-spare.impl.js +3 -3
  292. package/dist/utils/startup-database-spare.js +3 -3
  293. package/dist/utils/tools-manager.code.js +1 -1
  294. package/dist/utils/tools-manager.impl.js +3 -3
  295. package/dist/utils/tools-manager.js +3 -3
  296. package/docs/background-tasks.md +238 -243
  297. package/docs/build.md +21 -15
  298. package/docs/changelog.mdx +1 -1
  299. package/docs/codemode.md +68 -51
  300. package/docs/compaction/reference.md +65 -26
  301. package/docs/compaction.md +118 -66
  302. package/docs/computer-use.md +179 -146
  303. package/docs/containerization.md +87 -33
  304. package/docs/custom-provider/api-reference.md +152 -13
  305. package/docs/custom-provider/oauth.md +45 -28
  306. package/docs/custom-provider/override.md +14 -7
  307. package/docs/custom-provider/registration.md +77 -67
  308. package/docs/custom-provider/streaming.md +42 -19
  309. package/docs/custom-provider.md +26 -62
  310. package/docs/development.md +81 -42
  311. package/docs/docs.json +54 -38
  312. package/docs/environment-variables.md +92 -64
  313. package/docs/extensions/api-reference.md +326 -735
  314. package/docs/extensions/authoring.md +186 -269
  315. package/docs/extensions/events.md +308 -375
  316. package/docs/extensions/examples.md +122 -74
  317. package/docs/extensions/ui.md +217 -197
  318. package/docs/extensions.md +189 -259
  319. package/docs/getting-started/authentication.md +27 -14
  320. package/docs/getting-started/first-session.md +25 -26
  321. package/docs/getting-started/installation.md +62 -84
  322. package/docs/getting-started/project-instructions.md +39 -14
  323. package/docs/guides/configuration.md +62 -20
  324. package/docs/guides/intercom.md +20 -12
  325. package/docs/guides/non-interactive.md +31 -16
  326. package/docs/guides/orchestration.md +17 -9
  327. package/docs/guides/resume-on-any-machine.md +63 -52
  328. package/docs/guides/subagents.md +26 -14
  329. package/docs/guides/team-setup.md +49 -27
  330. package/docs/guides.md +30 -23
  331. package/docs/herdr.md +22 -17
  332. package/docs/index.md +24 -17
  333. package/docs/intercom/operations.md +90 -66
  334. package/docs/intercom/reference.md +219 -192
  335. package/docs/intercom.md +111 -92
  336. package/docs/json.md +73 -71
  337. package/docs/keybindings.md +74 -48
  338. package/docs/libraries/agent-core.md +52 -9
  339. package/docs/libraries/ai.md +90 -63
  340. package/docs/libraries/codemode.md +31 -8
  341. package/docs/libraries/schema.md +12 -9
  342. package/docs/libraries/storage-libsql.md +92 -0
  343. package/docs/libraries/storage-postgres.md +119 -0
  344. package/docs/libraries/telemetry.md +42 -9
  345. package/docs/libraries/tui.md +74 -94
  346. package/docs/libraries.md +25 -8
  347. package/docs/llama-cpp.md +38 -33
  348. package/docs/mcp-servers.md +140 -88
  349. package/docs/models/reference.md +53 -36
  350. package/docs/models-configuration.md +19 -13
  351. package/docs/models.md +102 -87
  352. package/docs/orchestration/migrating-workflows.md +22 -20
  353. package/docs/orchestration/patterns.md +36 -21
  354. package/docs/orchestration.md +24 -21
  355. package/docs/packages/authoring.md +29 -18
  356. package/docs/packages/reference.md +77 -16
  357. package/docs/packages.md +34 -34
  358. package/docs/programmatic.md +28 -21
  359. package/docs/prompt-templates.md +65 -41
  360. package/docs/providers/reference.md +36 -20
  361. package/docs/providers.md +78 -76
  362. package/docs/quickstart.md +42 -54
  363. package/docs/reference/cli.md +256 -254
  364. package/docs/reference.md +30 -23
  365. package/docs/rpc/examples.md +121 -17
  366. package/docs/rpc/extension-ui.md +86 -63
  367. package/docs/rpc/protocol.md +817 -358
  368. package/docs/rpc.md +78 -152
  369. package/docs/sdk/reference.md +309 -73
  370. package/docs/sdk/storage.md +614 -0
  371. package/docs/sdk/structured-decisions.md +168 -65
  372. package/docs/sdk/web-server.md +80 -46
  373. package/docs/sdk.md +168 -215
  374. package/docs/security.md +117 -44
  375. package/docs/session-format.md +127 -76
  376. package/docs/sessions.md +155 -113
  377. package/docs/settings.md +293 -205
  378. package/docs/shell-aliases.md +15 -6
  379. package/docs/skills/authoring.md +17 -9
  380. package/docs/skills/reference.md +23 -21
  381. package/docs/skills.md +148 -97
  382. package/docs/storage.md +172 -260
  383. package/docs/subagents/authoring.md +148 -15
  384. package/docs/subagents/reference.md +105 -29
  385. package/docs/subagents.md +247 -250
  386. package/docs/terminal-setup.md +97 -69
  387. package/docs/termux.md +51 -85
  388. package/docs/themes/reference.md +51 -37
  389. package/docs/themes.md +52 -55
  390. package/docs/tmux.md +38 -21
  391. package/docs/tools.md +209 -147
  392. package/docs/tui/reference.md +64 -32
  393. package/docs/tui.md +38 -66
  394. package/docs/usage.md +94 -86
  395. package/docs/verification.md +25 -25
  396. package/docs/web-access.md +106 -54
  397. package/docs/windows.md +55 -57
  398. package/docs/worktree-snapshots.md +82 -74
  399. package/examples/sdk/11-sessions.ts +4 -4
  400. package/package.json +8 -8
  401. package/schemas/models.schema.json +58 -7
  402. package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
  403. package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
  404. package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
  405. package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
  406. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
@@ -1,43 +1,30 @@
1
1
  ---
2
- title: Intercom operations
3
- description: Connection states, delivery behavior, notifications, shortcuts, and recovery.
2
+ title: "Operate Intercom"
3
+ sidebarTitle: "Operations"
4
+ description: "Configure Intercom connections, multi-machine routing, broker upgrades, delivery recovery, and troubleshooting."
4
5
  ---
5
6
 
6
- # Intercom operations
7
+ This guide explains how Atomic sessions connect to the local Intercom broker, how delivery and multi-machine routing work, and how to diagnose connection or upgrade issues.
7
8
 
8
- ## Connection states and recovery
9
+ Looking for another Intercom page? See [Intercom overview](/guides/intercom) for concepts, [Coordinate sessions with Intercom](/intercom) for quick-start patterns and `contact_supervisor`, [Intercom reference](/intercom/reference) for tool parameters and settings, or [Storage and Intercom CLI commands](/reference/cli#storage-and-intercom-commands) for broker subcommands.
9
10
 
10
- Start with the state you can observe. The sections below explain each lifecycle and delivery rule in detail.
11
+ Common operational tasks on this page:
11
12
 
12
- | State | What you see | What to do |
13
- | --- | --- | --- |
14
- | Not connected or waiting for lazy admission | Interactive sessions join in the background a few seconds after startup, unless startup join is off or the folder is not trusted yet. Print (`-p`), JSON, RPC, SDK sessions, and sessions whose tool selection excludes `intercom` join only on first Intercom use or when launching a subagent with Intercom. Subagents launched with Intercom join as soon as their session starts. | Invoke an Intercom tool, `/intercom`, or ALT+M in that session. The broker starts on demand. See [How Connection Works](#how-connection-works). |
15
- | Recoverable disconnect | An explicit Intercom call or overlay action fails visibly while background recovery keeps running. | Wait for reconnect. Check the reported outcome before repeating a send, ask, or reply, and never automatically repeat an unknown outcome. See [How It Works](#how-it-works). |
16
- | Reconnect backoff | The session stays disconnected between reconnect attempts. | No action is needed to keep recovery moving. Retries wait 1, 2, 5, 10, then 30 seconds until the session connects or closes. See [How It Works](#how-it-works). |
17
- | Destination-side admission failure | A non-parent asker receives a correlated failed-ask message, or an inline error while waiting, instead of a reply. | Act on the destination error, then send again once the recipient can accept messages. See [Subagent Notifications](#subagent-notifications). |
18
- | Broker restart or concurrent startup | Sessions disappear briefly, or several sessions start Intercom at once. | Usually no action is needed. Clients reconnect automatically, and startup locking prevents duplicate brokers. See [How It Works](#how-it-works). |
19
- | Broker started by an older Atomic | After an upgrade, the first session on the newer version replaces the older broker; sessions briefly reconnect. If replacement fails, the session warns that it uses the older broker locally. | Usually nothing. If the warning appears, run `atomic intercom restart` when a brief reconnect is acceptable. See [Upgrading Atomic with sessions running](#upgrading-atomic-with-sessions-running). |
20
- | Broker accepts connections but stops answering | List or send requests time out. | Allow about a minute for automatic broker replacement, then reconnect backoff. A request timeout can add up to five seconds for a health check. Check the logs below if it repeats. See [How It Works](#how-it-works). |
21
- | Broker does not start | The startup or readiness error prints the broker log path and a bounded tail. | Read `~/.atomic/agent/intercom/broker.log`, or the Intercom directory under `ATOMIC_CODING_AGENT_DIR`. See [How It Works](#how-it-works). |
22
- | Half-closed peer or undeliverable send | The send returns `Session not found`; its message ID remains retryable. | Refresh the session list and retry after the target reconnects. See [How It Works](#how-it-works). |
23
- | Subagent that is starting | A send or ask to a starting, resuming, or relaunching background subagent waits for registration instead of returning `Session not found` (up to twice `sessionStartTimeoutMs` plus 2 minutes, capped at 1 hour; 20 seconds across nodes). If startup fails, the sender gets the failure reason. | Wait for the send to return. Run `subagent({ action: "status", id })` to inspect start progress. See [How It Works](#how-it-works). |
24
- | Subagent being restored after a restart | A send or ask to a restoring background subagent waits up to 20 seconds by name, Atomic session ID, or pre-restart Intercom ID. If it is still restoring after 20 seconds, the sender gets a retryable error; if it did not survive the restart, the sender is told it is gone. | Retry shortly if the subagent is still restoring, or launch a fresh subagent if it did not survive. See [How It Works](#how-it-works). |
25
- | Subagent that finished or was paused | A single-target `send` or `ask` from the `intercom` tool to a completed or failed subagent returns at once as queued and resumes the subagent. One to a paused or quit subagent queues without resuming until the launching session continues it ([Messages that resume a finished subagent](/intercom/reference#messages-that-resume-a-finished-subagent)). | Wait for the reply or result. If delivery fails later, you get one delivery failure and can resend if still needed. See [How It Works](#how-it-works). |
26
- | Subagent that ended or dropped off | A send or ask to a subagent that just disconnected waits up to 20 seconds for reconnection or an owner report. If not queued for resume, senders in its group receive a typed error (`recipient_completed`, `recipient_failed`, `recipient_stopped`, `recipient_cancelled`, or retryable `recipient_disconnected`); other groups get `Session not found` ([Subagents with no live session](/intercom/reference#subagents-with-no-live-session)). | Ask the launching session to resume the subagent, or launch a fresh subagent if it was cancelled. See [How It Works](#how-it-works). |
27
- | Subagent released while it waits | A send or ask to a [released subagent](/subagents#released-subagents) waits while its launching session wakes it (20 seconds default, up to 120 seconds on confirmed wake; 20 seconds across nodes). Failures set `reasonCode` (`recipient_not_restored`, `recipient_parked`, or retryable `recipient_owner_suspended`). | Retry shortly, or resume the subagent if it is paused or quit. Only the launching session owns its hold ([Released subagents](/intercom/reference#released-subagents)). See [How It Works](#how-it-works). |
28
- | Queued for an offline session | With [multi-node routing](#running-intercom-across-machines) on, a send, ask, or reply to a recently disconnected session returns at once as queued (`Message queued for <target>`, `target: "offline session"`). An ask returns without waiting. | Do not resend as a new message. The broker delivers it when that session reconnects on any host sharing the database. See [Offline sessions](#offline-sessions). |
13
+ - [Running Intercom across machines](#running-intercom-across-machines) for shared-database setup, project groups, and multi-node troubleshooting.
14
+ - [Upgrading Atomic with sessions running](#upgrading-atomic-with-sessions-running) for broker handover, `atomic intercom upgrade`, and `atomic intercom restart`.
15
+ - [Connection states and recovery](#connection-states-and-recovery) for diagnosing disconnects, holds, and queued deliveries.
29
16
 
30
- ## How Connection Works
17
+ ## How connection works
31
18
 
32
- An interactive session connects to Intercom in the background a few seconds after it starts, including new, resumed, or forked terminal sessions. Neither the initial render nor your first prompt waits for this connection. Once connected, other sessions in its group can list and message it immediately.
19
+ An interactive session connects to Intercom in the background 3 seconds after startup, including new, resumed, or forked terminal sessions. Neither the initial render nor your first prompt waits for this connection. Once connected, other sessions in its group can list and message it immediately.
33
20
 
34
- In an untrusted folder, an interactive session waits until you trust the folder or send the first prompt before joining. If the broker cannot be reached at startup, the session retries silently after 1, 2, 5, 10, and 30 seconds, then waits until your first Intercom use. It always registers with the same name and group it would use on first use.
21
+ In an untrusted folder, an interactive session waits until you trust the folder or send your first prompt before joining. If the broker cannot be reached at startup, the session retries silently up to 5 times (after 1, 2, 5, 10, and 30 seconds), then waits until your first Intercom use. It always registers with the same name and group it would use on first use.
35
22
 
36
- Non-interactive and restricted sessions connect lazily when you or the model invoke the `intercom` tool, `/intercom`, or ALT+M. This applies to print (`-p`), JSON, RPC, and SDK sessions, as well as interactive sessions whose tool selection excludes `intercom`. An interactive session also joins lazily when `joinAtStartup` is `false` in [Intercom configuration](/intercom/reference#configuration) or when `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` is set (`1` turns startup join back on). Any session connects immediately when it launches a subagent with Intercom so it can authorize supervisor contact.
23
+ Non-interactive and restricted sessions connect on first use when you or the model invoke the `intercom` tool, `/intercom`, or `Alt+M`. This applies to print (`-p`), JSON, RPC, and SDK sessions, as well as interactive sessions whose tool selection excludes `intercom`. An interactive session also waits for first use when `joinAtStartup` is `false` in [Intercom configuration](/intercom/reference#configuration) or when `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` (or `false`, case-insensitive; legacy alias `PI_INTERCOM_JOIN_AT_STARTUP`) is set (`1` or `true` turns startup join back on). Any session connects immediately when it launches a subagent with Intercom so it can authorize supervisor contact.
37
24
 
38
25
  A subagent launched with Intercom connects as soon as its session starts, before its first turn, regardless of `joinAtStartup`. It inherits the launching session's group unless the launch sets `group`.
39
26
 
40
- If registration cannot reach the broker, the start waits at `registering on Intercom` and retries after 1, 2, 5, and 10 seconds, then every 30 seconds. A start past `sessionStartTimeoutMs` counts as stalled and retries once before failing ([Background launches and waiting](/subagents#background-launches-and-waiting)). If the broker fails to spawn, the subagent start fails immediately with the broker's error.
27
+ If subagent registration cannot reach the broker, startup waits at `registering on Intercom` and retries after 1, 2, 5, and 10 seconds, then every 30 seconds. A start past `sessionStartTimeoutMs` counts as stalled and retries once before failing ([Background launches and waiting](/subagents#background-launches-and-waiting)). If the broker fails to spawn, the subagent start fails immediately with the broker's error.
41
28
 
42
29
  A session is connected to Intercom when all of these hold:
43
30
 
@@ -45,21 +32,21 @@ A session is connected to Intercom when all of these hold:
45
32
  - The local broker is running or can be started on demand.
46
33
  - At least one join trigger applies: an interactive session with `intercom` enabled, startup join on, and a trusted folder or started prompt; a subagent launched with Intercom; an explicit Intercom call or overlay action; or a subagent launch that uses Intercom.
47
34
 
48
- The session list and ALT+M picker display connected agent sessions, not every open Atomic process. Internal control connections never appear as recipients and do not affect session counts. Agent sessions remain visible and messageable while executing tools or waiting for human input.
35
+ The session list and `Alt+M` picker display connected agent sessions, not every open Atomic process. Internal control connections never appear as recipients and do not affect session counts. Agent sessions remain visible and messageable while executing tools or waiting for human input.
49
36
 
50
- Use `/name` to give sessions readable targets such as `planner` and `worker`. Unnamed sessions receive a runtime-only fallback alias like `subagent-chat-1a2b3c4d-1111-4222-8333-123456789abc` so peers can address them. That fallback alias is never saved as the session title, so `/resume` still displays the transcript preview.
37
+ Use `/name` to give sessions readable targets such as `planner` and `worker`. Unnamed sessions receive a runtime-only fallback alias of the form `subagent-chat-<id>` (stripping any leading `session-` prefix from the session ID) so peers can address them. That fallback alias is never saved as the session title, so `/resume` still displays the transcript preview.
51
38
 
52
39
  ### Troubleshooting initialization
53
40
 
54
- `Intercom heavy initialization failed; a later call will retry: ...` means initialization failed temporarily and will retry on a later Intercom call. Interactive sessions display this as a yellow warning in chat; print, JSON, and RPC sessions print console diagnostics. Terminal relay and cleanup failures appear as error notifications in interactive sessions.
41
+ If Intercom cannot start or connect its background client, Atomic logs `Intercom heavy initialization failed; a later call will retry: ...` and retries on a later Intercom call. Interactive sessions show this as a yellow warning in chat; print, JSON, and RPC sessions print console diagnostics. Terminal relay and cleanup failures appear as error notifications in interactive sessions.
55
42
 
56
- If initialization keeps failing, inspect the reported error and `~/.atomic/agent/intercom/broker.log` (or the Intercom directory under `ATOMIC_CODING_AGENT_DIR`). Never resend an operation whose delivery outcome was reported as unknown before checking with the recipient.
43
+ If initialization keeps failing, inspect the reported error and `~/.atomic/agent/intercom/broker.log` (or the Intercom directory under `ATOMIC_CODING_AGENT_DIR`). Never resend a message whose delivery outcome was reported as unknown before checking with the recipient.
57
44
 
58
45
  ### Upgrading Atomic with sessions running
59
46
 
60
- Sessions on one machine share one local broker, and that broker keeps running after you install a newer Atomic release. Run `atomic intercom status` to see the running broker's PID, connected session count, storage match, multi-node state, and protocol version.
47
+ Sessions on one machine share one local broker, and that broker keeps running after you install a newer Atomic release. Run `atomic intercom status` to inspect the running broker's PID, connected session count, storage match, multi-node state, and protocol version.
61
48
 
62
- - **Automatic handover.** When a session on a newer Atomic version finds an older compatible broker, it asks that broker to shut down, waits up to a minute for exit (older Windows brokers can take around 30 seconds with active sessions), and starts the new broker. Existing sessions reconnect automatically, keep their session IDs, and continue exchanging messages across versions.
49
+ - **Automatic handover.** When a session on a newer Atomic version finds an older compatible broker, it asks that broker to shut down, waits up to 1 minute for exit (older Windows brokers can take around 30 seconds with active sessions), and starts the new broker. Existing sessions reconnect automatically, keep their session IDs, and continue exchanging messages across versions.
63
50
  - **When replacement fails.** If the older broker does not stop, uses a different shared storage selection, or speaks an incompatible protocol, the session leaves it running. Without multi-node storage, the session shows one warning and runs locally on the existing broker; requests that need newer features fail with `IntercomBrokerProtocolError`. With multi-node storage configured, the session refuses to register with `IntercomRoutingUnavailableError` because it cannot verify cross-machine routing. Run `atomic intercom restart` to replace the broker in either case.
64
51
  - **Installer and update hook.** Installers and `atomic update` finish by running `atomic intercom upgrade`. It stops an older broker immediately when no sessions are connected, and leaves an active broker for the next newer session to hand over safely. You can run `atomic intercom upgrade` manually at any time (for example after `npm install -g`).
65
52
  - **Windows npm upgrades from 0.10.4 or earlier.** If `npm install -g @bastani/atomic` fails with `EBUSY` on `dist\builtin\intercom`, an earlier broker is still holding that directory as its working directory. Close running Atomic sessions, wait 5 seconds (or run `atomic intercom restart`), and re-run the update. From 0.10.5 onward, the broker runs outside the installation directory and does not block npm updates or uninstalls.
@@ -72,15 +59,15 @@ Atomic 0.10.0 removed workflows along with `workflow:<rootRunId>/...` stage targ
72
59
 
73
60
  Messages sent to a `workflow:<rootRunId>/...` target are not queued for unstarted stages and return `Session not found`. If a 0.9.x workflow run is still active on a 0.10.0+ broker, each started stage registers as an ordinary session in its `workflow:<runId>` group; join that group to reach the stage by its session ID or name.
74
61
 
75
- ## How It Works
62
+ ## How it works
76
63
 
77
64
  ### Broker lifecycle and retries
78
65
 
79
- The local broker starts on demand when the first session connects and exits after 5 seconds with no registered sessions. Clients reconnect automatically after 1, 2, 5, 10, and then 30 seconds while keeping explicit connection errors visible.
66
+ The local broker starts on demand when the first session connects and exits automatically 5 seconds after its last session disconnects. Clients reconnect automatically after 1, 2, 5, 10, and then 30 seconds while keeping explicit connection errors visible.
80
67
 
81
68
  A built-in watchdog terminates an unresponsive broker if it stops answering health checks for about a minute, allowing clients to spawn a replacement. A single slow request does not trigger replacement, and an OS-suspended process cannot run its own watchdog. If a broker remains stuck, verify which process owns it before stopping it manually.
82
69
 
83
- For `send`, `ask`, and `reply`, the `intercom` tool manages reconnect recovery internally. Each call makes one initial attempt plus up to three retries (waiting 1, 2, and 5 seconds) within an 11-minute operation deadline. Retries preserve the message ID, arguments, attachments, and reply thread. Caller-supplied `retryToken` arguments are rejected without sending; each new tool call is a fresh operation.
70
+ For `send`, `ask`, and `reply`, the `intercom` tool manages reconnect recovery internally. Each call makes one initial attempt plus up to three retries (waiting 1, 2, and 5 seconds) within an 11-minute operation deadline. Retries preserve the message ID, arguments, attachments, and reply thread; each new tool call is a fresh operation.
84
71
 
85
72
  If initialization fails before delivery starts, the tool returns `outcome: "not_sent"`. Only recoverable disconnects trigger retries; unrelated errors stop immediately. Cancelling a call stops further retries without undoing an already accepted delivery.
86
73
 
@@ -94,39 +81,38 @@ If the recipient does not confirm the save within about 8 seconds, the sender re
94
81
 
95
82
  Intercom refuses new deliveries when it cannot safely track duplicates (such as storage or capacity failures). Do not delete Intercom database files to force a resend when an outcome is unknown.
96
83
 
97
- Custom SDK hosts can optionally pass `recipientPurpose` (`"agent"` or `"control"`) when registering a session; omitting it defaults to `"agent"`. Invalid values are rejected, and a session's purpose cannot change after registration.
98
-
99
84
  ### Local files, logs, and locks
100
85
 
101
86
  Configuration, logs, and local queues live in `~/.atomic/agent/intercom/` (or under `ATOMIC_CODING_AGENT_DIR`, falling back to `PI_CODING_AGENT_DIR`). Edit `config.json` to change [Intercom settings](/intercom/reference#configuration).
102
87
 
103
88
  - **Logs.** Read `broker.log` when startup fails; ordinary diagnostics are capped at 8 KiB per broker. The previous broker's log is kept in `broker.log.previous`, and `broker-watchdog.log` records the latest watchdog termination's time, PID, and reason. Keep these files when reporting stalls.
104
89
  - **Local queues and deduplication.** `delivered-messages.sqlite` tracks recently delivered message IDs across restarts, and `ended-child-queue.sqlite` stores queued messages for finished or paused subagents ([Across restarts](/intercom/reference#across-restarts)). Both are created when the first session registers. Do not delete them while troubleshooting delivery outcomes.
105
- - **Session teardown.** Disposing a session cancels any unstarted broker spawn and waits for a broker it already launched to finish starting. Once `dispose()` resolves, the session makes no further writes to the agent directory. On Windows, a running broker keeps `broker.log` open until it exits about 5 seconds after its last session disconnects.
90
+ - **Session teardown.** Disposing a session cancels any unstarted broker spawn and waits for a broker it already launched to finish starting. Once `dispose()` resolves, the session makes no further writes to the agent directory. On Windows, a running broker keeps `broker.log` open until its 5-second idle exit completes.
106
91
  - **Unchecked startup locks.** If startup encounters a lock held by a process Atomic cannot inspect (for example on a shared filesystem, across containers, or owned by another user), Atomic leaves the lock untouched. After 30 seconds it logs the lock path and recovery steps. Confirm that no process on any host sharing the directory still needs the files before removing them, and never remove the SQLite database files.
107
92
 
108
- ## Subagent Notifications
93
+ ## Subagent notifications
109
94
 
110
95
  Intercom delivers subagent results and control notices from the [subagent runtime](/subagents) back to the launching session.
111
96
 
112
97
  ### Subagent control notices
113
98
 
114
- The `subagent` tool's `control` options choose which activity notices reach the parent and over which channels:
99
+ The `subagent` tool's `control` options (or `control` in `~/.atomic/agent/extensions/subagent/config.json`) configure when activity notices fire and where they go:
115
100
 
101
+ - **`needsAttentionAfterMs`.** Defaults to `60000` (1 minute without observed activity).
102
+ - **`activeNoticeAfterMs`.** Defaults to `240000` (4 minutes elapsed while active).
103
+ - **`failedToolAttemptsBeforeAttention`.** Defaults to `3` consecutive mutating-tool failures.
116
104
  - **`notifyOn`.** Defaults to `["active_long_running", "needs_attention"]`.
117
105
  - **`notifyChannels`.** Defaults to `["event", "intercom"]`.
118
106
 
119
- Run results report each subagent's Intercom target as `Run intercom target` or `Previous intercom target`; a target may no longer be live after completion. Call `intercom({ action: "status" })` before launching subagents if you want to verify your connection and group memberships.
107
+ Run results report each subagent's Intercom target as `Run intercom target` or `Previous intercom target`; a target may no longer be live after completion. Call `intercom({ action: "status" })` before launching subagents to verify your connection and group memberships.
120
108
 
121
109
  Subagents launched with Intercom connect before their first turn and inherit the launching session's group unless the launch sets `group`. Fresh subagents still receive Intercom even when an extension allowlist omits it.
122
110
 
123
111
  ### Delivery ordering
124
112
 
125
- In normal task-host runs, both single-child and parallel launches run in the background without cancelling siblings. An `intercom` `ask` returns at delivery and delivers its reply later as a message in the same child. A `contact_supervisor` decision or interview waits only in the requesting child and continues that same execution when answered. Sends and progress updates are non-blocking.
126
-
127
- Only a direct single-child launch in an SDK session without a task host retains the terminal `[TASK_CONTEXT]` fresh-child handoff when a blocking parent request is claimed.
113
+ In standard interactive and background sessions, single and parallel subagent launches run without cancelling siblings. An `intercom` `ask` returns at delivery and delivers its reply later as a message in the same subagent. A `contact_supervisor` decision or interview waits only in the requesting subagent and continues that same subagent when answered. Sends and progress updates never block. (Only a direct single-child launch in an embedded SDK session without background task management uses the terminal `[TASK_CONTEXT]` handoff when a blocking supervisor request is claimed.)
128
114
 
129
- Queued messages from a child arrive before its completion notice. Delivery retries never rerun work or alter its outcome. Messages from one sender arrive in order whether admitted immediately or queued until the recipient is idle.
115
+ Queued messages from a subagent arrive before its completion notice. Delivery retries never rerun work or alter its outcome. Messages from one sender arrive in order whether delivered immediately or queued until the recipient is idle.
130
116
 
131
117
  ## Running Intercom across machines
132
118
 
@@ -136,7 +122,21 @@ By default, each machine's broker serves only sessions on that machine. With mul
136
122
 
137
123
  For a team, run `atomic team join <url> --token-file <path>` to configure the team database for Intercom while keeping session transcripts local and restarting the broker. CI runners use `ATOMIC_PROFILE=ci` instead. See [Team and CI setup](/guides/team-setup).
138
124
 
139
- To configure multi-node routing manually, give every machine the same top-level `storage` selection and `prefix`, using a [storage adapter](/storage#selecting-an-adapter) that implements `openDatabase` and connects to a shared database ([Sharing storage across hosts](/storage#sharing-storage-across-hosts)). Install the adapter on every machine, for example as an [Atomic package](/storage#adapters-from-atomic-packages). Both npm installations and standalone binaries support multi-node routing.
125
+ To configure multi-node routing with a shared database for both sessions and Intercom, install either `@bastani/atomic-storage-libsql` ([Turso and libSQL](/storage#turso-and-libsql), [libSQL adapter library](/libraries/storage-libsql)) or `@bastani/atomic-storage-postgres` ([PostgreSQL](/storage#postgresql), [PostgreSQL adapter library](/libraries/storage-postgres)) on every machine and run `atomic storage join`. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) and [Storage and Intercom CLI commands](/reference/cli#storage-and-intercom-commands) for all flags and options.
126
+
127
+ ```bash
128
+ # Turso / libSQL
129
+ atomic install npm:@bastani/atomic-storage-libsql
130
+ atomic storage join libsql://<db>.turso.io --token-file ~/turso-token --prefix team_
131
+ atomic intercom restart
132
+
133
+ # PostgreSQL
134
+ atomic install npm:@bastani/atomic-storage-postgres
135
+ atomic storage join postgres://atomic@db.example.com:5432/atomic?sslmode=verify-full --password-file ~/pg-password --prefix team_
136
+ atomic intercom restart
137
+ ```
138
+
139
+ You can also give every machine the same top-level `storage` selection and `prefix` manually, using any database-backed [storage adapter](/storage#selecting-an-adapter) installed as an [Atomic package](/storage#adapters-from-atomic-packages). Both npm installations and standalone binaries support multi-node routing.
140
140
 
141
141
  The broker reads its storage selection from:
142
142
 
@@ -146,9 +146,9 @@ The broker reads its storage selection from:
146
146
  ```json
147
147
  {
148
148
  "storage": {
149
- "adapter": "@example/atomic-sqlite",
150
- "options": { "url": "libsql://team.example" },
151
- "secrets": { "authToken": { "env": "TEAM_DB_TOKEN" } },
149
+ "adapter": "@bastani/atomic-storage-libsql",
150
+ "options": { "url": "libsql://<db>.turso.io" },
151
+ "secrets": { "authToken": { "env": "TURSO_TOKEN" } },
152
152
  "prefix": "team_"
153
153
  }
154
154
  }
@@ -160,18 +160,22 @@ Each broker logs `Intercom multi-node routing is on (adapter <adapter>, prefix <
160
160
 
161
161
  - No global or process-level `storage` is configured (project `.atomic/settings.json`, `sessions.storage`, and `ATOMIC_SESSIONS_STORAGE` do not enable multi-node routing).
162
162
  - Storage is in memory (`{ "memory": true }` or `{ "path": ":memory:" }`).
163
- - The adapter implements only `openSessionStore` without `openDatabase`.
163
+ - The storage adapter stores only session files and does not provide shared database tables.
164
164
  - The selection is invalid (such as a missing `env` secret or an unloadable adapter package).
165
165
 
166
166
  A local `path` selection shares only among brokers on the same machine opening the same file. Never place a local SQLite file on a network filesystem. Brokers using different `prefix` values cannot see each other's sessions, allowing one database to isolate separate teams or tenants.
167
167
 
168
168
  ### Project groups
169
169
 
170
- When multi-node routing is on, sessions without an explicit group join `project:<owner>/<repo>` instead of `default`. The name comes from the repository's `origin` remote, falling back to the repository directory name when there is no `origin`, or the working directory name outside Git. This prevents sessions from different repositories on a shared database from accidentally messaging each other.
170
+ When multi-node routing is on, sessions without an explicit group join `project:<path>` instead of `default`. This prevents sessions from different repositories on a shared database from accidentally messaging each other.
171
+
172
+ How the project group name is derived:
171
173
 
172
- Explicit groups still take precedence: an inherited subagent group, an SDK host policy, `ATOMIC_INTERCOM_GROUP`, or `group` in `config.json`. Joining `default` explicitly while multi-node routing is on prints a warning (in the UI or once on stderr for non-interactive runs) because every teammate sharing the database can message `default`. Running sessions keep their current group until restarted or reloaded.
174
+ - **Git detection.** Atomic walks up ancestor directories looking for `.git` without spawning `git`. Outside a Git repository, it uses the working directory's base name (`project:<dirname>`) and never runs `git`, so missing Git does not fail outside a Git repo.
175
+ - **Remote URL path and casing.** Inside a Git repository, Atomic runs `git` to inspect `origin`, falling back to the repository directory name when no `origin` is configured. All path segments are preserved (so nested paths such as `https://gitlab.com/org/team/repo.git` become `project:org/team/repo`). **Casing from the remote URL is preserved verbatim** (`project:Owner/Repo` and `project:owner/repo` are different groups). Make sure teammates configure matching casing on their `origin` URLs or set `ATOMIC_INTERCOM_GROUP`.
176
+ - **Missing or broken Git inside a repo.** If `.git` exists but `git` is missing or fails, Intercom fails startup with `ProjectGroupError` until you install Git, fix the repository error, or set `ATOMIC_INTERCOM_GROUP` to bypass the lookup.
173
177
 
174
- Inside a Git repository, Intercom runs `git` to inspect `origin`. If Git is missing or fails, Intercom fails startup with `ProjectGroupError` until you install Git, fix the repository error, or set `ATOMIC_INTERCOM_GROUP` to bypass the lookup.
178
+ Explicit groups take precedence over the project group: an inherited subagent group, an SDK host policy, `ATOMIC_INTERCOM_GROUP`, or `group` in `config.json`. Joining `default` explicitly while multi-node routing is on prints a warning (in the UI or once on stderr for non-interactive runs) because every teammate sharing the database can message `default`. Running sessions keep their current group until restarted or reloaded.
175
179
 
176
180
  Before registering, each session verifies the running broker's routing mode so a session never accidentally joins `default` on a multi-node broker or runs locally when shared storage was requested. If the running broker's storage disagrees with the session (for example after switching `storage` or `ATOMIC_PROFILE=ci`), run `atomic intercom restart` and restart the session. For `ProjectGroupError` and the `IntercomRouting*Error` classes (`IntercomRoutingMismatchError`, `IntercomRoutingUnavailableError`, `IntercomRoutingTimeoutError`, `IntercomRoutingChangedError`), see [Routing and project-group errors](/intercom/reference#routing-and-project-group-errors).
177
181
 
@@ -182,7 +186,7 @@ Sessions connected to brokers on other machines appear in `intercom list` and be
182
186
  - `send`, `ask`, and `reply` keep sender identity, reply threads, and save-confirmed `delivered` receipts.
183
187
  - Group isolation and [return paths](/intercom/reference#answering-a-sender-outside-your-groups) enforce the same rules across machines.
184
188
  - Supervisor traffic from `contact_supervisor` preserves supervisor routing.
185
- - Holds for restoring or released subagents work across machines with the same error codes ([Connection states and recovery](#connection-states-and-recovery)).
189
+ - Routing holds for restoring or released subagents work across machines with the same error codes ([Connection states and recovery](#connection-states-and-recovery)).
186
190
  - Retry deduplication prevents duplicate delivery across nodes.
187
191
 
188
192
  If a local session and a remote session share the same name, name lookup prefers the local session. Use distinct session names or address remote peers by session ID.
@@ -220,7 +224,7 @@ When a machine or broker stops abruptly, its sessions still look connected for u
220
224
 
221
225
  - Run `atomic storage status` on both machines to verify they use the exact same `storage` selection and `prefix`, and that each broker reports `storage: matches the selection above`. Run `atomic intercom restart` if a broker started before a settings change.
222
226
  - Run `atomic intercom status` or inspect `broker.log` for `Intercom multi-node routing is on`, `off`, or `unavailable`. Remember that a local `path` selection only reaches brokers on the same machine.
223
- - Confirm the remote session has actually joined Intercom (for non-interactive or lazy sessions, call `intercom({ action: "status" })` once) and shares a group with your session.
227
+ - Confirm the remote session has actually joined Intercom (for non-interactive or first-use sessions, call `intercom({ action: "status" })` once) and shares a group with your session (check remote URL casing if using `project:<path>` groups).
224
228
  - If the database is temporarily slow, `intercom list` falls back to local sessions after 2 seconds; retry shortly.
225
229
 
226
230
  **A send stays queued.** The recipient is offline. It receives the message when the same Atomic session reconnects with the same home group on a host using the same storage and prefix.
@@ -231,24 +235,44 @@ On startup failure, the broker logs `Intercom multi-node routing is unavailable:
231
235
 
232
236
  **A cross-machine ask never gets an answer.** If the remote recipient disconnects before answering, the asker is not notified and the ask stays pending. Cancel it with `intercom({ action: "cancel", askId })` and ask again once the recipient returns.
233
237
 
234
- ## Keyboard Shortcuts
238
+ ## Connection states and recovery
239
+
240
+ Use this table to diagnose what you observe in chat, `/intercom`, or tool responses:
241
+
242
+ | State | What you see | What to do |
243
+ | --- | --- | --- |
244
+ | Not connected yet (connects on first use) | Interactive sessions join 3 seconds after startup unless startup join is off or the folder is untrusted. Print (`-p`), JSON, RPC, SDK sessions, and sessions excluding `intercom` join only on first use or when launching a subagent with Intercom. Subagents join as soon as their session starts. | Invoke an Intercom tool, `/intercom`, or `Alt+M` in that session. The broker starts on demand. See [How connection works](#how-connection-works). |
245
+ | Recoverable disconnect | An explicit Intercom call or overlay action fails visibly while background recovery keeps running. | Wait for reconnect. Check the reported outcome before repeating a send, ask, or reply, and never automatically repeat an unknown outcome. See [How it works](#how-it-works). |
246
+ | Reconnect backoff | The session stays disconnected between reconnect attempts. | No action is needed. Retries wait 1, 2, 5, 10, then 30 seconds until the session connects or closes. See [How it works](#how-it-works). |
247
+ | Recipient refused the message | A non-parent asker receives a correlated failed-ask message, or an inline error while waiting, instead of a reply. | Act on the destination error, then send again once the recipient can accept messages. See [Subagent notifications](#subagent-notifications). |
248
+ | Broker restart or concurrent startup | Sessions disappear briefly, or several sessions start Intercom at once. | Usually no action is needed. Clients reconnect automatically, and startup locking prevents duplicate brokers. See [How it works](#how-it-works). |
249
+ | Broker started by an older Atomic | After an upgrade, the first session on the newer version replaces the older broker; sessions briefly reconnect. If replacement fails, the session warns that it uses the older broker locally. | Usually nothing. If the warning appears, run `atomic intercom restart` when a brief reconnect is acceptable. See [Upgrading Atomic with sessions running](#upgrading-atomic-with-sessions-running). |
250
+ | Broker accepts connections but stops answering | List or send requests time out. | Allow about a minute for automatic broker replacement, then reconnect backoff. A request timeout can add up to 5 seconds for a health check. Check `broker.log` if it repeats. See [How it works](#how-it-works). |
251
+ | Broker does not start | The startup or readiness error prints the broker log path and a bounded tail. | Read `~/.atomic/agent/intercom/broker.log`, or the Intercom directory under `ATOMIC_CODING_AGENT_DIR`. See [How it works](#how-it-works). |
252
+ | Peer disconnected unexpectedly | The send returns `Session not found`; its message ID remains retryable. | Refresh the session list and retry after the target reconnects. See [How it works](#how-it-works). |
253
+ | Subagent that is starting | A send or ask to a starting, resuming, or relaunching background subagent waits for registration instead of returning `Session not found` (up to twice `sessionStartTimeoutMs` plus 2 minutes, capped at 1 hour; 20 seconds across nodes). If startup fails, the sender gets the failure reason. | Wait for the send to return. Run `subagent({ action: "status", id })` to inspect start progress. See [How it works](#how-it-works). |
254
+ | Subagent being restored after a restart | A send or ask to a restoring background subagent waits up to 20 seconds by name, Atomic session ID, or pre-restart Intercom ID. If it is still restoring after 20 seconds, the sender gets a retryable error; if it did not survive the restart, the sender is told it is gone. | Retry shortly if the subagent is still restoring, or launch a fresh subagent if it did not survive. See [How it works](#how-it-works). |
255
+ | Subagent that finished or was paused | A single-target `send` or `ask` from the `intercom` tool to a completed or failed subagent returns at once as queued and resumes the subagent. One to a paused or quit subagent queues without resuming until the launching session continues it ([Messages that resume a finished subagent](/intercom/reference#messages-that-resume-a-finished-subagent)). | Wait for the reply or result. If delivery fails later, you get one delivery failure and can resend if still needed. See [How it works](#how-it-works). |
256
+ | Subagent that ended or dropped off | A send or ask to a subagent that just disconnected waits up to 20 seconds for reconnection or an owner report. If not queued for resume, senders in its group receive a typed error (`recipient_completed`, `recipient_failed`, `recipient_stopped`, `recipient_cancelled`, or retryable `recipient_disconnected`); other groups get `Session not found` ([Subagents with no live session](/intercom/reference#subagents-with-no-live-session)). | Ask the launching session to resume the subagent, or launch a fresh subagent if it was cancelled. See [How it works](#how-it-works). |
257
+ | Subagent released while it waits | A send or ask to a [released subagent](/subagents#released-subagents) waits while its launching session wakes it (20 seconds default, up to 120 seconds on confirmed wake; 20 seconds across nodes). Failures set `reasonCode` (`recipient_not_restored`, `recipient_parked`, or retryable `recipient_owner_suspended`). | Retry shortly, or resume the subagent if it is paused or quit. Only the launching session owns its hold ([Released subagents](/intercom/reference#released-subagents)). See [How it works](#how-it-works). |
258
+ | Queued for an offline session | With [multi-node routing](#running-intercom-across-machines) on, a send, ask, or reply to a recently disconnected session returns at once as queued (`Message queued for <target>`, `target: "offline session"`). An ask returns without waiting. | Do not resend as a new message. The broker delivers it when that session reconnects on any host sharing the database. See [Offline sessions](#offline-sessions). |
259
+
260
+ ## Keyboard shortcuts
235
261
 
236
262
  | Key | Action |
237
263
  | --- | --- |
238
- | ALT+M | Open session list overlay |
239
- | ↑/↓ | Navigate session list |
240
- | Enter | Select session or send message |
241
- | Escape | Cancel or close overlay |
264
+ | `Alt+M` | Open session list overlay |
265
+ | `↑`/`↓` | Navigate session list |
266
+ | `Enter` | Select session or send message |
267
+ | `Esc` | Cancel or close overlay |
242
268
 
243
269
  ## Limitations
244
270
 
245
271
  - **Local broker sockets.** Each session connects to the broker on its own machine over local sockets or pipes. Cross-machine delivery requires a shared storage database ([Running Intercom across machines](#running-intercom-across-machines)).
246
272
  - **No separate Intercom log.** Messages live in each session's history rather than a dedicated inbox or transcript file.
247
- - **No attachment picker in the overlay.** `file`, `snippet`, and `context` attachments work through the `intercom` tool and protocol, not the ALT+M compose overlay.
273
+ - **No attachment picker in the overlay.** `file`, `snippet`, and `context` attachments work through the `intercom` tool and protocol, not the `Alt+M` compose overlay.
248
274
  - **Only connected sessions appear.** `intercom list` and the overlay show sessions connected to the broker, not every open Atomic process.
249
- - **On-demand broker lifecycle.** The broker starts when the first session connects and exits after 5 seconds idle; sessions reconnect automatically if it restarts.
250
275
  - **Unsaved sessions.** A session started with `--no-session` keeps received messages only in memory, so unread messages are lost if it exits.
251
- - **Paused or quit subagents.** Single-target messages from `intercom` to a paused or quit subagent queue durably across broker restarts without resuming it, waiting until the launching session continues it. Queued messages fail once if the subagent is cancelled, or if the launching session ends or stays away for 7 days in a row. Pattern sends and older clients do not queue and get `recipient_stopped` or `Session not found` ([Run control](/subagents#run-control)).
252
- - **Subagents whose launching session is not running.** Live and restoring holds apply while the launching session is open or after it reported the subagent. Messages from `intercom` to reported completed, failed, paused, or quit subagents queue durably in `ended-child-queue.sqlite` or shared storage for up to 7 days while that session is away. Unreported or expired subagents return `Session not found` unless multi-node offline queueing applies. Unrestored holds end on disconnect, or after 60 seconds in hosts without recovery such as `atomic -p`.
276
+ - **Subagent queues when the launching session is away.** Routing holds for starting or restoring subagents apply while the launching session is open (ending on disconnect, or after 60 seconds in single-run modes without recovery such as `atomic -p`). Messages to reported completed, failed, paused, or quit subagents queue durably in `ended-child-queue.sqlite` or shared storage for up to 7 days while the launching session is away; pattern sends and older clients do not queue ([Run control](/subagents#run-control)).
253
277
  - **Released subagent asks on the local broker.** With multi-node routing on, replies from another machine survive broker restarts for asks sent to remote peers. Questions asked of a session on the subagent's own local broker are kept only by that broker, so a broker restart delivers a timeout to the subagent ([Released subagents](/intercom/reference#released-subagents)).
254
- - **Offline session queueing scope.** With [multi-node routing](#running-intercom-across-machines) on, sends to a session that disconnected within about 7 days (including a subagent session) queue for its return instead of returning `Session not found`, unless an active subagent hold or ended-subagent queue handles them first ([Offline sessions](#offline-sessions)).
278
+ - **Offline session queueing precedence.** With [multi-node routing](#running-intercom-across-machines) on, sends to a session that disconnected within about 7 days (including a subagent session) queue for its return instead of returning `Session not found`, unless an active subagent hold or ended-subagent queue handles them first ([Offline sessions](#offline-sessions)).