pi-subagents 0.76.0 → 0.77.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 (347) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +1 -1
  3. package/agents/oracle.md +8 -19
  4. package/agents/researcher.md +0 -3
  5. package/agents/reviewer.md +17 -61
  6. package/agents/scout.md +1 -4
  7. package/agents/worker.md +8 -25
  8. package/docs/agents.md +70 -3
  9. package/docs/configuration.md +55 -6
  10. package/docs/extension-api.md +36 -11
  11. package/docs/missions.md +24 -17
  12. package/docs/models.md +1 -1
  13. package/docs/observability.md +10 -5
  14. package/docs/tool-reference.md +101 -83
  15. package/docs/watchdog.md +8 -6
  16. package/docs/workflows.md +15 -6
  17. package/index.d.ts.map +1 -1
  18. package/index.js +5 -0
  19. package/index.js.map +1 -1
  20. package/package.json +2 -1
  21. package/prompts/council.md +1 -1
  22. package/skills/pi-subagents/SKILL.md +1 -1
  23. package/skills/pi-subagents/references/constraints-and-recipes.md +1 -1
  24. package/skills/pi-subagents/references/execution-controls.md +16 -16
  25. package/skills/pi-subagents/references/management-authoring-rpc.md +16 -12
  26. package/skills/pi-subagents/references/prompting-and-roles.md +3 -3
  27. package/src/agents/advertised-agent-prompt.d.ts +5 -1
  28. package/src/agents/advertised-agent-prompt.d.ts.map +1 -1
  29. package/src/agents/advertised-agent-prompt.js +8 -2
  30. package/src/agents/advertised-agent-prompt.js.map +1 -1
  31. package/src/agents/agent-management.d.ts.map +1 -1
  32. package/src/agents/agent-management.js +5 -0
  33. package/src/agents/agent-management.js.map +1 -1
  34. package/src/agents/agent-scope.d.ts +1 -0
  35. package/src/agents/agent-scope.d.ts.map +1 -1
  36. package/src/agents/agent-scope.js +3 -0
  37. package/src/agents/agent-scope.js.map +1 -1
  38. package/src/agents/agent-serializer.d.ts.map +1 -1
  39. package/src/agents/agent-serializer.js +3 -0
  40. package/src/agents/agent-serializer.js.map +1 -1
  41. package/src/agents/agents.d.ts +14 -2
  42. package/src/agents/agents.d.ts.map +1 -1
  43. package/src/agents/agents.js +94 -36
  44. package/src/agents/agents.js.map +1 -1
  45. package/src/api/preflight.d.ts +2 -0
  46. package/src/api/preflight.d.ts.map +1 -1
  47. package/src/api/preflight.js +6 -2
  48. package/src/api/preflight.js.map +1 -1
  49. package/src/extension/config.d.ts.map +1 -1
  50. package/src/extension/config.js +23 -2
  51. package/src/extension/config.js.map +1 -1
  52. package/src/extension/control-notices.d.ts +0 -2
  53. package/src/extension/control-notices.d.ts.map +1 -1
  54. package/src/extension/control-notices.js +1 -7
  55. package/src/extension/control-notices.js.map +1 -1
  56. package/src/extension/declaration-pinning.d.ts +14 -0
  57. package/src/extension/declaration-pinning.d.ts.map +1 -0
  58. package/src/extension/declaration-pinning.js +147 -0
  59. package/src/extension/declaration-pinning.js.map +1 -0
  60. package/src/extension/doctor.d.ts +3 -1
  61. package/src/extension/doctor.d.ts.map +1 -1
  62. package/src/extension/doctor.js +3 -9
  63. package/src/extension/doctor.js.map +1 -1
  64. package/src/extension/fanout-child.d.ts.map +1 -1
  65. package/src/extension/fanout-child.js +6 -8
  66. package/src/extension/fanout-child.js.map +1 -1
  67. package/src/extension/index.d.ts +1 -1
  68. package/src/extension/index.d.ts.map +1 -1
  69. package/src/extension/index.js +68 -116
  70. package/src/extension/index.js.map +1 -1
  71. package/src/extension/rpc.d.ts.map +1 -1
  72. package/src/extension/rpc.js +12 -6
  73. package/src/extension/rpc.js.map +1 -1
  74. package/src/extension/schemas.d.ts +137 -1
  75. package/src/extension/schemas.d.ts.map +1 -1
  76. package/src/extension/schemas.js +22 -22
  77. package/src/extension/schemas.js.map +1 -1
  78. package/src/extension/subagent-guide.d.ts +1 -0
  79. package/src/extension/subagent-guide.d.ts.map +1 -1
  80. package/src/extension/subagent-guide.js +80 -6
  81. package/src/extension/subagent-guide.js.map +1 -1
  82. package/src/extension/subagent-options.d.ts +8 -0
  83. package/src/extension/subagent-options.d.ts.map +1 -0
  84. package/src/extension/subagent-options.js +52 -0
  85. package/src/extension/subagent-options.js.map +1 -0
  86. package/src/extension/tool-activation.d.ts.map +1 -1
  87. package/src/extension/tool-activation.js +3 -2
  88. package/src/extension/tool-activation.js.map +1 -1
  89. package/src/extension/tool-description.d.ts +4 -7
  90. package/src/extension/tool-description.d.ts.map +1 -1
  91. package/src/extension/tool-description.js +45 -59
  92. package/src/extension/tool-description.js.map +1 -1
  93. package/src/inspectors/actions.d.ts +2 -0
  94. package/src/inspectors/actions.d.ts.map +1 -1
  95. package/src/inspectors/actions.js +41 -13
  96. package/src/inspectors/actions.js.map +1 -1
  97. package/src/inspectors/plugins.d.ts.map +1 -1
  98. package/src/inspectors/plugins.js +3 -2
  99. package/src/inspectors/plugins.js.map +1 -1
  100. package/src/inspectors/tmux/actions.d.ts +26 -0
  101. package/src/inspectors/tmux/actions.d.ts.map +1 -0
  102. package/src/inspectors/tmux/actions.js +182 -0
  103. package/src/inspectors/tmux/actions.js.map +1 -0
  104. package/src/inspectors/tmux/client.d.ts +28 -0
  105. package/src/inspectors/tmux/client.d.ts.map +1 -0
  106. package/src/inspectors/tmux/client.js +65 -0
  107. package/src/inspectors/tmux/client.js.map +1 -0
  108. package/src/inspectors/tmux/plugin.d.ts +8 -0
  109. package/src/inspectors/tmux/plugin.d.ts.map +1 -0
  110. package/src/inspectors/tmux/plugin.js +15 -0
  111. package/src/inspectors/tmux/plugin.js.map +1 -0
  112. package/src/integrations/herdr-status.d.ts +0 -1
  113. package/src/integrations/herdr-status.d.ts.map +1 -1
  114. package/src/integrations/herdr-status.js +18 -52
  115. package/src/integrations/herdr-status.js.map +1 -1
  116. package/src/integrations/program-status.d.ts +31 -0
  117. package/src/integrations/program-status.d.ts.map +1 -0
  118. package/src/integrations/program-status.js +189 -0
  119. package/src/integrations/program-status.js.map +1 -0
  120. package/src/intercom/native-supervisor-channel.d.ts +1 -0
  121. package/src/intercom/native-supervisor-channel.d.ts.map +1 -1
  122. package/src/intercom/native-supervisor-channel.js +77 -3
  123. package/src/intercom/native-supervisor-channel.js.map +1 -1
  124. package/src/intercom/result-intercom.js +1 -1
  125. package/src/intercom/result-intercom.js.map +1 -1
  126. package/src/intercom/supervisor-ui.d.ts +2 -12
  127. package/src/intercom/supervisor-ui.d.ts.map +1 -1
  128. package/src/intercom/supervisor-ui.js +2 -154
  129. package/src/intercom/supervisor-ui.js.map +1 -1
  130. package/src/missions/store.d.ts.map +1 -1
  131. package/src/missions/store.js +27 -5
  132. package/src/missions/store.js.map +1 -1
  133. package/src/runs/background/async-execution.d.ts +9 -1
  134. package/src/runs/background/async-execution.d.ts.map +1 -1
  135. package/src/runs/background/async-execution.js +250 -141
  136. package/src/runs/background/async-execution.js.map +1 -1
  137. package/src/runs/background/async-job-tracker.d.ts +4 -1
  138. package/src/runs/background/async-job-tracker.d.ts.map +1 -1
  139. package/src/runs/background/async-job-tracker.js +3 -2
  140. package/src/runs/background/async-job-tracker.js.map +1 -1
  141. package/src/runs/background/async-resume.d.ts.map +1 -1
  142. package/src/runs/background/async-resume.js +6 -2
  143. package/src/runs/background/async-resume.js.map +1 -1
  144. package/src/runs/background/await-async-run.d.ts +8 -4
  145. package/src/runs/background/await-async-run.d.ts.map +1 -1
  146. package/src/runs/background/await-async-run.js +14 -8
  147. package/src/runs/background/await-async-run.js.map +1 -1
  148. package/src/runs/background/binary-bootstrap.d.ts.map +1 -1
  149. package/src/runs/background/binary-bootstrap.js +2 -1
  150. package/src/runs/background/binary-bootstrap.js.map +1 -1
  151. package/src/runs/background/chain-root-attachment.d.ts +2 -0
  152. package/src/runs/background/chain-root-attachment.d.ts.map +1 -1
  153. package/src/runs/background/chain-root-attachment.js +5 -2
  154. package/src/runs/background/chain-root-attachment.js.map +1 -1
  155. package/src/runs/background/fleet-view.js +5 -5
  156. package/src/runs/background/fleet-view.js.map +1 -1
  157. package/src/runs/background/notify.d.ts +12 -2
  158. package/src/runs/background/notify.d.ts.map +1 -1
  159. package/src/runs/background/notify.js +148 -13
  160. package/src/runs/background/notify.js.map +1 -1
  161. package/src/runs/background/result-files.d.ts +29 -0
  162. package/src/runs/background/result-files.d.ts.map +1 -1
  163. package/src/runs/background/result-files.js +104 -6
  164. package/src/runs/background/result-files.js.map +1 -1
  165. package/src/runs/background/result-watcher.d.ts.map +1 -1
  166. package/src/runs/background/result-watcher.js +60 -64
  167. package/src/runs/background/result-watcher.js.map +1 -1
  168. package/src/runs/background/resume-guidance.js +2 -2
  169. package/src/runs/background/resume-guidance.js.map +1 -1
  170. package/src/runs/background/run-child-session.d.ts.map +1 -1
  171. package/src/runs/background/run-child-session.js +2 -1
  172. package/src/runs/background/run-child-session.js.map +1 -1
  173. package/src/runs/background/run-id-resolver.d.ts.map +1 -1
  174. package/src/runs/background/run-id-resolver.js +9 -6
  175. package/src/runs/background/run-id-resolver.js.map +1 -1
  176. package/src/runs/background/run-status.d.ts.map +1 -1
  177. package/src/runs/background/run-status.js +19 -15
  178. package/src/runs/background/run-status.js.map +1 -1
  179. package/src/runs/background/runner-child-launch.d.ts.map +1 -1
  180. package/src/runs/background/runner-child-launch.js +1 -0
  181. package/src/runs/background/runner-child-launch.js.map +1 -1
  182. package/src/runs/background/runner-http-dispatcher.d.ts +3 -0
  183. package/src/runs/background/runner-http-dispatcher.d.ts.map +1 -1
  184. package/src/runs/background/runner-http-dispatcher.js +2 -0
  185. package/src/runs/background/runner-http-dispatcher.js.map +1 -1
  186. package/src/runs/background/scheduled-runs.d.ts +9 -0
  187. package/src/runs/background/scheduled-runs.d.ts.map +1 -1
  188. package/src/runs/background/scheduled-runs.js +124 -36
  189. package/src/runs/background/scheduled-runs.js.map +1 -1
  190. package/src/runs/background/subagent-runner-bootstrap.d.ts.map +1 -1
  191. package/src/runs/background/subagent-runner-bootstrap.js +5 -1
  192. package/src/runs/background/subagent-runner-bootstrap.js.map +1 -1
  193. package/src/runs/background/subagent-runner.d.ts +3 -1
  194. package/src/runs/background/subagent-runner.d.ts.map +1 -1
  195. package/src/runs/background/subagent-runner.js +15 -6
  196. package/src/runs/background/subagent-runner.js.map +1 -1
  197. package/src/runs/background/subagent-wait.d.ts +2 -0
  198. package/src/runs/background/subagent-wait.d.ts.map +1 -1
  199. package/src/runs/background/subagent-wait.js +34 -20
  200. package/src/runs/background/subagent-wait.js.map +1 -1
  201. package/src/runs/background/terminal-run-index.d.ts +1 -0
  202. package/src/runs/background/terminal-run-index.d.ts.map +1 -1
  203. package/src/runs/background/terminal-run-index.js +47 -1
  204. package/src/runs/background/terminal-run-index.js.map +1 -1
  205. package/src/runs/background/wait-tool.d.ts.map +1 -1
  206. package/src/runs/background/wait-tool.js +36 -23
  207. package/src/runs/background/wait-tool.js.map +1 -1
  208. package/src/runs/foreground/async-stop-action.d.ts +7 -1
  209. package/src/runs/foreground/async-stop-action.d.ts.map +1 -1
  210. package/src/runs/foreground/async-stop-action.js +49 -25
  211. package/src/runs/foreground/async-stop-action.js.map +1 -1
  212. package/src/runs/foreground/execution.d.ts.map +1 -1
  213. package/src/runs/foreground/execution.js +50 -24
  214. package/src/runs/foreground/execution.js.map +1 -1
  215. package/src/runs/foreground/subagent-executor.d.ts +5 -1
  216. package/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  217. package/src/runs/foreground/subagent-executor.js +174 -65
  218. package/src/runs/foreground/subagent-executor.js.map +1 -1
  219. package/src/runs/shared/child-hooks.js +6 -5
  220. package/src/runs/shared/child-hooks.js.map +1 -1
  221. package/src/runs/shared/child-launch.d.ts +2 -0
  222. package/src/runs/shared/child-launch.d.ts.map +1 -1
  223. package/src/runs/shared/child-launch.js +1 -0
  224. package/src/runs/shared/child-launch.js.map +1 -1
  225. package/src/runs/shared/child-session.d.ts +4 -0
  226. package/src/runs/shared/child-session.d.ts.map +1 -1
  227. package/src/runs/shared/child-session.js +28 -23
  228. package/src/runs/shared/child-session.js.map +1 -1
  229. package/src/runs/shared/child-tool-plan.d.ts.map +1 -1
  230. package/src/runs/shared/child-tool-plan.js +11 -10
  231. package/src/runs/shared/child-tool-plan.js.map +1 -1
  232. package/src/runs/shared/dynamic-fanout.js +1 -1
  233. package/src/runs/shared/dynamic-fanout.js.map +1 -1
  234. package/src/runs/shared/herdr-placed-run.d.ts +1 -0
  235. package/src/runs/shared/herdr-placed-run.d.ts.map +1 -1
  236. package/src/runs/shared/herdr-placed-run.js +10 -6
  237. package/src/runs/shared/herdr-placed-run.js.map +1 -1
  238. package/src/runs/shared/model-resolution-diagnostic.d.ts +10 -0
  239. package/src/runs/shared/model-resolution-diagnostic.d.ts.map +1 -1
  240. package/src/runs/shared/model-resolution-diagnostic.js +24 -0
  241. package/src/runs/shared/model-resolution-diagnostic.js.map +1 -1
  242. package/src/runs/shared/model-resolution.d.ts.map +1 -1
  243. package/src/runs/shared/model-resolution.js +29 -1
  244. package/src/runs/shared/model-resolution.js.map +1 -1
  245. package/src/runs/shared/nested-events.d.ts +2 -0
  246. package/src/runs/shared/nested-events.d.ts.map +1 -1
  247. package/src/runs/shared/nested-events.js +4 -0
  248. package/src/runs/shared/nested-events.js.map +1 -1
  249. package/src/runs/shared/parallel-handoff.js +2 -2
  250. package/src/runs/shared/parallel-handoff.js.map +1 -1
  251. package/src/runs/shared/parallel-utils.d.ts +2 -0
  252. package/src/runs/shared/parallel-utils.d.ts.map +1 -1
  253. package/src/runs/shared/parallel-utils.js.map +1 -1
  254. package/src/runs/shared/runner-launcher.d.ts +12 -0
  255. package/src/runs/shared/runner-launcher.d.ts.map +1 -0
  256. package/src/runs/shared/runner-launcher.js +25 -0
  257. package/src/runs/shared/runner-launcher.js.map +1 -0
  258. package/src/runs/shared/single-output.d.ts +20 -0
  259. package/src/runs/shared/single-output.d.ts.map +1 -1
  260. package/src/runs/shared/single-output.js +57 -0
  261. package/src/runs/shared/single-output.js.map +1 -1
  262. package/src/runs/shared/structured-output.d.ts.map +1 -1
  263. package/src/runs/shared/structured-output.js +17 -8
  264. package/src/runs/shared/structured-output.js.map +1 -1
  265. package/src/runs/shared/subagent-control.js +3 -3
  266. package/src/runs/shared/subagent-control.js.map +1 -1
  267. package/src/runs/shared/subagent-prompt-runtime.d.ts +8 -2
  268. package/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  269. package/src/runs/shared/subagent-prompt-runtime.js +43 -20
  270. package/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  271. package/src/runs/shared/workflow-async-child-guidance.js +1 -1
  272. package/src/runs/shared/workflow-async-child-guidance.js.map +1 -1
  273. package/src/runs/shared/worktree-cleanup-plan.js +1 -1
  274. package/src/runs/shared/worktree-cleanup-plan.js.map +1 -1
  275. package/src/shared/atomic-json.d.ts +4 -3
  276. package/src/shared/atomic-json.d.ts.map +1 -1
  277. package/src/shared/atomic-json.js +3 -1
  278. package/src/shared/atomic-json.js.map +1 -1
  279. package/src/shared/edit-distance.d.ts +5 -0
  280. package/src/shared/edit-distance.d.ts.map +1 -0
  281. package/src/shared/edit-distance.js +33 -0
  282. package/src/shared/edit-distance.js.map +1 -0
  283. package/src/shared/formatters.d.ts.map +1 -1
  284. package/src/shared/formatters.js +1 -6
  285. package/src/shared/formatters.js.map +1 -1
  286. package/src/shared/model-info.d.ts +8 -0
  287. package/src/shared/model-info.d.ts.map +1 -1
  288. package/src/shared/model-info.js +22 -0
  289. package/src/shared/model-info.js.map +1 -1
  290. package/src/shared/package-version.d.ts +3 -0
  291. package/src/shared/package-version.d.ts.map +1 -0
  292. package/src/shared/package-version.js +15 -0
  293. package/src/shared/package-version.js.map +1 -0
  294. package/src/shared/parent-wake.d.ts +18 -0
  295. package/src/shared/parent-wake.d.ts.map +1 -0
  296. package/src/shared/parent-wake.js +60 -0
  297. package/src/shared/parent-wake.js.map +1 -0
  298. package/src/shared/pruned-fork.d.ts +1 -1
  299. package/src/shared/pruned-fork.d.ts.map +1 -1
  300. package/src/shared/pruned-fork.js +6 -0
  301. package/src/shared/pruned-fork.js.map +1 -1
  302. package/src/shared/runtime-module-path.d.ts +11 -0
  303. package/src/shared/runtime-module-path.d.ts.map +1 -0
  304. package/src/shared/runtime-module-path.js +17 -0
  305. package/src/shared/runtime-module-path.js.map +1 -0
  306. package/src/shared/types.d.ts +26 -2
  307. package/src/shared/types.d.ts.map +1 -1
  308. package/src/shared/types.js +3 -0
  309. package/src/shared/types.js.map +1 -1
  310. package/src/shared/utils.d.ts.map +1 -1
  311. package/src/shared/utils.js +8 -7
  312. package/src/shared/utils.js.map +1 -1
  313. package/src/slash/slash-commands.js +3 -3
  314. package/src/slash/slash-commands.js.map +1 -1
  315. package/src/slash/subagents-admin.d.ts.map +1 -1
  316. package/src/slash/subagents-admin.js +2 -1
  317. package/src/slash/subagents-admin.js.map +1 -1
  318. package/src/tui/fleet-transcript.d.ts +2 -0
  319. package/src/tui/fleet-transcript.d.ts.map +1 -1
  320. package/src/tui/fleet-transcript.js +7 -2
  321. package/src/tui/fleet-transcript.js.map +1 -1
  322. package/src/tui/fleet.d.ts.map +1 -1
  323. package/src/tui/fleet.js +9 -4
  324. package/src/tui/fleet.js.map +1 -1
  325. package/src/tui/render.d.ts +2 -2
  326. package/src/tui/render.d.ts.map +1 -1
  327. package/src/tui/render.js +19 -17
  328. package/src/tui/render.js.map +1 -1
  329. package/src/tui/subagent-messages.d.ts +23 -0
  330. package/src/tui/subagent-messages.d.ts.map +1 -0
  331. package/src/tui/subagent-messages.js +270 -0
  332. package/src/tui/subagent-messages.js.map +1 -0
  333. package/src/watchdog/register-main.d.ts.map +1 -1
  334. package/src/watchdog/register-main.js +1 -19
  335. package/src/watchdog/register-main.js.map +1 -1
  336. package/src/watchdog/render.d.ts +2 -10
  337. package/src/watchdog/render.d.ts.map +1 -1
  338. package/src/watchdog/render.js +1 -19
  339. package/src/watchdog/render.js.map +1 -1
  340. package/src/watchdog/tool-actions.js +2 -2
  341. package/src/watchdog/tool-actions.js.map +1 -1
  342. package/src/workflows/scripted-workflow.d.ts.map +1 -1
  343. package/src/workflows/scripted-workflow.js +20 -6
  344. package/src/workflows/scripted-workflow.js.map +1 -1
  345. package/src/workflows/workflow-resources.d.ts.map +1 -1
  346. package/src/workflows/workflow-resources.js +12 -0
  347. package/src/workflows/workflow-resources.js.map +1 -1
@@ -4,7 +4,7 @@ Parameters and actions for the `subagent` tool. These are what the LLM passes wh
4
4
 
5
5
  In a fresh parent session, `subagents_enable({})` makes the full `subagent` tool available on the immediately following model request without launching work. Pi may call it when delegation is authorized by the current request or applicable instructions, or to manage existing runs. Direct execution remains the default; task complexity does not grant delegation authority. The public `subagent` name and parameters are unchanged after activation.
6
6
 
7
- Call `{ action: "guide", topic: "tool-reference" }` for this reference or `topic: "workflows"` for [workflow recipes](workflows.md). Use `topic: "agents"` for authoring, `topic: "missions"` for missions/schedules, and `topic: "watchdog"` for watchdog controls. Guide reads do not change the schema or grant authority.
7
+ Call `{ action: "guide", options: { topic: "tool-reference" } }` for this reference or `options: { topic: "workflows" }` for [workflow recipes](workflows.md). Use `topic: "agents"` for authoring, `topic: "missions"` for missions/schedules, and `topic: "watchdog"` for watchdog controls, always inside `options`. Guide reads do not change the schema or grant authority.
8
8
 
9
9
  ## Execution examples
10
10
 
@@ -30,7 +30,7 @@ The host resolves the script and authority internally and records bounded proven
30
30
  ```js
31
31
  { workflow: "./workflows/review.js", args: { target: "src/workflows" }, cwd: "/path/to/project" }
32
32
  { action: "validate", workflow: "./workflows/review.js", args: { target: "src/workflows" } }
33
- { action: "schedule.create", every: "6h", workflow: "./workflows/review.js", args: { target: "src/workflows" } }
33
+ { action: "schedule.create", workflow: "./workflows/review.js", args: { target: "src/workflows" }, options: { every: "6h" } }
34
34
  ```
35
35
 
36
36
  Each script below is the ```` ```js workflow ```` block of a reply that then calls `subagent({ workflow: true })`:
@@ -67,49 +67,59 @@ The complete plain-JSON inventory is validated before the first launch (maximum
67
67
 
68
68
  ## Parameter reference
69
69
 
70
+ The `subagent` tool schema lists `agent`, `task`, `workflow`, `args`, `async`, `model`, `cwd`, `worktree`, `output`, `action`, `id` and `message` at the top level and every other field inside `options`, for example `subagent({ action: "status", id: "<run-id>", options: { view: "transcript" } })`. Management fields and the `runId`, `maxRuntimeMs` and `isolation` aliases also keep working at the top level, as in RPC payloads, slash commands, schedules and workflow `runs.run`/`runs.all` items; a field given in both places with different values is rejected.
71
+
72
+ ### Target and management parameters
73
+
70
74
  | Param | Type | Default | Description |
71
75
  |-------|------|---------|-------------|
76
+ | `options` | object | - | Management and control fields; the rows named `options.<name>` below go here. Unknown keys are rejected with the closest valid option. The same fields are also accepted at the top level. |
72
77
  | `agent` | string | - | One direct child or agent-management target. Workflow child agents are set inside `runs.run` or `runs.all`. |
73
78
  | `task` | string | agent default | Direct child's task; requires `agent`, excludes `action` and workflow inputs. `agent` may also select a management target. |
74
79
  | `action` | string | - | Offline workflow `validate`, agent management (including `guide`, `children.list`, and `refine`/`refine.show`/`refine.rollback`), lane evidence (`lane.status`, `lane.recordMerge`, `lane.recordSupersession`), mission (`mission.create/list/show/update/resolve-decision/attach-run/close`), Inspect actions (`inspector.command/open/status/close`), Herdr project pane (`project.open/status/close`), status/control, reviewed `worktree.cleanup`, schedule, watchdog, or doctor action. |
75
- | `topic` | `overview \| workflows \| agents \| missions \| observability \| tool-reference \| configuration \| models \| watchdog \| extension-api \| council` | `overview` | Packaged guide topic for `action: "guide"`. |
76
- | `config` | object/string | - | Agent config for management create/update. |
77
- | `context` | `fresh \| fork \| profile` | global or per-agent default, else `fresh` | Explicit `fresh` or `fork` overrides every workflow child. `profile` requires the selected agent's declared `defaultContext` and ignores config `defaultSubagentContext`; missing agent defaults fail. When omitted, [`defaultSubagentContext`](configuration.md#defaultsubagentcontext) wins over each agent's `defaultContext`; implicit fork falls back to fresh without a persisted parent session and leaf. Explicit fork is strict. Packaged `worker` defaults to `fresh`; packaged `oracle` and `advisor` default to `fork`. |
78
- | `model` | string | agent default | Call `{action:"models"}` first and copy an exact `provider/id`; bare ids resolve only if unique, and agent names are not model ids. A suffix such as `provider/id:high` (`off/minimal/low/medium/high/xhigh/max`) overrides agent thinking. The `thinking` field is only for `watchdog.configure`, ignored on dispatch. On the `claude-code` and `claude-code-writer` adapters the model is Claude Code's own alias or id, and the same suffix becomes its `--effort`, bounded by `subagents.maxThinking` and by an enforced `subagents.modelScope`. |
79
- | `missionId` | string | - | Attach a workflow, including each fire of `schedule.create`, to an existing project mission. Scheduled attachment uses ordinary lifecycle and retention rules. |
80
- | `mission` | object/false | auto-create | Override the default enclosing mission with `{ title \| summary, objective?, goal?, budget?, labels? }`. Set exactly one non-empty `title` or `summary`; `objective` and `labels` are optional. `goal` may only be `true`, requires `budget.tokens`, and enables continuation notices. Pass `false` for an intentionally ephemeral workflow with no mission for it or its children and no `state` global. Explicit mission persistence failures are strict. |
81
- | `handoffPath` | string | - | Aggregate handoff manifest for `action: "worktree.discard"` or lane evidence actions, or optional explicit metadata for `action: "worktree.cleanup"`. |
82
- | `repo` | string | runtime cwd | Repository path for `action: "worktree.cleanup"`; required explicitly for apply. The configured worktree base filters candidates by their per-project folder under it but never discovers them. |
83
- | `planId` | string | - | Saved, reviewed cleanup plan ID; required for apply, rejected in plan mode. |
84
- | `mode` | `steer \| follow_up \| auto \| plan \| apply` | - | Delivery mode for `action: "steer"`; `worktree.cleanup` accepts `plan` or `apply`; apply requires an explicit repository and saved plan ID. |
85
- | `laneId` | string | - | Exact `runId` stored in the handoff manifest for `lane.status`, `lane.recordMerge`, or `lane.recordSupersession`. |
86
- | `merge` | object | - | Attested merge evidence for `lane.recordMerge`; requires a positive PR number, full reviewed/merge SHAs, tree-equivalence and post-merge-check statuses, attestor, and timestamp. |
87
- | `supersession` | object | - | Attested replacement-lane evidence for `lane.recordSupersession`; requires a different replacement lane id, attestor, and timestamp. |
88
- | `focus` | boolean | false | Focus the newly split host inspector pane for `action: "inspector.open"` or the new Herdr project pane for `action: "project.open"`; not a standalone action. `inspector.command` is read-only and does not contact Herdr or write a binding. Panes open in the background unless you set `focus: true`. Existing saved project panes can be focused through the public project-pane API when Herdr reports a tab or workspace id. |
89
- | `view` | `fleet \| transcript` | - | Optional `status` view for the active fleet surface or transcript tail inspection. |
90
- | `lines` | number | `80` | Maximum transcript lines for `action: "status", view: "transcript"`; capped at 500. |
91
- | `agentScope` | `user \| project \| both` | `both` | Agent discovery scope. Project wins on collisions. |
92
- | `capabilities` | boolean | `false` | With `action: "list"`, return compact prompt-free rows and `details.agentCapabilities` machine-readable records for each agent's declared/default routing capabilities. External CLI rows also include their command and passive local availability. |
80
+ | `options.topic` | `overview \| workflows \| agents \| missions \| observability \| tool-reference \| configuration \| models \| watchdog \| extension-api \| council`, or `<topic>/<section>` | `overview` | Packaged guide topic for `action: "guide"`. A docs topic returns its table of contents; `<topic>/<section>` returns one section. |
81
+ | `options.config` | object/string | - | Agent config for management create/update. |
82
+ | `options.context` | `fresh \| fork \| profile` | global or per-agent default, else `fresh` | Explicit `fresh` or `fork` overrides every workflow child. `profile` requires the selected agent's declared `defaultContext` and ignores config `defaultSubagentContext`; missing agent defaults fail. When omitted, [`defaultSubagentContext`](configuration.md#defaultsubagentcontext) wins over each agent's `defaultContext`; implicit fork falls back to fresh without a persisted parent session and leaf. Explicit fork is strict. Packaged `worker` defaults to `fresh`; packaged `oracle` and `advisor` default to `fork`. |
83
+ | `model` | string | agent default | An exact `provider/id`; bare ids resolve only if unique, and agent names are not model ids. An unknown or ambiguous model fails with up to 5 closest registry ids to copy; `{action:"models"}` lists them all. A suffix such as `provider/id:high` (`off/minimal/low/medium/high/xhigh/max`) overrides agent thinking. The `thinking` field is only for `watchdog.configure`, ignored on dispatch. On the `claude-code` and `claude-code-writer` adapters the model is Claude Code's own alias or id, and the same suffix becomes its `--effort`, bounded by `subagents.maxThinking` and by an enforced `subagents.modelScope`. |
84
+ | `options.missionId` | string | - | Attach a workflow, including each fire of `schedule.create`, to an existing project mission. Scheduled attachment uses ordinary lifecycle and retention rules. |
85
+ | `options.mission` | object/false | auto-create | Override the default enclosing mission with `{ title \| summary, objective?, goal?, budget?, labels? }`. Set exactly one non-empty `title` or `summary`; `objective` and `labels` are optional. `goal` may only be `true`, requires `budget.tokens`, and enables continuation notices. Pass `false` for an intentionally ephemeral workflow with no mission for it or its children and no `state` global. Explicit mission persistence failures are strict. |
86
+ | `options.handoffPath` | string | - | Aggregate handoff manifest for `action: "worktree.discard"` or lane evidence actions, or optional explicit metadata for `action: "worktree.cleanup"`. |
87
+ | `options.repo` | string | runtime cwd | Repository path for `action: "worktree.cleanup"`; required explicitly for apply. The configured worktree base filters candidates by their per-project folder under it but never discovers them. |
88
+ | `options.planId` | string | - | Saved, reviewed cleanup plan ID; required for apply, rejected in plan mode. |
89
+ | `options.mode` | `steer \| follow_up \| auto \| plan \| apply` | - | Delivery mode for `action: "steer"`; `worktree.cleanup` accepts `plan` or `apply`; apply requires an explicit repository and saved plan ID. |
90
+ | `options.laneId` | string | - | Exact `runId` stored in the handoff manifest for `lane.status`, `lane.recordMerge`, or `lane.recordSupersession`. |
91
+ | `options.merge` | object | - | Attested merge evidence for `lane.recordMerge`; requires a positive PR number, full reviewed/merge SHAs, tree-equivalence and post-merge-check statuses, attestor, and timestamp. |
92
+ | `options.supersession` | object | - | Attested replacement-lane evidence for `lane.recordSupersession`; requires a different replacement lane id, attestor, and timestamp. |
93
+ | `options.focus` | boolean | false | Focus the newly split host inspector pane for `action: "inspector.open"` or the new Herdr project pane for `action: "project.open"`; not a standalone action. `inspector.command` is read-only and does not contact Herdr or write a binding. Panes open in the background unless you set `focus: true`. Existing saved project panes can be focused through the public project-pane API when Herdr reports a tab or workspace id. |
94
+ | `options.view` | `fleet \| transcript` | - | Optional `status` view for the active fleet surface or transcript tail inspection. |
95
+ | `options.lines` | number | `80` | Maximum transcript lines for `action: "status"` with `options.view: "transcript"`; capped at 500. |
96
+ | `options.agentScope` | `user \| project \| both` | `both` | Agent discovery scope. Project wins on collisions. |
97
+ | `options.capabilities` | boolean | `false` | With `action: "list"`, return compact prompt-free rows and `details.agentCapabilities` machine-readable records for each agent's declared/default routing capabilities. External CLI rows also include their command and passive local availability. |
98
+
99
+ ### Execution parameters
100
+
101
+ | Param | Type | Default | Description |
102
+ |-------|------|---------|-------------|
93
103
  | `async` | boolean | default-on | Background execution. Workflows default to background. `async:false` blocks the parent until completion. A local foreground child runs inside the parent Pi process and never loads the parent's ambient extensions, but it does inherit the providers those extensions registered. A pane-native remote foreground child instead uses the remote machine's provider discovery and configuration. Agents that need MCP tools (`mcpDirectTools`, or MCP tools from an ambient adapter such as pi-mcp-adapter) must run as background children, which load them inside the detached runner process. |
94
- | `chatProgress` | `auto \| off \| live-card` | `auto` | Workflow chat projection. `auto` renders a live in-chat card only for watched foreground workflows in the same Git repository, including managed worktrees; it is off otherwise. Explicit `live-card` requires `async:false` and the same Git repository. Async workflows have no inline live card, so omit `chatProgress` or use `auto`/`off`; use `async:false` only when the parent must block. |
95
- | `isolation` | `none \| worktree` | - | Workflow child isolation. `none` runs in the shared cwd and does not need Git. `worktree` requires a managed Git worktree. Do not combine it with a contradictory `worktree` value. |
96
- | `baseRef` | string | `HEAD` | `HEAD` or a supported named ref such as `refs/heads/release`, `refs/tags/v1`, or `origin/main`. Full 40/64-character commit IDs and revision expressions such as `HEAD~1` are unsupported. The ref must resolve to a commit at worktree allocation; omitted values default to `HEAD` resolved at that time. Source-checkout cleanliness is still checked. For a workflow script, set it on the outer request as a default or on an individual `runs.run`/`runs.all` child to override it. |
97
- | `timeoutMs` / `maxRuntimeMs` | number | config `timeoutMs`, else 30 min foreground / single-agent async | Optional run-level max runtime in milliseconds. Both aliases may be supplied only when their values agree. When omitted, the global [`timeoutMs`](configuration.md#timeoutms) config provides the default; absent that, foreground and plain single-agent async runs fall back to 30 minutes, while composite async runs (chains, parallel tasks, workflows) stay unbounded at the top level. Expiration of this run-level deadline is terminal. |
98
- | `toolTimeoutMs` | number | fast-tool default | Optional positive hard per-tool-call deadline in milliseconds. Precedence: call value → agent frontmatter → config → `PI_SUBAGENT_TOOL_TIMEOUT_MS`. The timer starts on `tool_execution_start`, clears on the matching `tool_execution_end`, and terminates the run with `timedOut: true` if the tool remains open. When omitted, known-fast built-in tools get a five-minute default; long-running tools get attention notices but no hard default. It never extends the run deadline; `contact_supervisor`, `intercom`, and `bg_wait` are exempt. |
99
- | `checkpointBeforeDeadlineMs` | number | none | Async single-agent runs only. The runner requests that the child "checkpoint and stop" this many milliseconds before the run deadline (finish the current tool call, report changed files, build/test state, remaining work, commit/PR state; start no new work). This best-effort steer uses the normal steering lifecycle at the next tool boundary, so the receipt is visible in status and events; the ordinary deadline kill still applies. Precedence: call value → config `checkpointBeforeDeadlineMs`. Disarmed when the deadline leaves under one second before the checkpoint. |
100
- | `toolBudget` | object | none | Optional child tool-call budget `{ soft?, hard, block? }`: `hard` is a positive integer and `soft`, if set, is a positive integer no greater than `hard`. At `soft` the child is nudged to finalize. After `hard`, configured tools are blocked; `block` defaults to `read`, `grep`, `find`, and `ls`, and accepts either a nonempty array of tool names or `"*"` for every tool call. Final assistant text is never blocked. |
101
- | `usageBudget` | object | none | Optional root-only reported-usage budget `{ tokens?: { soft?, hard }, costUsd?: { soft?, hard } }`. Include at least one metric; each `hard` must be positive and each optional `soft` positive and no greater than its `hard`. Soft limits are status-only. Hard limits prevent later child launches after reported usage is reconciled; already-running children are not stopped and no reservations are made. |
102
- | `extensionBindings` | object | none | Child-only plain JSON keyed by namespaces like `package.name/1` (positive version): at most 16 namespaces, nesting depth 16, 256 total object properties, and 16 KiB of canonical UTF-8 JSON. Native Pi launches only; external runners and retained resumes reject it. |
103
- | `preflight` | object | none | Advisory lane hints for raw scripts (`workflow: true` or a script path) only; not accepted with named workflows or direct children. See [bounded workflows](workflows.md#opt-in-bounded-workflows). |
104
+ | `options.chatProgress` | `auto \| off \| live-card` | `auto` | Workflow chat projection. `auto` renders a live in-chat card only for watched foreground workflows in the same Git repository, including managed worktrees; it is off otherwise. Explicit `live-card` requires `async:false` and the same Git repository. Async workflows have no inline live card, so omit `chatProgress` or use `auto`/`off`; use `async:false` only when the parent must block. |
105
+ | `isolation` | `none \| worktree` | - | Alias kept at the top level; prefer `worktree`. Workflow child isolation. `none` runs in the shared cwd and does not need Git. `worktree` requires a managed Git worktree. Do not combine it with a contradictory `worktree` value. |
106
+ | `options.baseRef` | string | `HEAD` | `HEAD` or a supported named ref such as `refs/heads/release`, `refs/tags/v1`, or `origin/main`. Full 40/64-character commit IDs and revision expressions such as `HEAD~1` are unsupported. The ref must resolve to a commit at worktree allocation; omitted values default to `HEAD` resolved at that time. Source-checkout cleanliness is still checked. For a workflow script, set it on the outer request as a default or on an individual `runs.run`/`runs.all` child to override it. |
107
+ | `options.timeoutMs` | number | config `timeoutMs`, else 30 min foreground / single-agent async | Optional run-level max runtime in milliseconds. The top-level alias `maxRuntimeMs` is also accepted; both must agree. When omitted, the global [`timeoutMs`](configuration.md#timeoutms) config provides the default; absent that, foreground and plain single-agent async runs fall back to 30 minutes, while composite async runs (chains, parallel tasks, workflows) stay unbounded at the top level. Expiration of this run-level deadline is terminal. |
108
+ | `options.toolTimeoutMs` | number | fast-tool default | Optional positive hard per-tool-call deadline in milliseconds. Precedence: call value → agent frontmatter → config → `PI_SUBAGENT_TOOL_TIMEOUT_MS`. The timer starts on `tool_execution_start`, clears on the matching `tool_execution_end`, and terminates the run with `timedOut: true` if the tool remains open. When omitted, known-fast built-in tools get a five-minute default; long-running tools get attention notices but no hard default. It never extends the run deadline; `contact_supervisor`, `intercom`, and `bg_wait` are exempt. |
109
+ | `options.checkpointBeforeDeadlineMs` | number | none | Async single-agent runs only. The runner requests that the child "checkpoint and stop" this many milliseconds before the run deadline (finish the current tool call, report changed files, build/test state, remaining work, commit/PR state; start no new work). This best-effort steer uses the normal steering lifecycle at the next tool boundary, so the receipt is visible in status and events; the ordinary deadline kill still applies. Precedence: call value → config `checkpointBeforeDeadlineMs`. Disarmed when the deadline leaves under one second before the checkpoint. |
110
+ | `options.toolBudget` | object | none | Optional child tool-call budget `{ soft?, hard, block? }`: `hard` is a positive integer and `soft`, if set, is a positive integer no greater than `hard`. At `soft` the child is nudged to finalize. After `hard`, configured tools are blocked; `block` defaults to `read`, `grep`, `find`, and `ls`, and accepts either a nonempty array of tool names or `"*"` for every tool call. Final assistant text is never blocked. |
111
+ | `options.usageBudget` | object | none | Optional root-only reported-usage budget `{ tokens?: { soft?, hard }, costUsd?: { soft?, hard } }`. Include at least one metric; each `hard` must be positive and each optional `soft` positive and no greater than its `hard`. Soft limits are status-only. Hard limits prevent later child launches after reported usage is reconciled; already-running children are not stopped and no reservations are made. |
112
+ | `options.extensionBindings` | object | none | Child-only plain JSON keyed by namespaces like `package.name/1` (positive version): at most 16 namespaces, nesting depth 16, 256 total object properties, and 16 KiB of canonical UTF-8 JSON. Native Pi launches only; external runners and retained resumes reject it. |
113
+ | `options.preflight` | object | none | Advisory lane hints for raw scripts (`workflow: true` or a script path) only; not accepted with named workflows or direct children. See [bounded workflows](workflows.md#opt-in-bounded-workflows). |
104
114
  | `cwd` | string | runtime cwd | Override working directory. With `machine`, the directory on that machine. |
105
- | `machine` | string | - | Herdr saved machine (label or profile id) for external-cli agents; see [agents.md](agents.md#running-external-cli-agents-on-a-herdr-saved-machine). |
106
- | `maxOutput` | object | none | Final output truncation limits `{ bytes?, lines? }`. For child runs it is only applied when set; there is no default cap on the inline path, so use `outputMode: "file-only"` for large outputs. For workflow script results, the Return, Emitted, and Console sections are always capped, at 200 KB / 5000 lines unless `maxOutput` sets other limits. |
107
- | `artifacts` | boolean | true | Write debug artifacts. |
108
- | `includeProgress` | boolean | false | Include full progress in result. |
109
- | `share` | boolean | false | Upload session export to GitHub Gist. |
110
- | `sessionDir` | string | derived | Override session log directory. |
111
- | `acceptance` | string/object/false | inferred | Configure evidence gates. See [Acceptance gates](#acceptance-gates). |
112
- | `gate` | string \| object | - | One host-run verification command, shorthand for `acceptance: { level: "verified", verify: [{ id: "gate", command }] }`. The object form `{ command, output?: "json", schema?, timeoutMs? }` adds a [typed gate](#typed-gates): with `output: "json"`, a passing command's stdout becomes the child's `structuredOutput`. Also valid on individual `runs.run`/`runs.all` items. Rejects `acceptance` except `false` (treated as omitted), rejects retained `resume`, and `output: "json"` rejects `outputSchema`. |
115
+ | `options.machine` | string | - | Herdr saved machine (label or profile id) for external-cli agents; see [agents.md](agents.md#running-external-cli-agents-on-a-herdr-saved-machine). |
116
+ | `options.maxOutput` | object | none | Final output truncation limits `{ bytes?, lines? }`. For child runs it is only applied when set; there is no default cap on the inline path, so use `outputMode: "file-only"` for large outputs. For workflow script results, the Return, Emitted, and Console sections are always capped, at 200 KB / 5000 lines unless `maxOutput` sets other limits. |
117
+ | `options.artifacts` | boolean | true | Write debug artifacts. |
118
+ | `options.includeProgress` | boolean | false | Include full progress in result. |
119
+ | `options.share` | boolean | false | Upload session export to GitHub Gist. |
120
+ | `options.sessionDir` | string | derived | Override session log directory. |
121
+ | `options.acceptance` | string/object/false | inferred | Configure evidence gates. See [Acceptance gates](#acceptance-gates). |
122
+ | `options.gate` | string \| object | - | One host-run verification command, shorthand for `acceptance: { level: "verified", verify: [{ id: "gate", command }] }`. The object form `{ command, output?: "json", schema?, timeoutMs? }` adds a [typed gate](#typed-gates): with `output: "json"`, a passing command's stdout becomes the child's `structuredOutput`. Also valid on individual `runs.run`/`runs.all` items. Rejects `acceptance` except `false` (treated as omitted), rejects retained `resume`, and `output: "json"` rejects `outputSchema`. |
113
123
 
114
124
  ### Budget guidance for writers
115
125
 
@@ -181,20 +191,20 @@ For a simple implementation challenge outside a workflow script, send the challe
181
191
 
182
192
  ### Guide
183
193
 
184
- `{ action: "guide" }` reads the packaged `README.md` from the installed version. Pass `topic` to read its packaged `docs/<topic>.md` file instead; see the `topic` parameter table for valid values. The `council` topic returns the packaged `skills/council-mode/SKILL.md` with the references it asks for, so `/council` works when Pi runs with `--no-skills`. Unknown topics list the valid values and do not change files. Use `/subagents-guide [topic]` for the slash equivalent.
194
+ `{ action: "guide" }` reads the packaged `README.md` from the installed version. Pass a docs topic to get the intro of its packaged `docs/<topic>.md` and a table of section addresses, then pass `topic: "<topic>/<section>"` (for example `"tool-reference/acceptance-gates"`) to read one section. A section runs from its heading to the next heading at the same or a higher level, and no response is longer than 8,000 characters: a larger section returns its intro and its subsection addresses. The `council` topic returns the packaged `skills/council-mode/SKILL.md` with the references it asks for, so `/council` works when Pi runs with `--no-skills`. Unknown topics list the valid values, unknown sections list the topic's table of contents, and neither changes files. Use `/subagents-guide [topic]` for the slash equivalent.
185
195
 
186
196
  Agent definitions are not loaded into context by default. Management actions let the LLM discover, inspect, create, update, and delete agents at runtime. An unknown action returns safe next steps (`status` and `list`) and may suggest a close non-destructive action. Destructive actions are only named for a near-complete one-character typo, and suggestions never execute an action.
187
197
 
188
198
  ```ts
189
199
  { action: "list" }
190
- { action: "list", agentScope: "project" }
191
- { action: "list", capabilities: true }
200
+ { action: "list", options: { agentScope: "project" } }
201
+ { action: "list", options: { capabilities: true } }
192
202
  { action: "get", agent: "scout" }
193
203
  { action: "models" }
194
204
  { action: "models", agent: "reviewer" }
195
205
  { action: "get", agent: "code-analysis.scout" }
196
206
 
197
- { action: "create", config: {
207
+ { action: "create", options: { config: {
198
208
  name: "Code Scout",
199
209
  package: "code-analysis",
200
210
  description: "Scans codebases for patterns and issues",
@@ -214,24 +224,24 @@ Agent definitions are not loaded into context by default. Management actions let
214
224
  output: "context.md",
215
225
  reads: "shared-context.md",
216
226
  progress: true
217
- }}
227
+ }}}
218
228
 
219
229
 
220
- { action: "update", agent: "code-analysis.scout", config: { model: "openai/gpt-4o" } }
221
- { action: "update", agent: "code-analysis.scout", config: { acceptance: "" } } // clear the frontmatter default
222
- { action: "update", agent: "code-analysis.scout", config: { acceptanceRole: false } } // restore default lightweight attestation
230
+ { action: "update", agent: "code-analysis.scout", options: { config: { model: "openai/gpt-4o" } } }
231
+ { action: "update", agent: "code-analysis.scout", options: { config: { acceptance: "" } } } // clear the frontmatter default
232
+ { action: "update", agent: "code-analysis.scout", options: { config: { acceptanceRole: false } } } // restore default lightweight attestation
223
233
  { action: "delete", agent: "scout" }
224
234
 
225
235
  { action: "eject", agent: "reviewer" }
226
- { action: "eject", agent: "reviewer", agentScope: "project" }
236
+ { action: "eject", agent: "reviewer", options: { agentScope: "project" } }
227
237
  { action: "disable", agent: "reviewer" }
228
- { action: "enable", agent: "reviewer", agentScope: "project" }
238
+ { action: "enable", agent: "reviewer", options: { agentScope: "project" } }
229
239
  { action: "reset", agent: "reviewer" }
230
240
  ```
231
241
 
232
242
  Rules:
233
243
 
234
- - `capabilities: true` changes `action: "list"` to compact one-line rows and adds `details.agentCapabilities: { agents, restrictedCount, capabilityCeilingSources? }`. Each agent row includes source, aliases, runner type/capabilities, tools, MCP direct tools, mutation tools, model/thinking, default async/timeout, declared acceptance policy/role, output path/mode, skills/extensions, and whether the current capability ceiling allows execution. External CLI rows include `runner.command`, `runner.available`, and a bounded `runner.unavailableReason` when passive PATH/PATHEXT/X_OK lookup cannot find the command. It never includes an agent's system prompt. Rows show declared/default capabilities and command discoverability, not authentication, version compatibility, or successful launch; launch preflight remains authoritative.
244
+ - `options.capabilities: true` changes `action: "list"` to compact one-line rows and adds `details.agentCapabilities: { agents, restrictedCount, capabilityCeilingSources? }`. Each agent row includes source, aliases, runner type/capabilities, tools, MCP direct tools, mutation tools, model/thinking, default async/timeout, declared acceptance policy/role, output path/mode, skills/extensions, and whether the current capability ceiling allows execution. External CLI rows include `runner.command`, `runner.available`, and a bounded `runner.unavailableReason` when passive PATH/PATHEXT/X_OK lookup cannot find the command. It never includes an agent's system prompt. Rows show declared/default capabilities and command discoverability, not authentication, version compatibility, or successful launch; launch preflight remains authoritative.
235
245
  - `create` uses `config.scope`, not `agentScope`.
236
246
  - `config.name` is the local frontmatter name; optional `config.package` registers the runtime name as `{package}.{name}` and is saved as separate `name` and `package` frontmatter.
237
247
  - `config.aliases` accepts a comma-separated string, string array, or `false` to clear aliases. Aliases resolve to the canonical agent name for execution and are shown by `list`/`get`.
@@ -255,29 +265,33 @@ Lane evidence actions update an existing parallel handoff manifest at an explici
255
265
  ```ts
256
266
  subagent({
257
267
  action: "lane.recordMerge",
258
- laneId: "<manifest-run-id>",
259
- handoffPath: "/path/to/handoff.json",
260
- merge: {
261
- prNumber: 123,
262
- reviewedHead: "<40-character-sha>",
263
- mergeCommit: "<40-character-sha>",
264
- treeEquivalent: true,
265
- postMergeChecks: "recorded",
266
- attestedBy: "operator",
267
- attestedAt: "2026-08-27T16:23:00.000Z"
268
+ options: {
269
+ laneId: "<manifest-run-id>",
270
+ handoffPath: "/path/to/handoff.json",
271
+ merge: {
272
+ prNumber: 123,
273
+ reviewedHead: "<40-character-sha>",
274
+ mergeCommit: "<40-character-sha>",
275
+ treeEquivalent: true,
276
+ postMergeChecks: "recorded",
277
+ attestedBy: "operator",
278
+ attestedAt: "2026-08-27T16:23:00.000Z"
279
+ }
268
280
  }
269
281
  })
270
282
  subagent({
271
283
  action: "lane.recordSupersession",
272
- laneId: "<manifest-run-id>",
273
- handoffPath: "/path/to/handoff.json",
274
- supersession: {
275
- supersededBy: "<replacement-lane-id>",
276
- attestedBy: "operator",
277
- attestedAt: "2026-08-27T16:23:00.000Z"
284
+ options: {
285
+ laneId: "<manifest-run-id>",
286
+ handoffPath: "/path/to/handoff.json",
287
+ supersession: {
288
+ supersededBy: "<replacement-lane-id>",
289
+ attestedBy: "operator",
290
+ attestedAt: "2026-08-27T16:23:00.000Z"
291
+ }
278
292
  }
279
293
  })
280
- subagent({ action: "lane.status", laneId: "<manifest-run-id>", handoffPath: "/path/to/handoff.json" })
294
+ subagent({ action: "lane.status", options: { laneId: "<manifest-run-id>", handoffPath: "/path/to/handoff.json" } })
281
295
  ```
282
296
 
283
297
  The manifest stores one of these fail-closed eligibility states: `active` (an owning child is still running), `terminal-eligible` (complete merge evidence and recorded post-merge checks), `terminal-blocked` with a reason, `superseded-eligible` (an explicit replacement attestation), or `unknown` (missing or malformed evidence/manifest). Each attestation stores a digest of the manifest facts it covered; later group, worktree, or patch changes downgrade that evidence to `terminal-blocked` until it is recorded again. A terminal update recomputes a previously stored `active` state from the current child statuses and evidence. Conflicting reviewed heads and mismatched lane ids are rejected as stale. Existing workflow receipts remain immutable.
@@ -294,19 +308,19 @@ For backlog lanes and other subagent-governed workflows, external/foreground/CLI
294
308
 
295
309
  ```ts
296
310
  subagent({ action: "status" })
297
- subagent({ action: "status", view: "fleet" })
311
+ subagent({ action: "status", options: { view: "fleet" } })
298
312
  subagent({ action: "status", id: "<run-id>" })
299
- subagent({ action: "status", id: "<run-id>", view: "transcript", index: 0, lines: 80 })
313
+ subagent({ action: "status", id: "<run-id>", options: { view: "transcript", index: 0, lines: 80 } })
300
314
  subagent({ action: "status", id: "<nested-run-id>" })
301
315
  subagent({ action: "interrupt", id: "<run-id>" })
302
316
  subagent({ action: "interrupt", id: "<nested-run-id>" })
303
317
  subagent({ action: "stop", id: "<run-id>" })
304
318
  subagent({ action: "resume", id: "<run-id>", message: "follow-up question after it pauses or finishes" })
305
- subagent({ action: "resume", id: "<run-id>", index: 1, message: "follow-up for child 2" })
319
+ subagent({ action: "resume", id: "<run-id>", message: "follow-up for child 2", options: { index: 1 } })
306
320
  subagent({ action: "resume", id: "<nested-run-id>", message: "follow-up for a nested child" })
307
321
  subagent({ action: "steer", id: "<run-id>", message: "guidance for the running child" })
308
- subagent({ action: "steer", id: "<run-id>", mode: "follow_up", message: "check this after the current turn" })
309
- subagent({ action: "steer", id: "<run-id>", index: 1, mode: "auto", message: "guidance for child 2" })
322
+ subagent({ action: "steer", id: "<run-id>", message: "check this after the current turn", options: { mode: "follow_up" } })
323
+ subagent({ action: "steer", id: "<run-id>", message: "guidance for child 2", options: { index: 1, mode: "auto" } })
310
324
  subagent({ action: "doctor" })
311
325
  ```
312
326
 
@@ -325,10 +339,10 @@ subagent({ action: "doctor" })
325
339
  Command controls target direct local native Pi children that explicitly select both `bash` and `subagent_command`, in foreground or async runs. They require the owning parent session, a run `id`, an explicit `index` for multi-child runs, and the exact `toolCallId` for mutations. Nested, external, and custom shell backends do not expose this controller. Custom bash extensions keep their own registered `subagent_command` tool. If a custom bash backend does not provide that tool, an explicitly required `subagent_command` remains available and reports an unsupported-backend error. Native supervisor command controls are unavailable for custom backends.
326
340
 
327
341
  ```ts
328
- subagent({ action: "command.status", id: "<run-id>", index: 0 })
329
- subagent({ action: "command.yield", id: "<run-id>", index: 0, toolCallId: "<call-id>" })
330
- subagent({ action: "command.cancel", id: "<run-id>", index: 0, toolCallId: "<call-id>" })
331
- subagent({ action: "command.status", id: "<run-id>", index: 0, toolCallId: "<call-id>" })
342
+ subagent({ action: "command.status", id: "<run-id>", options: { index: 0 } })
343
+ subagent({ action: "command.yield", id: "<run-id>", options: { index: 0, toolCallId: "<call-id>" } })
344
+ subagent({ action: "command.cancel", id: "<run-id>", options: { index: 0, toolCallId: "<call-id>" } })
345
+ subagent({ action: "command.status", id: "<run-id>", options: { index: 0, toolCallId: "<call-id>" } })
332
346
  ```
333
347
 
334
348
  `command.yield` releases the selected blocking tool call without restarting the process. `command.cancel` aborts only that command through Pi's native bash cancellation; the child receives a tool error and can continue. `cancel_requested` acknowledges the request, while `cancelled` confirms the backend settled. A stale id never targets a later command. Run-scoped `interrupt` remains separate.
@@ -391,15 +405,19 @@ Prefer an inline JSON object. JSON-encoded object strings are tolerated only dur
391
405
  {
392
406
  agent: "worker",
393
407
  task: "Implement the fix",
394
- acceptance: {
395
- level: "verified",
396
- criteria: ["Patch the bug without widening scope"],
397
- evidence: ["changed-files", "tests-added", "commands-run", "residual-risks", "no-staged-files"],
398
- verify: [{ id: "focused", command: "npm test", timeoutMs: 120000 }]
408
+ options: {
409
+ acceptance: {
410
+ level: "verified",
411
+ criteria: ["Patch the bug without widening scope"],
412
+ evidence: ["changed-files", "tests-added", "commands-run", "residual-risks", "no-staged-files"],
413
+ verify: [{ id: "focused", command: "npm test", timeoutMs: 120000 }]
414
+ }
399
415
  }
400
416
  }
401
417
  ```
402
418
 
419
+ A direct tool call passes `acceptance` inside `options`; a workflow `runs.run` item passes it as a plain field.
420
+
403
421
  ### One-command gates
404
422
 
405
423
  When one host-run command is the entire verification contract, use the `gate` shorthand instead of a full `acceptance` object:
@@ -519,7 +537,7 @@ return runs.run("main", { agent: "scout", task: "..." });
519
537
  ```
520
538
 
521
539
  ```js
522
- subagent({ workflow: true, share: true });
540
+ subagent({ workflow: true, options: { share: true } });
523
541
  ```
524
542
 
525
543
  This is disabled by default. Session data may contain source code, paths, environment variables, credentials, or other sensitive output. You need `gh` installed and authenticated.
@@ -529,8 +547,8 @@ This is disabled by default. Session data may contain source code, paths, enviro
529
547
  `worktree.cleanup` first saves a plan without removing anything:
530
548
 
531
549
  ```ts
532
- subagent({ action: "worktree.cleanup", repo: "/path/to/repo", mode: "plan" })
533
- subagent({ action: "worktree.cleanup", repo: "/path/to/repo", mode: "apply", planId: "<reviewed-plan-id>" })
550
+ subagent({ action: "worktree.cleanup", options: { repo: "/path/to/repo", mode: "plan" } })
551
+ subagent({ action: "worktree.cleanup", options: { repo: "/path/to/repo", mode: "apply", planId: "<reviewed-plan-id>" } })
534
552
  ```
535
553
 
536
554
  Apply uses the existing `authorityPolicy.discardWorktree` (`confirm` by default). It checks the saved plan's repository, hash and 30-minute expiry, then rechecks only reviewed candidates under a repository lock shared with retained resume admission. Only a clean, contained, provably owned terminal worktree with durable evidence can be removed. Dirty or untracked files, ignored files, Git locks, active ownership, recorded native session dependencies, retained resume admission, changed heads and missing artifacts keep the tree. Every local branch is retained; apply never forces removal or prunes unrelated Git metadata.
package/docs/watchdog.md CHANGED
@@ -46,13 +46,15 @@ you ─▶ agent turn ─▶ edits repo ─▶ agent_end ─▶ watchdog review
46
46
  └─ warning: low/medium user entry, or high steered message
47
47
  ```
48
48
 
49
- Collapsed warnings show the title and evidence line. Expanded warnings show evidence, recommended action, importance, category, and source:
49
+ A warning shows as one `[subagent] watchdog concern` or `[subagent] watchdog blocker` line, like every other message pi-subagents shows in the chat. Pi's expand key, or a click on the line, opens it to the summary, evidence, recommended action, importance, category, and source:
50
50
 
51
51
  ```
52
- ● Subagent watchdog Blocker (displayed): Claims tests passed without running them
53
- Evidence: The transcript claims `npm test` passed but no test command appears in the tool log.
54
- Recommended action: Run the focused test before finishing.
55
- Importance: High · Category: Test Gap · Source: main
52
+ [subagent] watchdog blocker
53
+
54
+ Subagent watchdog Blocker (displayed): Claims tests passed without running them
55
+ Evidence: The transcript claims npm test passed but no test command appears in the tool log.
56
+ Recommended action: Run the focused test before finishing.
57
+ Importance: High · Category: Test Gap · Source: main
56
58
  ```
57
59
 
58
60
  When consecutive boundary reviews raise the same warning, the agent is not making progress. After `stalemateRepeats` identical warnings in a row (default 3), the warning is shown as `stalemate`, no continuation is triggered, and the turn ends. Your next prompt resets the count.
@@ -110,7 +112,7 @@ Omit `main.model` to inherit the session model and thinking level. A `main.model
110
112
 
111
113
  The watchdog resolves one reviewer model and makes one review call. Unavailable models fail visibly; rate limits, quota, authentication, provider timeouts, findings, clarification, cancellation, and the overall watchdog deadline never switch models automatically. An inherited model keeps the current session model and thinking level.
112
114
 
113
- Agents can call `subagent({ action: "watchdog.recommend-model" })` and `subagent({ action: "watchdog.configure", model: "recommended", scope: "session" | "user" | "project" })`. They should use `scope: "session"` unless you ask for a lasting default.
115
+ Agents can call `subagent({ action: "watchdog.recommend-model" })` and `subagent({ action: "watchdog.configure", model: "recommended", options: { scope: "session" | "user" | "project" } })`. They should use `options: { scope: "session" }` unless you ask for a lasting default.
114
116
 
115
117
  ## Optional main-session clarification
116
118
 
package/docs/workflows.md CHANGED
@@ -12,6 +12,8 @@ clarify → scout → worker → fresh reviewers → worker
12
12
 
13
13
  Packaged `worker` defaults to fresh context so implementation starts from its assigned brief instead of the parent's unfinished conversation. Packaged `oracle` and `advisor` default to forked context; if the parent has no persisted session file or current leaf yet, that implicit default falls back to `fresh`. Explicit `context`, `context: "profile"`, and global `defaultSubagentContext` still override these profile defaults.
14
14
 
15
+ Launch children in the background (`async` follows `asyncByDefault`, normally true) and consume each result at the point a later step depends on it. Native completion wakes the parent session, so the parent returns control instead of sleeping or polling. Use `async: false` only when the parent must block, not for final reviews or gates. When an oracle or advisor reaches an unknown that needs a decision, it asks through supervisor dialogue; use a one-shot oracle call only when one was requested.
16
+
15
17
  Child-safety boundaries are enforced at runtime:
16
18
 
17
19
  - Child sessions do not receive the bundled `pi-subagents` skill.
@@ -27,7 +29,7 @@ Stop and report the exact failure, run/status, and repository/cwd/worktree/branc
27
29
 
28
30
  Failed workflow details and async `status.json` include `workflow.failureKind` as `validation`, `script`, `child`, `return-serialization`, `timeout`, `detached-child`, or `runtime`. `validation` means the host rejected the script before it ran (syntax or portability) or at completion (unawaited calls); errors thrown into a running script, including rejected `runs.run` parameters and runtime `SyntaxError`s, are `script` because the script could catch them, and failed children are `child`. `runtime` covers host setup and infrastructure failures, such as an unavailable cwd or a crashed worker. A workflow that is stopped or reloaded is not a failure and has no `failureKind`.
29
31
 
30
- When `/reload`, a session resume, or a pi-web project switch replaces the extension runtime, a running async workflow stops with `workflow.stopCause: "runtime-replaced"` in `status.json`, and its awaited async children keep running. When the same workflow script is launched again with the same `args` in that session, a `runs.run` with the same key and params returns a child that already finished successfully without launching it, and waits for a child that is still running instead of starting another. Those results carry `reused: true`, their step and trace entry are marked `reused`, and the new run records `workflow.reusedFrom`. Failed and stopped children, and children that ran in-process, launch again. Reuse applies only when the newest run of that script and args in the session was stopped this way; a user stop or a completed run ends it.
32
+ When `/reload`, a session resume, or a pi-web project switch replaces the extension runtime, a running async workflow stops with `workflow.stopCause: "runtime-replaced"` in `status.json`, and its awaited async children keep running. Its in-process foreground children are stopped, including ones that detached to ask their supervisor. When the same workflow script is launched again with the same `args` in that session, a `runs.run` with the same key and params returns a child that already finished successfully without launching it, and waits for a child that is still running instead of starting another. Those results carry `reused: true`, their step and trace entry are marked `reused`, and the new run records `workflow.reusedFrom`. Failed and stopped children, and children that ran in-process, launch again. Reuse applies only when the newest run of that script and args in the session was stopped this way; a user stop or a completed run ends it.
31
33
 
32
34
  Pi core may print a generic `pi -ne` extension-load hint; that out-of-repo hint is not protocol-approved fallback. A verified compaction abort may continue the retained child once on its already resolved model; it does not authorize an execution-mode or model switch.
33
35
 
@@ -49,6 +51,8 @@ Add `autofix` to `/parallel-review` or `/parallel-cleanup` to apply only the syn
49
51
 
50
52
  Use direct `{ agent, task }` for one bounded child. Use a workflow script when the parent needs a stable keyed child, sequence, fanout, steering, retry, or aggregation. For ordinary parallel fanout, use `await runs.all([{ key, agent, task }, ...])`. It resolves to an ordered array, not a key map, so use indexes, destructuring, or `.map(...)`, not `results.<key>`. Do not read `.output` from unawaited `runs.run` launches. Store a `runs.run` promise only when the script later observes it with `await`, `Promise.race`, or `Promise.all`, such as steering a live child before awaiting its result. Scripts are ordinary JavaScript statement bodies. Use an explicit `return` for a useful result.
51
53
 
54
+ Use top-level `await`, plain helper functions, or Promise chains; nested async functions, async arrows, and async methods are rejected (see [opt-in bounded workflows](#opt-in-bounded-workflows)).
55
+
52
56
  The `workflow` field selects the script source:
53
57
 
54
58
  - `workflow: true` runs the one ```` ```js workflow ```` fenced block written in the same assistant reply as the `subagent` call. The script is plain text in the reply, so it needs no JSON string escaping. A reply can carry exactly one such block and one `workflow: true` call; zero or several blocks fail. A reply with no tagged block may instead carry exactly one plain ```` ```js ```` block, which then runs. A line containing only ```` ``` ```` (three or more backticks, optionally followed by spaces or tabs) ends the block, so keep Markdown fences inside quoted strings.
@@ -104,9 +108,12 @@ Use a named workflow resource when a permission or policy extension needs to dis
104
108
  ```js
105
109
  subagent({ workflow: "review", args: { task: "Review the change" } });
106
110
  subagent({ workflow: "run-ci", args: { command: "npm test" } });
111
+ subagent({ workflow: "parallel", args: { tasks: [{ agent: "reviewer", task: "Review src/api" }, { agent: "scout", task: "Map the tests" }] } });
107
112
  ```
108
113
 
109
- The host resolves the name and validates bounded plain-JSON `args` before starting the workflow. Resource provenance is recorded in workflow details and receipts for downstream permission/policy checks. Resource authority is not caller-supplied: `runs.host` is available only when the resolved resource explicitly grants the requested host key and command. Reply-block (`workflow: true`) and file-path scripts remain raw, unknown-provenance inputs, so their `runs.host` calls are unavailable through the public execution boundary. Named resources cannot be combined with `agent` or `task`; this first slice ships only the package-owned `review` and `run-ci` resources, not a user/project resource registry.
114
+ The host resolves the name and validates bounded plain-JSON `args` before starting the workflow. Resource provenance is recorded in workflow details and receipts for downstream permission/policy checks. Resource authority is not caller-supplied: `runs.host` is available only when the resolved resource explicitly grants the requested host key and command. Reply-block (`workflow: true`) and file-path scripts remain raw, unknown-provenance inputs, so their `runs.host` calls are unavailable through the public execution boundary. Named resources cannot be combined with `agent` or `task`; the package ships the `review`, `run-ci` and `parallel` resources, not a user/project resource registry.
115
+
116
+ `parallel` runs independent children together without writing a script: `args.tasks` is a list of `{ agent, task }` items, the children run in one `runs.all` batch, and the result lists each child's output in order. A failed child fails the workflow. Use a workflow script when steps depend on each other.
110
117
 
111
118
  ### Opt-in bounded workflows
112
119
 
@@ -120,9 +127,11 @@ return runs.run("review", { agent: "reviewer", task: "Review:\n" + scan.output }
120
127
  ```js
121
128
  subagent({
122
129
  workflow: true,
123
- timeoutMs: 900000,
124
- toolBudget: { soft: 40, hard: 60 },
125
- usageBudget: { tokens: { soft: 100000, hard: 150000 } }
130
+ options: {
131
+ timeoutMs: 900000,
132
+ toolBudget: { soft: 40, hard: 60 },
133
+ usageBudget: { tokens: { soft: 100000, hard: 150000 } }
134
+ }
126
135
  });
127
136
  ```
128
137
 
@@ -517,7 +526,7 @@ For A → B → C, C's request belongs to B, not A. B can escalate a separate qu
517
526
 
518
527
  Child-side routine completion handoffs are not expected. If a child appears stalled, needs-attention notices show up in the parent session with useful next actions, such as checking `subagent({ action: "status" })`, interrupting the run, or nudging the child.
519
528
 
520
- If a workflow script child detaches through `contact_supervisor`, the enclosing async workflow stays `paused` until that child exits. Then the extension reconciles it to `complete` or `failed`. Wait on the child until that happens.
529
+ If a workflow script child detaches through `contact_supervisor`, the enclosing async workflow stays `paused` until that child exits. Then the extension reconciles it to `complete` or `failed`. Wait on the child until that happens. A detached child that runs in-process (not as an async child) is stopped if the extension runtime is replaced before it finishes; `status` on its run id then shows it as stopped with the reason.
521
530
 
522
531
  If messages do not show up, run `/subagents-doctor`. Advanced users can tune the bridge with `intercomBridge` in [configuration.md](configuration.md).
523
532
 
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAUpE,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAExE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAWpE,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAMxE"}
package/index.js CHANGED
@@ -1,10 +1,15 @@
1
1
  import { HERDR_PI_MODE_ENV } from "./src/runs/shared/herdr-pi-protocol.js";
2
+ import { loadedPackageVersion, readInstalledPackageVersion } from "./src/shared/package-version.js";
2
3
  const registerExtension = process.env[HERDR_PI_MODE_ENV] === "1"
3
4
  ? (await import("./src/extension/herdr-pi-bridge.js")).default
4
5
  : process.env.PI_SUBAGENT_CHILD === "1"
5
6
  ? undefined
6
7
  : (await import("./src/extension/index.js")).default;
7
8
  export default function registerSubagentExtension(pi) {
9
+ const installedVersion = readInstalledPackageVersion();
10
+ if (installedVersion !== loadedPackageVersion) {
11
+ throw new Error(`pi-subagents ${installedVersion} is installed, but this Pi process still has ${loadedPackageVersion} loaded. Restart Pi to load the update; /reload cannot replace extension modules that Node has already loaded.`);
12
+ }
8
13
  registerExtension?.(pi);
9
14
  }
10
15
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,GAAG;IAC/D,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC,OAAO;IAC9D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,GAAG;QACvC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,OAAO,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAAgB;IACjE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEpG,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,GAAG;IAC/D,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC,OAAO;IAC9D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,GAAG;QACvC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,OAAO,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAAgB;IACjE,MAAM,gBAAgB,GAAG,2BAA2B,EAAE,CAAC;IACvD,IAAI,gBAAgB,KAAK,oBAAoB,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,gBAAgB,gBAAgB,gDAAgD,oBAAoB,gHAAgH,CAAC,CAAC;IACvO,CAAC;IACD,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "pi-subagents",
4
- "version": "0.76.0",
4
+ "version": "0.77.0",
5
5
  "description": "Pi extension for single-agent delegation and scripted multi-agent workflows",
6
6
  "author": "Nico Bailon",
7
7
  "license": "MIT",
@@ -51,6 +51,7 @@
51
51
  "pi-package",
52
52
  "pi",
53
53
  "pi-coding-agent",
54
+ "extension",
54
55
  "subagents",
55
56
  "ai",
56
57
  "agents",
@@ -9,7 +9,7 @@ decide which feedback is valid, and write the final memo. Advisors do not talk
9
9
  directly or see peer transcripts by default. This is not free-form agent chat.
10
10
 
11
11
  Before you orchestrate, load the council protocol with
12
- `subagent({ action: "guide", topic: "council" })`. If only `subagents_enable`
12
+ `subagent({ action: "guide", options: { topic: "council" } })`. If only `subagents_enable`
13
13
  is available, call it first; `subagent` is available on the next request. The
14
14
  guide returns the packaged council-mode skill and the references it asks you to
15
15
  read, so it also works when Pi runs with `--no-skills`.
@@ -87,7 +87,7 @@ that runner explicitly supports the option.
87
87
 
88
88
  ## Read the reference for the branch
89
89
 
90
- For exact API fields and worked examples, call `subagent({action:"guide",topic:"tool-reference"})` or `topic:"workflows"`. The compact tool definition is not the recipe catalog; use `topic:"missions"` for mission updates and schedules.
90
+ For exact API fields and worked examples, call `subagent({action:"guide",options:{topic:"tool-reference"}})` or `topic:"workflows"`. The compact tool definition is not the recipe catalog; use `topic:"missions"` for mission updates and schedules.
91
91
 
92
92
  | Branch | Read |
93
93
  | --- | --- |
@@ -64,7 +64,7 @@ its overhead. Recipes select a shape; they do not authorize delegation:
64
64
 
65
65
  ## Error Handling
66
66
 
67
- - **Unknown agent:** run `subagent({ action: "list" })`; check scope/precedence and author new orchestration as a workflow script, not legacy chains.
67
+ - **Unknown agent:** the error lists the available agents and the directories searched; check scope/precedence and author new orchestration as a workflow script, not legacy chains.
68
68
  - **Setup, discovery, or intercom confusion:** run `subagent({ action: "doctor" })`.
69
69
  - **Max subagent depth exceeded:** flatten the workflow or raise `maxSubagentDepth` in config.
70
70
  - **Missing session file for a fork:** persist the parent session before using `context: "fork"`.