@chankov/agent-fleet 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (861) hide show
  1. package/.pi/agent-fleet/hooks/coms-stop-hook.mjs +53 -13
  2. package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
  3. package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
  4. package/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +4 -0
  5. package/.pi/agent-fleet/scripts/fleet.ts +13 -17
  6. package/.pi/agent-fleet/scripts/flow.ts +2 -2
  7. package/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
  8. package/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
  9. package/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
  10. package/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
  11. package/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
  12. package/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
  13. package/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +20 -13
  14. package/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
  15. package/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
  16. package/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
  17. package/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
  18. package/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +23 -13
  19. package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +100 -14
  20. package/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +1 -1
  21. package/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
  22. package/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +9 -3
  23. package/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +32 -16
  24. package/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +41 -21
  25. package/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +21 -0
  26. package/.pi/agent-fleet/scripts/lib/fleet-command.ts +4 -8
  27. package/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +2 -1
  28. package/.pi/agent-fleet/scripts/lib/team-project.ts +0 -2
  29. package/.pi/agent-fleet/scripts/team-up.ts +5 -12
  30. package/.pi/agent-fleet/scripts/workflows/lib/git.ts +9 -0
  31. package/.pi/agent-fleet/scripts/workflows/lib/quality.ts +17 -4
  32. package/.pi/agents/model-profiles.yaml +0 -2
  33. package/.pi/harnesses/agent-hub/README.md +116 -67
  34. package/.pi/harnesses/agent-hub/capability-packs.ts +7 -4
  35. package/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
  36. package/.pi/harnesses/agent-hub/commands/context.ts +0 -4
  37. package/.pi/harnesses/agent-hub/commands/recover.ts +2 -1
  38. package/.pi/harnesses/agent-hub/config/agents.ts +3 -1
  39. package/.pi/harnesses/agent-hub/config/model-profiles.ts +3 -0
  40. package/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +14 -1
  41. package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +17 -0
  42. package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +3 -1
  43. package/.pi/harnesses/agent-hub/dispatch-native-types.ts +4 -0
  44. package/.pi/harnesses/agent-hub/dispatch-native.ts +9 -3
  45. package/.pi/harnesses/agent-hub/drift-watchdog.js +5 -10
  46. package/.pi/harnesses/agent-hub/execution-trace.ts +1 -1
  47. package/.pi/harnesses/agent-hub/filesystem-tool.ts +1 -1
  48. package/.pi/harnesses/agent-hub/footer.ts +2 -3
  49. package/.pi/harnesses/agent-hub/helpers.ts +4 -5
  50. package/.pi/harnesses/agent-hub/history-projection.ts +1 -1
  51. package/.pi/harnesses/agent-hub/index.ts +213 -196
  52. package/.pi/harnesses/agent-hub/input/shortcuts.ts +0 -7
  53. package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +0 -2
  54. package/.pi/harnesses/agent-hub/no-progress.ts +14 -9
  55. package/.pi/harnesses/agent-hub/operator-current-state.ts +5 -1
  56. package/.pi/harnesses/agent-hub/package.json +1 -1
  57. package/.pi/harnesses/agent-hub/policy/roster.ts +12 -3
  58. package/.pi/harnesses/agent-hub/policy/work-mode.ts +10 -49
  59. package/.pi/harnesses/agent-hub/poll-command.ts +12 -4
  60. package/.pi/harnesses/agent-hub/proactive-snapshot.ts +12 -4
  61. package/.pi/harnesses/agent-hub/process-obligations.ts +42 -9
  62. package/.pi/harnesses/agent-hub/prompts/context.ts +17 -0
  63. package/.pi/harnesses/agent-hub/prompts/fragments.ts +9 -1
  64. package/.pi/harnesses/agent-hub/prompts/session-start.ts +2 -3
  65. package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +25 -8
  66. package/.pi/harnesses/agent-hub/provider-semaphore.js +5 -0
  67. package/.pi/harnesses/agent-hub/review-continuity.ts +5 -2
  68. package/.pi/harnesses/agent-hub/review-reuse.ts +2 -1
  69. package/.pi/harnesses/agent-hub/run-budget.js +22 -2
  70. package/.pi/harnesses/agent-hub/scope-gate.js +38 -0
  71. package/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
  72. package/.pi/harnesses/agent-hub/task-brief.ts +98 -0
  73. package/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +4 -0
  74. package/.pi/harnesses/agent-hub/tool-catalog-state.ts +5 -3
  75. package/.pi/harnesses/agent-hub/tools/action-executors.ts +5 -7
  76. package/.pi/harnesses/agent-hub/tools/context.ts +2 -0
  77. package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +2 -1
  78. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +184 -33
  79. package/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
  80. package/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
  81. package/.pi/harnesses/agent-hub/tools/run-flow.ts +41 -10
  82. package/.pi/harnesses/agent-hub/tools/team-adjust.ts +1 -1
  83. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +12 -2
  84. package/.pi/harnesses/agent-hub/work-mode.ts +44 -49
  85. package/.pi/harnesses/agent-hub/write-isolation.ts +53 -8
  86. package/.pi/harnesses/coms/package.json +1 -1
  87. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  88. package/.pi/harnesses/lib/codex-compat.ts +97 -0
  89. package/.pi/harnesses/lib/codex-contract.ts +259 -0
  90. package/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
  91. package/.pi/harnesses/lib/coms-core.ts +8 -4
  92. package/.pi/harnesses/lib/context-budget-child-prompt.ts +1 -1
  93. package/.pi/harnesses/lib/context-budget-hub-prompt.ts +6 -3
  94. package/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
  95. package/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
  96. package/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
  97. package/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
  98. package/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
  99. package/.pi/harnesses/lib/fleet-connection-control.ts +20 -3
  100. package/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
  101. package/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
  102. package/.pi/harnesses/lib/fleet-notification-validation.ts +80 -25
  103. package/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
  104. package/.versions/2.2.0/.pi/agent-fleet/hermes/README.md +347 -0
  105. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  106. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  107. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  108. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  109. package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  110. package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  111. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  112. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  113. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  114. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  115. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  116. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  117. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  118. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  119. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  120. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  121. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  122. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  123. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  124. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  125. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  126. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  127. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  128. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  129. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  130. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  131. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  132. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  133. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  134. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  135. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  136. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  137. package/.versions/2.2.0/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  138. package/.versions/2.2.0/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
  139. package/.versions/2.2.0/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  140. package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
  141. package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
  142. package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
  143. package/.versions/2.2.0/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  144. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
  145. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
  146. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
  147. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
  148. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
  149. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
  150. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
  151. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
  152. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
  153. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
  154. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
  155. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
  156. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
  157. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
  158. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
  159. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
  160. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
  161. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
  162. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
  163. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
  164. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
  165. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
  166. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
  167. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
  168. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
  169. package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
  170. package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
  171. package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet.ts +244 -0
  172. package/.versions/2.2.0/.pi/agent-fleet/scripts/flow.ts +166 -0
  173. package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  174. package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  175. package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  176. package/.versions/2.2.0/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  177. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
  178. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
  179. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
  180. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
  181. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
  182. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
  183. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
  184. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
  185. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
  186. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
  187. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
  188. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
  189. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
  190. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  191. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  192. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
  193. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
  194. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
  195. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
  196. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
  197. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
  198. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
  199. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
  200. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
  201. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
  202. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
  203. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
  204. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
  205. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
  206. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
  207. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
  208. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
  209. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
  210. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
  211. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
  212. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
  213. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
  214. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
  215. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
  216. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
  217. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
  218. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
  219. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  220. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  221. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  222. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  223. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  224. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  225. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  226. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  227. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  228. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  229. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  230. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  231. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  232. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  233. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  234. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  235. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  236. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
  237. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
  238. package/.versions/2.2.0/.pi/agent-fleet/scripts/package-lock.json +57 -0
  239. package/.versions/2.2.0/.pi/agent-fleet/scripts/package.json +10 -0
  240. package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  241. package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
  242. package/.versions/2.2.0/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  243. package/.versions/2.2.0/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
  244. package/.versions/2.2.0/.pi/agent-fleet/scripts/team-up.ts +378 -0
  245. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
  246. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  247. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  248. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
  249. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  250. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  251. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
  252. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
  253. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  254. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  255. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  256. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
  257. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  258. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  259. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
  260. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
  261. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
  262. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  263. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
  264. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  265. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
  266. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
  267. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  268. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  269. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  270. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  271. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  272. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  273. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  274. package/.versions/2.2.0/.pi/agents/dispatch-policy.yaml +32 -0
  275. package/.versions/2.2.0/.pi/agents/model-profiles.yaml +132 -0
  276. package/.versions/2.2.0/.pi/agents/peers.yaml +147 -0
  277. package/.versions/2.2.0/.pi/agents/teams.yaml +41 -0
  278. package/.versions/2.2.0/.pi/agents/voices.yaml +13 -0
  279. package/.versions/2.2.0/.pi/damage-control-rules.yaml +297 -0
  280. package/.versions/2.2.0/.pi/extensions/btw/README.md +120 -0
  281. package/.versions/2.2.0/.pi/extensions/btw/index.ts +916 -0
  282. package/.versions/2.2.0/.pi/extensions/btw/package.json +6 -0
  283. package/.versions/2.2.0/.pi/extensions/btw/state.js +179 -0
  284. package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  285. package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  286. package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  287. package/.versions/2.2.0/.pi/extensions/compact-and-continue/README.md +42 -0
  288. package/.versions/2.2.0/.pi/extensions/compact-and-continue/index.ts +136 -0
  289. package/.versions/2.2.0/.pi/extensions/compact-and-continue/package.json +6 -0
  290. package/.versions/2.2.0/.pi/extensions/mcp-bridge/README.md +46 -0
  291. package/.versions/2.2.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  292. package/.versions/2.2.0/.pi/extensions/mcp-bridge/package.json +6 -0
  293. package/.versions/2.2.0/.pi/extensions/package-lock.json +1175 -0
  294. package/.versions/2.2.0/.pi/extensions/package.json +9 -0
  295. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/README.md +224 -0
  296. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/config.ts +199 -0
  297. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  298. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
  299. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/package.json +6 -0
  300. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  301. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  302. package/.versions/2.2.0/.pi/harnesses/agent-hub/README.md +1633 -0
  303. package/.versions/2.2.0/.pi/harnesses/agent-hub/acceptance.ts +204 -0
  304. package/.versions/2.2.0/.pi/harnesses/agent-hub/access-approval.ts +266 -0
  305. package/.versions/2.2.0/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
  306. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
  307. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
  308. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
  309. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
  310. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
  311. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
  312. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
  313. package/.versions/2.2.0/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
  314. package/.versions/2.2.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
  315. package/.versions/2.2.0/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
  316. package/.versions/2.2.0/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
  317. package/.versions/2.2.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  318. package/.versions/2.2.0/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  319. package/.versions/2.2.0/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
  320. package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  321. package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
  322. package/.versions/2.2.0/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
  323. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  324. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  325. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  326. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  327. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  328. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  329. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  330. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  331. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  332. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  333. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  334. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  335. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  336. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  337. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/config.ts +9 -0
  338. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  339. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context.ts +43 -0
  340. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  341. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  342. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  343. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  344. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  345. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  346. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/recover.ts +62 -0
  347. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  348. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  349. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  350. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  351. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  352. package/.versions/2.2.0/.pi/harnesses/agent-hub/config/agents.ts +183 -0
  353. package/.versions/2.2.0/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
  354. package/.versions/2.2.0/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
  355. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  356. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
  357. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
  358. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  359. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  360. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
  361. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
  362. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
  363. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
  364. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
  365. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
  366. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
  367. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
  368. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
  369. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
  370. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
  371. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
  372. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-window.js +108 -0
  373. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
  374. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
  375. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
  376. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
  377. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
  378. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
  379. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
  380. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
  381. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
  382. package/.versions/2.2.0/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  383. package/.versions/2.2.0/.pi/harnesses/agent-hub/delegate.ts +478 -0
  384. package/.versions/2.2.0/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
  385. package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  386. package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  387. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
  388. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  389. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
  390. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
  391. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
  392. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
  393. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
  394. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  395. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
  396. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
  397. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  398. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  399. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  400. package/.versions/2.2.0/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  401. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  402. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  403. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  404. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  405. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
  406. package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  407. package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  408. package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
  409. package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
  410. package/.versions/2.2.0/.pi/harnesses/agent-hub/external-blocker.js +92 -0
  411. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
  412. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
  413. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
  414. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
  415. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
  416. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
  417. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
  418. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
  419. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
  420. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
  421. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
  422. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
  423. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
  424. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
  425. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
  426. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
  427. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
  428. package/.versions/2.2.0/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
  429. package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
  430. package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  431. package/.versions/2.2.0/.pi/harnesses/agent-hub/footer.ts +29 -0
  432. package/.versions/2.2.0/.pi/harnesses/agent-hub/helpers.ts +269 -0
  433. package/.versions/2.2.0/.pi/harnesses/agent-hub/history-projection.ts +116 -0
  434. package/.versions/2.2.0/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
  435. package/.versions/2.2.0/.pi/harnesses/agent-hub/index.ts +2722 -0
  436. package/.versions/2.2.0/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  437. package/.versions/2.2.0/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
  438. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
  439. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  440. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  441. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
  442. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  443. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  444. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  445. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  446. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  447. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  448. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  449. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  450. package/.versions/2.2.0/.pi/harnesses/agent-hub/no-progress.ts +627 -0
  451. package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-current-state.ts +57 -0
  452. package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
  453. package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
  454. package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  455. package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
  456. package/.versions/2.2.0/.pi/harnesses/agent-hub/package.json +7 -0
  457. package/.versions/2.2.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  458. package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
  459. package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
  460. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  461. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  462. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  463. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
  464. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/work-mode.ts +103 -0
  465. package/.versions/2.2.0/.pi/harnesses/agent-hub/poll-command.ts +184 -0
  466. package/.versions/2.2.0/.pi/harnesses/agent-hub/presentation.ts +54 -0
  467. package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
  468. package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
  469. package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
  470. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
  471. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  472. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
  473. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
  474. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  475. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  476. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
  477. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
  478. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
  479. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
  480. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  481. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  482. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
  483. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
  484. package/.versions/2.2.0/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
  485. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
  486. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
  487. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
  488. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
  489. package/.versions/2.2.0/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
  490. package/.versions/2.2.0/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  491. package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  492. package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  493. package/.versions/2.2.0/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
  494. package/.versions/2.2.0/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  495. package/.versions/2.2.0/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  496. package/.versions/2.2.0/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
  497. package/.versions/2.2.0/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
  498. package/.versions/2.2.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  499. package/.versions/2.2.0/.pi/harnesses/agent-hub/return-contract.js +371 -0
  500. package/.versions/2.2.0/.pi/harnesses/agent-hub/return-extract.js +77 -0
  501. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  502. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
  503. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-findings.js +96 -0
  504. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
  505. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
  506. package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  507. package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  508. package/.versions/2.2.0/.pi/harnesses/agent-hub/run-budget.js +362 -0
  509. package/.versions/2.2.0/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  510. package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
  511. package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
  512. package/.versions/2.2.0/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
  513. package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-gate.js +271 -0
  514. package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
  515. package/.versions/2.2.0/.pi/harnesses/agent-hub/session-audit.ts +331 -0
  516. package/.versions/2.2.0/.pi/harnesses/agent-hub/session-health.js +110 -0
  517. package/.versions/2.2.0/.pi/harnesses/agent-hub/session-start.ts +42 -0
  518. package/.versions/2.2.0/.pi/harnesses/agent-hub/spawn.ts +702 -0
  519. package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
  520. package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
  521. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  522. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
  523. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  524. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
  525. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-brief.ts +98 -0
  526. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
  527. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
  528. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
  529. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
  530. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
  531. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  532. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
  533. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  534. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  535. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  536. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  537. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
  538. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  539. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  540. package/.versions/2.2.0/.pi/harnesses/agent-hub/timeline.ts +72 -0
  541. package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
  542. package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
  543. package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  544. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
  545. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
  546. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
  547. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  548. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/context.ts +149 -0
  549. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
  550. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +928 -0
  551. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  552. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  553. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
  554. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
  555. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
  556. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
  557. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
  558. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  559. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
  560. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  561. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
  562. package/.versions/2.2.0/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  563. package/.versions/2.2.0/.pi/harnesses/agent-hub/types.ts +66 -0
  564. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  565. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
  566. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  567. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  568. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
  569. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  570. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  571. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  572. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  573. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  574. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  575. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  576. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  577. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  578. package/.versions/2.2.0/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  579. package/.versions/2.2.0/.pi/harnesses/agent-hub/version.ts +42 -0
  580. package/.versions/2.2.0/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  581. package/.versions/2.2.0/.pi/harnesses/agent-hub/work-mode.ts +183 -0
  582. package/.versions/2.2.0/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
  583. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/README.md +59 -0
  584. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/index.ts +571 -0
  585. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/questions.ts +206 -0
  586. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  587. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
  588. package/.versions/2.2.0/.pi/harnesses/coms/README.md +105 -0
  589. package/.versions/2.2.0/.pi/harnesses/coms/index.ts +308 -0
  590. package/.versions/2.2.0/.pi/harnesses/coms/package.json +7 -0
  591. package/.versions/2.2.0/.pi/harnesses/coms/version.ts +42 -0
  592. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/README.md +161 -0
  593. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/index.ts +659 -0
  594. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/package.json +7 -0
  595. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
  596. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
  597. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
  598. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
  599. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
  600. package/.versions/2.2.0/.pi/harnesses/lib/approval-wait.ts +17 -0
  601. package/.versions/2.2.0/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
  602. package/.versions/2.2.0/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  603. package/.versions/2.2.0/.pi/harnesses/lib/clarification-policy.ts +9 -0
  604. package/.versions/2.2.0/.pi/harnesses/lib/codex-compat.ts +97 -0
  605. package/.versions/2.2.0/.pi/harnesses/lib/codex-contract.ts +259 -0
  606. package/.versions/2.2.0/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
  607. package/.versions/2.2.0/.pi/harnesses/lib/coms-core-io.ts +422 -0
  608. package/.versions/2.2.0/.pi/harnesses/lib/coms-core.ts +738 -0
  609. package/.versions/2.2.0/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
  610. package/.versions/2.2.0/.pi/harnesses/lib/coms-observation.ts +74 -0
  611. package/.versions/2.2.0/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
  612. package/.versions/2.2.0/.pi/harnesses/lib/coms-response-read.ts +107 -0
  613. package/.versions/2.2.0/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
  614. package/.versions/2.2.0/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
  615. package/.versions/2.2.0/.pi/harnesses/lib/context-budget-view.ts +112 -0
  616. package/.versions/2.2.0/.pi/harnesses/lib/context-budget.ts +114 -0
  617. package/.versions/2.2.0/.pi/harnesses/lib/context-compaction-policy.js +35 -0
  618. package/.versions/2.2.0/.pi/harnesses/lib/damage-action-hash.ts +28 -0
  619. package/.versions/2.2.0/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
  620. package/.versions/2.2.0/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
  621. package/.versions/2.2.0/.pi/harnesses/lib/damage-control-shared.ts +276 -0
  622. package/.versions/2.2.0/.pi/harnesses/lib/damage-guard-port.ts +25 -0
  623. package/.versions/2.2.0/.pi/harnesses/lib/damage-policy.ts +35 -0
  624. package/.versions/2.2.0/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
  625. package/.versions/2.2.0/.pi/harnesses/lib/damage-result-view.ts +16 -0
  626. package/.versions/2.2.0/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
  627. package/.versions/2.2.0/.pi/harnesses/lib/exact-permission-port.ts +38 -0
  628. package/.versions/2.2.0/.pi/harnesses/lib/execution-trace.ts +45 -0
  629. package/.versions/2.2.0/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  630. package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  631. package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  632. package/.versions/2.2.0/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
  633. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
  634. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
  635. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
  636. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
  637. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
  638. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
  639. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
  640. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
  641. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
  642. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
  643. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/view.ts +338 -0
  644. package/.versions/2.2.0/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
  645. package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  646. package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
  647. package/.versions/2.2.0/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  648. package/.versions/2.2.0/.pi/harnesses/lib/fleet-event-source.ts +21 -0
  649. package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
  650. package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
  651. package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
  652. package/.versions/2.2.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  653. package/.versions/2.2.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
  654. package/.versions/2.2.0/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
  655. package/.versions/2.2.0/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  656. package/.versions/2.2.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
  657. package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  658. package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  659. package/.versions/2.2.0/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
  660. package/.versions/2.2.0/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  661. package/.versions/2.2.0/.pi/harnesses/lib/herdr-client.ts +472 -0
  662. package/.versions/2.2.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
  663. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  664. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  665. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  666. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  667. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  668. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  669. package/.versions/2.2.0/.pi/harnesses/lib/identical-dialog.ts +27 -0
  670. package/.versions/2.2.0/.pi/harnesses/lib/installation-state.js +62 -0
  671. package/.versions/2.2.0/.pi/harnesses/lib/peer-target.ts +24 -0
  672. package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.js +117 -0
  673. package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.ts +32 -0
  674. package/.versions/2.2.0/.pi/harnesses/lib/process-shared.ts +9 -0
  675. package/.versions/2.2.0/.pi/harnesses/lib/resource-closure.js +26 -0
  676. package/.versions/2.2.0/.pi/harnesses/lib/safe-source-read.js +29 -0
  677. package/.versions/2.2.0/.pi/harnesses/lib/semantic-approval.ts +80 -0
  678. package/.versions/2.2.0/.pi/harnesses/lib/session-target.ts +62 -0
  679. package/.versions/2.2.0/.pi/harnesses/lib/spawned-peers.js +191 -0
  680. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-agentic.js +15 -0
  681. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
  682. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
  683. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
  684. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-json.js +37 -0
  685. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-loader.js +53 -0
  686. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-proactive.js +68 -0
  687. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-triage.js +42 -0
  688. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-v2.js +112 -0
  689. package/.versions/2.2.0/.pi/harnesses/lib/system1/config.js +50 -0
  690. package/.versions/2.2.0/.pi/harnesses/lib/system1/contracts.ts +154 -0
  691. package/.versions/2.2.0/.pi/harnesses/lib/system1/demo.ts +95 -0
  692. package/.versions/2.2.0/.pi/harnesses/lib/system1/jev.ts +503 -0
  693. package/.versions/2.2.0/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
  694. package/.versions/2.2.0/.pi/harnesses/lib/system1/selection.js +11 -0
  695. package/.versions/2.2.0/.pi/harnesses/lib/system1/service.ts +245 -0
  696. package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  697. package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  698. package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  699. package/.versions/2.2.0/.pi/harnesses/lib/target-capabilities.js +7 -0
  700. package/.versions/2.2.0/.pi/harnesses/lib/update-check.ts +227 -0
  701. package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.js +115 -0
  702. package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.ts +22 -0
  703. package/.versions/2.2.0/.pi/harnesses/package-lock.json +2121 -0
  704. package/.versions/2.2.0/.pi/harnesses/package.json +13 -0
  705. package/.versions/2.2.0/.pi/prompts/af-build.md +27 -0
  706. package/.versions/2.2.0/.pi/prompts/af-code-simplify.md +22 -0
  707. package/.versions/2.2.0/.pi/prompts/af-constraints.md +31 -0
  708. package/.versions/2.2.0/.pi/prompts/af-plan.md +17 -0
  709. package/.versions/2.2.0/.pi/prompts/af-review.md +16 -0
  710. package/.versions/2.2.0/.pi/prompts/af-set-hermes-telegram.md +15 -0
  711. package/.versions/2.2.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  712. package/.versions/2.2.0/.pi/prompts/af-setup-rules.md +20 -0
  713. package/.versions/2.2.0/.pi/prompts/af-ship.md +17 -0
  714. package/.versions/2.2.0/.pi/prompts/af-spec.md +15 -0
  715. package/.versions/2.2.0/.pi/prompts/af-test.md +19 -0
  716. package/.versions/2.2.0/.pi/skills/bowser/SKILL.md +145 -0
  717. package/.versions/2.2.0/.version +1 -0
  718. package/.versions/2.2.0/agents/architect.md +24 -0
  719. package/.versions/2.2.0/agents/bowser.md +28 -0
  720. package/.versions/2.2.0/agents/builder.md +55 -0
  721. package/.versions/2.2.0/agents/code-reviewer.md +209 -0
  722. package/.versions/2.2.0/agents/deep-researcher.md +32 -0
  723. package/.versions/2.2.0/agents/documenter.md +22 -0
  724. package/.versions/2.2.0/agents/plan-reviewer.md +83 -0
  725. package/.versions/2.2.0/agents/planner.md +107 -0
  726. package/.versions/2.2.0/agents/releaser.md +24 -0
  727. package/.versions/2.2.0/agents/researcher.md +30 -0
  728. package/.versions/2.2.0/agents/security-auditor.md +167 -0
  729. package/.versions/2.2.0/agents/test-engineer.md +153 -0
  730. package/.versions/2.2.0/agents/web-debugger.md +44 -0
  731. package/.versions/2.2.0/agents/web-performance-auditor.md +194 -0
  732. package/.versions/2.2.0/bin/catalog/harness-runtime-closure.json +85 -0
  733. package/.versions/2.2.0/docs/ARCHITECTURE.md +1291 -0
  734. package/.versions/2.2.0/docs/agent-fleet-setup.md +1161 -0
  735. package/.versions/2.2.0/docs/claude-code-coms-bridge.md +147 -0
  736. package/.versions/2.2.0/docs/codex-local-mcp.md +520 -0
  737. package/.versions/2.2.0/docs/codex-session-bridge.md +44 -0
  738. package/.versions/2.2.0/docs/codex-setup.md +183 -0
  739. package/.versions/2.2.0/docs/coms-hermes-bridge.md +188 -0
  740. package/.versions/2.2.0/docs/fleet-native-voice.md +151 -0
  741. package/.versions/2.2.0/docs/getting-started.md +126 -0
  742. package/.versions/2.2.0/docs/npm-install.md +535 -0
  743. package/.versions/2.2.0/docs/pi-extensions.md +450 -0
  744. package/.versions/2.2.0/docs/pi-setup.md +92 -0
  745. package/.versions/2.2.0/docs/skill-anatomy.md +150 -0
  746. package/.versions/2.2.0/install-manifest.json +3226 -0
  747. package/.versions/2.2.0/justfile +246 -0
  748. package/.versions/2.2.0/manifest-meta.json +1098 -0
  749. package/.versions/2.2.0/references/accessibility-checklist.md +160 -0
  750. package/.versions/2.2.0/references/communication-contract.md +26 -0
  751. package/.versions/2.2.0/references/definition-of-done.md +67 -0
  752. package/.versions/2.2.0/references/fleet-coordination-patterns.md +171 -0
  753. package/.versions/2.2.0/references/observability-checklist.md +92 -0
  754. package/.versions/2.2.0/references/orchestration-patterns.md +370 -0
  755. package/.versions/2.2.0/references/performance-checklist.md +236 -0
  756. package/.versions/2.2.0/references/prompting-patterns.md +380 -0
  757. package/.versions/2.2.0/references/security-checklist.md +245 -0
  758. package/.versions/2.2.0/references/testing-patterns.md +235 -0
  759. package/.versions/2.2.0/references/workflow-authoring.md +304 -0
  760. package/.versions/2.2.0/skills/_internal/grilling.md +59 -0
  761. package/.versions/2.2.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
  762. package/.versions/2.2.0/skills/code-review-and-quality/SKILL.md +396 -0
  763. package/.versions/2.2.0/skills/compound-learning/SKILL.md +137 -0
  764. package/.versions/2.2.0/skills/constraint-driven-development/SKILL.md +338 -0
  765. package/.versions/2.2.0/skills/constraint-driven-development/references/floor-guard.md +99 -0
  766. package/.versions/2.2.0/skills/context-engineering/SKILL.md +341 -0
  767. package/.versions/2.2.0/skills/deprecation-and-migration/SKILL.md +247 -0
  768. package/.versions/2.2.0/skills/designing-agents/SKILL.md +394 -0
  769. package/.versions/2.2.0/skills/designing-agents/pi-harness-authoring.md +222 -0
  770. package/.versions/2.2.0/skills/drafting-workflows/SKILL.md +143 -0
  771. package/.versions/2.2.0/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  772. package/.versions/2.2.0/skills/fleet-connect/SKILL.md +29 -0
  773. package/.versions/2.2.0/skills/fleet-connect.zip +0 -0
  774. package/.versions/2.2.0/skills/fleet-native-voice/SKILL.md +103 -0
  775. package/.versions/2.2.0/skills/fleet-native-voice/agents/openai.yaml +4 -0
  776. package/.versions/2.2.0/skills/fleet-native-voice.zip +0 -0
  777. package/.versions/2.2.0/skills/frontend-ui-engineering/SKILL.md +328 -0
  778. package/.versions/2.2.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  779. package/.versions/2.2.0/skills/idea-refine/SKILL.md +182 -0
  780. package/.versions/2.2.0/skills/idea-refine/examples.md +238 -0
  781. package/.versions/2.2.0/skills/idea-refine/frameworks.md +99 -0
  782. package/.versions/2.2.0/skills/idea-refine/refinement-criteria.md +113 -0
  783. package/.versions/2.2.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  784. package/.versions/2.2.0/skills/incremental-implementation/SKILL.md +353 -0
  785. package/.versions/2.2.0/skills/incremental-implementation.zip +0 -0
  786. package/.versions/2.2.0/skills/interview-me/SKILL.md +226 -0
  787. package/.versions/2.2.0/skills/orchestration-verification/SKILL.md +182 -0
  788. package/.versions/2.2.0/skills/peer-coms/SKILL.md +90 -0
  789. package/.versions/2.2.0/skills/performance-optimization/SKILL.md +496 -0
  790. package/.versions/2.2.0/skills/planning-and-task-breakdown/SKILL.md +318 -0
  791. package/.versions/2.2.0/skills/planning-and-task-breakdown.zip +0 -0
  792. package/.versions/2.2.0/skills/repository-ai-setup/SKILL.md +135 -0
  793. package/.versions/2.2.0/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  794. package/.versions/2.2.0/skills/repository-ai-setup/references/apply-contract.md +74 -0
  795. package/.versions/2.2.0/skills/repository-ai-setup/references/provenance-template.md +16 -0
  796. package/.versions/2.2.0/skills/repository-ai-setup/references/setup-flow.md +108 -0
  797. package/.versions/2.2.0/skills/repository-ai-setup/references/verify-setup.md +20 -0
  798. package/.versions/2.2.0/skills/repository-ai-setup.zip +0 -0
  799. package/.versions/2.2.0/skills/security-and-hardening/SKILL.md +524 -0
  800. package/.versions/2.2.0/skills/spec-driven-development/SKILL.md +295 -0
  801. package/.versions/2.2.0/skills/spec-driven-development.zip +0 -0
  802. package/.versions/2.2.0/skills/using-agent-skills/SKILL.md +198 -0
  803. package/.versions/2.2.0/vendor/agent-skills-upstream/LICENSE +21 -0
  804. package/.versions/2.2.0/vendor/agent-skills-upstream/README.md +430 -0
  805. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  806. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  807. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  808. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  809. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  810. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  811. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  812. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  813. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  814. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  815. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  816. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  817. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  818. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  819. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  820. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  821. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  822. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  823. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  824. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  825. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  826. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  827. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  828. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  829. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  830. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  831. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  832. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  833. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  834. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  835. package/CHANGELOG.md +33 -0
  836. package/README.md +7 -10
  837. package/bin/lib/set-codex-mcp.js +1 -1
  838. package/bin/lib/validate-overrides.js +8 -1
  839. package/docs/ARCHITECTURE.md +122 -26
  840. package/docs/MIGRATION-agent-fleet.md +26 -5
  841. package/docs/agent-fleet-setup.md +44 -26
  842. package/docs/claude-code-coms-bridge.md +1 -1
  843. package/docs/codex-local-mcp.md +29 -12
  844. package/docs/codex-session-bridge.md +2 -2
  845. package/docs/codex-setup.md +1 -1
  846. package/docs/fleet-native-voice.md +10 -4
  847. package/docs/npm-install.md +1 -1
  848. package/docs/pi-extensions.md +13 -18
  849. package/docs/system1-agentic.md +1 -1
  850. package/docs/system1-file-discovery.md +2 -2
  851. package/docs/workflows.md +24 -1
  852. package/install-manifest.json +15 -28
  853. package/justfile +3 -4
  854. package/manifest-meta.json +13 -2
  855. package/package.json +4 -2
  856. package/skills/fleet-connect/SKILL.md +20 -16
  857. package/skills/fleet-connect.zip +0 -0
  858. package/skills/fleet-native-voice.zip +0 -0
  859. package/.pi/harnesses/agent-hub/commands/work-mode.ts +0 -29
  860. package/.pi/harnesses/agent-hub/work-mode-controls.ts +0 -56
  861. package/agents/orchestrator.md +0 -22
@@ -1,3 +1,4 @@
1
+ import { basePersonaName, parallelInstanceName } from "../run-budget.js";
1
2
  import { privateRequirements, privateDeclarationHash, privateClassification, type PrivateProofUse } from '../private-config-review.ts';
2
3
  import { capturePrivateConfig, privateConfigRevision, type PrivateConfigBinding } from '../private-config-current-state.ts';
3
4
  import { finishPrivateConfigReview } from '../private-config-review.ts';
@@ -19,7 +20,8 @@ import { blockingFindingCap, checkTierPersonaGate, isReviewPersona, reviewBudget
19
20
  import { countReviewFindings, findingBudgetNotice } from "../review-findings.js";
20
21
  import { checkDocsLane, docsLaneNotice } from "../docs-lane.js";
21
22
  import { checkExternalBlockerGate, extractExternalBlockers } from "../external-blocker.js";
22
- import { checkScope, diffAgainst, reviewableChangedPaths, snapshotRevision, snapshotWorktree, worktreeRevision } from "../scope-gate.js";
23
+ import { checkScope, diffAgainst, nestedRevisionScopes, reviewableChangedPaths, revisionOf, revisionScopes, snapshotRevision, snapshotWorktree, worktreeRevision } from "../scope-gate.js";
24
+ import { findScopeOverlap } from "../scope-overlap.ts";
23
25
  import { diagnoseChangedTypeScript, formatAdvisory, type DiagnosticsResult } from "../../lib/changed-file-diagnostics.ts";
24
26
  import { correctStructuredReturnForCompiler, crossCheck, deliveryDisposition, extractAssertionIds, parseDeliveredReturn } from "../return-contract.js";
25
27
  import { shouldExtractReturn } from "../return-extract.js";
@@ -38,6 +40,8 @@ import { authorizePlanStatusUpdate } from "../orchestration-route.ts";
38
40
  type Gate = { reason: string; message: string } | null;
39
41
  type DispatchResult = import("../dispatch-native-types.ts").NativeDispatchResult;
40
42
 
43
+ export interface WriterEntry { agent: string; scope: string[]; isolated: boolean }
44
+
41
45
  export interface DispatchExecutionState {
42
46
  getTurnDispatchCount(): number; setTurnDispatchCount(value: number): void;
43
47
  getTurnResearchCount(): number; setTurnResearchCount(value: number): void;
@@ -58,6 +62,18 @@ export interface DispatchExecutionState {
58
62
  getAgentStates(): Map<string, AgentState>;
59
63
  getAssertions(): Array<{ id: string; tag: string; text: string; source: string; reference?: string; criticalConditions?: string[]; testCommand?: string; compilerCommand?: string; status: string; evidence?: string; evidenceTaskId?: string; evidenceRevision?: string }>;
60
64
  getResearchPersonas(): ResearchAgentDef[];
65
+ /** Adds an installed, dispatchable persona to the active team; null when none is installed under that name. */
66
+ addInstalledAgent?(agent: string): { ok: boolean; message: string } | null;
67
+ /** Installed personas dispatch_agent may target (research and catalog-only personas excluded). */
68
+ getInstalledAgentNames?(): string[];
69
+ /** Writable dispatches running now, with their declared scope and whether they are OS-isolated. */
70
+ getActiveWriters?(): WriterEntry[];
71
+ /** Registers a writable dispatch; an isolated one makes its native launch sandboxed. Returns its release. */
72
+ beginWriter?(entry: WriterEntry): () => void;
73
+ /** Creates (or reuses) a parallel instance of an installed writable persona, e.g. builder-2. */
74
+ addAgentInstance?(base: string, instance: string): boolean;
75
+ /** Records an admitted delegation in the current task brief. */
76
+ recordDelegation?(entry: { agent: string; kind: "specialist" | "research"; task: string; scope: string[]; researchId?: number }): void;
61
77
  getActiveWritableDispatches(): number; setActiveWritableDispatches(value: number): void;
62
78
  getWritableOverlapCounter(): number; setWritableOverlapCounter(value: number): void;
63
79
  getProcessState?(): ProcessObligationState;
@@ -73,7 +89,7 @@ export interface DispatchExecutorDeps {
73
89
  artifacts: AssertionsArtifactsContext;
74
90
  research: ResearchRuntime<any>;
75
91
  provisionalCapabilityRefusal(pack: "fleet"): ToolExecutionResult | null;
76
- dispatchAgent(agent: string, task: string, ctx: ExtensionContext, artifacts: InputArtifactPreview[], scope: string[], watchdog?: boolean, backend?: "auto" | "native" | "coms", resume?: boolean, resumeContract?: Omit<TaskResumeInput, "previous">): Promise<DispatchResult>;
92
+ dispatchAgent(agent: string, task: string, ctx: ExtensionContext, artifacts: InputArtifactPreview[], scope: string[], watchdog?: boolean, backend?: "auto" | "native" | "coms", resume?: boolean, resumeContract?: Omit<TaskResumeInput, "previous">, revisionScopes?: string[]): Promise<DispatchResult>;
77
93
  runReturnExtraction(path: string, ids: string[], ctx: ExtensionContext): Promise<any>;
78
94
  /** Opt-in profile assistance: recover a missing submit_result from the written report. */
79
95
  returnExtractionAssist?(): boolean;
@@ -86,10 +102,10 @@ export interface DispatchExecutorDeps {
86
102
  diagnoseChangedTypeScript?: typeof diagnoseChangedTypeScript;
87
103
  }
88
104
 
89
- interface PreparedDispatch { privateConfig?: PrivateConfigBinding; operatorCandidate?: OperatorStateCandidate; beforeSnapshot?: unknown; reviewBaseline?: ReviewBaseline|null; reviewInput?: ReviewInput|null; taskToken: object; taskId: string; beforeRevision: string; requirements: AcceptanceRequirement[]; contract: DeliverableContract; resumeContract: Omit<TaskResumeInput, "previous">; sessionDir: string; agent: string; task: string; inputArtifacts: InputArtifactPreview[]; scopeGlobs: string[]; fingerprint: string; }
105
+ interface PreparedDispatch { privateConfig?: PrivateConfigBinding; operatorCandidate?: OperatorStateCandidate; beforeSnapshot?: unknown; reviewBaseline?: ReviewBaseline|null; reviewInput?: ReviewInput|null; taskToken: object; taskId: string; beforeRevision: string; /** Task revision basis (D8); [] at a root repository. */ revisionScopes: string[]; requirements: AcceptanceRequirement[]; contract: DeliverableContract; resumeContract: Omit<TaskResumeInput, "previous">; sessionDir: string; agent: string; task: string; inputArtifacts: InputArtifactPreview[]; scopeGlobs: string[]; fingerprint: string; parallel?: boolean; }
90
106
  interface RunData { result: DispatchResult; billed: number; out: number; researchRounds: { questions: string[]; files: string[] }[]; }
91
- interface Tracking { receiptCapture?: ReceiptCapture; writable: boolean; snapshot: any; overlapBaseline: number; concurrentAtStart: boolean; }
92
- interface WorktreeObservation { skipped: boolean; reason?: string; paths: string[]; snapshot?: unknown; concurrentWritableOverlap: boolean; gaps?: Array<{ scope: string; reason: string }>; repositories?: Array<{ root: string; prefix: string; head: string; scopes: string[] }>; }
107
+ interface Tracking { receiptCapture?: ReceiptCapture; writable: boolean; snapshot: any; overlapBaseline: number; concurrentAtStart: boolean; release?: () => void; isolatedScope?: string[]; }
108
+ interface WorktreeObservation { skipped: boolean; reason?: string; paths: string[]; foreignPaths?: string[]; snapshot?: unknown; concurrentWritableOverlap: boolean; gaps?: Array<{ scope: string; reason: string }>; repositories?: Array<{ root: string; prefix: string; head: string; scopes: string[] }>; }
93
109
 
94
110
  export function preflightGate(d: DispatchExecutorDeps, persona: string): Gate {
95
111
  const s = d.state;
@@ -116,7 +132,7 @@ function refusalSnapshot(d: DispatchExecutorDeps, ctx: ExtensionContext): string
116
132
  const tier = (d.state as any)?.getTaskTier?.() ?? "unknown";
117
133
  const catalog = (d as any)?.getToolCatalogVersion?.() ?? "unknown";
118
134
  let revision = "unavailable";
119
- try { revision = worktreeRevision(ctx.cwd || process.cwd(), []); } catch {}
135
+ try { const cwd = ctx.cwd || process.cwd(); revision = revisionOf(cwd, revisionScopes(cwd, (d.state as any)?.getProcessState?.()?.changedFiles ?? [])); } catch {}
120
136
  return `Snapshot: tier "${tier}", catalog "${catalog}", revision "${revision}". Prompt prose did not change state.`;
121
137
  } catch { return "Snapshot unavailable."; }
122
138
  }
@@ -145,15 +161,28 @@ function unknownAgentMessage(agent: string, available: string[], researchHint: b
145
161
  const research = researchHint
146
162
  ? `\n\n"${agent}" is a research persona. Call spawn_research with persona "${agent}" instead of dispatch_agent. Do not invent a substitute dispatch.`
147
163
  : "";
148
- return `Unknown agent "${agent}". dispatch_agent only accepts the active roster. Available agents: ${roster}.${research}\n\nDo not invent a substitute dispatch. ${["planner", "code-reviewer", "plan-reviewer", "security-auditor"].includes(agent) ? `Ask the human to activate the required role with /af-agents-add ${agent} or /af-agents-team; this does not change the tier or budget. ` : ""}Use an available agent, or spawn_research for a research persona.`;
164
+ const processRole = !researchHint && ["planner", "code-reviewer", "plan-reviewer", "security-auditor"].includes(agent)
165
+ ? `Ask the human to install the ${agent} persona (agent-fleet setup, or /af-agents-add ${agent} when its file is present); once installed, dispatching it adds it to the team. This does not change the tier or budget. `
166
+ : "";
167
+ return `Unknown agent "${agent}". dispatch_agent accepts installed agents. Installed agents: ${roster}.${research}\n\nDo not invent a substitute dispatch. ${processRole}Use an installed agent, or spawn_research for a research persona.`;
149
168
  }
150
169
 
151
- export function validateDispatchAgent(d: DispatchExecutorDeps, agent: string, task: string): ToolExecutionResult | null {
152
- const available = rosterNames(d);
153
- const onRoster = d.state.getAgentStates().has(agent) || available.some(name => normalizeAgentInput(name) === agent);
170
+ export function validateDispatchAgent(d: DispatchExecutorDeps, agent: string, task: string, ctx?: ExtensionContext): ToolExecutionResult | null {
171
+ const roster = rosterNames(d);
172
+ let onRoster = d.state.getAgentStates().has(agent) || roster.some(name => normalizeAgentInput(name) === agent);
173
+ const available = [...new Set([...roster, ...(d.state.getInstalledAgentNames?.() ?? [])])];
154
174
  if (isResearchDispatchName(d, agent)) {
155
175
  return refusal(d, agent, task, "research_persona_via_dispatch", unknownAgentMessage(agent, available, true), "research_persona_via_dispatch");
156
176
  }
177
+ if (!onRoster) {
178
+ // Every installed agent is dispatchable. The first dispatch adds it to the
179
+ // active team, so backend policy and session reuse keep working per member.
180
+ const added = d.state.addInstalledAgent?.(agent) ?? null;
181
+ if (added?.ok) {
182
+ onRoster = true;
183
+ try { ctx?.ui?.notify?.(`dispatch_agent: ${added.message}`, "info"); } catch { /* observational only */ }
184
+ }
185
+ }
157
186
  if (!onRoster) {
158
187
  return refusal(d, agent, task, "unknown_agent", unknownAgentMessage(agent, available, false), "unknown_agent");
159
188
  }
@@ -188,6 +217,39 @@ function appendRuntimeAcceptanceContract(task: string, requirements: AcceptanceR
188
217
  return `${task}\n\n## Runtime acceptance contract (machine-appended)\nThese requirements survive dispatch and compaction. A claim, file presence, or listed command is not proof; report evidence, while the runtime decides acceptance.\n${lines.join("\n")}`;
189
218
  }
190
219
 
220
+ const SCOPE_GLOB = /[*?[\]{}!]/;
221
+
222
+ /**
223
+ * Writes run one at a time unless every concurrent writer is OS-isolated to a
224
+ * disjoint exact scope (PHILOSOPHY, 2026-11-11). "Writable" follows the existing
225
+ * rule (write, edit or bash), so a bash-capable reviewer is also a writer; an
226
+ * isolated writer with an empty scope cannot write to the repository at all.
227
+ */
228
+ export function parallelWriterGate(d: DispatchExecutorDeps, agent: string, params: DispatchAgentParams): ToolExecutionResult | null {
229
+ const s = d.state; const def = s.getAgentStates().get(agent)?.def;
230
+ if (!def || !hasWriteCapability(def.tools)) return null;
231
+ const parallel = params.parallel === true;
232
+ const scope = (params.scope || []).map(String).map(entry => entry.trim()).filter(Boolean);
233
+ if (parallel) {
234
+ if (params.backend === "coms") return refusal(d, agent, params.task, "parallel_requires_native", "parallel: true needs the native OS write sandbox; a coms peer cannot be isolated. Use backend auto or native.");
235
+ const glob = scope.find(entry => SCOPE_GLOB.test(entry));
236
+ if (glob) return refusal(d, agent, params.task, "parallel_scope_invalid", `parallel: true needs exact existing files or directories as scope; globs cannot be enforced by the sandbox (${glob}).`);
237
+ if (params.scope_mode === "create") return refusal(d, agent, params.task, "parallel_scope_invalid", "parallel: true needs existing scope paths; create new files inside an existing directory that is in scope.");
238
+ }
239
+ const active = s.getActiveWriters?.()
240
+ ?? Array.from({ length: s.getActiveWritableDispatches() }, () => ({ agent: "a writable dispatch", scope: [], isolated: false }));
241
+ if (!active.length) return null;
242
+ const names = active.map(writer => writer.agent).join(", ");
243
+ if (!parallel) return refusal(d, agent, params.task, "writer_active", `${names} is running as a writable dispatch, so writes stay sequential; nothing started or charged. Wait for it to finish, or run writers together by dispatching each with parallel: true and disjoint exact scopes.`);
244
+ const open = active.find(writer => !writer.isolated);
245
+ if (open) return refusal(d, agent, params.task, "writer_active_unisolated", `${open.agent} is running without write isolation, so no other writer may start; nothing started or charged. Wait for it to finish.`);
246
+ for (const writer of active) {
247
+ const overlap = scope.length && writer.scope.length ? findScopeOverlap(scope, writer.scope) : null;
248
+ if (overlap) return refusal(d, agent, params.task, "scope_overlap", `Scope overlaps ${writer.agent}'s running write scope (${overlap.left} ↔ ${overlap.right}); nothing started or charged. Give parallel writers disjoint scopes or wait.`);
249
+ }
250
+ return null;
251
+ }
252
+
191
253
  export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentParams, ctx: ExtensionContext): PreparedDispatch | ToolExecutionResult {
192
254
  const s = d.state; const { task, artifacts, scope, review_reason } = params; const agent = normalizeAgentInput(params.agent);
193
255
  const privateMode = params.review_mode === 'private-config-current-state';
@@ -205,8 +267,10 @@ export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentPa
205
267
  if(operatorMode){try{operatorScopeSyntax(scope);}catch{return refusal(d,agent,task,'operator_state_preflight_failed','Current-state scope must contain 1–128 unique exact files; no aliases/globs.');}}
206
268
  if(operatorMode && (!['code-reviewer','security-auditor'].includes(agent)||params.backend!=='native'||params.scope_mode==='create'||params.deliverables?.length||!s.getProcessState))
207
269
  return refusal(d,agent,task,'operator_state_preflight_failed','Current-state verification requires a native code/security reviewer, existing exact files and no deliverables.');
208
- const rosterRefusal = validateDispatchAgent(d, agent, task);
270
+ const rosterRefusal = validateDispatchAgent(d, agent, task, ctx);
209
271
  if (rosterRefusal) return rosterRefusal;
272
+ const writerRefusal = parallelWriterGate(d, agent, params);
273
+ if (writerRefusal) return writerRefusal;
210
274
  if (s.getAgentStates().get(agent)?.status === "running") return { content: [{ type: "text", text: "Agent is busy; nothing started, queued or charged. Re-invoke explicitly after it is idle." }], details: { status: "busy", reason: "busy", recoveryCategory: "busy", started: false, exitCode: 1 } };
211
275
  d.budget.ensureTaskTier();
212
276
  const processGate = s.processBlock?.() ?? (s.getProcessState ? processPreEffectGate(s.getProcessState(), "child", agent) : { reason: "process_state_unavailable", message: "Process state is unavailable; child launch fails closed." });
@@ -216,6 +280,13 @@ export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentPa
216
280
  try { contract = preflightDeliverables(params, { cwd: ctx.cwd || process.cwd(), sessionDir: s.getSessionDir() }); }
217
281
  catch (error) { return refusal(d, agent, task, "scope_preflight_failed", String(error)); }
218
282
  const takeSnapshot=()=>snapshotWorktree(ctx.cwd||process.cwd(),(scope||[]).map(String).map(x=>x.trim()).filter(Boolean));
283
+ // The task revision basis (D8, 2026-11-12), read off the snapshot this dispatch takes
284
+ // anyway: [] at a root repository, where every revision is the whole repository as
285
+ // before; otherwise each nested repository holding a declared path or a registered
286
+ // task file, whole.
287
+ const basisPaths=[...(scope||[]).map(String).map(x=>x.trim()).filter(Boolean),...(s.getProcessState?.().changedFiles??[])];
288
+ const basisFor=(snapshot:any):string[]=>snapshot?.nested?nestedRevisionScopes(ctx.cwd||process.cwd(),basisPaths):snapshot?.skipped&&basisPaths.length?revisionScopes(ctx.cwd||process.cwd(),basisPaths):[];
289
+ const revisionFor=(snapshot:any,basis:string[])=>basis.length?revisionOf(ctx.cwd||process.cwd(),basis):snapshotRevision(snapshot);
219
290
  let operatorCandidate:OperatorStateCandidate|undefined,operatorSnapshot:any;
220
291
  if(operatorMode){
221
292
  try {
@@ -223,7 +294,7 @@ export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentPa
223
294
  if(!state||tools.some(t=>['edit','write'].includes(t)))throw Error('operator_state_writable_tools');
224
295
  if(!tools.includes('bash'))throw Error('operator_state_tests_unavailable');
225
296
  operatorSnapshot=takeSnapshot();
226
- operatorCandidate=captureOperatorState({scope,cwd:ctx.cwd||process.cwd(),snapshot:operatorSnapshot,revision:snapshotRevision(operatorSnapshot)});
297
+ operatorCandidate=captureOperatorState({scope,cwd:ctx.cwd||process.cwd(),snapshot:operatorSnapshot,revision:revisionFor(operatorSnapshot,basisFor(operatorSnapshot))});
227
298
  if(checkScope(s.getProcessState!().changedFiles,operatorCandidate.paths).outOfScope.length)throw Error('operator_state_incomplete_scope');
228
299
  }catch(e){return refusal(d,agent,task,'operator_state_preflight_failed',e instanceof Error&&/^operator_state_[a-z_]+$/.test(e.message)?e.message:'operator_state_scope_unavailable');}
229
300
  }
@@ -236,6 +307,7 @@ export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentPa
236
307
  if (isReviewPersona(agent)) s.setTaskReviewRounds(s.getTaskReviewRounds() + 1);
237
308
  s.getSessionTotals().dispatches++; d.budget.updateModeStatus();
238
309
  const scopeGlobs = (scope || []).map(String).map(x => x.trim()).filter(Boolean);
310
+ try { s.recordDelegation?.({ agent, kind: "specialist", task, scope: scopeGlobs }); } catch { /* the brief is a record, never a gate */ }
239
311
  const requirements = privateMode ? privateRequirements(s.getAssertions() as AcceptanceRequirement[]) : dispatchRequirements(d, agent, operatorMode ? '' : task);
240
312
  const privateConfig: PrivateConfigBinding | undefined = privateMode ? {files: [...params.private_config_files!].sort(), sources: [...params.verifier_sources!].sort(), taskId: d.noProgress.taskId(), sessionDir: s.getSessionDir(), declarationHash: receiptDeclarationHash(requirements, scopeGlobs, s.getAcceptedUserInput?.(), inputArtifacts), captureId: '', generation: '', epoch: 0} : undefined;
241
313
  const acceptedTask = appendRuntimeAcceptanceContract(task, requirements) + (privateConfig ? '\n\n## Private configuration current-state review\nReview the declared verifier/helper sources for semantic adequacy and completeness of declared dependencies. Private bodies are NOT input artifacts: never attach, copy, quote or export them. Run each exact declared offline command through approved bash. No activation, notification runtime, sockets, grants, policy changes or journal replay. Return an explicit APPROVE/REJECT and full scoped regression evidence. This private proof cannot satisfy Git source obligations.\nVerifier/helper sources: ' + JSON.stringify(privateConfig.sources) : '') + (operatorCandidate ? '\n\n## Explicit operator-current-state verification\nInspect the exact current candidate; do not modify source or claim historical authorship. Run every explicit automated verification command through approved bash, and report full scoped regression evidence. Manual assertions remain unsupported by automation. Return an explicit APPROVE/REJECT; runtime verifies unchanged scope/revision and actual checks. This does not make your read-only task a changed-task success.' : '');
@@ -252,7 +324,8 @@ export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentPa
252
324
  };
253
325
  // One pre-run snapshot is both the revision baseline and a writable run's delta base.
254
326
  const beforeSnapshot = operatorSnapshot ?? takeSnapshot();
255
- return { privateConfig, operatorCandidate, beforeSnapshot, reviewInput: !privateMode && s.getProcessState ? reviewInput(ctx.cwd || process.cwd(), d.noProgress.taskId(), agent, scopeGlobs, operatorReviewState(s.getProcessState(),operatorCandidate), s.getAssertions(), inputArtifacts, s.getAcceptedUserInput?.()) : null, taskToken: d.noProgress.taskToken(), taskId: resumeContract.taskId, beforeRevision: snapshotRevision(beforeSnapshot), requirements, contract, resumeContract, sessionDir: s.getSessionDir(), agent, task: declaredTask, inputArtifacts, scopeGlobs, fingerprint };
327
+ const revisionBasis = basisFor(beforeSnapshot);
328
+ return { privateConfig, operatorCandidate, beforeSnapshot, reviewInput: !privateMode && s.getProcessState ? reviewInput(ctx.cwd || process.cwd(), d.noProgress.taskId(), agent, scopeGlobs, operatorReviewState(s.getProcessState(),operatorCandidate), s.getAssertions(), inputArtifacts, s.getAcceptedUserInput?.()) : null, taskToken: d.noProgress.taskToken(), taskId: resumeContract.taskId, beforeRevision: revisionFor(beforeSnapshot, revisionBasis), revisionScopes: revisionBasis, requirements, contract, resumeContract, sessionDir: s.getSessionDir(), agent, task: declaredTask, inputArtifacts, scopeGlobs, fingerprint, parallel: params.parallel === true };
256
329
  }
257
330
 
258
331
  function startTracking(d: DispatchExecutorDeps, prepared: PreparedDispatch, ctx: ExtensionContext): Tracking {
@@ -262,8 +335,14 @@ function startTracking(d: DispatchExecutorDeps, prepared: PreparedDispatch, ctx:
262
335
  tracking.concurrentAtStart = s.getActiveWritableDispatches() > 0;
263
336
  if (tracking.concurrentAtStart) s.setWritableOverlapCounter(s.getWritableOverlapCounter() + 1);
264
337
  s.setActiveWritableDispatches(s.getActiveWritableDispatches() + 1);
338
+ // Registering an isolated writer is what makes its native launch sandboxed to its scope.
339
+ tracking.release = s.beginWriter?.({ agent: prepared.agent, scope: prepared.scopeGlobs, isolated: prepared.parallel === true });
340
+ if (prepared.parallel) tracking.isolatedScope = prepared.scopeGlobs;
265
341
  tracking.snapshot = prepared.beforeSnapshot ?? snapshotWorktree(ctx.cwd || process.cwd(), prepared.scopeGlobs);
266
342
  }
343
+ try { anchorReceipts(); } catch (error) { tracking.release?.(); throw error; }
344
+ return tracking;
345
+ function anchorReceipts(): void {
267
346
  if (canWrite && s.getProcessState && s.setProcessState && s.persistProcessVerdict) {
268
347
  const processState = s.getProcessState();
269
348
  const started = beginReceiptCapture(processState.runtimeReceipts, { taskId: prepared.taskId, sessionDir: prepared.sessionDir, scope: prepared.scopeGlobs, declarationHash: receiptDeclarationHash(prepared.requirements, prepared.scopeGlobs, s.getAcceptedUserInput?.(), prepared.inputArtifacts) }, !tracking.concurrentAtStart);
@@ -279,12 +358,12 @@ function startTracking(d: DispatchExecutorDeps, prepared: PreparedDispatch, ctx:
279
358
  if (prepared.beforeRevision === 'unavailable') throw Error('Private capture unavailable');
280
359
  }
281
360
  }
282
- return tracking;
361
+ }
283
362
  }
284
363
 
285
364
  async function runWithAutoResearch(d: DispatchExecutorDeps, p: PreparedDispatch, params: DispatchAgentParams, ctx: ExtensionContext, onUpdate: ToolUpdate): Promise<RunData> {
286
365
  const findingClause = reviewBudgetClause(d.state.getTaskTier(), p.agent); const dispatchedTask = findingClause ? `${p.task}\n\n${findingClause}` : p.task;
287
- let result = await d.dispatchAgent(p.agent, dispatchedTask, ctx, p.inputArtifacts, p.scopeGlobs, params.watchdog, params.backend ?? "auto", false, p.resumeContract);
366
+ let result = await d.dispatchAgent(p.agent, dispatchedTask, ctx, p.inputArtifacts, p.scopeGlobs, params.watchdog, params.backend ?? "auto", false, p.resumeContract, p.revisionScopes);
288
367
  let billed = result.billed ?? 0; let out = result.out ?? 0; const researchRounds: RunData["researchRounds"] = [];
289
368
  while (result.exitCode === 0 && researchRounds.length < MAX_AUTO_RESEARCH_ROUNDS && p.taskToken === d.noProgress.taskToken() && p.sessionDir === d.state.getSessionDir()) {
290
369
  const questions = d.extractNeedsResearch(result.output).slice(0, MAX_AUTO_RESEARCH_QUESTIONS); if (!questions.length) break;
@@ -299,14 +378,29 @@ async function runWithAutoResearch(d: DispatchExecutorDeps, p: PreparedDispatch,
299
378
  researchRounds.push({ questions, files: answered.map(a => a.file) });
300
379
  const resume = "Research findings for your NEEDS_RESEARCH questions are ready. Read each file with your read tool, then continue from where you paused:\n" + answered.map((a, i) => `${i + 1}. ${a.question}\n → ${a.file}`).join("\n");
301
380
  if (p.taskToken !== d.noProgress.taskToken() || p.sessionDir !== d.state.getSessionDir()) break;
302
- result = await d.dispatchAgent(p.agent, resume, ctx, p.inputArtifacts, p.scopeGlobs, params.watchdog, params.backend ?? "auto", true, p.resumeContract); billed += result.billed ?? 0; out += result.out ?? 0;
381
+ result = await d.dispatchAgent(p.agent, resume, ctx, p.inputArtifacts, p.scopeGlobs, params.watchdog, params.backend ?? "auto", true, p.resumeContract, p.revisionScopes); billed += result.billed ?? 0; out += result.out ?? 0;
303
382
  }
304
383
  return { result, billed, out, researchRounds };
305
384
  }
306
385
 
386
+ /** Writable dispatches running now other than this one (registry when available, else the counter). */
387
+ function otherActiveWriters(d: DispatchExecutorDeps, p: PreparedDispatch, tracking: Tracking): { agent: string }[] {
388
+ const s = d.state;
389
+ const writers = s.getActiveWriters?.()
390
+ ?? Array.from({ length: Math.max(0, s.getActiveWritableDispatches() - (tracking.writable ? 1 : 0)) }, () => ({ agent: "a writable dispatch" }));
391
+ return writers.filter(writer => writer.agent.toLowerCase() !== p.agent.toLowerCase());
392
+ }
393
+
307
394
  function observeWorktree(d: DispatchExecutorDeps, tracking: Tracking, ctx: ExtensionContext): WorktreeObservation | null {
308
395
  if (!tracking.snapshot) return null;
309
396
  const diff = diffAgainst(tracking.snapshot, ctx.cwd || process.cwd());
397
+ if (tracking.isolatedScope && !diff.skipped) {
398
+ // The OS sandbox confined this writer to its scope, and the admission gate let
399
+ // only isolated writers with disjoint scopes run beside it. Changes outside
400
+ // its scope cannot be its own; they are reported, never attributed to it.
401
+ const own = tracking.isolatedScope.length ? checkScope(diff.paths, tracking.isolatedScope).inScope : [];
402
+ return { ...diff, paths: own, foreignPaths: diff.paths.filter(path => !own.includes(path)), concurrentWritableOverlap: false };
403
+ }
310
404
  const concurrentWritableOverlap = tracking.concurrentAtStart || d.state.getWritableOverlapCounter() !== tracking.overlapBaseline;
311
405
  return { ...diff, concurrentWritableOverlap };
312
406
  }
@@ -394,7 +488,7 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
394
488
  compilerDiagnostics = incompleteObservation(`compiler diagnostics failed safely: ${String(error)}`, observation.concurrentWritableOverlap);
395
489
  }
396
490
  }
397
- if (observation) {
491
+ if (observation && !tracking.isolatedScope) {
398
492
  observation.concurrentWritableOverlap = observation.concurrentWritableOverlap || tracking.concurrentAtStart || s.getWritableOverlapCounter() !== tracking.overlapBaseline;
399
493
  if (compilerDiagnostics && observation.concurrentWritableOverlap) compilerDiagnostics = { ...compilerDiagnostics, attribution: "uncertain" };
400
494
  }
@@ -434,7 +528,9 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
434
528
  }
435
529
  }
436
530
  const executionStatus = disposition.pending ? "pending" : disposition.delivered ? "completed" : "failed";
437
- const repositoryAfterRevision = compilerRan ? worktreeRevision(cwd, [], p.scopeGlobs) : compilerInspectedRevision;
531
+ const repositoryAfterRevision = p.revisionScopes.length ? revisionOf(cwd, p.revisionScopes) : compilerRan ? worktreeRevision(cwd, [], p.scopeGlobs) : compilerInspectedRevision;
532
+ // Each recorded stage is checked over the basis it was recorded with.
533
+ const stageRevision = (scopes: readonly string[]) => scopes.join("\n") === p.revisionScopes.join("\n") ? afterRevision : revisionOf(cwd, [...scopes]);
438
534
  const afterRevision = p.privateConfig ? privateConfigRevision(cwd, repositoryAfterRevision, p.privateConfig) : repositoryAfterRevision;
439
535
  const changes = !tracking.writable || !observation
440
536
  ? { status: "unknown" as const, paths: [] as string[], attribution: "not_observed" as const }
@@ -534,9 +630,9 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
534
630
  let processState = s.getProcessState();
535
631
  const taskChanges = (paths: string[]) => reviewableChangedPaths(paths, cwd, p.sessionDir, p.scopeGlobs, p.contract.files.map(file => file.path));
536
632
  if (!p.privateConfig && !p.operatorCandidate && runtimeResult.acceptance.accepted && runtimeResult.verification.evidenceRefs[0]) {
537
- processState = noteProcessStage(processState, "acceptance", { evidenceRef: runtimeResult.verification.evidenceRefs[0], revision: afterRevision, changedFiles: taskChanges(observation?.paths ?? []) });
633
+ processState = noteProcessStage(processState, "acceptance", { evidenceRef: runtimeResult.verification.evidenceRefs[0], revision: afterRevision, revisionScopes: p.revisionScopes, changedFiles: taskChanges(observation?.paths ?? []) });
538
634
  }
539
- const stage = p.privateConfig ? null : p.agent === "planner" ? "plan" : isReviewPersona(p.agent) ? "review" : null;
635
+ const stage = p.privateConfig ? null : basePersonaName(p.agent) === "planner" ? "plan" : isReviewPersona(p.agent) ? "review" : null;
540
636
  const affirmativeReview = affirmativeReviewVerdict(result.output);
541
637
  // Candidate registration happens only after independent review and actual
542
638
  // same-revision runtime checks, never from reported past edits.
@@ -553,13 +649,17 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
553
649
  if(candidateReady&&p.operatorCandidate){
554
650
  try {
555
651
  const evidenceRef=persistOperatorStateProof({writer:d.artifacts.writeRunArtifact,sessionDir:p.sessionDir,runCount:state?.runCount??0,dispatchId:result.dispatchId||randomUUID(),record:{schema:'agent-fleet.operator-state-verification/v1',...p.operatorCandidate,taskId:p.taskId,checks:runtimeResult.verification.checks,manualAssertions:'not_automatically_proven'}});
556
- processState=noteProcessStage(processState,'acceptance',{evidenceRef,revision:afterRevision,changedFiles:p.operatorCandidate.paths,workOrigin:'operator-current-state'});
652
+ processState=noteProcessStage(processState,'acceptance',{evidenceRef,revision:afterRevision,revisionScopes:p.revisionScopes,changedFiles:p.operatorCandidate.paths,workOrigin:'operator-current-state'});
557
653
  operatorStateVerification={...operatorStateVerification,status:'accepted',evidenceRef};
558
654
  } catch { operatorStateVerification={...operatorStateVerification,reason:'evidence_readback_failed'}; }
559
655
  }
560
656
  const reviewScope = checkScope(processState.changedFiles, p.scopeGlobs);
561
657
  const completedReviewInput = candidateReviewInput;
562
- const reviewAuthorized = stage !== "review" || ((!p.operatorCandidate || operatorStateVerification?.status==='accepted') && reviewComplete && affirmativeReview && processState.changedFiles.length > 0 && reviewScope.outOfScope.length === 0 && reviewMayClose({ revision: afterRevision, scope: processState.changedFiles, output: result.output, evidenceRef: runPath ?? undefined, declared: !!parsedReturn, wide: processState.scope === "wide" || !!processState.additions?.some(item => item.status === "active" && item.reason === "wide_change") }));
658
+ // The review that closes the task covers the whole change with no other writer
659
+ // running (PHILOSOPHY, 2026-11-11): an area review beside a parallel writer is
660
+ // evidence for its area, never the task's final review.
661
+ const otherWriters = otherActiveWriters(d, p, tracking);
662
+ const reviewAuthorized = stage !== "review" || (otherWriters.length === 0 && (!p.operatorCandidate || operatorStateVerification?.status==='accepted') && reviewComplete && affirmativeReview && processState.changedFiles.length > 0 && reviewScope.outOfScope.length === 0 && reviewMayClose({ revision: afterRevision, scope: processState.changedFiles, output: result.output, evidenceRef: runPath ?? undefined, declared: !!parsedReturn, wide: processState.scope === "wide" || !!processState.additions?.some(item => item.status === "active" && item.reason === "wide_change") }));
563
663
  // A declared plan must read back successfully; a refusal or unresolved
564
664
  // decision is not plan evidence. No declaration still permits a retained
565
665
  // nonempty plan return. The Hub cannot judge its semantic adequacy.
@@ -568,7 +668,7 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
568
668
  && !(parsedReturn?.requires_user_decision ?? []).some((entry: unknown) => String(entry).trim().toLowerCase() !== "none")
569
669
  && d.extractNeedsResearch(result.output).length === 0 && d.extractAskUserQuestions(result.output).length === 0);
570
670
  if (stage && planProduced && reviewAuthorized && disposition.delivered && result.exitCode === 0 && sameTask && runPath) {
571
- processState = noteProcessStage(processState, stage, { evidenceRef: runPath, revision: afterRevision });
671
+ processState = noteProcessStage(processState, stage, { evidenceRef: runPath, revision: afterRevision, revisionScopes: p.revisionScopes });
572
672
  if(stage === "review" && !tracking.writable && !tracking.concurrentAtStart && !s.getActiveWritableDispatches() && tracking.overlapBaseline === s.getWritableOverlapCounter()
573
673
  && p.reviewInput && JSON.stringify(p.reviewInput) === JSON.stringify(completedReviewInput)) processState=retainReview(processState,completedReviewInput,runPath,cwd);
574
674
  }
@@ -583,7 +683,7 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
583
683
  }
584
684
  const planDeliverable = p.contract.files.map(file => file.path).find(path => /plan/i.test(path));
585
685
  if (p.agent === "builder" && planDeliverable && runPath && authorizePlanStatusUpdate({ planPath: planDeliverable, allowedScope: p.scopeGlobs, evidenceRefs: [runPath] }).allowed && sameTask) {
586
- processState = noteProcessStage(processState, "plan", { evidenceRef: runPath, revision: afterRevision });
686
+ processState = noteProcessStage(processState, "plan", { evidenceRef: runPath, revision: afterRevision, revisionScopes: p.revisionScopes });
587
687
  }
588
688
  if (p.privateConfig && privateConfigVerification?.status === 'accepted' && 'evidenceRef' in privateConfigVerification && 'evidenceHash' in privateConfigVerification && 'reviewer' in privateConfigVerification) {
589
689
  processState.privateVerification = { origin: 'private-config-current-state', binding: structuredClone(p.privateConfig), revision: afterRevision,
@@ -593,7 +693,7 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
593
693
  }
594
694
  const privateUse: PrivateProofUse = { cwd, taskId: d.noProgress.taskId(), sessionDir: s.getSessionDir(), declarationHash: privateDeclarationHash(s.getAssertions() as AcceptanceRequirement[], s.getAcceptedUserInput?.()), activeWriters: s.getActiveWritableDispatches() - (tracking.writable ? 1 : 0), overlap: s.getWritableOverlapCounter() };
595
695
  s.setProcessState?.(processState);
596
- processVerdict = evaluateProcessObligations(processState, { writable: tracking.writable || stage !== null, budgetTier: s.getTaskTier() ?? "small", t2Accepted: !p.privateConfig && !p.operatorCandidate && runtimeResult.acceptance.accepted, currentRevision: afterRevision, ...(p.privateConfig ? { privateUse } : {}) });
696
+ processVerdict = evaluateProcessObligations(processState, { writable: tracking.writable || stage !== null, budgetTier: s.getTaskTier() ?? "small", t2Accepted: !p.privateConfig && !p.operatorCandidate && runtimeResult.acceptance.accepted, currentRevision: stageRevision, ...(p.privateConfig ? { privateUse } : {}) });
597
697
  runtimeResult.process = processVerdict;
598
698
  if (!processVerdict.accepted) {
599
699
  runtimeResult.acceptance = { status: "not_accepted", accepted: false, reasons: [...new Set([...runtimeResult.acceptance.reasons, ...Object.entries(processVerdict.obligations).filter(([, value]) => value.status === "open").map(([name]) => `process_${name}_open`)])] };
@@ -609,12 +709,14 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
609
709
  // T2/F3: use the canonical wrapper identity so production reconcile can match.
610
710
  // Previously this wrote raw p.agent while the wrapper used canonical([cwd, actor]).
611
711
  d.noProgress.recordDispatchEvidence({
612
- dispatchId: result.dispatchId, taskId: p.taskId, executor: canonicalExecutor(cwd, p.agent), revision: afterRevision,
712
+ dispatchId: result.dispatchId, taskId: p.taskId, executor: canonicalExecutor(cwd, p.agent), revision: afterRevision, revisionScopes: p.revisionScopes,
613
713
  changedScope: changes.attribution === 'certain' ? changes.paths : [], readback,
614
714
  concurrentWriters: observation?.concurrentWritableOverlap ?? true,
615
715
  effectsRef: protocolEvidencePath ?? undefined,
616
716
  completed: disposition.delivered && result.exitCode === 0,
617
- blockingFindings: isReviewPersona(p.agent) && countReviewFindings(result.output).nonBlocking > 0 ? countReviewFindings(result.output).blocking : -1,
717
+ // A nonblocking review (the reconcile contract) approves with zero blocking findings;
718
+ // whether it also lists suggestions is irrelevant.
719
+ blockingFindings: isReviewPersona(p.agent) && affirmativeReviewVerdict(result.output) ? countReviewFindings(result.output).blocking : -1,
618
720
  coveredScope: isReviewPersona(p.agent) && result.exitCode === 0 ? d.noProgress.reviewCoverage(p.taskId).filter(path => checkScope([path], p.scopeGlobs).outOfScope.length === 0) : [],
619
721
  edited: p.beforeRevision !== afterRevision || !!observation && (observation.skipped || observation.paths.length > 0),
620
722
  evidenceRef: runPath ?? '', openRequirements: runtimeResult.verification.requirements.filter((r: any) => r.status !== 'passed').map((r: any) => r.id),
@@ -647,6 +749,11 @@ async function finishDispatch(d: DispatchExecutorDeps, p: PreparedDispatch, para
647
749
  if (researchRounds.length) notices.push(`ℹ ${p.agent} auto-paused for research ${researchRounds.length} round(s); ${answered} question(s) answered by read-only helpers. Findings were saved under ${safePathWithin(s.getSessionDir(), "findings")} and read by the agent directly — they are NOT inlined here.`);
648
750
  if (unresolved.length && researchRounds.length >= MAX_AUTO_RESEARCH_ROUNDS) notices.push(`⚠ ${p.agent} still requests research (${unresolved.length} question(s)) but the auto-research budget is exhausted. Run spawn_research yourself and re-dispatch with the findings, or simplify the task.`);
649
751
  if (returnPath) notices.push(`Full specialist output: ${returnPath}`);
752
+ if (isReviewPersona(p.agent) && !p.privateConfig) {
753
+ const writing = otherActiveWriters(d, p, tracking);
754
+ if (writing.length) notices.push(`Area review: ${writing.map(writer => writer.agent).join(", ")} was still writing, so this review is evidence for its own scope only and does not close the task's review. Run one final review of the whole change once no writer is active.`);
755
+ }
756
+ if (tracking.isolatedScope) notices.push(`Parallel writer: OS-sandboxed to ${tracking.isolatedScope.join(", ") || "no repository paths"}; only changes inside that scope are attributed to ${p.agent}.${observation?.foreignPaths?.length ? ` Changes outside it during the run (not attributed): ${observation.foreignPaths.slice(0, 12).join(", ")}${observation.foreignPaths.length > 12 ? " …" : ""}.` : ""} Run the full checks once no writer is active.`);
650
757
  if (disposition.pending) notices.push("⏳ DELIVERY PENDING — no result or assertion evidence is available yet, and no return/failure artifact was written. Use the msg_id above with coms_get/coms_await; do not re-dispatch.");
651
758
  if (failurePath) notices.push(`⚠ DELIVERY FAILURE (exit ${result.exitCode}) — no specialist result was returned. The error output is at ${failurePath}; it is NOT a return and carries no assertion evidence. The work may or may not have happened — check the artifacts the task was supposed to produce before re-dispatching.`);
652
759
  if (compilerDiagnostics && compilerDiagnostics.status !== "skipped") {
@@ -694,11 +801,52 @@ export function structuredResearchPrompt(params: SpawnResearchParams): string {
694
801
  ].join("\n");
695
802
  }
696
803
 
804
+ /**
805
+ * A persona runs one dispatch at a time (one session, one executor). A second
806
+ * `parallel: true` dispatch to a persona that is already writing gets its own
807
+ * instance (builder--p2, builder--p3, ...) with a separate session and executor.
808
+ * Claims are counted synchronously, so concurrent tool calls cannot pick the same
809
+ * instance and a refused duplicate cannot free another call's claim. Nothing else
810
+ * changes: the parallel writer gate still decides whether each one may run.
811
+ */
812
+ export function routeParallelInstance(d: DispatchExecutorDeps, params: DispatchAgentParams, reserved: Map<string, number>): { params: DispatchAgentParams; release: () => void } {
813
+ const base = normalizeAgentInput(params.agent);
814
+ const busy = (name: string) => (reserved.get(name) ?? 0) > 0 || d.state.getAgentStates().get(name)?.status === "running"
815
+ || (d.state.getActiveWriters?.() ?? []).some(writer => writer.agent.toLowerCase() === name);
816
+ let agent = base;
817
+ if (params.parallel === true && busy(base) && d.state.addAgentInstance) {
818
+ for (let n = 2; n <= 16; n++) {
819
+ const candidate = parallelInstanceName(base, n);
820
+ if (busy(candidate)) continue;
821
+ try { if (d.state.addAgentInstance(base, candidate)) agent = candidate; } catch { /* stay on the base; the gate explains */ }
822
+ break;
823
+ }
824
+ }
825
+ reserved.set(agent, (reserved.get(agent) ?? 0) + 1);
826
+ let released = false;
827
+ return { params: agent === base ? params : { ...params, agent }, release: () => {
828
+ if (released) return;
829
+ released = true;
830
+ const left = (reserved.get(agent) ?? 1) - 1;
831
+ if (left > 0) reserved.set(agent, left); else reserved.delete(agent);
832
+ } };
833
+ }
834
+
697
835
  export function createDispatchExecutor(d: DispatchExecutorDeps): ToolExecutor<DispatchAgentParams> {
836
+ const reserved = new Map<string, number>();
837
+ const guarded = createGuardedDispatchExecutor(d);
838
+ return async (id, params, signal, onUpdate, ctx) => {
839
+ const routed = routeParallelInstance(d, params, reserved);
840
+ try { return await guarded(id, routed.params, signal, onUpdate, ctx); }
841
+ finally { routed.release(); }
842
+ };
843
+ }
844
+
845
+ function createGuardedDispatchExecutor(d: DispatchExecutorDeps): ToolExecutor<DispatchAgentParams> {
698
846
  return withNoProgress(d, "dispatch", async (_id, params, signal, onUpdate, ctx) => {
699
847
  const capability = d.provisionalCapabilityRefusal("fleet"); if (capability) return capability;
700
848
  const agent = normalizeAgentInput(params.agent);
701
- const invalid = validateDispatchAgent(d, agent, params.task); if (invalid) return invalid;
849
+ const invalid = validateDispatchAgent(d, agent, params.task, ctx); if (invalid) return invalid;
702
850
  if (d.state.getAgentStates().get(agent)?.status === "running") return { content: [{ type: "text", text: "Agent is busy; nothing started, queued or charged. Re-invoke explicitly after it is idle." }], details: { status: "busy", reason: "busy", recoveryCategory: "busy", started: false, exitCode: 1 } };
703
851
  d.budget.ensureTaskTier();
704
852
  const processGate = d.state.processBlock?.() ?? (d.state.getProcessState ? processPreEffectGate(d.state.getProcessState(), "child", agent) : { reason: "process_state_unavailable", message: "Process state is unavailable; child launch fails closed." });
@@ -712,9 +860,10 @@ export function createDispatchExecutor(d: DispatchExecutorDeps): ToolExecutor<Di
712
860
  let cached=null;
713
861
  try { cached=reusableReview(state,reviewInput(ctx.cwd,d.noProgress.taskId(),agent,params.scope??[],state,d.state.getAssertions(),d.artifacts.loadInputArtifacts(params.artifacts,ctx),d.state.getAcceptedUserInput?.()),ctx.cwd); } catch { /* incomplete evidence must run the normal path */ }
714
862
  if(cached){
715
- const revision=worktreeRevision(ctx.cwd,[],params.scope??[]);
716
- const next=noteProcessStage(state,"review",{evidenceRef:cached.evidenceRef,revision});
717
- const verdict=evaluateProcessObligations(next,{writable:true,budgetTier:d.state.getTaskTier()??"small",currentRevision:revision});
863
+ const basis=revisionScopes(ctx.cwd,[...(params.scope??[]),...state.changedFiles]);
864
+ const revision=basis.length?revisionOf(ctx.cwd,basis):worktreeRevision(ctx.cwd,[],params.scope??[]);
865
+ const next=noteProcessStage(state,"review",{evidenceRef:cached.evidenceRef,revision,revisionScopes:basis});
866
+ const verdict=evaluateProcessObligations(next,{writable:true,budgetTier:d.state.getTaskTier()??"small",currentRevision:(scopes:readonly string[])=>scopes.join("\n")===basis.join("\n")?revision:revisionOf(ctx.cwd,[...scopes])});
718
867
  d.state.setProcessState?.(next);d.state.persistProcessVerdict?.(next,verdict);
719
868
  if(d.state.processBlock?.())return refusal(d,agent,params.task,"process_state_corrupt","Review reuse could not persist current evidence.");
720
869
  return {content:[{type:"text",text:`Independent ${agent} review already covers this unchanged scope and requirements. Reused evidence: ${cached.evidenceRef}. No child launched. New review focus requires review_reason.`}],details:{status:"review_reused",reused:true,started:false,notStarted:true,exitCode:0,elapsed:0,returnPath:cached.evidenceRef,processVerdict:verdict,accepted:verdict.accepted}};
@@ -742,7 +891,7 @@ export function createDispatchExecutor(d: DispatchExecutorDeps): ToolExecutor<Di
742
891
  catch { d.state.setActiveWritableDispatches(Math.max(0, d.state.getActiveWritableDispatches() - 1)); return refusal(d, agent, params.task, "receipt_capture_failed", "Runtime receipt capture could not be durably anchored; no child launched."); }
743
892
  try { onUpdate?.({ content: [{ type: "text", text: `Dispatching to ${prepared.agent}...` }], details: { agent: prepared.agent, task: prepared.task, status: "dispatching" } }); return await finishDispatch(d, prepared, params, await runWithAutoResearch(d, prepared, params, ctx, onUpdate), tracking, ctx, onUpdate); }
744
893
  catch (err: any) { return { content: [{ type: "text", text: `Error dispatching to ${prepared.agent}: ${err?.message || err}` }], details: { agent: prepared.agent, task: prepared.task, status: "error", elapsed: 0, exitCode: 1, fullOutput: "" } }; }
745
- finally { if (tracking.writable) d.state.setActiveWritableDispatches(Math.max(0, d.state.getActiveWritableDispatches() - 1)); }
894
+ finally { tracking.release?.(); if (tracking.writable) d.state.setActiveWritableDispatches(Math.max(0, d.state.getActiveWritableDispatches() - 1)); }
746
895
  }, (params, ctx) => dispatchExecutionConditions(d, params, ctx));
747
896
  }
748
897
 
@@ -758,7 +907,9 @@ export function createResearchExecutor(d: DispatchExecutorDeps): ToolExecutor<Sp
758
907
  s.setTurnResearchCount(s.getTurnResearchCount() + 1); s.setTaskResearchCount(s.getTaskResearchCount() + 1); s.getTurnReport().research++; s.getSessionTotals().research++; d.budget.updateModeStatus();
759
908
  const taskToken=d.noProgress.taskToken(),sessionDir=s.getSessionDir();
760
909
  const admit=()=>taskToken===d.noProgress.taskToken()&&sessionDir===s.getSessionDir()&&!signal?.aborted&&!d.provisionalCapabilityRefusal('fleet')&&!preflightGate(d,params.persona||'');
761
- const state = d.research.createState(def, persona, model); onUpdate?.({ content: [{ type: "text", text: `Spawning research helper r${state.id}...` }], details: { handle: `r${state.id}`, persona: persona ? def.name : null, status: "spawning" } });
910
+ const state = d.research.createState(def, persona, model);
911
+ try { s.recordDelegation?.({ agent: persona ? def.name : "research", kind: "research", task: params.task, scope: params.read_scope ?? [], researchId: state.id }); } catch { /* the brief is a record, never a gate */ }
912
+ onUpdate?.({ content: [{ type: "text", text: `Spawning research helper r${state.id}...` }], details: { handle: `r${state.id}`, persona: persona ? def.name : null, status: "spawning" } });
762
913
  try { const result = await d.research.spawn(state, structuredResearchPrompt(params), ctx, artifacts, signal, {readScope:normalizeResearchContract(params).readScope,admit}); const status = result.termination ? result.termination.reason : result.exitCode === 0 ? "done" : "error"; const output = result.output.length > 8000 ? `${result.output.slice(0, 8000)}\n\n... [truncated]` : result.output; return { content: [{ type: "text", text: `[research r${state.id} · ${persona ? d.displayName(def.name) : "ad-hoc"} · read-only] ${status} in ${Math.round(result.elapsed / 1000)}s\n\n${output}${result.evidencePath ? `\n\nFull execution evidence: ${result.evidencePath}` : ""}` }], details: { handle: `r${state.id}`, persona: persona ? def.name : null, model, status, elapsed: result.elapsed, exitCode: result.exitCode, fullOutput: result.output, dispatchId: result.dispatchId, evidencePath: result.evidencePath, transcriptPath: result.transcriptPath, termination: result.termination, lifecycle: (result as any).lifecycle ?? null, researchContract: normalizeResearchContract(params), artifacts: artifacts.map(a => ({ path: a.path, displayPath: a.displayPath, preview: a.preview, resolvedFromKind: a.resolvedFromKind ?? null })) } }; }
763
914
  catch (err: any) { return { content: [{ type: "text", text: `Error spawning research helper: ${err?.message || err}` }], details: { handle: `r${state.id}`, model, status: "error", elapsed: 0, exitCode: 1, fullOutput: "" } }; }
764
915
  }, (params, ctx) => researchExecutionConditions(d, params, ctx));
@@ -0,0 +1,30 @@
1
+ import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
2
+ import type { AfPollHandleResult } from "../poll-command.ts";
3
+
4
+ export interface PollPanelParams { question: string; panel?: string; persona?: string }
5
+
6
+ export interface PollPanelDeps {
7
+ /** Runs the same read-only panel poll as `/af-poll`, with typed inputs. */
8
+ run(params: PollPanelParams, ctx: ExtensionContext, onProgress: (line: string) => void): Promise<AfPollHandleResult>;
9
+ /** A refusal that must stop the poll before any model work (roster recovery, capability gate). */
10
+ blocked(ctx: ExtensionContext): string | null;
11
+ }
12
+
13
+ export const POLL_PANEL_DESCRIPTION =
14
+ "Ask the model panel one decision question in parallel; an integrator merges the opinions. For decisions, not facts. Read-only.";
15
+
16
+ type Update = ((update: { content: { type: "text"; text: string }[]; details: Record<string, unknown> }) => void) | undefined;
17
+
18
+ /** UI-free tool body, so it runs under `node --test` without the TUI package. */
19
+ export async function executePollPanel(deps: PollPanelDeps, params: PollPanelParams, onUpdate: Update, ctx: ExtensionContext) {
20
+ const refusal = deps.blocked(ctx);
21
+ if (refusal) return { content: [{ type: "text" as const, text: refusal }], details: { status: "refused", started: false } };
22
+ const progress: string[] = [];
23
+ const onProgress = (line: string) => {
24
+ progress.push(line);
25
+ try { onUpdate?.({ content: [{ type: "text", text: progress.join("\n\n") }], details: { status: "running" } }); } catch { /* progress is best-effort */ }
26
+ };
27
+ const result = await deps.run(params, ctx, onProgress);
28
+ if (!result.ok) return { content: [{ type: "text" as const, text: `POLL FAILED — no decision was produced.\n\n${result.message}` }], details: { status: "failed", started: true, message: result.message } };
29
+ return { content: [{ type: "text" as const, text: result.dispatcherNote ?? result.message }], details: { status: "ok", started: true, digest: result.digest } };
30
+ }
@@ -0,0 +1,33 @@
1
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
+ import { Type } from "@sinclair/typebox";
3
+ import { Text } from "@mariozechner/pi-tui";
4
+ import { executePollPanel, POLL_PANEL_DESCRIPTION, type PollPanelDeps, type PollPanelParams } from "./poll-panel-core.ts";
5
+
6
+ export type { PollPanelDeps, PollPanelParams } from "./poll-panel-core.ts";
7
+
8
+ export function registerPollPanel(pi: ExtensionAPI, deps: PollPanelDeps): void {
9
+ pi.registerTool({
10
+ name: "poll_panel",
11
+ label: "Poll Panel",
12
+ description: POLL_PANEL_DESCRIPTION,
13
+ parameters: Type.Object({
14
+ question: Type.String({ minLength: 1, description: "Self-contained English question with options; paths, not bodies." }),
15
+ panel: Type.Optional(Type.String({ description: "voices.yaml panel; default poll-panel." })),
16
+ persona: Type.Optional(Type.String({ description: "Voice persona; default researcher." })),
17
+ }, { additionalProperties: false }),
18
+ execute(_toolCallId, raw, _signal, onUpdate, ctx) {
19
+ return executePollPanel(deps, raw as PollPanelParams, onUpdate as any, ctx);
20
+ },
21
+ renderCall(args, theme) {
22
+ const question = String((args as any).question || "");
23
+ const preview = question.length > 60 ? `${question.slice(0, 57)}...` : question;
24
+ return new Text(
25
+ theme.fg("toolTitle", theme.bold("poll_panel ")) +
26
+ theme.fg("accent", String((args as any).panel || "default")) +
27
+ theme.fg("dim", " — ") +
28
+ theme.fg("muted", preview),
29
+ 0, 0,
30
+ );
31
+ },
32
+ });
33
+ }