@bastani/atomic 0.9.9 → 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (864) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/README.md +2 -0
  3. package/dist/builtin/cursor/CHANGELOG.md +12 -0
  4. package/dist/builtin/cursor/package.json +3 -3
  5. package/dist/builtin/intercom/CHANGELOG.md +30 -0
  6. package/dist/builtin/intercom/README.md +12 -4
  7. package/dist/builtin/intercom/broker/broker.ts +96 -14
  8. package/dist/builtin/intercom/broker/client-message-validation.ts +39 -0
  9. package/dist/builtin/intercom/broker/client.ts +101 -92
  10. package/dist/builtin/intercom/broker/group-isolation.ts +28 -0
  11. package/dist/builtin/intercom/broker/send-handler.ts +62 -10
  12. package/dist/builtin/intercom/broker/send-signature.ts +3 -0
  13. package/dist/builtin/intercom/broker/supervisor-channel.ts +126 -0
  14. package/dist/builtin/intercom/closed-workflow-stage-message.ts +66 -0
  15. package/dist/builtin/intercom/config.ts +10 -0
  16. package/dist/builtin/intercom/contact-supervisor-tool.ts +14 -10
  17. package/dist/builtin/intercom/foreground-detach-handoff.ts +12 -2
  18. package/dist/builtin/intercom/group.ts +46 -0
  19. package/dist/builtin/intercom/inbound-message-admission.ts +79 -0
  20. package/dist/builtin/intercom/incoming-message-delivery.ts +49 -0
  21. package/dist/builtin/intercom/index-heavy.ts +148 -94
  22. package/dist/builtin/intercom/index.ts +66 -4
  23. package/dist/builtin/intercom/intercom-test-seams.ts +6 -0
  24. package/dist/builtin/intercom/intercom-tool.ts +71 -20
  25. package/dist/builtin/intercom/intercom-utils.ts +15 -2
  26. package/dist/builtin/intercom/late-stage-message-router.ts +148 -0
  27. package/dist/builtin/intercom/lifecycle.ts +10 -4
  28. package/dist/builtin/intercom/package.json +2 -2
  29. package/dist/builtin/intercom/reconnect-backoff.ts +6 -0
  30. package/dist/builtin/intercom/reply-tracker.ts +8 -0
  31. package/dist/builtin/intercom/skills/intercom/SKILL.md +2 -0
  32. package/dist/builtin/intercom/stable-delivery-retry.ts +32 -0
  33. package/dist/builtin/intercom/subagent-relay.ts +67 -14
  34. package/dist/builtin/intercom/supervisor-authorization-registry.ts +22 -0
  35. package/dist/builtin/intercom/terminal-ordering-barrier.ts +144 -25
  36. package/dist/builtin/intercom/types.ts +18 -5
  37. package/dist/builtin/intercom/workflow-reply-tracker.ts +19 -0
  38. package/dist/builtin/intercom/workflow-stage-admission.ts +43 -0
  39. package/dist/builtin/intercom/workflow-stage-delivery-failure.ts +77 -0
  40. package/dist/builtin/mcp/CHANGELOG.md +22 -0
  41. package/dist/builtin/mcp/README.md +6 -2
  42. package/dist/builtin/mcp/config.ts +8 -8
  43. package/dist/builtin/mcp/direct-tool-executor.ts +7 -6
  44. package/dist/builtin/mcp/package.json +3 -3
  45. package/dist/builtin/mcp/proxy-call.ts +5 -4
  46. package/dist/builtin/mcp/sampling-handler.ts +7 -2
  47. package/dist/builtin/mcp/tool-call-timeout.ts +101 -0
  48. package/dist/builtin/mcp/tool-result-renderer.ts +3 -2
  49. package/dist/builtin/mcp/types.ts +5 -0
  50. package/dist/builtin/mcp/ui-server.ts +3 -2
  51. package/dist/builtin/subagents/CHANGELOG.md +42 -0
  52. package/dist/builtin/subagents/README.md +6 -3
  53. package/dist/builtin/subagents/agents/code-simplifier.md +1 -1
  54. package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
  55. package/dist/builtin/subagents/agents/codebase-locator.md +1 -1
  56. package/dist/builtin/subagents/agents/codebase-online-researcher.md +1 -1
  57. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +1 -1
  58. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
  59. package/dist/builtin/subagents/agents/codebase-research-locator.md +1 -1
  60. package/dist/builtin/subagents/agents/debugger.md +1 -1
  61. package/dist/builtin/subagents/agents/worker.md +1 -1
  62. package/dist/builtin/subagents/package.json +4 -4
  63. package/dist/builtin/subagents/skills/subagent/SKILL.md +1 -1
  64. package/dist/builtin/subagents/src/extension/index.ts +37 -61
  65. package/dist/builtin/subagents/src/extension/notification-content.ts +80 -0
  66. package/dist/builtin/subagents/src/extension/schemas.ts +9 -0
  67. package/dist/builtin/subagents/src/extension/tool-description.ts +1 -0
  68. package/dist/builtin/subagents/src/intercom/supervisor-authorization.ts +23 -0
  69. package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +4 -0
  70. package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +2 -0
  71. package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +4 -0
  72. package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +75 -13
  73. package/dist/builtin/subagents/src/runs/background/async-status.ts +19 -0
  74. package/dist/builtin/subagents/src/runs/background/completion-notification.ts +4 -3
  75. package/dist/builtin/subagents/src/runs/background/notify.ts +76 -15
  76. package/dist/builtin/subagents/src/runs/background/stale-run-reconciler.ts +1 -1
  77. package/dist/builtin/subagents/src/runs/background/subagent-runner-dynamic.ts +13 -0
  78. package/dist/builtin/subagents/src/runs/background/subagent-runner-parallel.ts +1 -0
  79. package/dist/builtin/subagents/src/runs/background/subagent-runner-sequential.ts +1 -0
  80. package/dist/builtin/subagents/src/runs/background/subagent-runner-step.ts +2 -1
  81. package/dist/builtin/subagents/src/runs/background/subagent-runner-types.ts +4 -0
  82. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +13 -0
  83. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +19 -2
  84. package/dist/builtin/subagents/src/runs/foreground/detached-cleanup-barrier.ts +26 -0
  85. package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +19 -30
  86. package/dist/builtin/subagents/src/runs/foreground/execution-intercom-detach.ts +47 -0
  87. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +60 -2
  88. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +21 -0
  89. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +21 -2
  90. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +6 -1
  91. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +2 -0
  92. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +2 -0
  93. package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +1 -1
  94. package/dist/builtin/subagents/src/runs/shared/intercom-group.ts +50 -0
  95. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +16 -0
  96. package/dist/builtin/subagents/src/runs/shared/worktree-post-create.ts +75 -0
  97. package/dist/builtin/subagents/src/runs/shared/worktree-root.ts +51 -0
  98. package/dist/builtin/subagents/src/runs/shared/worktree.ts +69 -77
  99. package/dist/builtin/subagents/src/shared/types-config.ts +6 -0
  100. package/dist/builtin/subagents/src/slash/slash-commands.ts +3 -2
  101. package/dist/builtin/subagents/src/tui/render-result-compact.ts +5 -3
  102. package/dist/builtin/subagents/src/tui/render-result.ts +5 -3
  103. package/dist/builtin/subagents/src/tui/render-widget-graph.ts +7 -4
  104. package/dist/builtin/web-access/CHANGELOG.md +22 -0
  105. package/dist/builtin/web-access/extract-frames.ts +14 -13
  106. package/dist/builtin/web-access/extract.ts +2 -2
  107. package/dist/builtin/web-access/gemini-api.ts +0 -3
  108. package/dist/builtin/web-access/gemini-web-config.ts +1 -3
  109. package/dist/builtin/web-access/gemini-web.ts +1 -0
  110. package/dist/builtin/web-access/package.json +2 -2
  111. package/dist/builtin/web-access/perplexity.ts +0 -3
  112. package/dist/builtin/web-access/result-renderers.ts +7 -5
  113. package/dist/builtin/web-access/subprocess.ts +100 -0
  114. package/dist/builtin/web-access/summary-review.ts +14 -3
  115. package/dist/builtin/web-access/video-extract.ts +12 -17
  116. package/dist/builtin/web-access/web-search-browser.ts +18 -10
  117. package/dist/builtin/web-access/web-search-summary.ts +9 -2
  118. package/dist/builtin/web-access/youtube-extract.ts +22 -25
  119. package/dist/builtin/workflows/CHANGELOG.md +153 -0
  120. package/dist/builtin/workflows/README.md +76 -38
  121. package/dist/builtin/workflows/ambient.d.ts +30 -0
  122. package/dist/builtin/workflows/builtin/adversarial-verification-prompts.ts +15 -0
  123. package/dist/builtin/workflows/builtin/adversarial-verification-runner.ts +93 -0
  124. package/dist/builtin/workflows/builtin/adversarial-verification.d.ts +11 -0
  125. package/dist/builtin/workflows/builtin/adversarial-verification.ts +24 -0
  126. package/dist/builtin/workflows/builtin/classify-and-act-prompts.ts +11 -0
  127. package/dist/builtin/workflows/builtin/classify-and-act-runner.ts +110 -0
  128. package/dist/builtin/workflows/builtin/classify-and-act.d.ts +24 -0
  129. package/dist/builtin/workflows/builtin/classify-and-act.ts +35 -0
  130. package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +8 -2
  131. package/dist/builtin/workflows/builtin/fan-out-and-synthesize-prompts.ts +11 -0
  132. package/dist/builtin/workflows/builtin/fan-out-and-synthesize-runner.ts +96 -0
  133. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.d.ts +23 -0
  134. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.ts +32 -0
  135. package/dist/builtin/workflows/builtin/generate-and-filter-prompts.ts +15 -0
  136. package/dist/builtin/workflows/builtin/generate-and-filter-runner.ts +75 -0
  137. package/dist/builtin/workflows/builtin/generate-and-filter.d.ts +11 -0
  138. package/dist/builtin/workflows/builtin/generate-and-filter.ts +26 -0
  139. package/dist/builtin/workflows/builtin/goal-models.ts +72 -0
  140. package/dist/builtin/workflows/builtin/goal-runner.ts +2 -64
  141. package/dist/builtin/workflows/builtin/index.d.ts +44 -0
  142. package/dist/builtin/workflows/builtin/index.ts +6 -0
  143. package/dist/builtin/workflows/builtin/loop-until-done-prompts.ts +79 -0
  144. package/dist/builtin/workflows/builtin/loop-until-done-runner.ts +189 -0
  145. package/dist/builtin/workflows/builtin/loop-until-done.d.ts +34 -0
  146. package/dist/builtin/workflows/builtin/loop-until-done.ts +31 -0
  147. package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +6 -1
  148. package/dist/builtin/workflows/builtin/pattern-artifact-root.ts +28 -0
  149. package/dist/builtin/workflows/builtin/ralph-models.ts +26 -5
  150. package/dist/builtin/workflows/builtin/ralph-runner.ts +1 -0
  151. package/dist/builtin/workflows/builtin/tournament-prompts.ts +79 -0
  152. package/dist/builtin/workflows/builtin/tournament-runner.ts +188 -0
  153. package/dist/builtin/workflows/builtin/tournament.d.ts +33 -0
  154. package/dist/builtin/workflows/builtin/tournament.ts +34 -0
  155. package/dist/builtin/workflows/package.json +2 -2
  156. package/dist/builtin/workflows/src/authoring.d.ts +2 -6
  157. package/dist/builtin/workflows/src/durable/backend.ts +163 -120
  158. package/dist/builtin/workflows/src/durable/completed-catalog.ts +37 -64
  159. package/dist/builtin/workflows/src/durable/completed-inspection.ts +4 -72
  160. package/dist/builtin/workflows/src/durable/dbos-backend.ts +242 -195
  161. package/dist/builtin/workflows/src/durable/dbos-embedded-postgres.ts +207 -0
  162. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +42 -42
  163. package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +155 -0
  164. package/dist/builtin/workflows/src/durable/dbos-local-postgres.ts +126 -0
  165. package/dist/builtin/workflows/src/durable/dbos-metadata.ts +105 -58
  166. package/dist/builtin/workflows/src/durable/dbos-prompt-reservations.ts +320 -0
  167. package/dist/builtin/workflows/src/durable/dbos-sdk-handle.ts +161 -0
  168. package/dist/builtin/workflows/src/durable/dbos-status-transition.ts +62 -0
  169. package/dist/builtin/workflows/src/durable/dbos-tombstone.ts +2 -2
  170. package/dist/builtin/workflows/src/durable/durable-hash.ts +20 -0
  171. package/dist/builtin/workflows/src/durable/factory.ts +23 -83
  172. package/dist/builtin/workflows/src/durable/format-version.ts +4 -10
  173. package/dist/builtin/workflows/src/durable/index.ts +16 -20
  174. package/dist/builtin/workflows/src/durable/local-command.ts +63 -0
  175. package/dist/builtin/workflows/src/durable/prompt-reservation-state.ts +177 -0
  176. package/dist/builtin/workflows/src/durable/prompt-reservations.ts +36 -0
  177. package/dist/builtin/workflows/src/durable/resume-catalog.ts +2 -200
  178. package/dist/builtin/workflows/src/durable/resume-eligibility.ts +42 -2
  179. package/dist/builtin/workflows/src/durable/resume-runtime.ts +121 -118
  180. package/dist/builtin/workflows/src/durable/retention-policy.ts +42 -0
  181. package/dist/builtin/workflows/src/durable/run-timing.ts +98 -0
  182. package/dist/builtin/workflows/src/durable/scoped-backend.ts +62 -14
  183. package/dist/builtin/workflows/src/durable/stage-primitive.ts +15 -2
  184. package/dist/builtin/workflows/src/durable/tool-primitive.ts +11 -7
  185. package/dist/builtin/workflows/src/durable/types.ts +25 -18
  186. package/dist/builtin/workflows/src/durable/ui-primitive.ts +117 -29
  187. package/dist/builtin/workflows/src/durable/workflow-status-transition.ts +30 -0
  188. package/dist/builtin/workflows/src/engine/primitives/parallel.ts +20 -5
  189. package/dist/builtin/workflows/src/engine/primitives/task.ts +3 -2
  190. package/dist/builtin/workflows/src/engine/primitives/ui.ts +6 -3
  191. package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +14 -22
  192. package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +14 -14
  193. package/dist/builtin/workflows/src/engine/run.ts +35 -37
  194. package/dist/builtin/workflows/src/engine/runtime.ts +3 -0
  195. package/dist/builtin/workflows/src/engine/workflow-activity.ts +9 -0
  196. package/dist/builtin/workflows/src/extension/completed-stage-intercom-ask.ts +155 -0
  197. package/dist/builtin/workflows/src/extension/config-file-loader.ts +13 -0
  198. package/dist/builtin/workflows/src/extension/config-loader.ts +20 -0
  199. package/dist/builtin/workflows/src/extension/dispatcher.ts +56 -17
  200. package/dist/builtin/workflows/src/extension/extension-factory.ts +13 -10
  201. package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +37 -59
  202. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +16 -18
  203. package/dist/builtin/workflows/src/extension/lifecycle-notification-delivery.ts +83 -0
  204. package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +80 -41
  205. package/dist/builtin/workflows/src/extension/postmortem-deps.ts +73 -0
  206. package/dist/builtin/workflows/src/extension/public-types.ts +11 -51
  207. package/dist/builtin/workflows/src/extension/render-call.ts +3 -9
  208. package/dist/builtin/workflows/src/extension/render-result.ts +22 -7
  209. package/dist/builtin/workflows/src/extension/runtime-active-block-claim.ts +78 -0
  210. package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +50 -29
  211. package/dist/builtin/workflows/src/extension/runtime.ts +70 -219
  212. package/dist/builtin/workflows/src/extension/ui-surface.ts +107 -3
  213. package/dist/builtin/workflows/src/extension/wiring.ts +76 -7
  214. package/dist/builtin/workflows/src/extension/workflow-command-completions.ts +10 -5
  215. package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +27 -5
  216. package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +49 -19
  217. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +8 -8
  218. package/dist/builtin/workflows/src/extension/workflow-resume-picker-rows.ts +81 -0
  219. package/dist/builtin/workflows/src/extension/workflow-resume-shadow.ts +55 -0
  220. package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +193 -145
  221. package/dist/builtin/workflows/src/extension/workflow-schema.ts +9 -133
  222. package/dist/builtin/workflows/src/extension/workflow-status-summary.ts +189 -0
  223. package/dist/builtin/workflows/src/extension/workflow-targets.ts +1 -1
  224. package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +78 -3
  225. package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +185 -89
  226. package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +92 -11
  227. package/dist/builtin/workflows/src/extension/workflow-tool.ts +18 -24
  228. package/dist/builtin/workflows/src/runs/background/durable-resume-transition.ts +63 -0
  229. package/dist/builtin/workflows/src/runs/background/quit.ts +139 -29
  230. package/dist/builtin/workflows/src/runs/background/resume-acknowledgements.ts +97 -0
  231. package/dist/builtin/workflows/src/runs/background/run-inspect.ts +111 -0
  232. package/dist/builtin/workflows/src/runs/background/runner.ts +46 -17
  233. package/dist/builtin/workflows/src/runs/background/startup-admission.ts +77 -0
  234. package/dist/builtin/workflows/src/runs/background/status.ts +133 -224
  235. package/dist/builtin/workflows/src/runs/background/workflow-lifecycle-aggregate.ts +44 -0
  236. package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +57 -256
  237. package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +7 -4
  238. package/dist/builtin/workflows/src/runs/foreground/executor-lifecycle.ts +12 -1
  239. package/dist/builtin/workflows/src/runs/foreground/executor-prompt-nodes.ts +39 -0
  240. package/dist/builtin/workflows/src/runs/foreground/executor-queued-user-message.ts +75 -0
  241. package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +44 -12
  242. package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +63 -12
  243. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +30 -4
  244. package/dist/builtin/workflows/src/runs/foreground/executor-stage-replay.ts +3 -0
  245. package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
  246. package/dist/builtin/workflows/src/runs/foreground/executor-task-prompts.ts +0 -67
  247. package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +6 -0
  248. package/dist/builtin/workflows/src/runs/foreground/executor.ts +0 -1
  249. package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +169 -0
  250. package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +38 -1
  251. package/dist/builtin/workflows/src/runs/foreground/stage-runner-candidate.ts +21 -0
  252. package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +21 -3
  253. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +85 -84
  254. package/dist/builtin/workflows/src/runs/foreground/stage-runner-message-admission.ts +195 -0
  255. package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +12 -5
  256. package/dist/builtin/workflows/src/runs/foreground/stage-runner-replacement.ts +42 -0
  257. package/dist/builtin/workflows/src/runs/foreground/stage-runner-send-user-message.ts +100 -8
  258. package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +51 -0
  259. package/dist/builtin/workflows/src/runs/foreground/stage-runner-session.ts +19 -0
  260. package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +28 -2
  261. package/dist/builtin/workflows/src/runs/shared/prompt-callsite.ts +4 -6
  262. package/dist/builtin/workflows/src/runs/shared/worktree-git-runner.ts +89 -0
  263. package/dist/builtin/workflows/src/runs/shared/worktree-git.ts +29 -133
  264. package/dist/builtin/workflows/src/runs/shared/worktree-post-create.ts +130 -0
  265. package/dist/builtin/workflows/src/runs/shared/worktree-root.ts +84 -0
  266. package/dist/builtin/workflows/src/runs/shared/worktree-setup.ts +77 -63
  267. package/dist/builtin/workflows/src/runs/shared/worktree-types.ts +4 -0
  268. package/dist/builtin/workflows/src/sdk-surface.ts +1 -1
  269. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +29 -22
  270. package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +26 -24
  271. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +5 -0
  272. package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +5 -0
  273. package/dist/builtin/workflows/src/shared/intercom-group.ts +51 -0
  274. package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +6 -0
  275. package/dist/builtin/workflows/src/shared/persistence-restore.ts +4 -0
  276. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +3 -0
  277. package/dist/builtin/workflows/src/shared/prompt-callsite-context.ts +13 -0
  278. package/dist/builtin/workflows/src/shared/returned-run-status.ts +2 -1
  279. package/dist/builtin/workflows/src/shared/session-transcript.ts +74 -0
  280. package/dist/builtin/workflows/src/shared/store-stage-methods.ts +1 -0
  281. package/dist/builtin/workflows/src/shared/store-types.ts +8 -0
  282. package/dist/builtin/workflows/src/shared/timing.ts +4 -1
  283. package/dist/builtin/workflows/src/shared/types.ts +2 -6
  284. package/dist/builtin/workflows/src/tui/chat-surface-message.ts +2 -42
  285. package/dist/builtin/workflows/src/tui/dispatch-confirm.ts +2 -2
  286. package/dist/builtin/workflows/src/tui/graph-view-constants.ts +7 -3
  287. package/dist/builtin/workflows/src/tui/graph-view-input.ts +29 -67
  288. package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +15 -10
  289. package/dist/builtin/workflows/src/tui/graph-view-state.ts +0 -2
  290. package/dist/builtin/workflows/src/tui/graph-view-types.ts +3 -9
  291. package/dist/builtin/workflows/src/tui/host-input-form.ts +62 -0
  292. package/dist/builtin/workflows/src/tui/mouse-input.ts +63 -0
  293. package/dist/builtin/workflows/src/tui/node-card.ts +1 -0
  294. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +67 -42
  295. package/dist/builtin/workflows/src/tui/overlay-terminal-modes.ts +49 -0
  296. package/dist/builtin/workflows/src/tui/session-overlays.ts +3 -104
  297. package/dist/builtin/workflows/src/tui/session-picker.ts +3 -12
  298. package/dist/builtin/workflows/src/tui/stage-chat-composer-drafts.ts +19 -0
  299. package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +30 -10
  300. package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +19 -9
  301. package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +25 -38
  302. package/dist/builtin/workflows/src/tui/stage-chat-view-render-helpers.ts +1 -1
  303. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +7 -6
  304. package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +7 -1
  305. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +3 -1
  306. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +19 -20
  307. package/dist/builtin/workflows/src/tui/switcher.ts +4 -4
  308. package/dist/builtin/workflows/src/tui/widget.ts +46 -33
  309. package/dist/builtin/workflows/src/tui/workflow-attach-pane-handle.ts +26 -0
  310. package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +14 -2
  311. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +26 -27
  312. package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +208 -69
  313. package/dist/bun/cli.js +3 -0
  314. package/dist/bun/cli.js.map +1 -1
  315. package/dist/cli/session-picker.d.ts.map +1 -1
  316. package/dist/cli/session-picker.js +3 -0
  317. package/dist/cli/session-picker.js.map +1 -1
  318. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  319. package/dist/core/agent-session-auto-compaction.js +19 -2
  320. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  321. package/dist/core/agent-session-compaction.js +2 -2
  322. package/dist/core/agent-session-compaction.js.map +1 -1
  323. package/dist/core/agent-session-events.d.ts.map +1 -1
  324. package/dist/core/agent-session-events.js +5 -3
  325. package/dist/core/agent-session-events.js.map +1 -1
  326. package/dist/core/agent-session-export.js +1 -1
  327. package/dist/core/agent-session-export.js.map +1 -1
  328. package/dist/core/agent-session-extension-bindings.d.ts +2 -4
  329. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  330. package/dist/core/agent-session-extension-bindings.js +9 -2
  331. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  332. package/dist/core/agent-session-message-queue.d.ts +6 -0
  333. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  334. package/dist/core/agent-session-message-queue.js +107 -36
  335. package/dist/core/agent-session-message-queue.js.map +1 -1
  336. package/dist/core/agent-session-methods.d.ts +18 -7
  337. package/dist/core/agent-session-methods.d.ts.map +1 -1
  338. package/dist/core/agent-session-methods.js.map +1 -1
  339. package/dist/core/agent-session-models.d.ts +3 -1
  340. package/dist/core/agent-session-models.d.ts.map +1 -1
  341. package/dist/core/agent-session-models.js +1 -1
  342. package/dist/core/agent-session-models.js.map +1 -1
  343. package/dist/core/agent-session-post-tool-compaction.d.ts +16 -0
  344. package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -0
  345. package/dist/core/agent-session-post-tool-compaction.js +113 -0
  346. package/dist/core/agent-session-post-tool-compaction.js.map +1 -0
  347. package/dist/core/agent-session-prompt.d.ts +12 -1
  348. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  349. package/dist/core/agent-session-prompt.js +22 -5
  350. package/dist/core/agent-session-prompt.js.map +1 -1
  351. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  352. package/dist/core/agent-session-runtime.js +3 -0
  353. package/dist/core/agent-session-runtime.js.map +1 -1
  354. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  355. package/dist/core/agent-session-tool-hooks.js +21 -0
  356. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  357. package/dist/core/agent-session-tree.d.ts.map +1 -1
  358. package/dist/core/agent-session-tree.js +2 -1
  359. package/dist/core/agent-session-tree.js.map +1 -1
  360. package/dist/core/agent-session-types.d.ts +7 -0
  361. package/dist/core/agent-session-types.d.ts.map +1 -1
  362. package/dist/core/agent-session-types.js.map +1 -1
  363. package/dist/core/agent-session.d.ts +6 -0
  364. package/dist/core/agent-session.d.ts.map +1 -1
  365. package/dist/core/agent-session.js +18 -1
  366. package/dist/core/agent-session.js.map +1 -1
  367. package/dist/core/async/job-manager.d.ts +1 -0
  368. package/dist/core/async/job-manager.d.ts.map +1 -1
  369. package/dist/core/async/job-manager.js +29 -5
  370. package/dist/core/async/job-manager.js.map +1 -1
  371. package/dist/core/async/session-manager.d.ts +2 -4
  372. package/dist/core/async/session-manager.d.ts.map +1 -1
  373. package/dist/core/async/session-manager.js +5 -32
  374. package/dist/core/async/session-manager.js.map +1 -1
  375. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  376. package/dist/core/atomic-guide-command.js +2 -0
  377. package/dist/core/atomic-guide-command.js.map +1 -1
  378. package/dist/core/auth-storage.d.ts +20 -10
  379. package/dist/core/auth-storage.d.ts.map +1 -1
  380. package/dist/core/auth-storage.js +151 -92
  381. package/dist/core/auth-storage.js.map +1 -1
  382. package/dist/core/callback-activity.d.ts +27 -0
  383. package/dist/core/callback-activity.d.ts.map +1 -0
  384. package/dist/core/callback-activity.js +44 -0
  385. package/dist/core/callback-activity.js.map +1 -0
  386. package/dist/core/compaction/branch-summarization.d.ts +4 -1
  387. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  388. package/dist/core/compaction/branch-summarization.js +4 -3
  389. package/dist/core/compaction/branch-summarization.js.map +1 -1
  390. package/dist/core/compaction/compaction-boundary.d.ts +1 -1
  391. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  392. package/dist/core/compaction/compaction-boundary.js +10 -23
  393. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  394. package/dist/core/compaction/compaction-runner.d.ts +4 -1
  395. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  396. package/dist/core/compaction/compaction-runner.js +1 -1
  397. package/dist/core/compaction/compaction-runner.js.map +1 -1
  398. package/dist/core/compaction/compaction-types.d.ts +3 -2
  399. package/dist/core/compaction/compaction-types.d.ts.map +1 -1
  400. package/dist/core/compaction/compaction-types.js.map +1 -1
  401. package/dist/core/compaction/compaction.d.ts +6 -6
  402. package/dist/core/compaction/compaction.d.ts.map +1 -1
  403. package/dist/core/compaction/compaction.js +12 -9
  404. package/dist/core/compaction/compaction.js.map +1 -1
  405. package/dist/core/compaction/index.d.ts +1 -0
  406. package/dist/core/compaction/index.d.ts.map +1 -1
  407. package/dist/core/compaction/index.js +1 -0
  408. package/dist/core/compaction/index.js.map +1 -1
  409. package/dist/core/compaction/range-planner-diagnostics.d.ts +101 -0
  410. package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -0
  411. package/dist/core/compaction/range-planner-diagnostics.js +116 -0
  412. package/dist/core/compaction/range-planner-diagnostics.js.map +1 -0
  413. package/dist/core/compaction/range-planner.d.ts +13 -3
  414. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  415. package/dist/core/compaction/range-planner.js +117 -68
  416. package/dist/core/compaction/range-planner.js.map +1 -1
  417. package/dist/core/compaction/truncated-range-recovery.d.ts +47 -0
  418. package/dist/core/compaction/truncated-range-recovery.d.ts.map +1 -0
  419. package/dist/core/compaction/truncated-range-recovery.js +112 -0
  420. package/dist/core/compaction/truncated-range-recovery.js.map +1 -0
  421. package/dist/core/extensions/api-types.d.ts +2 -2
  422. package/dist/core/extensions/api-types.d.ts.map +1 -1
  423. package/dist/core/extensions/api-types.js.map +1 -1
  424. package/dist/core/extensions/context-types.d.ts +23 -1
  425. package/dist/core/extensions/context-types.d.ts.map +1 -1
  426. package/dist/core/extensions/context-types.js.map +1 -1
  427. package/dist/core/extensions/index.d.ts +1 -1
  428. package/dist/core/extensions/index.d.ts.map +1 -1
  429. package/dist/core/extensions/index.js.map +1 -1
  430. package/dist/core/extensions/loader-api.js +2 -2
  431. package/dist/core/extensions/loader-api.js.map +1 -1
  432. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  433. package/dist/core/extensions/loader-core.js +8 -1
  434. package/dist/core/extensions/loader-core.js.map +1 -1
  435. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  436. package/dist/core/extensions/loader-virtual-modules.js +9 -6
  437. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  438. package/dist/core/extensions/message-types.d.ts +17 -0
  439. package/dist/core/extensions/message-types.d.ts.map +1 -1
  440. package/dist/core/extensions/message-types.js.map +1 -1
  441. package/dist/core/extensions/provider-types.d.ts +3 -0
  442. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  443. package/dist/core/extensions/provider-types.js.map +1 -1
  444. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  445. package/dist/core/extensions/runner-events.js +11 -10
  446. package/dist/core/extensions/runner-events.js.map +1 -1
  447. package/dist/core/extensions/runtime-types.d.ts +2 -2
  448. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  449. package/dist/core/extensions/runtime-types.js.map +1 -1
  450. package/dist/core/extensions/ui-types.d.ts +78 -0
  451. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  452. package/dist/core/extensions/ui-types.js.map +1 -1
  453. package/dist/core/model-registry-auth.d.ts +2 -1
  454. package/dist/core/model-registry-auth.d.ts.map +1 -1
  455. package/dist/core/model-registry-auth.js +25 -6
  456. package/dist/core/model-registry-auth.js.map +1 -1
  457. package/dist/core/model-registry-builtins.d.ts +3 -2
  458. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  459. package/dist/core/model-registry-builtins.js +12 -6
  460. package/dist/core/model-registry-builtins.js.map +1 -1
  461. package/dist/core/model-registry-dynamic.d.ts +1 -0
  462. package/dist/core/model-registry-dynamic.d.ts.map +1 -1
  463. package/dist/core/model-registry-dynamic.js +53 -13
  464. package/dist/core/model-registry-dynamic.js.map +1 -1
  465. package/dist/core/model-registry-loader.d.ts +2 -1
  466. package/dist/core/model-registry-loader.d.ts.map +1 -1
  467. package/dist/core/model-registry-loader.js +2 -2
  468. package/dist/core/model-registry-loader.js.map +1 -1
  469. package/dist/core/model-registry-types.d.ts +10 -3
  470. package/dist/core/model-registry-types.d.ts.map +1 -1
  471. package/dist/core/model-registry-types.js.map +1 -1
  472. package/dist/core/model-registry.d.ts +15 -1
  473. package/dist/core/model-registry.d.ts.map +1 -1
  474. package/dist/core/model-registry.js +214 -30
  475. package/dist/core/model-registry.js.map +1 -1
  476. package/dist/core/models-store.d.ts +25 -0
  477. package/dist/core/models-store.d.ts.map +1 -0
  478. package/dist/core/models-store.js +73 -0
  479. package/dist/core/models-store.js.map +1 -0
  480. package/dist/core/oauth-compat.d.ts +17 -0
  481. package/dist/core/oauth-compat.d.ts.map +1 -0
  482. package/dist/core/oauth-compat.js +2 -0
  483. package/dist/core/oauth-compat.js.map +1 -0
  484. package/dist/core/oauth-provider-bridge.d.ts +40 -0
  485. package/dist/core/oauth-provider-bridge.d.ts.map +1 -0
  486. package/dist/core/oauth-provider-bridge.js +169 -0
  487. package/dist/core/oauth-provider-bridge.js.map +1 -0
  488. package/dist/core/output-guard.d.ts +2 -0
  489. package/dist/core/output-guard.d.ts.map +1 -1
  490. package/dist/core/output-guard.js +14 -0
  491. package/dist/core/output-guard.js.map +1 -1
  492. package/dist/core/remote-catalog-provider.d.ts +5 -0
  493. package/dist/core/remote-catalog-provider.d.ts.map +1 -0
  494. package/dist/core/remote-catalog-provider.js +138 -0
  495. package/dist/core/remote-catalog-provider.js.map +1 -0
  496. package/dist/core/sdk.d.ts.map +1 -1
  497. package/dist/core/sdk.js +8 -3
  498. package/dist/core/sdk.js.map +1 -1
  499. package/dist/core/session-manager-core.d.ts +1 -1
  500. package/dist/core/session-manager-core.d.ts.map +1 -1
  501. package/dist/core/session-manager-core.js +1 -1
  502. package/dist/core/session-manager-core.js.map +1 -1
  503. package/dist/core/session-manager-entries.d.ts +1 -1
  504. package/dist/core/session-manager-entries.d.ts.map +1 -1
  505. package/dist/core/session-manager-entries.js.map +1 -1
  506. package/dist/core/session-manager-history.d.ts +2 -2
  507. package/dist/core/session-manager-history.js +2 -2
  508. package/dist/core/session-manager-history.js.map +1 -1
  509. package/dist/core/session-manager-list.d.ts.map +1 -1
  510. package/dist/core/session-manager-list.js +65 -23
  511. package/dist/core/session-manager-list.js.map +1 -1
  512. package/dist/core/session-manager-types.d.ts +3 -2
  513. package/dist/core/session-manager-types.d.ts.map +1 -1
  514. package/dist/core/session-manager-types.js.map +1 -1
  515. package/dist/core/slash-commands.d.ts.map +1 -1
  516. package/dist/core/slash-commands.js +9 -5
  517. package/dist/core/slash-commands.js.map +1 -1
  518. package/dist/core/tools/bash.d.ts.map +1 -1
  519. package/dist/core/tools/bash.js +2 -3
  520. package/dist/core/tools/bash.js.map +1 -1
  521. package/dist/core/tools/find.js +2 -2
  522. package/dist/core/tools/find.js.map +1 -1
  523. package/dist/core/tools/grep.js +2 -2
  524. package/dist/core/tools/grep.js.map +1 -1
  525. package/dist/core/tools/ls.js +2 -2
  526. package/dist/core/tools/ls.js.map +1 -1
  527. package/dist/core/tools/read.d.ts.map +1 -1
  528. package/dist/core/tools/read.js +4 -3
  529. package/dist/core/tools/read.js.map +1 -1
  530. package/dist/core/tools/todos-render.d.ts.map +1 -1
  531. package/dist/core/tools/todos-render.js +3 -2
  532. package/dist/core/tools/todos-render.js.map +1 -1
  533. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  534. package/dist/core/tools/tool-definition-wrapper.js +3 -2
  535. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  536. package/dist/core/tools/write.js +2 -2
  537. package/dist/core/tools/write.js.map +1 -1
  538. package/dist/core/workflow-stage-admission.d.ts +29 -0
  539. package/dist/core/workflow-stage-admission.d.ts.map +1 -0
  540. package/dist/core/workflow-stage-admission.js +81 -0
  541. package/dist/core/workflow-stage-admission.js.map +1 -0
  542. package/dist/index-extensions.d.ts +1 -1
  543. package/dist/index-extensions.d.ts.map +1 -1
  544. package/dist/index-extensions.js.map +1 -1
  545. package/dist/index.d.ts +4 -1
  546. package/dist/index.d.ts.map +1 -1
  547. package/dist/index.js +4 -1
  548. package/dist/index.js.map +1 -1
  549. package/dist/main-types.d.ts +13 -0
  550. package/dist/main-types.d.ts.map +1 -0
  551. package/dist/main-types.js +2 -0
  552. package/dist/main-types.js.map +1 -0
  553. package/dist/main.d.ts +2 -5
  554. package/dist/main.d.ts.map +1 -1
  555. package/dist/main.js +25 -17
  556. package/dist/main.js.map +1 -1
  557. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  558. package/dist/modes/interactive/components/assistant-message.js +17 -12
  559. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  560. package/dist/modes/interactive/components/atomic-banner.d.ts +7 -0
  561. package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
  562. package/dist/modes/interactive/components/atomic-banner.js +20 -0
  563. package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
  564. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  565. package/dist/modes/interactive/components/bash-execution.js +5 -3
  566. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  567. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  568. package/dist/modes/interactive/components/branch-summary-message.js +3 -4
  569. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  570. package/dist/modes/interactive/components/chat-message-renderer.d.ts +4 -0
  571. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  572. package/dist/modes/interactive/components/chat-message-renderer.js +4 -0
  573. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  574. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  575. package/dist/modes/interactive/components/chat-session-host-events.js +79 -8
  576. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  577. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  578. package/dist/modes/interactive/components/chat-session-host-rendering.js +4 -2
  579. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  580. package/dist/modes/interactive/components/chat-session-host.d.ts +1 -0
  581. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  582. package/dist/modes/interactive/components/chat-session-host.js +4 -1
  583. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  584. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  585. package/dist/modes/interactive/components/compaction-boundary-message.js +3 -4
  586. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  587. package/dist/modes/interactive/components/host-input-form-mount.d.ts +14 -0
  588. package/dist/modes/interactive/components/host-input-form-mount.d.ts.map +1 -0
  589. package/dist/modes/interactive/components/host-input-form-mount.js +79 -0
  590. package/dist/modes/interactive/components/host-input-form-mount.js.map +1 -0
  591. package/dist/modes/interactive/components/host-input-form.d.ts +52 -0
  592. package/dist/modes/interactive/components/host-input-form.d.ts.map +1 -0
  593. package/dist/modes/interactive/components/host-input-form.js +278 -0
  594. package/dist/modes/interactive/components/host-input-form.js.map +1 -0
  595. package/dist/modes/interactive/components/host-session-picker.d.ts +46 -0
  596. package/dist/modes/interactive/components/host-session-picker.d.ts.map +1 -0
  597. package/dist/modes/interactive/components/host-session-picker.js +183 -0
  598. package/dist/modes/interactive/components/host-session-picker.js.map +1 -0
  599. package/dist/modes/interactive/components/index.d.ts +1 -1
  600. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  601. package/dist/modes/interactive/components/index.js +1 -1
  602. package/dist/modes/interactive/components/index.js.map +1 -1
  603. package/dist/modes/interactive/components/keybinding-hints.d.ts +2 -0
  604. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  605. package/dist/modes/interactive/components/keybinding-hints.js +12 -0
  606. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  607. package/dist/modes/interactive/components/login-dialog.d.ts +3 -1
  608. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  609. package/dist/modes/interactive/components/login-dialog.js +8 -2
  610. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  611. package/dist/modes/interactive/components/model-selector.d.ts +7 -1
  612. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  613. package/dist/modes/interactive/components/model-selector.js +57 -10
  614. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  615. package/dist/modes/interactive/components/session-selector.d.ts +15 -0
  616. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  617. package/dist/modes/interactive/components/session-selector.js +35 -3
  618. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  619. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  620. package/dist/modes/interactive/components/skill-invocation-message.js +3 -2
  621. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  622. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  623. package/dist/modes/interactive/components/tool-execution.js +9 -0
  624. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  625. package/dist/modes/interactive/interactive-agent-events.js +24 -10
  626. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  627. package/dist/modes/interactive/interactive-auth-login.js +7 -1
  628. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  629. package/dist/modes/interactive/interactive-auth-routing.js +3 -3
  630. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  631. package/dist/modes/interactive/interactive-autocomplete.js +49 -0
  632. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  633. package/dist/modes/interactive/interactive-bash-compact.js +2 -0
  634. package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
  635. package/dist/modes/interactive/interactive-extension-context.js +14 -0
  636. package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
  637. package/dist/modes/interactive/interactive-extension-runtime.js +1 -1
  638. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  639. package/dist/modes/interactive/interactive-global-clear.d.ts +13 -0
  640. package/dist/modes/interactive/interactive-global-clear.d.ts.map +1 -0
  641. package/dist/modes/interactive/interactive-global-clear.js +11 -0
  642. package/dist/modes/interactive/interactive-global-clear.js.map +1 -0
  643. package/dist/modes/interactive/interactive-input-handling.js +17 -10
  644. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  645. package/dist/modes/interactive/interactive-mode-base.d.ts +6 -1
  646. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  647. package/dist/modes/interactive/interactive-mode-base.js +25 -2
  648. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  649. package/dist/modes/interactive/interactive-mode-deps.d.ts +4 -3
  650. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  651. package/dist/modes/interactive/interactive-mode-deps.js +2 -2
  652. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  653. package/dist/modes/interactive/interactive-mode-helpers.d.ts +4 -1
  654. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  655. package/dist/modes/interactive/interactive-mode-helpers.js +14 -1
  656. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  657. package/dist/modes/interactive/interactive-mode-surface.d.ts +3 -2
  658. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  659. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  660. package/dist/modes/interactive/interactive-mode-types.d.ts +3 -0
  661. package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
  662. package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
  663. package/dist/modes/interactive/interactive-model-routing.js +7 -4
  664. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  665. package/dist/modes/interactive/interactive-queueing.js +2 -2
  666. package/dist/modes/interactive/interactive-queueing.js.map +1 -1
  667. package/dist/modes/interactive/interactive-render-chat.js +25 -4
  668. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  669. package/dist/modes/interactive/interactive-session-routing.js +3 -0
  670. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  671. package/dist/modes/interactive/interactive-slash-commands.js +5 -2
  672. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  673. package/dist/modes/interactive/interactive-startup.d.ts +1 -1
  674. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  675. package/dist/modes/interactive/interactive-startup.js +22 -9
  676. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  677. package/dist/modes/interactive/interactive-terminal-title.d.ts +6 -0
  678. package/dist/modes/interactive/interactive-terminal-title.d.ts.map +1 -0
  679. package/dist/modes/interactive/interactive-terminal-title.js +7 -0
  680. package/dist/modes/interactive/interactive-terminal-title.js.map +1 -0
  681. package/dist/modes/interactive-engine/activity-watchdog.d.ts +45 -0
  682. package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -0
  683. package/dist/modes/interactive-engine/activity-watchdog.js +74 -0
  684. package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -0
  685. package/dist/modes/interactive-engine/create-isolated-runtime.d.ts +14 -0
  686. package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -0
  687. package/dist/modes/interactive-engine/create-isolated-runtime.js +56 -0
  688. package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -0
  689. package/dist/modes/interactive-engine/engine-args.d.ts +10 -0
  690. package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -0
  691. package/dist/modes/interactive-engine/engine-args.js +55 -0
  692. package/dist/modes/interactive-engine/engine-args.js.map +1 -0
  693. package/dist/modes/interactive-engine/engine-child-liveness.d.ts +7 -0
  694. package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -0
  695. package/dist/modes/interactive-engine/engine-child-liveness.js +50 -0
  696. package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -0
  697. package/dist/modes/interactive-engine/engine-custom-ui.d.ts +47 -0
  698. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -0
  699. package/dist/modes/interactive-engine/engine-custom-ui.js +276 -0
  700. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -0
  701. package/dist/modes/interactive-engine/engine-input-form.d.ts +13 -0
  702. package/dist/modes/interactive-engine/engine-input-form.d.ts.map +1 -0
  703. package/dist/modes/interactive-engine/engine-input-form.js +49 -0
  704. package/dist/modes/interactive-engine/engine-input-form.js.map +1 -0
  705. package/dist/modes/interactive-engine/engine-monitor.d.ts +18 -0
  706. package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -0
  707. package/dist/modes/interactive-engine/engine-monitor.js +63 -0
  708. package/dist/modes/interactive-engine/engine-monitor.js.map +1 -0
  709. package/dist/modes/interactive-engine/engine-render-service.d.ts +17 -0
  710. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -0
  711. package/dist/modes/interactive-engine/engine-render-service.js +150 -0
  712. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -0
  713. package/dist/modes/interactive-engine/engine-session-picker.d.ts +22 -0
  714. package/dist/modes/interactive-engine/engine-session-picker.d.ts.map +1 -0
  715. package/dist/modes/interactive-engine/engine-session-picker.js +106 -0
  716. package/dist/modes/interactive-engine/engine-session-picker.js.map +1 -0
  717. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +23 -0
  718. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -0
  719. package/dist/modes/interactive-engine/extension-ui-bridge.js +126 -0
  720. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -0
  721. package/dist/modes/interactive-engine/input-form-host.d.ts +15 -0
  722. package/dist/modes/interactive-engine/input-form-host.d.ts.map +1 -0
  723. package/dist/modes/interactive-engine/input-form-host.js +44 -0
  724. package/dist/modes/interactive-engine/input-form-host.js.map +1 -0
  725. package/dist/modes/interactive-engine/isolated-runtime.d.ts +75 -0
  726. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -0
  727. package/dist/modes/interactive-engine/isolated-runtime.js +448 -0
  728. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -0
  729. package/dist/modes/interactive-engine/protocol.d.ts +184 -0
  730. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -0
  731. package/dist/modes/interactive-engine/protocol.js +254 -0
  732. package/dist/modes/interactive-engine/protocol.js.map +1 -0
  733. package/dist/modes/interactive-engine/remote-command-catalog.d.ts +33 -0
  734. package/dist/modes/interactive-engine/remote-command-catalog.d.ts.map +1 -0
  735. package/dist/modes/interactive-engine/remote-command-catalog.js +51 -0
  736. package/dist/modes/interactive-engine/remote-command-catalog.js.map +1 -0
  737. package/dist/modes/interactive-engine/remote-component.d.ts +16 -0
  738. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -0
  739. package/dist/modes/interactive-engine/remote-component.js +209 -0
  740. package/dist/modes/interactive-engine/remote-component.js.map +1 -0
  741. package/dist/modes/interactive-engine/remote-frame-clamp.d.ts +25 -0
  742. package/dist/modes/interactive-engine/remote-frame-clamp.d.ts.map +1 -0
  743. package/dist/modes/interactive-engine/remote-frame-clamp.js +43 -0
  744. package/dist/modes/interactive-engine/remote-frame-clamp.js.map +1 -0
  745. package/dist/modes/interactive-engine/remote-renderer.d.ts +59 -0
  746. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -0
  747. package/dist/modes/interactive-engine/remote-renderer.js +123 -0
  748. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -0
  749. package/dist/modes/interactive-engine/session-picker-host.d.ts +25 -0
  750. package/dist/modes/interactive-engine/session-picker-host.d.ts.map +1 -0
  751. package/dist/modes/interactive-engine/session-picker-host.js +75 -0
  752. package/dist/modes/interactive-engine/session-picker-host.js.map +1 -0
  753. package/dist/modes/interactive-engine/terminal-mode-controller.d.ts +43 -0
  754. package/dist/modes/interactive-engine/terminal-mode-controller.d.ts.map +1 -0
  755. package/dist/modes/interactive-engine/terminal-mode-controller.js +109 -0
  756. package/dist/modes/interactive-engine/terminal-mode-controller.js.map +1 -0
  757. package/dist/modes/rpc/bounded-writer.d.ts +27 -0
  758. package/dist/modes/rpc/bounded-writer.d.ts.map +1 -0
  759. package/dist/modes/rpc/bounded-writer.js +103 -0
  760. package/dist/modes/rpc/bounded-writer.js.map +1 -0
  761. package/dist/modes/rpc/jsonl.d.ts +15 -12
  762. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  763. package/dist/modes/rpc/jsonl.js +102 -28
  764. package/dist/modes/rpc/jsonl.js.map +1 -1
  765. package/dist/modes/rpc/rpc-client-api.d.ts +83 -0
  766. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -0
  767. package/dist/modes/rpc/rpc-client-api.js +64 -0
  768. package/dist/modes/rpc/rpc-client-api.js.map +1 -0
  769. package/dist/modes/rpc/rpc-client-process.d.ts +19 -0
  770. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -0
  771. package/dist/modes/rpc/rpc-client-process.js +79 -0
  772. package/dist/modes/rpc/rpc-client-process.js.map +1 -0
  773. package/dist/modes/rpc/rpc-client-waits.d.ts +8 -0
  774. package/dist/modes/rpc/rpc-client-waits.d.ts.map +1 -0
  775. package/dist/modes/rpc/rpc-client-waits.js +33 -0
  776. package/dist/modes/rpc/rpc-client-waits.js.map +1 -0
  777. package/dist/modes/rpc/rpc-client.d.ts +48 -124
  778. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  779. package/dist/modes/rpc/rpc-client.js +295 -249
  780. package/dist/modes/rpc/rpc-client.js.map +1 -1
  781. package/dist/modes/rpc/rpc-command-handler.d.ts +5 -1
  782. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  783. package/dist/modes/rpc/rpc-command-handler.js +79 -3
  784. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  785. package/dist/modes/rpc/rpc-event-buffer.d.ts +11 -0
  786. package/dist/modes/rpc/rpc-event-buffer.d.ts.map +1 -0
  787. package/dist/modes/rpc/rpc-event-buffer.js +30 -0
  788. package/dist/modes/rpc/rpc-event-buffer.js.map +1 -0
  789. package/dist/modes/rpc/rpc-extension-ui.d.ts +7 -1
  790. package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
  791. package/dist/modes/rpc/rpc-extension-ui.js +54 -32
  792. package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
  793. package/dist/modes/rpc/rpc-input-scheduler.d.ts +16 -0
  794. package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -0
  795. package/dist/modes/rpc/rpc-input-scheduler.js +69 -0
  796. package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -0
  797. package/dist/modes/rpc/rpc-input.d.ts +2 -1
  798. package/dist/modes/rpc/rpc-input.d.ts.map +1 -1
  799. package/dist/modes/rpc/rpc-input.js +4 -9
  800. package/dist/modes/rpc/rpc-input.js.map +1 -1
  801. package/dist/modes/rpc/rpc-keybindings-reload.d.ts +27 -0
  802. package/dist/modes/rpc/rpc-keybindings-reload.d.ts.map +1 -0
  803. package/dist/modes/rpc/rpc-keybindings-reload.js +69 -0
  804. package/dist/modes/rpc/rpc-keybindings-reload.js.map +1 -0
  805. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  806. package/dist/modes/rpc/rpc-mode.js +63 -8
  807. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  808. package/dist/modes/rpc/rpc-output-buffer.d.ts +10 -0
  809. package/dist/modes/rpc/rpc-output-buffer.d.ts.map +1 -0
  810. package/dist/modes/rpc/rpc-output-buffer.js +70 -0
  811. package/dist/modes/rpc/rpc-output-buffer.js.map +1 -0
  812. package/dist/modes/rpc/rpc-session-binding.d.ts +16 -1
  813. package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
  814. package/dist/modes/rpc/rpc-session-binding.js +16 -3
  815. package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
  816. package/dist/modes/rpc/rpc-types.d.ts +109 -0
  817. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  818. package/dist/modes/rpc/rpc-types.js.map +1 -1
  819. package/dist/package-manager-cli-parser.d.ts +2 -0
  820. package/dist/package-manager-cli-parser.d.ts.map +1 -1
  821. package/dist/package-manager-cli-parser.js +24 -5
  822. package/dist/package-manager-cli-parser.js.map +1 -1
  823. package/dist/package-manager-cli.d.ts +7 -0
  824. package/dist/package-manager-cli.d.ts.map +1 -1
  825. package/dist/package-manager-cli.js +65 -1
  826. package/dist/package-manager-cli.js.map +1 -1
  827. package/dist/utils/shell.d.ts +1 -0
  828. package/dist/utils/shell.d.ts.map +1 -1
  829. package/dist/utils/shell.js +46 -0
  830. package/dist/utils/shell.js.map +1 -1
  831. package/docs/changelog.mdx +11 -0
  832. package/docs/compaction.md +53 -17
  833. package/docs/custom-provider.md +24 -5
  834. package/docs/development.md +9 -7
  835. package/docs/docs.json +1 -0
  836. package/docs/extensions.md +30 -16
  837. package/docs/intercom.md +489 -0
  838. package/docs/json.md +1 -1
  839. package/docs/keybindings.md +1 -1
  840. package/docs/packages.md +1 -0
  841. package/docs/quickstart.md +11 -5
  842. package/docs/rpc.md +9 -7
  843. package/docs/sdk.md +6 -0
  844. package/docs/session-format.md +7 -6
  845. package/docs/sessions.md +4 -2
  846. package/docs/settings.md +2 -2
  847. package/docs/subagents.md +7 -2
  848. package/docs/tui.md +61 -2
  849. package/docs/usage.md +6 -5
  850. package/docs/workflows.md +2572 -1379
  851. package/examples/extensions/handoff.ts +1 -1
  852. package/examples/extensions/qna.ts +1 -1
  853. package/examples/extensions/summarize.ts +1 -1
  854. package/npm-shrinkwrap.json +225 -76
  855. package/package.json +7 -6
  856. package/dist/builtin/workflows/src/durable/file-backend.ts +0 -439
  857. package/dist/builtin/workflows/src/durable/file-lock.ts +0 -153
  858. package/dist/builtin/workflows/src/durable/file-state.ts +0 -104
  859. package/dist/builtin/workflows/src/extension/runtime-direct.ts +0 -96
  860. package/dist/builtin/workflows/src/extension/workflow-tool-helpers.ts +0 -66
  861. package/dist/builtin/workflows/src/runs/foreground/executor-direct-output.ts +0 -91
  862. package/dist/builtin/workflows/src/runs/foreground/executor-direct.ts +0 -282
  863. package/dist/builtin/workflows/src/shared/resumable-workflow-notices.ts +0 -43
  864. package/dist/builtin/workflows/src/tui/session-confirm.ts +0 -299
@@ -0,0 +1,489 @@
1
+ ---
2
+ title: "Intercom"
3
+ description: "Direct messaging between Atomic sessions on the same machine"
4
+ ---
5
+
6
+ > Atomic sessions can talk to each other. Press ALT+M to message another session, or ask the agent to coordinate with a peer.
7
+
8
+ # Intercom
9
+
10
+ Atomic bundles `@bastani/intercom`, a first-party extension for direct 1:1 messaging between Atomic sessions on the same machine. Send context, findings, or requests from one session to another — whether you're driving the conversation or letting agents coordinate. Connections are lazy and tool-driven: the extension registers its commands and tools at startup, but a session does not connect until you or the model actually invoke Intercom. No separate install is needed.
11
+
12
+ **Key capabilities:**
13
+ - **Session messaging** - `send`, `ask` (blocking, 10-minute timeout), `reply`, `pending`, `list`, and `status` via the `intercom` tool
14
+ - **Session discovery** - List connected sessions with name, short ID, working directory, model, and live status
15
+ - **Keyboard overlay** - ALT+M or `/intercom` opens a session picker and compose overlay
16
+ - **Attachments** - Share `file`, `snippet`, and `context` payloads between sessions
17
+ - **Subagent escalation** - Delegated children get a `contact_supervisor` tool for decisions, structured interviews, and progress updates
18
+ - **Run notifications** - Workflows and subagents deliver async results and control notices to a parent session over Intercom
19
+ - **Bundled skill** - `/skill:intercom` provides planner-worker and escalation-handling patterns
20
+
21
+ **Example use cases:**
22
+ - Planner–worker splits across two terminals
23
+ - Research → implementation context handoffs
24
+ - Supervisor decisions and structured interviews for delegated subagents
25
+ - Async workflow/subagent completion and needs-attention notices
26
+ - Pair debugging between sessions
27
+
28
+ ## Table of Contents
29
+
30
+ - [Quick Start](#quick-start)
31
+ - [From the Keyboard](#from-the-keyboard)
32
+ - [From the Agent](#from-the-agent)
33
+ - [Receiving Messages](#receiving-messages)
34
+ - [How Connection Works](#how-connection-works)
35
+ - [The intercom Tool](#the-intercom-tool)
36
+ - [Actions](#actions)
37
+ - [Targeting Sessions](#targeting-sessions)
38
+ - [send vs ask vs reply](#send-vs-ask-vs-reply)
39
+ - [Attachments](#attachments)
40
+ - [Coordination Patterns](#coordination-patterns)
41
+ - [Subagent Escalation: contact_supervisor](#subagent-escalation-contact_supervisor)
42
+ - [When the Tool Appears](#when-the-tool-appears)
43
+ - [The Three Reasons](#the-three-reasons)
44
+ - [What the Supervisor Sees](#what-the-supervisor-sees)
45
+ - [Structured Interview Replies](#structured-interview-replies)
46
+ - [Workflow and Subagent Notifications](#workflow-and-subagent-notifications)
47
+ - [Workflow Delivery Modes](#workflow-delivery-modes)
48
+ - [Subagent Control Notices](#subagent-control-notices)
49
+ - [Delivery Ordering](#delivery-ordering)
50
+ - [Configuration](#configuration)
51
+ - [Keyboard Shortcuts](#keyboard-shortcuts)
52
+ - [How It Works](#how-it-works)
53
+ - [Intercom vs Shared-Room Messengers](#intercom-vs-shared-room-messengers)
54
+ - [Limitations](#limitations)
55
+ - [Related Docs](#related-docs)
56
+
57
+ ## Quick Start
58
+
59
+ ### From the Keyboard
60
+
61
+ Press **ALT+M** or run `/intercom` to open the session list overlay:
62
+
63
+ 1. **Select a session** — Use arrow keys to pick a target session
64
+ 2. **Compose message** — Write your message in the compose overlay
65
+ 3. **Send** — Enter Send · Escape Cancel
66
+
67
+ Sent messages are recorded in session history and confirmed with a notification.
68
+
69
+ ### From the Agent
70
+
71
+ The agent can list sessions and send messages using the `intercom` tool. Tool calls and results render as compact transcript rows so send/ask/reply flows are easy to scan:
72
+
73
+ ```typescript
74
+ // List active sessions
75
+ intercom({ action: "list" })
76
+ // → **Current session:**
77
+ // → • executor (20d43841) — ~/projects/api (claude-sonnet-4) [self, idle]
78
+ // → **Other sessions:**
79
+ // → • research (6332faab) — ~/projects/api (claude-sonnet-4) [same cwd, thinking]
80
+
81
+ // Send a message
82
+ intercom({ action: "send", to: "research", message: "Check if UserService.validate() handles null" })
83
+ // → Message sent to research
84
+
85
+ // The short ID printed by list is also a valid target
86
+ intercom({ action: "ask", to: "6332faab", message: "Which validation path should I use?" })
87
+
88
+ // Check connection status
89
+ intercom({ action: "status" })
90
+ // → Connected: Yes, Session ID: abc123, Active sessions: 3
91
+
92
+ // Send with attachments (code snippets, files, or context)
93
+ intercom({
94
+ action: "send",
95
+ to: "worker",
96
+ message: "Here's the fix:",
97
+ attachments: [{
98
+ type: "snippet",
99
+ name: "auth.ts",
100
+ language: "typescript",
101
+ content: "function validate(user: User) { ... }"
102
+ }]
103
+ })
104
+ ```
105
+
106
+ ### Receiving Messages
107
+
108
+ When a message arrives, it appears inline in your chat with the sender's info and a reply hint:
109
+
110
+ ```
111
+ **From research** (~/projects/api)
112
+
113
+ To reply, use the intercom tool: intercom({ action: "reply", message: "..." })
114
+
115
+ Found the issue — UserService.validate() doesn't check for null input.
116
+ See auth.ts:142-156.
117
+ ```
118
+
119
+ The reply hint (enabled by default) points to `intercom({ action: "reply", ... })`, so recipients never need raw sender or `replyTo` IDs. Idle recipients get a new turn immediately; busy interactive recipients receive the message once they go idle. Attachment content is included in the agent-visible body, and messages are rendered inline and stored in Atomic session history.
120
+
121
+ ## How Connection Works
122
+
123
+ Intercom connections are normally tool-driven. Ordinary sessions and delegated children keep the lightweight wrapper unloaded until an Intercom tool, `/intercom`, or the ALT+M overlay is invoked. One exception is supervisor authorization: launching an Intercom-enabled subagent connects the parent runtime long enough to request a broker capability for that child; the child's own connection remains lazy until it invokes `contact_supervisor`. The parent restores issued capabilities across reconnects, and the child uses the broker-confirmed current supervisor ID. Concurrent callers share one import and connection attempt, and broker state is leased to the active session generation and cleaned up on shutdown or replacement.
124
+
125
+ A session becomes intercom-connected when all of these are true:
126
+
127
+ - the intercom extension is loaded in that session
128
+ - `enabled` is not set to `false` in `~/.atomic/agent/intercom/config.json` (or the legacy `~/.pi/agent/intercom/config.json` fallback)
129
+ - the model or user has invoked an Intercom surface in that session, **or** the parent runtime is authorizing an Intercom-enabled child supervisor relationship
130
+ - the local broker is running or can be auto-started
131
+
132
+ The session list only shows intercom-connected sessions, not every open Atomic process on the machine.
133
+
134
+ Name sessions with `/name` so they can target each other (for example `/name planner` and `/name worker`). If a session is unnamed, Intercom exposes a runtime-only fallback alias like `subagent-chat-1a2b3c4d` so other sessions can still target it. That alias is not persisted as the session title, so resume pickers keep showing the transcript snippet instead of a generic name.
135
+
136
+ ## The intercom Tool
137
+
138
+ | Parameter | Type | Description |
139
+ |-----------|------|-------------|
140
+ | `action` | string | `"list"`, `"send"`, `"ask"`, `"reply"`, `"pending"`, or `"status"` |
141
+ | `to` | string | Exact session name, exact full ID, or unique ID prefix (for send/ask, or to disambiguate reply) |
142
+ | `message` | string | Message text (for send/ask/reply) |
143
+ | `attachments` | array | Optional `file`, `snippet`, or `context` attachments |
144
+ | `replyTo` | string | Optional message ID for threading or replying to an `ask` |
145
+ | `group` | string | Read-only group filter for `list`/`status` (peek who is in a named group). Ignored/locked for `send`/`ask` — those always use your own group and error on a different group. |
146
+
147
+ ### Actions
148
+
149
+ | Action | Behavior |
150
+ |--------|----------|
151
+ | `list` | Returns the current session plus other active intercom-connected sessions with name, short ID, working directory, model, and live status (`idle`, `thinking`, or `tool:<name>`, derived from lifecycle events). Every displayed short ID is a valid target. |
152
+ | `send` | Fire-and-forget delivery. Requires `to` and `message`; returns delivery confirmation or the delivery-failure reason. Cannot message the current session. |
153
+ | `ask` | Sends a message and blocks until the recipient replies (10-minute timeout). The reply is returned as the tool result, so the agent continues in the same turn. |
154
+ | `reply` | Replies to the intercom-triggered message of the current turn; otherwise falls back to the single unresolved inbound ask. With multiple pending asks, pass `to` or inspect with `pending` first. |
155
+ | `pending` | Lists unresolved inbound asks with sender, message ID, elapsed time, and a short preview. |
156
+ | `status` | Shows connection status, session ID, and the total count of active sessions. |
157
+
158
+ Sent and received messages are recorded in session history as `intercom_sent` / `intercom_received` entries.
159
+
160
+ ### Targeting Sessions
161
+
162
+ Target lookup resolves an exact full ID first, then an exact case-insensitive name, then a unique session-ID prefix. If a prefix matches multiple sessions, Intercom reports every match and asks for a longer ID or exact name instead of guessing. Resolving a prefix to the current session triggers the normal self-target rejection ("Cannot message the current session"). Targeting is also **group-scoped** — see [Groups](#groups) below.
163
+
164
+ ### Groups
165
+
166
+ Every session belongs to exactly one intercom **group**. Sessions with no group configured share the implicit `"default"` group (so ungrouped sessions all see and message each other, exactly as before). A session in group G can **only** message sessions in group G — cross-group sends are rejected by the broker, not merely hidden from discovery:
167
+
168
+ - A cross-group target name is unresolvable (`list`/targeting only consider your own group), and a cross-group send by exact session ID is rejected with `"Target session is in a different intercom group"`.
169
+ - `list`/`status` show your own group and only same-group peers. Pass `group: "name"` to `list`/`status` for a **read-only** peek at another group's membership. `send`/`ask` are always locked to your own group and error if you pass a different `group`.
170
+ - `session_joined`/`session_left`/`presence_update` are group-scoped, so you never see peers outside your group appear or disappear.
171
+
172
+ A session's home group is resolved with precedence: workflow/orchestrator-injected per-session group > env `ATOMIC_INTERCOM_GROUP` (legacy `PI_INTERCOM_GROUP`) > intercom `config.json` `"group"` > `"default"`. In workflow and subagent `group` options, boolean `true` and the trimmed, case-insensitive strings `"true"`/`"auto"` request an automatically generated group; those string names are reserved and cannot name literal groups. Groups are the mechanism workflows use to isolate reviewer levels (see [workflows.md](/workflows)). The subagent-only `contact_supervisor` path can cross groups only after a broker capability binds the registered child socket to the issuing supervisor session. The broker, not the client, marks validated traffic as `supervisor`; ordinary `send` frames remain isolated even if a raw client forges that flag, and replies cross back only through an exact broker-recorded `replyTo` match. Parent-held authorization state is restored after broker reconnects. The lightweight wrapper synchronously claims supervisor-authorization requests and lazy-loads the broker provider; a claimed provider failure aborts launch, while runtimes with no provider omit supervisor metadata and do not expose a broken channel.
173
+
174
+ ### send vs ask vs reply
175
+
176
+ **`send`** is fire-and-forget — the tool returns immediately after delivery. By default it sends immediately, including in interactive sessions. If you want an approval dialog before non-reply sends, set `confirmSend: true` in config; replies that include `replyTo` still skip confirmation so reply-hint flows continue without an extra approval step.
177
+
178
+ **`ask`** sends the message and blocks until the recipient responds (10-minute timeout). The reply comes back as the tool result, so the agent continues in the same turn with full context. No confirmation dialog — if you're asking and waiting, the intent is clear. Only one pending `ask` is allowed per session at a time; if several blocking requests race (parallel `ask` calls, or `ask` alongside `contact_supervisor`), one wins the reservation and each other call returns a normal "Already waiting for a reply" tool error without disturbing the pending ask.
179
+
180
+ **`reply`** is receiver-side sugar for replying to an inbound ask. In the turn triggered by an incoming intercom message, `intercom({ action: "reply", message: "..." })` targets that exact sender and message automatically. If you reply later, it falls back to the single unresolved inbound ask; with multiple pending asks, use `pending` to inspect them and pass `to` to disambiguate. Under the hood this is still a normal `send` with the exact `replyTo` value.
181
+
182
+ ### Attachments
183
+
184
+ `send`, `ask`, and `reply` accept an `attachments` array of `{ type, name, content, language? }` objects where `type` is `"file"`, `"snippet"`, or `"context"`. Attachment content is included in the recipient's agent-visible message body. Attachments are supported in the protocol but not in the ALT+M compose overlay.
185
+
186
+ ## Coordination Patterns
187
+
188
+ The most natural use of Intercom is splitting a task between two sessions — one holds the big picture, the other does the hands-on work. Open two terminals, start Atomic in each, and name them so they can find each other:
189
+
190
+ ```
191
+ # Terminal 1 # Terminal 2
192
+ /name planner /name worker
193
+ ```
194
+
195
+ Verify they see each other with `intercom({ action: "list" })`, then coordinate:
196
+
197
+ ```typescript
198
+ // Planner delegates with send (fire-and-forget)
199
+ intercom({
200
+ action: "send",
201
+ to: "worker",
202
+ message: "Task-3: Add retry logic to API client. Key files: src/api/client.ts, src/api/types.ts. Ask if anything's unclear."
203
+ })
204
+
205
+ // Worker hits an ambiguity — asks and waits
206
+ intercom({
207
+ action: "ask",
208
+ to: "planner",
209
+ message: "Should retry apply to all endpoints or just idempotent ones? Also, max retry count and backoff strategy?"
210
+ })
211
+ // → Reply from planner: Only GET/PUT/DELETE — never POST. Max 3 retries, exponential backoff starting at 100ms.
212
+ // Worker continues implementing with the answer, same turn, full context.
213
+ ```
214
+
215
+ | Pattern | Action | Why |
216
+ |---------|--------|-----|
217
+ | **Task delegation** | Planner uses `send` | Fire-and-forget. Planner doesn't need to wait for an ack. |
218
+ | **Clarification request** | Worker uses `ask` | Worker needs the answer to proceed. Blocks until reply. |
219
+ | **Discovery escalation** | Worker uses `ask` | Worker needs approval before changing course. |
220
+ | **Completion report** | Worker uses `ask` | Planner might have follow-up instructions or the next task. |
221
+
222
+ The bundled `intercom` skill (`/skill:intercom`) has copy-paste ready patterns for planner-worker delegation, status checks, natural replies, broadcasting to multiple workers, attachments, and handling subagent escalations on the orchestrator side.
223
+
224
+ **Recommended:** Add this snippet to your project's `AGENTS.md` to help agents understand when to coordinate across sessions:
225
+
226
+ ```xml
227
+ <intercom>
228
+ Coordinate with other local Atomic sessions on related codebases. Use `/skill:intercom` for patterns.
229
+
230
+ **When:** Same codebase (parallel work), reference codebase (consulting patterns), related repos (shared libraries).
231
+
232
+ **Not when:** Unrelated codebases, trivial questions, or when you can proceed independently.
233
+
234
+ **Principle:** Prefer `send` for notifications; `ask` only when blocked waiting for input.
235
+ </intercom>
236
+ ```
237
+
238
+ ## Subagent Escalation: contact_supervisor
239
+
240
+ When Atomic's [subagent runtime](/subagents) spawns a delegated child with bridge metadata, the child session gets a subagent-only `contact_supervisor` tool in addition to the regular `intercom` tool. Normal sessions never see `contact_supervisor`.
241
+
242
+ ### When the Tool Appears
243
+
244
+ `contact_supervisor` only registers when the subagent runtime sets all of these environment variables:
245
+
246
+ - `ATOMIC_SUBAGENT_ORCHESTRATOR_TARGET` — the supervisor session name or ID
247
+ - `ATOMIC_SUBAGENT_RUN_ID` — the run identifier
248
+ - `ATOMIC_SUBAGENT_CHILD_AGENT` — the agent type
249
+ - `ATOMIC_SUBAGENT_CHILD_INDEX` — the child index within the run
250
+
251
+ Legacy `PI_SUBAGENT_*` bridge metadata remains compatible. The optional `ATOMIC_SUBAGENT_INTERCOM_SESSION_NAME` variable sets the delegated child's session name. If required variables are missing, the session falls back to the regular `intercom` tool.
252
+
253
+ | Parameter | Type | Description |
254
+ |-----------|------|-------------|
255
+ | `reason` | string | `"need_decision"` (blocking), `"interview_request"` (blocking structured questions), or `"progress_update"` (fire-and-forget) |
256
+ | `message` | string | The decision request, optional interview note, or progress update |
257
+ | `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }` |
258
+
259
+ ### The Three Reasons
260
+
261
+ | Reason | Behavior | Use When |
262
+ |--------|----------|----------|
263
+ | `need_decision` | Sends a formatted ask to the supervisor and blocks until it replies (10-minute timeout) | The subagent is blocked, uncertain, needs approval, or faces a product/API/scope decision |
264
+ | `interview_request` | Sends structured questions and blocks until the supervisor replies | The subagent needs multiple machine-readable answers from the supervisor in one exchange |
265
+ | `progress_update` | Fire-and-forget update to the supervisor | Meaningful progress or unexpected discoveries that change the plan |
266
+
267
+ Do not use `contact_supervisor` for routine completion handoffs — return the final subagent result normally. Blocking calls share the same single reply-waiter reservation as `ask`, with the same "Already waiting for a reply" semantics.
268
+
269
+ ```typescript
270
+ // Blocked subagent asks for guidance
271
+ contact_supervisor({
272
+ reason: "need_decision",
273
+ 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?"
274
+ })
275
+ // → Reply from supervisor: Treat 403 as re-auth trigger. Update the token refresh logic.
276
+
277
+ // Fire-and-forget progress update
278
+ contact_supervisor({
279
+ reason: "progress_update",
280
+ message: "Discovered the bug is in the retry wrapper, not the API client. Fixing the wrapper will also close issue #42."
281
+ })
282
+ // → Progress update sent to supervisor planner
283
+ ```
284
+
285
+ ### What the Supervisor Sees
286
+
287
+ The supervisor receives a formatted message with run metadata:
288
+
289
+ ```
290
+ **From subagent-worker-78f659a3-1**
291
+
292
+ Subagent needs a supervisor decision.
293
+ Run: 78f659a3
294
+ Agent: worker
295
+ Child index: 0
296
+
297
+ Which API should I use?
298
+ ```
299
+
300
+ Reply hints work the same as regular `intercom` ask/reply flows. The supervisor replies with `intercom({ action: "reply", message: "..." })` and the subagent receives the answer as the tool result.
301
+
302
+ ### Structured Interview Replies
303
+
304
+ `interview_request` questions use the shape `{ id, type, question, options?, context? }` where `type` is `single`, `multi`, `text`, `image`, or `info` (`info` questions are context-only and need no response):
305
+
306
+ ```typescript
307
+ contact_supervisor({
308
+ reason: "interview_request",
309
+ message: "Please answer these before I continue the migration.",
310
+ interview: {
311
+ title: "API migration choices",
312
+ questions: [
313
+ { id: "api", type: "single", question: "Which API should I target?", options: ["Stable API", "Experimental API"] },
314
+ { id: "constraints", type: "text", question: "What constraints should I preserve?" }
315
+ ]
316
+ }
317
+ })
318
+ ```
319
+
320
+ The supervisor message includes the structured questions plus a fenced JSON answer example using this stable shape:
321
+
322
+ ```json
323
+ {
324
+ "responses": [
325
+ { "id": "api", "value": "Stable API" },
326
+ { "id": "constraints", "value": "Keep the public error shape unchanged." }
327
+ ]
328
+ }
329
+ ```
330
+
331
+ The supervisor can reply with plain JSON or a fenced `json` block. If the reply matches the `{ "responses": [...] }` shape and references valid question ids/options, the child tool result includes it in `details.structuredReply` while still showing the raw reply text; parse errors are surfaced in `details.structuredReplyParseError`.
332
+
333
+ ## Workflow and Subagent Notifications
334
+
335
+ Intercom is also the delivery channel for async run results and control notices from [workflows](/workflows) and [subagents](/subagents).
336
+
337
+ ### Workflow Delivery Modes
338
+
339
+ Programmatic `workflow()` calls accept an `intercom` option that controls how async direct-run results and control notices reach a parent session:
340
+
341
+ ```typescript
342
+ workflow({
343
+ tasks: [{ agent: "worker", task: "..." }],
344
+ async: true,
345
+ intercom: { delivery: "result" },
346
+ })
347
+ ```
348
+
349
+ | Option | Values | Meaning |
350
+ |--------|--------|---------|
351
+ | `enabled` | boolean | `false` forces delivery off; `true` resolves to `control-and-result` |
352
+ | `delivery` | `"off"` \| `"notify"` \| `"result"` \| `"control-and-result"` | Explicit delivery mode; wins over `enabled` |
353
+ | `parentSession` | string | Target session for delivery; resolved from args or the Intercom port when omitted |
354
+ | `notifyOn` | array | Control events to deliver: `"active_long_running"`, `"needs_attention"`, `"completed"`, `"failed"` |
355
+
356
+ When neither `enabled` nor `delivery` is set, async direct `parallel`/`chain` runs default to `control-and-result` when Intercom is available; otherwise delivery is off. Treat Intercom payloads from async direct runs as user-visible workflow output.
357
+
358
+ While a workflow stage generation is open, incoming Intercom messages are admitted through the stage session's native steering/follow-up queue. If that stage is busy running a foreground subagent, Atomic synchronously reserves the message in the stage generation before starting the exact child's probe/commit detach handshake. Model-visible queue insertion waits inside that reservation until detach is acknowledged or the owner is unclaimed/disappears, so terminal stage close cannot overtake and silently drop the message. The stage drains the admitted delivery before publishing its terminal snapshot. A destination-side admission failure returns a correlated actionable error to a blocking asker instead of waiting for the 10-minute reply timeout.
359
+ ### Subagent Control Notices
360
+
361
+ The `subagent` tool's `control` options select which control events notify the parent and over which channels:
362
+
363
+ - **`notifyOn`** — defaults to `["active_long_running", "needs_attention"]`
364
+ - **`notifyChannels`** — defaults to `["event", "async", "intercom"]` (all that are available)
365
+
366
+ Async subagent result delivery over Intercom is confirmation-based and preserves a successful delivery phase across watcher replacement. Each delegated child gets a deterministic Intercom target derived from its run/agent/index identity, and run results report those targets ("Run intercom target" / "Previous intercom target"; targets may be inactive after completion). `subagent({ action: "doctor" })` reports Intercom bridge availability and whether Intercom is enabled in config.
367
+
368
+ If live child-to-parent coordination is needed, invoke `intercom({ action: "status" })` in the parent before launching; the child connects on its first `contact_supervisor` or `intercom` call. Fresh child processes receive the bundled Intercom wrapper through normal package discovery unless an explicit `extensions` allowlist excludes it.
369
+
370
+ ### Delivery Ordering
371
+
372
+ During a foreground subagent run, Atomic probes for the exact live foreground owner before delivery: the matching child reserves the request, accepts a generation-scoped detach commit, and acknowledges it before messages enter the parent's model-visible steering queue. A commit accepted by one member of a foreground parallel group releases supervision for all active siblings while retaining their process/result ownership, allowing the aggregate tool call to return. If the owner disappears between probe and commit, a still-current receiver uses its ordinary fallback route rather than dropping the broker-delivered message. Blocking calls stay alive until the exact threaded reply; generation cancellation or replacement invalidates stale handshakes.
373
+
374
+ For delegated background children, queued messages and terminal lifecycle notices are ordered per child: pre-terminal messages are admitted FIFO and atomically together with the paused, completed, or failed notice, exact terminal-identity deduplication prevents double admission, failed dispatches remain retryable, and correlated ask replies bypass unrelated queued sends. See [Subagents](/subagents) for the full coordination contract.
375
+
376
+ ## Configuration
377
+
378
+ Create `~/.atomic/agent/intercom/config.json`. The legacy `~/.pi/agent/intercom/config.json` fallback is read when the Atomic config is absent:
379
+
380
+ ```json
381
+ {
382
+ "brokerCommand": "npx",
383
+ "brokerArgs": ["--no-install", "tsx"],
384
+ "confirmSend": false,
385
+ "enabled": true,
386
+ "replyHint": true,
387
+ "status": "researching",
388
+ "group": "default"
389
+ }
390
+ ```
391
+
392
+ | Setting | Default | Description |
393
+ |---------|---------|-------------|
394
+ | `brokerCommand` | `"npx"` | Command used to start the local broker process; the default sentinel is hardened internally to avoid PATH lookup |
395
+ | `brokerArgs` | `["--no-install", "tsx"]` | Arguments passed to `brokerCommand` before the broker script path |
396
+ | `confirmSend` | `false` | Show a confirmation dialog before non-reply sends from an interactive session with UI |
397
+ | `enabled` | `true` | Enable/disable intercom entirely |
398
+ | `replyHint` | `true` | Include reply instruction in incoming messages |
399
+ | `status` | — | Optional custom status suffix shown after the automatic lifecycle status, for example `thinking · researching` |
400
+ | `group` | `"default"` | Home intercom group for this session (see [Groups](#groups)). Overridden by env `ATOMIC_INTERCOM_GROUP` / `PI_INTERCOM_GROUP` and by workflow/orchestrator per-session injection. |
401
+
402
+ The default `npx --no-install tsx` pair is a compatibility sentinel: Intercom recognizes it and starts the broker through the current Atomic runtime (`process.execPath`). Node-based installs use that runtime with a resolved `tsx` CLI, falling back to Atomic's bundled `jiti` loader when `tsx` is unavailable; Bun source-checkout runs use the current Bun executable directly; standalone Atomic binaries re-enter the split launcher through a narrow internal broker handoff. Default startup therefore does not rely on `npx`, `tsx`, or `bun` being on `PATH`. Explicit custom broker commands still work — for example, to intentionally use Bun from `PATH`:
403
+
404
+ ```json
405
+ {
406
+ "brokerCommand": "bun",
407
+ "brokerArgs": []
408
+ }
409
+ ```
410
+
411
+ Config validation is strict: every field is checked, and if the file is not valid JSON or any field has an invalid value, the whole config is rejected — an error is logged and all defaults are used.
412
+
413
+ Intercom publishes live session status automatically: sessions register as `idle`, switch to `thinking` while the agent is running, show `tool:<name>` during tool execution, and return to `idle` on completion. A configured `status` is appended as context instead of replacing the lifecycle status.
414
+
415
+ ## Keyboard Shortcuts
416
+
417
+ | Key | Action |
418
+ |-----|--------|
419
+ | ALT+M | Open session list overlay |
420
+ | ↑/↓ | Navigate session list |
421
+ | Enter | Select session / Send message |
422
+ | Escape | Cancel / Close overlay |
423
+
424
+ ## How It Works
425
+
426
+ ```mermaid
427
+ graph TB
428
+ subgraph A["Atomic Session A"]
429
+ A1[Intercom Client]
430
+ A2[intercom tool]
431
+ A3[UI overlays]
432
+ end
433
+
434
+ subgraph Broker["Intercom Broker"]
435
+ B1[Session Registry]
436
+ B2[Message Router]
437
+ end
438
+
439
+ subgraph B["Atomic Session B"]
440
+ B3[Intercom Client]
441
+ B4[intercom tool]
442
+ B5[UI overlays]
443
+ end
444
+
445
+ A1 <-->|Local Socket/Pipe| B1
446
+ B1 --- B2
447
+ B2 <-->|Local Socket/Pipe| B3
448
+ ```
449
+
450
+ The broker is a standalone process that manages session registration and message routing. It auto-spawns when the first intercom-enabled session needs it and exits 5 seconds after the last connected session disconnects; clients reconnect automatically if the broker restarts. A spawn lock keyed by PID and timestamp prevents duplicate brokers when multiple sessions start at once.
451
+
452
+ Transport is local IPC only — a Unix domain socket on macOS/Linux or a named pipe on Windows — using length-prefixed JSON (4-byte length + payload) with request correlation for session listing, explicit delivery failures, and validation of malformed or out-of-order messages. `ask` stays client-side: the broker routes plain messages, and the client waits for the matching reply before returning it as the tool result.
453
+
454
+ Runtime files live under the active agent directory — `~/.atomic/agent/intercom/` by default, or below `ATOMIC_CODING_AGENT_DIR` when set (the legacy `PI_CODING_AGENT_DIR` alias is honored when the Atomic variable is unset):
455
+
456
+ - `broker.sock` — Unix domain socket (macOS/Linux; Windows uses a named pipe instead)
457
+ - `broker-launch.vbs` — Windows helper script to launch the broker without a console window
458
+ - `broker.pid` — Broker process ID
459
+ - `broker.spawn.lock` — Short-lived lock used to avoid duplicate auto-spawns
460
+ - `config.json` — User configuration
461
+
462
+ Async extension work (startup, inbound flushes, reconnects, overlays, and relays) no-ops if the session shuts down or reloads before it settles.
463
+
464
+ ## Intercom vs Shared-Room Messengers
465
+
466
+ | Aspect | Intercom | Shared-room messengers |
467
+ |--------|----------|------------------------|
468
+ | **Model** | Direct 1:1 messaging | Shared chat room |
469
+ | **Primary use** | User orchestrating sessions | Autonomous agent swarms |
470
+ | **Discovery** | Broker-based (real-time) | File-based registry |
471
+ | **Messages** | Private, session-to-session | Broadcast to all agents |
472
+ | **Persistence** | In Atomic session history | Shared coordination files |
473
+
474
+ Use a shared-room messenger for multi-agent swarms working on one shared task. Use Intercom when you want to manually coordinate your own sessions or have one agent reach out to another specific session.
475
+
476
+ ## Limitations
477
+
478
+ - **Same machine only** — Uses local sockets/pipes, no network support
479
+ - **No dedicated intercom log** — Messages are kept in session history; there is no separate intercom transcript or inbox
480
+ - **No attachments UI** — `file`, `snippet`, and `context` attachments are supported in the protocol, but not in the compose overlay
481
+ - **Only connected sessions appear** — The list shows sessions that have connected to the broker, not every open Atomic process
482
+ - **Broker lifecycle** — The broker auto-spawns on first use and exits when idle; sessions reconnect automatically if it restarts
483
+
484
+ ## Related Docs
485
+
486
+ - [Subagents](/subagents) for delegated child runs, foreground coordination, and result delivery.
487
+ - [Workflows](/workflows) for multi-stage automation and async run notifications.
488
+ - [Skills](/skills) for reusable instructions like `/skill:intercom`.
489
+ - [Usage](/usage) for environment variables and the bundled-extension overview.
package/docs/json.md CHANGED
@@ -26,7 +26,7 @@ type AgentSessionEvent =
26
26
 
27
27
  `queue_update` emits the full pending steering and follow-up queues whenever they change. `session_info_changed`, `model_changed`, `thinking_level_changed`, and `context_window_changed` report interactive session metadata changes. `context_window_changed` carries the active token budget after `AgentSession.setContextWindow()` or branch navigation replay applies a branch-scoped `context_window_change`; branch replay does not add another session journal entry or write settings. `compaction_start` and `compaction_end` cover manual and automatic verbatim line compaction: the model emits deleted ranges and Atomic mechanically reconstructs retained text.
28
28
 
29
- For automatic compaction, `compaction_end.willRetry === true` means the agent is retrying the interrupted turn after compaction; `AgentSession.prompt()` waits for that continuation before resolving. This includes overflow recovery and live threshold compaction for retry-worthy interrupted work such as output-token truncation or OpenAI Responses output-budget underflow errors. Generic provider `invalid_request_body` failures still compact with `willRetry: false` when threshold compaction is warranted. If the same-model compact-and-retry overflow path is exhausted, `compaction_end` includes `unresolvedOverflow: true` plus an `errorMessage` so orchestration layers can fallback to another model instead of treating the prompt as successful.
29
+ For automatic compaction, `compaction_end.willRetry === true` means the agent is retrying the interrupted turn after compaction; `AgentSession.prompt()` waits for that continuation before resolving. This includes overflow recovery and live threshold compaction for retry-worthy interrupted work such as output-token truncation or OpenAI Responses output-budget underflow errors. Generic provider `invalid_request_body` failures still compact with `willRetry: false` when threshold compaction is warranted. If the same-model compact-and-retry overflow path is exhausted, `compaction_end` includes `unresolvedOverflow: true` plus an `errorMessage` so orchestration layers can fall back to another model instead of treating the prompt as successful.
30
30
 
31
31
  Base events come from `AgentEvent` in `@earendil-works/pi-agent-core` (installed as an Atomic dependency):
32
32
 
@@ -118,7 +118,7 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+1
118
118
 
119
119
  | Keybinding id | Default | Description |
120
120
  |--------|---------|-------------|
121
- | `app.tools.expand` | `ctrl+o` | Collapse or expand tool output |
121
+ | `app.tools.expand` | `ctrl+o` | Collapse or expand tool and workflow-node detail in main chat or an attached workflow stage chat |
122
122
  | `app.message.followUp` | `alt+enter` | Queue follow-up message |
123
123
  | `app.message.dequeue` | `alt+up` | Restore queued messages to editor |
124
124
 
package/docs/packages.md CHANGED
@@ -38,6 +38,7 @@ atomic list # show installed packages from settings
38
38
  atomic update # update Atomic only
39
39
  atomic update --all # update Atomic, update packages, and reconcile pinned git refs
40
40
  atomic update --extensions # update packages and reconcile pinned git refs only
41
+ atomic update --models # force-refresh authenticated provider model catalogs
41
42
  atomic update --self # update Atomic only
42
43
  atomic update --self --force # reinstall Atomic even if current
43
44
  atomic update npm:@foo/bar # update one package
@@ -84,7 +84,7 @@ On a fresh install with no prior Atomic startup state, Atomic shows a one-time f
84
84
 
85
85
  Once Atomic starts, default to a workflow for non-trivial work and for requests with inherent structure plus a verifiable objective. Implementation, build, debugging, bug fixes, migrations, features, scoped multi-file edits, validation/review work, and loop-shaped requests are workflow candidates; reserve direct chat for tiny deterministic low-risk answers or edits where tracking clearly adds more overhead than value.
86
86
 
87
- Workflow-first is not builtin-only or monolithic. Atomic can discover named builtin, project, user, and package workflows; run direct `task`, `tasks`, and `chain` shapes; author a rich custom TypeScript `workflow({...})` inline; and compositionally import reusable workflow definitions—including builtins from `@bastani/workflows/builtin`—into parent workflows with `ctx.workflow(...)`. Nested children can nest again within `maxDepth`, so custom graphs can combine proven research, implementation, design, verification, and approval workflows instead of copying them. They can also classify and branch, dynamically fan out and synthesize artifacts, run adversarial repair cycles, tournament-rank candidates, and loop until checks pass with explicit bounds.
87
+ Workflow-first is not builtin-only or monolithic. Atomic can discover and run named builtin, project, user, and package workflows; author a rich custom TypeScript `workflow({...})` inline; and compositionally import reusable workflow definitions—including builtins from `@bastani/workflows/builtin`—into parent workflows with `ctx.workflow(...)`. Nested children can nest again within `maxDepth`, so custom graphs can combine proven research, implementation, design, verification, and approval workflows instead of copying them. They can also classify and branch, dynamically fan out and synthesize artifacts, run adversarial repair cycles, tournament-rank candidates, and loop until checks pass with explicit bounds.
88
88
 
89
89
  Atomic turns repeatable engineering loops into executable stages with inspectable evidence instead of relying on a markdown checklist the model may or may not follow.
90
90
 
@@ -92,10 +92,16 @@ For an interactive tour any time, run `/atomic` inside the TUI; `/atomic overvie
92
92
 
93
93
  ### Try the built-in workflows
94
94
 
95
- Atomic ships with four workflows you can run immediately. Use `/workflow list` to see them and `/workflow inputs <name>` to inspect their inputs in your environment.
95
+ Atomic ships with ten workflows you can run immediately. Use `/workflow list` to see them and `/workflow inputs <name>` to inspect their inputs in your environment.
96
96
 
97
97
  | Workflow | When to use | Example |
98
98
  |---|---|---|
99
+ | `classify-and-act` | Route requests through structured classification and low-confidence human fallback. | `/workflow classify-and-act prompt="Triage and handle this request"` |
100
+ | `fan-out-and-synthesize` | Partition independent slices and synthesize their artifact evidence. | `/workflow fan-out-and-synthesize prompt="Review every API package"` |
101
+ | `adversarial-verification` | Challenge a candidate with fresh verifiers and bounded repair. | `/workflow adversarial-verification task="Verify the migration patch"` |
102
+ | `generate-and-filter` | Generate, dedupe, filter, optionally judge, and shortlist candidates. | `/workflow generate-and-filter prompt="Propose names for the new command"` |
103
+ | `tournament` | Compare whole solutions through balanced pairwise judging. | `/workflow tournament prompt="Design the retry strategy"` |
104
+ | `loop-until-done` | Iterate with a durable ledger until completion or bound exhaustion. | `/workflow loop-until-done prompt="Repair failures until the test suite passes"` |
99
105
  | `deep-research-codebase` | Broad, cross-cutting research before you decide what to change. Scout → research-history → parallel specialist waves → aggregator. | `/workflow deep-research-codebase prompt="How do payment retries work end to end?"` |
100
106
  | `goal` | Clearly delegated autonomous work that materially benefits from a durable goal ledger, bounded worker turns, named validation, and reviewer gates. It stops as `complete`, `blocked`, or `needs_human`, with optional final-stage PR creation through `create_pr=true` after approval. | `/workflow goal objective="Update the CLI docs for --json, include one example, run the docs build, and finish when the build passes"` |
101
107
  | `ralph` | Clearly delegated autonomous work that materially benefits from a durable research-first pipeline, delegated implementation, and iterative review. Ralph can start from a spec file, GitHub issue, or crisp ticket description and optionally lets only the final stage attempt PR creation with `create_pr=true`. | `/workflow ralph prompt="Implement specs/2026-03-rate-limit.md and validate burst traffic returns 429"` |
@@ -123,16 +129,16 @@ For an autonomous one-off job that materially benefits from a durable goal ledge
123
129
 
124
130
  ### Monitor and steer a run
125
131
 
126
- Named workflow runs execute in the background. After launch you get a run id; use it to inspect, attach, pause, or resume.
132
+ Named workflow runs execute in the background. After launch you get a run id; use it to inspect, connect, pause, quit, or resume.
127
133
 
128
134
  ```text
129
135
  /workflow status <run-id> # inspect one run's progress
130
136
  /workflow status # list this session's active and terminal runs
131
- /workflow connect <run-id> # watch, attach to stages, or steer (F2 also opens latest)
137
+ /workflow connect <run-id> # see agents working; chat with or steer each stage (F2 also opens latest)
132
138
  /workflow attach <run-id> <stage> # chat with one stage
133
139
  /workflow interrupt <run-id> # pause resumably
134
140
  /workflow resume <run-id> "go" # send a steer message and resume
135
- /workflow kill <run-id> # abort and retain for inspection
141
+ /workflow quit <run-id> # pause gracefully and keep the run resumable
136
142
  ```
137
143
 
138
144
  Human-in-the-loop prompts (`ctx.ui.input`, `confirm`, `select`, `editor`) surface in the graph viewer, not as chat modals — connect to the run to answer them.
package/docs/rpc.md CHANGED
@@ -414,7 +414,7 @@ Response:
414
414
 
415
415
  #### compact
416
416
 
417
- Run Atomic's verbatim line compactor. The selected session model receives a numbered transcript and returns JSON deleted ranges; Atomic validates them and mechanically reconstructs retained lines with `(filtered N lines)` markers. The command appends a durable `compaction` entry with `details.strategy: "verbatim-lines"`. Recent logical turns remain ordinary messages.
417
+ Run Atomic's verbatim line compactor. The selected session model receives the complete active numbered transcript except for exactly the newest `preserve_recent` context-visible messages and returns bare `start,end` deletion records; Atomic validates them and mechanically reconstructs retained lines with `(filtered N lines)` markers. The default tail is two messages, with no user-turn alignment. A value of zero sends the entire active transcript and persists `firstKeptEntryId: null`. The command appends a durable `compaction` entry with `details.strategy: "verbatim-lines"`.
418
418
 
419
419
  ```json
420
420
  {"type": "compact"}
@@ -430,13 +430,13 @@ Response:
430
430
  "compactedText": "[User]: fix the test\n(filtered 42 lines)\n[Assistant]: Fixed.",
431
431
  "firstKeptEntryId": "m7",
432
432
  "tokensBefore": 150000,
433
- "promptVersion": 2,
433
+ "promptVersion": 3,
434
434
  "parameters": {
435
435
  "compression_ratio": 0.5,
436
436
  "preserve_recent": 2,
437
437
  "query": "fix the test"
438
438
  },
439
- "rung": "standard",
439
+ "rung": "planned",
440
440
  "stats": {
441
441
  "linesBefore": 812,
442
442
  "linesDeleted": 417,
@@ -451,6 +451,8 @@ Response:
451
451
  }
452
452
  ```
453
453
 
454
+ `firstKeptEntryId` is a string when at least one ordinary message remains outside compaction and `null` when none does. RPC clients must accept both values.
455
+
454
456
  #### set_auto_compaction
455
457
 
456
458
  Enable or disable automatic compaction when context is nearly full.
@@ -1068,9 +1070,9 @@ The `reason` field is `"manual"`, `"threshold"`, or `"overflow"`.
1068
1070
  "compactedText": "[User]: fix the test\n(filtered 42 lines)",
1069
1071
  "firstKeptEntryId": "m7",
1070
1072
  "tokensBefore": 150000,
1071
- "promptVersion": 2,
1073
+ "promptVersion": 3,
1072
1074
  "parameters": {"compression_ratio": 0.5, "preserve_recent": 2, "query": "fix the test"},
1073
- "rung": "standard",
1075
+ "rung": "planned",
1074
1076
  "stats": {
1075
1077
  "linesBefore": 812,
1076
1078
  "linesDeleted": 417,
@@ -1154,9 +1156,9 @@ If a dialog method includes a `timeout` field, the agent-side will auto-resolve
1154
1156
 
1155
1157
  Some `ExtensionUIContext` methods are not supported or degraded in RPC mode because they require direct TUI access:
1156
1158
  - `custom()` returns `undefined`
1157
- - `setWorkingMessage()`, `setWorkingIndicator()`, `setFooter()`, `setHeader()`, `setEditorComponent()`, `setToolsExpanded()` are no-ops
1159
+ - `setWorkingMessage()`, `setWorkingIndicator()`, `setFooter()`, `setHeader()`, `setEditorComponent()` are no-ops
1158
1160
  - `getEditorText()` returns `""`
1159
- - `getToolsExpanded()` returns `false`
1161
+ - `setToolsExpanded()` and `getToolsExpanded()` maintain context-local expansion state; `getChatRenderSettings().toolOutputExpanded` reports the same value. This state is not sent through the client extension-UI protocol.
1160
1162
  - `pasteToEditor()` delegates to `setEditorText()` (no paste/collapse handling)
1161
1163
  - `getAllThemes()` returns `[]`
1162
1164
  - `getTheme()` returns `undefined`