@bastani/atomic 0.9.39 → 0.9.40-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +14 -0
  3. package/dist/builtin/intercom/broker/broker.ts +523 -72
  4. package/dist/builtin/intercom/broker/client.ts +136 -5
  5. package/dist/builtin/intercom/broker/database-wake-up-bus.ts +274 -0
  6. package/dist/builtin/intercom/broker/group-membership.ts +2 -2
  7. package/dist/builtin/intercom/broker/multinode-router.ts +1500 -0
  8. package/dist/builtin/intercom/broker/multinode-state-store.ts +569 -0
  9. package/dist/builtin/intercom/broker/open-broker-state.ts +160 -0
  10. package/dist/builtin/intercom/broker/paths.ts +6 -0
  11. package/dist/builtin/intercom/broker/pending-send-registry.ts +14 -0
  12. package/dist/builtin/intercom/broker/recipient-receipts.ts +93 -0
  13. package/dist/builtin/intercom/broker/restoring-recipients.ts +263 -0
  14. package/dist/builtin/intercom/broker/send-handler.ts +241 -25
  15. package/dist/builtin/intercom/broker/session-id-reclaim.ts +41 -0
  16. package/dist/builtin/intercom/broker/socket-writes.ts +47 -0
  17. package/dist/builtin/intercom/broker/spawn.ts +10 -2
  18. package/dist/builtin/intercom/broker/sql-held-send-store.ts +96 -0
  19. package/dist/builtin/intercom/broker/sql-known-session-store.ts +129 -0
  20. package/dist/builtin/intercom/broker/sql-lease-store.ts +194 -0
  21. package/dist/builtin/intercom/broker/sql-outbox-store.ts +249 -0
  22. package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +105 -0
  23. package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +295 -0
  24. package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +126 -0
  25. package/dist/builtin/intercom/broker/supervisor-channel.ts +10 -0
  26. package/dist/builtin/intercom/broker/wake-up-bus.ts +60 -0
  27. package/dist/builtin/intercom/index.bundle.mjs +793 -91
  28. package/dist/builtin/intercom/package.json +1 -1
  29. package/dist/builtin/intercom/retry-policy.ts +4 -0
  30. package/dist/builtin/intercom/session-target.ts +24 -0
  31. package/dist/builtin/intercom/types.ts +57 -3
  32. package/dist/builtin/mcp/package.json +1 -1
  33. package/dist/builtin/subagents/CHANGELOG.md +31 -0
  34. package/dist/builtin/subagents/README.md +18 -12
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +1 -1
  37. package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +55 -8
  38. package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +7 -2
  39. package/dist/builtin/subagents/skills/cua-driver/LINUX.md +7 -1
  40. package/dist/builtin/subagents/skills/cua-driver/MACOS.md +151 -27
  41. package/dist/builtin/subagents/skills/cua-driver/RUNTIME.md +1 -1
  42. package/dist/builtin/subagents/skills/cua-driver/SKILL.md +33 -17
  43. package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +5 -0
  44. package/dist/builtin/subagents/skills/cua-driver/WORKFLOW.md +46 -8
  45. package/dist/builtin/subagents/skills/subagent/SKILL.md +18 -20
  46. package/dist/builtin/subagents/src/extension/index.bundle.mjs +8032 -6034
  47. package/dist/builtin/web-access/CHANGELOG.md +6 -0
  48. package/dist/builtin/web-access/README.md +1 -1
  49. package/dist/builtin/web-access/index.bundle.mjs +2 -5
  50. package/dist/builtin/web-access/package.json +1 -1
  51. package/dist/builtin/workflows/CHANGELOG.md +24 -0
  52. package/dist/builtin/workflows/README.md +1 -1
  53. package/dist/builtin/workflows/package.json +1 -1
  54. package/dist/builtin/workflows/skills/impeccable/SKILL.md +8 -8
  55. package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +3 -3
  56. package/dist/builtin/workflows/skills/impeccable/reference/adapt.native.md +1 -1
  57. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +4 -2
  58. package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +2 -2
  59. package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +1 -1
  60. package/dist/builtin/workflows/skills/impeccable/reference/critique.md +22 -9
  61. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +2 -2
  62. package/dist/builtin/workflows/skills/impeccable/reference/distill.md +3 -3
  63. package/dist/builtin/workflows/skills/impeccable/reference/extract.md +3 -3
  64. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +2 -4
  65. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +4 -4
  66. package/dist/builtin/workflows/skills/impeccable/reference/live.md +1 -1
  67. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +6 -6
  68. package/dist/builtin/workflows/skills/impeccable/reference/onboard.md +3 -3
  69. package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +3 -3
  70. package/dist/builtin/workflows/skills/impeccable/reference/overdrive.md +3 -3
  71. package/dist/builtin/workflows/skills/impeccable/reference/quieter.md +3 -3
  72. package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +10 -0
  73. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +1 -1
  74. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
  75. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +6 -0
  76. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +47 -22
  77. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-dom.js +34 -1
  78. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +25 -1
  79. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +33 -8
  80. package/dist/builtin/workflows/src/durable/journal/resolution.d.ts +7 -7
  81. package/dist/builtin/workflows/src/extension/index.bundle.mjs +22715 -22159
  82. package/dist/builtin/workflows/src/index.js +106 -35
  83. package/dist/cli/args.d.ts +2 -0
  84. package/dist/cli/args.d.ts.map +1 -1
  85. package/dist/cli/args.js +17 -1
  86. package/dist/cli/args.js.map +1 -1
  87. package/dist/core/agent-session-extension-bindings.d.ts +2 -0
  88. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  89. package/dist/core/agent-session-extension-bindings.js +6 -6
  90. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  91. package/dist/core/agent-session-methods.d.ts +6 -3
  92. package/dist/core/agent-session-methods.d.ts.map +1 -1
  93. package/dist/core/agent-session-methods.js.map +1 -1
  94. package/dist/core/agent-session-persistent-custom-messages.d.ts +7 -2
  95. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  96. package/dist/core/agent-session-persistent-custom-messages.js +29 -12
  97. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  98. package/dist/core/agent-session-recovery.d.ts +14 -0
  99. package/dist/core/agent-session-recovery.d.ts.map +1 -0
  100. package/dist/core/agent-session-recovery.js +83 -0
  101. package/dist/core/agent-session-recovery.js.map +1 -0
  102. package/dist/core/agent-session-tasks.d.ts.map +1 -1
  103. package/dist/core/agent-session-tasks.js +4 -6
  104. package/dist/core/agent-session-tasks.js.map +1 -1
  105. package/dist/core/agent-session-types.d.ts +13 -0
  106. package/dist/core/agent-session-types.d.ts.map +1 -1
  107. package/dist/core/agent-session-types.js.map +1 -1
  108. package/dist/core/agent-session.d.ts +2 -1
  109. package/dist/core/agent-session.d.ts.map +1 -1
  110. package/dist/core/agent-session.js +4 -1
  111. package/dist/core/agent-session.js.map +1 -1
  112. package/dist/core/export-html/index.d.ts.map +1 -1
  113. package/dist/core/export-html/index.js +3 -2
  114. package/dist/core/export-html/index.js.map +1 -1
  115. package/dist/core/export-html/template.html +1 -0
  116. package/dist/core/export-html/template.js +37 -20
  117. package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
  118. package/dist/core/export-html/vendor/marked.min.js +76 -3
  119. package/dist/core/extensions/api-types.d.ts +6 -2
  120. package/dist/core/extensions/api-types.d.ts.map +1 -1
  121. package/dist/core/extensions/api-types.js.map +1 -1
  122. package/dist/core/extensions/event-results.d.ts +21 -0
  123. package/dist/core/extensions/event-results.d.ts.map +1 -1
  124. package/dist/core/extensions/event-results.js.map +1 -1
  125. package/dist/core/extensions/index.d.ts +1 -1
  126. package/dist/core/extensions/index.d.ts.map +1 -1
  127. package/dist/core/extensions/index.js.map +1 -1
  128. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  129. package/dist/core/extensions/loader-api.js +4 -0
  130. package/dist/core/extensions/loader-api.js.map +1 -1
  131. package/dist/core/extensions/runner-events.d.ts +9 -2
  132. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  133. package/dist/core/extensions/runner-events.js +29 -0
  134. package/dist/core/extensions/runner-events.js.map +1 -1
  135. package/dist/core/extensions/runner.d.ts +5 -3
  136. package/dist/core/extensions/runner.d.ts.map +1 -1
  137. package/dist/core/extensions/runner.js +7 -2
  138. package/dist/core/extensions/runner.js.map +1 -1
  139. package/dist/core/extensions/runtime-types.d.ts +1 -0
  140. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  141. package/dist/core/extensions/runtime-types.js.map +1 -1
  142. package/dist/core/extensions/session-events.d.ts +30 -2
  143. package/dist/core/extensions/session-events.d.ts.map +1 -1
  144. package/dist/core/extensions/session-events.js.map +1 -1
  145. package/dist/core/sdk-types.d.ts +3 -2
  146. package/dist/core/sdk-types.d.ts.map +1 -1
  147. package/dist/core/sdk-types.js.map +1 -1
  148. package/dist/core/sdk.d.ts.map +1 -1
  149. package/dist/core/sdk.js +3 -0
  150. package/dist/core/sdk.js.map +1 -1
  151. package/dist/core/session-storage.d.ts.map +1 -1
  152. package/dist/core/session-storage.js +15 -9
  153. package/dist/core/session-storage.js.map +1 -1
  154. package/dist/core/storage/process-selection.d.ts +39 -0
  155. package/dist/core/storage/process-selection.d.ts.map +1 -0
  156. package/dist/core/storage/process-selection.js +154 -0
  157. package/dist/core/storage/process-selection.js.map +1 -0
  158. package/dist/core/storage/provider.d.ts +6 -1
  159. package/dist/core/storage/provider.d.ts.map +1 -1
  160. package/dist/core/storage/provider.js +3 -2
  161. package/dist/core/storage/provider.js.map +1 -1
  162. package/dist/core/storage/selection.d.ts +1 -1
  163. package/dist/core/storage/selection.d.ts.map +1 -1
  164. package/dist/core/storage/selection.js.map +1 -1
  165. package/dist/core/storage/session/jsonl-session-store.d.ts +2 -0
  166. package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -1
  167. package/dist/core/storage/session/jsonl-session-store.js +38 -2
  168. package/dist/core/storage/session/jsonl-session-store.js.map +1 -1
  169. package/dist/core/tasks/completion.d.ts +11 -2
  170. package/dist/core/tasks/completion.d.ts.map +1 -1
  171. package/dist/core/tasks/completion.js +40 -16
  172. package/dist/core/tasks/completion.js.map +1 -1
  173. package/dist/core/tasks/pause.d.ts +4 -1
  174. package/dist/core/tasks/pause.d.ts.map +1 -1
  175. package/dist/core/tasks/pause.js +8 -5
  176. package/dist/core/tasks/pause.js.map +1 -1
  177. package/dist/index-extensions.d.ts +1 -1
  178. package/dist/index-extensions.d.ts.map +1 -1
  179. package/dist/index-extensions.js.map +1 -1
  180. package/dist/index.d.ts +2 -1
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.js +2 -0
  183. package/dist/index.js.map +1 -1
  184. package/dist/main.d.ts.map +1 -1
  185. package/dist/main.js +7 -1
  186. package/dist/main.js.map +1 -1
  187. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  188. package/dist/modes/interactive/components/chat-session-host-rendering.js +11 -1
  189. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  190. package/dist/modes/interactive/components/chat-session-host-state.d.ts +2 -0
  191. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  192. package/dist/modes/interactive/components/chat-session-host-state.js +2 -0
  193. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  194. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
  195. package/dist/modes/interactive/interactive-deferred-startup.js +4 -0
  196. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  197. package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -1
  198. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  199. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  200. package/dist/modes/interactive/interactive-render-chat.js +3 -0
  201. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  202. package/dist/modes/interactive/interactive-session-routing.js +2 -0
  203. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  204. package/dist/modes/interactive/interactive-session-runtime.d.ts +2 -1
  205. package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
  206. package/dist/modes/interactive/interactive-session-runtime.js +29 -0
  207. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  208. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  209. package/dist/modes/interactive/interactive-startup.js +4 -1
  210. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  211. package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -1
  212. package/dist/modes/interactive-engine/engine-args.js +4 -0
  213. package/dist/modes/interactive-engine/engine-args.js.map +1 -1
  214. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  215. package/dist/modes/interactive-engine/engine-render-service.js +4 -4
  216. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  217. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  218. package/dist/modes/interactive-engine/isolated-runtime.js +4 -0
  219. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  220. package/dist/modes/interactive-engine/remote-renderer.js +1 -1
  221. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  222. package/dist/modes/rpc/rpc-client-api.d.ts +4 -1
  223. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  224. package/dist/modes/rpc/rpc-client-api.js +4 -0
  225. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  226. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  227. package/dist/modes/rpc/rpc-command-handler.js +3 -0
  228. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  229. package/dist/modes/rpc/rpc-command-timeouts.d.ts.map +1 -1
  230. package/dist/modes/rpc/rpc-command-timeouts.js +1 -0
  231. package/dist/modes/rpc/rpc-command-timeouts.js.map +1 -1
  232. package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -1
  233. package/dist/modes/rpc/rpc-input-scheduler.js +6 -1
  234. package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
  235. package/dist/modes/rpc/rpc-types.d.ts +12 -1
  236. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  237. package/dist/modes/rpc/rpc-types.js.map +1 -1
  238. package/dist/utils/shell.d.ts.map +1 -1
  239. package/dist/utils/shell.js +44 -11
  240. package/dist/utils/shell.js.map +1 -1
  241. package/dist/utils/tools-manager.js +1 -1
  242. package/dist/utils/tools-manager.js.map +1 -1
  243. package/docs/background-tasks.md +5 -3
  244. package/docs/computer-use.md +2 -2
  245. package/docs/environment-variables.md +4 -1
  246. package/docs/extensions/events.md +29 -2
  247. package/docs/getting-started/first-session.md +1 -1
  248. package/docs/guides/intercom.md +1 -1
  249. package/docs/intercom/operations.md +103 -1
  250. package/docs/intercom/reference.md +10 -3
  251. package/docs/intercom.md +8 -6
  252. package/docs/keybindings.md +1 -1
  253. package/docs/models.md +1 -1
  254. package/docs/providers.md +5 -3
  255. package/docs/reference/cli.md +5 -0
  256. package/docs/rpc/protocol.md +19 -0
  257. package/docs/rpc.md +3 -0
  258. package/docs/sdk/web-server.md +1 -1
  259. package/docs/sdk.md +5 -2
  260. package/docs/sessions.md +17 -1
  261. package/docs/settings.md +6 -4
  262. package/docs/skills.md +1 -1
  263. package/docs/storage.md +54 -3
  264. package/docs/subagents.md +49 -9
  265. package/docs/usage.md +1 -1
  266. package/docs/windows.md +14 -4
  267. package/docs/workflows/api-reference.md +1 -1
  268. package/docs/workflows/authoring.md +1 -1
  269. package/docs/workflows/operations.md +10 -6
  270. package/npm-shrinkwrap.json +40 -40
  271. package/package.json +6 -6
  272. package/dist/core/export-html/template-js/data-tree.js +0 -287
  273. package/dist/core/export-html/template-js/entries-navigation.js +0 -434
  274. package/dist/core/export-html/template-js/initialization.js +0 -335
  275. package/dist/core/export-html/template-js/message-tools.js +0 -428
  276. package/dist/core/export-html/template-js/tree-filter-render.js +0 -419
  277. package/dist/core/export-html/template-script.d.ts +0 -3
  278. package/dist/core/export-html/template-script.d.ts.map +0 -1
  279. package/dist/core/export-html/template-script.js +0 -13
  280. package/dist/core/export-html/template-script.js.map +0 -1
@@ -22,7 +22,7 @@ Use this skill when bounded specialist delegation adds value and the parent shou
22
22
  - **Debug and fix**: use `debugger` for actual failures that need reproduction, root-cause diagnosis, and a validated patch; conceptual or exploratory debugging can stay inline.
23
23
  - **Refinement**: use `code-simplifier` to clean up recently changed code without altering behavior.
24
24
  - **Adversarial review**: compose read-only specialists (`codebase-analyzer`, `codebase-pattern-finder`, `debugger` in inspect-only mode, `codebase-online-researcher`) into a parallel review pass — there is no generic `reviewer` agent.
25
- - **Subagent control**: watch needs-attention signals and kill only when a delegated run is genuinely blocked.
25
+ - **Subagent control**: watch needs-attention signals and pause or quit only when a delegated run is genuinely blocked; both stay resumable.
26
26
  - **Agent authoring**: create, update, or override agents for a project.
27
27
 
28
28
  ## Tool
@@ -213,11 +213,11 @@ Keep immediately blocking work local unless specialist expertise, context isolat
213
213
 
214
214
  Choose the observation mode for each authorized task. No extra user confirmation is needed merely to choose foreground or background. In owner-bound main and workflow-stage sessions, omitted `wait` or `wait: { kind: "background" }` returns after admission. Use `wait: { kind: "foreground", budgetMs: 30000 }` when the result is needed next. If the observation budget expires, the same child keeps running in the background; do not relaunch it. This applies to single and parallel calls.
215
215
 
216
- Use `subagent({ action: "wait", id: taskId })` to observe an existing task with the owner's budget, `status` to inspect its state, or `kill` to terminally stop it. Wait when the result becomes a dependency; otherwise rely on completion notices. Avoid repeated short waits or status polls; override the budget only for a concrete responsiveness need. A yielded receipt is not a terminal result. Background counts stay below the prompt; `/tasks` opens inspection only on command. A shaded completion notification reaches the owning chat without requiring a model reply. A later wait does not extend the owner's lifetime.
216
+ Use `subagent({ action: "wait", id: taskId })` to observe an existing task with the owner's budget, `status` to inspect its state, or `pause`, `quit`, and `resume` to control it (see [Subagent control](#subagent-control)). Wait when the result becomes a dependency; otherwise rely on completion notices. Avoid repeated short waits or status polls; override the budget only for a concrete responsiveness need. A yielded receipt is not a terminal result. Background counts stay below the prompt; `/tasks` opens inspection only on command. A shaded completion notification reaches the owning chat without requiring a model reply. A later wait does not extend the owner's lifetime.
217
217
 
218
- Intercom `ask` cannot revive a completed, failed, interrupted, or cancelled noninteractive child, even if its retained registration says `idle`. New asks fail immediately, and termination fails an already-admitted ask that has not received a reply. Use a fresh child for follow-up work. Live interactive idle sessions and workflow post-mortem conversations remain separate reply-capable cases; `send` transport behavior is unchanged.
218
+ Intercom `ask` cannot revive a completed, failed, interrupted, or cancelled noninteractive child, even if its retained registration says `idle`. New asks fail immediately, and termination fails an already-admitted ask that has not received a reply. Use `resume` on a resumable child, or a fresh child, for follow-up work. Live interactive idle sessions and workflow post-mortem conversations remain separate reply-capable cases; `send` transport behavior is unchanged.
219
219
 
220
- Completed, killed, interrupted, and parent-question children are terminal for continuation. Do not address a prior child or sibling set by run ID. Start follow-up work with the normal launch form and an explicit handoff:
220
+ A completed, failed, interrupted, paused, or quit child can continue in the same run identity with `subagent({ action: "resume", id, message })`; see [Subagent control](#subagent-control). Children cancelled for good (by owner or batch cancellation, including a `/tasks` stop, and the removed `kill` action), children whose workflow stage ended (all of that stage's children, including paused and quit ones), and children reported gone after a restart are terminal. For those, and to answer a single-child handoff, start follow-up work with the normal launch form and an explicit handoff:
221
221
 
222
222
  ```typescript
223
223
  subagent({ agent: "worker", task: "[TASK_CONTEXT] Continue with this supervisor answer: ..." })
@@ -227,23 +227,21 @@ A parent-ask handoff supplies the original question, ordered attachments, previo
227
227
 
228
228
  ### Subagent control
229
229
 
230
- Subagent control is the runtime visibility and intervention layer for delegated runs. Lifecycle status distinguishes queued and running children from terminal completed, failed, killed, or cancelled results. Activity reporting is factual: it tracks the last observed activity time and the current tool when known. It does not pretend to know that a child is truly stuck.
230
+ Subagent control is the runtime visibility and intervention layer for delegated runs. Lifecycle status distinguishes queued and running children from paused, quit, completed, failed, and cancelled results. Activity reporting is factual: it tracks the last observed activity time and the current tool when known. It does not pretend to know that a child is truly stuck.
231
231
 
232
- Default behavior is intentionally conservative. When no activity has been observed past the configured threshold, the run emits a `needs_attention` control event. Foreground runs push this as a `subagent:control-event` event, and notification-worthy control events are inserted into the visible transcript so both the user and the parent agent can see them, with a proactive hint plus concrete `nudge`, `status`, and `kill` options. Visible notifications fire once per child run and attention state.
232
+ Default behavior is intentionally conservative. When no activity has been observed past the configured threshold, the run emits a `needs_attention` control event. Foreground runs push this as a `subagent:control-event` event, and notification-worthy control events are inserted into the visible transcript so both the user and the parent agent can see them, with a proactive hint plus concrete `nudge`, `status`, and `quit` options. Visible notifications fire once per child run and attention state.
233
233
 
234
- Use kill when a child is clearly blocked or drifting and the parent needs to terminally stop it:
234
+ Run control mirrors the workflow tool's `pause`, `resume`, and `quit`. `id` accepts the child id (`<runId>:<index>`), its task id, its Intercom name, or the run id of a single-child run:
235
235
 
236
236
  ```typescript
237
- subagent({ action: "kill", id: taskId })
237
+ subagent({ action: "pause", id: taskId }) // stop now, hold queued messages until resume
238
+ subagent({ action: "quit", id: taskId }) // stop gracefully; stays resumable
239
+ subagent({ action: "pause", all: true }) // every running child this session launched
240
+ subagent({ action: "quit", all: true }) // also covers paused children; all stay resumable
241
+ subagent({ action: "resume", id: taskId, message: "Focus on the failing test first." })
238
242
  ```
239
243
 
240
- Pass `id` when targeting a specific controllable run:
241
-
242
- ```typescript
243
- subagent({ action: "kill", id: "abc123" })
244
- ```
245
-
246
- Kill terminally stops the child and records it as killed. It cannot be resumed and does not mean the delegated task succeeded. Decide the next explicit action: launch a fresh child with the relevant task context, replace the task, ask the user, or stop the workflow.
244
+ Pause stops a child's current turn and keeps its queued steering and Intercom messages held until resume. Quit stops it the same way without holding new messages, and also accepts a child already paused by you or with its workflow stage. Both keep the child resumable while the session or workflow stage that launched it can still resume it, and so does a pause or quit of that workflow stage. Resume reopens the child's own saved session under the same id, Intercom name, and group, with fresh supervisor authorization. A paused, quit, or interrupted child receives `message` once as its next prompt and then continues where it left off; a completed or failed child receives `message` as one fresh prompt. Without `message`, any resumable child, including a completed or failed one, is asked to continue where it left off or stop if it is finished. A child cancelled for good (owner or batch cancellation, including a `/tasks` stop, or the removed `kill` action), a child whose workflow stage ended (the stage finished, or its run ended or was cancelled; this covers every child of that stage, including paused and quit ones), or one reported gone after a restart cannot be resumed: resume returns an error that says why, so launch a fresh child with the relevant task context. `kill` and `interrupt` were removed; calls using them are rejected with an error that names `quit`.
247
245
 
248
246
  Per-run control thresholds can be overridden when a task legitimately runs without observable output for longer than usual:
249
247
 
@@ -428,8 +426,8 @@ If a prompt-template extension is installed, additional user prompt templates ca
428
426
 
429
427
  - **Forking requires a persisted parent session.** If the current session does not have a persisted session file, forked runs fail.
430
428
  - **Forked runs inherit parent history.** They are branched threads, not fresh filtered contexts. Use fresh context for adversarial review unless the user explicitly asks for forked context.
431
- - **Delegation is one level deep and not configurable.** A subagent cannot call `subagent`: every launch and `kill` from inside a child is refused. Only `list`, `get`, and `status` stay available to a child.
432
- - **Attention signals are not lifecycle state.** `needs_attention` means no activity has been observed past the configured threshold. `killed` means the child was terminally stopped by the kill command; it cannot be resumed and is not the same as `failed`.
429
+ - **Delegation is one level deep and not configurable.** A subagent cannot call `subagent`: every launch and run control (`pause`, `resume`, `quit`) from inside a child is refused. Only `list`, `get`, `status`, and `wait` stay available to a child.
430
+ - **Attention signals are not lifecycle state.** `needs_attention` means no activity has been observed past the configured threshold. `killed` means the child was cancelled for good by owner or batch cancellation (or, in older sessions, the removed kill action); it cannot be resumed and is not the same as `failed`. `paused` and `quit` children stay resumable.
433
431
  - **Builtin coordination respects caller restrictions.** Every builtin agent declares `intercom`, but a parent that disables it prevents live coordination. Resolve decisions up front when running without coordination tools.
434
432
  - **Intercom asks are blocking.** A session can only maintain one pending outbound ask wait state at a time.
435
433
  - **Keep conversational authority clear.** Advisory specialists should not silently become second decision-makers.
@@ -465,13 +463,13 @@ Give subagents specific tasks rather than vague mandates.
465
463
 
466
464
  ### Escalate decisions upward, coordinate sideways
467
465
 
468
- All builtin specialists can use Intercom when permitted by the parent. Use `contact_supervisor` for parent decisions when the active bridge supplies it. Resolve known scope, product, and architecture questions before launching any writer. If the parent realizes mid-run that the scope is wrong, steer a reachable child or kill it.
466
+ All builtin specialists can use Intercom when permitted by the parent. Use `contact_supervisor` for parent decisions when the active bridge supplies it. Resolve known scope, product, and architecture questions before launching any writer. If the parent realizes mid-run that the scope is wrong, steer a reachable child, or `quit` it and `resume` it later with a corrected `message`.
469
467
 
470
468
  When several children work related angles, tell them to use ordinary `intercom` with each other for findings, ownership, and challenges so the parent is not the bottleneck for information that a sibling already holds. See [Peer coordination](#peer-coordination).
471
469
 
472
470
  ### Intervene only on clear control signals
473
471
 
474
- Use subagent control proactively when a delegated run emits `needs_attention`, or when a human asks you to regain control. Do not kill just because a child has briefly produced no output. Silence can be normal during long tool calls, test runs, or model reasoning.
472
+ Use subagent control proactively when a delegated run emits `needs_attention`, or when a human asks you to regain control. Do not pause or quit a child just because it has briefly produced no output. Silence can be normal during long tool calls, test runs, or model reasoning.
475
473
 
476
474
  ### Name sessions meaningfully
477
475
 
@@ -510,7 +508,7 @@ For complex or risky changes, increase review and validation fanout when user in
510
508
 
511
509
  For very large work, split into serial milestones instead of launching a swarm of writers. Each milestone gets one writer, a validation contract, fresh-context review, a fix pass, and parent approval before the next milestone starts. Use parallel subagents inside a milestone for read-only context, research, and review only.
512
510
 
513
- Keep orchestration authority in the parent session. Child subagents cannot launch more subagents or run their own orchestration loops: delegation is one level deep and nothing configures it. This skill is parent-only and is stripped from every child prompt. A child may still have the `subagent` extension tool registered, because bundled extensions load through normal discovery; registration is not authority. Typed admission policy lets a child use only `list`, `get`, and `status`, and refuses delegation and `kill`. Spawned children also do not receive parent-only status/control/slash messages or prior parent `subagent` tool-call/tool-result artifacts, and child context filtering strips old hidden orchestration-instruction messages when they appear in inherited history. Every child also receives a boundary instruction that says the parent owns orchestration, that the `subagent` tool refuses every launch and `kill` from inside a subagent, and that writer children must call real edit/write tools instead of printing pseudo tool calls. Pass children concrete role-specific work instead.
511
+ Keep orchestration authority in the parent session. Child subagents cannot launch more subagents or run their own orchestration loops: delegation is one level deep and nothing configures it. This skill is parent-only and is stripped from every child prompt. A child may still have the `subagent` extension tool registered, because bundled extensions load through normal discovery; registration is not authority. Typed admission policy lets a child use only `list`, `get`, `status`, and `wait`, and refuses delegation and run control (`pause`, `resume`, `quit`). Spawned children also do not receive parent-only status/control/slash messages or prior parent `subagent` tool-call/tool-result artifacts, and child context filtering strips old hidden orchestration-instruction messages when they appear in inherited history. Every child also receives a boundary instruction that says the parent owns orchestration, that the `subagent` tool refuses every launch and run control from inside a subagent, and that writer children must call real edit/write tools instead of printing pseudo tool calls. Pass children concrete role-specific work instead.
514
512
 
515
513
  1. Clarify only when needed. Use existing context first; gather missing code or research context selectively, then ask only unresolved questions that materially affect scope, completion criteria, constraints, or non-goals.
516
514
  2. Define the validation contract. State completion expectations before implementation: expected behavior, checks to run, user flows to exercise, and evidence required in the writer handoff. For UI, CLI, integration, or workflow changes, include at least one validator angle that uses the product the way a user would rather than only reading code.