@emiliosp/pi-maestro 0.7.4 → 0.8.0

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 (413) hide show
  1. package/ADR.md +58 -0
  2. package/README.md +1 -1
  3. package/ROADMAP.md +113 -20
  4. package/docs/glossary.md +1 -0
  5. package/docs/workflow.md +14 -1
  6. package/node_modules/pi-subagents/CHANGELOG.md +140 -0
  7. package/node_modules/pi-subagents/README.md +1 -1
  8. package/node_modules/pi-subagents/agents/evidence-auditor.md +1 -0
  9. package/node_modules/pi-subagents/agents/oracle.md +9 -19
  10. package/node_modules/pi-subagents/agents/researcher.md +0 -3
  11. package/node_modules/pi-subagents/agents/reviewer.md +18 -61
  12. package/node_modules/pi-subagents/agents/scout.md +1 -4
  13. package/node_modules/pi-subagents/agents/worker.md +8 -25
  14. package/node_modules/pi-subagents/docs/agents.md +71 -4
  15. package/node_modules/pi-subagents/docs/configuration.md +75 -10
  16. package/node_modules/pi-subagents/docs/extension-api.md +40 -11
  17. package/node_modules/pi-subagents/docs/missions.md +24 -17
  18. package/node_modules/pi-subagents/docs/models.md +1 -1
  19. package/node_modules/pi-subagents/docs/observability.md +12 -5
  20. package/node_modules/pi-subagents/docs/tool-reference.md +103 -85
  21. package/node_modules/pi-subagents/docs/watchdog.md +8 -6
  22. package/node_modules/pi-subagents/docs/workflows.md +17 -8
  23. package/node_modules/pi-subagents/index.d.ts.map +1 -1
  24. package/node_modules/pi-subagents/index.js +5 -0
  25. package/node_modules/pi-subagents/index.js.map +1 -1
  26. package/node_modules/pi-subagents/package.json +2 -1
  27. package/node_modules/pi-subagents/prompts/council.md +1 -1
  28. package/node_modules/pi-subagents/skills/pi-subagents/SKILL.md +2 -2
  29. package/node_modules/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +1 -1
  30. package/node_modules/pi-subagents/skills/pi-subagents/references/execution-controls.md +16 -16
  31. package/node_modules/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +16 -12
  32. package/node_modules/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +1 -1
  33. package/node_modules/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +3 -3
  34. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts +5 -1
  35. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts.map +1 -1
  36. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js +8 -2
  37. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js.map +1 -1
  38. package/node_modules/pi-subagents/src/agents/agent-management.d.ts.map +1 -1
  39. package/node_modules/pi-subagents/src/agents/agent-management.js +5 -0
  40. package/node_modules/pi-subagents/src/agents/agent-management.js.map +1 -1
  41. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts +1 -0
  42. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts.map +1 -1
  43. package/node_modules/pi-subagents/src/agents/agent-scope.js +3 -0
  44. package/node_modules/pi-subagents/src/agents/agent-scope.js.map +1 -1
  45. package/node_modules/pi-subagents/src/agents/agent-serializer.d.ts.map +1 -1
  46. package/node_modules/pi-subagents/src/agents/agent-serializer.js +3 -0
  47. package/node_modules/pi-subagents/src/agents/agent-serializer.js.map +1 -1
  48. package/node_modules/pi-subagents/src/agents/agents.d.ts +14 -2
  49. package/node_modules/pi-subagents/src/agents/agents.d.ts.map +1 -1
  50. package/node_modules/pi-subagents/src/agents/agents.js +94 -36
  51. package/node_modules/pi-subagents/src/agents/agents.js.map +1 -1
  52. package/node_modules/pi-subagents/src/api/external-runs.d.ts.map +1 -1
  53. package/node_modules/pi-subagents/src/api/external-runs.js +5 -4
  54. package/node_modules/pi-subagents/src/api/external-runs.js.map +1 -1
  55. package/node_modules/pi-subagents/src/api/preflight.d.ts +2 -0
  56. package/node_modules/pi-subagents/src/api/preflight.d.ts.map +1 -1
  57. package/node_modules/pi-subagents/src/api/preflight.js +7 -3
  58. package/node_modules/pi-subagents/src/api/preflight.js.map +1 -1
  59. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts +8 -0
  60. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts.map +1 -0
  61. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js +30 -0
  62. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js.map +1 -0
  63. package/node_modules/pi-subagents/src/extension/config.d.ts.map +1 -1
  64. package/node_modules/pi-subagents/src/extension/config.js +29 -2
  65. package/node_modules/pi-subagents/src/extension/config.js.map +1 -1
  66. package/node_modules/pi-subagents/src/extension/control-notices.d.ts +0 -2
  67. package/node_modules/pi-subagents/src/extension/control-notices.d.ts.map +1 -1
  68. package/node_modules/pi-subagents/src/extension/control-notices.js +1 -7
  69. package/node_modules/pi-subagents/src/extension/control-notices.js.map +1 -1
  70. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts +19 -0
  71. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts.map +1 -0
  72. package/node_modules/pi-subagents/src/extension/declaration-pinning.js +154 -0
  73. package/node_modules/pi-subagents/src/extension/declaration-pinning.js.map +1 -0
  74. package/node_modules/pi-subagents/src/extension/doctor.d.ts +3 -1
  75. package/node_modules/pi-subagents/src/extension/doctor.d.ts.map +1 -1
  76. package/node_modules/pi-subagents/src/extension/doctor.js +3 -9
  77. package/node_modules/pi-subagents/src/extension/doctor.js.map +1 -1
  78. package/node_modules/pi-subagents/src/extension/fanout-child.d.ts.map +1 -1
  79. package/node_modules/pi-subagents/src/extension/fanout-child.js +6 -8
  80. package/node_modules/pi-subagents/src/extension/fanout-child.js.map +1 -1
  81. package/node_modules/pi-subagents/src/extension/index.d.ts +1 -2
  82. package/node_modules/pi-subagents/src/extension/index.d.ts.map +1 -1
  83. package/node_modules/pi-subagents/src/extension/index.js +121 -127
  84. package/node_modules/pi-subagents/src/extension/index.js.map +1 -1
  85. package/node_modules/pi-subagents/src/extension/rpc.d.ts.map +1 -1
  86. package/node_modules/pi-subagents/src/extension/rpc.js +12 -6
  87. package/node_modules/pi-subagents/src/extension/rpc.js.map +1 -1
  88. package/node_modules/pi-subagents/src/extension/schemas.d.ts +137 -1
  89. package/node_modules/pi-subagents/src/extension/schemas.d.ts.map +1 -1
  90. package/node_modules/pi-subagents/src/extension/schemas.js +22 -22
  91. package/node_modules/pi-subagents/src/extension/schemas.js.map +1 -1
  92. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts +1 -0
  93. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts.map +1 -1
  94. package/node_modules/pi-subagents/src/extension/subagent-guide.js +80 -6
  95. package/node_modules/pi-subagents/src/extension/subagent-guide.js.map +1 -1
  96. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts +8 -0
  97. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts.map +1 -0
  98. package/node_modules/pi-subagents/src/extension/subagent-options.js +52 -0
  99. package/node_modules/pi-subagents/src/extension/subagent-options.js.map +1 -0
  100. package/node_modules/pi-subagents/src/extension/tool-activation.d.ts.map +1 -1
  101. package/node_modules/pi-subagents/src/extension/tool-activation.js +7 -4
  102. package/node_modules/pi-subagents/src/extension/tool-activation.js.map +1 -1
  103. package/node_modules/pi-subagents/src/extension/tool-description.d.ts +4 -7
  104. package/node_modules/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
  105. package/node_modules/pi-subagents/src/extension/tool-description.js +45 -59
  106. package/node_modules/pi-subagents/src/extension/tool-description.js.map +1 -1
  107. package/node_modules/pi-subagents/src/inspectors/actions.d.ts +2 -0
  108. package/node_modules/pi-subagents/src/inspectors/actions.d.ts.map +1 -1
  109. package/node_modules/pi-subagents/src/inspectors/actions.js +41 -13
  110. package/node_modules/pi-subagents/src/inspectors/actions.js.map +1 -1
  111. package/node_modules/pi-subagents/src/inspectors/plugins.d.ts.map +1 -1
  112. package/node_modules/pi-subagents/src/inspectors/plugins.js +3 -2
  113. package/node_modules/pi-subagents/src/inspectors/plugins.js.map +1 -1
  114. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts +26 -0
  115. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts.map +1 -0
  116. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js +182 -0
  117. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js.map +1 -0
  118. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts +28 -0
  119. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts.map +1 -0
  120. package/node_modules/pi-subagents/src/inspectors/tmux/client.js +65 -0
  121. package/node_modules/pi-subagents/src/inspectors/tmux/client.js.map +1 -0
  122. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts +8 -0
  123. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts.map +1 -0
  124. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js +15 -0
  125. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js.map +1 -0
  126. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts +0 -1
  127. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts.map +1 -1
  128. package/node_modules/pi-subagents/src/integrations/herdr-status.js +18 -52
  129. package/node_modules/pi-subagents/src/integrations/herdr-status.js.map +1 -1
  130. package/node_modules/pi-subagents/src/integrations/program-status.d.ts +31 -0
  131. package/node_modules/pi-subagents/src/integrations/program-status.d.ts.map +1 -0
  132. package/node_modules/pi-subagents/src/integrations/program-status.js +189 -0
  133. package/node_modules/pi-subagents/src/integrations/program-status.js.map +1 -0
  134. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts +17 -1
  135. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
  136. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js +102 -9
  137. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
  138. package/node_modules/pi-subagents/src/intercom/result-intercom.js +1 -1
  139. package/node_modules/pi-subagents/src/intercom/result-intercom.js.map +1 -1
  140. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts +2 -12
  141. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts.map +1 -1
  142. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js +2 -154
  143. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js.map +1 -1
  144. package/node_modules/pi-subagents/src/missions/store.d.ts.map +1 -1
  145. package/node_modules/pi-subagents/src/missions/store.js +27 -5
  146. package/node_modules/pi-subagents/src/missions/store.js.map +1 -1
  147. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts +2 -1
  148. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts.map +1 -1
  149. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js +10 -6
  150. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js.map +1 -1
  151. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts +9 -1
  152. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
  153. package/node_modules/pi-subagents/src/runs/background/async-execution.js +253 -144
  154. package/node_modules/pi-subagents/src/runs/background/async-execution.js.map +1 -1
  155. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts +4 -1
  156. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -1
  157. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js +3 -2
  158. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
  159. package/node_modules/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -1
  160. package/node_modules/pi-subagents/src/runs/background/async-resume.js +9 -3
  161. package/node_modules/pi-subagents/src/runs/background/async-resume.js.map +1 -1
  162. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts +8 -4
  163. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts.map +1 -1
  164. package/node_modules/pi-subagents/src/runs/background/await-async-run.js +14 -8
  165. package/node_modules/pi-subagents/src/runs/background/await-async-run.js.map +1 -1
  166. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.d.ts.map +1 -1
  167. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js +2 -1
  168. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js.map +1 -1
  169. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts +2 -0
  170. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +1 -1
  171. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js +9 -6
  172. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js.map +1 -1
  173. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts +1 -0
  174. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts.map +1 -1
  175. package/node_modules/pi-subagents/src/runs/background/control-channel.js +27 -3
  176. package/node_modules/pi-subagents/src/runs/background/control-channel.js.map +1 -1
  177. package/node_modules/pi-subagents/src/runs/background/fleet-view.js +5 -5
  178. package/node_modules/pi-subagents/src/runs/background/fleet-view.js.map +1 -1
  179. package/node_modules/pi-subagents/src/runs/background/notify.d.ts +12 -2
  180. package/node_modules/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
  181. package/node_modules/pi-subagents/src/runs/background/notify.js +152 -13
  182. package/node_modules/pi-subagents/src/runs/background/notify.js.map +1 -1
  183. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts +29 -0
  184. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts.map +1 -1
  185. package/node_modules/pi-subagents/src/runs/background/result-files.js +104 -6
  186. package/node_modules/pi-subagents/src/runs/background/result-files.js.map +1 -1
  187. package/node_modules/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
  188. package/node_modules/pi-subagents/src/runs/background/result-watcher.js +60 -64
  189. package/node_modules/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
  190. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js +2 -2
  191. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js.map +1 -1
  192. package/node_modules/pi-subagents/src/runs/background/run-child-session.d.ts.map +1 -1
  193. package/node_modules/pi-subagents/src/runs/background/run-child-session.js +9 -15
  194. package/node_modules/pi-subagents/src/runs/background/run-child-session.js.map +1 -1
  195. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.d.ts.map +1 -1
  196. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js +9 -6
  197. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js.map +1 -1
  198. package/node_modules/pi-subagents/src/runs/background/run-status.d.ts.map +1 -1
  199. package/node_modules/pi-subagents/src/runs/background/run-status.js +19 -15
  200. package/node_modules/pi-subagents/src/runs/background/run-status.js.map +1 -1
  201. package/node_modules/pi-subagents/src/runs/background/runner-aliases.d.ts.map +1 -1
  202. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js +11 -8
  203. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js.map +1 -1
  204. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.d.ts.map +1 -1
  205. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js +1 -0
  206. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js.map +1 -1
  207. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts +3 -0
  208. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts.map +1 -1
  209. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js +2 -0
  210. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js.map +1 -1
  211. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts +9 -0
  212. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts.map +1 -1
  213. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js +124 -36
  214. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js.map +1 -1
  215. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.d.ts.map +1 -1
  216. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js +5 -1
  217. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js.map +1 -1
  218. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts +3 -1
  219. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
  220. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js +211 -283
  221. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
  222. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts +2 -0
  223. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
  224. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js +34 -20
  225. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
  226. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts +1 -0
  227. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts.map +1 -1
  228. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js +47 -1
  229. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js.map +1 -1
  230. package/node_modules/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
  231. package/node_modules/pi-subagents/src/runs/background/wait-tool.js +36 -23
  232. package/node_modules/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
  233. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts +1 -1
  234. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts.map +1 -1
  235. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js +12 -3
  236. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js.map +1 -1
  237. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts +7 -1
  238. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts.map +1 -1
  239. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js +55 -32
  240. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js.map +1 -1
  241. package/node_modules/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
  242. package/node_modules/pi-subagents/src/runs/foreground/execution.js +101 -79
  243. package/node_modules/pi-subagents/src/runs/foreground/execution.js.map +1 -1
  244. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts +5 -1
  245. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  246. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js +184 -84
  247. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
  248. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js +6 -5
  249. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js.map +1 -1
  250. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts +2 -0
  251. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts.map +1 -1
  252. package/node_modules/pi-subagents/src/runs/shared/child-launch.js +1 -0
  253. package/node_modules/pi-subagents/src/runs/shared/child-launch.js.map +1 -1
  254. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts +4 -0
  255. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts.map +1 -1
  256. package/node_modules/pi-subagents/src/runs/shared/child-session.js +28 -23
  257. package/node_modules/pi-subagents/src/runs/shared/child-session.js.map +1 -1
  258. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.d.ts.map +1 -1
  259. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js +11 -10
  260. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js.map +1 -1
  261. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js +1 -1
  262. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js.map +1 -1
  263. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts +4 -4
  264. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts.map +1 -1
  265. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js +5 -4
  266. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js.map +1 -1
  267. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.d.ts.map +1 -1
  268. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js +3 -2
  269. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js.map +1 -1
  270. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts +1 -0
  271. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts.map +1 -1
  272. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js +10 -6
  273. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js.map +1 -1
  274. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts +17 -5
  275. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts.map +1 -1
  276. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js +37 -10
  277. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js.map +1 -1
  278. package/node_modules/pi-subagents/src/runs/shared/model-resolution.d.ts.map +1 -1
  279. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js +29 -1
  280. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js.map +1 -1
  281. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts +2 -0
  282. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts.map +1 -1
  283. package/node_modules/pi-subagents/src/runs/shared/nested-events.js +4 -0
  284. package/node_modules/pi-subagents/src/runs/shared/nested-events.js.map +1 -1
  285. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js +1 -1
  286. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js.map +1 -1
  287. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js +2 -2
  288. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js.map +1 -1
  289. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts +2 -0
  290. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
  291. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
  292. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts +7 -0
  293. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts.map +1 -1
  294. package/node_modules/pi-subagents/src/runs/shared/partial-output.js +7 -0
  295. package/node_modules/pi-subagents/src/runs/shared/partial-output.js.map +1 -1
  296. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts +12 -0
  297. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts.map +1 -0
  298. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js +25 -0
  299. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js.map +1 -0
  300. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts +31 -1
  301. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts.map +1 -1
  302. package/node_modules/pi-subagents/src/runs/shared/single-output.js +100 -21
  303. package/node_modules/pi-subagents/src/runs/shared/single-output.js.map +1 -1
  304. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts +2 -0
  305. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts.map +1 -1
  306. package/node_modules/pi-subagents/src/runs/shared/structured-output.js +26 -8
  307. package/node_modules/pi-subagents/src/runs/shared/structured-output.js.map +1 -1
  308. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js +3 -3
  309. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js.map +1 -1
  310. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts +37 -2
  311. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  312. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +130 -22
  313. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  314. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js +1 -1
  315. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js.map +1 -1
  316. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js +1 -1
  317. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js.map +1 -1
  318. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js +1 -1
  319. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js.map +1 -1
  320. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts +4 -3
  321. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts.map +1 -1
  322. package/node_modules/pi-subagents/src/shared/atomic-json.js +3 -1
  323. package/node_modules/pi-subagents/src/shared/atomic-json.js.map +1 -1
  324. package/node_modules/pi-subagents/src/shared/child-transcript.js +1 -1
  325. package/node_modules/pi-subagents/src/shared/child-transcript.js.map +1 -1
  326. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts +5 -0
  327. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts.map +1 -0
  328. package/node_modules/pi-subagents/src/shared/edit-distance.js +33 -0
  329. package/node_modules/pi-subagents/src/shared/edit-distance.js.map +1 -0
  330. package/node_modules/pi-subagents/src/shared/extension-context.d.ts +5 -0
  331. package/node_modules/pi-subagents/src/shared/extension-context.d.ts.map +1 -1
  332. package/node_modules/pi-subagents/src/shared/extension-context.js +7 -0
  333. package/node_modules/pi-subagents/src/shared/extension-context.js.map +1 -1
  334. package/node_modules/pi-subagents/src/shared/formatters.d.ts.map +1 -1
  335. package/node_modules/pi-subagents/src/shared/formatters.js +1 -6
  336. package/node_modules/pi-subagents/src/shared/formatters.js.map +1 -1
  337. package/node_modules/pi-subagents/src/shared/model-info.d.ts +8 -0
  338. package/node_modules/pi-subagents/src/shared/model-info.d.ts.map +1 -1
  339. package/node_modules/pi-subagents/src/shared/model-info.js +22 -0
  340. package/node_modules/pi-subagents/src/shared/model-info.js.map +1 -1
  341. package/node_modules/pi-subagents/src/shared/package-version.d.ts +3 -0
  342. package/node_modules/pi-subagents/src/shared/package-version.d.ts.map +1 -0
  343. package/node_modules/pi-subagents/src/shared/package-version.js +15 -0
  344. package/node_modules/pi-subagents/src/shared/package-version.js.map +1 -0
  345. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts +24 -0
  346. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts.map +1 -0
  347. package/node_modules/pi-subagents/src/shared/parent-wake.js +71 -0
  348. package/node_modules/pi-subagents/src/shared/parent-wake.js.map +1 -0
  349. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts +1 -1
  350. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts.map +1 -1
  351. package/node_modules/pi-subagents/src/shared/pruned-fork.js +6 -0
  352. package/node_modules/pi-subagents/src/shared/pruned-fork.js.map +1 -1
  353. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts +11 -0
  354. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts.map +1 -0
  355. package/node_modules/pi-subagents/src/shared/runtime-module-path.js +17 -0
  356. package/node_modules/pi-subagents/src/shared/runtime-module-path.js.map +1 -0
  357. package/node_modules/pi-subagents/src/shared/types.d.ts +33 -10
  358. package/node_modules/pi-subagents/src/shared/types.d.ts.map +1 -1
  359. package/node_modules/pi-subagents/src/shared/types.js +7 -4
  360. package/node_modules/pi-subagents/src/shared/types.js.map +1 -1
  361. package/node_modules/pi-subagents/src/shared/utils.d.ts +2 -0
  362. package/node_modules/pi-subagents/src/shared/utils.d.ts.map +1 -1
  363. package/node_modules/pi-subagents/src/shared/utils.js +10 -7
  364. package/node_modules/pi-subagents/src/shared/utils.js.map +1 -1
  365. package/node_modules/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
  366. package/node_modules/pi-subagents/src/slash/slash-commands.js +21 -10
  367. package/node_modules/pi-subagents/src/slash/slash-commands.js.map +1 -1
  368. package/node_modules/pi-subagents/src/slash/subagents-admin.d.ts.map +1 -1
  369. package/node_modules/pi-subagents/src/slash/subagents-admin.js +3 -1
  370. package/node_modules/pi-subagents/src/slash/subagents-admin.js.map +1 -1
  371. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts +5 -0
  372. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts.map +1 -1
  373. package/node_modules/pi-subagents/src/tui/fleet-status.js +24 -3
  374. package/node_modules/pi-subagents/src/tui/fleet-status.js.map +1 -1
  375. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts +2 -0
  376. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts.map +1 -1
  377. package/node_modules/pi-subagents/src/tui/fleet-transcript.js +7 -2
  378. package/node_modules/pi-subagents/src/tui/fleet-transcript.js.map +1 -1
  379. package/node_modules/pi-subagents/src/tui/fleet.d.ts.map +1 -1
  380. package/node_modules/pi-subagents/src/tui/fleet.js +11 -6
  381. package/node_modules/pi-subagents/src/tui/fleet.js.map +1 -1
  382. package/node_modules/pi-subagents/src/tui/render.d.ts +2 -2
  383. package/node_modules/pi-subagents/src/tui/render.d.ts.map +1 -1
  384. package/node_modules/pi-subagents/src/tui/render.js +19 -17
  385. package/node_modules/pi-subagents/src/tui/render.js.map +1 -1
  386. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts +23 -0
  387. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts.map +1 -0
  388. package/node_modules/pi-subagents/src/tui/subagent-messages.js +270 -0
  389. package/node_modules/pi-subagents/src/tui/subagent-messages.js.map +1 -0
  390. package/node_modules/pi-subagents/src/watchdog/change-signature.d.ts.map +1 -1
  391. package/node_modules/pi-subagents/src/watchdog/change-signature.js +1 -3
  392. package/node_modules/pi-subagents/src/watchdog/change-signature.js.map +1 -1
  393. package/node_modules/pi-subagents/src/watchdog/register-main.d.ts.map +1 -1
  394. package/node_modules/pi-subagents/src/watchdog/register-main.js +1 -19
  395. package/node_modules/pi-subagents/src/watchdog/register-main.js.map +1 -1
  396. package/node_modules/pi-subagents/src/watchdog/render.d.ts +2 -10
  397. package/node_modules/pi-subagents/src/watchdog/render.d.ts.map +1 -1
  398. package/node_modules/pi-subagents/src/watchdog/render.js +1 -19
  399. package/node_modules/pi-subagents/src/watchdog/render.js.map +1 -1
  400. package/node_modules/pi-subagents/src/watchdog/tool-actions.js +2 -2
  401. package/node_modules/pi-subagents/src/watchdog/tool-actions.js.map +1 -1
  402. package/node_modules/pi-subagents/src/workflows/scripted-workflow.d.ts.map +1 -1
  403. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js +33 -10
  404. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js.map +1 -1
  405. package/node_modules/pi-subagents/src/workflows/workflow-resources.d.ts.map +1 -1
  406. package/node_modules/pi-subagents/src/workflows/workflow-resources.js +12 -0
  407. package/node_modules/pi-subagents/src/workflows/workflow-resources.js.map +1 -1
  408. package/package.json +3 -3
  409. package/DESIGN_DECISIONS.md +0 -21
  410. package/node_modules/pi-subagents/src/runs/shared/run-history.d.ts +0 -67
  411. package/node_modules/pi-subagents/src/runs/shared/run-history.d.ts.map +0 -1
  412. package/node_modules/pi-subagents/src/runs/shared/run-history.js +0 -270
  413. package/node_modules/pi-subagents/src/runs/shared/run-history.js.map +0 -1
@@ -19,7 +19,7 @@ registerWorkflowResource({
19
19
  }): { dispose(): void }
20
20
  ```
21
21
 
22
- Names are case-sensitive, at most 128 characters, and match `[A-Za-z0-9][A-Za-z0-9._-]*`; use an extension prefix. Versions are positive safe integers. Registration throws for invalid input, protected builtins (`review`, `run-ci`, and `chain` and `tasks`, which back the tool's structured inputs), or duplicate names within the same session. Different sessions may register the same name. Dispose before replacement; there is no silent overwrite.
22
+ Names are case-sensitive, at most 128 characters, and match `[A-Za-z0-9][A-Za-z0-9._-]*`; use an extension prefix. Versions are positive safe integers. Registration throws for invalid input, protected builtins (`review`, `run-ci`, `parallel`, and `chain` and `tasks`, which back the tool's structured inputs), or duplicate names within the same session. Different sessions may register the same name. Dispose before replacement; there is no silent overwrite.
23
23
 
24
24
  Register in `session_start` using **`ctx.sessionManager.getSessionId()`**, not the session file path or a tool argument. Dispose in `session_shutdown`. New/resumed/forked sessions and reloads need registration from the replacement runtime's `session_start`; do not retain old `pi`/`ctx` references. The extension owns cleanup, not an automatic registration lifecycle manager. Disposal is idempotent and cannot remove a newer replacement. Missing cleanup can cause a duplicate-registration failure on reload.
25
25
 
@@ -123,7 +123,7 @@ Method notes:
123
123
  - `steer` requires an async run `id` (plus optional child `index`) and a non-empty `message`; its reply preserves the normal acknowledged-delivery result. Optional `mode` values are `steer` (default), `follow_up`, and `auto`, and receipts include `deliveryStatus: "delivered" | "queued"`. RPC steering disables the direct tool's pause-and-revive recovery in every mode so an extension keeps authority over the exact child it spawned; `ping.capabilities.nonRecoveringSteer` advertises this guarantee.
124
124
  - `resume` requires a run target and non-empty `message`. It delegates to the existing revival path, which validates current-session ownership, persisted session/recovery metadata, stopped/live state, capability ceilings, and the exclusive session lease before returning the new async run details. Callers may request a `file-only` output path for the revived result without overriding its model, tools, or budgets. `ping.capabilities.resume` advertises this seam.
125
125
  - `cost` returns the same parent-plus-child accounting `/subagent-cost` renders, as data: `{ version: 1, parent, children, childTotal, total, unresolvedAsyncChildren }`, where each usage is `{ input, output, cacheRead, cacheWrite, cost, turns }` and each child carries `label`, `agent`, `runId`, `usage`, and `sessionFile` when known. It is read-only and walks the current session branch plus existing run artifacts, so request it on your own turn boundaries (for example after `agent_settled` or an async completion wake), not on a timer. `unresolvedAsyncChildren` counts async children whose metadata could not be read; treat `childTotal` as a lower bound when it is non-zero, exactly as documented for `/subagent-cost` in [observability.md](observability.md). `ping.capabilities.cost` advertises `{ version: 1 }`.
126
- - `stop` targets current-session top-level async runs through the stop control channel and records a `stopped` lifecycle instead of reporting a timeout.
126
+ - `stop` accepts current-session running or queued async runs and whole paused runs. Paused runs are sealed only with exact observed native runner-terminal proof; missing or unknown proof returns an error even if a stop request was persisted. A successful reply's `state: "stopping"` acknowledges the stop operation for the exact run, not its current lifecycle or retirement. Read status and process-terminal evidence to establish termination. Child-scoped stop remains limited to pending or running children of eligible runs; already-terminal targets are rejected.
127
127
  - `status` keeps targeted and rich requests on the executor-backed path. A request with no `id`, `runId`, `dir`, `index`, `view`, or `lines` may use the restored in-memory projections and a short summary; when the live state is missing, stale, session-mismatched, or not restored, it falls back to normal executor status. Status `view`, `lines`, and `index` are forwarded for targeted transcript/fleet requests. Successful replies retain `text`, `details`, `fleet`, and `asyncSnapshot`; the short summary intentionally omits canonical filesystem details, wait subscriptions, and budget annotations.
128
128
 
129
129
  Capability advertisements on `ping`:
@@ -141,6 +141,20 @@ Capability advertisements on `ping`:
141
141
 
142
142
  Structured delegation progress updates carry `runId` as soon as foreground execution allocates it, so a caller can retain the package-owned revival target even if its own tool turn is interrupted before the terminal response. Foreground `details.results[]` rows also include a numeric `index` that is unique within the run and stable across partial progress snapshots and the final result; use `(runId, index)` instead of row position to correlate single, counted parallel, and chain children.
143
143
 
144
+ ### Direct async launch correlation
145
+
146
+ Direct async runs retain their originating `toolCallId` in status and result
147
+ artifacts. After a lost RPC spawn reply, request `status` with
148
+ `id: "rpc-spawn-<original-requestId>"`. The raw request UUID is not a run ID.
149
+ Default targeted replies expose the resolved `runId` and retained `toolCallId`
150
+ in `data.details`; older artifacts can omit the latter.
151
+
152
+ Lookup uses the existing run indexes and retained artifacts. Terminal indexing
153
+ keeps the alias after result delivery while the run's status is retained.
154
+ Correlation is not idempotent spawn: multiple runs with one alias are ambiguous, and missing or
155
+ expired evidence never proves that execution did not start. Do not redispatch
156
+ on that basis.
157
+
144
158
  ### Fleet status DTO
145
159
 
146
160
  When `ping.capabilities.fleetStatus` is `{ version: 1 }`, successful `status` replies include `data.fleet`: `{ version: 1, entries, totalActive, omitted }`.
@@ -264,6 +278,7 @@ Preflight covers ordinary single-agent launch resolution:
264
278
  - A parsed-definition digest, including system prompt and launch-affecting model, tool, skill, extension, output, and memory fields. Runtime overlays such as the Intercom bridge never change it.
265
279
  - Fresh/fork context, effective model and thinking, skill and tool resolution, direct MCP selections, runtime/configured extensions. Pass your extension's `pi` as `runtimeSnapshotHost` so `mcp:` selections resolve against Pi's built-in MCP the way a launch does. Without it, preflight cannot see built-in MCP and resolves `mcp:` selections through pi-mcp-adapter's configuration, as before.
266
280
  - Model scope allow lists accept the reserved tokens `inherit` and `scoped`; `scoped` expands to the caller-supplied `scopedModelIds` snapshot, degrading to `inherit` when it is omitted. Callers whose `modelScope.allow` uses `scoped` must pass `scopedModelIds` (the session's `/scoped-models` snapshot) alongside `parentModel`, otherwise preflight resolves it as `inherit` and may reject models the actual launch allows.
281
+ - Pass `projectTrusted: ctx.isProjectTrusted()` to match a session that declined project trust. With `false`, project agents and project subagent settings are ignored and an explicit `agentScope: "project"` returns `restricted_agent`. It defaults to `true`.
267
282
  - The resolved Intercom bridge state (`intercomBridge.mode` and `intercomBridge.active`). An active bridge appends the bridge instruction to the child prompt and adds `contact_supervisor` to a declared tool list, exactly as execution does.
268
283
  - Artifact/session paths, async lifecycle/status/result/event/process-terminal paths, package/lifecycle versions, capability-ceiling audit data, and stable digests.
269
284
 
@@ -445,10 +460,10 @@ The async runner process does not import provider internals. It writes operation
445
460
  Inspect is the portable command and action surface for an existing async run. The public actions are:
446
461
 
447
462
  ```ts
448
- subagent({ action: "inspector.command", id: "<run-id>", index: 0 })
449
- subagent({ action: "inspector.open", id: "<run-id>", index: 0, focus: true })
450
- subagent({ action: "inspector.status", id: "<run-id>", index: 0 })
451
- subagent({ action: "inspector.close", id: "<run-id>", index: 0 })
463
+ subagent({ action: "inspector.command", id: "<run-id>", options: { index: 0 } })
464
+ subagent({ action: "inspector.open", id: "<run-id>", options: { index: 0, focus: true } })
465
+ subagent({ action: "inspector.status", id: "<run-id>", options: { index: 0 } })
466
+ subagent({ action: "inspector.close", id: "<run-id>", options: { index: 0 } })
452
467
  ```
453
468
 
454
469
  `inspector.command` returns a standalone runner command without contacting a host or writing a binding. `inspector.open` selects an available built-in or externally registered inspector plugin. `status` and `close` select the plugin that owns the run binding and report clearly when that plugin does not support the requested lifecycle action. Without an available plugin, `open` fails closed with an actionable message; ordinary launches remain headless. Closing an inspector never stops the run.
@@ -495,9 +510,9 @@ An `InspectorPlugin` supplies:
495
510
  - `owns(context)`: synchronously check whether the provider owns an inspector binding for this target.
496
511
  - Optional `status(context)` and `close(context)`: inspect or close that binding, returning the same result type. Closing an inspector must not stop the subagent.
497
512
 
498
- The existing dispatcher tries Herdr, then Ghostty, then external providers in
513
+ The existing dispatcher tries Herdr, then Ghostty, then tmux, then external providers in
499
514
  registration order. Names are case-sensitive; duplicate names and the built-in
500
- names `herdr` and `ghostty` are rejected. A selected provider's failure is not
515
+ names `herdr`, `ghostty`, and `tmux` are rejected. A selected provider's failure is not
501
516
  retried through another provider. Status/close use the first provider whose
502
517
  `owns` returns true; unavailable lifecycle methods remain explicit errors.
503
518
  Providers own their pane bindings and must verify ownership before closing one.
@@ -529,7 +544,7 @@ When Pi runs inside [Herdr](https://herdr.dev), pi-subagents automatically repor
529
544
 
530
545
  - The bridge is enabled only when Herdr supplies `HERDR_ENV=1` and `HERDR_PANE_ID`; outside Herdr it registers no listeners or timers.
531
546
  - It restores current-session active runs after `/reload` or `/resume`, refreshes metadata while work is active, and clears it on completion or shutdown.
532
- - The bridge uses Herdr's existing `herdr:blocked` sibling event when an async child needs attention, and emits `herdr:busy` while async work remains. Herdr versions that support the sibling event keep the pane's semantic state `working`; older versions ignore it safely and still display the metadata label while the Pi integration remains the lifecycle authority.
547
+ - The bridge emits `herdr:busy` while async work remains and never raises `herdr:blocked`, because a child's attention request goes to the parent agent, not the user. Herdr's Pi integration does not consume `herdr:busy` yet, so the pane's dot follows the parent's own turn and the metadata label shows the active work.
533
548
  - The owning Pi session is the only publisher for its own pane metadata. When an active workflow has an explicit bounded `label`, the newest active label appears in the summary and compact `title-suffix`; overlapping completion restores the previous active label. Raw task and goal prompts never enter Herdr metadata. Without a label, one active run uses its agent name and two or more use the active-run count. Attention adds `⚠`, and the suffix is cleared when active work reaches zero.
534
549
 
535
550
  To show the reported label in the expanded Agent sidebar, include `state_text` or `$summary` in its row layout:
@@ -581,13 +596,23 @@ The API returns discriminated structured results with canonical project root, bi
581
596
 
582
597
  A host that embeds this extension owns whether completion wakes can be delivered at all.
583
598
 
584
- Ordinary async and foreground completion wakes use `registerSubagentNotify` and `sendCompletion`. They listen for completion events and deliver through `pi.sendMessage(..., { triggerTurn })`. Session shutdown stops the result watcher and disposes this completion notifier. `createWaitSubscriptionManager` is separate: it is the explicit non-blocking `bg_wait` subscription path for work without native notification, not the ordinary completion wake path.
599
+ Ordinary async and foreground completion wakes use `registerSubagentNotify` and `sendCompletion`. They listen for completion events and deliver through `pi.sendMessage(..., { triggerTurn })`. When the parent is idle, every pi-subagents notice that should start a turn (completions, supervisor asks, control and steering notices, wait subscriptions) is instead appended without a turn, followed by one user message, `PARENT_WAKE_TEXT` from `src/shared/parent-wake.ts`, sent with `pi.sendUserMessage`. Pi runs `before_agent_start` only for prompts, so this keeps extension-set system prompt sections in the woken run. A busy parent still gets the notice as a steering message. After the user aborts a parent run in a host with a UI, these notices are only appended, with no turn and no wake message, until the next parent run starts. Session shutdown stops the result watcher and disposes this completion notifier. `createWaitSubscriptionManager` is separate: it is the explicit non-blocking `bg_wait` subscription path for work without native notification, not the ordinary completion wake path.
600
+
601
+ Each completion notice is a custom message with `customType: "subagent-notify"`. Its `content` is the text the model reads. Pi does not send `details` to the model, so hosts can use it to match a notice to its runs by id without parsing the text. `details.runs` has one entry per finished run, in the order of the notice. A grouped notice has several entries. Each entry has `agent` and `status` (`completed`, `failed`, `paused` or `stopped`). When known, an entry also has these fields:
602
+
603
+ - `runId`: the finished run's id. For a workflow it equals `workflowRunId`.
604
+ - `workflowRunId`: set only for workflows.
605
+ - `childRuns`: `{ runId, workflowKey?, agent?, status }` for each workflow, chain or parallel child.
606
+ - `childOutputs`: the per-child saved output paths of a workflow.
607
+ - `source`, `durationMs`, `asyncDir`, `workflowReceiptPath`, `handoffPath`, and `sessionLabel` with `sessionValue` (a session file, share URL or share error).
608
+
609
+ Entries can also carry other values the notice text is built from, such as `scheduleOrigin` and `watchdogBlockers`. The output previews are only in `content`.
585
610
 
586
611
  Detached children do not stop when the session does. They are the host process's children, not the session's, so the run keeps going, completes, and notifies nobody. What is lost is the notification, not the work.
587
612
 
588
613
  This matters because "is the parent busy?" is the wrong idle signal. A parent that launches a detached run and hands control back — which is what the async launch output tells it to do — is not prompting, streaming, compacting, or running a shell command. A host that reaps sessions on those signals alone will dispose exactly the session that was waiting to be woken.
589
614
 
590
- When pi-subagents runs inside a compatible pi-web host, it discovers the versioned `Symbol.for("@agegr/pi-web/session-liveness/v1")` registry and registers one provider for the current session. The provider reports live `queued`/`running` async jobs, active nested descendants (including foreground routes retained after their direct parent settles), foreground controls that still have a scheduling owner or active child, async runs that ended but whose result has not reached the parent (including a rejected send waiting for retry), and completion notifications until Pi starts the wake message (`message_start`), even when Pi queued it behind the current turn or past `agent_settled`. A wake Pi discards without starting keeps the session live until it shuts down. Retained terminal history, future schedules, and wait subscriptions do not make a session live by themselves. The registration is replaced on session changes and released during runtime shutdown or reload; other hosts remain unaffected.
615
+ When pi-subagents runs inside a compatible pi-web host, it discovers the versioned `Symbol.for("@agegr/pi-web/session-liveness/v1")` registry and registers one provider for the current session. The provider reports live `queued`/`running` async jobs, active nested descendants (including foreground routes retained after their direct parent settles), foreground controls that still have a scheduling owner or active child, async runs that ended but whose result has not reached the parent (including a rejected send waiting for retry), completion notifications until Pi starts the wake message (`message_start`), even when Pi queued it behind the current turn or past `agent_settled`, and a wake prompt sent to an idle parent until its run starts (`agent_start`). Accepted wakes remain owned by the same Pi session manager and session UUID across extension reloads, until they start. Independent session managers never share this ownership, and changing the UUID on an existing manager discards the old session's wakes. A wake message Pi discards without starting keeps the session live until the session shuts down for a reason other than reload. A wake prompt whose run has not started 10 seconds later, while the parent is idle, no longer keeps the session live: an input handler consumed it or it failed, and its notices are already in the session. Retained terminal history, future schedules, and wait subscriptions do not make a session live by themselves. The registration is replaced on session changes and released during runtime shutdown or reload; other hosts remain unaffected.
591
616
 
592
617
  If your host reclaims idle sessions, keep a session alive while it still has live detached work:
593
618
 
@@ -599,6 +624,10 @@ If your host reclaims idle sessions, keep a session alive while it still has liv
599
624
 
600
625
  The symptom when this is missed is quiet and easy to misattribute: subagents appear never to report back, which looks like a fault in this extension rather than in the host that disposed the listener.
601
626
 
627
+ ## Component screens over RPC
628
+
629
+ `/subagents-fleet`, `/subagents-stop` and the `/subagents` model and thinking pickers draw a `ctx.ui.custom()` component in the TUI. In every other mode they fall back to text or `ctx.ui.select`, because stock Pi RPC defines `custom()` as a no-op. A host that runs Pi in RPC mode and renders `custom()` components itself, such as pi-web, can set `PI_SUBAGENTS_COMPONENT_UI=1` in Pi's environment to get the component screens.
630
+
602
631
  ## Runtime files
603
632
 
604
633
  The main runtime files in this repository:
@@ -28,13 +28,15 @@ An explicit `mission` object must have exactly one non-empty `title` or `summary
28
28
  ```ts
29
29
  const created = subagent({
30
30
  action: "mission.create",
31
- mission: { title: "Ship auth refresh", objective: "Implement and validate token refresh" }
31
+ options: {
32
+ mission: { title: "Ship auth refresh", objective: "Implement and validate token refresh" }
33
+ }
32
34
  })
33
35
  // After a ```js workflow block that runs the approved auth refresh plan:
34
- subagent({ workflow: true, missionId: "<mission-id>" })
36
+ subagent({ workflow: true, options: { missionId: "<mission-id>" } })
35
37
 
36
38
  // Or create and attach in one launch
37
- subagent({ workflow: true, mission: { title: "Ship auth refresh" } })
39
+ subagent({ workflow: true, options: { mission: { title: "Ship auth refresh" } } })
38
40
  ```
39
41
 
40
42
  ### Goal missions
@@ -44,11 +46,13 @@ Set `goal: true` with a token budget to make an open mission an active continuat
44
46
  ```ts
45
47
  subagent({
46
48
  action: "mission.create",
47
- mission: {
48
- title: "Ship auth refresh",
49
- objective: "Implement and validate token refresh",
50
- goal: true,
51
- budget: { tokens: 400000 }
49
+ options: {
50
+ mission: {
51
+ title: "Ship auth refresh",
52
+ objective: "Implement and validate token refresh",
53
+ goal: true,
54
+ budget: { tokens: 400000 }
55
+ }
52
56
  }
53
57
  })
54
58
  ```
@@ -92,10 +96,12 @@ return runs.run("main", { agent: "reviewer", task: "Review the current diff." })
92
96
  subagent({
93
97
  action: "schedule.create",
94
98
  id: "evening-review",
95
- name: "Evening review",
96
- at: "+30m",
97
- baseRef: "refs/heads/release",
98
- workflow: true
99
+ workflow: true,
100
+ options: {
101
+ name: "Evening review",
102
+ at: "+30m",
103
+ baseRef: "refs/heads/release"
104
+ }
99
105
  })
100
106
  ```
101
107
 
@@ -103,14 +109,14 @@ Create a fixed recurring workflow from a script file:
103
109
 
104
110
  ```ts
105
111
  // .pi/workflows/backlog.js: return runs.run('main', { agent: 'worker', task: args.task })
106
- subagent({ action: "schedule.create", id: "backlog", every: "6h", catchUp: "latest", workflow: "./.pi/workflows/backlog.js", args: { task: "Maintain core" } })
112
+ subagent({ action: "schedule.create", id: "backlog", workflow: "./.pi/workflows/backlog.js", args: { task: "Maintain core" }, options: { every: "6h", catchUp: "latest" } })
107
113
  ```
108
114
 
109
115
  Create a daily or weekly local-time schedule:
110
116
 
111
117
  ```ts
112
- subagent({ action: "schedule.create", every: "day", at: "09:00", timezone: "Asia/Taipei", workflow: "./.pi/workflows/review.js" })
113
- subagent({ action: "schedule.create", every: "week", on: ["mon", "tue", "wed", "thu", "fri"], at: "09:00", timezone: "America/New_York", workflow: "./.pi/workflows/review.js" })
118
+ subagent({ action: "schedule.create", workflow: "./.pi/workflows/review.js", options: { every: "day", at: "09:00", timezone: "Asia/Taipei" } })
119
+ subagent({ action: "schedule.create", workflow: "./.pi/workflows/review.js", options: { every: "week", on: ["mon", "tue", "wed", "thu", "fri"], at: "09:00", timezone: "America/New_York" } })
114
120
  ```
115
121
 
116
122
  Calendar schedules require `HH:mm` and an explicit IANA `timezone` or `UTC`. Weekly `on` is a non-empty weekday array; duplicates are removed and weekdays sorted. Daily schedules do not accept `on`. Missing local times and skipped dates are skipped; a repeated time fires at its first instant only. The pending local date is persisted with a UTC cache that is refreshed on restoration using the host's current timezone data. Use a calendar-capable version in every session sharing these definitions; older schedulers reject the unknown trigger kind.
@@ -120,7 +126,7 @@ Fixed intervals support `m`, `h`, `d`, and `w` units and advance from the planne
120
126
  Create a quiet recurring workflow whose successful completions stay visible but do not wake the parent session:
121
127
 
122
128
  ```ts
123
- subagent({ action: "schedule.create", id: "nightly-sweep", every: "24h", quiet: true, workflow: true })
129
+ subagent({ action: "schedule.create", id: "nightly-sweep", workflow: true, options: { every: "24h", quiet: true } })
124
130
  ```
125
131
 
126
132
  Manage schedules with `schedule.list`, `schedule.show`, `schedule.history`, `schedule.pause`, `schedule.resume`, `schedule.run`, `schedule.run-due`, and `schedule.delete`.
@@ -128,7 +134,7 @@ Manage schedules with `schedule.list`, `schedule.show`, `schedule.history`, `sch
128
134
  Attach an existing mission to give each scheduled workflow access to the same durable `state.get/set`:
129
135
 
130
136
  ```ts
131
- subagent({ action: "schedule.create", id: "backlog", every: "6h", workflow: "./.pi/workflows/backlog.js", missionId: "<mission-id>" })
137
+ subagent({ action: "schedule.create", id: "backlog", workflow: "./.pi/workflows/backlog.js", options: { every: "6h", missionId: "<mission-id>" } })
132
138
  ```
133
139
 
134
140
  The mission must be readable in the store resolved from the schedule's target `cwd` and current mission configuration. Creation checks it without changing its status. Every fire uses the normal explicit mission launch path, including after session restoration; missing or invalid records fail before workflow execution. Schedules accept only an existing `missionId`, not mission creation or updates. The script's fixed `args` and its mutable mission state remain separate.
@@ -142,6 +148,7 @@ Mission-bound definitions use schedule schema version 2 so older versions reject
142
148
  Behavior:
143
149
 
144
150
  - Runs always launch async with fresh context. Without `missionId`, they disable mission creation and have no `state` global.
151
+ - Project-wide schedules (the default) fire in whichever Pi session in that project claims the fire first, and that session receives the run's notifications. Pass `sessionOnly: true` to bind restoration and every fire to the creating session; other sessions in the project never arm it.
145
152
  - An optional top-level `baseRef` selects the safe Git ref used by managed worktrees (default `HEAD`); it is persisted with the schedule and forwarded on every fire. The source checkout must still be clean.
146
153
  - Definitions, bounded history, append-only events, and per-run receipts are stored with mode `0600`.
147
154
  - `overlap` is currently fixed to `skip`; `catchUp` supports `latest` (default) and `none`.
@@ -220,7 +220,7 @@ Model scope is policy only. It rejects or warns; it does not select a cheaper mo
220
220
 
221
221
  `inherit` and `scoped` expand in the parent process at each launch. They are never sent to the child as model ids. A nested child therefore inherits its immediate parent's current model, not the original top-level model. `scoped` uses the scoped-model set at launch, so a mid-session `/scoped-models` change applies to the next child; background runs keep the set captured when the run started. Pi reports an empty set when the session is unscoped, either because nothing is configured or because no configured pattern matches an available model, and then lets the parent use every model. In that case `scoped` behaves exactly as `inherit`, which is narrower. If no parent model is available, an enforced `inherit` or `scoped` entry does not match and fails closed.
222
222
 
223
- Project `modelScope` settings replace the complete user `modelScope`, as with the existing project-over-user settings precedence. Project settings are trusted and can therefore replace user restrictions.
223
+ Project `modelScope` settings replace the complete user `modelScope`, as with the existing project-over-user settings precedence. This applies only when the session trusts the project: when project trust is declined, project subagent settings are ignored and the user `modelScope` applies.
224
224
 
225
225
  ## Profiles and provider model catalogs
226
226
 
@@ -10,6 +10,8 @@ A foreground child is a pi session created inside the parent Pi process, not a s
10
10
 
11
11
  A background child is a pi session created inside the detached runner process. The runner mirrors session events into `events.jsonl`, `output-<index>.log`, and the transcript. Interrupt and stop abort the child session; steer requests are delivered with the session's `steer` or `followUp`.
12
12
 
13
+ Pressing `Esc` in the parent stops the parent turn and its foreground children. Background children keep running. Until the next parent turn starts, usually your next prompt, their results and requests are added to the session but do not start a new parent turn, and the TUI shows how many background runs are still active. Use `/subagents-stop` to stop them.
14
+
13
15
  Long-open `bash` attention notices identify the exact tool call and include status and child-specific transcript commands. Each distinct long-open call notifies once. Inspect the running command and recent output before intervening: development servers and watch commands may intentionally never return, while builds and tests may legitimately take time. A queued steer does not cancel the shell command. For local native Pi children explicitly granted `subagent_command`, `command.yield` returns control while the selected command remains managed; `command.cancel` stops that command without interrupting the child. Query `command.status` to confirm its terminal state. Unsupported children require the existing run-scoped interrupt/resume path, which may affect siblings. See [command controls](tool-reference.md#command-controls).
14
16
 
15
17
  Live progress shows compact detail for single, chain, and parallel modes: a bounded one-line task, current tool, recent output, token counts, aggregate cost, duration, activity freshness, current-tool duration, and chain graph metadata when available. Workflow `label` metadata wins over raw task text in compact multi-child cards.
@@ -29,6 +31,8 @@ subagent({ action: "status", id: "..." }) // one run
29
31
 
30
32
  Or ask naturally: "Show me the current async runs."
31
33
 
34
+ In a terminal that supports [OSC 7501](https://www.superlogical.com/rex/docs/build/program-status), each background run is also reported to the terminal as working, waiting on you, finished, or failed. See [`programStatus`](configuration.md#programstatus).
35
+
32
36
  ### Usage and cost accounting
33
37
 
34
38
  Run `/subagent-cost` for the parent session's combined parent and child token usage and cost. It includes completed async workflow children when their persisted receipts and metadata remain available. Missing child metadata is reported as unavailable when the receipt identifies that child. If the workflow receipt itself is missing, unreadable, invalid, or non-terminal, affected children can be omitted from the total without an unavailable count, so treat the result as a lower bound when run artifacts are unavailable.
@@ -46,7 +50,7 @@ async subagent worker · background
46
50
  Press configured-expand-key for live detail
47
51
  ```
48
52
 
49
- To inspect one background child in text, use `subagent({ action: "status", id: "...", view: "transcript" })`; add `index` for a specific child in a parallel or chain run.
53
+ To inspect one background child in text, use `subagent({ action: "status", id: "...", options: { view: "transcript" } })`; add `index` for a specific child in a parallel or chain run.
50
54
 
51
55
  In Pi fullscreen mode with mouse dispatch, left-click
52
56
  anywhere on the async widget's header row to fold it into a live one-line status
@@ -79,6 +83,7 @@ For compact chat results with FleetView as the only live editor surface, merge t
79
83
  - `fleetView: true` retains live progress. Open `/subagents-fleet` for details instead of repeatedly requesting status just to watch progress. Pi's expand key does not expand summary results; keep `"rich"` if you want expandable inline output.
80
84
  - `asyncWidget: false` hides only the additional under-editor async widget, leaving FleetView available. This configuration reduces visible surfaces; it does not guarantee ordering relative to other extensions.
81
85
  - `asyncWidgetCollapsed: true` starts each newly mounted async widget as a one-line live status summary; click its header to expand it.
86
+ - `asyncWidgetLayout: "rows"` shows each run in the async widget as one line under a header instead of a block of detail rows; Pi's expand key still shows the details.
82
87
 
83
88
  Thanks to [DraconDev](https://github.com/DraconDev) for reporting the display noise and suggesting summary mode in [#1931](https://github.com/nicobailon/pi-subagents/issues/1931).
84
89
 
@@ -123,11 +128,11 @@ Default keys:
123
128
 
124
129
  Set `fleetKeybindings` in the extension config to replace inspector-level keys when a terminal intercepts keys such as `PgUp`, `PgDn`, `Home`, or `End`. Prompt modes keep fixed keys such as `Esc`, `Enter`, `Tab`, and stop-confirmation `Y`/`N`.
125
130
 
126
- Enter and `H` use the available Inspect plugin. On macOS with Ghostty 1.3+ (TERM_PROGRAM=ghostty), this includes the other bundled open-only plugin using Ghostty's preview AppleScript API; status and close are unavailable because no binding is written. In a child-specific inspector, type ordinary guidance and press Enter to send it through the acknowledged steer channel; `steer <message>`, `status`, and `stop` remain available as explicit controls. The bundled Herdr plugin uses Herdr 0.7.5+.
131
+ Enter and `H` use the available Inspect plugin. Inside tmux, this includes the bundled tmux plugin: it splits the focused window, runs the inspector pane there, and records a binding, so `status` and `close` are available and ordinary tmux keys such as the prefix keep working in the pane. On macOS with Ghostty 1.3+ (TERM_PROGRAM=ghostty), this includes the other bundled open-only plugin using Ghostty's preview AppleScript API; status and close are unavailable because no binding is written. In a child-specific inspector, type ordinary guidance and press Enter to send it through the acknowledged steer channel; `steer <message>`, `status`, and `stop` remain available as explicit controls. The bundled Herdr plugin uses Herdr 0.7.5+.
127
132
 
128
- Without a TUI, `/subagents-fleet` retains the textual `subagent({ action: "status", view: "fleet" })` fallback, and mutations use explicit commands: run `/subagents-stop` and pick from the selector, or use `/subagents-stop <run-id>` / `subagent({ action: "stop", id: "..." })` when you already know the id.
133
+ Without a TUI, `/subagents-fleet` retains the textual `subagent({ action: "status", options: { view: "fleet" } })` fallback, and mutations use explicit commands: run `/subagents-stop` and pick from the selector, or use `/subagents-stop <run-id>` / `subagent({ action: "stop", id: "..." })` when you already know the id.
129
134
 
130
- Use `/subagents-detach [run-id]` only for an active foreground single-subagent run you want to leave running without terminating; the eventual result remains available through status/wait.
135
+ Use `/subagents-detach [run-id]` only for an active foreground single-subagent run you want to leave running without terminating; the eventual result remains available through status/wait. A detached foreground child runs inside the current pi-subagents runtime. When `/reload`, a session resume, or a session switch replaces that runtime, the child is stopped, and `status` then shows it as stopped with the reason. `resume` continues it from its session.
131
136
 
132
137
  Set `foregroundDetachShortcut` in `~/.pi/agent/extensions/subagent/config.json` to bind the same action to a shortcut. The running foreground card shows the configured shortcut beside its live-detail hint:
133
138
 
@@ -295,7 +300,7 @@ Debug artifacts live under `{sessionDir}/subagent-artifacts/`, `.pi/subagents/ar
295
300
  - `{runId}_{agent}.jsonl`
296
301
  - `{runId}_{agent}_meta.json`
297
302
 
298
- Metadata records timing, usage, exit code, the resolved model, and the resolved acceptance ledger with its parsed child report. A strictly guarded retained-session recovery after a verified compaction abort may continue once on that same model; it never selects another model.
303
+ Metadata records the parent session id, timing, usage, exit code, the resolved model, and the resolved acceptance ledger with its parsed child report. A strictly guarded retained-session recovery after a verified compaction abort may continue once on that same model; it never selects another model.
299
304
 
300
305
  For npm package projects, project-scoped artifacts need a `.npmignore` rule (or `.gitignore` when no `.npmignore` exists) or a `files` allowlist that does not include `.pi/subagents/`. pi-subagents warns at launch when these package settings can include the artifacts. Use `artifactDir: "session"` or `"temp"` to keep them outside the package worktree.
301
306
 
@@ -303,6 +308,8 @@ For npm package projects, project-scoped artifacts need a `.npmignore` rule (or
303
308
 
304
309
  Session files are stored under a per-run session directory. With `context: "fork"`, each child starts from a branched session file produced from the parent's current leaf (foreground children open it in-process; background children receive it as `--session`). That is a real session fork, not an injected summary. An omitted launch `context` that resolves through `defaultContext: fork` uses the same branch when the parent session file and current leaf exist, and otherwise starts fresh.
305
310
 
311
+ A child session's header records the launching session's file as `parentSession`, the field Pi uses for its own forks, so a reader can find the parent session without parsing the directory layout. A nested child points at the session of the child that launched it. Run metadata (`{runId}_{agent}_meta.json`) also records `parentSessionId`, the launching session's id.
312
+
306
313
  ## Completion notifications
307
314
 
308
315
  Async completions belong only to the originating session. The result watcher emits `subagent:async-complete` for detached runs. Awaited workflow children emit it when they settle, with `awaitedByWorkflow: true`, `parentWorkflowRunId`, and `triggerTurn: false`. They do not send a separate child notification or turn.