@bastani/atomic 0.10.9 → 0.10.10-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +211 -155
  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} +145 -58
  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 +85 -114
  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 +37 -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 +71 -138
  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 +60 -87
  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 +235 -243
  297. package/docs/build.md +12 -11
  298. package/docs/codemode.md +60 -51
  299. package/docs/compaction/reference.md +61 -24
  300. package/docs/compaction.md +117 -65
  301. package/docs/computer-use.md +179 -146
  302. package/docs/containerization.md +79 -33
  303. package/docs/custom-provider/api-reference.md +148 -11
  304. package/docs/custom-provider/oauth.md +44 -27
  305. package/docs/custom-provider/override.md +14 -7
  306. package/docs/custom-provider/registration.md +75 -65
  307. package/docs/custom-provider/streaming.md +42 -19
  308. package/docs/custom-provider.md +25 -61
  309. package/docs/development.md +47 -43
  310. package/docs/docs.json +33 -33
  311. package/docs/environment-variables.md +83 -57
  312. package/docs/extensions/api-reference.md +323 -734
  313. package/docs/extensions/authoring.md +186 -269
  314. package/docs/extensions/events.md +308 -375
  315. package/docs/extensions/examples.md +122 -74
  316. package/docs/extensions/ui.md +217 -197
  317. package/docs/extensions.md +152 -259
  318. package/docs/getting-started/authentication.md +27 -14
  319. package/docs/getting-started/first-session.md +25 -26
  320. package/docs/getting-started/installation.md +62 -84
  321. package/docs/getting-started/project-instructions.md +39 -14
  322. package/docs/guides/configuration.md +42 -20
  323. package/docs/guides/intercom.md +17 -13
  324. package/docs/guides/non-interactive.md +29 -16
  325. package/docs/guides/orchestration.md +16 -10
  326. package/docs/guides/resume-on-any-machine.md +54 -49
  327. package/docs/guides/subagents.md +22 -14
  328. package/docs/guides/team-setup.md +37 -26
  329. package/docs/guides.md +22 -21
  330. package/docs/herdr.md +21 -16
  331. package/docs/index.md +16 -17
  332. package/docs/intercom/operations.md +68 -66
  333. package/docs/intercom/reference.md +196 -191
  334. package/docs/intercom.md +103 -92
  335. package/docs/json.md +71 -71
  336. package/docs/keybindings.md +63 -50
  337. package/docs/libraries/agent-core.md +49 -8
  338. package/docs/libraries/ai.md +21 -12
  339. package/docs/libraries/codemode.md +28 -6
  340. package/docs/libraries/schema.md +7 -7
  341. package/docs/libraries/telemetry.md +7 -7
  342. package/docs/libraries/tui.md +74 -94
  343. package/docs/libraries.md +5 -5
  344. package/docs/llama-cpp.md +38 -33
  345. package/docs/mcp-servers.md +96 -90
  346. package/docs/models/reference.md +46 -33
  347. package/docs/models-configuration.md +12 -6
  348. package/docs/models.md +93 -88
  349. package/docs/orchestration/migrating-workflows.md +21 -19
  350. package/docs/orchestration/patterns.md +35 -20
  351. package/docs/orchestration.md +22 -21
  352. package/docs/packages/authoring.md +28 -19
  353. package/docs/packages/reference.md +75 -16
  354. package/docs/packages.md +31 -33
  355. package/docs/programmatic.md +22 -21
  356. package/docs/prompt-templates.md +63 -41
  357. package/docs/providers/reference.md +35 -19
  358. package/docs/providers.md +61 -71
  359. package/docs/quickstart.md +32 -46
  360. package/docs/reference/cli.md +249 -252
  361. package/docs/reference.md +23 -20
  362. package/docs/rpc/examples.md +74 -17
  363. package/docs/rpc/extension-ui.md +79 -62
  364. package/docs/rpc/protocol.md +816 -358
  365. package/docs/rpc.md +75 -151
  366. package/docs/sdk/reference.md +175 -45
  367. package/docs/sdk/structured-decisions.md +92 -62
  368. package/docs/sdk/web-server.md +79 -46
  369. package/docs/sdk.md +237 -195
  370. package/docs/security.md +106 -43
  371. package/docs/session-format.md +96 -59
  372. package/docs/sessions.md +149 -113
  373. package/docs/settings.md +289 -204
  374. package/docs/shell-aliases.md +15 -6
  375. package/docs/skills/authoring.md +17 -9
  376. package/docs/skills/reference.md +23 -21
  377. package/docs/skills.md +104 -97
  378. package/docs/storage.md +140 -242
  379. package/docs/subagents/authoring.md +147 -16
  380. package/docs/subagents/reference.md +100 -30
  381. package/docs/subagents.md +220 -252
  382. package/docs/terminal-setup.md +97 -69
  383. package/docs/termux.md +51 -85
  384. package/docs/themes/reference.md +51 -37
  385. package/docs/themes.md +49 -54
  386. package/docs/tmux.md +38 -21
  387. package/docs/tools.md +198 -147
  388. package/docs/tui/reference.md +64 -32
  389. package/docs/tui.md +38 -66
  390. package/docs/usage.md +76 -78
  391. package/docs/verification.md +25 -25
  392. package/docs/web-access.md +72 -55
  393. package/docs/windows.md +53 -58
  394. package/docs/worktree-snapshots.md +62 -65
  395. package/package.json +8 -8
  396. package/schemas/models.schema.json +51 -0
  397. package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
  398. package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
  399. package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
  400. package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
  401. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
package/docs/intercom.md CHANGED
@@ -1,33 +1,32 @@
1
1
  ---
2
- title: "Intercom"
3
- description: "Direct and broadcast messaging between Atomic sessions, on one machine or across machines that share storage"
2
+ title: "Coordinate sessions with Intercom"
3
+ sidebarTitle: "Intercom guide"
4
+ description: "Send messages, ask non-blocking questions, and escalate subagent decisions between Atomic sessions."
4
5
  ---
5
6
 
6
- # Intercom
7
+ Intercom provides direct and broadcast messaging between Atomic sessions on the same machine, or across multiple machines that share a storage database. You can send context, findings, or requests yourself, or let agents coordinate directly. No separate install is required.
7
8
 
8
- Atomic bundles `@bastani/intercom` for direct and broadcast messaging between sessions on the same machine, or across several machines that share a storage database. You can send context, findings, or requests yourself, or let agents coordinate directly. No separate install is required.
9
+ The `/intercom` command, `Alt+M` shortcut, and `intercom` tool are available as soon as Atomic starts. An interactive session joins Intercom automatically in the background 3 seconds after startup, so other sessions in its group can list and message it before it uses Intercom itself. Startup never waits for this connection.
9
10
 
10
- The extension registers commands and tools at startup. An interactive session joins Intercom in the background a few seconds after it starts, so other sessions in its group can list and message it before it uses Intercom itself. Starting the session does not wait for this connection.
11
-
12
- Print (`-p`), JSON, RPC, and SDK sessions join when you or the model first use Intercom, or when they launch a subagent with Intercom. Interactive sessions do the same when startup join is off, either because `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` is set or because `joinAtStartup` is `false` in Intercom's [configuration](/intercom/reference#configuration) without `ATOMIC_INTERCOM_JOIN_AT_STARTUP=1`. A subagent launched with Intercom joins as soon as its session starts and inherits the launching session's group unless the launch sets `group`.
11
+ Print (`-p`), JSON, RPC, and SDK sessions connect on first Intercom use or when they launch a subagent with Intercom. Interactive sessions do the same when startup join is disabled (`ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` or `false`, legacy alias `PI_INTERCOM_JOIN_AT_STARTUP`, or `joinAtStartup: false` in [Intercom configuration](/intercom/reference#configuration) without `ATOMIC_INTERCOM_JOIN_AT_STARTUP=1` or `true`; unrecognized environment values are ignored). A subagent launched with Intercom connects as soon as its session starts and inherits the launching session's group unless the launch sets `group`.
13
12
 
14
13
  **Key capabilities:**
15
14
 
16
15
  - **Session messaging.** Call `send`, `ask`, `reply`, `pending`, `cancel`, `list`, `groups`, and `status` through the `intercom` tool. Calls to `ask` never block; late replies arrive as messages.
17
- - **Runtime groups.** Add or remove named memberships without restarting. Joined sessions keep their broker IDs, and later subagents inherit the most recently joined membership.
18
- - **Session and group discovery.** List connected sessions or every available group with session counts and membership markers.
19
- - **Host-set reach.** An SDK host can assign a session a home group and reachable groups, enforced by the broker ([Reach policies](/intercom/reference#reach-policies)).
20
- - **Keyboard overlay.** Press ALT+M or run `/intercom` to pick a session and compose a message.
16
+ - **Runtime groups.** Add or remove named memberships without restarting. Joined sessions keep their Intercom session IDs, and later subagents inherit the most recently joined membership.
17
+ - **Session and group discovery.** List connected sessions or every active group with session counts and membership markers.
18
+ - **Keyboard overlay.** Press `Alt+M` or run `/intercom` to pick a session and compose a message.
21
19
  - **Attachments.** Share `file`, `snippet`, and `context` payloads between sessions.
22
- - **Subagent escalation.** Delegated children receive a `contact_supervisor` tool for decisions, structured interviews, and progress updates.
23
- - **Run notifications.** Subagents deliver run results and control notices to their parent session over Intercom.
20
+ - **Subagent escalation.** Subagents receive `contact_supervisor` for decisions, structured interviews, and progress updates.
21
+ - **Run notifications.** Subagents deliver run results and activity notices to their launching session over Intercom.
24
22
  - **Bundled skill.** Run `/skill:intercom` for planner-worker, group, broadcast, and escalation patterns.
23
+ - **Programmatic reach policies.** Embedded SDK hosts can constrain a session's reachable groups via [Reach policies](/intercom/reference#reach-policies).
25
24
 
26
- **Example use cases:**
25
+ **Common use cases:**
27
26
 
28
27
  - Planner and worker splits across two terminals.
29
- - Research to implementation context handoffs.
30
- - Supervisor decisions and structured interviews for delegated subagents.
28
+ - Research-to-implementation context handoffs.
29
+ - Supervisor decisions and structured interviews for subagents.
31
30
  - Peer-to-peer coordination across parallel subagents.
32
31
  - Pair debugging between sessions.
33
32
 
@@ -35,19 +34,19 @@ Print (`-p`), JSON, RPC, and SDK sessions join when you or the model first use I
35
34
 
36
35
  Read this page for the quick start, coordination patterns, and supervisor escalation. Then continue to:
37
36
 
38
- - [Intercom operations](/intercom/operations) for connection states, delivery behavior, notifications, shortcuts, and recovery.
37
+ - [Operate Intercom](/intercom/operations) for connection lifecycles, delivery recovery, broker upgrades, and troubleshooting.
39
38
  - [Running Intercom across machines](/intercom/operations#running-intercom-across-machines) for multi-machine messaging through shared storage.
40
- - [Intercom reference](/intercom/reference) for the `intercom` tool contract, error classes, and every Intercom setting.
39
+ - [Intercom reference](/intercom/reference) for the `intercom` tool contract, targeting rules, error classes, and every Intercom setting.
41
40
 
42
41
  ## Quick start
43
42
 
44
43
  ### From the keyboard
45
44
 
46
- Press **ALT+M** or run `/intercom` to open the session list overlay:
45
+ Press **`Alt+M`** or run `/intercom` to open the session list overlay (`Alt+M` is bound by the Intercom extension rather than `keybindings.json`; `/intercom` always works as a fallback):
47
46
 
48
47
  1. **Select a session.** Use arrow keys to choose a target session.
49
48
  2. **Compose a message.** Type your message in the compose overlay.
50
- 3. **Send.** Press Enter to send or Escape to cancel.
49
+ 3. **Send.** Press `Enter` to send or `Esc` to cancel.
51
50
 
52
51
  Sent messages are recorded in session history and confirmed with a notification.
53
52
 
@@ -119,31 +118,31 @@ Found the issue: UserService.validate() does not check for null input.
119
118
  See auth.ts:142-156.
120
119
  ```
121
120
 
122
- The reply hint is enabled by default and points to `intercom({ action: "reply", ... })`, so recipients rarely need raw sender or `replyTo` IDs. Idle recipients start a new turn immediately; busy interactive recipients receive the message when they go idle. Attachment content is included in the model-visible body, and messages are stored in Atomic session history.
121
+ The reply hint is enabled by default and points to `intercom({ action: "reply", ... })`, so recipients rarely need raw sender or `replyTo` IDs. Idle recipients start a new turn immediately; busy interactive main sessions receive incoming messages when they become idle. Attachment content is included in the model-visible body, and messages are stored in Atomic session history.
123
122
 
124
123
  The recipient saves each message to its session as soon as it arrives, and the sender sees `delivered` only after that save succeeds. If the recipient closes or crashes before showing a saved message, resuming it with `atomic --session <id>` or `/resume` replays unread messages once in arrival order when the sender is still connected.
125
124
 
126
- Messages from a sender that is gone are recorded once in full without starting a turn. Messages whose sender cannot be checked yet, such as when Intercom is unreachable or a relaunched subagent has not reconnected, are deferred until the next reopen. Sessions started with `--no-session` are not saved, so their unread messages cannot be recovered.
125
+ Messages from a sender that is gone are recorded once in full without starting a turn. Messages whose sender cannot be checked yet (such as when Intercom is unreachable or a relaunched subagent has not reconnected) are deferred until the next reopen. Sessions started with `--no-session` are not saved, so their unread messages cannot be recovered.
127
126
 
128
- Working subagents handle incoming `send` and `ask` messages in the same task and session according to the sender's `delivery` option:
127
+ Working subagents act on incoming `send` and `ask` messages in the same task and session according to the sender's case-sensitive `delivery` option (busy interactive main sessions wait until idle regardless of `delivery`):
129
128
 
130
- | `delivery` | When a busy recipient gets it | Use it for |
129
+ | `delivery` | When a working subagent receives it | Use it for |
131
130
  | --- | --- | --- |
132
131
  | `"steer"` (default) | After its current tool calls finish. Current work is not cancelled. | Ordinary coordination, findings, and updates |
133
- | `"followUp"` | After the recipient finishes and stops. | Low-priority notes or follow-up tasks |
132
+ | `"followUp"` | After the subagent finishes and stops. | Low-priority notes or follow-up tasks |
134
133
  | `"interrupt"` | Immediately. Current model call or cancellable tool call is cancelled, then the message runs next. | Urgent corrections or stop orders |
135
134
 
136
- Any sender can set `delivery` per message, including peers, the supervisor, and you. An idle recipient starts a turn for any mode. For example, `intercom({ action: "send", to: "worker", message: "Stop; the spec changed", delivery: "interrupt" })` cancels the worker's current tool call. Tools that ignore cancellation finish first, and completed side effects are not undone.
135
+ Any sender can set `delivery` per `send` or `ask` call, including peers, the supervisor, and you. An idle recipient starts a turn for any mode. For example, `intercom({ action: "send", to: "worker", message: "Stop; the spec changed", delivery: "interrupt" })` cancels the worker's current tool call. Tools that ignore cancellation finish first, and completed side effects are not undone.
137
136
 
138
- Messages from one sender always reach the recipient in arrival order, whether admitted immediately, queued for idle, or replayed on resume. Startup messages join the original subagent task, and asks keep their reply threads. Subagent `pause` and `quit`, owner cancellation, host stop, and permanently cancelled children take precedence over later messages.
137
+ Messages from one sender always reach the recipient in arrival order, whether delivered immediately, queued for idle, or replayed on resume. Startup messages join the original subagent task, and asks keep their reply threads. Subagent `pause` and `quit`, session cancellation, host stop, and permanently cancelled subagents take precedence over later messages.
139
138
 
140
139
  Sending or asking a subagent that completed or failed resumes it automatically. The call returns at once with the message queued, the launching session resumes the subagent, and the subagent receives the message first. A paused or quit subagent is not resumed automatically; its messages wait with no time limit until the launching session continues it.
141
140
 
142
141
  Queued messages survive broker restarts and deliver once in order. If delivery becomes impossible because the subagent was cancelled, the launching session ended, or the launching session stayed away for 7 days in a row, the sender gets one delivery failure. See [Messages that resume a finished subagent](/intercom/reference#messages-that-resume-a-finished-subagent).
143
142
 
144
- A busy non-interactive recipient that is not an admitted subagent can refuse a message without interrupting its work. A `delivered` receipt means the recipient saved the message, not that its model accepted it. Refusals keep the reply thread: an `ask` receives a failed-ask message (or an inline error while waiting), and a `send` delivers an **Intercom delivery failed** notice with a `Sent:` timestamp without triggering a standalone turn.
143
+ A busy non-interactive recipient other than a running subagent can refuse a message without interrupting its work. A `delivered` receipt means the recipient saved the message, not that its model accepted it. Refusals keep the reply thread: an `ask` receives a failed-ask message (or an inline error while waiting), and a `send` delivers an **Intercom delivery failed** notice with a `Sent:` timestamp without triggering a standalone turn.
145
144
 
146
- Atomic enables `intercom` by default, subject to tool allowlists, exclusions, and `noTools: "all"`. Include `"intercom"` in an explicit allowlist when you need it. An interactive session whose tool selection omits `intercom` does not join at startup. SDK hosts can disable the package completely with `builtins: { intercom: false }`, and reload does not restore it. `contact_supervisor` remains subagent-only.
145
+ Atomic enables `intercom` by default, subject to tool allowlists, exclusions, and `noTools: "all"`. Include `"intercom"` in an explicit allowlist when you need it. An interactive session whose tool selection omits `intercom` does not join at startup. Print, JSON, RPC, and SDK sessions with `builtins: { intercom: false }` disable Intercom completely, and `/reload` does not restore it. `contact_supervisor` remains subagent-only.
147
146
 
148
147
  ## Coordination patterns
149
148
 
@@ -179,7 +178,7 @@ intercom({
179
178
  | Pattern | Action | Why |
180
179
  | --- | --- | --- |
181
180
  | **Task delegation** | Planner uses `send` | Fire-and-forget. Planner does not need to wait for an answer. |
182
- | **Clarification request** | Worker uses `ask` | Worker needs an answer to proceed. It keeps working on unblocked tasks until the reply arrives. |
181
+ | **Clarification request** | Worker uses `ask` | Worker needs an answer to proceed and keeps working on unblocked tasks until the reply arrives. |
183
182
  | **Discovery escalation** | Worker uses `ask` | Worker requests approval before changing direction. |
184
183
  | **Completion report** | Worker uses `ask` | Planner may have follow-up instructions or the next task. |
185
184
  | **Peer handoff** | Sibling uses `send` | A researcher or debugger passes file paths, evidence, or a reproduction straight to the sibling that needs it. |
@@ -207,33 +206,27 @@ Coordinate with other local Atomic sessions on related codebases. Use `/skill:in
207
206
  </intercom>
208
207
  ```
209
208
 
210
- ## Subagent escalation: contact_supervisor
211
-
212
- When Atomic's [subagent runtime](/subagents) launches a delegated child with supervisor coordination enabled, that child receives the subagent-only `contact_supervisor` tool alongside `intercom`. Normal sessions never see `contact_supervisor`.
209
+ ## Escalate subagent decisions with `contact_supervisor`
213
210
 
214
- ### When the tool appears
211
+ By default (`intercomBridge.mode: "always"` in `~/.atomic/agent/extensions/subagent/config.json`), every subagent launched by a session with Intercom active receives the subagent-only `contact_supervisor` tool alongside `intercom`. Atomic wires up the supervisor target automatically with no manual configuration. Normal sessions never see `contact_supervisor`.
215
212
 
216
- `contact_supervisor` appears only in a delegated child whose parent granted supervisor coordination. Otherwise the child receives only `intercom`. Supervisor identity is injected by the runtime, not environment variables.
213
+ Setting `intercomBridge.mode` to `"off"` (or `"fork-only"` for fresh subagents) limits `contact_supervisor` to agents that explicitly include it in their frontmatter tools list.
217
214
 
218
- In normal task-host runs, both single-child and parallel launches run in the background. A `contact_supervisor` request waits in the requesting child and continues in that same child when the supervisor replies, while an `intercom` `ask` returns at delivery and delivers its reply later as a message.
219
-
220
- A parent's `subagent({ action: "wait" })` call may yield so the parent can reply without cancelling active or queued siblings. Sends and progress updates never block. Only a direct single-child launch in an SDK session without a task host ends with a `[TASK_CONTEXT]` fresh-child handoff when its blocking parent request is claimed.
215
+ ### Parameters and reasons
221
216
 
222
217
  | Parameter | Type | Description |
223
218
  | --- | --- | --- |
224
- | `reason` | string | `"need_decision"` (blocking), `"interview_request"` (blocking structured questions), or `"progress_update"` (fire-and-forget) |
225
- | `message` | string | The decision request, optional interview note, or progress update |
226
- | `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }` |
227
-
228
- ### The three reasons
219
+ | `reason` | string | `"need_decision"` (blocking), `"interview_request"` (blocking structured questions), or `"progress_update"` (fire-and-forget). |
220
+ | `message` | string | Required for `progress_update`; strongly recommended for `need_decision` (an omitted `message` sends an empty question); optional note for `interview_request`. |
221
+ | `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }`. |
229
222
 
230
223
  | Reason | Behavior | Use when |
231
224
  | --- | --- | --- |
232
- | `need_decision` | In normal task-host runs, both single and parallel, waits for the supervisor's correlated reply and continues in the same child. In an SDK session without a task host, a direct single-child launch ends with a claimed `[TASK_CONTEXT]` fresh-child handoff. | The subagent is blocked, uncertain, needs approval, or faces a product, API, or scope decision. |
233
- | `interview_request` | In normal task-host runs, both single and parallel, waits for structured supervisor answers and continues in the same child. In an SDK session without a task host, a direct single-child launch ends with a claimed `[TASK_CONTEXT]` fresh-child handoff. | The subagent needs multiple machine-readable answers from the supervisor in one exchange. |
234
- | `progress_update` | Fire-and-forget update to the supervisor. Does not wait or end the child. | Meaningful progress or unexpected discoveries change the plan. |
225
+ | `need_decision` | Waits inside the requesting subagent (up to 10 minutes) for the supervisor's correlated reply, then continues in that same subagent. | The subagent is blocked, uncertain, needs approval, or faces a product, API, or scope decision. |
226
+ | `interview_request` | Waits inside the requesting subagent (up to 10 minutes) for structured answers from the supervisor, then continues in that same subagent. | The subagent needs multiple machine-readable answers in one exchange. |
227
+ | `progress_update` | Fire-and-forget update to the supervisor. Returns immediately without waiting or disrupting siblings. | Meaningful progress or unexpected discoveries change the plan. |
235
228
 
236
- Do not use `contact_supervisor` for routine completion handoffs; return the final subagent result normally.
229
+ Do not use `contact_supervisor` for routine completion handoffs; return the final subagent result normally. A parent's `subagent({ action: "wait" })` call yields so the supervisor can reply without cancelling active or queued siblings.
237
230
 
238
231
  ```typescript
239
232
  // Blocked subagent asks for guidance
@@ -241,8 +234,6 @@ contact_supervisor({
241
234
  reason: "need_decision",
242
235
  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?"
243
236
  })
244
- // Normal task-host run (single or parallel): the supervisor replies through Intercom and this child continues.
245
- // Direct single-child SDK launch without a task host: parent receives [TASK_CONTEXT] for a fresh child.
246
237
 
247
238
  // Fire-and-forget progress update
248
239
  contact_supervisor({
@@ -252,28 +243,18 @@ contact_supervisor({
252
243
  // Output: Progress update sent to supervisor planner
253
244
  ```
254
245
 
255
- ### What the supervisor sees
246
+ ### Answering a subagent as the supervisor
256
247
 
257
- In normal task-host runs, both single and parallel, the supervisor receives the question with child and run identity plus a reply hint. Answer through `intercom({ action: "reply", message: "..." })`. If several questions are pending, run `intercom({ action: "pending" })` and pass the exact `replyTo`. The answer returns as the child's tool result; do not launch a replacement child to answer it.
258
-
259
- In an SDK session without a task host, a claimed direct single-child handoff instead delivers terminal run metadata, ordered attachments, the original delegated task, and a fresh-start `[TASK_CONTEXT]` call:
260
-
261
- ```text
262
- Subagent yielded for parent input (worker, child 1).
263
- Previous run (terminal): 78f659a3
264
- Question:
265
- Which API should I use?
266
-
267
- Start a fresh subagent with a new run identity, replacing <SUPERVISOR_ANSWER> with your answer:
268
- subagent({
269
- "agent": "worker",
270
- "task": "[TASK_CONTEXT] ... Continue with this supervisor answer: <SUPERVISOR_ANSWER>"
271
- })
272
- ```
248
+ The supervisor receives the question with child and run identity plus a reply hint. Answer through `intercom({ action: "reply", message: "..." })`. If several questions are pending, run `intercom({ action: "pending" })` and pass the exact `replyTo`. Your answer returns as the subagent's tool result; never launch a replacement subagent just to answer it.
273
249
 
274
250
  ### Structured interview replies
275
251
 
276
- `interview_request` questions use the shape `{ id, type, question, options?, context? }` where `type` is `single`, `multi`, `text`, `image`, or `info` (`info` questions provide context only and need no response):
252
+ `interview_request` questions use `{ id, type, question, options?, context? }`:
253
+
254
+ - `questions` must be a non-empty array with unique, non-empty `id` strings.
255
+ - `type` must be `"single"`, `"multi"`, `"text"`, `"image"`, or `"info"` (`info` items provide context only and need no answer).
256
+ - `options` is **required** (non-empty array of strings or `{ label: string }` objects) for `single` and `multi`, and **rejected** for `text`, `image`, and `info`.
257
+ - `message` is optional.
277
258
 
278
259
  ```typescript
279
260
  contact_supervisor({
@@ -289,7 +270,7 @@ contact_supervisor({
289
270
  })
290
271
  ```
291
272
 
292
- In normal task-host runs, questions arrive without reordering or rewriting. The supervisor can reply with plain or fenced JSON using this shape to tie answers to question IDs:
273
+ Questions arrive without reordering or rewriting. Reply with plain JSON or a fenced code block (if a reply contains multiple fenced blocks, only the first is parsed):
293
274
 
294
275
  ```json
295
276
  {
@@ -300,13 +281,30 @@ In normal task-host runs, questions arrive without reordering or rewriting. The
300
281
  }
301
282
  ```
302
283
 
303
- The child's tool result preserves the raw reply text and populates `details.structuredReply` when the answer matches the expected question IDs and options. In an SDK session without a task host, a direct single-child handoff instead carries the structured questions into its fresh task context and does not create an Intercom reply.
284
+ The subagent's tool result preserves the raw reply text and populates `details.structuredReply` when the JSON matches the expected question IDs and options. If JSON parsing or option validation fails, `details.structuredReply` is omitted and `details.structuredReplyParseError` describes the error while keeping the raw reply text.
285
+
286
+ ### Embedded SDK sessions without background task management
287
+
288
+ When an embedded SDK session launches a single subagent directly without background task management, a blocking `need_decision` or `interview_request` ends that subagent instead of waiting in place. The caller receives terminal run metadata, ordered attachments, the original delegated task (including any structured interview questions), and a fresh-start `[TASK_CONTEXT]` call:
289
+
290
+ ```text
291
+ Subagent yielded for parent input (worker, child 1).
292
+ Previous run (terminal): 78f659a3
293
+ Question:
294
+ Which API should I use?
295
+
296
+ Start a fresh subagent with a new run identity, replacing <SUPERVISOR_ANSWER> with your answer:
297
+ subagent({
298
+ "agent": "worker",
299
+ "task": "[TASK_CONTEXT] ... Continue with this supervisor answer: <SUPERVISOR_ANSWER>"
300
+ })
301
+ ```
304
302
 
305
303
  ## Mixed versions
306
304
 
307
- Atomic 0.10.0 removed workflows and `workflow:<rootRunId>/...` stage targets, which now return `Session not found`. Sessions of 0.9.x and 0.10.0+ still exchange ordinary sends, asks, and replies through whichever broker is running. See [Mixed versions and workflows](/intercom/operations#mixed-versions-and-workflows) for details.
305
+ Atomic 0.10.0 removed workflows and `workflow:<rootRunId>/...` stage targets, which now return `Session not found`. Sessions of 0.9.x and 0.10.0+ still exchange ordinary sends, asks, and replies through whichever broker is running. See [Mixed versions and workflows](/intercom/operations#mixed-versions-and-workflows).
308
306
 
309
- ## Intercom vs shared-room messengers
307
+ ## Intercom vs. shared-room messengers
310
308
 
311
309
  | Aspect | Intercom | Shared-room messengers |
312
310
  | --- | --- | --- |
@@ -320,31 +318,44 @@ Use Intercom for coordinating your own sessions and for peer-to-peer agent swarm
320
318
 
321
319
  ## Related docs
322
320
 
323
- - [Subagents](/subagents) for delegated child runs, supervisor coordination, and result delivery.
324
- - [Orchestration](/orchestration) for multi-step tasks and child completion notices.
321
+ - [Run subagents](/subagents) for delegated subagent runs, supervisor coordination, and result delivery.
322
+ - [Orchestrate with codemode and subagents](/orchestration) for multi-step tasks and completion notices.
325
323
  - [Skills](/skills) for reusable instructions like `/skill:intercom`.
326
324
  - [Environment variables](/environment-variables) for Intercom environment variables.
327
- - [Interactive use](/usage) for interactive commands and the bundled-extension overview.
325
+ - [Interactive use](/usage) for interactive commands and bundled extensions.
328
326
 
329
327
  ## Moved sections
330
328
 
331
- <a id="how-connection-works" />
332
- <a id="troubleshooting-initialization" />
333
- <a id="subagent-notifications" />
334
- <a id="subagent-control-notices" />
335
- <a id="delivery-ordering" />
336
- <a id="keyboard-shortcuts" />
337
- <a id="how-it-works" />
338
- <a id="limitations" />
339
-
340
- - **Intercom operations:** [How Connection Works](/intercom/operations#how-connection-works), [Troubleshooting initialization](/intercom/operations#troubleshooting-initialization), [Subagent Notifications](/intercom/operations#subagent-notifications), [Subagent Control Notices](/intercom/operations#subagent-control-notices), [Delivery Ordering](/intercom/operations#delivery-ordering), [Keyboard Shortcuts](/intercom/operations#keyboard-shortcuts), [How It Works](/intercom/operations#how-it-works), [Limitations](/intercom/operations#limitations).
341
-
342
- <a id="the-intercom-tool" />
343
- <a id="actions" />
344
- <a id="targeting-sessions" />
345
- <a id="groups" />
346
- <a id="send-vs-ask-vs-reply" />
347
- <a id="attachments" />
348
- <a id="configuration" />
329
+ <div id="how-connection-works" />
330
+
331
+ <div id="troubleshooting-initialization" />
332
+
333
+ <div id="subagent-notifications" />
334
+
335
+ <div id="subagent-control-notices" />
336
+
337
+ <div id="delivery-ordering" />
338
+
339
+ <div id="keyboard-shortcuts" />
340
+
341
+ <div id="how-it-works" />
342
+
343
+ <div id="limitations" />
344
+
345
+ - **Intercom operations:** [How connection works](/intercom/operations#how-connection-works), [Troubleshooting initialization](/intercom/operations#troubleshooting-initialization), [Subagent notifications](/intercom/operations#subagent-notifications), [Subagent control notices](/intercom/operations#subagent-control-notices), [Delivery ordering](/intercom/operations#delivery-ordering), [Keyboard shortcuts](/intercom/operations#keyboard-shortcuts), [How it works](/intercom/operations#how-it-works), [Limitations](/intercom/operations#limitations).
346
+
347
+ <div id="the-intercom-tool" />
348
+
349
+ <div id="actions" />
350
+
351
+ <div id="targeting-sessions" />
352
+
353
+ <div id="groups" />
354
+
355
+ <div id="send-vs-ask-vs-reply" />
356
+
357
+ <div id="attachments" />
358
+
359
+ <div id="configuration" />
349
360
 
350
361
  - **Intercom reference:** [The intercom tool](/intercom/reference#the-intercom-tool), [Actions](/intercom/reference#actions), [Targeting sessions](/intercom/reference#targeting-sessions), [Groups](/intercom/reference#groups), [send vs ask vs reply](/intercom/reference#send-vs-ask-vs-reply), [Attachments](/intercom/reference#attachments), [Configuration](/intercom/reference#configuration).
package/docs/json.md CHANGED
@@ -1,33 +1,56 @@
1
1
  ---
2
2
  title: "JSON event stream"
3
- description: "Run one prompt and parse Atomic's output as newline-delimited events."
3
+ sidebarTitle: "JSON event stream"
4
+ description: "Run one or more prompts and parse Atomic session output as newline-delimited JSON events."
4
5
  ---
5
6
 
6
- # JSON event stream mode
7
-
8
7
  ```bash
9
8
  atomic --mode json "Your prompt"
10
9
  ```
11
10
 
12
- Outputs all session events as JSON lines to stdout. Use this mode to integrate Atomic into scripts, pipelines, or custom UIs.
11
+ JSON mode runs one or more positional prompts in sequence (`atomic --mode json "First prompt" "Second prompt"`), writes every session event as a JSON line to stdout, and exits. Use it for scripts, CI pipelines, and batch processors that do not need interactive follow-up commands.
12
+
13
+ Need to send follow-up commands to a live process or embed Atomic directly in Node.js? Compare JSON mode, [RPC mode](/rpc), and the [TypeScript SDK](/sdk) on [Programmatic integration](/programmatic).
14
+
15
+ If a saved default `provider/model` names a provider that stays unsupported after startup, JSON mode writes a configuration diagnostic to stderr and exits with code `1` before sending any prompt. Stdout stays empty so downstream parsers never receive non-JSON text. Supported providers with an unknown model or missing credentials still fall back through normal model selection.
16
+
17
+ ## Output format
18
+
19
+ Each line on stdout is a single JSON object terminated by `\n`. The first line is always the session header (including when `--no-session` is passed, which emits the in-memory session header):
13
20
 
14
- If a complete saved provider/model default names a provider that remains unsupported after provider registration, JSON mode writes a configuration diagnostic to stderr and exits nonzero before sending the prompt. It writes no diagnostic text to stdout, so stdout remains valid JSONL. Supported-provider model or authentication fallback still uses automatic model selection.
21
+ ```json
22
+ {"type":"session","version":4,"id":"uuid","createdAt":"2026-01-01T00:00:00.000Z","cwd":"/path"}
23
+ ```
15
24
 
16
- ## Choosing an integration mode
25
+ Session events follow as they occur:
17
26
 
18
- JSON mode is one of three ways to drive Atomic from your software. Pick the smallest one that fits.
27
+ ```json
28
+ {"type":"agent_start"}
29
+ {"type":"turn_start"}
30
+ {"type":"message_start","message":{"role":"assistant","content":[]}}
31
+ {"type":"message_update","usage":{},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
32
+ {"type":"message_end","message":{"role":"assistant","content":[{"type":"text","text":"Hello"}]}}
33
+ {"type":"turn_end","message":{"role":"assistant","content":[{"type":"text","text":"Hello"}]},"toolResults":[]}
34
+ {"type":"agent_end","messages":[]}
35
+ ```
19
36
 
20
- | You want | Use | Why |
21
- | --- | --- | --- |
22
- | One prompt, structured output, then exit | **JSON event stream mode** (this page) | One process, one prompt, newline-delimited events on stdout. Nothing to keep alive. |
23
- | A long-lived process you send more input to | [RPC mode](/rpc) | Send further prompts, interrupt, switch models, and answer extension UI dialogs and OAuth prompts on a live process. |
24
- | Atomic embedded inside a Node.js application | [SDK](/sdk) | The same engine as a library, with programmatic control over extensions, skills, tools, and session storage. |
37
+ Unlike RPC mode, JSON mode does not add `entryId` or `seq` fields to `message_end`.
25
38
 
26
- If you need the full protocol contract rather than an overview, read the [RPC protocol](/rpc/protocol) or the [SDK API reference](/sdk/reference). [Programmatic use](/programmatic) compares all three modes side by side.
39
+ ### Streaming `message_update` wire format
40
+
41
+ On the wire, `message_update` omits large cumulative snapshots to keep streaming lines compact:
42
+
43
+ - The top-level `message` property is **stripped** on the wire (unlike the in-memory `AgentSessionEvent` delivered to SDK subscribers). Read final message content from `message_end`.
44
+ - `assistantMessageEvent.partial` is **stripped**.
45
+ - When `assistantMessageEvent.type` is `"toolcall_start"`, Atomic injects `id` and `toolName` directly on `assistantMessageEvent`.
46
+ - Top-level `usage` carries the latest cumulative provider-reported token usage (which may stay zero until completion if the provider reports usage only at the end).
47
+ - Top-level `endTurn` is included only when the provider reported an explicit end-of-turn signal (`AssistantMessage.endTurn` from `@bastani/atomic-ai`, such as OpenAI Codex `end_turn`).
48
+
49
+ A non-assistant message on `message_update` is treated as a protocol violation; Atomic throws an error instead of emitting fabricated usage.
27
50
 
28
51
  ## Event types
29
52
 
30
- Events follow the `AgentSessionEvent` type exported from `@bastani/atomic`:
53
+ Events follow the `AgentSessionEvent` union exported from `@bastani/atomic`, with the wire adjustments on `message_update` described above:
31
54
 
32
55
  ```typescript
33
56
  type AgentSessionEvent =
@@ -61,93 +84,70 @@ type AgentSessionEvent =
61
84
  | { type: "worktree_snapshot_unavailable"; reason: SerializedWorkspaceError };
62
85
  ```
63
86
 
64
- A resumed session whose blueprint build runs behind its first turn (see [Start the first turn while the build runs](/guides/resume-on-any-machine#start-the-first-turn-while-the-build-runs)) also gets one line when that build ends:
65
-
66
- ```json
67
- {"type": "blueprint_build_finished", "sessionId": "...", "roots": ["/home/u/.atomic/agent/worktree-snapshots/worktrees/..."], "notices": [{"type": "warning", "message": "Partial build: ..."}]}
68
- ```
69
-
70
- While a resume waits for another Atomic process's build of the same worktree, Atomic emits `{"type": "blueprint_build_waiting", "root": "...", "message": "Waiting for ..."}` once. This line can arrive before the session header. `notices` holds the warnings that a waiting resume prints, and is empty when the build finished cleanly. In text mode (`-p`), the same warnings go to stderr as `Warning: ...` lines.
71
-
72
- ### Key session events
73
-
74
- - `queue_update`: emits the full pending steering and follow-up queues whenever they change.
75
- - `session_info_changed`, `model_changed`, and `thinking_level_changed`: report session metadata changes.
76
- - `compaction_start` and `compaction_end`: cover manual and automatic compaction. `compaction_end.result.form` is `cleared` when the context window was cleared and `compacted` when a compactor model or an extension replaced it.
77
- - `compaction_usage`: reports the usage of the compactor model's request when it returns, including for a run that later fails. A clear makes no model call.
78
- - `child_session_usage`: reports one model call of a child session created by this session, such as a subagent, or of that child's own children.
79
- - `agent_end` and `agent_settled`: `agent_end` closes one low-level agent run while retries, compaction recovery, or queued work may still continue. `agent_settled` means no automatic work remains for the session-level run, and `aborted` is `true` when the run was cancelled.
80
-
81
- For automatic compaction, `compaction_end.willRetry === true` means the interrupted turn will retry, and `AgentSession.prompt()` waits for that continuation. This includes overflow and retry-worthy threshold recovery, such as output-token truncation or OpenAI Responses output-budget underflow. Generic `invalid_request_body` failures use `willRetry: false` when threshold compaction is warranted.
82
-
83
- If the compact-and-retry attempt for an overflow is exhausted, `unresolvedOverflow: true` and `errorMessage` let integrations choose another model instead of treating the prompt as successful. Check `result` and `errorMessage` independently: both can be present when the boundary was saved but the follow-up request exceeded the provider's hard input limit.
84
-
85
- Branch summaries reuse the configured retry policy for transient provider failures. Their `summarization_retry_*` events report scheduling, each restarted request, and retry-loop completion to JSON, RPC, SDK, and interactive consumers. Compaction does not retry its compactor request; a failure clears the context instead.
86
-
87
- Base events come from `AgentEvent` in `@bastani/atomic-agent-core` (installed as an Atomic dependency):
87
+ Base events come from `AgentEvent` in `@bastani/atomic-agent-core`:
88
88
 
89
89
  ```typescript
90
90
  type AgentEvent =
91
- // Agent lifecycle
92
91
  | { type: "agent_start" }
93
92
  | { type: "agent_end"; messages: AgentMessage[] }
94
- // Turn lifecycle
95
93
  | { type: "turn_start" }
96
94
  | { type: "turn_end"; message: AgentMessage; toolResults: ToolResultMessage[] }
97
- // Message lifecycle
98
95
  | { type: "message_start"; message: AgentMessage }
99
96
  | { type: "message_update"; message: AgentMessage; assistantMessageEvent: AssistantMessageEvent }
100
97
  | { type: "message_end"; message: AgentMessage }
101
- // Tool execution
102
- | { type: "tool_execution_start"; toolCallId: string; toolName: string; args: any }
103
- | { type: "tool_execution_update"; toolCallId: string; toolName: string; args: any; partialResult: any }
104
- | { type: "tool_execution_end"; toolCallId: string; toolName: string; result: any; isError: boolean; durationMs?: number };
98
+ | { type: "tool_execution_start"; toolCallId: string; toolName: string; args: unknown }
99
+ | { type: "tool_execution_update"; toolCallId: string; toolName: string; args: unknown; partialResult: unknown }
100
+ | { type: "tool_execution_end"; toolCallId: string; toolName: string; result: unknown; isError: boolean; durationMs?: number };
105
101
  ```
106
102
 
107
- Final assistant and tool-result messages include optional `durationMs` timing. On `tool_execution_end`, `durationMs` records how long the tool's `execute()` took using a monotonic clock, and is absent when the tool did not run.
103
+ Final assistant messages and tool results include optional `durationMs` timing. On `tool_execution_end`, `durationMs` records how long the tool's `execute()` ran using a monotonic clock and is omitted when the tool did not execute.
108
104
 
109
- On the wire, each `message_update` record carries:
105
+ ### Key session events
110
106
 
111
- - The streaming delta in `assistantMessageEvent`, with its cumulative `partial` field stripped.
112
- - The latest cumulative provider-reported `usage`. This may remain zero until completion if the provider reports usage only at the end.
113
- - `endTurn`, only when the provider reported it. This is the provider's explicit end-of-turn signal (`AssistantMessage.endTurn` from `@bastani/atomic-ai`), for example OpenAI Codex `end_turn`.
107
+ - `queue_update`: reports the full pending steering and follow-up queues whenever they change.
108
+ - `session_info_changed`, `model_changed`, and `thinking_level_changed`: report session metadata updates.
109
+ - `compaction_start` and `compaction_end`: bracket manual and automatic compaction. `compaction_end.result.form` is `"cleared"` when the context window was cleared and `"compacted"` when a compactor model or extension replaced it.
110
+ - `compaction_usage`: reports compactor model token usage when the request returns, even if the run later fails. Clearing context makes no model call.
111
+ - `child_session_usage`: reports one model call made by a child session (such as a subagent or nested subagent).
112
+ - `agent_end` and `agent_settled`: `agent_end` finishes one low-level agent loop while retries, compaction recovery, or queued messages may still continue. `agent_settled` fires once no automatic work remains, with `aborted: true` if cancelled.
113
+ - `blueprint_build_waiting` and `blueprint_build_finished`: emitted when resuming a session whose worktree blueprint build is running in the background (see [Start the first turn while the build runs](/guides/resume-on-any-machine#start-the-first-turn-while-the-build-runs)).
114
114
 
115
- A non-assistant message on `message_update` is a protocol violation. Atomic throws rather than emitting invented zeroed usage.
115
+ ```json
116
+ {"type":"blueprint_build_waiting","root":"...","message":"Waiting for ..."}
117
+ {"type":"blueprint_build_finished","sessionId":"...","roots":["/home/u/.atomic/agent/worktree-snapshots/worktrees/..."],"notices":[{"type":"warning","message":"Partial build: ..."}]}
118
+ ```
119
+
120
+ `blueprint_build_waiting` can arrive before the session header when waiting on another process's build of the same worktree. `notices` is empty when the build completes cleanly (in `-p` text mode, those warnings go to stderr as `Warning: ...`).
121
+
122
+ For automatic compaction, `compaction_end.willRetry: true` indicates Atomic will automatically retry the interrupted turn (such as after context overflow or recoverable output truncation). When a non-retryable request error triggers threshold compaction, `willRetry` is `false`. If overflow recovery is exhausted, `unresolvedOverflow: true` and `errorMessage` are set; check `result` and `errorMessage` independently because both can be present when a compaction boundary was saved before the follow-up request still exceeded the provider's input limit.
123
+
124
+ Branch summaries use the configured retry policy for transient provider errors and emit `summarization_retry_*` events. Compaction does not retry its compactor call and clears context instead if it fails.
116
125
 
117
126
  ## Message types
118
127
 
119
- Base messages come from `@bastani/atomic-ai` (installed as an Atomic dependency):
128
+ Base messages come from `@bastani/atomic-ai`:
129
+
120
130
  - `UserMessage`
121
131
  - `AssistantMessage`
122
132
  - `ToolResultMessage`
123
133
 
124
- Importing `@bastani/atomic` augments `AgentMessage` from `@bastani/atomic-agent-core` with Atomic's extended message roles (documented in [RPC protocol types](/rpc/protocol#types)):
134
+ Importing `@bastani/atomic` augments `AgentMessage` with Atomic's extended roles (documented in [RPC protocol types](/rpc/protocol#types)):
135
+
125
136
  - `BashExecutionMessage`
126
137
  - `CustomMessage`
127
138
  - `BranchSummaryMessage`
128
139
 
129
- ## Output format
130
-
131
- Each line is a JSON object. The first line is the session header:
132
-
133
- ```json
134
- {"type":"session","version":4,"id":"uuid","timestamp":"...","cwd":"/path"}
135
- ```
140
+ ## Exit codes and signals
136
141
 
137
- Followed by events as they occur:
138
-
139
- ```json
140
- {"type":"agent_start"}
141
- {"type":"turn_start"}
142
- {"type":"message_start","message":{"role":"assistant","content":[],...}}
143
- {"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"text_delta","delta":"Hello",...}}
144
- {"type":"message_end","message":{...}}
145
- {"type":"turn_end","message":{...},"toolResults":[]}
146
- {"type":"agent_end","messages":[...]}
147
- ```
142
+ - **Exit `0`**: all prompts finished without fatal errors. Unlike `-p` text mode, an assistant response ending with `stopReason: "length"` still exits `0` in JSON mode.
143
+ - **Exit `1`**: configuration diagnostic for an unsupported provider, extension command failure, session persistence or claim conflict, final assistant `stopReason` of `"error"` or `"aborted"`, or an uncaught error.
144
+ - **Signals**: `SIGINT` exits with `130`, `SIGTERM` exits with `143`, and `SIGHUP` exits with `129` (skipped on Windows and when started with `SIGHUP` ignored, such as under `nohup`). A second signal forces immediate exit.
145
+ - **Background worktree builds**: JSON mode waits for in-progress blueprint builds to settle before exiting.
148
146
 
149
147
  ## Example
150
148
 
149
+ Filter completed messages with `jq`:
150
+
151
151
  ```bash
152
152
  atomic --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
153
153
  ```