@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
@@ -3,10 +3,10 @@ import { existsSync, readFileSync } from "node:fs";
3
3
  import { join, resolve } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { APP_NAME } from "./p0-cli-BB45ZQY6.js";
6
- import { getBuiltinPackageLocations, openAdapterSelectionDatabase } from "./startup-0-0-TYUFUOJZ.js";
6
+ import { getBuiltinPackageLocations, openAdapterSelectionDatabase } from "./startup-0-0-4VG2G44V.js";
7
7
  import { SettingsManager, adoptInlineSnapshotBlobs, collectStorageStatus, describeStorageError as describeStorageError$1, describeStorageSelection, effectiveSharedSelection, inlineSnapshotBlobs, joinSharedDatabase, projectTrust, resolveSessionStore, selectSessionStorageWithSettings, sessionSnapshotBlobs } from "./startup-8-1-4KANEHRA.js";
8
8
  import { mkdir } from "node:fs/promises";
9
- import { SESSIONS_TRANSFER_DIRECTORY, StorageImportIncompleteError, StorageTransferError, assertSessionBlobStore, inlineToolOutput, isStorageImportIncompleteError, isStorageTransferError, readTransferDirectory, storeSessionBlobs, takeInlineToolOutput, transferFile, writeLinesAtomically } from "./startup-0-1-W2G2UY7R.js";
9
+ import { SESSIONS_TRANSFER_DIRECTORY, StorageImportIncompleteError, StorageTransferError, assertSessionBlobStore, inlineToolOutput, isStorageImportIncompleteError, isStorageTransferError, readTransferDirectory, storeSessionBlobs, takeInlineToolOutput, transferFile, writeLinesAtomically } from "./startup-0-1-XTIL65D4.js";
10
10
  import { SessionConflictError, SessionExistsError } from "../core/storage/session/errors.js";
11
11
  import { JsonlSessionStore, isCurrentSessionHeader } from "./startup-8-0-34CBHPZH.js";
12
12
  import "./settings-startup-4QCVCI53.js";
@@ -1012,7 +1012,7 @@ function __atomicOnDemandFailed(error, feature) {
1012
1012
  return (async () => {
1013
1013
  const root = new URL("../", import.meta.url);
1014
1014
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
1015
- const key = `${root.href}#0.10.9`;
1015
+ const key = `${root.href}#0.10.10-alpha.2`;
1016
1016
  let release = releases.get(key);
1017
1017
  if (release === undefined) {
1018
1018
  const current = (async () => {
@@ -1040,7 +1040,7 @@ function __atomicOnDemandFailed(error, feature) {
1040
1040
  } catch {
1041
1041
  // No installation to read, as in a bundle of the package: the release the process runs decides.
1042
1042
  }
1043
- const updatedTo = typeof installed === "string" && installed !== "0.10.9" ? installed : running !== undefined && running.version !== "0.10.9" ? "0.10.9" : undefined;
1043
+ const updatedTo = typeof installed === "string" && installed !== "0.10.10-alpha.2" ? installed : running !== undefined && running.version !== "0.10.10-alpha.2" ? "0.10.10-alpha.2" : undefined;
1044
1044
  if (updatedTo === undefined) throw error;
1045
1045
  const application = typeof running?.name === "string" ? running.name : "atomic";
1046
1046
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -31,7 +31,7 @@ function __atomicOnDemandFailed(error, feature) {
31
31
  return (async () => {
32
32
  const root = new URL("../", import.meta.url);
33
33
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
34
- const key = `${root.href}#0.10.9`;
34
+ const key = `${root.href}#0.10.10-alpha.2`;
35
35
  let release = releases.get(key);
36
36
  if (release === undefined) {
37
37
  const current = (async () => {
@@ -59,7 +59,7 @@ function __atomicOnDemandFailed(error, feature) {
59
59
  } catch {
60
60
  // No installation to read, as in a bundle of the package: the release the process runs decides.
61
61
  }
62
- const updatedTo = typeof installed === "string" && installed !== "0.10.9" ? installed : running !== undefined && running.version !== "0.10.9" ? "0.10.9" : undefined;
62
+ const updatedTo = typeof installed === "string" && installed !== "0.10.10-alpha.2" ? installed : running !== undefined && running.version !== "0.10.10-alpha.2" ? "0.10.10-alpha.2" : undefined;
63
63
  if (updatedTo === undefined) throw error;
64
64
  const application = typeof running?.name === "string" ? running.name : "atomic";
65
65
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -88,7 +88,7 @@ function __atomicOnDemandFailed(error, feature) {
88
88
  return (async () => {
89
89
  const root = new URL("../", import.meta.url);
90
90
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
91
- const key = `${root.href}#0.10.9`;
91
+ const key = `${root.href}#0.10.10-alpha.2`;
92
92
  let release = releases.get(key);
93
93
  if (release === undefined) {
94
94
  const current = (async () => {
@@ -116,7 +116,7 @@ function __atomicOnDemandFailed(error, feature) {
116
116
  } catch {
117
117
  // No installation to read, as in a bundle of the package: the release the process runs decides.
118
118
  }
119
- const updatedTo = typeof installed === "string" && installed !== "0.10.9" ? installed : running !== undefined && running.version !== "0.10.9" ? "0.10.9" : undefined;
119
+ const updatedTo = typeof installed === "string" && installed !== "0.10.10-alpha.2" ? installed : running !== undefined && running.version !== "0.10.10-alpha.2" ? "0.10.10-alpha.2" : undefined;
120
120
  if (updatedTo === undefined) throw error;
121
121
  const application = typeof running?.name === "string" ? running.name : "atomic";
122
122
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -4,6 +4,12 @@ All notable changes to Atomic's Intercom extension, `@bastani/intercom`, are doc
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.10.10-alpha.1] - 2026-11-24
8
+
9
+ ### Fixed
10
+
11
+ - Targeted `intercom({ action: "leave", group })` on a session's last membership now falls back to the session's resolved registration group (such as `project:<owner>/<repo>` under multi-node routing) instead of silently moving the session into `"default"` ([#6552](https://github.com/bastani-inc/atomic/pull/6552)).
12
+
7
13
  ## [0.10.6] - 2026-11-23
8
14
 
9
15
  ### Changed
@@ -8,15 +8,17 @@ See the [Intercom guide](https://docs.bastani.ai/intercom), [Intercom operations
8
8
 
9
9
  When you run multiple Atomic sessions at the same time, such as one researching and another implementing, Intercom lets you coordinate them without copying text between terminals:
10
10
 
11
- - **User-driven orchestration.** Press `Alt+M` or run `/intercom` to pick a session and send context or instructions.
12
- - **Agent collaboration.** Agents can list live peers, send notifications, ask questions, and exchange file or code attachments.
13
- - **Subagent escalation.** Delegated subagents receive a typed admission-issued `contact_supervisor` tool with canonical run metadata and a broker-issued supervisor capability bound to the child's `IntercomClient`. Descendants cannot inherit a parent capability through process environment variables. Normal sessions see only the `intercom` tool.
11
+ - **User-driven orchestration:** Press `Alt+M` or run `/intercom` to pick a session and send context or instructions.
12
+ - **Agent collaboration:** Agents can list live peers, send notifications, ask questions, and exchange file or code attachments.
13
+ - **Subagent escalation:** Delegated subagents launched with supervisor coordination automatically receive a `contact_supervisor` tool scoped to their parent session. Regular sessions see only the `intercom` tool.
14
14
 
15
15
  ## Setup
16
16
 
17
17
  Atomic bundles `@bastani/intercom` with `@bastani/atomic`. No separate installation is required.
18
18
 
19
- At startup, the extension registers the `intercom` tool, `/intercom` command, `Alt+M` shortcut, and bundled `intercom` skill (`/skill:intercom`). An interactive session connects to the local broker in the background a few seconds after startup, so other sessions in its group can list and message it right away. Print (`-p`), JSON, RPC, and SDK sessions connect on first use, or when they launch a subagent with Intercom. Interactive sessions also wait for first use when `intercom` is excluded from the session's tools, or when joining at startup is off. It is off when `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` is set, or when `joinAtStartup` is `false` in config and `ATOMIC_INTERCOM_JOIN_AT_STARTUP` is not `1`. A subagent launched with Intercom connects as soon as its session starts, so sessions in its group can list and message it right away. Its group is the group of the session that launched it, unless the launch passes `group`.
19
+ At startup, the extension registers the `intercom` tool, `/intercom` command, `Alt+M` shortcut, and bundled `intercom` skill (`/skill:intercom`). An interactive session connects to the local broker in the background 3 seconds after startup so other sessions in its group can list and message it right away. Print (`-p`), JSON, RPC, and SDK sessions connect on first use, or when they launch a subagent with Intercom. Interactive sessions also wait for first use when `intercom` is excluded from the session's tools, or when startup join is disabled (`joinAtStartup: false` in config, or `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` or `false`; legacy alias `PI_INTERCOM_JOIN_AT_STARTUP`). Setting `ATOMIC_INTERCOM_JOIN_AT_STARTUP=1` or `true` forces startup join even when config sets `joinAtStartup` to `false`.
20
+
21
+ A subagent launched with Intercom connects as soon as its session starts so sessions in its group can list and message it immediately. Its group matches the launching session's group unless the launch specifies `group`.
20
22
 
21
23
  You can add this snippet to your project's `AGENTS.md` to guide when agents should coordinate across sessions:
22
24
 
@@ -30,7 +32,7 @@ Principle: use `send` for notifications and `ask` when you need an answer. `ask`
30
32
  </intercom>
31
33
  ```
32
34
 
33
- The session list, `Alt+M` picker, and group counts include connected agent sessions only. Internal control connections are hidden and cannot receive ordinary messages, even by exact session ID or through a supervisor route. An agent executing a tool or waiting for user input stays visible and messageable.
35
+ The session list, `Alt+M` picker, and group counts include connected agent sessions only. An agent executing a tool or waiting for user input stays visible and messageable.
34
36
 
35
37
  Unnamed sessions keep a runtime alias such as `subagent-chat-1a2b3c4d-1111-4222-8333-123456789abc` for name lookup. Session listings omit that generated alias and lead with the copyable full session ID while keeping user-chosen names as metadata.
36
38
 
@@ -58,7 +60,7 @@ intercom({ action: "join", group: "api-review" })
58
60
  // Discover all active groups and see which ones you belong to
59
61
  intercom({ action: "groups" })
60
62
 
61
- // Leave one membership, or omit group to reset to your startup home group
63
+ // Leave one membership, or omit group to reset to your resolved home group
62
64
  intercom({ action: "leave", group: "api-review" })
63
65
 
64
66
  // Send a message to a named session
@@ -84,15 +86,17 @@ intercom({ action: "status" })
84
86
 
85
87
  // Send with attachments (file, snippet, or context)
86
88
  intercom({
87
- action: "send",
88
- to: "worker",
89
- message: "Here is the fix:",
90
- attachments: [{
91
- type: "snippet",
92
- name: "auth.ts",
93
- language: "typescript",
94
- content: "function validate(user: User) { ... }"
95
- }]
89
+ action: "send",
90
+ to: "worker",
91
+ message: "Here is the fix:",
92
+ attachments: [
93
+ {
94
+ type: "snippet",
95
+ name: "auth.ts",
96
+ language: "typescript",
97
+ content: "function validate(user: User) { ... }",
98
+ },
99
+ ],
96
100
  })
97
101
  ```
98
102
 
@@ -101,7 +105,7 @@ intercom({
101
105
  Incoming messages appear inline in chat with the sender's details and a reply hint:
102
106
 
103
107
  ```text
104
- **From research** (~/projects/api)
108
+ **📨 From research** (~/projects/api)
105
109
 
106
110
  To reply, use the intercom tool: intercom({ action: "reply", message: "..." })
107
111
 
@@ -109,7 +113,7 @@ Found the issue. UserService.validate() does not check for null input.
109
113
  See auth.ts:142-156.
110
114
  ```
111
115
 
112
- The reply hint is enabled by default and points to `intercom({ action: "reply", ... })`, so recipients do not have to reconstruct raw sender or message IDs. Idle recipients start a new turn immediately. Busy interactive recipients receive the message once idle. Attachment contents are included in the agent-visible body, and messages are stored in Atomic session history.
116
+ The reply hint is enabled by default and points to `intercom({ action: "reply", ... })` so recipients do not have to reconstruct raw sender or message IDs. Idle recipients start a new turn immediately. How a busy recipient handles an incoming message depends on `delivery` (default `"steer"`, which arrives after current tool calls finish without cancelling work). Attachment contents are included in the agent-visible body, and messages are saved in Atomic session history.
113
117
 
114
118
  Recipients save each message to their session before the sender receives `delivered`. If a recipient closes or crashes before showing a saved message, reopening that session recovers the message in arrival order.
115
119
 
@@ -123,7 +127,7 @@ For `send` and `ask`, the `delivery` parameter controls how a busy recipient han
123
127
 
124
128
  A single-target `send` or `ask` to a subagent that completed or failed queues the message and has its launching session resume it. A message to a paused or quit subagent waits without expiring until its launching session continues it. Queued messages survive broker restarts in `ended-child-queue.sqlite`, or in the shared database when multi-node routing is active. Permanently cancelled children reject new messages.
125
129
 
126
- For delegated children, queued messages and terminal lifecycle notices stay ordered per child. Intercom drains the child's pre-terminal entries in FIFO order and admits that prelude together with the terminal notice, deduplicated by terminal identity so each child's terminal notice is admitted once.
130
+ For delegated children, queued messages and completion notices stay ordered per child, and each child's completion notice is delivered once.
127
131
 
128
132
  ## Planner-worker coordination
129
133
 
@@ -139,20 +143,20 @@ Confirm both sessions appear in `intercom({ action: "list" })`, then coordinate:
139
143
  ```typescript
140
144
  // Planner delegates with send
141
145
  intercom({
142
- action: "send",
143
- to: "worker",
144
- message: "Task-3: Add retry logic to src/api/client.ts and src/api/types.ts. Ask if anything is unclear."
146
+ action: "send",
147
+ to: "worker",
148
+ message: "Task-3: Add retry logic to src/api/client.ts and src/api/types.ts. Ask if anything is unclear.",
145
149
  })
146
150
 
147
151
  // Worker asks for clarification and keeps working if the answer is not immediate
148
152
  intercom({
149
- action: "ask",
150
- to: "planner",
151
- message: "Should retry apply to all endpoints or only idempotent ones? What max retry count and backoff should I use?"
153
+ action: "ask",
154
+ to: "planner",
155
+ message: "Should retry apply to all endpoints or only idempotent ones? What max retry count and backoff should I use?",
152
156
  })
153
157
  ```
154
158
 
155
- If the planner replies within the wait budget, the reply returns inline as the tool result. Otherwise the ask stays pending with no expiry and the answer arrives later as a message starting `"Reply to your ask <id> from planner"`.
159
+ If the planner replies within the wait budget, the reply returns inline as the tool result. Otherwise the ask stays pending with no expiry, and the answer arrives later as a message starting `"Reply to your ask <id> from planner"`.
156
160
 
157
161
  To coordinate two chat sessions privately without changing startup settings, have both call `intercom({ action: "join", group: "api-review" })`. Joining adds a membership without changing the session ID or removing existing memberships. Joined memberships survive broker reconnects and Atomic restarts; groups you leave are not rejoined. Sending to a session that is live only in another group fails with `<name> is live in group <group>; join it to send`.
158
162
 
@@ -177,44 +181,45 @@ To coordinate two chat sessions privately without changing startup settings, hav
177
181
 
178
182
  ## Subagent escalation with `contact_supervisor`
179
183
 
180
- When Atomic's subagent runtime admits a delegated child with supervisor coordination, the child receives the `contact_supervisor` tool alongside `intercom`. Normal sessions never see `contact_supervisor`.
184
+ When a [subagent](https://docs.bastani.ai/subagents) is launched with supervisor coordination, it receives the `contact_supervisor` tool alongside `intercom`. Regular sessions never see `contact_supervisor`.
181
185
 
182
- The tool is registered from the child's typed admission record, which binds the supervisor target, child identity, child index, session name, and broker-issued capability directly to the child session. In parallel runs, blocking `contact_supervisor` requests wait only in the requesting child and resume that same execution once the supervisor replies. Active and queued siblings keep running with their original identities and worktrees. Only a single child run directly by an SDK host without a task owner ends with a `[TASK_CONTEXT]` fresh-child handoff when its blocking parent ask is claimed.
186
+ In interactive and standard sessions, blocking `contact_supervisor` requests wait inside the requesting child and continue that same child once the supervisor replies. Active and queued siblings keep running with their original identities and worktrees. In custom SDK sessions without background task support, a blocking request ends the child with a `[TASK_CONTEXT]` handoff.
183
187
 
184
188
  | Reason | Behavior | Use when |
185
189
  | --- | --- | --- |
186
- | `need_decision` | Waits for a correlated reply in the same child (or returns a `[TASK_CONTEXT]` handoff for a single ownerless SDK child). | The child is blocked or faces an unapproved product, API, or scope decision. |
187
- | `interview_request` | Waits for structured JSON answers in the same child (or returns a `[TASK_CONTEXT]` handoff for a single ownerless SDK child). | The child needs multiple machine-readable answers in one exchange. |
190
+ | `need_decision` | Requires `message`. Waits for a correlated reply in the same child (or returns a `[TASK_CONTEXT]` handoff in custom SDK sessions without background task support). | The child is blocked or faces an unapproved product, API, or scope decision. |
191
+ | `interview_request` | Waits for structured JSON answers in the same child (or returns a `[TASK_CONTEXT]` handoff in custom SDK sessions without background task support). | The child needs multiple machine-readable answers in one exchange. |
188
192
  | `progress_update` | Sends a non-blocking update and returns at delivery. | A discovery changes the plan or merits an explicit update. |
189
193
 
190
194
  Do not use `contact_supervisor` for routine completion handoffs. Return the child's normal final result instead.
191
195
 
192
- Cross-group supervisor delivery uses a dedicated broker protocol. Raw `send` frames remain group-isolated and reject forged `channel: "supervisor"` markers. A child crosses groups only after its broker-issued capability binds its socket to the exact supervisor. Replies cross back only when `replyTo` matches a recorded supervisor message in the reverse direction.
196
+ Cross-group supervisor delivery is restricted strictly to the parent-child pair. Ordinary `send` calls stay group-isolated, and replies cross back only when `replyTo` matches a recorded supervisor message in the reverse direction.
193
197
 
194
198
  ```typescript
195
199
  // Blocked subagent asks for a decision
196
200
  contact_supervisor({
197
- reason: "need_decision",
198
- message: "The auth service returns 403 instead of 401 for expired tokens. Should I treat 403 as a re-auth trigger or a hard failure?"
201
+ reason: "need_decision",
202
+ message:
203
+ "The auth service returns 403 instead of 401 for expired tokens. Should I treat 403 as a re-auth trigger or a hard failure?",
199
204
  })
200
205
 
201
206
  // Structured supervisor interview
202
207
  contact_supervisor({
203
- reason: "interview_request",
204
- message: "Please answer these questions before I continue the migration.",
205
- interview: {
206
- title: "API migration choices",
207
- questions: [
208
- { id: "api", type: "single", question: "Which API should I target?", options: ["Stable API", "Experimental API"] },
209
- { id: "constraints", type: "text", question: "What constraints should I preserve?" }
210
- ]
211
- }
208
+ reason: "interview_request",
209
+ message: "Please answer these questions before I continue the migration.",
210
+ interview: {
211
+ title: "API migration choices",
212
+ questions: [
213
+ { id: "api", type: "single", question: "Which API should I target?", options: ["Stable API", "Experimental API"] },
214
+ { id: "constraints", type: "text", question: "What constraints should I preserve?" },
215
+ ],
216
+ },
212
217
  })
213
218
 
214
219
  // Non-blocking progress update
215
220
  contact_supervisor({
216
- reason: "progress_update",
217
- message: "The bug is in the retry wrapper rather than the API client."
221
+ reason: "progress_update",
222
+ message: "The bug is in the retry wrapper rather than the API client.",
218
223
  })
219
224
  ```
220
225
 
@@ -223,12 +228,13 @@ contact_supervisor({
223
228
  The supervisor sees the child identity, run metadata, and question:
224
229
 
225
230
  ```text
226
- **From subagent-worker-78f659a3-1**
231
+ **📨 From subagent-worker-78f659a3-1**
227
232
 
228
233
  Subagent needs a supervisor decision.
229
234
  Run: 78f659a3
230
235
  Agent: worker
231
236
  Child index: 0
237
+ Child intercom target: subagent-worker-78f659a3-1
232
238
 
233
239
  Which API should I use?
234
240
  ```
@@ -265,12 +271,12 @@ When the reply matches valid question IDs and options, the child tool result inc
265
271
 
266
272
  ### `contact_supervisor`
267
273
 
268
- Registered only in subagent sessions admitted with supervisor coordination.
274
+ Registered only in subagent sessions launched with supervisor coordination.
269
275
 
270
276
  | Parameter | Type | Description |
271
277
  | --- | --- | --- |
272
278
  | `reason` | string | `"need_decision"`, `"interview_request"`, or `"progress_update"`. |
273
- | `message` | string | Decision request, optional interview note, or progress update. |
279
+ | `message` | string | Decision request (required for `need_decision`), optional interview note, or progress update. |
274
280
  | `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }`. |
275
281
 
276
282
  ### Actions
@@ -278,7 +284,7 @@ Registered only in subagent sessions admitted with supervisor coordination.
278
284
  - **`list`** returns the current session and every active session sharing at least one membership. Pass `group` for a read-only view of one group.
279
285
  - **`groups`** lists every group represented by a connected session with connected counts and membership markers.
280
286
  - **`join`** adds a trimmed named membership and creates that group if empty. `default` is shared; `true` and `auto` are reserved for subagent auto-groups.
281
- - **`leave`** removes the specified `group`, or resets memberships to the startup home group when `group` is omitted.
287
+ - **`leave`** removes the specified `group`, or resets memberships to your resolved home group when `group` is omitted. Leaving your last remaining group also returns you to your resolved home group (such as `project:<owner>/<repo>` under multi-node routing, or `default` otherwise).
282
288
  - **`send`** delivers a message to one target or every live match of a pattern within your groups. A session-name glob matching multiple sessions requires `broadcast: true`; without it, nothing is sent and the error lists all matches.
283
289
  - **`ask`** sends a question to one exact target, waits according to `wait`, and keeps the ask open until answered or cancelled. Up to `maxPendingAsks` (default 6) calls may wait concurrently; further asks still deliver and receive replies as messages.
284
290
  - **`reply`** answers the active incoming message or single pending inbound ask, or an explicit `to` / `replyTo` thread.
@@ -286,11 +292,9 @@ Registered only in subagent sessions admitted with supervisor coordination.
286
292
  - **`cancel`** cancels one of your outbound asks by `askId` (any later reply appears once, marked late), or closes an inbound ask sent to you by `replyTo` without notifying its sender.
287
293
  - **`status`** reports connection status, session ID, memberships, visible session count, and the `Multi-node routing:` state (including live peer brokers in shared storage).
288
294
 
289
- Target lookup accepts an exact full Intercom session ID, an exact case-insensitive session name, a unique 8-hex UUID prefix, or a connected session's Atomic session ID when unambiguous. Workflow stage targets (`workflow:<rootRunId>/...`) were removed with workflows in Atomic 0.10.0 and return `Session not found`.
290
-
291
- A session outside your groups whose message reached you (such as through a host reach policy or supervisor exchange) can be answered directly without joining a group, up to 3 messages within 30 minutes of its latest message. Pattern sends never use this return path.
295
+ Target lookup accepts an exact full Intercom session ID, an exact case-insensitive session name, a unique 8-hex UUID prefix, or a connected session's Atomic session ID when unambiguous.
292
296
 
293
- Host registrations may set `recipientPurpose` to `"agent"` or `"control"` (omission defaults to `"agent"`). Presence updates cannot change a session's registered purpose, and control connections are excluded from discovery and ordinary delivery.
297
+ A session outside your groups whose message reached you (such as through a supervisor exchange) can be answered directly without joining a group, up to 3 messages within 30 minutes of its latest message. Pattern sends never use this return path.
294
298
 
295
299
  Only one blocking `contact_supervisor` request can wait at a time per child. One supervisor wait can coexist with peer asks, while a second concurrent supervisor wait fails with `Already waiting for a supervisor reply`.
296
300
 
@@ -317,32 +321,30 @@ Create `~/.atomic/agent/intercom/config.json`. When that file is absent and neit
317
321
 
318
322
  ```json
319
323
  {
320
- "brokerCommand": "npx",
321
- "brokerArgs": ["--no-install", "tsx"],
322
- "brokerStartupTimeoutMs": 30000,
323
324
  "confirmSend": false,
325
+ "group": "api-review",
326
+ "joinAtStartup": true,
324
327
  "maxPendingAsks": 6,
325
328
  "replyHint": true,
326
- "joinAtStartup": true,
327
329
  "status": "researching"
328
330
  }
329
331
  ```
330
332
 
331
- The default `npx --no-install tsx` pair is a compatibility sentinel. Intercom recognizes it and spawns the broker with the current Atomic runtime (`process.execPath`) without resolving `npx`, `tsx`, or `bun` on `PATH`. Installed builds run `broker/broker.bundle.mjs`, Node source checkouts run `broker/broker.ts` through Atomic's bundled `jiti` loader, Bun source checkouts run with the active Bun binary, and standalone Atomic binaries re-enter the launcher internally.
332
-
333
333
  | Setting | Default | Description |
334
334
  | --- | --- | --- |
335
- | `brokerCommand` | `"npx"` | Broker spawn command. The default sentinel uses the active Atomic runtime internally. |
336
- | `brokerArgs` | `["--no-install", "tsx"]` | Arguments passed to `brokerCommand` before the broker script path. |
337
- | `brokerStartupTimeoutMs` | `30000` | Maximum milliseconds a session waits for a newly spawned broker to answer on its socket (minimum `1000`). Raise this if slow source-checkout starts time out. |
338
335
  | `confirmSend` | `false` | Prompt for interactive confirmation before non-reply sends. |
336
+ | `group` | none | Optional default home group. `ATOMIC_INTERCOM_GROUP` (or legacy `PI_INTERCOM_GROUP`) overrides it. |
337
+ | `joinAtStartup` | `true` | Connect interactive sessions in the background 3 seconds after startup. `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` or `false` disables startup join; `1` or `true` forces it on (legacy `PI_INTERCOM_JOIN_AT_STARTUP`). |
339
338
  | `maxPendingAsks` | `6` | Maximum concurrent waiting asks per session (minimum `1`). |
340
339
  | `replyHint` | `true` | Include the `intercom({ action: "reply", ... })` hint in incoming messages. |
341
340
  | `status` | none | Optional status suffix appended after automatic lifecycle states (`idle`, `thinking`, `tool:<name>`). |
342
- | `group` | none | Optional default home group. `ATOMIC_INTERCOM_GROUP` (or legacy `PI_INTERCOM_GROUP`) overrides it. |
343
- | `joinAtStartup` | `true` | Connect interactive sessions in the background at startup. `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` disables startup join, and `ATOMIC_INTERCOM_JOIN_AT_STARTUP=1` forces startup join even when config sets `joinAtStartup` to `false`. |
341
+ | `brokerStartupTimeoutMs` | `30000` | Maximum milliseconds a session waits for a newly spawned broker to answer on its socket (minimum `1000`). Raise this if slow source-checkout starts time out. |
342
+ | `brokerCommand` | `"npx"` | Advanced override for the broker spawn command. By default Atomic spawns the broker with its own runtime without invoking `npx` or `tsx` from `PATH`. |
343
+ | `brokerArgs` | `["--no-install", "tsx"]` | Arguments passed to a custom `brokerCommand` before the broker script path. |
344
+
345
+ ### Custom broker runtime
344
346
 
345
- Custom broker commands remain supported. To launch the broker explicitly with Bun from `PATH`:
347
+ To launch the broker explicitly with a custom runtime such as Bun from `PATH`, override `brokerCommand` and `brokerArgs`:
346
348
 
347
349
  ```json
348
350
  {
@@ -377,67 +379,36 @@ graph TB
377
379
  B2 <-->|Local Socket/Pipe| B3
378
380
  ```
379
381
 
380
- The broker is a standalone process that manages session registration and message routing over length-prefixed JSON frames (4-byte length header plus JSON payload) on a Unix domain socket (macOS and Linux) or named pipe (Windows). When shared storage is configured through `@bastani/atomic-storage-libsql` or `@bastani/atomic-storage-postgres`, brokers also enable multi-node routing so sessions on different machines can list and message each other, and ungrouped sessions default to their repository's `project:<owner>/<repo>` group instead of `default`.
382
+ The broker is a standalone process that manages session registration and message routing over length-prefixed JSON frames on a Unix domain socket (macOS and Linux) or named pipe (Windows). When [shared storage](https://docs.bastani.ai/storage) is configured through [`@bastani/atomic-storage-libsql`](https://docs.bastani.ai/libraries/storage-libsql) or [`@bastani/atomic-storage-postgres`](https://docs.bastani.ai/libraries/storage-postgres), brokers also enable multi-node routing so sessions on different machines can list and message each other, and ungrouped sessions default to their repository's `project:<owner>/<repo>` group instead of `default`.
381
383
 
382
384
  ### Broker lifecycle and recovery
383
385
 
384
- - **Auto-spawn and idle exit.** The broker starts automatically when needed and exits after 5 seconds with no registered sessions. A spawn lock prevents duplicate brokers when multiple sessions connect concurrently.
385
- - **Reconnects.** Clients reconnect automatically with bounded backoff (1s, 2s, 5s, 10s, then 30s) if the broker restarts or retires.
386
- - **Watchdog.** A broker-owned watchdog probes its local request path independently of the main thread and exits its own process after roughly one minute without a valid response so clients spawn a healthy replacement.
387
- - **Internal delivery retries.** Each `send`, `ask`, or `reply` call retries recoverable disconnects internally up to 3 times (after 1, 2, and 5 seconds) with the same message ID, arguments, attachments, and reply route, within an 11-minute deadline. Caller-supplied `retryToken` parameters are rejected without sending. If recovery cannot confirm the outcome, the tool returns a terminal error with `outcome: "unknown"` so callers check with the recipient rather than duplicating automatically.
388
- - **Durable delivery authority.** Accepted operations are recorded for 12 minutes in `delivered-messages.sqlite` as keyed SHA-256 HMAC digests paired with `delivered-messages.key` (never plaintext bodies or attachments). On POSIX, the Intercom directory is set to `0700` and database and key files to `0600`. Capacity limits are bounded at 1,000 client identity slots, 10,000 live broker authority records, and 64 MiB of broker authority storage; limits fail closed instead of evicting live authority.
389
- - **Mixed-version compatibility.** The protocol range supports Atomic 0.9.x sessions alongside 0.10.x sessions on the same broker. Legacy 0.9.x workflow frames receive compatible responses without closing the connection, while `workflow:` targets return `Session not found`.
390
- - **Session teardown safety.** Async startup, reconnect, overlay, and relay tasks become no-ops if the session shuts down or reloads before they settle.
386
+ - **Auto-spawn and idle exit:** The broker starts automatically when needed and exits after 5 seconds with no registered sessions. A spawn lock prevents duplicate brokers when multiple sessions connect concurrently.
387
+ - **Reconnects:** Clients reconnect automatically with bounded backoff (1s, 2s, 5s, 10s, then 30s) if the broker restarts or retires.
388
+ - **Watchdog:** A broker-owned watchdog probes its local request path independently and exits after roughly one minute without a valid response so clients spawn a healthy replacement.
389
+ - **Internal delivery retries:** Each `send`, `ask`, or `reply` call retries recoverable disconnects internally up to 3 times (after 1, 2, and 5 seconds) with the same operation identity within an 11-minute deadline. If recovery cannot confirm the outcome, the tool returns an error with `outcome: "unknown"` so callers check with the recipient instead of duplicating automatically.
390
+ - **Durable delivery deduplication:** Accepted operations are recorded for 12 minutes in `delivered-messages.sqlite` as keyed SHA-256 HMAC digests paired with `delivered-messages.key` (never plaintext bodies or attachments). On POSIX, the Intercom directory is `0700` and database and key files are `0600`. Storage is capped at 1,000 client identity slots, 10,000 live records, and 64 MiB; once a cap is reached, new requests return an error instead of evicting existing delivery records.
391
+ - **Session teardown safety:** Async startup, reconnect, overlay, and relay tasks stop safely if the session shuts down or reloads before they finish.
391
392
 
392
393
  ### Runtime files
393
394
 
394
- Runtime files live in `~/.atomic/agent/intercom/`. Setting `ATOMIC_CODING_AGENT_DIR` (or legacy `PI_CODING_AGENT_DIR` when unset) relocates this directory.
395
-
396
- - `broker.sock` holds the Unix domain socket on macOS and Linux (Windows uses a named pipe). If the path exceeds the Unix socket path limit (107 bytes on Linux, 103 bytes on macOS), the broker creates an owner-only `atomic-intercom-<uid>/<digest>.sock` socket under `$XDG_RUNTIME_DIR` or the system temp directory.
397
- - `broker.sock.path` records the moved socket path when `broker.sock` would exceed the platform limit.
398
- - `broker.pid` stores the broker process ID.
399
- - `broker.starting` records a starting broker's PID until it begins listening.
400
- - `broker.spawn.lock` coordinates concurrent broker spawns with a 60-second backstop.
401
- - `broker.sock.replace.lock` serializes stale socket replacement during broker startup.
402
- - `broker.log` captures broker stderr, capped internally at 8 KiB by `broker/bounded-stderr-install.ts`.
403
- - `broker.log.previous` keeps the bounded tail of the previous nonempty broker log.
404
- - `broker-watchdog.log` records the latest watchdog termination.
405
- - `delivered-messages.sqlite` and `delivered-messages.key` store durable delivery deduplication digests and their owner-only HMAC key.
406
- - `away-asks.sqlite` stores open asks and replies held for away sessions, and, with multi-node routing, the sessions a broker moved back to their earlier Intercom ID until they register again (at most about 7 days).
407
- - `ended-child-queue.sqlite` stores queued messages waiting to resume or reach finished and paused subagents across broker restarts.
395
+ Runtime files live in `~/.atomic/agent/intercom/`. Setting [`ATOMIC_CODING_AGENT_DIR`](https://docs.bastani.ai/environment-variables) (or legacy `PI_CODING_AGENT_DIR` when unset) relocates this directory.
396
+
397
+ - `broker.sock` holds the Unix domain socket on macOS and Linux (Windows uses a named pipe). If the path exceeds the platform Unix socket limit (107 bytes on Linux, 103 bytes on macOS), the broker creates an owner-only `atomic-intercom-<uid>/<digest>.sock` socket under `$XDG_RUNTIME_DIR` or the system temp directory and records its path in `broker.sock.path`.
398
+ - `broker.pid`, `broker.starting`, `broker.spawn.lock`, and `broker.sock.replace.lock` coordinate broker startup and lock ownership.
399
+ - `broker.log` (capped at 8 KiB), `broker.log.previous`, and `broker-watchdog.log` store diagnostic logs.
400
+ - `delivered-messages.sqlite` and `delivered-messages.key` store delivery deduplication digests and their owner-only HMAC key.
401
+ - `away-asks.sqlite` stores open asks and replies held for away sessions (retained up to about 7 days).
402
+ - `ended-child-queue.sqlite` stores queued messages waiting to reach finished and paused subagents across broker restarts.
408
403
  - `config.json` stores user configuration.
409
404
 
410
- ## Package layout
405
+ ## Limitations
411
406
 
412
- ```text
413
- packages/intercom/
414
- ├── package.json
415
- ├── index.ts # Lazy extension entry point
416
- ├── index-heavy.ts # Runtime wiring and session lifecycle
417
- ├── intercom-tool.ts # intercom tool implementation
418
- ├── contact-supervisor-tool.ts # Subagent-only contact_supervisor tool
419
- ├── config.ts # Config loading and validation
420
- ├── types.ts # Protocol and session types
421
- ├── broker/
422
- │ ├── broker.ts # Broker process entry point
423
- │ ├── client.ts # IntercomClient socket client
424
- │ ├── framing.ts # Length-prefixed JSON framing
425
- │ ├── paths.ts # Platform socket, pipe, and state paths
426
- │ ├── spawn.ts # Auto-spawn and lock coordination
427
- │ ├── multinode-router.ts # Cross-machine routing over shared storage
428
- │ └── watchdog.ts # Broker liveness watchdog
429
- ├── ui/
430
- │ ├── session-list.ts # Session picker overlay
431
- │ ├── compose.ts # Message composition overlay
432
- │ └── inline-message.ts # Inline received message renderer
433
- └── skills/
434
- └── intercom/
435
- └── SKILL.md # Bundled /skill:intercom guide
436
- ```
407
+ - **Local IPC by default:** Without [shared storage](https://docs.bastani.ai/storage), Intercom connects sessions on the same machine only. Cross-machine messaging requires configuring a shared storage adapter ([`@bastani/atomic-storage-libsql`](https://docs.bastani.ai/libraries/storage-libsql) or [`@bastani/atomic-storage-postgres`](https://docs.bastani.ai/libraries/storage-postgres)).
408
+ - **No separate transcript file:** Messages are stored in Atomic session history rather than a dedicated Intercom inbox file.
409
+ - **No attachments UI:** The `intercom` tool supports `file`, `snippet`, and `context` attachments, while the `Alt+M` compose overlay sends plain text only.
410
+ - **Connected sessions only:** `intercom list` shows sessions currently registered with the broker, not disconnected or offline Atomic processes.
437
411
 
438
- ## Limitations
412
+ ## License
439
413
 
440
- - **Local IPC by default.** Without shared storage, Intercom connects sessions on the same machine only. Cross-machine messaging requires configuring a shared storage adapter (`@bastani/atomic-storage-libsql` or `@bastani/atomic-storage-postgres`).
441
- - **No separate transcript file.** Messages are stored in Atomic session history rather than a dedicated Intercom inbox file.
442
- - **No attachments UI.** The `intercom` tool supports `file`, `snippet`, and `context` attachments, while the `Alt+M` compose overlay sends plain text only.
443
- - **Connected sessions only.** `intercom list` shows sessions currently registered with the broker, not disconnected or offline Atomic processes.
414
+ MIT. See [LICENSE](LICENSE).
@@ -62,10 +62,10 @@ function addGroup(groups, value) {
62
62
  next.add(validateRuntimeGroup(value));
63
63
  return next;
64
64
  }
65
- function removeGroup(groups, value) {
65
+ function removeGroup(groups, value, fallback) {
66
66
  const next = normalizeGroups(groups);
67
67
  next.delete(normalizeGroup(value));
68
- return normalizeGroups(next);
68
+ return next.size > 0 ? next : normalizeGroups(undefined, fallback);
69
69
  }
70
70
  function hasGroup(groups, value) {
71
71
  return normalizeGroups(groups).has(normalizeGroup(value));
@@ -15869,7 +15869,7 @@ function handleBrokerPresence(socket, clientMessage, currentId, sessions, write,
15869
15869
  if (typeof clientMessage.group !== "string")
15870
15870
  return void fail("Invalid presence group");
15871
15871
  const group = validateRuntimeGroup(clientMessage.group);
15872
- nextGroups = removeGroup(previousGroups, group);
15872
+ nextGroups = removeGroup(previousGroups, group, session.registrationGroup);
15873
15873
  if (legacyGroup === group)
15874
15874
  legacyGroup = undefined;
15875
15875
  }
@@ -127,7 +127,7 @@ export function handleBrokerPresence(
127
127
  } else {
128
128
  if (typeof clientMessage.group !== "string") return void fail("Invalid presence group");
129
129
  const group = validateRuntimeGroup(clientMessage.group);
130
- nextGroups = removeGroup(previousGroups, group);
130
+ nextGroups = removeGroup(previousGroups, group, session.registrationGroup);
131
131
  if (legacyGroup === group) legacyGroup = undefined;
132
132
  }
133
133
  } else {
@@ -74,11 +74,15 @@ export function addGroup(groups: GroupMemberships, value: unknown): Set<string>
74
74
  return next;
75
75
  }
76
76
 
77
- /** Remove one normalized group while retaining default membership when none remain. */
78
- export function removeGroup(groups: GroupMemberships, value?: string | null): Set<string> {
77
+ /** Remove one normalized group while retaining the fallback (or default) membership when none remain. */
78
+ export function removeGroup(
79
+ groups: GroupMemberships,
80
+ value?: string | null,
81
+ fallback?: string | null,
82
+ ): Set<string> {
79
83
  const next = normalizeGroups(groups);
80
84
  next.delete(normalizeGroup(value));
81
- return normalizeGroups(next);
85
+ return next.size > 0 ? next : normalizeGroups(undefined, fallback);
82
86
  }
83
87
 
84
88
  /** Test a normalized group membership. */
@@ -7,7 +7,7 @@ import * as __atomicHostImport1 from "@bastani/atomic-ai";
7
7
  if (!(name in namespace)) missing.push(`The requested module '${specifier}' does not provide an export named '${name}'`);
8
8
  if (missing.length > 0) {
9
9
  const application = typeof __atomicHostImport0.APP_NAME === "string" ? __atomicHostImport0.APP_NAME : "atomic";
10
- if (__atomicHostImport0.VERSION !== "0.10.9") missing.unshift(application + " was updated to 0.10.9 while this session was running; restart it to keep using the intercom extension.");
10
+ if (__atomicHostImport0.VERSION !== "0.10.10-alpha.2") missing.unshift(application + " was updated to 0.10.10-alpha.2 while this session was running; restart it to keep using the intercom extension.");
11
11
  throw new Error(missing.join("\n"));
12
12
  }
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.10.9",
3
+ "version": "0.10.10-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for direct messaging and coordination between parent, child, and peer agent sessions.",
6
6
  "contributors": [