@bastani/atomic 0.9.89 → 0.9.90

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 (868) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +25 -0
  3. package/dist/builtin/intercom/README.md +3 -1
  4. package/dist/builtin/intercom/broker/broker.ts +35 -10
  5. package/dist/builtin/intercom/broker/client.ts +42 -1
  6. package/dist/builtin/intercom/index.bundle.mjs +400 -67
  7. package/dist/builtin/intercom/package.json +1 -1
  8. package/dist/builtin/intercom/skills/intercom/SKILL.md +24 -5
  9. package/dist/builtin/intercom/types.ts +5 -0
  10. package/dist/builtin/mcp/package.json +1 -1
  11. package/dist/builtin/subagents/CHANGELOG.md +53 -0
  12. package/dist/builtin/subagents/README.md +18 -20
  13. package/dist/builtin/subagents/agents/worker.md +1 -1
  14. package/dist/builtin/subagents/package.json +1 -1
  15. package/dist/builtin/subagents/skills/feedback/SKILL.md +2 -2
  16. package/dist/builtin/subagents/skills/qlty/SKILL.md +2 -2
  17. package/dist/builtin/subagents/skills/qlty/references/commands.md +45 -12
  18. package/dist/builtin/subagents/skills/qlty/references/quickstart.md +102 -21
  19. package/dist/builtin/subagents/skills/subagent/SKILL.md +18 -17
  20. package/dist/builtin/subagents/skills/tdd/LICENSE.txt +50 -0
  21. package/dist/builtin/subagents/skills/tdd/SKILL.md +10 -0
  22. package/dist/builtin/subagents/skills/tdd/tests.md +16 -0
  23. package/dist/builtin/subagents/skills/tmux/LICENSE.txt +24 -0
  24. package/dist/builtin/subagents/skills/tmux/SKILL.md +20 -1
  25. package/dist/builtin/subagents/skills/tmux/scripts/find-sessions.sh +19 -10
  26. package/dist/builtin/subagents/skills/tmux/scripts/wait-for-text.sh +231 -19
  27. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1911 -845
  28. package/dist/builtin/web-access/CHANGELOG.md +12 -0
  29. package/dist/builtin/web-access/index.bundle.mjs +158 -34
  30. package/dist/builtin/web-access/package.json +1 -1
  31. package/dist/builtin/workflows/CHANGELOG.md +68 -0
  32. package/dist/builtin/workflows/builtin/{chunk-tjk7jp9a.js → chunk-akmcsx14.js} +1 -1
  33. package/dist/builtin/workflows/builtin/{chunk-913nwrzq.js → chunk-erpybg3c.js} +109 -30
  34. package/dist/builtin/workflows/builtin/{chunk-e07n7en6.js → chunk-wpgpr31s.js} +1 -1
  35. package/dist/builtin/workflows/builtin/goal.js +2 -2
  36. package/dist/builtin/workflows/builtin/index.js +3 -3
  37. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  38. package/dist/builtin/workflows/package.json +1 -1
  39. package/dist/builtin/workflows/skills/bro/SKILL.md +1 -1
  40. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_2.md +19 -19
  41. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +2 -2
  42. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +3 -3
  43. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +2 -2
  44. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_sol.md +2 -2
  45. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_terra.md +3 -3
  46. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_2.md +3 -2
  47. package/dist/builtin/workflows/skills/show-me/SKILL.md +2 -2
  48. package/dist/builtin/workflows/skills/skill-creator/scripts/run_eval.py +29 -24
  49. package/dist/builtin/workflows/skills/teach/SKILL.md +8 -8
  50. package/dist/builtin/workflows/skills/unslop/SKILL.md +29 -51
  51. package/dist/builtin/workflows/src/durable/journal/internal.d.ts +10 -5
  52. package/dist/builtin/workflows/src/durable/journal/sharded-run-journal.d.ts +6 -3
  53. package/dist/builtin/workflows/src/durable/journal/sql-run-journal.d.ts +25 -3
  54. package/dist/builtin/workflows/src/extension/index.bundle.mjs +4444 -1356
  55. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +2544 -568
  56. package/dist/builtin/workflows/src/index.js +2467 -549
  57. package/dist/builtin/workflows/src/local-worker-entry.mjs +2544 -568
  58. package/dist/cli/storage-command.d.ts +6 -0
  59. package/dist/cli/storage-command.d.ts.map +1 -1
  60. package/dist/cli/storage-command.js +11 -0
  61. package/dist/cli/storage-command.js.map +1 -1
  62. package/dist/cli/storage-search-database.d.ts +18 -0
  63. package/dist/cli/storage-search-database.d.ts.map +1 -0
  64. package/dist/cli/storage-search-database.js +90 -0
  65. package/dist/cli/storage-search-database.js.map +1 -0
  66. package/dist/cli/storage-search-session.d.ts +5 -0
  67. package/dist/cli/storage-search-session.d.ts.map +1 -0
  68. package/dist/cli/storage-search-session.js +133 -0
  69. package/dist/cli/storage-search-session.js.map +1 -0
  70. package/dist/core/agent-session-accessors.d.ts.map +1 -1
  71. package/dist/core/agent-session-accessors.js +107 -1
  72. package/dist/core/agent-session-accessors.js.map +1 -1
  73. package/dist/core/agent-session-bash.d.ts.map +1 -1
  74. package/dist/core/agent-session-bash.js +2 -0
  75. package/dist/core/agent-session-bash.js.map +1 -1
  76. package/dist/core/agent-session-boundaries.d.ts +2 -0
  77. package/dist/core/agent-session-boundaries.d.ts.map +1 -1
  78. package/dist/core/agent-session-boundaries.js +9 -4
  79. package/dist/core/agent-session-boundaries.js.map +1 -1
  80. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
  81. package/dist/core/agent-session-custom-message-commit.js +2 -1
  82. package/dist/core/agent-session-custom-message-commit.js.map +1 -1
  83. package/dist/core/agent-session-detached-tools.d.ts +3 -2
  84. package/dist/core/agent-session-detached-tools.d.ts.map +1 -1
  85. package/dist/core/agent-session-detached-tools.js +156 -41
  86. package/dist/core/agent-session-detached-tools.js.map +1 -1
  87. package/dist/core/agent-session-events.d.ts +2 -1
  88. package/dist/core/agent-session-events.d.ts.map +1 -1
  89. package/dist/core/agent-session-events.js +59 -23
  90. package/dist/core/agent-session-events.js.map +1 -1
  91. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  92. package/dist/core/agent-session-extension-bindings.js +53 -4
  93. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  94. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  95. package/dist/core/agent-session-message-queue.js +2 -1
  96. package/dist/core/agent-session-message-queue.js.map +1 -1
  97. package/dist/core/agent-session-methods.d.ts +23 -3
  98. package/dist/core/agent-session-methods.d.ts.map +1 -1
  99. package/dist/core/agent-session-methods.js.map +1 -1
  100. package/dist/core/agent-session-models.d.ts.map +1 -1
  101. package/dist/core/agent-session-models.js +2 -0
  102. package/dist/core/agent-session-models.js.map +1 -1
  103. package/dist/core/agent-session-prompt.d.ts +1 -1
  104. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  105. package/dist/core/agent-session-prompt.js +14 -3
  106. package/dist/core/agent-session-prompt.js.map +1 -1
  107. package/dist/core/agent-session-queue-pause.d.ts +2 -1
  108. package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
  109. package/dist/core/agent-session-queue-pause.js +8 -4
  110. package/dist/core/agent-session-queue-pause.js.map +1 -1
  111. package/dist/core/agent-session-retry.d.ts +7 -3
  112. package/dist/core/agent-session-retry.d.ts.map +1 -1
  113. package/dist/core/agent-session-retry.js +113 -112
  114. package/dist/core/agent-session-retry.js.map +1 -1
  115. package/dist/core/agent-session-runtime.d.ts +15 -0
  116. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  117. package/dist/core/agent-session-runtime.js +26 -0
  118. package/dist/core/agent-session-runtime.js.map +1 -1
  119. package/dist/core/agent-session-services.d.ts +5 -2
  120. package/dist/core/agent-session-services.d.ts.map +1 -1
  121. package/dist/core/agent-session-services.js +6 -6
  122. package/dist/core/agent-session-services.js.map +1 -1
  123. package/dist/core/agent-session-tasks.js.map +1 -1
  124. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  125. package/dist/core/agent-session-tool-registry.js +4 -2
  126. package/dist/core/agent-session-tool-registry.js.map +1 -1
  127. package/dist/core/agent-session-types.d.ts +19 -1
  128. package/dist/core/agent-session-types.d.ts.map +1 -1
  129. package/dist/core/agent-session-types.js.map +1 -1
  130. package/dist/core/agent-session.d.ts +11 -0
  131. package/dist/core/agent-session.d.ts.map +1 -1
  132. package/dist/core/agent-session.js +8 -0
  133. package/dist/core/agent-session.js.map +1 -1
  134. package/dist/core/anthropic-thinking-guard.d.ts +16 -1
  135. package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
  136. package/dist/core/anthropic-thinking-guard.js +124 -7
  137. package/dist/core/anthropic-thinking-guard.js.map +1 -1
  138. package/dist/core/auth-storage.d.ts +3 -0
  139. package/dist/core/auth-storage.d.ts.map +1 -1
  140. package/dist/core/auth-storage.js +10 -0
  141. package/dist/core/auth-storage.js.map +1 -1
  142. package/dist/core/detached-tool-output.d.ts +4 -0
  143. package/dist/core/detached-tool-output.d.ts.map +1 -0
  144. package/dist/core/detached-tool-output.js +48 -0
  145. package/dist/core/detached-tool-output.js.map +1 -0
  146. package/dist/core/event-loop-monitor.d.ts +4 -1
  147. package/dist/core/event-loop-monitor.d.ts.map +1 -1
  148. package/dist/core/event-loop-monitor.js +84 -159
  149. package/dist/core/event-loop-monitor.js.map +1 -1
  150. package/dist/core/export-html/index.d.ts.map +1 -1
  151. package/dist/core/export-html/index.js +26 -4
  152. package/dist/core/export-html/index.js.map +1 -1
  153. package/dist/core/export-html/saved-agent-cards.d.ts +15 -0
  154. package/dist/core/export-html/saved-agent-cards.d.ts.map +1 -0
  155. package/dist/core/export-html/saved-agent-cards.js +255 -0
  156. package/dist/core/export-html/saved-agent-cards.js.map +1 -0
  157. package/dist/core/export-html/saved-agent-viewer.js +101 -0
  158. package/dist/core/extensions/builtin-subagent-record-writer.d.ts +11 -0
  159. package/dist/core/extensions/builtin-subagent-record-writer.d.ts.map +1 -0
  160. package/dist/core/extensions/builtin-subagent-record-writer.js +33 -0
  161. package/dist/core/extensions/builtin-subagent-record-writer.js.map +1 -0
  162. package/dist/core/extensions/loader-api.d.ts +1 -1
  163. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  164. package/dist/core/extensions/loader-api.js +9 -2
  165. package/dist/core/extensions/loader-api.js.map +1 -1
  166. package/dist/core/extensions/loader-bindings.d.ts +7 -0
  167. package/dist/core/extensions/loader-bindings.d.ts.map +1 -1
  168. package/dist/core/extensions/loader-bindings.js +42 -1
  169. package/dist/core/extensions/loader-bindings.js.map +1 -1
  170. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  171. package/dist/core/extensions/loader-core.js +33 -12
  172. package/dist/core/extensions/loader-core.js.map +1 -1
  173. package/dist/core/extensions/runner-events.d.ts +2 -0
  174. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  175. package/dist/core/extensions/runner-events.js +17 -7
  176. package/dist/core/extensions/runner-events.js.map +1 -1
  177. package/dist/core/extensions/runner.d.ts +6 -2
  178. package/dist/core/extensions/runner.d.ts.map +1 -1
  179. package/dist/core/extensions/runner.js +5 -2
  180. package/dist/core/extensions/runner.js.map +1 -1
  181. package/dist/core/extensions/ui-types.d.ts +4 -0
  182. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  183. package/dist/core/extensions/ui-types.js.map +1 -1
  184. package/dist/core/extensions/workflow-run-control-hub.d.ts +2 -2
  185. package/dist/core/extensions/workflow-run-control-hub.d.ts.map +1 -1
  186. package/dist/core/extensions/workflow-run-control-hub.js +2 -2
  187. package/dist/core/extensions/workflow-run-control-hub.js.map +1 -1
  188. package/dist/core/extensions/workflow-run-control.d.ts +10 -3
  189. package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
  190. package/dist/core/extensions/workflow-run-control.js.map +1 -1
  191. package/dist/core/first-prompt-model.d.ts +22 -0
  192. package/dist/core/first-prompt-model.d.ts.map +1 -0
  193. package/dist/core/first-prompt-model.js +84 -0
  194. package/dist/core/first-prompt-model.js.map +1 -0
  195. package/dist/core/footer-data-provider.d.ts.map +1 -1
  196. package/dist/core/footer-data-provider.js +11 -7
  197. package/dist/core/footer-data-provider.js.map +1 -1
  198. package/dist/core/fork-replay-pair.d.ts +22 -0
  199. package/dist/core/fork-replay-pair.d.ts.map +1 -0
  200. package/dist/core/fork-replay-pair.js +174 -0
  201. package/dist/core/fork-replay-pair.js.map +1 -0
  202. package/dist/core/fork-replay-wire.d.ts +11 -0
  203. package/dist/core/fork-replay-wire.d.ts.map +1 -0
  204. package/dist/core/fork-replay-wire.js +116 -0
  205. package/dist/core/fork-replay-wire.js.map +1 -0
  206. package/dist/core/messages.d.ts +2 -0
  207. package/dist/core/messages.d.ts.map +1 -1
  208. package/dist/core/messages.js +8 -4
  209. package/dist/core/messages.js.map +1 -1
  210. package/dist/core/model-runtime.d.ts +10 -1
  211. package/dist/core/model-runtime.d.ts.map +1 -1
  212. package/dist/core/model-runtime.js +76 -11
  213. package/dist/core/model-runtime.js.map +1 -1
  214. package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
  215. package/dist/core/package-manager-auto-resources.js +3 -2
  216. package/dist/core/package-manager-auto-resources.js.map +1 -1
  217. package/dist/core/package-manager-resource-files.js +7 -8
  218. package/dist/core/package-manager-resource-files.js.map +1 -1
  219. package/dist/core/project-trust-state.d.ts +90 -0
  220. package/dist/core/project-trust-state.d.ts.map +1 -0
  221. package/dist/core/project-trust-state.js +65 -0
  222. package/dist/core/project-trust-state.js.map +1 -0
  223. package/dist/core/provider-rate-limits.d.ts +6 -0
  224. package/dist/core/provider-rate-limits.d.ts.map +1 -1
  225. package/dist/core/provider-rate-limits.js +43 -0
  226. package/dist/core/provider-rate-limits.js.map +1 -1
  227. package/dist/core/provider-request-admission.d.ts.map +1 -1
  228. package/dist/core/provider-request-admission.js +10 -1
  229. package/dist/core/provider-request-admission.js.map +1 -1
  230. package/dist/core/remote-catalog-provider.d.ts +6 -1
  231. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  232. package/dist/core/remote-catalog-provider.js +22 -1
  233. package/dist/core/remote-catalog-provider.js.map +1 -1
  234. package/dist/core/resolve-config-value.d.ts.map +1 -1
  235. package/dist/core/resolve-config-value.js +5 -2
  236. package/dist/core/resolve-config-value.js.map +1 -1
  237. package/dist/core/resource-loader-core.d.ts.map +1 -1
  238. package/dist/core/resource-loader-core.js +3 -0
  239. package/dist/core/resource-loader-core.js.map +1 -1
  240. package/dist/core/resource-loader-extensions.d.ts +2 -2
  241. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  242. package/dist/core/resource-loader-extensions.js +6 -4
  243. package/dist/core/resource-loader-extensions.js.map +1 -1
  244. package/dist/core/resource-loader-package-resources.d.ts +1 -0
  245. package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
  246. package/dist/core/resource-loader-package-resources.js +2 -1
  247. package/dist/core/resource-loader-package-resources.js.map +1 -1
  248. package/dist/core/resource-loader-reload.d.ts +1 -1
  249. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  250. package/dist/core/resource-loader-reload.js +3 -2
  251. package/dist/core/resource-loader-reload.js.map +1 -1
  252. package/dist/core/resource-loader-types.d.ts +2 -0
  253. package/dist/core/resource-loader-types.d.ts.map +1 -1
  254. package/dist/core/resource-loader-types.js.map +1 -1
  255. package/dist/core/resume/blueprint/actions.d.ts.map +1 -1
  256. package/dist/core/resume/blueprint/actions.js +15 -15
  257. package/dist/core/resume/blueprint/actions.js.map +1 -1
  258. package/dist/core/resume/blueprint/process.d.ts +6 -1
  259. package/dist/core/resume/blueprint/process.d.ts.map +1 -1
  260. package/dist/core/resume/blueprint/process.js +132 -21
  261. package/dist/core/resume/blueprint/process.js.map +1 -1
  262. package/dist/core/runtime-credentials.d.ts +5 -0
  263. package/dist/core/runtime-credentials.d.ts.map +1 -1
  264. package/dist/core/runtime-credentials.js +34 -0
  265. package/dist/core/runtime-credentials.js.map +1 -1
  266. package/dist/core/sdk-types.d.ts +2 -0
  267. package/dist/core/sdk-types.d.ts.map +1 -1
  268. package/dist/core/sdk-types.js.map +1 -1
  269. package/dist/core/sdk.d.ts +1 -1
  270. package/dist/core/sdk.d.ts.map +1 -1
  271. package/dist/core/sdk.js +187 -32
  272. package/dist/core/sdk.js.map +1 -1
  273. package/dist/core/session-account-model.d.ts +15 -0
  274. package/dist/core/session-account-model.d.ts.map +1 -0
  275. package/dist/core/session-account-model.js +105 -0
  276. package/dist/core/session-account-model.js.map +1 -0
  277. package/dist/core/session-lifecycle-scope.d.ts +5 -0
  278. package/dist/core/session-lifecycle-scope.d.ts.map +1 -1
  279. package/dist/core/session-lifecycle-scope.js.map +1 -1
  280. package/dist/core/session-manager-core.d.ts +21 -2
  281. package/dist/core/session-manager-core.d.ts.map +1 -1
  282. package/dist/core/session-manager-core.js +64 -8
  283. package/dist/core/session-manager-core.js.map +1 -1
  284. package/dist/core/session-manager-history.d.ts +3 -1
  285. package/dist/core/session-manager-history.d.ts.map +1 -1
  286. package/dist/core/session-manager-history.js +19 -5
  287. package/dist/core/session-manager-history.js.map +1 -1
  288. package/dist/core/session-manager-types.d.ts +2 -0
  289. package/dist/core/session-manager-types.d.ts.map +1 -1
  290. package/dist/core/session-manager-types.js.map +1 -1
  291. package/dist/core/session-retry-status.d.ts +22 -0
  292. package/dist/core/session-retry-status.d.ts.map +1 -0
  293. package/dist/core/session-retry-status.js +25 -0
  294. package/dist/core/session-retry-status.js.map +1 -0
  295. package/dist/core/session-worktree-snapshots.d.ts +4 -2
  296. package/dist/core/session-worktree-snapshots.d.ts.map +1 -1
  297. package/dist/core/session-worktree-snapshots.js +8 -4
  298. package/dist/core/session-worktree-snapshots.js.map +1 -1
  299. package/dist/core/settings-manager-core.d.ts +4 -0
  300. package/dist/core/settings-manager-core.d.ts.map +1 -1
  301. package/dist/core/settings-manager-core.js +73 -1
  302. package/dist/core/settings-manager-core.js.map +1 -1
  303. package/dist/core/settings-schema.js +1 -1
  304. package/dist/core/settings-schema.js.map +1 -1
  305. package/dist/core/slash-commands.d.ts +2 -2
  306. package/dist/core/slash-commands.d.ts.map +1 -1
  307. package/dist/core/slash-commands.js +15 -4
  308. package/dist/core/slash-commands.js.map +1 -1
  309. package/dist/core/storage/database.d.ts +14 -2
  310. package/dist/core/storage/database.d.ts.map +1 -1
  311. package/dist/core/storage/database.js.map +1 -1
  312. package/dist/core/storage/dialect.d.ts +13 -0
  313. package/dist/core/storage/dialect.d.ts.map +1 -1
  314. package/dist/core/storage/dialect.js +9 -1
  315. package/dist/core/storage/dialect.js.map +1 -1
  316. package/dist/core/storage/errors.d.ts +23 -1
  317. package/dist/core/storage/errors.d.ts.map +1 -1
  318. package/dist/core/storage/errors.js +28 -5
  319. package/dist/core/storage/errors.js.map +1 -1
  320. package/dist/core/storage/journal-transfer.d.ts.map +1 -1
  321. package/dist/core/storage/journal-transfer.js +90 -5
  322. package/dist/core/storage/journal-transfer.js.map +1 -1
  323. package/dist/core/storage/node-sqlite.d.ts.map +1 -1
  324. package/dist/core/storage/node-sqlite.js +61 -1
  325. package/dist/core/storage/node-sqlite.js.map +1 -1
  326. package/dist/core/storage/session/chunked-resume-projection.d.ts +4 -0
  327. package/dist/core/storage/session/chunked-resume-projection.d.ts.map +1 -0
  328. package/dist/core/storage/session/chunked-resume-projection.js +369 -0
  329. package/dist/core/storage/session/chunked-resume-projection.js.map +1 -0
  330. package/dist/core/storage/session/legacy-session-store.d.ts +5 -0
  331. package/dist/core/storage/session/legacy-session-store.d.ts.map +1 -1
  332. package/dist/core/storage/session/legacy-session-store.js +10 -2
  333. package/dist/core/storage/session/legacy-session-store.js.map +1 -1
  334. package/dist/core/storage/session/memory-session-store.d.ts.map +1 -1
  335. package/dist/core/storage/session/memory-session-store.js +6 -1
  336. package/dist/core/storage/session/memory-session-store.js.map +1 -1
  337. package/dist/core/storage/session/snapshot-generation.d.ts +8 -0
  338. package/dist/core/storage/session/snapshot-generation.d.ts.map +1 -0
  339. package/dist/core/storage/session/snapshot-generation.js +17 -0
  340. package/dist/core/storage/session/snapshot-generation.js.map +1 -0
  341. package/dist/core/storage/session/sql-session-store.d.ts +12 -0
  342. package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
  343. package/dist/core/storage/session/sql-session-store.js +243 -46
  344. package/dist/core/storage/session/sql-session-store.js.map +1 -1
  345. package/dist/core/storage/sqlite-facade.d.ts +17 -2
  346. package/dist/core/storage/sqlite-facade.d.ts.map +1 -1
  347. package/dist/core/storage/sqlite-facade.js +17 -1
  348. package/dist/core/storage/sqlite-facade.js.map +1 -1
  349. package/dist/core/tasks/agent-adapter.d.ts +13 -2
  350. package/dist/core/tasks/agent-adapter.d.ts.map +1 -1
  351. package/dist/core/tasks/agent-adapter.js +25 -8
  352. package/dist/core/tasks/agent-adapter.js.map +1 -1
  353. package/dist/core/tasks/agent-panel-rules.d.ts +77 -0
  354. package/dist/core/tasks/agent-panel-rules.d.ts.map +1 -0
  355. package/dist/core/tasks/agent-panel-rules.js +88 -0
  356. package/dist/core/tasks/agent-panel-rules.js.map +1 -0
  357. package/dist/core/tasks/agent-panel-source.d.ts +19 -0
  358. package/dist/core/tasks/agent-panel-source.d.ts.map +1 -1
  359. package/dist/core/tasks/agent-panel-source.js +50 -9
  360. package/dist/core/tasks/agent-panel-source.js.map +1 -1
  361. package/dist/core/tasks/command-output.d.ts +17 -2
  362. package/dist/core/tasks/command-output.d.ts.map +1 -1
  363. package/dist/core/tasks/command-output.js +59 -3
  364. package/dist/core/tasks/command-output.js.map +1 -1
  365. package/dist/core/tasks/completion-message.d.ts +8 -3
  366. package/dist/core/tasks/completion-message.d.ts.map +1 -1
  367. package/dist/core/tasks/completion-message.js +14 -10
  368. package/dist/core/tasks/completion-message.js.map +1 -1
  369. package/dist/core/tasks/completion.d.ts +14 -4
  370. package/dist/core/tasks/completion.d.ts.map +1 -1
  371. package/dist/core/tasks/completion.js +58 -17
  372. package/dist/core/tasks/completion.js.map +1 -1
  373. package/dist/core/tasks/contracts.d.ts +10 -1
  374. package/dist/core/tasks/contracts.d.ts.map +1 -1
  375. package/dist/core/tasks/contracts.js +3 -1
  376. package/dist/core/tasks/contracts.js.map +1 -1
  377. package/dist/core/tasks/heartbeat.js +2 -1
  378. package/dist/core/tasks/heartbeat.js.map +1 -1
  379. package/dist/core/tasks/live-elapsed.d.ts +16 -1
  380. package/dist/core/tasks/live-elapsed.d.ts.map +1 -1
  381. package/dist/core/tasks/live-elapsed.js +43 -4
  382. package/dist/core/tasks/live-elapsed.js.map +1 -1
  383. package/dist/core/tasks/owner-store.d.ts +8 -0
  384. package/dist/core/tasks/owner-store.d.ts.map +1 -1
  385. package/dist/core/tasks/owner-store.js +34 -4
  386. package/dist/core/tasks/owner-store.js.map +1 -1
  387. package/dist/core/tasks/session-scope.d.ts +7 -0
  388. package/dist/core/tasks/session-scope.d.ts.map +1 -1
  389. package/dist/core/tasks/session-scope.js +15 -9
  390. package/dist/core/tasks/session-scope.js.map +1 -1
  391. package/dist/core/tasks/supervisor.d.ts +7 -3
  392. package/dist/core/tasks/supervisor.d.ts.map +1 -1
  393. package/dist/core/tasks/supervisor.js +92 -17
  394. package/dist/core/tasks/supervisor.js.map +1 -1
  395. package/dist/core/tasks/task-archive-snapshot.d.ts +7 -0
  396. package/dist/core/tasks/task-archive-snapshot.d.ts.map +1 -0
  397. package/dist/core/tasks/task-archive-snapshot.js +33 -0
  398. package/dist/core/tasks/task-archive-snapshot.js.map +1 -0
  399. package/dist/core/tasks/task-resumer.d.ts +5 -3
  400. package/dist/core/tasks/task-resumer.d.ts.map +1 -1
  401. package/dist/core/tasks/task-resumer.js +37 -13
  402. package/dist/core/tasks/task-resumer.js.map +1 -1
  403. package/dist/core/tasks/task-view-source.d.ts +25 -3
  404. package/dist/core/tasks/task-view-source.d.ts.map +1 -1
  405. package/dist/core/tasks/task-view-source.js +144 -44
  406. package/dist/core/tasks/task-view-source.js.map +1 -1
  407. package/dist/core/tasks/transcript.d.ts +3 -1
  408. package/dist/core/tasks/transcript.d.ts.map +1 -1
  409. package/dist/core/tasks/transcript.js +27 -0
  410. package/dist/core/tasks/transcript.js.map +1 -1
  411. package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts.map +1 -1
  412. package/dist/core/tools/ask-user-question/view/dialog-builder.js +2 -1
  413. package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
  414. package/dist/core/tools/bash.d.ts.map +1 -1
  415. package/dist/core/tools/bash.js +2 -1
  416. package/dist/core/tools/bash.js.map +1 -1
  417. package/dist/core/tools/history-protocol.d.ts.map +1 -1
  418. package/dist/core/tools/history-protocol.js +130 -29
  419. package/dist/core/tools/history-protocol.js.map +1 -1
  420. package/dist/core/tools/history-search-position.d.ts +30 -0
  421. package/dist/core/tools/history-search-position.d.ts.map +1 -0
  422. package/dist/core/tools/history-search-position.js +161 -0
  423. package/dist/core/tools/history-search-position.js.map +1 -0
  424. package/dist/core/tools/history-search-wire.d.ts +25 -0
  425. package/dist/core/tools/history-search-wire.d.ts.map +1 -0
  426. package/dist/core/tools/history-search-wire.js +210 -0
  427. package/dist/core/tools/history-search-wire.js.map +1 -0
  428. package/dist/core/tools/resource-selectors.d.ts +7 -1
  429. package/dist/core/tools/resource-selectors.d.ts.map +1 -1
  430. package/dist/core/tools/resource-selectors.js +18 -11
  431. package/dist/core/tools/resource-selectors.js.map +1 -1
  432. package/dist/core/tools/search.d.ts.map +1 -1
  433. package/dist/core/tools/search.js +24 -3
  434. package/dist/core/tools/search.js.map +1 -1
  435. package/dist/core/tools/sqlite-selector-connection.d.ts +3 -0
  436. package/dist/core/tools/sqlite-selector-connection.d.ts.map +1 -1
  437. package/dist/core/tools/sqlite-selector-connection.js +4 -0
  438. package/dist/core/tools/sqlite-selector-connection.js.map +1 -1
  439. package/dist/core/tools/tool-abort-grace.d.ts +13 -0
  440. package/dist/core/tools/tool-abort-grace.d.ts.map +1 -0
  441. package/dist/core/tools/tool-abort-grace.js +72 -0
  442. package/dist/core/tools/tool-abort-grace.js.map +1 -0
  443. package/dist/core/tools/tool-concurrency.d.ts +5 -1
  444. package/dist/core/tools/tool-concurrency.d.ts.map +1 -1
  445. package/dist/core/tools/tool-concurrency.js +36 -6
  446. package/dist/core/tools/tool-concurrency.js.map +1 -1
  447. package/dist/core/workflow-resume.d.ts +1 -1
  448. package/dist/core/workflow-resume.d.ts.map +1 -1
  449. package/dist/core/workflow-resume.js +13 -3
  450. package/dist/core/workflow-resume.js.map +1 -1
  451. package/dist/core/workflow-summary-lifecycle.d.ts.map +1 -1
  452. package/dist/core/workflow-summary-lifecycle.js +8 -2
  453. package/dist/core/workflow-summary-lifecycle.js.map +1 -1
  454. package/dist/core/workspace/errors.d.ts +5 -2
  455. package/dist/core/workspace/errors.d.ts.map +1 -1
  456. package/dist/core/workspace/errors.js +59 -5
  457. package/dist/core/workspace/errors.js.map +1 -1
  458. package/dist/core/worktree-snapshot/blob-store.d.ts +138 -17
  459. package/dist/core/worktree-snapshot/blob-store.d.ts.map +1 -1
  460. package/dist/core/worktree-snapshot/blob-store.js +788 -82
  461. package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
  462. package/dist/core/worktree-snapshot/garbage.d.ts +17 -2
  463. package/dist/core/worktree-snapshot/garbage.d.ts.map +1 -1
  464. package/dist/core/worktree-snapshot/garbage.js +20 -4
  465. package/dist/core/worktree-snapshot/garbage.js.map +1 -1
  466. package/dist/core/worktree-snapshot/index.d.ts +1 -1
  467. package/dist/core/worktree-snapshot/index.d.ts.map +1 -1
  468. package/dist/core/worktree-snapshot/index.js +1 -1
  469. package/dist/core/worktree-snapshot/index.js.map +1 -1
  470. package/dist/core/worktree-snapshot/pool.d.ts.map +1 -1
  471. package/dist/core/worktree-snapshot/pool.js +38 -6
  472. package/dist/core/worktree-snapshot/pool.js.map +1 -1
  473. package/dist/core/worktree-snapshot/shared-clock.d.ts +3 -1
  474. package/dist/core/worktree-snapshot/shared-clock.d.ts.map +1 -1
  475. package/dist/core/worktree-snapshot/shared-clock.js +116 -26
  476. package/dist/core/worktree-snapshot/shared-clock.js.map +1 -1
  477. package/dist/core/worktree-snapshot/types.d.ts +4 -1
  478. package/dist/core/worktree-snapshot/types.d.ts.map +1 -1
  479. package/dist/core/worktree-snapshot/types.js.map +1 -1
  480. package/dist/extensions/llama/huggingface-ui.d.ts.map +1 -1
  481. package/dist/extensions/llama/huggingface-ui.js +2 -2
  482. package/dist/extensions/llama/huggingface-ui.js.map +1 -1
  483. package/dist/extensions/llama/index.d.ts +2 -0
  484. package/dist/extensions/llama/index.d.ts.map +1 -1
  485. package/dist/extensions/llama/index.js +19 -2
  486. package/dist/extensions/llama/index.js.map +1 -1
  487. package/dist/index.d.ts +9 -6
  488. package/dist/index.d.ts.map +1 -1
  489. package/dist/index.js +8 -4
  490. package/dist/index.js.map +1 -1
  491. package/dist/main.d.ts.map +1 -1
  492. package/dist/main.js +74 -15
  493. package/dist/main.js.map +1 -1
  494. package/dist/modes/interactive/components/agent-panel.d.ts +22 -6
  495. package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
  496. package/dist/modes/interactive/components/agent-panel.js +80 -23
  497. package/dist/modes/interactive/components/agent-panel.js.map +1 -1
  498. package/dist/modes/interactive/components/assistant-message.d.ts +2 -0
  499. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  500. package/dist/modes/interactive/components/assistant-message.js +11 -0
  501. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  502. package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -1
  503. package/dist/modes/interactive/components/atomic-working-status.js +10 -3
  504. package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
  505. package/dist/modes/interactive/components/bash-execution.d.ts +3 -2
  506. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  507. package/dist/modes/interactive/components/bash-execution.js +7 -7
  508. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  509. package/dist/modes/interactive/components/branch-summary-message.d.ts +6 -0
  510. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  511. package/dist/modes/interactive/components/branch-summary-message.js +12 -7
  512. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  513. package/dist/modes/interactive/components/chat-message-renderer.d.ts +2 -0
  514. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/chat-message-renderer.js +24 -3
  516. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  517. package/dist/modes/interactive/components/chat-session-host-actions.d.ts +1 -1
  518. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  519. package/dist/modes/interactive/components/chat-session-host-actions.js +16 -10
  520. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  521. package/dist/modes/interactive/components/chat-session-host-events.d.ts +10 -0
  522. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/chat-session-host-events.js +76 -31
  524. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  525. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts +17 -5
  526. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  527. package/dist/modes/interactive/components/chat-session-host-rendering.js +79 -24
  528. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  529. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  530. package/dist/modes/interactive/components/chat-session-host-runtime.js +5 -4
  531. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  532. package/dist/modes/interactive/components/chat-session-host-state.d.ts +16 -1
  533. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/chat-session-host-state.js +22 -0
  535. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  536. package/dist/modes/interactive/components/chat-session-host-types.d.ts +8 -2
  537. package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
  538. package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
  539. package/dist/modes/interactive/components/chat-session-host-utils.d.ts +1 -0
  540. package/dist/modes/interactive/components/chat-session-host-utils.d.ts.map +1 -1
  541. package/dist/modes/interactive/components/chat-session-host-utils.js +2 -1
  542. package/dist/modes/interactive/components/chat-session-host-utils.js.map +1 -1
  543. package/dist/modes/interactive/components/chat-session-host.d.ts +35 -9
  544. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/chat-session-host.js +129 -35
  546. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  547. package/dist/modes/interactive/components/chat-transcript.d.ts +13 -2
  548. package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
  549. package/dist/modes/interactive/components/chat-transcript.js +24 -4
  550. package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
  551. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +6 -0
  552. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  553. package/dist/modes/interactive/components/compaction-boundary-message.js +12 -7
  554. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  555. package/dist/modes/interactive/components/composer-rule.d.ts +0 -2
  556. package/dist/modes/interactive/components/composer-rule.d.ts.map +1 -1
  557. package/dist/modes/interactive/components/composer-rule.js +4 -6
  558. package/dist/modes/interactive/components/composer-rule.js.map +1 -1
  559. package/dist/modes/interactive/components/countdown-timer.d.ts +5 -9
  560. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  561. package/dist/modes/interactive/components/countdown-timer.js +32 -23
  562. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  563. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  564. package/dist/modes/interactive/components/custom-editor.js +4 -3
  565. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  566. package/dist/modes/interactive/components/custom-entry.d.ts +6 -0
  567. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  568. package/dist/modes/interactive/components/custom-entry.js +15 -0
  569. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  570. package/dist/modes/interactive/components/custom-message.d.ts +7 -3
  571. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  572. package/dist/modes/interactive/components/custom-message.js +17 -15
  573. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  574. package/dist/modes/interactive/components/footer.d.ts +10 -3
  575. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  576. package/dist/modes/interactive/components/footer.js +37 -45
  577. package/dist/modes/interactive/components/footer.js.map +1 -1
  578. package/dist/modes/interactive/components/heartbeat-block.d.ts.map +1 -1
  579. package/dist/modes/interactive/components/heartbeat-block.js +3 -1
  580. package/dist/modes/interactive/components/heartbeat-block.js.map +1 -1
  581. package/dist/modes/interactive/components/host-input-form.d.ts.map +1 -1
  582. package/dist/modes/interactive/components/host-input-form.js +3 -3
  583. package/dist/modes/interactive/components/host-input-form.js.map +1 -1
  584. package/dist/modes/interactive/components/index.d.ts +1 -1
  585. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  586. package/dist/modes/interactive/components/index.js.map +1 -1
  587. package/dist/modes/interactive/components/input-label.d.ts.map +1 -1
  588. package/dist/modes/interactive/components/input-label.js +4 -5
  589. package/dist/modes/interactive/components/input-label.js.map +1 -1
  590. package/dist/modes/interactive/components/keybinding-hints.d.ts +7 -0
  591. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  592. package/dist/modes/interactive/components/keybinding-hints.js +27 -6
  593. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  594. package/dist/modes/interactive/components/main-composer-keys.d.ts +17 -2
  595. package/dist/modes/interactive/components/main-composer-keys.d.ts.map +1 -1
  596. package/dist/modes/interactive/components/main-composer-keys.js +44 -27
  597. package/dist/modes/interactive/components/main-composer-keys.js.map +1 -1
  598. package/dist/modes/interactive/components/model-selector.d.ts +6 -1
  599. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  600. package/dist/modes/interactive/components/model-selector.js +13 -7
  601. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  602. package/dist/modes/interactive/components/nav-keys.d.ts +7 -2
  603. package/dist/modes/interactive/components/nav-keys.d.ts.map +1 -1
  604. package/dist/modes/interactive/components/nav-keys.js +51 -17
  605. package/dist/modes/interactive/components/nav-keys.js.map +1 -1
  606. package/dist/modes/interactive/components/notice-line.d.ts +8 -0
  607. package/dist/modes/interactive/components/notice-line.d.ts.map +1 -1
  608. package/dist/modes/interactive/components/notice-line.js +6 -1
  609. package/dist/modes/interactive/components/notice-line.js.map +1 -1
  610. package/dist/modes/interactive/components/selector.d.ts +3 -0
  611. package/dist/modes/interactive/components/selector.d.ts.map +1 -1
  612. package/dist/modes/interactive/components/selector.js +30 -7
  613. package/dist/modes/interactive/components/selector.js.map +1 -1
  614. package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
  615. package/dist/modes/interactive/components/session-selector-list.js +11 -11
  616. package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
  617. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  618. package/dist/modes/interactive/components/session-selector.js +2 -2
  619. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  620. package/dist/modes/interactive/components/settings-picker.d.ts +5 -0
  621. package/dist/modes/interactive/components/settings-picker.d.ts.map +1 -1
  622. package/dist/modes/interactive/components/settings-picker.js +36 -2
  623. package/dist/modes/interactive/components/settings-picker.js.map +1 -1
  624. package/dist/modes/interactive/components/settings-selector-submenus.d.ts +10 -0
  625. package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
  626. package/dist/modes/interactive/components/settings-selector-submenus.js +89 -19
  627. package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
  628. package/dist/modes/interactive/components/settings-selector-types.d.ts +6 -0
  629. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  630. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  631. package/dist/modes/interactive/components/settings-selector.d.ts +7 -0
  632. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  633. package/dist/modes/interactive/components/settings-selector.js +12 -0
  634. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  635. package/dist/modes/interactive/components/skill-invocation-message.d.ts +6 -0
  636. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  637. package/dist/modes/interactive/components/skill-invocation-message.js +12 -7
  638. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  639. package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
  640. package/dist/modes/interactive/components/task-board.js +9 -2
  641. package/dist/modes/interactive/components/task-board.js.map +1 -1
  642. package/dist/modes/interactive/components/task-completion-message.d.ts +10 -3
  643. package/dist/modes/interactive/components/task-completion-message.d.ts.map +1 -1
  644. package/dist/modes/interactive/components/task-completion-message.js +173 -19
  645. package/dist/modes/interactive/components/task-completion-message.js.map +1 -1
  646. package/dist/modes/interactive/components/task-inspector.d.ts +1 -1
  647. package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
  648. package/dist/modes/interactive/components/task-inspector.js +28 -19
  649. package/dist/modes/interactive/components/task-inspector.js.map +1 -1
  650. package/dist/modes/interactive/components/task-list.d.ts +7 -3
  651. package/dist/modes/interactive/components/task-list.d.ts.map +1 -1
  652. package/dist/modes/interactive/components/task-list.js +60 -33
  653. package/dist/modes/interactive/components/task-list.js.map +1 -1
  654. package/dist/modes/interactive/components/task-row.d.ts +7 -0
  655. package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
  656. package/dist/modes/interactive/components/task-row.js +25 -11
  657. package/dist/modes/interactive/components/task-row.js.map +1 -1
  658. package/dist/modes/interactive/components/task-transcript-notices.d.ts +16 -0
  659. package/dist/modes/interactive/components/task-transcript-notices.d.ts.map +1 -0
  660. package/dist/modes/interactive/components/task-transcript-notices.js +74 -0
  661. package/dist/modes/interactive/components/task-transcript-notices.js.map +1 -0
  662. package/dist/modes/interactive/components/task-transcript-page.d.ts +11 -6
  663. package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
  664. package/dist/modes/interactive/components/task-transcript-page.js +48 -21
  665. package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
  666. package/dist/modes/interactive/components/tool-block-families.d.ts.map +1 -1
  667. package/dist/modes/interactive/components/tool-block-families.js +2 -1
  668. package/dist/modes/interactive/components/tool-block-families.js.map +1 -1
  669. package/dist/modes/interactive/components/tool-execution.d.ts +3 -2
  670. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  671. package/dist/modes/interactive/components/tool-execution.js +23 -9
  672. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  673. package/dist/modes/interactive/components/transcript-block-clicks.d.ts +54 -14
  674. package/dist/modes/interactive/components/transcript-block-clicks.d.ts.map +1 -1
  675. package/dist/modes/interactive/components/transcript-block-clicks.js +151 -16
  676. package/dist/modes/interactive/components/transcript-block-clicks.js.map +1 -1
  677. package/dist/modes/interactive/components/tree-selector-help.d.ts.map +1 -1
  678. package/dist/modes/interactive/components/tree-selector-help.js +25 -30
  679. package/dist/modes/interactive/components/tree-selector-help.js.map +1 -1
  680. package/dist/modes/interactive/components/tree-selector-list.d.ts +4 -0
  681. package/dist/modes/interactive/components/tree-selector-list.d.ts.map +1 -1
  682. package/dist/modes/interactive/components/tree-selector-list.js +21 -21
  683. package/dist/modes/interactive/components/tree-selector-list.js.map +1 -1
  684. package/dist/modes/interactive/components/working-run-meter.d.ts +31 -2
  685. package/dist/modes/interactive/components/working-run-meter.d.ts.map +1 -1
  686. package/dist/modes/interactive/components/working-run-meter.js +81 -10
  687. package/dist/modes/interactive/components/working-run-meter.js.map +1 -1
  688. package/dist/modes/interactive/interactive-agent-events.js +67 -14
  689. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  690. package/dist/modes/interactive/interactive-autocomplete.js +2 -2
  691. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  692. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
  693. package/dist/modes/interactive/interactive-deferred-startup.js +10 -4
  694. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  695. package/dist/modes/interactive/interactive-editor-actions.js +4 -1
  696. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  697. package/dist/modes/interactive/interactive-extension-custom-ui.js +13 -3
  698. package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
  699. package/dist/modes/interactive/interactive-extension-runtime.js +4 -2
  700. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  701. package/dist/modes/interactive/interactive-extension-widgets.js +6 -8
  702. package/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
  703. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  704. package/dist/modes/interactive/interactive-input-handling.js +43 -3
  705. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  706. package/dist/modes/interactive/interactive-mode-base.d.ts +7 -0
  707. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  708. package/dist/modes/interactive/interactive-mode-base.js +9 -2
  709. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  710. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  711. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  712. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  713. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  714. package/dist/modes/interactive/interactive-mode-helpers.d.ts +5 -0
  715. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  716. package/dist/modes/interactive/interactive-mode-helpers.js +9 -0
  717. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  718. package/dist/modes/interactive/interactive-mode-surface.d.ts +10 -2
  719. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  720. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  721. package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
  722. package/dist/modes/interactive/interactive-model-routing.js +63 -21
  723. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  724. package/dist/modes/interactive/interactive-prompt-turn.js +1 -1
  725. package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
  726. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  727. package/dist/modes/interactive/interactive-render-chat.js +71 -10
  728. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  729. package/dist/modes/interactive/interactive-resource-rendering.js +9 -18
  730. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  731. package/dist/modes/interactive/interactive-selectors.js +106 -57
  732. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  733. package/dist/modes/interactive/interactive-session-routing.js +10 -5
  734. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  735. package/dist/modes/interactive/interactive-session-runtime.d.ts +3 -0
  736. package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
  737. package/dist/modes/interactive/interactive-session-runtime.js +11 -0
  738. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  739. package/dist/modes/interactive/interactive-slash-commands.js +3 -0
  740. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  741. package/dist/modes/interactive/interactive-startup-chat-container.d.ts +5 -1
  742. package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -1
  743. package/dist/modes/interactive/interactive-startup-chat-container.js +8 -3
  744. package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -1
  745. package/dist/modes/interactive/interactive-startup-trust.d.ts +2 -0
  746. package/dist/modes/interactive/interactive-startup-trust.d.ts.map +1 -1
  747. package/dist/modes/interactive/interactive-startup-trust.js +21 -0
  748. package/dist/modes/interactive/interactive-startup-trust.js.map +1 -1
  749. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  750. package/dist/modes/interactive/interactive-startup.js +39 -17
  751. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  752. package/dist/modes/interactive/interactive-task-projection.d.ts.map +1 -1
  753. package/dist/modes/interactive/interactive-task-projection.js +11 -1
  754. package/dist/modes/interactive/interactive-task-projection.js.map +1 -1
  755. package/dist/modes/interactive/resume-catalog.d.ts.map +1 -1
  756. package/dist/modes/interactive/resume-catalog.js +1 -0
  757. package/dist/modes/interactive/resume-catalog.js.map +1 -1
  758. package/dist/modes/interactive/theme/theme-controller.d.ts +6 -1
  759. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  760. package/dist/modes/interactive/theme/theme-controller.js +19 -1
  761. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  762. package/dist/modes/interactive-engine/engine-child-liveness.d.ts +2 -0
  763. package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -1
  764. package/dist/modes/interactive-engine/engine-child-liveness.js +2 -0
  765. package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -1
  766. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  767. package/dist/modes/interactive-engine/engine-custom-ui.js +54 -4
  768. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  769. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  770. package/dist/modes/interactive-engine/engine-render-service.js +21 -2
  771. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  772. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +4 -2
  773. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  774. package/dist/modes/interactive-engine/extension-ui-bridge.js +4 -0
  775. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  776. package/dist/modes/interactive-engine/isolated-runtime.d.ts +39 -3
  777. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  778. package/dist/modes/interactive-engine/isolated-runtime.js +219 -29
  779. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  780. package/dist/modes/interactive-engine/protocol.d.ts +33 -1
  781. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  782. package/dist/modes/interactive-engine/protocol.js +40 -2
  783. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  784. package/dist/modes/interactive-engine/remote-command-catalog.d.ts +2 -2
  785. package/dist/modes/interactive-engine/remote-command-catalog.d.ts.map +1 -1
  786. package/dist/modes/interactive-engine/remote-command-catalog.js +7 -3
  787. package/dist/modes/interactive-engine/remote-command-catalog.js.map +1 -1
  788. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  789. package/dist/modes/interactive-engine/remote-component.js +31 -5
  790. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  791. package/dist/modes/interactive-engine/remote-renderer.d.ts +20 -12
  792. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  793. package/dist/modes/interactive-engine/remote-renderer.js +100 -34
  794. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  795. package/dist/modes/print-mode.d.ts.map +1 -1
  796. package/dist/modes/print-mode.js +4 -1
  797. package/dist/modes/print-mode.js.map +1 -1
  798. package/dist/modes/rpc/agent-panel-bridge.d.ts +7 -0
  799. package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
  800. package/dist/modes/rpc/agent-panel-bridge.js +119 -114
  801. package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
  802. package/dist/modes/rpc/rpc-client-process.d.ts +2 -1
  803. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  804. package/dist/modes/rpc/rpc-client-process.js +2 -1
  805. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  806. package/dist/modes/rpc/rpc-client.d.ts +8 -0
  807. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  808. package/dist/modes/rpc/rpc-client.js +5 -1
  809. package/dist/modes/rpc/rpc-client.js.map +1 -1
  810. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  811. package/dist/modes/rpc/rpc-command-handler.js +19 -2
  812. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  813. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  814. package/dist/modes/rpc/rpc-mode.js +4 -2
  815. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  816. package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
  817. package/dist/modes/rpc/rpc-session-binding.js +7 -0
  818. package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
  819. package/dist/modes/rpc/rpc-types.d.ts +13 -1
  820. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  821. package/dist/modes/rpc/rpc-types.js.map +1 -1
  822. package/dist/utils/interactive-engine-bootstrap.d.ts +3 -0
  823. package/dist/utils/interactive-engine-bootstrap.d.ts.map +1 -1
  824. package/dist/utils/interactive-engine-bootstrap.js +25 -0
  825. package/dist/utils/interactive-engine-bootstrap.js.map +1 -1
  826. package/dist/utils/interactive-engine-env.d.ts +3 -0
  827. package/dist/utils/interactive-engine-env.d.ts.map +1 -1
  828. package/dist/utils/interactive-engine-env.js +1 -0
  829. package/dist/utils/interactive-engine-env.js.map +1 -1
  830. package/dist/utils/shell.d.ts +2 -0
  831. package/dist/utils/shell.d.ts.map +1 -1
  832. package/dist/utils/shell.js +3 -3
  833. package/dist/utils/shell.js.map +1 -1
  834. package/docs/background-tasks.md +32 -37
  835. package/docs/compaction.md +2 -2
  836. package/docs/computer-use.md +2 -0
  837. package/docs/development.md +11 -1
  838. package/docs/environment-variables.md +2 -0
  839. package/docs/extensions/api-reference.md +7 -3
  840. package/docs/extensions/authoring.md +3 -1
  841. package/docs/extensions/events.md +3 -1
  842. package/docs/extensions/ui.md +2 -0
  843. package/docs/guides/resume-on-any-machine.md +3 -1
  844. package/docs/intercom/reference.md +1 -1
  845. package/docs/intercom.md +3 -3
  846. package/docs/keybindings.md +6 -2
  847. package/docs/libraries/tui.md +4 -0
  848. package/docs/providers.md +1 -1
  849. package/docs/rpc/protocol.md +6 -4
  850. package/docs/sdk/reference.md +10 -4
  851. package/docs/sdk.md +5 -2
  852. package/docs/security.md +5 -1
  853. package/docs/session-format.md +1 -1
  854. package/docs/sessions.md +16 -0
  855. package/docs/settings.md +2 -2
  856. package/docs/skills.md +3 -3
  857. package/docs/storage.md +25 -4
  858. package/docs/subagents.md +42 -45
  859. package/docs/tui.md +1 -1
  860. package/docs/usage.md +3 -1
  861. package/docs/workflows/api-reference.md +3 -1
  862. package/docs/workflows/authoring.md +1 -1
  863. package/docs/workflows/operations.md +21 -14
  864. package/docs/workflows.md +1 -1
  865. package/docs/worktree-snapshots.md +10 -8
  866. package/npm-shrinkwrap.json +71 -49
  867. package/package.json +9 -8
  868. package/schemas/settings.schema.json +1 -1
package/docs/storage.md CHANGED
@@ -188,12 +188,13 @@ You can write this block by hand as well. `secrets.password` takes `{ "file":
188
188
  | `statementTimeoutMs` | 30000 | How long one statement may run before the server cancels it |
189
189
  | `listenUrl` | `url` | A direct endpoint for [wake-ups](#wake-ups), when `url` goes through a transaction pooler |
190
190
  | `schema` | `"atomic"` | The schema Atomic's tables live in: a lowercase name of letters, digits and `_`. Atomic creates it when the role may |
191
+ | `proxy` | from the environment | An `http://` or `https://` proxy every connection tunnels through, or `"none"` to connect directly. See [Through an HTTP proxy](#through-an-http-proxy) |
191
192
 
192
193
  `atomic team join` takes libSQL URLs only; use `atomic storage join` for PostgreSQL. To run worker hosts and a fleet controller on a managed service, follow [Worker fleets on managed PostgreSQL](/guides/worker-fleets-postgres). SDK callers can import `openPostgresDatabase` from `@bastani/atomic-storage-postgres`.
193
194
 
194
195
  ### TLS
195
196
 
196
- Atomic connects with TLS to every host except the local machine, and checks the server's certificate and host name (`sslmode=verify-full`). Add `sslmode` to the URL to choose otherwise. It follows libpq: `verify-ca` checks the certificate's CA but not its host name, `prefer` and `allow` encrypt without checking the certificate, and `disable` turns TLS off. The CA is the one `sslrootcert` names, or otherwise the CAs Node.js trusts. `require` with `sslrootcert` acts as `verify-ca`; without `sslrootcert`, Atomic's `require` checks the certificate and its host name, as `verify-full` does, which is stricter than libpq. Write parameter names in lowercase: a URL with a TLS parameter such as `SSLMODE`, or an `sslmode` libpq does not know, is refused with `StorageConfigError`.
197
+ Atomic connects with TLS to every host except the local machine, and checks the server's certificate and host name (`sslmode=verify-full`). For a URL that names no host, the host is `PGHOST`, as for the connection itself. Add `sslmode` to the URL to choose otherwise. It follows libpq: `verify-ca` checks the certificate's CA but not its host name, `prefer` and `allow` encrypt without checking the certificate, and `disable` turns TLS off. The CA is the one `sslrootcert` names, or otherwise the CAs Node.js trusts. `require` with `sslrootcert` acts as `verify-ca`; without `sslrootcert`, Atomic's `require` checks the certificate and its host name, as `verify-full` does, which is stricter than libpq. Write parameter names in lowercase: a URL with a TLS parameter such as `SSLMODE`, or an `sslmode` libpq does not know, is refused with `StorageConfigError`.
197
198
 
198
199
  By provider:
199
200
 
@@ -202,6 +203,19 @@ By provider:
202
203
  - Amazon RDS and Aurora: download your region's certificate bundle from `https://truststore.pki.rds.amazonaws.com/<region>/<region>-bundle.pem` and add `?sslrootcert=/path/to/bundle.pem`.
203
204
  - Google Cloud SQL: save the instance's server CA certificate (`gcloud sql instances describe <instance> --format='value(serverCaCert.cert)'`) and add `?sslmode=verify-ca&sslrootcert=/path/to/server-ca.pem` when you connect by private IP address, which is not among the certificate's names.
204
205
 
206
+ ### Through an HTTP proxy
207
+
208
+ Where the only way out is an HTTP proxy, such as a sandbox that allows only `CONNECT` tunnels to listed `host:port` entries, Atomic opens each connection to PostgreSQL through a `CONNECT` tunnel: the pool's, the [wake-ups](#wake-ups) connection, and the connections that cancel a statement. List `<database host>:5432` (or the URL's port) on the proxy.
209
+
210
+ - **Which proxy.** Atomic reads the variables its other HTTPS clients read, `HTTPS_PROXY` (or `https_proxy`) and then `HTTP_PROXY`, plus `ALL_PROXY` between them when it names an `http://` or `https://` proxy. Credentials in the proxy URL, such as `http://user:password@proxy:3128`, are sent as `Proxy-Authorization` and never appear in messages.
211
+ - **Which hosts.** `NO_PROXY` (or `no_proxy`) exempts hosts as it does for those clients: `db.example.com`, `.example.com` or `example.com` (the domain and its subdomains), `*.example.com` (subdomains only), `host:port`, or `*`. A database on this machine (`localhost`, a loopback address, or a socket directory) is reached directly whatever the environment says.
212
+ - **Setting it for the store alone.** The `proxy` option in `storage.options` overrides the environment: a proxy URL sends every connection through it, even to this machine, and `"none"` connects directly. SDK callers pass `proxy` to `openPostgresDatabase`, or instead `socket`, a function that opens a connection to `{ host, port }` for a custom transport; passing both is refused. A socket directory is always reached directly.
213
+ - **TLS still runs end to end.** Atomic negotiates TLS with the database through the tunnel, cancel requests included, as in [TLS](#tls). What the proxy can see depends on `sslmode`. With the default `verify-full`, or `require` without `sslrootcert`, the server's certificate must name the database host, so the proxy sees only encrypted traffic. `verify-ca`, and `require` with `sslrootcert`, accept any certificate the CA signed, whatever host it names: that keeps the proxy out only when `sslrootcert` names a CA that signs your database servers alone. With the CAs Node.js trusts instead, a proxy that holds any certificate they issued, for any host, could read and change the traffic. With `prefer` or `allow` the certificate is not checked, so a proxy could read and change the traffic, and with `disable` it is not encrypted at all.
214
+
215
+ If the proxy sends informational replies such as `103 Early Hints`, Atomic waits for the final `CONNECT` status. The headers of all replies together must fit within 16 KiB; database traffic after the final reply does not count.
216
+
217
+ When the proxy refuses the tunnel, the store fails to open with `StorageUnavailableError`, and the message names the proxy and the `host:port` it refused, for example `the proxy http://127.0.0.1:3128 refused the tunnel to db.example.com:5432 (403 Forbidden)`. A `403` or `407` is not retried. A proxy that refuses the connection, closes it before answering, or answers `502` or `503` is retried like an unreachable server, so the open fails after about 4 seconds. Each attempt waits up to 8 seconds for the proxy to accept the connection and answer, so a proxy address that drops connection attempts, or a proxy that does not answer, fails the open after about 45 seconds. While the open retries, Atomic prints one warning that names the proxy and what happened, for example `the proxy http://127.0.0.1:3128 could not be reached for the tunnel to db.example.com:5432 (ECONNREFUSED) on attempt 1 (connection-refused)`.
218
+
205
219
  ### Connection poolers
206
220
 
207
221
  Atomic works through transaction-mode poolers: PgBouncer, the PgBouncer built into Azure Database for PostgreSQL (port 6432), Supabase's Supavisor (port 6543), and Neon's pooled endpoint (the `-pooler` host name). Point the URL at the pooler. A pooler lets many machines share a small number of server connections. Use transaction or session mode, not statement mode. For a worker fleet's connection count and pooler settings, see [Worker fleets on managed PostgreSQL](/guides/worker-fleets-postgres#connection-poolers).
@@ -273,6 +287,8 @@ A cloud identity is a role like any other: make it the runtime role with the gra
273
287
  - **The server refused a token**: `28P01` ("password authentication failed") is a token for the wrong user or one that expired. Azure answers `28000` ("The access token has invalid format") for a malformed one, such as a token for another resource or an empty or truncated token file: get it for `https://ossrdbms-aad.database.windows.net` (`az account get-access-token --resource-type oss-rdbms`), or use `--auth azure`.
274
288
  - **`StorageUnavailableError`** when the store opens: the server refused the password (`28P01`, or `28000` for an Azure token, as above), the database does not exist (`3D000`), or the server is older than PostgreSQL 14. Atomic's tables need PostgreSQL 16: on 14 and 15 the adapter connects, but sessions and workflow runs fail to open.
275
289
  - **A certificate error** (`self-signed certificate in certificate chain`, `unable to get local issuer certificate`): the server's CA is not one Node.js trusts. Add `sslrootcert`, as in [TLS](#tls).
290
+ - **"the proxy … refused the tunnel to …"**: the proxy's allow-list does not name the database's `host:port`, or (`407`) it wants credentials it was not given: put them in the proxy URL. "could not be reached" means nothing answers at the proxy's address; check `HTTPS_PROXY`. To connect without the proxy, add the host to `NO_PROXY` or set the `proxy` option to `"none"`. See [Through an HTTP proxy](#through-an-http-proxy).
291
+ - **`unsupported-proxy`**: the proxy variable or option is not an `http://` or `https://` URL, for example a `socks5://` proxy in `HTTPS_PROXY`. Set an HTTP proxy, add the database host to `NO_PROXY`, or set the `proxy` option to `"none"`.
276
292
  - **`StorageTransientError` with code `read-only-server`** (`25006`): the server accepts reads only. Either the URL names a read replica, a standby or a read-only endpoint, such as an Azure HorizonDB pool's: use the primary server, or the cluster's read/write endpoint. Or the server is read-only for now, during a failover or while Azure keeps a server whose storage is nearly full read-only: Atomic retries, and a call still refused after its retries fails with this code.
277
293
  - **`too many connections`** or **`remaining connection slots are reserved`** (`53300`): lower `maxConnections`, raise the server's `max_connections`, or put a [pooler](#connection-poolers) in front.
278
294
  - **`StorageTransientError` with code `lock-conflict` or `transaction-timeout`**: the server cancelled a statement or transaction that waited too long for a lock or ran past `statementTimeoutMs`, and nothing it wrote was kept. Persistent ones point to an overloaded server.
@@ -326,6 +342,10 @@ Atomic's stores keep every value well under the smallest of these limits, so ses
326
342
 
327
343
  Blobs, entries, events, inputs and results written before this release stay readable in their original rows. Snapshot collection moves worktree-snapshot blobs over 1 MiB into chunks regardless of their age, writing at most 16 MiB of chunks per transaction. Recording unknown ages for smaller blobs also rewrites at most 16 MiB per transaction. Moving a blob preserves its existing age, so conversion does not restart its grace window. A stopped move resumes on the next collection, and deleting the blob removes its partial chunks.
328
344
 
345
+ Earlier releases created `snapshot_blob_chunks` on SQLite and libSQL as a `WITHOUT ROWID` table, which keeps each 1 MiB row inside its key's b-tree, so every lookup in it read several whole chunks. Snapshot collection moves such a table to an ordinary table with the same name, columns and key. It copies the rows to `snapshot_blob_chunks_next`, then copies the chunks other processes stored meanwhile and deletes the copies of chunks they deleted. Each of these transactions copies or frees at most 4 chunks (4 MiB) in all, and the one that leaves the copy holding exactly the old table's rows also renames the copy to `snapshot_blob_chunks`. The move then empties the old table, renamed `snapshot_blob_chunks_retired`, 4 rows per transaction, and drops it. A stopped collection resumes the move, every blob keeps its exact bytes, and older Atomic processes sharing the store keep reading and writing the table during and after the move. The database file grows once by the size of the chunk table; SQLite keeps the old table's pages for later writes rather than shrinking the file. For a SQLite or libSQL file, the move starts only when the file system the database file is on (where a link to it points) has room for what is left to copy, the write-ahead log of that copy and another 64 MiB; otherwise the collection completes without it and keeps the current layout, and a partial copy an earlier collection left is dropped, its pages kept for later writes. On a libSQL server, whose disk Atomic cannot see, the move runs only while at most 64 MiB of the table is left to copy; a larger table keeps its layout. Allow free server space for at least the remaining copy, its write-ahead log and 64 MiB of headroom; sqld also needs room for its separate replication log and for temporary files while it compacts that log. By default, pages from a partial copy discarded after a disk-full error stay in the database for reuse; with `auto_vacuum=FULL`, the file can shrink and return space to the filesystem. On any backend, a disk that fills up or fails to read or write during the move ends the move, not the collection, the same way, and a later collection tries again. PostgreSQL tables keep their keys apart from their rows already and are not moved.
346
+
347
+ SQLite renames no table while a trigger or view in the database refers to a missing table, including one that another application or another storage prefix created. In such a database the move stops at its rename on every collection: the old table stays in use, no blob is lost, and the collection fails with a `WorkspaceCollectionError` that names the trigger or view, shown once per process as a warning. SQLite does not quote the name in its report, so when another trigger or view has a name the report could also mean, such as `sales` beside a broken `sales after rename`, the warning names neither and gives the database's report instead. Fix it or drop it (for example `DROP TRIGGER "name"` or `DROP VIEW "name"`), and the next collection finishes the move.
348
+
329
349
  Refreshing or storing a blob of unknown age leaves it protected until collection records its age. A blob whose age an older build already recorded keeps its normal age refresh, so refreshing a large inline blob can still rewrite its whole row before the first collection moves it. Publishing the chunks also frees the old inline pages under the write lock, with time proportional to the blob's size.
330
350
 
331
351
  **This upgrade is one way.** The first session entry this release stores in chunks upgrades the session schema to version 2, in the sessions meta table. Until then, a new database or an existing version 1 database stays at version 1, and older builds keep opening it. A database already at version 2 is not downgraded, even after its chunked entries are deleted. When this release opens a workflow journal, it upgrades the journal schema (`wf_meta`) to version 2, and a worker pool's schema (`wf_runs_pool_meta`) to version 3. Older Atomic builds then refuse the database with `StorageSchemaVersionError` (`JournalSchemaVersionError` for a journal) instead of reading a large entry, event, input, result or worktree snapshot blob as a stub. Storing a worktree snapshot over 1 MiB, or a collection finishing the move of an older one into chunks, does the same to the journal schema even where no workflow has run yet, so an older build cannot open that database's journal. Upgrade every host that shares a store together, before any of them opens it with this release.
@@ -588,7 +608,8 @@ Atomic does not bundle remote database drivers. Install your chosen SQLite-compa
588
608
  - `close()`: releases the connection.
589
609
  - `batch(statements)`, optional: runs `{ sql, params }` statements in order in one write transaction, sent as one request, and returns each statement's result; all of them commit or none do. Provide it only when your driver sends the whole batch at once. The facade then offers `SqliteDatabase.batch`, and workflow journals write a batch of events with one request instead of one per statement.
590
610
  - `redact(text)`, optional: removes credentials from diagnostic text. `redactSecrets(secrets)` builds one that also removes each secret's URI-encoded and decoded forms, longest first.
591
- - `transientFailure(failure)`, optional: recognizes a failure your driver threw as one that passes, from the failure's own fields (never its message), and returns `{ code, outcome }`. `code` is one of the `StorageTransientError` codes below; `outcome` is `"not-applied"` when the failed request cannot have changed the database and `"unknown"` when the connection broke after the server may have applied it. The facade calls it with the unredacted failure.
611
+ - `transientFailure(failure)`, optional: recognizes a failure your driver threw as one that passes, from the failure's own fields (never its message), and returns `{ code, outcome }`. `code` is one of the `StorageTransientError` codes below; `outcome` is `"not-applied"` when the failed request cannot have changed the database and `"unknown"` when the connection broke after the server may have applied it. When the call failed before it reached the server, for example at a proxy, also return `hop: { name, failure }`: `name` names that hop, such as `the proxy http://proxy.example:3128`, and `failure` says what happened there, such as `the proxy http://proxy.example:3128 could not be reached for the tunnel to db.example.com:5432 (ECONNREFUSED)`. The error then says `failure` where it would say "the database server call failed", and its hint asks to check `name` rather than the database server. The facade calls `transientFailure` with the unredacted failure, and passes both `hop` texts through `redact`.
612
+ - `freeBytes()`, optional: for a database in a local file, the bytes this process may still write on the file system that holds the file (where a link to it points), or `undefined` when the file system does not say. The facade offers it as `SqliteDatabase.freeBytes`. Snapshot collection reads it before it moves an older snapshot chunk table to the current layout; without it, the move runs only while at most 64 MiB of the table is left to copy, as on a libSQL server.
592
613
 
593
614
  Driver calls may return values or promises. The returned facade follows the rules described above: it queues operations in call order and keeps them outside active transactions, snapshots binary parameters when a call is made, rejects NUL text with `StorageInvalidTextError` before SQL runs, returns safe-range integers as numbers and blobs as `Uint8Array` copies, expires transaction handles when their callback settles, and closes the driver once after draining accepted work. A failed driver call rejects with `StorageUnavailableError`, whose `cause` is the driver error with credentials redacted. A failed rollback rejects with `StorageRollbackError`, and callback failures are preserved. Do not fall back to memory after an opening failure.
594
615
 
@@ -962,7 +983,7 @@ Adapters may mark a read-only database facade with `readOnly: true` so Atomic av
962
983
 
963
984
  Sequences count entries from 1. `readResume.branch` contains `{ seq, entry }` records; `state` also records `onBranch`. Returned entries keep their original content, ids and parent ids. `epoch` identifies a session generation: keep it unchanged on append, change it on replacement or recreation, return it from every range read, and resolve `create` and `replace` with `{ lastSeq, epoch }`. Writes with an `epoch` must reject a different generation with `SessionConflictError`, even when the sequence count matches. A store that resolves `create` or `replace` without an `epoch` keeps working; Atomic then sends no `epoch` with that session's later writes. `SessionRecoveryState.deliveryOpIds` lists the `data.op` of every `atomic-pooled-delivery-op` entry, so a resumed workflow stage does not take a delivery twice. Atomic also rejects a range hydration from a different generation instead of merging two histories. `SessionResume`, `SessionRecoveryState` and the range and compaction types are exported from `@bastani/atomic/storage`.
964
985
 
965
- Atomic uses `readResume` when available. A custom store without it keeps working and resumes sessions whole. First-party stores implement all of these methods. An older SQL session needs one lazy, paged metadata scan to build its index; a read-only store remembers the result for that process. JSONL stores save a checksummed `.idx` sidecar with an atomic rename and rebuild it when the session file changes.
986
+ Atomic uses `readResume` when available. A custom store without it keeps working and resumes sessions whole. First-party stores implement all of these methods. An older SQL session builds its resume index on first use, including sessions with entries larger than the database's per-value limit. The scan writes only the completed index. If the rebuild is interrupted, the next resume starts at the first page; it never uses an index built from part of the transcript. A read-only store remembers the completed index only for that process. JSONL stores save a checksummed `.idx` sidecar with an atomic rename and rebuild it when the session file changes.
966
987
 
967
988
  ## Locks in the agent directory
968
989
 
@@ -1006,7 +1027,7 @@ These storage errors carry a stable `code` and a `hint` with the remedy:
1006
1027
  | `StorageUnsupportedOperationError` | `unsupported-operation` | `getWriterQueueStats` or `getWriterQueueDegradation` received a handle that `openNodeSqliteDatabase` or `wrapNodeSqliteDatabase` did not return. | `operation` (`"getWriterQueueStats"` or `"getWriterQueueDegradation"`), `adapter`, `location` | Pass a node-sqlite handle. |
1007
1028
  | `StorageWriterQueueDegradedError` | `writer-queue-degraded` | Not thrown: recorded once per reason on the connection (read with `getWriterQueueDegradation`) and emitted once as a process warning. A waiting writer could not watch its release notice (`watch-unavailable`), a writer letting go of the lock could not read the queue or notify the next writer (`wake-failed`), an entry or notice could not be removed on leaving or after abandonment (`stale-ticket-kept`), or the connection could not keep its record of holding the write lock in `<file>-holders`, so a writer that gives up waiting may not name the holder (`holder-record-unavailable`). | `reason` (`"watch-unavailable"`, `"wake-failed"`, `"stale-ticket-kept"`, or `"holder-record-unavailable"`), `adapter`, `location`, `cause`, and a `hint` for the reason | Raise the file-watch limits; make the `<file>-writers`, `<file>-wakes` and `<file>-holders` directories readable and writable; or remove abandoned entries by hand. A live entry left behind can delay the queue until it becomes stale. |
1008
1029
  | `StorageWriterQueueUnusableError` (a `StorageUnavailableError`) | `writer-queue-unusable` | A node-sqlite transaction could not read the `<file>-writers` directory, or add, refresh, or read an entry or its release notice. Nothing of the transaction ran. | `adapter`, `location`, `errno` (such as `"EACCES"`) when the cause has one, `cause` | Make the `<file>-writers` and `<file>-wakes` directories readable and writable for every process that writes the database. |
1009
- | `StorageTransientError` (a `StorageUnavailableError`) | `stream-expired`, `transaction-timeout`, `connection-refused`, `connection-lost`, `read-only-server` | A call to a database server failed for a reason that passes: the server expired an idle stream, for example of a process stopped mid-transaction (`stream-expired`); it rolled back a transaction that kept the write lock while another writer waited (`transaction-timeout`); no connection could be made (`connection-refused`); or the connection broke during the request, or something in front of a libSQL server answered HTTP 5xx (`connection-lost`); or a PostgreSQL server that accepts reads only refused a write (`read-only-server`): a read replica or read-only endpoint, or a server read-only for now, during a failover or while its storage is nearly full. Thrown after the call ran up to five times when it wrote nothing, or at once when its outcome is unknown. | `adapter`, `location`, `outcome` (`"not-applied"`, nothing was written; or `"unknown"`, the write may have been applied), `attempts` (the run that failed), `retryable: true`, `cause` (the driver failure, credentials redacted) | Check that the server is reachable and the process is not stopped or starved of CPU, then retry. With `outcome: "unknown"`, read the write back before retrying one that is not idempotent. |
1030
+ | `StorageTransientError` (a `StorageUnavailableError`) | `stream-expired`, `transaction-timeout`, `connection-refused`, `connection-lost`, `lock-conflict`, `read-only-server` | A call to a database server failed for a reason that passes: the server expired an idle stream, for example of a process stopped mid-transaction (`stream-expired`); it rolled back a transaction that kept the write lock while another writer waited (`transaction-timeout`); no connection could be made (`connection-refused`); or the connection broke during the request, or something in front of a libSQL server answered HTTP 5xx (`connection-lost`); the server aborted a transaction to resolve a lock conflict (`lock-conflict`); or a PostgreSQL server that accepts reads only refused a write (`read-only-server`): a read replica or read-only endpoint, or a server read-only for now, during a failover or while its storage is nearly full. Thrown after the call ran up to five times when it wrote nothing, or at once when its outcome is unknown. | `adapter`, `location`, `outcome` (`"not-applied"`, nothing was written; or `"unknown"`, the write may have been applied), `attempts` (the run that failed), `retryable: true`, `cause` (the driver failure, credentials redacted); when the call failed on the way to the server, such as at a proxy, `hop` (that hop, such as `the proxy http://proxy.example:3128`) and `hopFailure` (what happened there), which the message names instead of the server | Check that the server, or the `hop` the message names, is reachable and the process is not stopped or starved of CPU, then retry. With `outcome: "unknown"`, read the write back before retrying one that is not idempotent. |
1010
1031
  | `SessionBlobError` | `blobs-unsupported` | The session store has no `putBlob` and `getBlob` (a session directory, or a custom store without them), and an import, fork, branch or `tool-output://` read needs them. Nothing was written. | `sessionId`, `adapter` | Keep the session in a SQLite or libSQL session store, or give the custom store `putBlob` and `getBlob`. |
1011
1032
  | `SessionBlobError` | `blob-missing` | A `tool-output://<sha256>` URL names a blob the current session does not hold. A copy, fork or export that finds blobs missing from its source carries on without them and reports this once as a process warning (an `onMissingBlob` function passed to `copySessionBlobs` or `inlineToolOutput` receives it instead). | `sessionId`, `hash` (the first missing one), `missing` (how many, when a copy or export reports it) | The output is gone, for example because the export it came from left it out; run the tool again. |
1012
1033
  | `SessionBlobError` | `blob-incomplete` | The store holds a blob's record but lost part of its content. | `sessionId`, `hash`, `bytes` | The store lost part of this output; run the tool again. |
package/docs/subagents.md CHANGED
@@ -9,11 +9,11 @@ Atomic bundles `@bastani/subagents` for bounded specialist work in separate cont
9
9
 
10
10
  Keep interactive, exploratory, conceptual, and conversation-led work inline when direct user steering is more useful. Keep immediately blocking work local unless specialist expertise, context isolation, or an explicit delegation request makes a child worthwhile.
11
11
 
12
- Delegate independent work you can overlap with your next steps, then continue without duplicating the child's task. Foreground observation is available when you need a specialist's result next. Otherwise, rely on completion notices rather than repeated short waits or status polls. Wait when the result becomes a dependency.
12
+ Delegate independent work you can overlap with your next steps, then continue without duplicating the child's task. Every subagent runs in the background: rely on completion notices rather than repeated short waits or status polls, and wait with `subagent({ action: "wait", id })` when a child's result becomes a dependency.
13
13
 
14
14
  You do not need to install anything separately when you use `@bastani/atomic`.
15
15
 
16
- Background subagents are supported. See [Background tasks](/background-tasks) for launch examples, the agent panel below the prompt, `/tasks`, shell output, cancellation, and completion notices.
16
+ Every subagent runs in the background. See [Background tasks](/background-tasks) for launch examples, the agent panel below the prompt, `/tasks`, shell output, cancellation, and completion notices.
17
17
 
18
18
  ## Where to go next
19
19
 
@@ -68,45 +68,43 @@ Prompt-template delegation comes from the separately installed `pi-prompt-templa
68
68
 
69
69
  Subagents now run and return their results directly. Atomic does not infer acceptance gates from prompt wording, inject `acceptance-report` instructions into child prompts, parse or strip `acceptance-report` blocks, or reject completed child runs because changed-file, test, or review evidence is missing. Put any evidence or validation requirements directly in the task text you give the parent or child agent.
70
70
 
71
- ## Owner-bound task observation
71
+ ## Background launches and waiting
72
72
 
73
- Runtime-created session contexts bind single launches to their actual session or workflow-stage owner. Choose observation behavior with `wait`:
73
+ Runtime-created session contexts bind launches to their actual session or workflow-stage owner. Every launch runs in the background: the call returns once each child is admitted, with an observation whose reason is `default-background` and the child's task id. The child keeps running, is listed below the prompt and in `/tasks`, where you can open its chat and message it, and reports by a completion notice when it ends.
74
74
 
75
- - Omitted `wait` returns an admitted observation with reason `default-background`.
76
- - `wait: {kind: "background"}` uses reason `explicit`.
77
- - `wait: {kind: "foreground", budgetMs: 30000}` opts into foreground-first observation. The omitted foreground budget is 30000 ms.
75
+ A launch that still passes `wait`, as older saved prompts, agents or workflows may, runs in the background too. When it asked for `wait: { kind: "foreground" }`, the first line of its result says that the foreground wait was removed and how to wait instead.
78
76
 
79
77
  A running child sends the parent a [task heartbeat](/background-tasks#task-heartbeats) every 15 minutes by default, with its current tool call, time since its last activity, and turn, tool-call and token counts. Set `heartbeatMs` on the call, or on a `tasks` entry, to change that child's cadence; `0` turns it off.
80
78
 
81
- When you issue several single-agent calls in one turn, each keeps its own `wait` policy and returns only its own task result. Background completions appear as visible notices and notify the parent agent, including in workflow-stage chats receiving other messages.
79
+ When you issue several single-agent calls in one turn, each returns only its own task. Background completions appear as visible notices and notify the parent agent, including in workflow-stage chats receiving other messages.
82
80
 
83
- These calls share the `concurrency` limit, or the configured subagent parallel limit when omitted, even when their wait policies differ. A background receipt or an expired foreground observation does not free a running child's slot; queued children start when execution capacity becomes available.
81
+ These calls share the `concurrency` limit, or the configured subagent parallel limit when omitted. A returned launch or an ended wait does not free a running child's slot; queued children start when execution capacity becomes available.
84
82
 
85
- Use `subagent({action: "wait", id: taskId})` to observe an existing task in the same owner without restarting it. It uses the owner's observation budget unless explicitly overridden.
83
+ Use `subagent({ action: "wait", id: taskId })` to wait for an existing task in the same owner without restarting it. It waits up to the owner's agent wait budget (`tasks.wait.agentBudgetMs`, 30 seconds by default) unless `budgetMs` overrides it. Pressing Esc ends the wait at once and ends the turn. Either way the child keeps running, and its completion notice still arrives when it finishes.
86
84
 
87
85
  A background launch result names the child's Intercom target as `intercomTarget` (for example `subagent-worker-1a2b3c4d-1`), and `subagent({ action: "status", id: taskId })` names it on the task's record too. Each task id maps to exactly one target, so send to that name rather than deriving one from the task id.
88
86
 
89
87
  Until a child starts its first turn, `status` reports where its start is, never just `running`. A line such as `task-1-0-7 (subagent-worker-1a2b3c4d-1) is starting: creating its agent session for 95s (120s since launch, attempt 1 of 2)` comes first, and the record carries a `start` field with the step and how long it and the start have run. The steps are opening its session, loading its resources, waiting for a resource-admission permit, creating its agent session, registering on Intercom, and dispatching its task. `/tasks` and task heartbeats show the step as the task's current action. A start that runs out of its start budget (`sessionStartTimeoutMs`, 5 minutes by default) is shown as `stalled` with the step it stalled in and is retried once, as soon as the stalled start has let go of its session. If the retry runs out of its budget too, the task fails with `Subagent did not start: its start stalled <step> after <N>s and was retried once; the retry stalled <step> after <M>s`, and the launching session gets the failure notice. A stalled start that still holds its session after half its budget (at most 30 seconds), for example because an extension's `session_start` never returns, is not retried: the task fails with its timeout and says why.
90
88
 
91
- When a task has settled, the launch result, `action: "wait"`, and `action: "status"` show its output after the task record: up to 16 KB of text, a `Full output:` path to a private copy of the complete result, and a `Requested output:` line naming the `output` file you asked for (background runs included). The private copies live in a temporary directory readable only by you and are removed when Atomic exits. With `outputMode: "file-only"` the text is only the saved-file reference, and the private copy holds the file's contents. A child that stops to ask a question through `contact_supervisor` settles with the question and a ready-to-run follow-up call in this output.
89
+ When a task has settled, `action: "wait"` and `action: "status"` show its output after the task record: up to 16 KB of text, a `Full output:` path to a private copy of the complete result, and a `Requested output:` line naming the `output` file you asked for (background runs included). Atomic keeps the 256 most recent private copies across sessions in a temporary directory readable only by you and removes them when it exits. After a copy expires, a retained task can still show a short answer that matches text in its transcript. If the exact output cannot be recovered, `wait` and `status` point you to the earlier result or `/tasks <id>`. With `outputMode: "file-only"` the text is only the saved-file reference, and the private copy holds the file's contents.
92
90
 
93
- The agent may choose foreground-first or background observation for each authorized call without asking the user merely to select a mode. When a foreground observation expires, the returned task is still running. Wait for terminal completion before using its result in dependent work. See [Choosing how long to wait](/background-tasks#choose-how-long-to-wait) for shell and subagent defaults and the separate execution-timeout behavior.
91
+ The agent decides for each call whether its next step needs the child's result, without asking the user to choose. When a wait ends at its budget, the task is still running. Wait for terminal completion before using its result in dependent work. See [Choosing how long to wait](/background-tasks#choose-how-long-to-wait) for shell and subagent defaults and the separate execution-timeout behavior.
94
92
 
95
- User steering or an incoming Intercom ask/send admitted to the waiting parent releases its active subagent observations, including both foreground launches and `action: "wait"`. This applies to main chat and live workflow-stage chat. The parent can handle the queued message and reply without cancelling the child, closing its owner, or interrupting another owner's waits. User input yields with reason `input-needed`; Intercom coordination yields with reason `intercom-coordination`. The original task can be observed again after handling the message.
93
+ User steering or an incoming Intercom ask/send admitted to the waiting parent ends its active `action: "wait"` calls. This applies to main chat and live workflow-stage chat. The parent can handle the queued message and reply without cancelling the child, closing its owner, or interrupting another owner's waits. User input yields with reason `input-needed`; Intercom coordination yields with reason `intercom-coordination`. The original task can be observed again after handling the message.
96
94
 
97
95
  An Intercom yield keeps the execution alive, including queued parallel siblings. Completion appears in the owning chat with the outcome, error, and response excerpt. Unbound SDK callers retain their existing result fields.
98
96
 
99
- Durable `ctx.tool` callbacks wait for tasks admitted inside their callback before checkpointing, even when the launching observation yielded. Session lifetime closure cancels session-owned work; stage generation closure, not pane detach or fallback session replacement, owns stage tasks.
97
+ Durable `ctx.tool` callbacks wait for tasks admitted inside their callback before checkpointing, although each launch returned before its child finished. Session lifetime closure cancels session-owned work; stage generation closure, not pane detach or fallback session replacement, owns stage tasks.
100
98
 
101
99
  ## Supervisor coordination
102
100
 
103
101
  Every builtin specialist includes `intercom` for live coordination, including read-only researchers and locators. `debugger` and `worker` also declare `contact_supervisor`; prefer it for supervisor requests when available. Explicit parent tool allowlists, exclusions, `noTools`, and disabled Intercom still apply—builtin declarations do not override caller restrictions. A child whose tools leave out `read` or `search` gets one read-only tool, `session_history`, after compaction first clears its context, so it can recover from its own session's history and nothing else; see [Agents without read or search](/compaction#agents-without-read-or-search).
104
102
 
105
- In a parallel run, `intercom.ask`, `contact_supervisor({ reason: "need_decision" })`, and `interview_request` wait only in the requesting child. The supervisor answers with ordinary `intercom({ action: "reply", message: "..." })`; use `pending` and `replyTo` to select the exact question when several asks are pending. The correlated reply returns to the same child execution, with its context and run identity intact. Do not relaunch the requester or its siblings to deliver an answer.
103
+ `intercom.ask`, `contact_supervisor({ reason: "need_decision" })`, and `interview_request` wait only in the requesting child, in a single or a parallel run. The supervisor answers with ordinary `intercom({ action: "reply", message: "..." })`; use `pending` and `replyTo` to select the exact question when several asks are pending. The correlated reply returns to the same child execution, with its context and run identity intact. Do not relaunch the requester or its siblings to deliver an answer.
106
104
 
107
- `intercom.send` and `contact_supervisor` progress updates return after delivery without waiting for a reply. An exact-child Intercom handshake can release the parallel call's foreground observations so the supervisor can handle the message. This is not execution cancellation: active siblings keep running, queued siblings start once capacity is available, and worktrees stay owned until their children exit. Background calls use the same communication path without needing to release an observation.
105
+ `intercom.send` and `contact_supervisor` progress updates return after delivery without waiting for a reply. A child's message reaches its busy supervisor through an exact-child Intercom handshake. Nothing is cancelled: active siblings keep running, queued siblings start once capacity is available, and worktrees stay owned until their children exit.
108
106
 
109
- To update a working child, use ordinary Intercom `send` or `ask` with its exact connected name or full session ID from `intercom list`. An admitted child registers with Intercom when its session starts and before its first turn, so it is listed and reachable while it works even if it never calls Intercom itself. If the broker is briefly unreachable then, the child's start waits in its `registering on Intercom` step and retries until it registers or its start budget runs out. A child's `contact_supervisor` reaches the session that launched it, by the Intercom id that session registered under. If the broker refuses the child's supervisor authorization, the child keeps offering it for up to 30 seconds, since a broker restart refuses it until the launching session has reconnected. It keeps the authorization once that session is back. If the authorization is still refused after that, for example because the launching workflow stage has released or it was never valid, the child still starts without it. `contact_supervisor` then reports that the authorization was refused, and the child offers it again the next time it connects to Intercom. Foreground and background children handle it in the same child execution, without relaunching the task or repeating the original prompt, according to the sender's `delivery` option. Messages from sibling children, the supervisor, and you all work the same way:
107
+ To update a working child, use ordinary Intercom `send` or `ask` with its exact connected name or full session ID from `intercom list`. An admitted child registers with Intercom when its session starts and before its first turn, so it is listed and reachable while it works even if it never calls Intercom itself. If the broker is briefly unreachable then, the child's start waits in its `registering on Intercom` step and retries until it registers or its start budget runs out. A child's `contact_supervisor` reaches the session that launched it, by the Intercom id that session registered under. If the broker refuses the child's supervisor authorization, the child keeps offering it for up to 30 seconds, since a broker restart refuses it until the launching session has reconnected. It keeps the authorization once that session is back. If the authorization is still refused after that, for example because the launching workflow stage has released or it was never valid, the child still starts without it. `contact_supervisor` then reports that the authorization was refused, and the child offers it again the next time it connects to Intercom. Children handle it in the same child execution, without relaunching the task or repeating the original prompt, according to the sender's `delivery` option. Messages from sibling children, the supervisor, and you all work the same way:
110
108
 
111
109
  | `delivery` | When a busy recipient gets it | Use it for |
112
110
  |---|---|---|
@@ -114,7 +112,7 @@ To update a working child, use ordinary Intercom `send` or `ask` with its exact
114
112
  | `"followUp"` | Only after it finishes and stops | Low-priority notes, or anything meant for "after you're done" |
115
113
  | `"interrupt"` | Immediately. Its current model call or cancellable tool call is cancelled, then the message is handled next. | An urgent correction or a stop order |
116
114
 
117
- The sender chooses `delivery` for each message; override the default by urgency. It applies to every sender, including peers, the supervisor, and you. With `"interrupt"`, tools that ignore cancellation finish first, and completed side effects are kept. Multiple updates stay in arrival order. A reply to an incoming ask uses ordinary `intercom.reply`; this does not change the single-child parent-targeted handoff described below.
115
+ The sender chooses `delivery` for each message; override the default by urgency. It applies to every sender, including peers, the supervisor, and you. With `"interrupt"`, tools that ignore cancellation finish first, and completed side effects are kept. Multiple updates stay in arrival order. A reply to an incoming ask uses ordinary `intercom.reply`.
118
116
 
119
117
  [Run control](#run-control) (`pause`, `quit`) stops only the selected child, and it stays resumable. Explicit batch cancellation and workflow-stage closure stop the intended owned children for good, including pending reply waits. Closing or switching away from a session also stops its children, but they stay resumable, as described next. A late or duplicate reply cannot revive a terminal child. Ordinary Intercom group restrictions and the authorized cross-group `contact_supervisor` route are unchanged.
120
118
 
@@ -159,15 +157,9 @@ These are the limits that apply:
159
157
 
160
158
  For example, 20 parallel workflow stages that each launch 50 children form a swarm of 1,000 agents. The workflow and subagent defaults already run them all at once: up to 1000 stages and 1000 running children per parent. Lower `defaultConcurrency` or a per-call `concurrency` to run fewer stages at a time. Beyond these settings, the practical ceiling is your provider rate limits, machine memory, and any workflow admission limits you set.
161
159
 
162
- ### Single-child handoff
160
+ ### Single-child handoff without a task host
163
161
 
164
- A claimed parent-targeted blocking request ends a single child and returns its question, attachments, agent identity, and `[TASK_CONTEXT]` through the parent's `subagent` call. Start a fresh child with the answer and handoff. In parallel runs and collected sibling launches, the requesting child instead stays alive and continues its ongoing execution after receiving the supervisor's reply.
165
-
166
- The handoff explicitly tells the parent to start a fresh child with a normal launch such as `subagent({ agent: "worker", task: "[TASK_CONTEXT] ... Continue with this supervisor answer: ..." })`. The new child receives a new run identity.
167
-
168
- ## Foreground supervisor coordination
169
-
170
- See [Supervisor coordination](#supervisor-coordination) for parallel requests and [Single-child handoff](#single-child-handoff) for claimed single-child requests.
162
+ An SDK session without a task host runs a single child directly, and its `subagent` call waits for it. There, a claimed parent-targeted blocking request ends the child and returns its question, attachments, agent identity, and `[TASK_CONTEXT]` through that call. The handoff tells the parent to start a fresh child with a normal launch such as `subagent({ agent: "worker", task: "[TASK_CONTEXT] ... Continue with this supervisor answer: ..." })`. The new child receives a new run identity. Every other child stays alive and continues its ongoing execution after receiving the supervisor's reply.
171
163
 
172
164
  ## Migration from acceptance gates
173
165
 
@@ -219,9 +211,9 @@ Review the current diff with fresh-context specialists: analyze correctness, ins
219
211
 
220
212
  Compose those review and research passes with the `subagent` tool. Treat them as parent-side recipes, not bundled slash commands.
221
213
 
222
- ## Foreground work and control
214
+ ## Waiting and control
223
215
 
224
- Explicit foreground-first observations wait for the child until it settles or the observation yields. The child continues after a yield; owner-bound calls without `wait` use background observation by default.
216
+ A launch returns once its children are admitted. To use a child's result in the same turn, wait for it explicitly; the wait ends when the child settles, when its budget runs out, or when you press Esc, and the child keeps running in the last two cases.
225
217
 
226
218
  Natural-language examples:
227
219
 
@@ -236,16 +228,17 @@ Show me the current subagent status.
236
228
  Tool examples:
237
229
 
238
230
  ```ts
239
- subagent({ agent: "codebase-analyzer", task: "Trace the auth flow with file references.", wait: { kind: "foreground", budgetMs: 30000 } })
231
+ subagent({ agent: "codebase-analyzer", task: "Trace the auth flow with file references." })
232
+ subagent({ action: "wait", id: "<task id>", budgetMs: 120000 })
240
233
  ```
241
234
 
242
235
  Use [run control](#run-control) to stop, hold, or continue a child.
243
236
 
244
- Main chat, workflow stage chats and subagent chats show the same `∀` working line. Its changing verb is followed by elapsed time and a token count; `↑` means a request is waiting for content, and `↓` means content has arrived. Zero token counts stay hidden. After the run ends, a dim past-tense row keeps its time and tokens visible until the next run. Opening a chat mid-run preserves its elapsed time instead of restarting the clock.
237
+ Main chat, workflow stage chats and subagent chats show the same `∀` working line. Its changing verb is followed by elapsed time and a token count; `↑` means a request is waiting for content, and `↓` means content has arrived. Zero token counts stay hidden. A retry or a switch to a fallback model continues the same count from the turn's first request. Reopening the chat shows the current wait without restarting the clock, including for a workflow stage on a worker. When the turn finishes, is interrupted or runs out of attempts, a dim row keeps its elapsed time and tokens until the next turn. If a workflow worker goes away, its stage and subagent chats stop showing the old wait. A stage moving to another host shows the replacement session once its first update arrives. A warning that a follow-up could not be delivered is separate: it does not mean the provider stopped trying.
245
238
 
246
- Each launch shows `Agent(<agent> · <short task title>)` with its state, elapsed time and tokens. A management hint appears only when the task can be selected. Ctrl+O expands the prompt, tool calls and result. Completion notices show the agent's name and first result line. If an older transcript is unavailable, expansion shows the full retained result and an unavailable-transcript message rather than an empty tool-call list.
239
+ Each launch shows `Agent(<agent> · <short task title>)` with its state, elapsed time and tokens. Elapsed time starts when the child is dispatched, includes session startup and retries, and stops when the child finishes, stops or is released. Queue time and cleanup do not count. Waiting silently or handing the conversation back for Intercom does not stop the clock. When a child wakes or resumes, its original launch card shows the elapsed time for the new run. A management hint appears only when the task can be selected. Ctrl+O expands the prompt, tool calls and result. Completion notices show the agent's name and first result line. If an older transcript is unavailable, expansion shows the full retained result and an unavailable-transcript message rather than an empty tool-call list.
247
240
 
248
- Cancelling the parent turn stops a running foreground child. This is terminal cancellation, not completion or a retryable failure. Atomic returns labelled partial findings from the run's modified `progress.md`, the last assistant text, or a cancellation notice with available artifact paths. Parallel siblings do not each receive duplicate copies of shared progress.
241
+ Cancelling the parent turn ends its wait, never the child: a running subagent keeps running and reports by its completion notice. Stop a child with [run control](#run-control) or from `/tasks`. In an SDK session without a task host, whose `subagent` call waits for its children, cancelling the call stops them for good. Atomic then returns labelled partial findings from the run's modified `progress.md`, the last assistant text, or a cancellation notice with available artifact paths. Parallel siblings do not each receive duplicate copies of shared progress.
249
242
 
250
243
  Use the returned task or run ID for status and run control. Expand status cards to see every child, full paths, task, parent, and any recorded termination cause; status inspection does not start work. Atomic keeps the in-process status of the 256 most recently finished subagent runs, as `/tasks` keeps the 256 most recently finished tasks; a run with a child still pending, running or continued is always kept. A child of an older run is no longer listed under its run's path, and still resumes with `subagent({ action: "resume", id })` from its saved session.
251
244
 
@@ -277,22 +270,24 @@ subagent({ action: "resume", id: "<child-id>", message: "Focus on the failing te
277
270
 
278
271
  Paused, quit, interrupted, completed, and failed children are resumable, including a paused child that you later quit. So are children whose session you closed or switched away from, whether Atomic exited or crashed, or you used `/new`, `/resume` to another session, or `/fork`; they are restored when that session reopens. Subagents of a workflow stage that was paused or quit, including by Atomic exiting or a session switch, stay resumable too: the stage agent can continue them with `resume`, and resuming the run after Atomic restarts restores them with the stage. These children are terminal, and `resume` returns an error that says why:
279
272
 
280
- - **Killed**: cancelled for good by an owner or batch cancellation. Stopping a subagent from `/tasks` quits it resumably instead.
273
+ - **Killed**: cancelled for good by an owner or batch cancellation. Confirming a stop in the agent panel or `/tasks` quits the subagent resumably instead.
281
274
  - **Stage ended**: the workflow stage that launched it finished, or its run ended or was cancelled. This covers every subagent of that stage, including ones you paused or quit, and also a run killed while it waited, after a restart, to be resumed. The error reads `<agent> (<child-id>, <intercom-name>) is terminal and cannot be resumed: its workflow stage ended (the stage finished, or its run ended or was cancelled). Launch a fresh subagent if its work is still needed.`
282
275
  - **Gone**: it could not be restored after a restart.
283
276
 
284
277
  An Intercom `send` or `ask` to a child that has no live session, because it completed, failed, was stopped or cancelled, does not return a bare `Session not found` while the session that launched it is connected. The sender gets an error that says how the child ended and names the call to make, for example `Subagent "subagent-worker-aabcf28b-1" completed and has no live session (recipient_completed). Its launching session can continue it with subagent({ action: "resume", id: "aabcf28b:0", message: "<your message>" }).` A send made in the moment a child's session closes waits up to 20 seconds for that answer, and is delivered if the child reconnects instead. See [Subagents with no live session](/intercom/reference#subagents-with-no-live-session) for the error codes.
285
278
 
286
- Resume also refuses a child that is still running (pause or quit it first) and an id this session did not launch. A resume that fails, for example because the child's agent is no longer defined, keeps its `worktree: true` worktree with its changes and branch.
279
+ Resume also refuses a child that is still running (pause or quit it first) and an id this session did not launch. That includes a child that is running again because a wake reopened it, for example after a released child's call finished or a late result reached a finished child: the error reads `<agent> (<child-id>, <intercom-name>) is already running as task <task-id>; pause or quit it first.` To reach a running child without stopping it, send it an Intercom message. A resume that arrives while a wake or another resume is still reopening the child gives that error as soon as the new task starts. You can use the task ID from the launch receipt immediately, even before the child's record is saved or after reopening the owner's view. A workflow stage that keeps its task host across `/reload` still recognizes the task and any wake already reopening it; it does not start a second copy. Resume does not wait for a sibling to save or for the child to register on Intercom. A resume that fails, for example because the child's agent is no longer defined, keeps its `worktree: true` worktree with its changes and branch.
280
+
281
+ Interrupting your turn (Esc) ends a `pause`, `resume`, or `quit` call that is still waiting; the call's result says what happened. A stop that was already requested goes on, so the child still ends paused or quit. If the resume is still checking the child's state or queued to wake it, the child does not run it or receive its `message`. You can retry when you are ready; pending saves still finish. A resume that had already begun reopening the child goes on, and `subagent({ action: "status", id })` shows how it went.
287
282
 
288
283
  An SDK session without a task host runs its subagents directly and records them in its session the same way, so `pause`, `resume` (with or without `message`, queued messages included) and `quit` work there by id and with `all: true`, also after the session is reopened. A child resumed there runs in the background, and its result arrives as a completion notice. Closing the session stops such a child; reopening the session relaunches it automatically, and the messages it had queued and not read are delivered once, in order. For a terminal child, launch a fresh child with an explicit context handoff.
289
284
 
290
285
  #### Released subagents
291
286
 
292
- A background subagent that waits more than a minute on a tool call marked `detachable` (extension tools opt in with `detachable: true`) is **released**: the call keeps running, but the child gives up its session, task and Intercom connection and holds nothing else while it waits. Nothing paused it, and it needs no `resume`: it wakes by itself when the call finishes. Its parent gets a notice that reads `Subagent <name> released while waiting on <tool> (<call id>)` and says it wakes by itself. The notice appears in the parent's chat without starting a turn, and the parent's model reads it with its next turn. `/tasks`, the agent panel and a chat's task footer list the child under **Waiting** with a still `◌` mark and `waiting on <tool>`, naming the tools it waits on; its detail in `/tasks` reads `Waiting on <tool>` and adds the call ids. Opening the child shows its saved conversation without waking it, with a note that says what it waits on, that it wakes by itself, and which of its shells still run. Alt+W (`app.tasks.openWaited`) opens the output of its newest running shell, from that chat or from its row in `/tasks`, and ← goes back. The launch card in the parent's chat shows it with the same `◌` mark and `Waiting on <tool>`, and shows it running or finished again once it wakes or ends. A message you send from that chat wakes it, as an Intercom message does. Pressing `x` twice on its row stops it as `quit` does, so it no longer wakes by itself and waits for a resume. When it wakes, its later run replaces it in these lists. `subagent({ action: "status" })` lists it as `released · waiting on <tool> (<call id>)` and says it is not paused. A child you pause or quit is reported as `paused · awaiting resume`.
287
+ A background subagent that waits more than a minute on a tool call marked `detachable` (extension tools opt in with `detachable: true`) is **released**: the call keeps running, but the child gives up its session, task and Intercom connection and holds nothing else while it waits. Nothing paused it, and it needs no `resume`: it wakes by itself when the call finishes. Its parent gets a notice that reads `Subagent <name> released while waiting on <tool> (<call id>)` and says it wakes by itself. The notice appears in the parent's chat as `◌ <name> is waiting on <tool> (<call id>)`, with the same still, dim `◌` mark every other view gives the child, without starting a turn, and the parent's model reads it with its next turn. `/tasks`, the agent panel and a chat's task footer list the child under **Waiting** with a still `◌` mark and `waiting on <tool>`, naming the tools it waits on; its detail in `/tasks` reads `Waiting on <tool>` and adds the call ids. Opening the child shows its saved conversation without waking it, with a note that says what it waits on, that it wakes by itself, and which of its shells still run. Alt+W (`app.tasks.openWaited`) opens the output of its newest running shell, from that chat or from its row in `/tasks`, and ← goes back. The launch card in the parent's chat shows it with the same `◌` mark and `Waiting on <tool>`, and shows it running or finished again once it wakes or ends. A message you send from that chat wakes it, as an Intercom message does. Pressing `x` twice on its row stops it as `quit` does, so it no longer wakes by itself and waits for a resume. When it wakes, its later run replaces it in these lists. `subagent({ action: "status" })` lists it as `released · waiting on <tool> (<call id>)` and says it is not paused. A child you pause or quit is reported as `paused · awaiting resume`, and its notice keeps the `⏸` mark.
293
288
 
294
- - Only background subagents are released. A foreground subagent stays a live session for as long as it waits, because your turn is waiting for its result.
295
- - When the call finishes, the child wakes from its saved session and continues the turn with the call's result.
289
+ - Any subagent with an owning session can be released, including one your turn waits for with `action: "wait"`: that wait then ends and reports the child released.
290
+ - When the call finishes, the child wakes from its saved session and continues the turn with the call's result. You can `/reload` while it wakes: the same task appears as running without a second `resume`.
296
291
  - An Intercom message or ask sent to a released child wakes it too. Senders wait while it wakes, and it receives every message once, in the order they were sent. Calls it is still waiting on are marked as still running, and their results arrive later as messages.
297
292
  - An ask already awaiting a child's reply stays open if the child is released, also when the ask came through another node's broker with [multi-node Intercom routing](/intercom/operations#running-intercom-across-machines); it can be answered after the child wakes, on any node. A woken child keeps its Intercom session id; if it cannot, an asker on another node does not learn the new id, and its wait ends at its reply timeout. If the child is gone instead, or the session that launched it drops it or closes, an asker on the same broker is told it disconnected, and an asker on another node waits until its reply timeout.
298
293
  - Steering and follow-up messages the child had queued and not yet read when it was released are delivered when it wakes, once and in order. Turn-starting Intercom messages, extension messages and background completion notices accepted during release are kept too, with steering or follow-up delivery. Their cards are saved once, and their context is delivered once on wake. Extension messages with `excludeFromContext: true` keep only their saved cards and never reach the model. This release guarantee does not apply to `deliverAs: "nextTurn"`.
@@ -314,7 +309,7 @@ When waking or keeping track of a released subagent fails, `status` and the noti
314
309
  | `child-record-unreadable` | The child's latest record is in a session that is not open in this process, such as a workflow stage's session after the stage closed. | Open the session that launched the child and try again from it. |
315
310
  | `child-unrestorable` | The child's session or agent cannot be restored, for example because its agent is no longer defined. | Fix what the reason names, then `resume` it, or launch a new subagent. |
316
311
  | `record-append-failed` | The child's record could not be saved to the session store. Retryable. | Check the session store. Until the record is saved, a restart would not know this state of the child. |
317
- | `hold-failed` | Sends to the released child could not be held at the Intercom broker. Retryable. | Check that Intercom is connected. Until the reservation exists, sends to the child are answered as not found. |
312
+ | `hold-failed` | Sends to the released child could not be held at the Intercom broker, for example because another session holds that child. Retryable. The notice names only the children whose reservation failed, once for each release of a child, until a reservation of it succeeds. A retry skips a child that has since resumed or finished. | Check that Intercom is connected. Until the reservation exists, sends to the child are answered as not found. |
318
313
  | `completion-not-held` | A shell task finished after the child that started it ran again or ended. | Nothing: the notice waits for the child's next run. The session that launched the child never receives it. |
319
314
  | `wake-failed` | A wake failed for any other reason. Retryable. | The results are kept: `resume` the child to try again. |
320
315
 
@@ -330,7 +325,7 @@ A parallel launch keeps a separate `Agent(...)` block for every child, in launch
330
325
 
331
326
  ## Task inspection
332
327
 
333
- Hosts with an owner task store expose `/tasks` and `/tasks <id>` for background agents and shells, including their retained terminal results. Foreground-only work is excluded. Enter or Right opens the selected task's chat or output, or its detail page when no transcript is available. Press `x` twice within 3 seconds to stop a running task, or once to dismiss a finished row. Escape returns one view at a time without stopping work.
328
+ Hosts with an owner task store expose `/tasks` and `/tasks <id>` for subagents and background shells, including their retained terminal results. A shell command its tool call still waits on is excluded. Enter or Right opens the selected task's chat or output, or its detail page when no transcript is available. Press `x` twice within 3 seconds to stop a running task, or once to dismiss a finished row. Escape returns one view at a time without stopping work.
334
329
 
335
330
  Stopping a subagent from `/tasks` uses `quit` and keeps it resumable. Its row shows **Stopped** (`◼`), and its chat reads `Stopped · send to resume`. Send a message from that chat, or use `subagent({ action: "resume", id })`, to continue it. A child whose owner ended, or whose saved state is unavailable, remains read-only.
336
331
 
@@ -344,13 +339,13 @@ Plain RPC clients and SDK hosts without a task inspector keep receiving child qu
344
339
 
345
340
  Opening `/tasks` while the main chat has a question does not answer or cancel that main-chat question. It returns with its selection intact when task navigation closes.
346
341
 
347
- In the default isolated CLI, background subagents continue running after their launch observation returns. The agent panel below the prompt lists each one with its task, elapsed time and tokens; press ↓ on an empty prompt and Enter on a row to open its chat, or run `/tasks` to inspect individual tasks. Task updates never open either automatically. Completed tasks leave the panel after a while and remain available in completion notices and `/tasks`. Inspecting does not restart work or create a second task owner. Top-level model bash commands use this owner on POSIX and native Windows; native Windows PowerShell is also owner-bound. Commands inside subagent sessions retain their existing execution path. See [Background shells](/background-tasks#background-shells) for platform support and the separate execution timeout.
342
+ In the default isolated CLI, background subagents continue running after their launch observation returns. The agent panel below the prompt lists each one with its task, elapsed time and tokens; press ↓ on an empty prompt and Enter on a row to open its chat, or run `/tasks` to inspect individual tasks. Task updates never open either automatically. Completed tasks leave the panel as soon as they finish and remain available in completion notices and `/tasks`. Inspecting does not restart work or create a second task owner. Top-level model bash commands use this owner on POSIX and native Windows; native Windows PowerShell is also owner-bound. Commands inside subagent sessions retain their existing execution path. See [Background shells](/background-tasks#background-shells) for platform support and the separate execution timeout.
348
343
 
349
344
  Transcript inspection shows the child's conversation as a chat, with the same scrolling, keys, and display settings as a workflow stage chat: it opens at the latest message, follows new output, and loads earlier retained history as you scroll toward the top. Thinking blocks follow Ctrl+T and tool output follows Ctrl+O. Compaction boundaries, branch summaries, and extension notices appear as they do in the chat. Missing capture is reported as `Transcript unavailable`; metrics never substitute for missing messages. See [Inspect tasks](/background-tasks#inspect-tasks) for the controls.
350
345
 
351
- A subagent's chat has an attached composer: heavy accent rules around the prompt, the top one naming the subagent, its task and its state (`debugger · #5220 spawn lock · 18m`), the way an attached workflow stage chat names `stage · <name> · <state>`. The empty prompt reads `Message debugger…`, or `Answer debugger…` while it waits on a question. The name is the agent's name, or its Intercom name when it has none. The chat box is the stage chat's: pending messages, the working line and the usage meter sit above the prompt, and the model and folder line and the subagent's own running tasks, as agent-panel rows, sit below it. While the subagent runs in this session, the usage meter and model line show its own session (the model line only while the subagent is idle; while it works, no status line shows below the prompt), and a transcript opened mid-turn shows the working line and any messages already queued for it. A subagent that has finished, or runs in another process, still lists its active tasks below the prompt in the same rows. Typing `/tasks` there opens that subagent's own tasks, the shells it ran and the subagents it launched, instead of the parent's. Inside a nested subagent's transcript, `/tasks` lists that subagent's tasks. Escape or Left on that list returns to the subagent's chat. In the subagent's chat itself, Left on an empty prompt goes back and Escape interrupts the subagent's current turn without leaving or ending it. The main chat's `/tasks` lists only the main chat's own tasks: its shells, and the subagents and workflow runs it launched, not the shells those subagents ran.
346
+ A subagent's chat has an attached composer: accent-coloured rules around the prompt, the top one naming the subagent, its task and its state (`debugger · #5220 spawn lock · 18m`), the way an attached workflow stage chat names `stage · <name> · <state>`. The empty prompt reads `Message debugger…`, or `Answer debugger…` while it waits on a question. The name is the agent's name, or its Intercom name when it has none. The chat box is the stage chat's: pending messages, the working line and the usage meter sit above the prompt, and the model and folder line and the subagent's own running tasks, as agent-panel rows, sit below it. While the subagent runs in this session, the usage meter and model line show its own session (the model line only while the subagent is idle; while it works, no status line shows below the prompt), and a transcript opened mid-turn shows the working line and any messages already queued for it. A subagent that has finished, or runs in another process, still lists its active tasks below the prompt in the same rows. Typing `/tasks` there opens that subagent's own tasks, the shells it ran and the subagents it launched, instead of the parent's. Inside a nested subagent's transcript, `/tasks` lists that subagent's tasks. Escape or Left on that list returns to the subagent's chat. In the subagent's chat itself, Left on an empty prompt goes back and Escape interrupts the subagent's current turn without leaving or ending it. The main chat's `/tasks` lists only the main chat's own tasks: its shells, and the subagents and workflow runs it launched, not the shells those subagents ran.
352
347
 
353
- After Escape interrupts a subagent's turn, its task stays running while the child waits. Its stopped row stays in the agent panel and `/tasks`; `x` still requires confirmation to quit the task rather than dismissing it. Your next message or the completion of its own background work can start another turn. This includes a resumed subagent interrupted while it replays a message that arrived before it stopped: it answers your next message, then continues with the task it was resumed with. You can interrupt that turn again, including while it is starting, to leave the child waiting. If a message cannot start a turn because it could not be saved, fix the storage problem and send another message; the child stays available. When a later turn finishes without another interrupt, the task completes and its parent receives the result. Sending another message in the finished child's chat resumes it in its saved session; the same chat can resume it again after later completions.
348
+ After Escape interrupts a subagent's turn, its task stays running while the child waits. Its stopped row stays in `/tasks`, and in the agent panel while other background work is still running; `x` still requires confirmation to quit the task rather than dismissing it. Your next message or the completion of its own background work can start another turn. This includes a resumed subagent interrupted while it replays a message that arrived before it stopped: it answers your next message, then continues with the task it was resumed with. You can interrupt that turn again, including while it is starting, to leave the child waiting. If a message cannot start a turn because it could not be saved, fix the storage problem and send another message; the child stays available. When a later turn finishes without another interrupt, the task completes and its parent receives the result. Sending another message in the finished child's chat resumes it in its saved session; the same chat can resume it again after later completions.
354
349
 
355
350
  The prompt completes as a stage chat's does: `/` offers `/tasks` and the subagent's own `/skill:` commands, and `@` file mentions and Tab complete paths in the subagent's working directory. A skill command reaches the subagent expanded from its own skills, as the subagent would expand it.
356
351
 
@@ -383,6 +378,8 @@ For parallel implementation work, `worktree: true` can give each child an isolat
383
378
 
384
379
  Observation yields do not release these worktrees. The batch's worktrees and branches are removed once every child that uses them has finished; Atomic first saves each worktree's changes as a patch under the run's `worktree-diffs/<run id>` artifact directory. When a child is paused or quit, or stays resumable because you closed or switched away from its session or its workflow stage paused, its worktree is kept only if it has uncommitted or untracked changes or commits that are not in the run's base; a clean worktree is removed with the others. Resuming the child continues in its kept worktree, or recreates a removed one from the run's base with its saved patch applied, so a resumed completed child starts with its earlier changes. A resumed child keeps its worktree until it finishes again, and then saves a new patch (`task-<n>-<agent>.<execution>.patch`) rather than overwriting the earlier one. Cancelling a child for good, including a queued one, or its workflow stage closing for good, lets its worktree be removed. If you never resume a stopped child that has unsaved changes, its worktree stays on disk under `.atomic/worktrees/`.
385
380
 
381
+ If resume cannot restart a child, it waits for worktree cleanup before reporting the error. A sibling that is still running keeps the batch's worktrees; wait for it before removing them. If cleanup takes more than ten seconds, the reply says so. Don't remove the directory while cleanup continues in the background. If a git command times out, check the worktree for unsaved changes before removing it.
382
+
386
383
  ### Named worktrees
387
384
 
388
385
  To run a child on a branch you choose, pass `worktree: { branch, base?, path? }` on a single call, a parallel call (it applies to each task without its own), or a task:
@@ -449,7 +446,7 @@ Starting Atomic and resuming a session (`/resume`) recover children; `/reload`,
449
446
 
450
447
  When one assistant response emits several sibling execution-mode `subagent` tool calls, Atomic collects that synchronous burst before starting a child and runs it as one indexed parallel set. Each original tool call still receives one result containing only the children it requested, and its live result, progress, control, and artifact updates are projected to that same route without sibling data. The TUI redraws the shared run as one aggregate parallel widget rather than retaining one widget per original call. A single call keeps its original SINGLE or PARALLEL mode, calls awaited in sequence remain separate runs, and management actions bypass collection. An execution call that arrives after a child has started still receives the existing in-progress rejection. Prefer one explicit `{ tasks: [...] }` call when planning parallel work; burst collection handles sibling calls emitted by a model.
451
448
 
452
- For a collected burst, each call contributes its top-level `agent` task first and then its `tasks` entries in array order. Atomic preserves duplicates, expands `count` in place, and applies `parallel.maxTasks` after flattening and expansion. Each call-level `cwd` selects that call's agent-discovery scope and child base directory. A task-level `cwd` stays relative to that call base and changes only that child's execution directory, not agent discovery. This per-origin discovery rule applies only to collected sibling calls; an ordinary explicit `{ tasks: [...] }` call keeps one discovery scope from its top-level `cwd`. Per-call and per-task `group` values also stay with their originating children. A call's named `worktree: { … }` stays with its own children, so sibling calls can each name a different one. Shared run options must match across every sibling call: `concurrency`, `worktree: true`, `context`, `share`, `control`, `sessionDir`, `maxOutput`, `artifacts`, `includeProgress`, and `agentScope`. A mismatch rejects the whole burst before any child launches and names the incompatible field.
449
+ For a collected burst, each call contributes its top-level `agent` task first and then its `tasks` entries in array order. The same list is checked against the per-call limit and launched even if all other calls in the message fail. Atomic preserves duplicates, expands `count` in place, and applies `parallel.maxTasks` after flattening and expansion. Each call-level `cwd` selects that call's agent-discovery scope and child base directory. A task-level `cwd` stays relative to that call base and changes only that child's execution directory, not agent discovery. This per-origin discovery rule applies only to collected sibling calls; an ordinary explicit `{ tasks: [...] }` call keeps one discovery scope from its top-level `cwd`. Per-call and per-task `group` values also stay with their originating children. A call's named `worktree: { … }` stays with its own children, so sibling calls can each name a different one. Shared run options must match across every sibling call: `concurrency`, `worktree: true`, `context`, `share`, `control`, `sessionDir`, `maxOutput`, `artifacts`, `includeProgress`, and `agentScope`. A mismatch rejects the whole burst before any child launches and names the incompatible field. Two tasks in one call writing to the same resolved output path fail only that call, including in named worktrees. An output conflict only between calls fails the merged run. Calls with a known setup error do not count toward the remaining calls’ combined task limit; an absolute output path can be checked even before a worktree exists.
453
450
 
454
451
  For a collected `worktree: true` burst, every call-level `cwd` must resolve to the same path. That common path becomes the shared worktree root; differing origins reject the burst before launch, and any task-level `cwd` must still resolve to that root. Each projected caller result keeps shared worktree diff text and terminal control guidance while its child results and standard child-output sections remain route-local.
455
452
 
@@ -461,9 +458,9 @@ Detached children remain owned by the workflow stage that launched them. When th
461
458
 
462
459
  When a subagent call or parallel task uses a `cwd`, Atomic validates that working directory before starting the child runtime. Missing or non-directory paths are reported as `cwd` problems instead of lower-level runtime errors.
463
460
 
464
- Single-agent calls also accept `reads: string[] | false`. Atomic prepends those files as read context for foreground execution through the same in-process session path. Relative entries resolve against the effective child `cwd` (including a relative top-level `cwd` resolved from the parent); absolute entries are unchanged. Invalid values fail before the child session starts.
461
+ Single-agent calls also accept `reads: string[] | false`. Atomic prepends those files as read context through the same in-process session path. Relative entries resolve against the effective child `cwd` (including a relative top-level `cwd` resolved from the parent); absolute entries are unchanged. Invalid values fail before the child session starts.
465
462
 
466
- Single-agent calls accept `progress: boolean` in foreground mode. `progress: true` creates a run-scoped `progress.md` under isolated subagent artifact storage and instructs the child to maintain it without writing `progress.md` into the child `cwd`; `progress: false` disables an agent's `defaultProgress`. When `progress` is omitted, the agent's default is inherited, except that inherited progress is suppressed for read-only tasks (`progress: true` still explicitly opts in). Foreground runs remove this run-owned progress storage after the child exits when `artifacts: false`, including children temporarily detached for intercom coordination. Parallel tasks with `progress` enabled share one run-scoped `progress.md` in the same artifact storage, never in a task's `cwd` or the project directory. This is separate from `includeProgress: true`, which only includes detailed runtime progress telemetry in the final tool result and does not create or maintain a file.
463
+ Single-agent calls accept `progress: boolean`. `progress: true` creates a run-scoped `progress.md` under isolated subagent artifact storage and instructs the child to maintain it without writing `progress.md` into the child `cwd`; `progress: false` disables an agent's `defaultProgress`. When `progress` is omitted, the agent's default is inherited, except that inherited progress is suppressed for read-only tasks (`progress: true` still explicitly opts in). Atomic removes this run-owned progress storage after the child exits when `artifacts: false`. Parallel tasks with `progress` enabled share one run-scoped `progress.md` in the same artifact storage, never in a task's `cwd` or the project directory. This is separate from `includeProgress: true`, which only includes detailed runtime progress telemetry in the final tool result and does not create or maintain a file.
467
464
 
468
465
  ```ts
469
466
  subagent({ agent: "worker", task: "Implement the approved fix.", progress: true })
package/docs/tui.md CHANGED
@@ -852,7 +852,7 @@ export default function (pi: ExtensionAPI) {
852
852
 
853
853
  ### Pattern 7b: Attached Composer
854
854
 
855
- A chat that talks to something other than the main agent should not look like the main chat. `applyAttachedComposer(style, label, placeholder, lines)` takes an editor's rendered lines and returns them in the form Atomic uses for subagent and workflow stage chats: heavy accent rules above and below the prompt, the top rule ending in a bold `label`, and a dim `placeholder` after the cursor while nothing is typed.
855
+ A chat that talks to something other than the main agent should not look like the main chat. `applyAttachedComposer(style, label, placeholder, lines)` takes an editor's rendered lines and returns them in the form Atomic uses for subagent and workflow stage chats: accent-coloured rules above and below the prompt, the top rule ending in a bold `label`, and a dim `placeholder` after the cursor while nothing is typed.
856
856
 
857
857
  ```typescript
858
858
  import { applyAttachedComposer, CustomEditor, type ExtensionAPI, type Theme } from "@bastani/atomic";
package/docs/usage.md CHANGED
@@ -125,7 +125,7 @@ If the first message sent after compaction fails, it stays queued with the messa
125
125
 
126
126
  Both interrupts hold a queued message only while it is still waiting in the queue. A message the agent has already picked up is written into the transcript, and an interrupt that cancels its reply before any output appears no longer strands it: Atomic answers it instead of returning it to the editor. A reply that had already started printing is left as-is and is not restarted. Sending a message while that recovered reply is still streaming is safe — it is delivered as soon as the reply finishes.
127
127
 
128
- Both abort routes ask the agent to stop cooperatively. Escape waits as long as the agent needs, and neither route terminates the engine during normal cancellation.
128
+ Both abort routes ask the agent to stop cooperatively, and neither route terminates the engine during normal cancellation. The turn ends once each of its tool calls has stopped. A tool call still waiting for an earlier call to finish ends at once with `Operation aborted` and does not run. A tool call that has not stopped 10 seconds after the interrupt (set `ATOMIC_TOOL_ABORT_GRACE_MS` to change this; see [Environment variables](/environment-variables)) gets the result `Operation aborted: <tool> did not stop within 10 seconds after the turn was interrupted`, and the turn ends anyway. Such a call may keep running in the background, but later tool calls no longer wait for it. Anything it returns or throws after the grace period is discarded; it does not enter the chat or a later model request.
129
129
 
130
130
  Ctrl+C also provides a recovery path. It reaches Atomic even when an extension's custom UI owns the screen, closing that UI if it does not handle the key. If the engine stops answering, a queue clear or cancellation remains unanswered for over one second, or either operation fails, Ctrl+C replaces the engine. This includes cancelling chat, shell commands, compaction, and retries, even while engine heartbeats continue. It also covers a replacement that hangs during startup or fails to start. Recovery is explicit: a stalled control does not restart the engine on its own. Replacing the engine interrupts its running workflows and tools; inspect workflow status before resuming work.
131
131
 
@@ -193,6 +193,8 @@ The agent remembers earlier work through `history://`: it recalls this project's
193
193
 
194
194
  Use `/export [file]` to write a session to HTML. In the exported page, press `T` to toggle thinking, `O` to toggle tool output, and `H` to show custom messages that are hidden in the terminal. Hidden messages stay hidden until you toggle them, and selecting one in the sidebar reveals them.
195
195
 
196
+ `atomic --export <session.jsonl> [file]` can show an `Agent(...)` card for a single subagent launch on the selected branch. Expand it to read the prompt, tool calls and answer saved in the receipt. A recorded background handoff is labeled as a handoff, not as a currently running child. Open **Recorded arguments and result** for the original record. The export never opens the child's session. Parallel launches, incomplete or ambiguous receipts, and other extension tools keep their usual export format.
197
+
196
198
  Use `/share` to upload a private GitHub gist with a shareable link. The link opens the session in Atomic's viewer at `https://bastani.ai/session/`; set `ATOMIC_SHARE_VIEWER_URL` to use your own viewer instead.
197
199
 
198
200
  Treat exported and shared sessions as sensitive: transcripts can contain source code, file paths, credentials, and other private data from your session. Review a session before sharing it, and only upload transcripts you are comfortable making accessible to anyone with the link.
@@ -1267,7 +1267,7 @@ Native session delivery is literal by default. Set `expandPromptTemplates: true`
1267
1267
 
1268
1268
  Native sessions accept strings or text/image content blocks. Non-native fallback adapters accept only strings and reject block arrays; `deliverAs` affects streaming delivery only, and follow-on turns retain the stage MCP scope.
1269
1269
 
1270
- Externally produced Intercom and subagent notices admitted before the generation closes drain through the same session. When a busy stage owns a foreground subagent, exact-owner detach gets first refusal before Intercom enters this boundary; unclaimed traffic then uses normal stage admission. Closing the atomic boundary cancels still-running stage-owned children and suppresses their later findings and completion notices. Ordinary traffic not owned by that stage arriving afterward cannot reopen the completed stage and retains the existing single main-chat route.
1270
+ Externally produced Intercom and subagent notices admitted before the generation closes drain through the same session. When a busy stage's own subagent messages it, exact-owner detach gets first refusal before Intercom enters this boundary; unclaimed traffic then uses normal stage admission. Closing the atomic boundary cancels still-running stage-owned children and suppresses their later findings and completion notices. Ordinary traffic not owned by that stage arriving afterward cannot reopen the completed stage and retains the existing single main-chat route.
1271
1271
 
1272
1272
  See [Stage follow-on user messages](/workflows/authoring#stage-follow-on-user-messages) for the full lifecycle and schema-backed example.
1273
1273
 
@@ -2359,6 +2359,8 @@ try {
2359
2359
 
2360
2360
  `SqlRunJournal.open` leaves ownership of the facade with you. Journal tables use `wf_` names, optionally preceded by your prefix; session tables use a separate namespace in the same database. A new prefix selects an empty journal, not a migration. Bare journal table names from earlier unreleased builds are not read. SQL event and lease timestamps, including expiry checks, use the database clock. Journal storage failures expose `StorageUnavailableError.adapter`, `.location`, and `.cause`; use `.location` rather than `.path`.
2361
2361
 
2362
+ `journal.listRuns()` first asks for the catalog in one response. If the server refuses the response size and the journal has no legacy source, it reads the unfiltered catalog in pages from one snapshot on a separate connection. The libSQL server adapter supports this; adapters that cannot open a separate reader return the original refusal instead of delaying live runs. A refused page fails the listing rather than returning a partial result. Filtered lists and lists that include legacy tables use the original queries. Exporting one explicitly selected run from a named database can also recover from a refused catalog; it does not page the run's events.
2363
+
2362
2364
  Custom journals implement this full async interface. The named types are exported from `@bastani/atomic/workflows`:
2363
2365
 
2364
2366
  ```ts
@@ -989,7 +989,7 @@ Missing required outputs, schema type mismatches, and non-JSON-serializable retu
989
989
 
990
990
  Pass only imported workflow definitions to `ctx.workflow(...)`, not registry names or paths. Missing modules or invalid exports fail discovery. Nested children count against `maxDepth`, default `3` total workflow levels.
991
991
 
992
- A missing, empty, or invalid child graph retains a boundary summary rather than displaying unrelated nodes. Failed or skipped boundaries also retain summaries. Use `stageName` for a concise custom boundary label.
992
+ A failed or skipped boundary still shows the stages and tools of a child it actually started. A missing, empty, or invalid child graph retains a boundary summary rather than displaying unrelated nodes. Use `stageName` for a concise custom boundary label.
993
993
 
994
994
  If the parent exits while a child runs, the child is cleaned up and becomes `cancelled`, non-resumable; active child stages and prompts are skipped. No further child work starts after parent exit.
995
995