@selesai/code 0.9.10 → 0.9.12

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 (862) hide show
  1. package/CHANGELOG.md +271 -255
  2. package/dist/cli/args.js +13 -2
  3. package/dist/cli/args.test.js +8 -0
  4. package/dist/cli/credential-print.js +4 -4
  5. package/dist/cli.js +0 -0
  6. package/dist/config.d.ts +4 -6
  7. package/dist/config.js +10 -14
  8. package/dist/core/agent-session-auto-handoff.test.js +24 -1
  9. package/dist/core/agent-session.d.ts +10 -4
  10. package/dist/core/agent-session.js +61 -46
  11. package/dist/core/compaction/branch-summarization.js +30 -30
  12. package/dist/core/compaction/compaction.js +81 -81
  13. package/dist/core/compaction/utils.js +2 -2
  14. package/dist/core/defaults.d.ts +1 -0
  15. package/dist/core/defaults.js +9 -0
  16. package/dist/core/export-html/template.css +1066 -1066
  17. package/dist/core/export-html/template.html +55 -55
  18. package/dist/core/export-html/template.js +1864 -1864
  19. package/dist/core/export-html/vendor/highlight.min.js +1212 -1212
  20. package/dist/core/export-html/vendor/marked.min.js +78 -78
  21. package/dist/core/extensions/loader.js +108 -35
  22. package/dist/core/extensions/loader.test.js +21 -0
  23. package/dist/core/extensions/types.d.ts +12 -4
  24. package/dist/core/keybindings.d.ts +2 -2
  25. package/dist/core/messages.js +7 -7
  26. package/dist/core/model-resolver.d.ts +1 -0
  27. package/dist/core/model-resolver.js +10 -4
  28. package/dist/core/package-manager.js +4 -4
  29. package/dist/core/sdk.d.ts +5 -5
  30. package/dist/core/sdk.js +16 -4
  31. package/dist/core/settings-manager.d.ts +6 -2
  32. package/dist/core/settings-manager.js +22 -3
  33. package/dist/core/tools/bash.d.ts +18 -1
  34. package/dist/core/tools/bash.js +41 -23
  35. package/dist/core/tools/index.d.ts +4 -2
  36. package/dist/core/tools/index.js +9 -2
  37. package/dist/core/tools/powershell.d.ts +15 -0
  38. package/dist/core/tools/powershell.js +38 -0
  39. package/dist/core/tools/powershell.test.d.ts +1 -0
  40. package/dist/core/tools/powershell.test.js +20 -0
  41. package/dist/defaults/settings.json +0 -1
  42. package/dist/extensions/context-compaction-reminder.test.ts +82 -82
  43. package/dist/extensions/context-compaction-reminder.ts +28 -28
  44. package/dist/extensions/model-prompt-injector/index.test.ts +0 -10
  45. package/dist/extensions/model-prompt-injector/index.ts +0 -3
  46. package/dist/extensions/pi-intercom/CHANGELOG.md +53 -16
  47. package/dist/extensions/pi-intercom/LICENSE +21 -21
  48. package/dist/extensions/pi-intercom/README.md +41 -8
  49. package/dist/extensions/pi-intercom/banner.png +0 -0
  50. package/dist/extensions/pi-intercom/broker/broker.ts +498 -215
  51. package/dist/extensions/pi-intercom/broker/client.test.ts +83 -83
  52. package/dist/extensions/pi-intercom/broker/client.ts +39 -12
  53. package/dist/extensions/pi-intercom/broker/extension.test.ts +486 -387
  54. package/dist/extensions/pi-intercom/broker/framing.test.ts +114 -114
  55. package/dist/extensions/pi-intercom/broker/paths.test.ts +153 -153
  56. package/dist/extensions/pi-intercom/broker/paths.ts +134 -134
  57. package/dist/extensions/pi-intercom/broker/protocol.ts +26 -0
  58. package/dist/extensions/pi-intercom/broker/runtime-claim.test.ts +34 -34
  59. package/dist/extensions/pi-intercom/broker/runtime-claim.ts +21 -21
  60. package/dist/extensions/pi-intercom/broker/spawn.test.ts +5 -20
  61. package/dist/extensions/pi-intercom/config.test.ts +41 -0
  62. package/dist/extensions/pi-intercom/config.ts +21 -0
  63. package/dist/extensions/pi-intercom/cwd.test.ts +40 -40
  64. package/dist/extensions/pi-intercom/cwd.ts +31 -31
  65. package/dist/extensions/pi-intercom/extension-api.ts +84 -44
  66. package/dist/extensions/pi-intercom/format-context.test.ts +31 -31
  67. package/dist/extensions/pi-intercom/format-context.ts +32 -32
  68. package/dist/extensions/pi-intercom/index.ts +362 -26
  69. package/dist/extensions/pi-intercom/intercom.integration.test.ts +819 -13
  70. package/dist/extensions/pi-intercom/package.json +1 -1
  71. package/dist/extensions/pi-intercom/project-agent.ts +2 -2
  72. package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +8 -110
  73. package/dist/extensions/pi-intercom/test/overlay-width.test.ts +66 -66
  74. package/dist/extensions/pi-intercom/types.ts +32 -5
  75. package/dist/extensions/pi-intercom/ui/compose.ts +143 -143
  76. package/dist/extensions/pi-intercom/ui/inline-message.ts +6 -0
  77. package/dist/extensions/pi-intercom/ui/session-list.ts +166 -166
  78. package/dist/extensions/pi-powerline-footer/bash-mode/shell-session.ts +286 -286
  79. package/dist/extensions/pi-powerline-footer/bash-mode/transcript.ts +108 -108
  80. package/dist/extensions/pi-powerline-footer/separators.ts +57 -57
  81. package/dist/extensions/pi-powerline-footer/tests/session-usage.test.ts +47 -47
  82. package/dist/extensions/pi-powerline-footer/tests/tps.test.ts +39 -39
  83. package/dist/extensions/pi-powerline-footer/theme.example.json +24 -24
  84. package/dist/extensions/pi-powerline-footer/theme.json +12 -12
  85. package/dist/extensions/pi-powerline-footer/tps.ts +345 -345
  86. package/dist/extensions/pi-rewind-hook/README.md +245 -245
  87. package/dist/extensions/pi-rewind-hook/index.ts +1445 -1445
  88. package/dist/extensions/pi-rewind-hook/package.json +29 -29
  89. package/dist/extensions/pi-subagents/.github/assets/subagent-fleet-inspector.png +0 -0
  90. package/dist/extensions/pi-subagents/.github/workflows/release.yml +28 -0
  91. package/dist/extensions/pi-subagents/.github/workflows/test.yml +51 -0
  92. package/dist/extensions/pi-subagents/.greptile/config.json +33 -0
  93. package/dist/extensions/pi-subagents/.greptile/files.json +8 -0
  94. package/dist/extensions/pi-subagents/.greptile/rules.md +16 -0
  95. package/dist/extensions/pi-subagents/CHANGELOG.md +309 -87
  96. package/dist/extensions/pi-subagents/README.md +15 -17
  97. package/dist/extensions/pi-subagents/agents/oracle.md +3 -1
  98. package/dist/extensions/pi-subagents/agents/researcher.md +32 -13
  99. package/dist/extensions/pi-subagents/agents/reviewer.md +13 -2
  100. package/dist/extensions/pi-subagents/agents/scout.md +2 -2
  101. package/dist/extensions/pi-subagents/agents/worker.md +2 -1
  102. package/dist/extensions/pi-subagents/async-retention-discovery-worker.mjs +180 -0
  103. package/dist/extensions/pi-subagents/docs/configuration.md +106 -27
  104. package/dist/extensions/pi-subagents/docs/extension-api.md +85 -21
  105. package/dist/extensions/pi-subagents/docs/missions.md +41 -4
  106. package/dist/extensions/pi-subagents/docs/models.md +52 -9
  107. package/dist/extensions/pi-subagents/docs/observability.md +103 -16
  108. package/dist/extensions/pi-subagents/docs/tool-reference.md +60 -45
  109. package/dist/extensions/pi-subagents/docs/watchdog.md +60 -3
  110. package/dist/extensions/pi-subagents/docs/workflows.md +181 -7
  111. package/dist/extensions/pi-subagents/index.ts +10 -1
  112. package/dist/extensions/pi-subagents/install.mjs +4 -4
  113. package/dist/extensions/pi-subagents/package-lock.json +1483 -1470
  114. package/dist/extensions/pi-subagents/package.json +6 -3
  115. package/dist/extensions/pi-subagents/prompts/council.md +60 -0
  116. package/dist/extensions/pi-subagents/prompts/parallel-review.md +5 -1
  117. package/dist/extensions/pi-subagents/prompts/review-loop.md +9 -5
  118. package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +254 -0
  119. package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +18 -17
  120. package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
  121. package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +107 -140
  122. package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
  123. package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
  124. package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +44 -92
  125. package/dist/extensions/pi-subagents/src/agents/agent-management.ts +261 -368
  126. package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +6 -2
  127. package/dist/extensions/pi-subagents/src/agents/agents.ts +388 -85
  128. package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +14 -0
  129. package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +418 -0
  130. package/dist/extensions/pi-subagents/src/agents/skills.ts +1 -1
  131. package/dist/extensions/pi-subagents/src/api/agents.ts +7 -0
  132. package/dist/extensions/pi-subagents/src/api/external-job-provider.ts +195 -0
  133. package/dist/extensions/pi-subagents/src/api/preflight.ts +88 -27
  134. package/dist/extensions/pi-subagents/src/api/project-panes.ts +2 -0
  135. package/dist/extensions/pi-subagents/src/api/shared-types.ts +2 -0
  136. package/dist/extensions/pi-subagents/src/extension/config.ts +20 -11
  137. package/dist/extensions/pi-subagents/src/extension/doctor.ts +14 -6
  138. package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +5 -4
  139. package/dist/extensions/pi-subagents/src/extension/index.ts +270 -187
  140. package/dist/extensions/pi-subagents/src/extension/public-execution.ts +65 -28
  141. package/dist/extensions/pi-subagents/src/extension/rpc.ts +120 -11
  142. package/dist/extensions/pi-subagents/src/extension/schemas.ts +46 -64
  143. package/dist/extensions/pi-subagents/src/extension/tool-description.ts +51 -37
  144. package/dist/extensions/pi-subagents/src/extension/tool-result.ts +19 -0
  145. package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +2 -2
  146. package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +3 -3
  147. package/dist/extensions/pi-subagents/src/inspectors/herdr/focus.ts +55 -0
  148. package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +2 -1
  149. package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +230 -46
  150. package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +26 -4
  151. package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +32 -10
  152. package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +6 -1
  153. package/dist/extensions/pi-subagents/src/missions/store.ts +4 -9
  154. package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +2 -2
  155. package/dist/extensions/pi-subagents/src/policy/authority.ts +2 -0
  156. package/dist/extensions/pi-subagents/src/profiles/profiles.ts +3 -1
  157. package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +31 -8
  158. package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +210 -52
  159. package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +63 -33
  160. package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +71 -17
  161. package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +886 -0
  162. package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +14 -5
  163. package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +49 -56
  164. package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +1 -0
  165. package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -33
  166. package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +5 -0
  167. package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +5 -1
  168. package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +22 -12
  169. package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +105 -71
  170. package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +68 -19
  171. package/dist/extensions/pi-subagents/src/runs/background/index-segment.ts +59 -0
  172. package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +443 -0
  173. package/dist/extensions/pi-subagents/src/runs/background/notify.ts +94 -10
  174. package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +158 -90
  175. package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +141 -53
  176. package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +8 -5
  177. package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +14 -4
  178. package/dist/extensions/pi-subagents/src/runs/background/run-id-query.ts +7 -0
  179. package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +13 -14
  180. package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +46 -25
  181. package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +823 -0
  182. package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +9 -3
  183. package/dist/extensions/pi-subagents/src/runs/background/steering.ts +11 -1
  184. package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +594 -216
  185. package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +17 -13
  186. package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +138 -0
  187. package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +23 -4
  188. package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +82 -4
  189. package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +5 -3
  190. package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +21 -14
  191. package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +23 -2
  192. package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +153 -58
  193. package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +7 -9
  194. package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1283 -1657
  195. package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +274 -0
  196. package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +6 -5
  197. package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +59 -10
  198. package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +1 -1
  199. package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +1 -3
  200. package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +36 -0
  201. package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +52 -2
  202. package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
  203. package/dist/extensions/pi-subagents/src/runs/shared/extension-bindings.ts +78 -0
  204. package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +2 -0
  205. package/dist/extensions/pi-subagents/src/runs/shared/external-job-bridge.ts +460 -0
  206. package/dist/extensions/pi-subagents/src/runs/shared/external-job-runner.ts +389 -0
  207. package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +10 -0
  208. package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +14 -0
  209. package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +243 -0
  210. package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +201 -85
  211. package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +106 -39
  212. package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +145 -0
  213. package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +150 -27
  214. package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +46 -4
  215. package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +19 -15
  216. package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +5 -1
  217. package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +86 -2
  218. package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +9 -9
  219. package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +0 -6
  220. package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +18 -4
  221. package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +51 -7
  222. package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +62 -21
  223. package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +1 -3
  224. package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +1 -3
  225. package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +1 -23
  226. package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +14 -2
  227. package/dist/extensions/pi-subagents/src/shared/artifacts.ts +2 -2
  228. package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +22 -2
  229. package/dist/extensions/pi-subagents/src/shared/capacity-resilient-json.ts +102 -0
  230. package/dist/extensions/pi-subagents/src/shared/completion-owner.ts +14 -0
  231. package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +49 -1
  232. package/dist/extensions/pi-subagents/src/shared/fork-context.ts +59 -1
  233. package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +12 -5
  234. package/dist/extensions/pi-subagents/src/shared/model-info.ts +20 -0
  235. package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +0 -40
  236. package/dist/extensions/pi-subagents/src/shared/settings.ts +11 -30
  237. package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +52 -0
  238. package/dist/extensions/pi-subagents/src/shared/types.ts +228 -49
  239. package/dist/extensions/pi-subagents/src/shared/utils.ts +11 -3
  240. package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +10 -0
  241. package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +0 -162
  242. package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +2 -5
  243. package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +105 -13
  244. package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +6 -36
  245. package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +829 -0
  246. package/dist/extensions/pi-subagents/src/tui/fleet.ts +1415 -0
  247. package/dist/extensions/pi-subagents/src/tui/render.ts +78 -7
  248. package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
  249. package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +1 -0
  250. package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +59 -51
  251. package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +8 -2
  252. package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +2 -1
  253. package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +4 -4
  254. package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +471 -86
  255. package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +140 -0
  256. package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +2 -2
  257. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +3 -0
  258. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +2 -0
  259. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +17 -0
  260. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +57 -0
  261. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +16 -0
  262. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +15 -0
  263. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +18 -0
  264. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +9 -0
  265. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +10 -0
  266. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +10 -0
  267. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +20 -0
  268. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +3 -0
  269. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +96 -0
  270. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +119 -0
  271. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +85 -0
  272. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +620 -0
  273. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +5 -0
  274. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +56 -0
  275. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +32 -0
  276. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +49 -0
  277. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +93 -0
  278. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +128 -0
  279. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +7 -0
  280. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +38 -0
  281. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +3 -0
  282. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +15 -0
  283. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +9 -0
  284. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +29 -0
  285. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +2 -0
  286. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +22 -0
  287. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +37 -0
  288. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +34 -0
  289. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +12 -0
  290. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +23 -0
  291. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +171 -0
  292. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +1261 -0
  293. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +20 -0
  294. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +54 -0
  295. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +22 -0
  296. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +13 -0
  297. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +358 -0
  298. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +77 -0
  299. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +512 -0
  300. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +43 -0
  301. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +121 -0
  302. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +82 -0
  303. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +17 -0
  304. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +7 -0
  305. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +210 -0
  306. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +15 -0
  307. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +54 -0
  308. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +4 -0
  309. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +55 -0
  310. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +2 -0
  311. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +5 -0
  312. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +30 -0
  313. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +206 -0
  314. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +15 -0
  315. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +106 -0
  316. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +19 -0
  317. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +356 -0
  318. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +297 -0
  319. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +60 -0
  320. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +15 -0
  321. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +18 -0
  322. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +28 -0
  323. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +3 -0
  324. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +10 -0
  325. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +68 -0
  326. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +106 -0
  327. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +51 -0
  328. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +6 -0
  329. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +35 -0
  330. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +37 -0
  331. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +40 -0
  332. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +37 -0
  333. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +52 -0
  334. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +10 -0
  335. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +35 -0
  336. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +24 -0
  337. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
  338. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +70 -0
  339. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +26 -0
  340. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +36 -0
  341. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +19 -0
  342. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +3 -0
  343. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +61 -0
  344. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +23 -0
  345. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +3 -0
  346. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +10 -0
  347. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +42 -0
  348. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +35 -0
  349. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +12 -0
  350. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +33 -0
  351. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +9 -0
  352. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +34 -0
  353. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +22 -0
  354. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +34 -0
  355. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  356. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  357. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  358. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +102 -0
  359. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  360. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  361. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +19 -0
  362. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +20 -0
  363. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  364. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +12 -0
  365. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  366. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
  367. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +22 -0
  368. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +23 -0
  369. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +26 -0
  370. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
  371. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +32 -0
  372. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +34 -0
  373. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
  374. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +52 -0
  375. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +54 -0
  376. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
  377. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
  378. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  379. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +95 -0
  380. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +77 -0
  381. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  382. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  383. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +28 -0
  384. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  385. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  386. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +63 -0
  387. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +94 -0
  388. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  389. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  390. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +14 -0
  391. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  392. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +394 -0
  393. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +12 -0
  394. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
  395. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +120 -0
  396. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +28 -0
  397. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +17 -0
  398. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +246 -0
  399. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +20 -0
  400. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +457 -0
  401. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +8 -0
  402. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +3 -0
  403. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +2 -0
  404. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +22 -0
  405. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +18 -0
  406. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +11 -0
  407. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +11 -0
  408. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +4 -0
  409. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +4 -0
  410. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +5 -0
  411. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +8 -0
  412. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +5 -0
  413. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +26 -0
  414. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +7 -0
  415. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +10 -0
  416. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +18 -0
  417. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +30 -0
  418. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +2 -0
  419. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +16 -0
  420. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +3 -0
  421. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +3 -0
  422. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +9 -0
  423. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +31 -0
  424. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +21 -0
  425. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +2 -0
  426. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +31 -0
  427. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +5 -0
  428. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +12 -0
  429. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +3 -0
  430. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +15 -0
  431. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +3 -0
  432. package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +1 -1
  433. package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +0 -54
  434. package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +1053 -414
  435. package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +194 -4
  436. package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +59 -4
  437. package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +0 -77
  438. package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +107 -6
  439. package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +211 -897
  440. package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +265 -375
  441. package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +77 -7
  442. package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +1 -1
  443. package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +10 -10
  444. package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +547 -30
  445. package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +2112 -310
  446. package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +274 -34
  447. package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +1 -1
  448. package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +20 -3
  449. package/dist/extensions/pi-subagents/test/support/isolated-temp-root.mjs +9 -0
  450. package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +30 -5
  451. package/dist/extensions/pi-subagents/test/support/mock-pi.ts +2 -0
  452. package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -2
  453. package/dist/extensions/pi-subagents/test/support/register-loader.mjs +1 -0
  454. package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +197 -0
  455. package/dist/extensions/pi-subagents/test/unit/agent-contract.test.ts +14 -0
  456. package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
  457. package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +204 -27
  458. package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +444 -145
  459. package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +256 -4
  460. package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +9 -7
  461. package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +152 -22
  462. package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +29 -0
  463. package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +205 -23
  464. package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +579 -0
  465. package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +24 -0
  466. package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +1 -0
  467. package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +3 -3
  468. package/dist/extensions/pi-subagents/test/unit/capacity-resilient-json.test.ts +155 -0
  469. package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +2 -2
  470. package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +7 -0
  471. package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +123 -0
  472. package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +81 -3
  473. package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +109 -7
  474. package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +2 -2
  475. package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +5 -2
  476. package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +3 -2
  477. package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +79 -0
  478. package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +22 -0
  479. package/dist/extensions/pi-subagents/test/unit/external-job-runner.test.ts +961 -0
  480. package/dist/extensions/pi-subagents/test/unit/file-system-retry.test.ts +64 -0
  481. package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +1110 -0
  482. package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +1664 -0
  483. package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +81 -1
  484. package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +138 -11
  485. package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +41 -2
  486. package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +210 -79
  487. package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +95 -0
  488. package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +596 -0
  489. package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +10 -1
  490. package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +3 -5
  491. package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +167 -0
  492. package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +319 -18
  493. package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +78 -0
  494. package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +19 -5
  495. package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +44 -0
  496. package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +129 -0
  497. package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +231 -2
  498. package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +28 -1
  499. package/dist/extensions/pi-subagents/test/unit/notify.test.ts +106 -2
  500. package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +204 -7
  501. package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +59 -4
  502. package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +2 -6
  503. package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +34 -2
  504. package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +116 -6
  505. package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +12 -3
  506. package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +56 -61
  507. package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +416 -1
  508. package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +9 -2
  509. package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +42 -0
  510. package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +21 -30
  511. package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +86 -11
  512. package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +49 -1
  513. package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +233 -5
  514. package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +28 -5
  515. package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +323 -20
  516. package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +66 -10
  517. package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +68 -5
  518. package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +174 -0
  519. package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +679 -0
  520. package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
  521. package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +55 -44
  522. package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +399 -84
  523. package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +13 -0
  524. package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +1 -1
  525. package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +15 -10
  526. package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +11 -7
  527. package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +2 -0
  528. package/dist/extensions/pi-subagents/test/unit/steering.test.ts +40 -1
  529. package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +10 -2
  530. package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +38 -3
  531. package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +110 -12
  532. package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +204 -19
  533. package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +25 -0
  534. package/dist/extensions/pi-subagents/test/unit/thinking-ceiling.test.ts +73 -0
  535. package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +90 -50
  536. package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +1 -2
  537. package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +234 -7
  538. package/dist/extensions/pi-subagents/test/unit/watch-strategy.test.ts +24 -0
  539. package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +36 -0
  540. package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +37 -9
  541. package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +302 -0
  542. package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +167 -7
  543. package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +113 -0
  544. package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +6 -6
  545. package/dist/extensions/pi-web-agent/package.json +31 -31
  546. package/dist/extensions/pi-web-agent/src/backends/config.ts +205 -205
  547. package/dist/extensions/pi-web-agent/src/backends/doctor.ts +136 -136
  548. package/dist/extensions/pi-web-agent/src/backends/factory.ts +152 -152
  549. package/dist/extensions/pi-web-agent/src/backends/settings-reader.ts +25 -25
  550. package/dist/extensions/pi-web-agent/src/cache/ttl-cache.ts +28 -28
  551. package/dist/extensions/pi-web-agent/src/changelog-notice.ts +136 -136
  552. package/dist/extensions/pi-web-agent/src/commands/web-agent-config.ts +946 -946
  553. package/dist/extensions/pi-web-agent/src/extension.ts +126 -126
  554. package/dist/extensions/pi-web-agent/src/extract/readability.ts +118 -118
  555. package/dist/extensions/pi-web-agent/src/fetch/browser-resolution.ts +199 -199
  556. package/dist/extensions/pi-web-agent/src/fetch/firecrawl-fetch.ts +100 -100
  557. package/dist/extensions/pi-web-agent/src/fetch/headless-fetch.ts +117 -117
  558. package/dist/extensions/pi-web-agent/src/fetch/http-fetch.ts +67 -67
  559. package/dist/extensions/pi-web-agent/src/orchestration/answer-synthesizer.ts +60 -60
  560. package/dist/extensions/pi-web-agent/src/orchestration/candidate-selector.ts +50 -50
  561. package/dist/extensions/pi-web-agent/src/orchestration/direct-url.ts +52 -52
  562. package/dist/extensions/pi-web-agent/src/orchestration/evidence-quality.ts +105 -105
  563. package/dist/extensions/pi-web-agent/src/orchestration/evidence-ranker.ts +45 -45
  564. package/dist/extensions/pi-web-agent/src/orchestration/index.ts +28 -28
  565. package/dist/extensions/pi-web-agent/src/orchestration/query-planner.ts +47 -47
  566. package/dist/extensions/pi-web-agent/src/orchestration/research-orchestrator.ts +376 -376
  567. package/dist/extensions/pi-web-agent/src/orchestration/research-types.ts +64 -64
  568. package/dist/extensions/pi-web-agent/src/orchestration/research-worker.ts +181 -181
  569. package/dist/extensions/pi-web-agent/src/orchestration/source-profile.ts +101 -101
  570. package/dist/extensions/pi-web-agent/src/orchestration/stop-decider.ts +81 -81
  571. package/dist/extensions/pi-web-agent/src/presentation/config-store.ts +210 -210
  572. package/dist/extensions/pi-web-agent/src/presentation/config.ts +75 -75
  573. package/dist/extensions/pi-web-agent/src/presentation/explore-presentation.ts +61 -61
  574. package/dist/extensions/pi-web-agent/src/presentation/fetch-presentation.ts +54 -54
  575. package/dist/extensions/pi-web-agent/src/presentation/search-presentation.ts +41 -41
  576. package/dist/extensions/pi-web-agent/src/presentation/select-view.ts +20 -20
  577. package/dist/extensions/pi-web-agent/src/presentation/types.ts +63 -63
  578. package/dist/extensions/pi-web-agent/src/search/brave.ts +114 -114
  579. package/dist/extensions/pi-web-agent/src/search/duckduckgo.ts +72 -72
  580. package/dist/extensions/pi-web-agent/src/search/searxng.ts +96 -96
  581. package/dist/extensions/pi-web-agent/src/tools/web-explore.ts +71 -71
  582. package/dist/extensions/pi-web-agent/src/tools/web-fetch-headless.ts +31 -31
  583. package/dist/extensions/pi-web-agent/src/tools/web-fetch.ts +31 -31
  584. package/dist/extensions/pi-web-agent/src/tools/web-search.ts +157 -157
  585. package/dist/extensions/pi-web-agent/src/types.ts +88 -88
  586. package/dist/extensions/ponytail/index.js +31 -25
  587. package/dist/extensions/ponytail/package.json +8 -8
  588. package/dist/extensions/ponytail/ponytail-config.cjs +34 -7
  589. package/dist/extensions/ponytail/ponytail-instructions.cjs +7 -9
  590. package/dist/extensions/ponytail/test/extension.test.js +7 -8
  591. package/dist/extensions/ponytail/test/helpers.test.js +1 -1
  592. package/dist/extensions/question/batch.ts +103 -103
  593. package/dist/extensions/question/constants.ts +30 -30
  594. package/dist/extensions/question/helpers.ts +58 -58
  595. package/dist/extensions/question/navigation.ts +14 -14
  596. package/dist/extensions/question/package.json +19 -19
  597. package/dist/extensions/question/schemas.ts +43 -43
  598. package/dist/extensions/question/selection-mode.ts +46 -46
  599. package/dist/extensions/question/shortcuts.ts +44 -44
  600. package/dist/extensions/question/types.ts +132 -132
  601. package/dist/extensions/test-resolve-hook-impl.mjs +6 -6
  602. package/dist/extensions/test-resolve-hook.mjs +6 -6
  603. package/dist/extensions/web-agent-onboarding.ts +222 -222
  604. package/dist/extensions/workflow/package.json +17 -17
  605. package/dist/package-manager-cli.js +71 -71
  606. package/dist/rpc-entry.js +0 -0
  607. package/dist/skills/agent-browser/SKILL.md +52 -52
  608. package/dist/skills/batch-grill-me/SKILL.md +19 -19
  609. package/dist/skills/brandkit/SKILL.md +799 -0
  610. package/dist/skills/design-taste-frontend/SKILL.md +1207 -0
  611. package/dist/skills/design-taste-frontend-v1/SKILL.md +227 -0
  612. package/dist/skills/full-output-enforcement/SKILL.md +50 -0
  613. package/dist/skills/gpt-taste/SKILL.md +75 -0
  614. package/dist/skills/grill-me/SKILL.md +10 -10
  615. package/dist/skills/handoff/SKILL.md +16 -16
  616. package/dist/skills/handoff-text/SKILL.md +14 -14
  617. package/dist/skills/high-end-visual-design/SKILL.md +99 -0
  618. package/dist/skills/image-to-code/SKILL.md +1229 -0
  619. package/dist/skills/imagegen-frontend-mobile/SKILL.md +1466 -0
  620. package/dist/skills/imagegen-frontend-web/SKILL.md +988 -0
  621. package/dist/skills/implanger/SKILL.md +69 -69
  622. package/dist/skills/improve-codebase/REFERENCE.md +78 -78
  623. package/dist/skills/improve-codebase/SKILL.md +178 -178
  624. package/dist/skills/industrial-brutalist-ui/SKILL.md +93 -0
  625. package/dist/skills/minimalist-ui/SKILL.md +86 -0
  626. package/dist/skills/pi-subagents/SKILL.md +18 -17
  627. package/dist/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
  628. package/dist/skills/pi-subagents/references/execution-controls.md +95 -143
  629. package/dist/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
  630. package/dist/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
  631. package/dist/skills/pi-subagents/references/prompting-and-roles.md +45 -94
  632. package/dist/skills/planger/SKILL.md +166 -166
  633. package/dist/skills/ponytail/SKILL.md +120 -116
  634. package/dist/skills/ponytail-audit/SKILL.md +41 -42
  635. package/dist/skills/ponytail-debt/SKILL.md +44 -45
  636. package/dist/skills/ponytail-gain/SKILL.md +50 -51
  637. package/dist/skills/ponytail-help/SKILL.md +71 -70
  638. package/dist/skills/ponytail-review/SKILL.md +57 -58
  639. package/dist/skills/redesign-existing-projects/SKILL.md +179 -0
  640. package/dist/skills/selesai-handoff/SKILL.md +20 -20
  641. package/dist/skills/stitch-design-taste/SKILL.md +185 -0
  642. package/dist/skills/unlazy/CHANGELOG.md +100 -0
  643. package/dist/skills/unlazy/CONTRIBUTING.md +66 -0
  644. package/dist/skills/unlazy/LICENSE +21 -0
  645. package/dist/skills/unlazy/README.md +242 -0
  646. package/dist/skills/unlazy/SECURITY.md +70 -0
  647. package/dist/skills/unlazy/SKILL.md +100 -0
  648. package/dist/skills/unlazy/package.json +13 -0
  649. package/dist/skills/unlazy/references/dispatch.md +82 -0
  650. package/dist/skills/unlazy/references/gates.md +132 -0
  651. package/dist/skills/unlazy/references/method.md +49 -0
  652. package/dist/skills/unlazy/references/orchestration.md +99 -0
  653. package/dist/skills/unlazy/references/parallel.md +123 -0
  654. package/dist/skills/unlazy/references/token-economy.md +39 -0
  655. package/dist/skills/unlazy/research/validation-protocol.md +81 -0
  656. package/dist/skills/unlazy/scripts/dispatch-check.mjs +108 -0
  657. package/dist/skills/unlazy/scripts/gate-check.mjs +894 -0
  658. package/dist/skills/unlazy/scripts/gate-lint.mjs +178 -0
  659. package/dist/skills/unlazy/scripts/install-hooks.mjs +206 -0
  660. package/dist/skills/unlazy/scripts/lib/check-supervisor.mjs +46 -0
  661. package/dist/skills/unlazy/scripts/lib/dispatch.mjs +283 -0
  662. package/dist/skills/unlazy/scripts/lib/gates.mjs +629 -0
  663. package/dist/skills/unlazy/scripts/lib/process-tree.mjs +161 -0
  664. package/dist/skills/unlazy/scripts/lib/regex-worker.mjs +9 -0
  665. package/dist/skills/unlazy/scripts/stop-hook.mjs +174 -0
  666. package/dist/skills/unlazy/templates/PLAN.md +65 -0
  667. package/dist/skills/unlazy/templates/gates-leaf.md +51 -0
  668. package/dist/skills/unlazy/templates/gates-node.md +50 -0
  669. package/dist/skills/unlazy/tests/contract-tests.mjs +127 -0
  670. package/dist/skills/unlazy/tests/dispatch-tests.mjs +481 -0
  671. package/dist/skills/unlazy/tests/hardening-tests.mjs +903 -0
  672. package/dist/skills/unlazy/tests/lint-tests.mjs +242 -0
  673. package/dist/skills/unlazy/tests/run-tests.mjs +554 -0
  674. package/dist/skills/unlazy/tests/self-check.mjs +165 -0
  675. package/dist/skills/unlazy/tests/stress-tests.mjs +356 -0
  676. package/dist/skills/web-design-guidelines/SKILL.md +40 -0
  677. package/dist/skills/workflow-creation/SKILL.md +73 -73
  678. package/dist/themes/powerline-footer/theme.json +33 -33
  679. package/dist/utils/shell.d.ts +3 -0
  680. package/dist/utils/shell.js +17 -5
  681. package/docs/compaction.md +396 -396
  682. package/docs/containerization.md +111 -111
  683. package/docs/development.md +71 -71
  684. package/docs/docs.json +164 -164
  685. package/docs/environment-variables.md +86 -86
  686. package/docs/index.md +83 -83
  687. package/docs/json.md +82 -82
  688. package/docs/models.md +502 -502
  689. package/docs/packages.md +227 -227
  690. package/docs/plans/subagent-delegation/phase-0-correctness.md +264 -264
  691. package/docs/plans/subagent-delegation/phase-1-behavioral-contract.md +485 -485
  692. package/docs/plans/subagent-delegation/phase-2-context-controls.md +281 -281
  693. package/docs/plans/subagent-delegation/phase-3-advisory-routing.md +361 -361
  694. package/docs/plans/subagent-delegation/phase-4-optional-enforcement.md +380 -380
  695. package/docs/prompt-templates.md +95 -95
  696. package/docs/providers.md +293 -293
  697. package/docs/sdk.md +1144 -1143
  698. package/docs/security.md +59 -59
  699. package/docs/session-format.md +414 -414
  700. package/docs/sessions.md +145 -145
  701. package/docs/settings.md +0 -5
  702. package/docs/shared-host-extensions.md +109 -109
  703. package/docs/shell-aliases.md +13 -13
  704. package/docs/skills.md +231 -231
  705. package/docs/terminal-setup.md +142 -142
  706. package/docs/termux.md +127 -127
  707. package/docs/themes.md +295 -295
  708. package/docs/tmux.md +63 -63
  709. package/docs/tui.md +927 -927
  710. package/docs/windows.md +17 -17
  711. package/examples/README.md +25 -25
  712. package/examples/extensions/README.md +211 -211
  713. package/examples/extensions/auto-commit-on-exit.ts +49 -49
  714. package/examples/extensions/bash-spawn-hook.ts +30 -30
  715. package/examples/extensions/bookmark.ts +50 -50
  716. package/examples/extensions/border-status-editor.ts +150 -150
  717. package/examples/extensions/built-in-tool-renderer.ts +249 -249
  718. package/examples/extensions/claude-rules.ts +86 -86
  719. package/examples/extensions/commands.ts +72 -72
  720. package/examples/extensions/confirm-destructive.ts +59 -59
  721. package/examples/extensions/custom-compaction.ts +130 -130
  722. package/examples/extensions/custom-footer.ts +64 -64
  723. package/examples/extensions/custom-header.ts +73 -73
  724. package/examples/extensions/custom-provider-anthropic/index.ts +610 -610
  725. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -24
  726. package/examples/extensions/custom-provider-anthropic/package.json +19 -19
  727. package/examples/extensions/custom-provider-gitlab-duo/index.ts +404 -404
  728. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -16
  729. package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -82
  730. package/examples/extensions/dirty-repo-guard.ts +56 -56
  731. package/examples/extensions/doom-overlay/README.md +46 -46
  732. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -21
  733. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  734. package/examples/extensions/doom-overlay/doom/build.sh +152 -152
  735. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -72
  736. package/examples/extensions/doom-overlay/doom-component.ts +132 -132
  737. package/examples/extensions/doom-overlay/doom-engine.ts +173 -173
  738. package/examples/extensions/doom-overlay/doom-keys.ts +104 -104
  739. package/examples/extensions/doom-overlay/index.ts +74 -74
  740. package/examples/extensions/doom-overlay/wad-finder.ts +51 -51
  741. package/examples/extensions/dynamic-resources/SKILL.md +8 -8
  742. package/examples/extensions/dynamic-resources/dynamic.json +79 -79
  743. package/examples/extensions/dynamic-resources/dynamic.md +5 -5
  744. package/examples/extensions/dynamic-resources/index.ts +15 -15
  745. package/examples/extensions/dynamic-tools.ts +74 -74
  746. package/examples/extensions/event-bus.ts +43 -43
  747. package/examples/extensions/file-trigger.ts +41 -41
  748. package/examples/extensions/git-checkpoint.ts +53 -53
  749. package/examples/extensions/git-merge-and-resolve.ts +115 -115
  750. package/examples/extensions/github-issue-autocomplete.ts +185 -185
  751. package/examples/extensions/gondolin/index.ts +531 -531
  752. package/examples/extensions/gondolin/package-lock.json +185 -185
  753. package/examples/extensions/gondolin/package.json +19 -19
  754. package/examples/extensions/handoff.ts +199 -199
  755. package/examples/extensions/hello.ts +26 -26
  756. package/examples/extensions/hidden-thinking-label.ts +53 -53
  757. package/examples/extensions/inline-bash.ts +94 -94
  758. package/examples/extensions/input-transform-streaming.ts +39 -39
  759. package/examples/extensions/input-transform.ts +43 -43
  760. package/examples/extensions/interactive-shell.ts +196 -196
  761. package/examples/extensions/mac-system-theme.ts +47 -47
  762. package/examples/extensions/message-renderer.ts +59 -59
  763. package/examples/extensions/minimal-mode.ts +426 -426
  764. package/examples/extensions/modal-editor.ts +85 -85
  765. package/examples/extensions/model-status.ts +31 -31
  766. package/examples/extensions/notify.ts +55 -55
  767. package/examples/extensions/overlay-qa-tests.ts +1450 -1450
  768. package/examples/extensions/overlay-test.ts +153 -153
  769. package/examples/extensions/permission-gate.ts +34 -34
  770. package/examples/extensions/pirate.ts +47 -47
  771. package/examples/extensions/plan-mode/README.md +66 -66
  772. package/examples/extensions/plan-mode/index.ts +390 -390
  773. package/examples/extensions/plan-mode/utils.ts +168 -168
  774. package/examples/extensions/preset.ts +436 -436
  775. package/examples/extensions/project-trust.ts +64 -64
  776. package/examples/extensions/prompt-customizer.ts +97 -97
  777. package/examples/extensions/protected-paths.ts +30 -30
  778. package/examples/extensions/provider-payload.ts +18 -18
  779. package/examples/extensions/qna.ts +122 -122
  780. package/examples/extensions/question.ts +285 -285
  781. package/examples/extensions/questionnaire.ts +448 -448
  782. package/examples/extensions/rainbow-editor.ts +88 -88
  783. package/examples/extensions/reload-runtime.ts +37 -37
  784. package/examples/extensions/rpc-demo.ts +118 -118
  785. package/examples/extensions/sandbox/index.ts +321 -321
  786. package/examples/extensions/sandbox/package-lock.json +92 -92
  787. package/examples/extensions/sandbox/package.json +19 -19
  788. package/examples/extensions/send-user-message.ts +97 -97
  789. package/examples/extensions/session-name.ts +27 -27
  790. package/examples/extensions/shutdown-command.ts +63 -63
  791. package/examples/extensions/snake.ts +343 -343
  792. package/examples/extensions/space-invaders.ts +560 -560
  793. package/examples/extensions/ssh.ts +220 -220
  794. package/examples/extensions/status-line.ts +32 -32
  795. package/examples/extensions/structured-output.ts +65 -65
  796. package/examples/extensions/subagent/README.md +175 -175
  797. package/examples/extensions/subagent/agents/planner.md +37 -37
  798. package/examples/extensions/subagent/agents/reviewer.md +35 -35
  799. package/examples/extensions/subagent/agents/scout.md +50 -50
  800. package/examples/extensions/subagent/agents/worker.md +24 -24
  801. package/examples/extensions/subagent/agents.ts +126 -126
  802. package/examples/extensions/subagent/index.ts +1015 -1015
  803. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -10
  804. package/examples/extensions/subagent/prompts/implement.md +10 -10
  805. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -9
  806. package/examples/extensions/summarize.ts +209 -209
  807. package/examples/extensions/system-prompt-header.ts +17 -17
  808. package/examples/extensions/tic-tac-toe.ts +1008 -1008
  809. package/examples/extensions/timed-confirm.ts +70 -70
  810. package/examples/extensions/titlebar-spinner.ts +58 -58
  811. package/examples/extensions/todo.ts +297 -297
  812. package/examples/extensions/tool-override.ts +144 -144
  813. package/examples/extensions/tools.ts +146 -146
  814. package/examples/extensions/trigger-compact.ts +50 -50
  815. package/examples/extensions/truncated-tool.ts +195 -195
  816. package/examples/extensions/widget-placement.ts +9 -9
  817. package/examples/extensions/with-deps/index.ts +32 -32
  818. package/examples/extensions/with-deps/package-lock.json +31 -31
  819. package/examples/extensions/with-deps/package.json +22 -22
  820. package/examples/extensions/working-indicator.ts +123 -123
  821. package/examples/extensions/working-message-test.ts +25 -25
  822. package/examples/rpc-extension-ui.ts +632 -632
  823. package/examples/sdk/01-minimal.ts +26 -26
  824. package/examples/sdk/02-custom-model.ts +53 -53
  825. package/examples/sdk/03-custom-prompt.ts +75 -75
  826. package/examples/sdk/04-skills.ts +55 -55
  827. package/examples/sdk/05-tools.ts +48 -48
  828. package/examples/sdk/06-extensions.ts +99 -99
  829. package/examples/sdk/07-context-files.ts +47 -47
  830. package/examples/sdk/08-prompt-templates.ts +51 -51
  831. package/examples/sdk/09-api-keys-and-oauth.ts +52 -52
  832. package/examples/sdk/10-settings.ts +53 -53
  833. package/examples/sdk/11-sessions.ts +52 -52
  834. package/examples/sdk/12-full-control.ts +79 -79
  835. package/examples/sdk/13-session-runtime.ts +67 -67
  836. package/examples/sdk/README.md +144 -144
  837. package/package.json +4 -4
  838. package/dist/core/tools/schema-prune.d.ts +0 -16
  839. package/dist/core/tools/schema-prune.js +0 -39
  840. package/dist/core/tools/schema-prune.test.js +0 -111
  841. package/dist/extensions/pi-subagents/UPSTREAM-V0.50-MAPPING.md +0 -172
  842. package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +0 -55
  843. package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +0 -61
  844. package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +0 -132
  845. package/dist/extensions/pi-subagents/src/extension/chain-validation.ts +0 -181
  846. package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +0 -1354
  847. package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +0 -1581
  848. package/dist/extensions/pi-subagents/src/shared/env.ts +0 -16
  849. package/dist/extensions/pi-subagents/src/shared/session-lineage.ts +0 -71
  850. package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +0 -136
  851. package/dist/extensions/pi-subagents/src/workflows/workflow-auto-relaunch.ts +0 -41
  852. package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +0 -466
  853. package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +0 -1859
  854. package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +0 -733
  855. package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +0 -63
  856. package/dist/extensions/pi-subagents/test/unit/chain-validation.test.ts +0 -326
  857. package/dist/extensions/pi-subagents/test/unit/handoff-adoption.test.ts +0 -103
  858. package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +0 -127
  859. package/dist/extensions/pi-subagents/test/unit/session-lineage.test.ts +0 -73
  860. package/dist/extensions/pi-subagents/test/unit/task-aware-routing.test.ts +0 -213
  861. package/dist/extensions/pi-subagents/test/unit/workflow-auto-relaunch.test.ts +0 -65
  862. /package/dist/core/{tools/schema-prune.test.d.ts → extensions/loader.test.d.ts} +0 -0
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "pi-subagents",
3
- "version": "0.50.0",
4
- "description": "Selesai extension for single-agent delegation, chains, parallel groups, and scripted multi-agent workflows",
3
+ "version": "0.56.0",
4
+ "description": "Selesai extension for single-agent delegation and scripted multi-agent workflows",
5
5
  "author": "Nico Bailon",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": "./index.ts",
10
10
  "./background-work": "./src/api/background-work.ts",
11
+ "./external-job-provider": "./src/api/external-job-provider.ts",
11
12
  "./external-runs": "./src/api/external-runs.ts",
13
+ "./agents": "./src/api/agents.ts",
12
14
  "./delegation": "./src/api/delegation.ts",
13
15
  "./capability-ceiling": "./src/api/capability-ceiling.ts",
14
16
  "./preflight": "./src/api/preflight.ts",
@@ -52,7 +54,7 @@
52
54
  "scripts": {
53
55
  "typecheck": "tsc --noEmit",
54
56
  "test": "npm run test:unit",
55
- "test:unit": "node --experimental-strip-types --test test/unit/*.test.ts",
57
+ "test:unit": "node --experimental-strip-types --import ./test/support/isolated-temp-root.mjs --test test/unit/*.test.ts",
56
58
  "test:integration": "node --experimental-strip-types --import ./test/support/register-loader.mjs --test test/integration/*.test.ts",
57
59
  "test:e2e": "node --experimental-strip-types --import ./test/support/register-loader.mjs --test test/e2e/*.test.ts",
58
60
  "test:all": "npm run test:unit && npm run test:integration && npm run test:e2e"
@@ -89,6 +91,7 @@
89
91
  }
90
92
  },
91
93
  "dependencies": {
94
+ "acorn": "8.18.0",
92
95
  "jiti": "2.7.0",
93
96
  "typebox": "1.1.38",
94
97
  "yaml": "2.8.3"
@@ -0,0 +1,60 @@
1
+ ---
2
+ description: Run a bounded supervisor-mediated council of advisors and write a decision memo
3
+ argument-hint: "<question> [--advisors name,name] [--max-passes 2|3] [--scope ...] [--non-goals ...]"
4
+ ---
5
+
6
+ Run a bounded, supervisor-mediated council on this question. You, the parent
7
+ session, are the supervisor. You select the roster, curate cross-advisor packets,
8
+ decide which feedback is valid, and write the final memo. Advisors do not talk
9
+ directly or see peer transcripts by default. This is not free-form agent chat.
10
+
11
+ Before you orchestrate, read `skills/council-mode/SKILL.md` and
12
+ `skills/pi-subagents/references/execution-controls.md`.
13
+
14
+ Parse the invocation yourself. The flags below are conventions, not runtime
15
+ options. Record a brief with the question, scope, non-goals, evidence targets,
16
+ roster, known advisor context modes, and pass cap. Default `--max-passes` to 2.
17
+ Clamp it to 2 or 3. If the question is trivial or settled, answer directly instead
18
+ of convening a council.
19
+
20
+ ## Roster
21
+
22
+ - If `--advisors` is given, use exactly those agent names. Fail clearly on an
23
+ unknown agent. Do not require or invent per-advisor role labels.
24
+ - Otherwise list agents with `subagent({ action: "list" })`, then prefer 2–3
25
+ executable names that start with `council-`.
26
+ - If fewer than two profiles are available, fill the roster with `oracle`, then
27
+ `reviewer`, until it has two advisors. Launch fallback `oracle` with
28
+ `context: "fork"` so global defaults cannot remove its parent-chat context.
29
+ Let `reviewer` use its normal profile context. Note the fallback and known
30
+ context modes in the memo.
31
+ - Use the normal single-oracle loop only when a requested roster or unavailable
32
+ builtins leaves fewer than two advisors. Label the memo as degraded mode.
33
+
34
+ Profiles provide the model, tools, context, and advisor stance. The council
35
+ question and scope provide the decision frame. If the user wants a specific lens,
36
+ they should put it in the question, scope, or profile definition. Keep the roster
37
+ at 2–3 and never exceed 4.
38
+
39
+ Package advisors such as Surf's `gpt-pro` are valid only when the package Pi
40
+ extension is installed and its external-job provider is registered. For Surf,
41
+ that means the `surf-cli` Pi extension has loaded and `surf-oracle` appears in
42
+ `subagent({ action: "list" })` or the advisor is explicitly requested in
43
+ `--advisors` after that install. Treat them as external-runner advisors: omit
44
+ child `async` for normal attached council results, do not pass `outputSchema`,
45
+ include any needed evidence in the prompt, and use the fresh fallback cross-exam
46
+ path if the run is not resumable.
47
+
48
+ ## Run the protocol
49
+
50
+ Use the canonical workflow, structured advisor contracts, aggregate pass receipts,
51
+ and memo requirements in `skills/council-mode/SKILL.md`. Keep the parent as the
52
+ only synthesizer and decision maker. Do not introduce a chair advisor, peer chat,
53
+ or transcript sharing.
54
+
55
+ Use its required boundary checkpoints, yield for each async workflow without
56
+ polling, and write its required final memo.
57
+
58
+ Question and options from the slash command invocation:
59
+
60
+ $@
@@ -28,7 +28,11 @@ Choose or adapt angles when the work calls for it:
28
28
 
29
29
  Prefer three strong reviewers over many vague reviewers.
30
30
 
31
- Give every reviewer a specific task prompt naming its angle. Ask reviewers to return concise, evidence-backed findings with file/line references and suggested fixes. The response should be review feedback, not a context summary. Reviewers must not edit files unless I explicitly ask for a writer pass.
31
+ Give every reviewer a specific task prompt naming its angle. Ask reviewers to return concise, evidence-backed findings with file/line references and suggested fixes. Filter on evidence, not severity: a finding must be concrete, current, caused or made reachable by the target diff, and supported by source proof, a test or repro, or a contract contradiction. Label findings P0/P1/P2. P0 blocks merge. P1 should be fixed before release. P2 is report-only. End each review with `Merge verdict: BLOCK`, `Merge verdict: OK`, or `Merge verdict: OK with notes`. If nothing qualifies, ask the reviewer to say exactly `No issues found.` The response should be review feedback, not a context summary. Reviewers must not edit files unless I explicitly ask for a writer pass.
32
+
33
+ Do not default first-pass reviews to `blockers only`. That phrase is valid only for final pre-merge re-checks after P1/P2 findings are already inventoried, or for explicit emergency hotfix lanes where non-blocking findings are intentionally deferred.
34
+
35
+ For a targeted follow-up review, ask only whether the named finding was resolved, whether the fix introduced a new defect in the fix blast radius, and whether prior P1/P2 notes still stand. For bot or PR-comment triage, classify each comment as VALID, STALE, INVALID, or OUT-OF-POLICY against current HEAD, then assign P0/P1/P2 only to VALID comments.
32
36
 
33
37
  While reviewers run, do your own narrow inspection if useful. After they return, synthesize the feedback into:
34
38
  - fixes worth doing now
@@ -6,7 +6,7 @@ Run a parent-orchestrated review loop for the requested work.
6
6
 
7
7
  Use the `subagent` tool. Keep the parent session as the loop controller and final decision-maker. Child subagents must receive concrete role-specific tasks; they must not run subagents or manage the loop themselves unless the parent intentionally selected an explicit fanout agent whose builtin `tools` includes `subagent` for that assigned fanout.
8
8
 
9
- Default to a maximum of 3 review rounds unless I specify a different cap. Count a review round each time fresh-context reviewers inspect the current diff after a worker pass. Stop early when reviewers find no blockers or fixes worth doing now.
9
+ Default to a maximum of 3 review rounds unless I specify a different cap. Count a review round each time fresh-context reviewers inspect the current diff after a worker pass. Stop early when reviewers find no P0 findings, no P1 fixes worth doing now, and no approved P2 notes that should be handled in this loop.
10
10
 
11
11
  If the invocation includes an implementation request, first launch one async `worker` to implement the approved scope. If the current diff is already the target, start with review. The sequence can be launched up front with `workflowScript` when it is already clear, or continued as follow-up single-agent runs after each async completion. For an initial workflowScript, pass `async: true` so the main chat is unblocked; do not set `clarify: true` unless I explicitly want the foreground clarify UI. Use only one writer against the active worktree at a time unless I explicitly ask for isolated worktrees.
12
12
 
@@ -14,12 +14,14 @@ As a conservative orchestration policy, do not set `turnBudget`, a hard `toolBud
14
14
 
15
15
  For each review round, launch fresh-context `reviewer` agents in parallel. Reviewers must inspect the repository, relevant instructions, and current diff directly from files and commands. They must not rely on the main conversation history and must not edit files.
16
16
 
17
+ Tell reviewers to filter on evidence, not severity. They should report only concrete current issues caused or made reachable by the target diff, with source proof, a test or repro, or a contract contradiction. Ask them to label findings P0/P1/P2 and end with `Merge verdict: BLOCK`, `Merge verdict: OK`, or `Merge verdict: OK with notes`. P0 blocks merge. P1 should be fixed before release. P2 is report-only. Use `blockers only` only for final pre-merge re-checks after P1/P2 findings are already captured, or for explicit emergency hotfix lanes.
18
+
17
19
  Choose review angles from the actual change. Common angles are correctness/regressions, tests/validation, and simplicity/maintainability. Add security, performance, docs/API contracts, or user-flow validation when the work calls for it. Prefer three strong reviewers over many vague reviewers.
18
20
 
19
21
  After reviewers return, synthesize their feedback into:
20
- - blockers or scope/product/architecture decisions that need user approval;
21
- - fixes worth doing now;
22
- - optional improvements;
22
+ - P0 blockers or scope/product/architecture decisions that need user approval;
23
+ - P1 fixes worth doing now;
24
+ - P2 report-only notes or optional improvements;
23
25
  - feedback to ignore or defer, with a short reason.
24
26
 
25
27
  Do not blindly apply every reviewer suggestion. If reviewers surface an unapproved product, scope, or architecture decision, pause and ask me before launching a fix worker.
@@ -30,8 +32,10 @@ When there are fixes worth doing now and the workflow is implementation-authoriz
30
32
 
31
33
  After a fix worker returns, run another review round only when it made material changes or addressed non-trivial findings. Do not keep looping for optional polish, speculative improvements, or findings already deferred by the parent.
32
34
 
35
+ For a targeted follow-up review, ask only three questions: whether the named finding was resolved, whether the fix introduced a new concrete defect in the fix blast radius, and whether prior P1/P2 notes still stand. End with a fix verdict and the merge verdict.
36
+
33
37
  Stop and summarize when one of these is true:
34
- - reviewers find no blockers or fixes worth doing now;
38
+ - reviewers find no P0 blockers or P1 fixes worth doing now;
35
39
  - remaining feedback is optional, speculative, or intentionally deferred;
36
40
  - reviewers surface an unapproved decision that needs me;
37
41
  - the max review-round cap is reached.
@@ -0,0 +1,254 @@
1
+ ---
2
+ name: council-mode
3
+ description: Run a bounded supervisor-mediated advisor council. Use when the user asks for council mode, asks to convene advisors, debate a decision, cross-examine recommendations, or run /council.
4
+ ---
5
+
6
+ # Council Mode
7
+
8
+ This skill is for the parent supervisor only. Do not inject it into advisors. The
9
+ parent selects the roster, curates all cross-advisor communication, decides which
10
+ feedback is valid, and writes the decision memo. Advisors do not talk directly or
11
+ see peer transcripts by default. This is not free-form agent chat.
12
+
13
+ Use council mode for a material decision with real tradeoffs. Do not use it for a
14
+ trivial or settled question, or for implementation work. Read
15
+ `skills/pi-subagents/references/execution-controls.md` before you launch advisors.
16
+
17
+ ## Roster and limits
18
+
19
+ Use advisor profile names directly. A `council-*` profile defines model, tools,
20
+ context, output defaults, and any persistent stance in the profile body. Its
21
+ profile configuration or explicit invocation owns its context choice.
22
+
23
+ Package advisors can also join the roster only when their package Pi extension is
24
+ installed and their external-job provider is registered. For Surf, `gpt-pro` is
25
+ available only after the `surf-cli` Pi extension loads Surf's `surf-oracle`
26
+ provider. Treat it as a normal advisor name in `runs.all` after that provider is
27
+ visible. It is background-only, so omit `async` unless you explicitly want
28
+ detached receipt semantics; workflow execution will await the terminal provider
29
+ result. External runners can lack repo tools, structured-output support, or
30
+ resumability. For them, include the needed evidence or file excerpts in the task,
31
+ use the text JSON contract below instead of `outputSchema`, and use the
32
+ fresh-context fallback path for cross-exam when the run is not resumable.
33
+
34
+ Create model-based profiles in your user or project agent directory. Do not add
35
+ them to this package. This is a valid example:
36
+
37
+ ```markdown
38
+ ---
39
+ name: council-sol
40
+ description: Read-only fresh-context advisor for bounded council decisions
41
+ tools: read, grep, find, ls
42
+ model: openai-codex/gpt-5.6-sol
43
+ thinking: high
44
+ systemPromptMode: replace
45
+ inheritProjectContext: true
46
+ inheritSkills: false
47
+ defaultContext: fresh
48
+ acceptanceRole: read-only
49
+ ---
50
+
51
+ Analyze the council question independently. Inspect evidence directly. Do not
52
+ edit, run mutating commands, commit, push, contact peers, or spawn subagents.
53
+ Return concise, cited advice using the report contract in the council task.
54
+ ```
55
+
56
+ After `subagent({ action: "list" })`, prefer 2–3 executable names that start with
57
+ `council-`. The prefix is a naming convention, not runtime selection. If fewer
58
+ than two profiles are available, fill the roster with `oracle`, then `reviewer`,
59
+ until it has two advisors. Launch fallback `oracle` with `context: "fork"` so
60
+ global defaults cannot remove its parent-chat context. Let fallback `reviewer`
61
+ use its normal profile context. Note the fallback and known context modes in the
62
+ memo. Use the normal single-oracle consultation loop only when a requested roster
63
+ or unavailable builtins leaves fewer than two advisors.
64
+ Label that result as degraded mode. Never use more than four advisors.
65
+
66
+ Pass 1 is independent reports. Pass 2 is one cross-exam. The default pass cap is
67
+ 2. Run pass 3 only when `--max-passes 3` was requested and a material dispute can
68
+ be settled by evidence an advisor can produce. Never run an unbounded loop.
69
+
70
+ ## Protocol
71
+
72
+ 1. The parent writes a brief with the question, scope, non-goals, evidence targets,
73
+ roster, known advisor context modes, and pass cap. If the user wants a specific
74
+ lens, keep it in the question, scope, or profile body instead of inventing a
75
+ per-advisor label.
76
+ 2. Before Pass 1, tell the user the roster, requested or known context modes, and
77
+ pass cap. Use a stable key, `phase`, and concise `label` for every
78
+ workflow child. For example, use `advisor-oracle`, `phase: "Council pass 1"`,
79
+ and `label: "Oracle — intent and consistency"`.
80
+ 3. Launch one async `workflowScript` with `runs.all` for independent advisor
81
+ reports. Set `context` when the selected advisor has a known profile context or
82
+ a fallback rule requests one, because a global default can otherwise override
83
+ that profile. Set `context: "fork"` for fallback `oracle`. If no advisor context
84
+ is known, omit `context` and disclose the unknown runtime default in the memo.
85
+ Each advisor is read-only and must not spawn children, edit files, run mutating
86
+ commands, commit, or push. Set `output: false` unless separate advisor artifacts
87
+ are explicitly requested or useful for the decision. When separate artifacts are
88
+ useful, give advisors relative output paths so the runtime stores them under its
89
+ managed artifact directory; do not ask them to write root-level council report
90
+ files. For installed
91
+ external-runner advisors such as Surf `gpt-pro` after `surf-oracle` is
92
+ registered, do not pass `outputSchema`; put the schema request in the task text
93
+ and accept `result.output` as the report.
94
+ 4. Return one aggregate Pass 1 receipt. After it completes, tell the user the
95
+ completion count, agreement count, dispute count, and whether Pass 2 is needed.
96
+ 5. The parent synthesizes a claim matrix in session. It contains agreements,
97
+ disputed claims, missing proof, owner decisions, and a relay set of at most five
98
+ high-impact claims per advisor. Do not delegate this synthesis.
99
+ 6. Before Pass 2, tell the user how many claims are relayed and why each is
100
+ material. Launch a second async `workflowScript` with `runs.all` resume calls.
101
+ Each task is a curated challenge packet, not a peer transcript. A resume requires
102
+ a retained run id and a non-empty task. It excludes `agent` and rejects `gate`.
103
+ Record the new run id from every resume. Pass 3 resumes those latest ids. Return
104
+ one aggregate Pass 2 receipt.
105
+ 7. After Pass 2, tell the user whether the council converged or which owner
106
+ decisions remain. The parent writes the final memo. Do not delegate it.
107
+
108
+ If an advisor is not resumable, run the same profile in fresh context with its own
109
+ pass-1 report and the challenge packet. Label that response as a fresh-context
110
+ fallback, not a true cross-exam.
111
+
112
+ Do not set `clarify`, `worktree`, `gate`, turn budgets, tool budgets, or tight usage
113
+ budgets on advisors. Bound work through the roster, pass cap, and report length.
114
+
115
+ ## Advisor contracts and pass receipts
116
+
117
+ Pass-1 reports are at most about 600 words. Give native Pi advisors the same
118
+ `outputSchema`, so reports are comparable without heading cleanup. For
119
+ external-runner advisors, do not pass `outputSchema`; ask them to return compact
120
+ JSON text with the same fields. The following shape is a contract template. Use
121
+ the runtime schema syntax supported by the workflow for native advisors and keep
122
+ narrative fields as strings:
123
+
124
+ ```js
125
+ const pass1OutputSchema = {
126
+ type: "object",
127
+ required: [
128
+ "recommendation", "evidence", "assumptions", "risks", "confidence",
129
+ "challengeClaims", "ownerDecisions", "changeMyMind"
130
+ ],
131
+ properties: {
132
+ recommendation: { type: "string" },
133
+ evidence: {
134
+ type: "array",
135
+ items: {
136
+ type: "object",
137
+ required: ["claim", "sources"],
138
+ properties: {
139
+ claim: { type: "string" },
140
+ sources: { type: "array", items: { type: "string" } }
141
+ }
142
+ }
143
+ },
144
+ assumptions: {
145
+ type: "array",
146
+ items: {
147
+ type: "object",
148
+ required: ["assumption", "status"],
149
+ properties: {
150
+ assumption: { type: "string" },
151
+ status: { enum: ["verified", "unverified"] }
152
+ }
153
+ }
154
+ },
155
+ risks: { type: "array", items: { type: "string" } },
156
+ confidence: {
157
+ type: "object",
158
+ required: ["level", "reason"],
159
+ properties: {
160
+ level: { enum: ["high", "medium", "low"] },
161
+ reason: { type: "string" }
162
+ }
163
+ },
164
+ challengeClaims: { type: "array", items: { type: "string" }, maxItems: 3 },
165
+ ownerDecisions: { type: "array", items: { type: "string" } },
166
+ changeMyMind: { type: "array", items: { type: "string" } }
167
+ }
168
+ };
169
+ ```
170
+
171
+ Include this contract in each Pass 1 task: inspect supplied evidence directly; do
172
+ not see or ask about other advisors; stay read-only; do not spawn children; return
173
+ only the structured report. For external-runner advisors, say `Return only JSON
174
+ matching this shape. Do not wrap it in Markdown.` and include any evidence they
175
+ cannot read through tools.
176
+
177
+ After `runs.all`, return one aggregate receipt rather than making the parent find
178
+ separate artifacts. Preserve the result order or map it by stable key so each row
179
+ contains the advisor identity and report:
180
+
181
+ ```js
182
+ return {
183
+ pass: 1,
184
+ advisors: results.map((result, index) => ({
185
+ key: result.key,
186
+ agent: result.agent,
187
+ requestedContext: roster[index].context ?? "runtime-default-unknown",
188
+ runId: result.runId,
189
+ report: result.structuredOutput ?? result.output
190
+ }))
191
+ };
192
+ ```
193
+
194
+ Do not replace `runtime-default-unknown` with a guessed context. It records that
195
+ the launch intentionally omitted context.
196
+
197
+ A challenge packet contains only disputed claims, strong conflicting evidence,
198
+ missing proof, owner decisions, and high-impact risks. Attribute peer content as
199
+ "another advisor". Do not include full peer reports. Use a common Pass 2 contract:
200
+
201
+ ```js
202
+ const pass2OutputSchema = {
203
+ type: "object",
204
+ required: ["responses", "recommendationChanged", "outOfScopeFindings"],
205
+ properties: {
206
+ responses: {
207
+ type: "array",
208
+ items: {
209
+ type: "object",
210
+ required: ["claimId", "disposition", "reason", "sources"],
211
+ properties: {
212
+ claimId: { type: "string" },
213
+ disposition: {
214
+ enum: ["accept", "reject", "refine", "owner-decision"]
215
+ },
216
+ reason: { type: "string" },
217
+ sources: { type: "array", items: { type: "string" } }
218
+ }
219
+ }
220
+ },
221
+ recommendationChanged: {
222
+ type: "object",
223
+ required: ["changed", "reason"],
224
+ properties: { changed: { type: "boolean" }, reason: { type: "string" } }
225
+ },
226
+ outOfScopeFindings: { type: "array", items: { type: "string" } }
227
+ }
228
+ };
229
+ ```
230
+
231
+ Use stable resume keys such as `cross-oracle`, `phase: "Council pass 2"`, concise
232
+ labels, and `output: false` unless separate artifacts are requested or useful. Keep
233
+ any artifact outputs under the managed run artifact directory. Do not pass
234
+ `outputSchema` to external-runner fallback launches; ask for compact JSON text
235
+ instead. The aggregate Pass 2 receipt uses the same row shape as Pass 1, with the
236
+ new `runId` and `structuredOutput ?? output`.
237
+
238
+ ## Stop and memo
239
+
240
+ Converged means no disputed claim remains that both materially affects the
241
+ recommendation and can plausibly be settled by evidence. Stop at convergence, the
242
+ pass cap, failed fallback, or user interruption. Put unresolved disputes in owner
243
+ decisions. Never add a round for polish or symmetry.
244
+
245
+ The parent memo states the question and scope, recommendation, rationale, accepted
246
+ and rejected feedback with reasons, owner decisions, evidence and run ids,
247
+ confidence, what would change the decision, and the roster, passes, fallbacks, and
248
+ known advisor context modes. Identify advisors by profile name or model-based
249
+ profile, not by invented role labels. State that fallback `oracle` is context-aware
250
+ and forked.
251
+
252
+ Council mode is not agent-to-agent chat, a transcript dump, mutation authority,
253
+ auto-escalation to writer lanes, or a council UI. Escalate to a writer only after
254
+ the parent memo and only when the user explicitly requests it.
@@ -1,25 +1,20 @@
1
1
  ---
2
2
  name: pi-subagents
3
3
  description: |
4
- Delegate work to builtin or custom subagents with single-agent, chain,
5
- parallel, scripted, async, forked-context, mission-backed, and
6
- intercom-coordinated workflows. Use for advisory review, implementation
7
- handoffs, and multi-step tasks where a single agent stays in control while
8
- other agents contribute context, planning, or execution.
4
+ Delegate work to builtin or custom subagents with single-agent, parallel,
5
+ scripted-chaining, async, forked-context, and coordinated workflows. Use
6
+ for advisory review, implementation handoffs, and multi-step tasks where a
7
+ single agent should stay in control while other agents contribute context,
8
+ planning, or execution.
9
9
  ---
10
10
 
11
- # Selesai Subagents
11
+ # Pi Subagents
12
12
 
13
13
  This skill is for the main parent orchestrator only. Do not inject or follow it inside spawned child subagents. The parent session owns delegation, orchestration, review fanout, and final fix-worker launches. Ordinary children should not run their own subagent workflows; the explicit exception is a delegated fanout child whose resolved builtin `tools` includes `subagent`, and that child may use `subagent` only for the fanout work the parent assigned.
14
14
 
15
- Use this skill when the parent orchestrator needs one specialized child or composed orchestration. The `subagent` tool has four first-class execution modes:
15
+ Use this skill when the parent orchestrator needs one specialized child or composed orchestration. Use `workflowScript` for all execution, including one isolated child. Chaining is still supported, but it is code-driven: use `await runs.run(...)` for sequential steps, `runs.all([...])` for parallel fanout, and ordinary JavaScript for branching, retries, gate monitors, and aggregation. Keep workflow helpers portable: use plain helper functions or explicit Promise chains, not nested `async function` helpers, async arrows, or async methods. Do not use legacy top-level `chain` / `tasks` inputs or durable `.chain.md` execution. Scripted workflows normally start asynchronously unless config sets `asyncByDefault:false`; set `async:true` explicitly when async behavior matters. Pass `async:false` only when the parent must block until completion. Async mode still shows progress. Do not use `async:false` for final reviews, backlog gates, run-to-completion convenience, or because no other work is available.
16
16
 
17
- - **SINGLE** — `{ agent, task }` for one child (omit `task` for a self-contained agent).
18
- - **CHAIN** — `{ chain: [{ agent, task }, ...] }` for sequential steps with `{previous}`, `{outputs.name}`, `phase`/`label`, `outputSchema`, and `{ checkpoint: "name" }` human gates.
19
- - **PARALLEL** — `{ tasks: [{ agent, task }, ...], concurrency? }` for top-level parallel children, plus in-chain `{ parallel: [...] }` groups and dynamic `expand`/`collect` fanout.
20
- - **SCRIPTED WORKFLOW** — `{ workflowScript }` with `runs.run`/`runs.all` and ordinary JavaScript for sequence, parallelism, branching, retries, gate monitors, and aggregation. Use `return runs.run("main", { agent, task })` for one child and `runs.all([...])` for coordinated waves. Scripts start asynchronously by default; pass `async:false` only for a small foreground run.
21
-
22
- Prefer the declarative modes when the shape is known up front; reach for `workflowScript` when coordination needs dynamic branching or aggregation. Saved `.chain.md` / `.chain.json` workflows (run with `/run-chain`) make repeatable multi-agent flows shareable without rewriting the chain each time.
17
+ Package-installed agents appear in `subagent({ action: "list" })` with builtin, user, and project agents. If `surf-cli` is installed as a Pi package, the Surf browser extension is loaded, and Chrome is logged into a ChatGPT Pro account, Surf can expose `gpt-pro`: a read-only async advisor that reaches ChatGPT web through Surf Oracle. Check it with `subagent({ action: "get", agent: "gpt-pro" })` and run it with `subagent({ agent: "gpt-pro", task: "Review this plan and identify release risks." })`.
23
18
 
24
19
  ## How to use this router
25
20
 
@@ -28,8 +23,10 @@ Read the matching reference file before acting. Paths are relative to this `SKIL
28
23
  | Task | Read |
29
24
  | --- | --- |
30
25
  | Decide whether to delegate, choose agents, compare tool versus slash commands, apply prompt techniques, or understand builtin roles | `references/prompting-and-roles.md` |
31
- | Run single, chain, parallel, scripted, async, scheduled, mission-backed, forked, worktree, watchdog, clarify, oracle, or intercom-coordinated workflows | `references/execution-controls.md` |
32
- | List/create/update/delete/eject/disable agents or chains, edit agent files, use prompt-template integration, or expose extension RPC | `references/management-authoring-rpc.md` |
26
+ | Use council mode, convene several advisors, debate a decision, cross-examine recommendations, critique or improve a plan with multiple model perspectives, or run `/council` | `../council-mode/SKILL.md` |
27
+ | Run one-child, scripted, async, scheduled, mission-backed, forked, watchdog, oracle, or intercom-coordinated workflows | `references/execution-controls.md` |
28
+ | Coordinate several independent tasks, worktrees, repositories, or writer lanes | `references/multi-lane-orchestration.md` |
29
+ | List/create/update/delete/eject/disable agents, inspect legacy chain records, edit agent files, use prompt-template integration, or expose extension RPC | `references/management-authoring-rpc.md` |
33
30
  | Check safety constraints, best practices, standard workflows, or error handling | `references/constraints-and-recipes.md` |
34
31
 
35
32
  For broad or uncertain requests, read more than one reference. For complex work, start with `references/prompting-and-roles.md` and `references/execution-controls.md`, then consult `references/constraints-and-recipes.md` before launching or reviewing child work.
@@ -37,11 +34,15 @@ For broad or uncertain requests, read more than one reference. For complex work,
37
34
  ## Always-on constraints
38
35
 
39
36
  - Keep the parent as orchestrator and final decision-maker.
37
+ - Before multiple mutation-capable lanes, record a lane board and each lane's isolation path.
38
+ - For plan, design, or architecture advice that asks for council mode, asks to convene several advisors, compare model perspectives, debate a decision, cross-examine recommendations, or critique and improve a plan, read `../council-mode/SKILL.md` and use Council Mode instead of ad hoc parallel oracle calls.
39
+ - For plan, design, or architecture advice that asks to consult, discuss with, or come to agreement with one `oracle`, use a short same-session consultation loop: read the first result, resume once with a targeted challenge when material tradeoffs remain, then synthesize the parent decision. Keep explicit one-shot, trivial, and fully settled consultations one-shot.
40
40
  - Use one writer per cwd/worktree unless isolated worktrees are intentional.
41
41
  - For cross-codebase work, record the target repo, explicit `cwd`, authority boundary, and expected output before launch. Do not assume the parent session cwd is the child repo.
42
- - For parallel fanout, compare child prompts before launch. Do not send clone prompts with only issue numbers, titles, or broad file globs swapped; each child needs a lane-specific task, source seam, prior evidence, and decision that remains distinct without the item number. Launch that fanout as one async `workflowScript` or parallel `tasks` group with stable keys and aggregate output unless there is truly only one child.
42
+ - For parallel fanout, compare child prompts before launch. Do not send clone prompts with only issue numbers, titles, or broad file globs swapped; each child needs a lane-specific task, source seam, prior evidence, and decision that remains distinct without the item number. Launch that fanout as one async `workflowScript` with stable keys and aggregate output unless there is truly only one child.
43
43
  - Prefer fresh-context review/validation fanout, then synthesize and apply fixes in the parent.
44
- - Use async/background by default when work can proceed independently; do not poll just to wait. For planned human gates, use `{ checkpoint: "name", message?: "..." }` chain steps and approve or reject paused checkpoints with `approve-checkpoint` / `reject-checkpoint`. For adaptive gates, branch in `workflowScript`.
44
+ - Use async/background by default. Final reviews, gate checks, oracle checks, and backlog lanes stay async. Use `async:false` only when the parent must block until completion. Do not poll just to wait. For adaptive gates, branch in `workflowScript`.
45
+ - For Pi extension repos whose canonical checkout is under `~/.selesai/agent/extensions`, never create lane worktrees as sibling directories there. Pi auto-loads `~/.selesai/agent/extensions/*/index.ts`, so sibling worktrees can register duplicate tools. Put lanes under `~/.selesai/agent/worktrees`, another worktree base outside auto-discovery, or a temporary clone. If a lane must run the modified extension itself, use an isolated Pi config home with `SELESAI_CODING_AGENT_DIR=<lane-config> pi --no-extensions -e <lane>/index.ts`. Use full containers only when path and config isolation are insufficient.
45
46
  - Preserve capability ceilings, including child tool restrictions and session-scoped allowed-agent restrictions.
46
47
  - Escalate unresolved product, architecture, authority, release, merge, or safety decisions upward instead of letting a child decide silently.
47
48
  - Treat receipts, CI, review bots, and external-run records as evidence, not authority to merge, close, comment, publish, or release.
@@ -1,13 +1,15 @@
1
- # Selesai Subagents: Constraints And Recipes
1
+ # Pi Subagents: Constraints And Recipes
2
2
 
3
3
  This file is a detailed reference loaded from `skills/pi-subagents/SKILL.md`.
4
4
 
5
5
  ## Important Constraints
6
6
 
7
- - **Forking requires a persisted parent session.** If the current session does not
8
- have a persisted session file, forked runs fail. Packaged `worker`, `oracle`,
9
- and `advisor` default to forked context, so use `context: "fresh"` explicitly
10
- when that is not available or not wanted.
7
+ - **Explicit forking requires a persisted parent session.** If the current session
8
+ does not have a persisted session file or current leaf, explicit `context: "fork"`
9
+ fails. An agent-level `defaultContext: fork` is a preference: packaged `worker`,
10
+ `oracle`, and `advisor` fall back to `fresh` when those fork preconditions are not
11
+ met yet. Use `context: "fresh"` when you do not want a fork even after the parent
12
+ session exists.
11
13
  - **Forked runs inherit parent history.** They are branched threads, not fresh
12
14
  filtered contexts. Use fresh context for adversarial reviewers unless the user explicitly asks for forked context.
13
15
  - **Default subagent nesting depth is 2.** Deeper recursive delegation is blocked
@@ -19,7 +21,13 @@ This file is a detailed reference loaded from `skills/pi-subagents/SKILL.md`.
19
21
  become second decision-makers.
20
22
  - **Respect the fixed authority policy.** `authorityPolicy` is a small `auto` / `confirm` / `forbid` map for supported operational actions. Worktree discard, destructive cleanup, and spawn-budget grants default to confirmation; stop, steer, and schedule creation remain automatic. Use `worktree.discard` with the durable `handoffPath`; confirm-required actions refuse safely without an interactive UI and retained paths include manual Git recovery commands.
21
23
 
22
- Runtime config can change orchestration behavior. `intercomBridge.resultDelivery: false` disables only external acknowledged grouped-result delivery when native parent notifications own completion; supervisor asks/progress stay active, and enabled transport failures are still reported. `asyncByDefault` and `forceTopLevelAsync` affect whether launches detach; `waitTool` can make direct `subagent_wait()` calls return immediately while headless auto-drain remains active, and its effective value is propagated to child runtimes; `globalConcurrencyLimit` bounds concurrent fanout, while a positive `maxSubagentSpawnsPerSession` optionally caps cumulative launches (`0` or unset is unlimited). Status and doctor report the budget; static work preflights declared capacity; only the settled root interactive parent can use `grant-spawn-budget` after native confirmation, with total grants bounded by the original cap. Compaction does not reset usage or grants; `singleRunOutputBaseDir` and `worktreeBaseDir` route outputs and worktrees; `completionBatch` groups async notifications. `artifactDir` is `project` (default), `session`, or `temp` and chooses where subagent artifacts are stored. Set `asyncWidget: false` to hide the above-editor background-run widget when a companion footer or dashboard owns that space (fleet inspector remains available). Per-run `artifacts: false` disables artifact capture for that launch. Async status and result artifacts include `lifecycleArtifactVersion` and fields such as `workflowGraph`, `steps`, `results`, `totalTokens`, `totalCost`, `turnCount`, `toolCount`, and nested `children`. Child protocol failures expose a structured `protocolError`; `protocol_output_limit` means a child emitted a JSONL line above the 16 MiB live-parser cap. Prefer these artifacts and `status` views over scraping terminal output.
24
+ Runtime config can change orchestration behavior. `intercomBridge.resultDelivery: false` disables only external acknowledged grouped-result delivery when native parent notifications own completion; supervisor asks/progress stay active, and enabled transport failures are still reported. `asyncByDefault` and `forceTopLevelAsync` affect whether launches detach; `waitTool` can make direct `subagent_wait()` calls return immediately while headless auto-drain remains active, and its effective value is propagated to child runtimes; `globalConcurrencyLimit` bounds concurrent fanout, while a positive `maxSubagentSpawnsPerSession` optionally caps cumulative launches (`0` or unset is unlimited). Status and doctor report the budget; static work preflights declared capacity; only the settled root interactive parent can use `grant-spawn-budget` after native confirmation, with total grants bounded by the original cap. Compaction does not reset usage or grants; `singleRunOutputBaseDir` and `worktreeBaseDir` route outputs and worktrees; `completionBatch` groups async notifications. `artifactDir` is `session` (default), `project`, or `temp` and chooses where subagent artifacts are stored. Set `asyncWidget: false` to hide the above-editor background-run widget when a companion footer or dashboard owns that space (fleet inspector remains available). Per-run `artifacts: false` disables artifact capture for that launch. Async status and result artifacts include `lifecycleArtifactVersion` and fields such as `workflowGraph`, `steps`, `results`, `totalTokens`, `totalCost`, `turnCount`, `toolCount`, and nested `children`. Child protocol failures expose a structured `protocolError`; `protocol_output_limit` means a child emitted a JSONL line above the 16 MiB live-parser cap. Prefer these artifacts and `status` views over scraping terminal output.
25
+
26
+ ### Keep report artifacts out of the repository root
27
+
28
+ Treat lane reports, review notes, council pass reports, and gate logs as scratch unless the user explicitly asks to keep them. Prefer `output: false` and the aggregate workflow result for short reports. When a later step needs a file, use the runtime-managed output artifact by setting a stable child key plus a relative `output` path such as `plans/deploy.md`; relative child outputs are saved under the run artifact directory, not the project root. Do not put `reports/...`, `*-report.json`, or similar repo-root paths in child task text.
29
+
30
+ For durable evidence, copy only the final summary to session memory, a PR body/comment, a mission artifact, or a user-approved docs path outside the repo. After the PR, issue, or gate reaches a terminal state, delete or move scratch reports from the active worktree before reporting completion. Keep a project `.gitignore` entry for ad-hoc report patterns only as a safety net; it is not the cleanup mechanism.
23
31
 
24
32
  ## Best Practices
25
33
 
@@ -29,11 +37,12 @@ Launch every subagent asynchronously by default. Use `async: true` for scouts, r
29
37
 
30
38
  ### Use subagent_wait() to block until async runs finish
31
39
 
32
- In an interactive chat, do not call `subagent_wait()` merely to wait after launching background work; return control to the user and Selesai will wake the session on completion. Override that default when the current request is run-to-completion — for example, the user asked you to stay with the task and report results back this turn or a skill must finish in one turn. In a headless run, Selesai auto-drains exact current-session work at `agent_end`; call `subagent_wait()` when this turn must receive results before it ends. In either case, `subagent_wait()` blocks the current turn until the next run completes or needs attention, keeps the turn alive for normal notification delivery, then returns.
40
+ In an interactive chat, do not call `subagent_wait()` merely to wait after launching background work; return control to the user and Pi will wake the session on completion. Override that default when the current request is run-to-completion — for example, the user asked you to stay with the task and report results back this turn or a skill must finish in one turn. In a headless run, Pi auto-drains exact current-session work at `agent_end`; call `subagent_wait()` when this turn must receive results before it ends. In either case, `subagent_wait()` blocks the current turn until the next run completes or needs attention, keeps the turn alive for normal notification delivery, then returns.
33
41
 
34
42
  - `subagent_wait()` — return when the next initially active async run or registered provider item finishes, or a subagent needs attention.
35
43
  - `subagent_wait({ all: true })` — block until every async run and provider item active at call time finishes, or a subagent needs attention.
36
44
  - `subagent_wait({ id: "..." })` — block on one async or remembered detached foreground run (id or prefix). Provider items are not selected through this parameter.
45
+ - `subagent_wait({ stopOnAttention: false })` — for blocking waits only, keep waiting through idle or long-thinking attention; supervisor/contact requests still stop the wait.
37
46
  - `subagent_wait({ timeoutMs })` — cap the block; active work keeps running if it elapses.
38
47
 
39
48
  Providers are discovered through the `pi-subagents/background-work` registry and must return stable item IDs with exact owning session IDs. Child agents receive no provider automatically: keep `subagent_wait` in the child `tools` allowlist and load provider extensions through `extensions` or `subagentOnlyExtensions`.
@@ -59,10 +68,23 @@ user explicitly requests forked context.
59
68
  Give subagents specific tasks rather than vague mandates.
60
69
  `Review auth.ts for null-check gaps` works better than `Review everything`.
61
70
 
71
+ Before fanout, assign each child a lightweight task profile in the parent prompt:
72
+ work kind, required input, expected output, acceptance check, and context mode.
73
+ Keep the profile prose-only; do not invent runtime fields. Use coarse kinds such
74
+ as `code-write`, `code-read`, `transform`, `summarize`, and `search` only to
75
+ shape the task and choose an existing agent/model setting. If a child task is not
76
+ standalone enough for fresh context, add the missing facts to the prompt, switch
77
+ to forked context, or ask the user. Do not launch vague tasks and rely on
78
+ supervisor round-trips to recover missing context.
79
+
62
80
  ### Escalate decisions upward
63
81
 
64
82
  If a subagent encounters an unapproved product, architecture, scope, merge, release, credential, or authority choice, it should use `contact_supervisor` and wait for the reply instead of deciding alone. Generic `intercom` is external or provider-supplied only. Use it only when external bridge instructions provide an explicit safe target. External checks, receipts, and review bots provide evidence only; they do not grant authority.
65
83
 
84
+ ### Use a short oracle consultation for material advice
85
+
86
+ When a user asks to ask, consult, discuss with, or come to agreement with `oracle` about a plan, design, or architecture decision, do not treat the first advisory report as final when it raises a material challenge or tradeoff. Read it, resume the same oracle session once with a targeted question, then make the parent decision. An explicit one-shot request, a trivial question, or a fully settled first answer does not need a follow-up.
87
+
66
88
  ### Intervene only on clear control signals
67
89
 
68
90
  Use subagent control proactively when a delegated run emits `needs_attention`, or when a human asks you to regain control. Do not interrupt just because a child has briefly produced no output. Silence can be normal during long tool calls, test runs, or model reasoning.
@@ -77,8 +99,8 @@ Use `/name` so intercom targeting stays stable.
77
99
 
78
100
  ```js
79
101
  subagent({ workflowScript: `
80
- const context = await runs.run("recon", { agent: "scout", task: "Inspect the codebase and identify the implementation seam" });
81
- return (await runs.run("implement", { agent: "worker", task: "Implement from: " + context.output })).output;
102
+ const context = await runs.run("recon", { agent: "scout", task: "Start from the named source roots, paths, and symbols. Identify the implementation seam before broad search." });
103
+ return (await runs.run("implement", { agent: "worker", task: "Read the scout output, plan paths, and named files/seams first. Implement from: " + context.output })).output;
82
104
  ` })
83
105
  ```
84
106