@chankov/agent-fleet 0.0.3 → 0.0.4

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 (329) hide show
  1. package/.claude/commands/setup-agent-fleet.md +1 -1
  2. package/.opencode/commands/af-setup-agent-fleet.md +1 -1
  3. package/.pi/harnesses/agent-hub/README.md +199 -16
  4. package/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  5. package/.pi/harnesses/agent-hub/delegate.ts +32 -9
  6. package/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  7. package/.pi/harnesses/agent-hub/footer.ts +29 -0
  8. package/.pi/harnesses/agent-hub/helpers.ts +49 -0
  9. package/.pi/harnesses/agent-hub/index.ts +1033 -242
  10. package/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  11. package/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  12. package/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  13. package/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  14. package/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  15. package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  16. package/.pi/harnesses/agent-hub/package.json +5 -4
  17. package/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  18. package/.pi/harnesses/agent-hub/run-budget.js +155 -0
  19. package/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  20. package/.pi/harnesses/agent-hub/spawn.ts +161 -94
  21. package/.pi/harnesses/agent-hub/version.ts +18 -0
  22. package/.pi/harnesses/coms/README.md +10 -0
  23. package/.pi/harnesses/coms/index.ts +2 -0
  24. package/.pi/harnesses/coms/package.json +5 -4
  25. package/.pi/harnesses/coms/version.ts +18 -0
  26. package/.pi/harnesses/damage-control-continue/README.md +32 -31
  27. package/.pi/harnesses/damage-control-continue/index.ts +23 -9
  28. package/.pi/harnesses/damage-control-continue/package.json +5 -4
  29. package/.pi/harnesses/damage-control-continue/version.ts +18 -0
  30. package/.pi/harnesses/{damage-control/shared.ts → lib/damage-control-shared.ts} +20 -6
  31. package/.pi/prompts/setup-agent-fleet.md +1 -1
  32. package/.versions/0.0.4/.claude/commands/build.md +44 -0
  33. package/.versions/0.0.4/.claude/commands/code-simplify.md +22 -0
  34. package/.versions/0.0.4/.claude/commands/design-agent.md +14 -0
  35. package/.versions/0.0.4/.claude/commands/doctor-agent-fleet.md +17 -0
  36. package/.versions/0.0.4/.claude/commands/orchestrate.md +112 -0
  37. package/.versions/0.0.4/.claude/commands/plan.md +16 -0
  38. package/.versions/0.0.4/.claude/commands/prime.md +22 -0
  39. package/.versions/0.0.4/.claude/commands/review.md +16 -0
  40. package/.versions/0.0.4/.claude/commands/setup-agent-fleet.md +25 -0
  41. package/.versions/0.0.4/.claude/commands/ship.md +72 -0
  42. package/.versions/0.0.4/.claude/commands/spec.md +15 -0
  43. package/.versions/0.0.4/.claude/commands/test.md +19 -0
  44. package/.versions/0.0.4/.claude/commands/webperf.md +32 -0
  45. package/.versions/0.0.4/.claude/orchestrate-teams.yaml +24 -0
  46. package/.versions/0.0.4/.opencode/commands/af-build.md +17 -0
  47. package/.versions/0.0.4/.opencode/commands/af-code-simplify.md +16 -0
  48. package/.versions/0.0.4/.opencode/commands/af-compound.md +16 -0
  49. package/.versions/0.0.4/.opencode/commands/af-design-agent.md +15 -0
  50. package/.versions/0.0.4/.opencode/commands/af-doctor-agent-fleet.md +17 -0
  51. package/.versions/0.0.4/.opencode/commands/af-orchestrate.md +112 -0
  52. package/.versions/0.0.4/.opencode/commands/af-plan.md +16 -0
  53. package/.versions/0.0.4/.opencode/commands/af-prime.md +22 -0
  54. package/.versions/0.0.4/.opencode/commands/af-review.md +15 -0
  55. package/.versions/0.0.4/.opencode/commands/af-setup-agent-fleet.md +15 -0
  56. package/.versions/0.0.4/.opencode/commands/af-ship.md +16 -0
  57. package/.versions/0.0.4/.opencode/commands/af-spec.md +16 -0
  58. package/.versions/0.0.4/.opencode/commands/af-test.md +21 -0
  59. package/.versions/0.0.4/.opencode/commands/af-webperf.md +32 -0
  60. package/.versions/0.0.4/.opencode/orchestrate-teams.yaml +24 -0
  61. package/.versions/0.0.4/.pi/agents/dispatch-policy.yaml +32 -0
  62. package/.versions/0.0.4/.pi/agents/model-profiles.yaml +20 -0
  63. package/.versions/0.0.4/.pi/agents/peers.yaml +146 -0
  64. package/.versions/0.0.4/.pi/agents/teams.yaml +39 -0
  65. package/.versions/0.0.4/.pi/damage-control-rules.yaml +297 -0
  66. package/.versions/0.0.4/.pi/extensions/agent-fleet-update-check/README.md +58 -0
  67. package/.versions/0.0.4/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  68. package/{.pi/harnesses/damage-control → .versions/0.0.4/.pi/extensions/agent-fleet-update-check}/package.json +1 -1
  69. package/.versions/0.0.4/.pi/extensions/btw/README.md +118 -0
  70. package/.versions/0.0.4/.pi/extensions/btw/index.ts +917 -0
  71. package/.versions/0.0.4/.pi/extensions/btw/package.json +6 -0
  72. package/.versions/0.0.4/.pi/extensions/btw/state.js +179 -0
  73. package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
  74. package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
  75. package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  76. package/.versions/0.0.4/.pi/extensions/compact-and-continue/README.md +42 -0
  77. package/.versions/0.0.4/.pi/extensions/compact-and-continue/index.ts +120 -0
  78. package/.versions/0.0.4/.pi/extensions/compact-and-continue/package.json +6 -0
  79. package/.versions/0.0.4/.pi/extensions/mcp-bridge/README.md +46 -0
  80. package/.versions/0.0.4/.pi/extensions/mcp-bridge/index.ts +206 -0
  81. package/.versions/0.0.4/.pi/extensions/mcp-bridge/package.json +6 -0
  82. package/.versions/0.0.4/.pi/extensions/package-lock.json +1143 -0
  83. package/.versions/0.0.4/.pi/extensions/package.json +9 -0
  84. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/README.md +201 -0
  85. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/config.ts +198 -0
  86. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  87. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/index.ts +248 -0
  88. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/package.json +6 -0
  89. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  90. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  91. package/.versions/0.0.4/.pi/harnesses/agent-hub/README.md +798 -0
  92. package/.versions/0.0.4/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  93. package/.versions/0.0.4/.pi/harnesses/agent-hub/artifacts.js +92 -0
  94. package/.versions/0.0.4/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  95. package/.versions/0.0.4/.pi/harnesses/agent-hub/delegate.ts +386 -0
  96. package/.versions/0.0.4/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  97. package/.versions/0.0.4/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  98. package/.versions/0.0.4/.pi/harnesses/agent-hub/footer.ts +29 -0
  99. package/.versions/0.0.4/.pi/harnesses/agent-hub/helpers.ts +214 -0
  100. package/.versions/0.0.4/.pi/harnesses/agent-hub/index.ts +8045 -0
  101. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  102. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  103. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  104. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  105. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  106. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  107. package/.versions/0.0.4/.pi/harnesses/agent-hub/package.json +7 -0
  108. package/.versions/0.0.4/.pi/harnesses/agent-hub/research-retention.js +34 -0
  109. package/.versions/0.0.4/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  110. package/.versions/0.0.4/.pi/harnesses/agent-hub/return-contract.js +215 -0
  111. package/.versions/0.0.4/.pi/harnesses/agent-hub/run-budget.js +155 -0
  112. package/.versions/0.0.4/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  113. package/.versions/0.0.4/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  114. package/.versions/0.0.4/.pi/harnesses/agent-hub/spawn.ts +246 -0
  115. package/.versions/0.0.4/.pi/harnesses/agent-hub/version.ts +18 -0
  116. package/.versions/0.0.4/.pi/harnesses/ask-user-remote/README.md +18 -0
  117. package/.versions/0.0.4/.pi/harnesses/ask-user-remote/index.ts +293 -0
  118. package/.versions/0.0.4/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  119. package/.versions/0.0.4/.pi/harnesses/coms/README.md +92 -0
  120. package/.versions/0.0.4/.pi/harnesses/coms/index.ts +1745 -0
  121. package/.versions/0.0.4/.pi/harnesses/coms/package.json +7 -0
  122. package/.versions/0.0.4/.pi/harnesses/coms/version.ts +18 -0
  123. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/README.md +117 -0
  124. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/index.ts +536 -0
  125. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/package.json +7 -0
  126. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/version.ts +18 -0
  127. package/.versions/0.0.4/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  128. package/.versions/0.0.4/.pi/harnesses/lib/herdr-client.ts +458 -0
  129. package/.versions/0.0.4/.pi/harnesses/lib/herdr-presence.ts +288 -0
  130. package/.versions/0.0.4/.pi/harnesses/package-lock.json +35 -0
  131. package/.versions/0.0.4/.pi/harnesses/package.json +9 -0
  132. package/.versions/0.0.4/.pi/prompts/build.md +24 -0
  133. package/.versions/0.0.4/.pi/prompts/code-simplify.md +22 -0
  134. package/.versions/0.0.4/.pi/prompts/doctor-agent-fleet.md +15 -0
  135. package/.versions/0.0.4/.pi/prompts/plan.md +16 -0
  136. package/.versions/0.0.4/.pi/prompts/review.md +16 -0
  137. package/.versions/0.0.4/.pi/prompts/setup-agent-fleet.md +27 -0
  138. package/.versions/0.0.4/.pi/prompts/ship.md +17 -0
  139. package/.versions/0.0.4/.pi/prompts/spec.md +15 -0
  140. package/.versions/0.0.4/.pi/prompts/test.md +19 -0
  141. package/.versions/0.0.4/.pi/skills/bowser/SKILL.md +145 -0
  142. package/.versions/0.0.4/.version +1 -0
  143. package/.versions/0.0.4/agents/architect.md +23 -0
  144. package/.versions/0.0.4/agents/bowser.md +26 -0
  145. package/.versions/0.0.4/agents/builder.md +53 -0
  146. package/.versions/0.0.4/agents/code-reviewer.md +205 -0
  147. package/.versions/0.0.4/agents/deep-researcher.md +31 -0
  148. package/.versions/0.0.4/agents/documenter.md +18 -0
  149. package/.versions/0.0.4/agents/orchestrator.md +54 -0
  150. package/.versions/0.0.4/agents/plan-reviewer.md +60 -0
  151. package/.versions/0.0.4/agents/planner.md +69 -0
  152. package/.versions/0.0.4/agents/releaser.md +24 -0
  153. package/.versions/0.0.4/agents/researcher.md +28 -0
  154. package/.versions/0.0.4/agents/security-auditor.md +166 -0
  155. package/.versions/0.0.4/agents/test-engineer.md +151 -0
  156. package/.versions/0.0.4/agents/web-debugger.md +42 -0
  157. package/.versions/0.0.4/agents/web-performance-auditor.md +192 -0
  158. package/.versions/0.0.4/codex/CONDUCTOR.md +148 -0
  159. package/.versions/0.0.4/docs/ARCHITECTURE.md +210 -0
  160. package/.versions/0.0.4/docs/agent-fleet-setup.md +366 -0
  161. package/.versions/0.0.4/docs/claude-code-coms-bridge.md +103 -0
  162. package/.versions/0.0.4/docs/codex-remote-conductor.md +170 -0
  163. package/.versions/0.0.4/docs/coms-hermes-bridge.md +121 -0
  164. package/.versions/0.0.4/docs/getting-started.md +183 -0
  165. package/.versions/0.0.4/docs/npm-install.md +337 -0
  166. package/.versions/0.0.4/docs/opencode-setup.md +248 -0
  167. package/.versions/0.0.4/docs/pi-extensions.md +288 -0
  168. package/.versions/0.0.4/docs/pi-setup.md +463 -0
  169. package/.versions/0.0.4/docs/skill-anatomy.md +150 -0
  170. package/.versions/0.0.4/hermes/README.md +228 -0
  171. package/.versions/0.0.4/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  172. package/.versions/0.0.4/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  173. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +15 -0
  174. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +19 -0
  175. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +13 -0
  176. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +11 -0
  177. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +9 -0
  178. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +17 -0
  179. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +34 -0
  180. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +151 -0
  181. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +39 -0
  182. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  183. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +12 -0
  184. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  185. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +22 -0
  186. package/.versions/0.0.4/hermes/skills/hub-conductor/SKILL.md +84 -0
  187. package/.versions/0.0.4/hermes/skills/hub-liaison/SKILL.md +84 -0
  188. package/.versions/0.0.4/hooks/SIMPLIFY-IGNORE.md +90 -0
  189. package/.versions/0.0.4/hooks/coms-stop-hook.mjs +73 -0
  190. package/.versions/0.0.4/hooks/hooks.json +14 -0
  191. package/.versions/0.0.4/hooks/session-start.sh +74 -0
  192. package/.versions/0.0.4/hooks/simplify-ignore.sh +302 -0
  193. package/.versions/0.0.4/justfile +256 -0
  194. package/.versions/0.0.4/references/accessibility-checklist.md +160 -0
  195. package/.versions/0.0.4/references/definition-of-done.md +67 -0
  196. package/.versions/0.0.4/references/fleet-coordination-patterns.md +151 -0
  197. package/.versions/0.0.4/references/observability-checklist.md +91 -0
  198. package/.versions/0.0.4/references/orchestration-patterns.md +370 -0
  199. package/.versions/0.0.4/references/performance-checklist.md +153 -0
  200. package/.versions/0.0.4/references/prompting-patterns.md +380 -0
  201. package/.versions/0.0.4/references/security-checklist.md +179 -0
  202. package/.versions/0.0.4/references/testing-patterns.md +236 -0
  203. package/.versions/0.0.4/scripts/codex-conductor.ts +41 -0
  204. package/.versions/0.0.4/scripts/codex-remote-control.ts +167 -0
  205. package/.versions/0.0.4/scripts/coms-claude-bridge.ts +286 -0
  206. package/.versions/0.0.4/scripts/coms-cli.ts +484 -0
  207. package/.versions/0.0.4/scripts/coms-hermes-bridge.ts +403 -0
  208. package/.versions/0.0.4/scripts/hermes-monitor-capability-runner.ts +25 -0
  209. package/.versions/0.0.4/scripts/hermes-monitor-scenario.ts +7 -0
  210. package/.versions/0.0.4/scripts/lib/claude-bridge-core.ts +100 -0
  211. package/.versions/0.0.4/scripts/lib/codex-conductor.ts +88 -0
  212. package/.versions/0.0.4/scripts/lib/codex-remote-control.ts +480 -0
  213. package/.versions/0.0.4/scripts/lib/coms-envelope.ts +539 -0
  214. package/.versions/0.0.4/scripts/lib/fake-herdr-server.ts +88 -0
  215. package/.versions/0.0.4/scripts/lib/herdr-layout.ts +263 -0
  216. package/.versions/0.0.4/scripts/lib/hermes-bridge-core.ts +238 -0
  217. package/.versions/0.0.4/scripts/lib/hermes-monitor-herdr.ts +28 -0
  218. package/.versions/0.0.4/scripts/lib/hermes-monitor-model.ts +9 -0
  219. package/.versions/0.0.4/scripts/lib/hermes-monitor-registry.ts +6 -0
  220. package/.versions/0.0.4/scripts/lib/hermes-monitor-socket.ts +118 -0
  221. package/.versions/0.0.4/scripts/lib/hermes-monitor-store.ts +31 -0
  222. package/.versions/0.0.4/scripts/lib/persona-banner.ts +62 -0
  223. package/.versions/0.0.4/scripts/lib/spawn-stagger.ts +101 -0
  224. package/.versions/0.0.4/scripts/lib/team-project.ts +184 -0
  225. package/.versions/0.0.4/scripts/lib/team-snapshot.ts +147 -0
  226. package/.versions/0.0.4/scripts/peer-banner.ts +40 -0
  227. package/.versions/0.0.4/scripts/team-snapshot.ts +238 -0
  228. package/.versions/0.0.4/scripts/team-up.ts +333 -0
  229. package/.versions/0.0.4/skills/_internal/grilling.md +11 -0
  230. package/.versions/0.0.4/skills/browser-testing-with-devtools/SKILL.md +352 -0
  231. package/.versions/0.0.4/skills/code-review-and-quality/SKILL.md +381 -0
  232. package/.versions/0.0.4/skills/compound-learning/SKILL.md +137 -0
  233. package/.versions/0.0.4/skills/context-engineering/SKILL.md +291 -0
  234. package/.versions/0.0.4/skills/deprecation-and-migration/SKILL.md +206 -0
  235. package/.versions/0.0.4/skills/designing-agents/SKILL.md +394 -0
  236. package/.versions/0.0.4/skills/designing-agents/pi-harness-authoring.md +222 -0
  237. package/.versions/0.0.4/skills/frontend-ui-engineering/SKILL.md +328 -0
  238. package/.versions/0.0.4/skills/git-workflow-and-versioning/SKILL.md +316 -0
  239. package/.versions/0.0.4/skills/guided-workspace-setup/SKILL.md +535 -0
  240. package/.versions/0.0.4/skills/guided-workspace-setup/companion-manifest.json +33 -0
  241. package/.versions/0.0.4/skills/idea-refine/SKILL.md +182 -0
  242. package/.versions/0.0.4/skills/idea-refine/examples.md +238 -0
  243. package/.versions/0.0.4/skills/idea-refine/frameworks.md +99 -0
  244. package/.versions/0.0.4/skills/idea-refine/refinement-criteria.md +113 -0
  245. package/.versions/0.0.4/skills/idea-refine/scripts/idea-refine.sh +15 -0
  246. package/.versions/0.0.4/skills/incremental-implementation/SKILL.md +287 -0
  247. package/.versions/0.0.4/skills/interview-me/SKILL.md +226 -0
  248. package/.versions/0.0.4/skills/orchestration-verification/SKILL.md +181 -0
  249. package/.versions/0.0.4/skills/peer-coms/SKILL.md +90 -0
  250. package/.versions/0.0.4/skills/performance-optimization/SKILL.md +350 -0
  251. package/.versions/0.0.4/skills/planning-and-task-breakdown/SKILL.md +236 -0
  252. package/.versions/0.0.4/skills/security-and-hardening/SKILL.md +461 -0
  253. package/.versions/0.0.4/skills/spec-driven-development/SKILL.md +245 -0
  254. package/.versions/0.0.4/skills/using-agent-skills/SKILL.md +199 -0
  255. package/.versions/0.0.4/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  256. package/.versions/0.0.4/vendor/agent-skills-upstream/LICENSE +21 -0
  257. package/.versions/0.0.4/vendor/agent-skills-upstream/README.md +11 -0
  258. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  259. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  260. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  261. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  262. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  263. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  264. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  265. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  266. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  267. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  268. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  269. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  270. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  271. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  272. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  273. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  274. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  275. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  276. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  277. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  278. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  279. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  280. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  281. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  282. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  283. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  284. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  285. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  286. package/CHANGELOG.md +53 -0
  287. package/README.md +3 -3
  288. package/agents/builder.md +1 -1
  289. package/agents/code-reviewer.md +1 -1
  290. package/agents/deep-researcher.md +3 -3
  291. package/agents/orchestrator.md +20 -11
  292. package/agents/plan-reviewer.md +3 -3
  293. package/agents/test-engineer.md +11 -4
  294. package/bin/lib/validate-overrides.js +19 -0
  295. package/bin/sync-harness-versions.js +94 -0
  296. package/docs/ARCHITECTURE.md +46 -1
  297. package/docs/agent-fleet-setup.md +10 -0
  298. package/docs/pi-extensions.md +49 -14
  299. package/docs/pi-setup.md +10 -4
  300. package/hermes/README.md +180 -0
  301. package/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  302. package/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  303. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +15 -0
  304. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +19 -0
  305. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +13 -0
  306. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +11 -0
  307. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +9 -0
  308. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +17 -0
  309. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +34 -0
  310. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +151 -0
  311. package/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +39 -0
  312. package/hermes/plugins/agent-fleet-monitor/dashboard/dist/index.js +10 -0
  313. package/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  314. package/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +12 -0
  315. package/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  316. package/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +22 -0
  317. package/justfile +6 -10
  318. package/package.json +9 -4
  319. package/scripts/lib/fake-herdr-server.ts +88 -0
  320. package/scripts/lib/hermes-monitor-herdr.ts +28 -0
  321. package/scripts/lib/hermes-monitor-model.ts +9 -0
  322. package/scripts/lib/hermes-monitor-registry.ts +6 -0
  323. package/scripts/lib/hermes-monitor-socket.ts +118 -0
  324. package/scripts/lib/hermes-monitor-store.ts +31 -0
  325. package/skills/designing-agents/SKILL.md +2 -2
  326. package/skills/designing-agents/pi-harness-authoring.md +26 -13
  327. package/skills/guided-workspace-setup/SKILL.md +11 -8
  328. package/.pi/harnesses/damage-control/README.md +0 -65
  329. package/.pi/harnesses/damage-control/index.ts +0 -250
@@ -18,7 +18,7 @@ Removal happens **only** on an explicit `Remove some…` multi-select (empty sel
18
18
 
19
19
  **Personas are generated for non-pi targets.** The personas group lists the full availability roster from `node <source-root>/bin/cli.js transform-persona --list --agent <agent>` (pi-only personas — `bowser`, `orchestrator` — appear only when the agent is `pi`). For `claude-code`/`opencode` the apply step installs personas via `transform-persona --agent <agent> --workspace <workspace> <name…>` — always a generated copy, even in symlink mode — and records the rows with `transformed: true`; status checks diff against the generated output, not the raw canonical source.
20
20
 
21
- **pi harness companions.** When the agent is `pi`, installing/refreshing/removing any harness also refreshes its companions — the `justfile` launch recipes, the `team-up`/`coms-net` scripts, the peer/team YAML, `.pi/damage-control-rules.yaml`, and `.pi/harnesses/package.json`. Refresh the `justfile` from the current source (rewriting only the `agent-fleet:harnesses` managed region so user recipes survive) so retired-harness recipes are pruned and new ones added; a stale `justfile` left after a harness change is the regression this prevents.
21
+ **pi harness companions.** When the agent is `pi`, installing/refreshing/removing any harness also refreshes its companions — the `justfile` launch recipes, the `team-up`/`coms-net` scripts, the peer/team YAML, `.pi/damage-control-rules.yaml`, and `.pi/harnesses/package.json`. `agent-hub` requires only `damage-control-continue` and `ask-user-remote`; auto-include both. Refresh the `justfile` from the current source (rewriting only the `agent-fleet:harnesses` managed region so user recipes survive) so retired-harness recipes are pruned and new ones added. Treat the retired `damage-control` hard-stop directory as `gone`: remove it only when recorded and unchanged against the recorded snapshot, or when it is a symlink into the source root (including a broken retirement link). Preserve every user-modified or unowned copy.
22
22
 
23
23
  **No mid-apply overwrite prompts.** The `mod` description already warns that refreshing overwrites local edits. The user's selection is the consent; the Step 9 confirmation is the single gate. During apply, refresh selected items unconditionally — never pause to ask "should I overwrite this file?". Genuine errors (permission denied, missing source) still stop and report.
24
24
 
@@ -8,7 +8,7 @@ Run the guided install for a target workspace. If the user passed a workspace pa
8
8
 
9
9
  The Skills group draws from **two roots**: fleet-native `skills/` and the vendored upstream import `vendor/agent-skills-upstream/skills/` (see `docs/UPSTREAM-SKILLS.md`). On a name collision the native copy wins — never offer the vendored duplicate as a separate row.
10
10
 
11
- Analyse the workspace, then present the install menu per the skill's Step 1 interaction contract: with a native select widget, open with the **Express question** (`Recommended ★` / `Everything` / `Custom — group by group`, or the installed-state variants), and on `Custom` run the **7 groups** (4 shared: Skills, Agent personas, Commands/prompts, References & Hooks; 3 pi-only — an opencode workspace sees just the 4 shared groups) as single-select quick screens with multi-select drill-ins only behind `Customise`, chunked by sub-category; installed state shows as counts and plain-words descriptions (no pre-checking), removal only via an explicit `Remove some…` selection, and cancel = keep-as-is. Without a widget, fall back to the skill's tabular format (pre-checked `[x]` tables with text replies). On `pi`, installing/refreshing/removing any harness also refreshes its companions — the `justfile` launch recipes (managed region only, so user recipes survive), the `team-up` script, the peer/team YAML, `.pi/damage-control-rules.yaml`, and `.pi/harnesses/package.json` — refreshed from the current source so retired-harness recipes are pruned and new ones added.
11
+ Analyse the workspace, then present the install menu per the skill's Step 1 interaction contract: with a native select widget, open with the **Express question** (`Recommended ★` / `Everything` / `Custom — group by group`, or the installed-state variants), and on `Custom` run the **7 groups** (4 shared: Skills, Agent personas, Commands/prompts, References & Hooks; 3 pi-only — an opencode workspace sees just the 4 shared groups) as single-select quick screens with multi-select drill-ins only behind `Customise`, chunked by sub-category; installed state shows as counts and plain-words descriptions (no pre-checking), removal only via an explicit `Remove some…` selection, and cancel = keep-as-is. Without a widget, fall back to the skill's tabular format (pre-checked `[x]` tables with text replies). On `pi`, installing/refreshing/removing any harness also refreshes its companions — the `justfile` launch recipes (managed region only, so user recipes survive), the `team-up` script, the peer/team YAML, `.pi/damage-control-rules.yaml`, and `.pi/harnesses/package.json` — refreshed from the current source so retired-harness recipes are pruned and new ones added. `agent-hub` requires only `damage-control-continue` and `ask-user-remote`. Treat the retired `damage-control` hard-stop directory as `gone`: remove it only when recorded and unchanged against the recorded snapshot, or when it is a symlink into the source root (including a broken retirement link); preserve every user-modified or unowned copy.
12
12
 
13
13
  **Personas are generated for opencode.** The personas group lists the full availability roster from `node <source-root>/bin/cli.js transform-persona --list --agent opencode` (pi-only personas — `bowser`, `orchestrator` — are excluded). The apply step installs them into `.opencode/agent/<name>.md` via `transform-persona --agent opencode --workspace <workspace> <name…>` — always a generated copy, even in symlink mode — and records the rows with `transformed: true`; status checks diff against the generated output, not the raw canonical source.
14
14
 
@@ -210,8 +210,8 @@ Every borrowed idea from another harness passes one test before it lands: *does
210
210
  - **Default damage-control guardrails** — `just hub` and `just hub-solo` load the
211
211
  `damage-control-continue` harness before `agent-hub`, so dispatcher tool calls are checked against
212
212
  `.pi/damage-control-rules.yaml` and a blocked call feeds back instead of aborting the turn. A
213
- guardrail is also re-loaded into every spawned subagent (see [Safety scope](#safety-scope)):
214
- research helpers get the same continue variant, other specialists get the hard-stop `damage-control`.
213
+ guardrail is also re-loaded into every native specialist, research helper, and nested delegate
214
+ (see [Safety scope](#safety-scope)). Missing safety plumbing refuses child dispatch.
215
215
  - **Embedded coms** — the dispatcher is a discoverable peer on the local machine. Multiple
216
216
  `agent-hub` (or plain `coms`) sessions on the same box find each other through per-project registry
217
217
  files and exchange messages over a unix socket (named pipe on Windows).
@@ -256,6 +256,21 @@ done agents are hidden in compact mode, and the coms pool widget collapses too,
256
256
  collapses to just the prompt and footer. The current mode and binding are shown in the footer
257
257
  (`Alt+A view:dashboard` / `Alt+A view:compact`).
258
258
 
259
+ ### Version footer
260
+
261
+ `agent-hub` renders its local harness version first in its custom footer:
262
+ `v<version> · <model><thinking> · <team>`. It replaces pi's default footer, so it does **not**
263
+ consume or render the shared version status; it reads its own adjacent stamped manifest directly.
264
+ The three persistent-UI harnesses (`agent-hub`, `coms`, and
265
+ `damage-control-continue`) still register that one shared key, which gives default footers one
266
+ version in stacked non-hub sessions. In the supported guardrail-plus-hub stack, the hub's custom
267
+ footer supplies the single visible version. Damage-Control can update its own safety status after
268
+ a violation without overwriting the shared version entry. The canonical source is the
269
+ repository-root `package.json`; the adjacent harness manifest is a synchronized stamp maintained
270
+ by `bin/sync-harness-versions.js`. Its local `version.ts` reader intentionally stays with the
271
+ harness for copied or symlinked installs, but those installs still need the pre-existing full
272
+ `.pi/harnesses/` dependency installation.
273
+
259
274
  ### Voice dictation indicator
260
275
 
261
276
  The custom footer renders the optional [`pi-voice-stt`](../../extensions/pi-voice-stt/README.md)
@@ -333,9 +348,140 @@ research-keep: 8
333
348
  (LRU by finish time, default 4; `all` disables the cap). Auto-research pipe helpers are
334
349
  always pruned as soon as they finish, regardless of this key.
335
350
 
351
+ ### Bounded local-disk searches
352
+
353
+ Every `read`, `grep`, `find`, and `ls` call made by a native research helper or a nested
354
+ `delegate` child has a **parent-side** watchdog. The default is **120 seconds per tool call**;
355
+ it is a per-tool bound, not a whole-run deadline — the whole-run bound is the execution
356
+ mode's per-run deadline below. Configure it in the repository-standard overrides file:
357
+
358
+ ```markdown
359
+ ## agent-hub
360
+ recon-search-timeout-s: 120 # integer 1..3600
361
+ # recon-search-timeout-s: off # disable this per-tool watchdog
362
+ ```
363
+
364
+ Invalid values warn at session start and use 120. Calls are tracked independently by their
365
+ JSONL `toolCallId`; a repeated start/update cannot extend an existing deadline. A timeout returns
366
+ `tool_timeout` with the call metadata, ends the research/delegate lifecycle, sends SIGTERM to the
367
+ child's explicitly owned process group, then SIGKILL after a finite grace period. The parent also
368
+ has a final settlement timer, so it settles rather than waiting indefinitely for `close` or
369
+ inherited pipe drain. If child/process-group death cannot be confirmed after this bounded cleanup,
370
+ the timeout metadata reports `terminationConfirmed: false`: this prevents the parent hanging, but
371
+ may indicate an uninterruptible OS-level process that needs operator attention. This group
372
+ ownership covers descendants even when the pi leader exits first; nested delegates own their groups
373
+ and forward parent cancellation, avoiding detached-orphan processes. Caller
374
+ cancellation follows the same bounded cleanup path but is reported as `cancelled`, not
375
+ `tool_timeout`.
376
+
377
+ ### Execution modes & turn budgets
378
+
379
+ The hub runs one of three **execution modes** — `fast`, `standard` (default), `strict` —
380
+ with **per-user-turn budgets enforced in code**, not prose. This is the guardrail against
381
+ runaway orchestration (the observed failure mode: 100+ dispatches and 100M+ tokens for one
382
+ task, most of it re-billed stale specialist context).
383
+
384
+ | Budget (per user turn) | fast | standard | strict |
385
+ |-----------------------------------|--------|----------|---------|
386
+ | `dispatch_agent` calls | 2 | 8 | 24 |
387
+ | `spawn_research` calls | 1 | 4 | 12 |
388
+ | Turn wall clock | 15 min | 60 min | 240 min |
389
+ | Per-run deadline (specialist/research/delegate) | 10 min | 30 min | off |
390
+ | Specialist session recycled after | 3 runs | 5 runs | 5 runs |
391
+ | Nested delegation | off | on | on |
392
+
393
+ - **fast** — single-specialist path for small, low-risk asks; assertion ledger optional,
394
+ no nested delegation.
395
+ - **standard** — batched execution: one recon max, builder batches of 4–6 plan tasks with
396
+ one gate each, one review gate at the end.
397
+ - **strict** — the full Verification Contract (parity inventories, per-batch gates,
398
+ second confirming reads); use for production migrations and security-sensitive work.
399
+
400
+ When a budget is exhausted, `dispatch_agent`/`spawn_research` **refuse** with instructions
401
+ to summarize and ask the user; the next user message opens a fresh window. Switch modes
402
+ live with `/hub-mode fast|standard|strict` (no argument shows the current mode and usage);
403
+ set the project default and per-axis overrides in the overrides file:
404
+
405
+ ```markdown
406
+ ## agent-hub
407
+ mode: standard # fast|standard|strict
408
+ max-dispatches-per-turn: 8 # integer or off
409
+ max-research-per-turn: 4 # integer or off
410
+ turn-wall-time-s: 3600 # integer or off
411
+ agent-turn-timeout-s: 1800 # whole-run deadline per spawned run; integer or off
412
+ session-recycle-runs: 5 # recycle a specialist session after N resumed runs; integer or off
413
+ ```
414
+
415
+ Two related always-on behaviors: specialist **context pressure is measured over
416
+ input + cacheRead + cacheWrite** (resumed sessions re-send their whole accumulated context
417
+ as cache reads — counting `input` alone hid that entirely), and a specialist session is
418
+ **recycled** (fresh session, no `-c` resume) once it has served `session-recycle-runs` runs
419
+ or its measured context passes 60%. The dispatch result notes the recycle so the dispatcher
420
+ knows the specialist starts without session memory — task text and `artifacts:` paths must
421
+ carry the state, which the deliverable-to-file protocol already ensures.
422
+
423
+ The per-run deadline lands as `turn_timeout` (exit 124) with partial output preserved, for
424
+ dispatched specialists, research helpers, and nested delegate children alike — a hung child
425
+ can no longer hold its parent for hours.
426
+
427
+ ### Task triage (complexity tiers)
428
+
429
+ The dispatcher classifies each user turn with the `set_task_tier` tool BEFORE its first
430
+ dispatch — `trivial` / `small` / `feature` / `project` — and the hub lowers the enforced
431
+ dispatch/research caps to **min(mode, tier)**: trivial = 1 dispatch / 1 research,
432
+ small = 2 / 2, feature = 6 / 4, `project` defers to the mode. Skipping the call makes the
433
+ first dispatch assume `feature` (except in strict mode, where tiers are opt-in). The tier
434
+ resets every user turn and shows in the `hub-mode` status chip (`Mode: standard·small · …`).
435
+ The system prompt ties the tier to the anti-over-engineering rules: a provided plan is a
436
+ spec (no re-planning), assertions stay ≤3 for trivial/small asks, and "using every persona"
437
+ is called out as a smell. Two hygiene guards are enforced in code, not prose: a
438
+ **duplicate-dispatch guard** refuses re-dispatching the same agent with a near-identical
439
+ task inside one turn, and every budget/duplicate refusal is counted in `/hub-report`.
440
+
441
+ ### Drift watchdog (in-flight observation)
442
+
443
+ An armed dispatch is observed **while it runs**, from the same JSON event stream that
444
+ drives the cards — not post-hoc:
445
+
446
+ - **Layer 1 — deterministic rules, zero tokens** (`drift-watchdog.js`): a write/edit
447
+ outside the dispatch's declared `scope` globs, the identical tool call repeated 4×,
448
+ 5 consecutive failed tool calls, or 200 total tool calls in one run.
449
+ - **Layer 2 — LLM judge, escalation only**: when a rule fires (single-flight, 90 s
450
+ cooldown), a one-shot cheap run (default model: the researcher persona's; override with
451
+ `watchdog-judge-model`) reads the original task + declared scope + recent tool trail and
452
+ answers `VERDICT: ON_TRACK|DRIFTING|STUCK`. Judge failures fail open.
453
+ - **Intervention**: DRIFTING/STUCK terminates the run as **`drift_stop`** (exit 125,
454
+ partial output preserved) and the dispatch result instructs: re-dispatch ONCE with a
455
+ corrected, narrowed task — never the same task unchanged.
456
+
457
+ Enablement is dynamic, precedence top to bottom: the `watchdog: true|false` param on a
458
+ single `dispatch_agent` call → a per-agent override (`/watchdog builder on|off|clear`) →
459
+ the hub-wide setting (`/watchdog on|off|auto`, default `auto`, project default via the
460
+ `watchdog:` overrides key). Read-only research helpers are not monitored — they already
461
+ run under the per-tool watchdog + turn deadline and cannot write.
462
+
463
+ ### Dynamic teams
464
+
465
+ Rosters start from `.pi/agents/teams.yaml` but are not frozen there:
466
+
467
+ - `/agents-add <persona>…` / `/agents-drop <persona>…` — restructure the ACTIVE team
468
+ live (drop refuses running or last members; session files are kept for re-adding).
469
+ - `/agents-save <name>` — persist the current roster as a named team back into
470
+ `teams.yaml` (targeted block upsert; comments and other teams untouched).
471
+ - `team_adjust` — the dispatcher itself may add/drop a persona **with a stated reason**;
472
+ disabled in fast mode, capped at 8 roster members, and every change is notified to the
473
+ human. The system prompt is rebuilt each turn, so changes take effect immediately.
474
+
475
+ ### `/hub-report`
476
+
477
+ Per-turn cost accounting: dispatches (agent, status, elapsed, billed/output tokens),
478
+ research runs, session recycles, drift stops, and budget/duplicate refusals — for the
479
+ current turn, the last completed turn, and session totals. Billed tokens count
480
+ input + cacheRead + cacheWrite, the same measure the recycler uses.
481
+
336
482
  Paths that don't exist produce a session-start warning, never an error. The full key list for
337
- `## agent-hub` (models, sub-roles, depth budgets, persona gate, research retention) is
338
- documented in `docs/agent-fleet-setup.md`.
483
+ `## agent-hub` (models, sub-roles, depth budgets, persona gate, research retention, watchdog,
484
+ mode/budget keys) is documented in `docs/agent-fleet-setup.md`.
339
485
 
340
486
  ## The coms layer
341
487
 
@@ -531,6 +677,45 @@ orchestration surface the dispatcher persona never narrows.
531
677
  The dispatcher persona is **flavor-only** (decision G4 / 9) — it enriches the role but never narrows
532
678
  this tool set, so coms and dispatch stay available regardless of the chosen persona.
533
679
 
680
+ ## Optional Hermes local monitor transport
681
+
682
+ The optional monitor is an Agent Fleet-owned transport boundary, not a Hermes runtime API or a
683
+ bundled Hermes plugin. When enabled, `agent-hub` publishes dispatcher-turn and specialist-run
684
+ state and owns generation-safe cancellation. A separate local Hermes UI or operator client may
685
+ consume the owner-only discovery + Unix-socket contract documented in
686
+ [`hermes/README.md`](../../../hermes/README.md#local-agent-hub-monitor-integration).
687
+
688
+ Set these before the hub starts:
689
+
690
+ ```bash
691
+ export AGENT_FLEET_PROFILE_ID="approved-profile-id"
692
+ export AGENT_FLEET_MONITOR_RUNTIME_DIR="/absolute/owner-only/runtime-root"
693
+ ```
694
+
695
+ Both are required for monitor startup; the runtime root must be absolute and owner-only, and the
696
+ profile ID must be a safe identifier. The monitor also starts only for a Herdr-backed hub with
697
+ `HERDR_WORKSPACE_ID` and `HERDR_PANE_ID`; retain those values and `HERDR_SOCKET_PATH` in the
698
+ standard `just hub-team <team>` flow. Workspace labels are display metadata, not monitor identity.
699
+
700
+ The live contract exposes three authenticated newline-delimited JSON requests: `snapshot`, cursor-
701
+ based `output`, and exact-generation `cancel`. The monitor is local-only and fails closed when its
702
+ profile discovery, lease, token, or Unix socket is unavailable. A native cancel targets only the
703
+ matching hub-owned process generation. A coms cancel abandons the local wait only; its peer can
704
+ continue. Neither path controls or closes a Herdr workspace/pane.
705
+
706
+ Example startup:
707
+
708
+ ```bash
709
+ monitor_runtime="${XDG_RUNTIME_DIR:?}/agent-fleet-monitor"
710
+ install -d -m 700 "$monitor_runtime"
711
+ AGENT_FLEET_PROFILE_ID=dev \
712
+ AGENT_FLEET_MONITOR_RUNTIME_DIR="$monitor_runtime" \
713
+ just hub-team default
714
+ ```
715
+
716
+ No Desktop/backend plugin installation is required or provided. Consumers must re-discover after
717
+ lease or socket loss and must never persist or log the token.
718
+
534
719
  ## Requires
535
720
 
536
721
  - `.pi/agents/teams.yaml` for fixed specialist teams, the referenced persona `.md` files, and
@@ -562,18 +747,16 @@ Identity flags: `--name`, `--purpose`, `--project`, `--color`, `--explicit`.
562
747
  to hub/dispatcher tool calls in that parent pi process — and because it is the *continue* variant, a
563
748
  blocked dispatcher call feeds back and the turn keeps going rather than aborting. Specialist and
564
749
  research agents are spawned as separate pi subprocesses with `--no-extensions` — but `agent-hub`
565
- resolves a damage-control harness (from this session's `-e` flags, else the repo-local
566
- `.pi/harnesses/<variant>/index.ts`) and re-loads *only* that one into each child via `-e`. The variant
567
- is chosen per child: research helpers (`researcher` / `deep-researcher`) get `damage-control-continue`
568
- so a blocked read lets them adapt and keep going; every other specialist gets the hard-stop
569
- `damage-control` that aborts on a violation. (Continue falls back to the hard-stop variant when it
570
- isn't installed, so researchers stay guarded either way.) `--no-extensions` keeps discovery off, so
571
- children never auto-load the `.pi/extensions/` utilities or recursively re-load `agent-hub`; the
572
- explicit `-e` still applies, so every child's tool calls are checked against the same
573
- `.pi/damage-control-rules.yaml`. If damage-control can't be resolved, a session-start warning is
574
- shown and children spawn unguarded. Research helpers are additionally read-only by construction.
575
- The guided setup (`guided-workspace-setup`) enforces the pairing: installing or keeping `agent-hub`
576
- always installs/keeps `damage-control` (and `damage-control-continue`) with it.
750
+ resolves `damage-control-continue` from this session's `-e` flags, else the repo-local harness, and
751
+ re-loads it into every native specialist, research helper, and nested delegate via explicit `-e`.
752
+ `--no-extensions` keeps discovery off, so children never auto-load `.pi/extensions/` utilities or
753
+ recursively re-load `agent-hub`; the explicit guardrail still checks every child's tool calls against
754
+ `.pi/damage-control-rules.yaml`. Protected-path blocks escalate to the hub for explicit approval;
755
+ protected deletions offer only Deny or Allow once, while inherently dangerous command patterns are
756
+ non-exemptible. Denial or timeout blocks the call without aborting the child's turn. If continue
757
+ cannot be resolved, dispatch is refused—children are never spawned unguarded. Research helpers are
758
+ additionally read-only by construction. Guided setup enforces `agent-hub` ⇒
759
+ `damage-control-continue` + `ask-user-remote`.
577
760
 
578
761
  ### Related recipes
579
762
 
@@ -0,0 +1,135 @@
1
+ import {
2
+ accessDecisionChoices,
3
+ accessRequestCacheKey,
4
+ appendExemptionToFile,
5
+ fileExemptionsFor,
6
+ type AccessDecision,
7
+ type AccessDecisionChoice,
8
+ type AccessRequest,
9
+ } from "../lib/damage-control-shared.ts";
10
+
11
+ type ApprovalContext = {
12
+ hasUI: boolean;
13
+ ui: {
14
+ notify(message: string, level?: string): void;
15
+ select(title: string, options: string[], settings: { timeout: number }): Promise<string | undefined>;
16
+ };
17
+ };
18
+
19
+ type ReplySocket = {
20
+ write(chunk: string): unknown;
21
+ end(): unknown;
22
+ };
23
+
24
+ type AccessApprovalDeps = {
25
+ getContext(): ApprovalContext | null | undefined;
26
+ getExemptionsFile(): string | null | undefined;
27
+ appendLog(entry: Record<string, unknown>): void;
28
+ now(): string;
29
+ };
30
+
31
+ export function createAccessApprovalRouter(deps: AccessApprovalDeps) {
32
+ let askQueue: Promise<unknown> = Promise.resolve();
33
+ let generation = 0;
34
+ const denyCache = new Set<string>();
35
+ const pending = new Map<string, Promise<AccessDecisionChoice>>();
36
+
37
+ const respond = (socket: ReplySocket, msgId: string, decision: AccessDecisionChoice) => {
38
+ const reply: AccessDecision = { type: "access_decision", msg_id: msgId, decision };
39
+ try { socket.write(JSON.stringify(reply) + "\n"); } catch { /* child may have timed out */ }
40
+ try { socket.end(); } catch { /* ignore */ }
41
+ };
42
+
43
+ const validRequest = (request: AccessRequest) =>
44
+ typeof request.pattern === "string" && request.pattern.length > 0 &&
45
+ (request.category === "zero_access" || request.category === "read_only" || request.category === "no_delete");
46
+
47
+ const decide = (request: AccessRequest): Promise<AccessDecisionChoice> => {
48
+ const agent = (typeof request.agent === "string" && request.agent) || request.sender_session || "unknown-agent";
49
+ const pattern = request.pattern;
50
+ const cacheKey = accessRequestCacheKey({ ...request, agent, pattern });
51
+ const exemptionsFile = deps.getExemptionsFile();
52
+ const requestGeneration = generation;
53
+
54
+ if (fileExemptionsFor(exemptionsFile ?? undefined, agent).some((entry) => entry.pattern === pattern)) {
55
+ return Promise.resolve("allow_all");
56
+ }
57
+ if (denyCache.has(cacheKey)) return Promise.resolve("deny");
58
+ const existing = pending.get(cacheKey);
59
+ if (existing) return existing;
60
+
61
+ const ask = askQueue.then(async (): Promise<AccessDecisionChoice> => {
62
+ if (requestGeneration !== generation) return "deny";
63
+ const ctx = deps.getContext();
64
+ if (!ctx?.hasUI) return "deny";
65
+
66
+ const labels = new Map<AccessDecisionChoice, string>([
67
+ ["deny", "Deny (keep blocked)"],
68
+ ["allow_once", "Allow once"],
69
+ ["allow_agent", `Allow for ${agent} (this session)`],
70
+ ["allow_all", "Allow for all agents (this session)"],
71
+ ]);
72
+ const allowed = accessDecisionChoices(request.category);
73
+ const options = allowed.map((decision) => labels.get(decision)!);
74
+ ctx.ui.notify(
75
+ `🛡️ Access request from ${agent}: ${request.rule}\n tool: ${request.tool}\n attempted: ${String(request.invocation || "").slice(0, 200)}`,
76
+ "warning",
77
+ );
78
+ try {
79
+ const choice = await ctx.ui.select(
80
+ `🛡️ ${agent} requests access: ${pattern}`,
81
+ options,
82
+ { timeout: 600_000 },
83
+ );
84
+ if (requestGeneration !== generation) return "deny";
85
+ const selected = allowed.find((decision) => labels.get(decision) === choice) ?? "deny";
86
+ if (selected === "deny" && choice === labels.get("deny")) denyCache.add(cacheKey);
87
+ return selected;
88
+ } catch {
89
+ return "deny";
90
+ }
91
+ });
92
+
93
+ askQueue = ask.catch(() => {});
94
+ pending.set(cacheKey, ask);
95
+ void ask.finally(() => pending.delete(cacheKey));
96
+ return ask;
97
+ };
98
+
99
+ return {
100
+ async handle(socket: ReplySocket, request: AccessRequest): Promise<void> {
101
+ if (!validRequest(request)) {
102
+ respond(socket, request.msg_id, "deny");
103
+ return;
104
+ }
105
+ const agent = (typeof request.agent === "string" && request.agent) || request.sender_session || "unknown-agent";
106
+ const decision = await decide(request).catch((): AccessDecisionChoice => "deny");
107
+ const exemptionsFile = deps.getExemptionsFile();
108
+ if ((decision === "allow_agent" || decision === "allow_all") && exemptionsFile) {
109
+ try {
110
+ appendExemptionToFile(exemptionsFile, {
111
+ pattern: request.pattern,
112
+ scope: "session",
113
+ agent: decision === "allow_agent" ? agent : undefined,
114
+ grantedVia: "escalation",
115
+ grantedAt: deps.now(),
116
+ });
117
+ } catch { /* allow-once semantics still hold via the reply */ }
118
+ }
119
+ deps.appendLog({ action: `escalation_${decision}`, agent, pattern: request.pattern, tool: request.tool, rule: request.rule });
120
+ try {
121
+ deps.getContext()?.ui.notify(
122
+ `🛡️ Access ${decision === "deny" ? "denied" : `granted (${decision.replace(/_/g, " ")})`}: ${request.pattern} — ${agent}`,
123
+ decision === "deny" ? "warning" : "info",
124
+ );
125
+ } catch { /* ignore */ }
126
+ respond(socket, request.msg_id, decision);
127
+ },
128
+ reset() {
129
+ generation++;
130
+ askQueue = Promise.resolve();
131
+ denyCache.clear();
132
+ pending.clear();
133
+ },
134
+ };
135
+ }
@@ -35,7 +35,7 @@ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
35
35
  import { Type } from "@sinclair/typebox";
36
36
  import { appendFileSync, mkdirSync, writeFileSync } from "fs";
37
37
  import type { ChildProcess } from "child_process";
38
- import { spawnPiAgent } from "./spawn.ts";
38
+ import { spawnPiAgent, killPiTree } from "./spawn.ts";
39
39
  import {
40
40
  delegateBudgetRefusal,
41
41
  DELEGATE_TREE_SPAWN_BUDGET,
@@ -68,6 +68,10 @@ export interface DelegateConfig {
68
68
  eventDir: string;
69
69
  damageControl?: string;
70
70
  delegateExt: string;
71
+ /** Parent-side per-tool deadline inherited by every terminal child. */
72
+ reconSearchTimeoutMs?: number | null;
73
+ /** Whole-run deadline per delegate child (hub mode budget); null/absent = off. */
74
+ turnDeadlineMs?: number | null;
71
75
  cwd: string;
72
76
  }
73
77
 
@@ -139,9 +143,7 @@ export default function (pi: ExtensionAPI) {
139
143
  // signals the specialist's negative PID), but if only this process is
140
144
  // terminated, forward the signal to any live children.
141
145
  process.on("SIGTERM", () => {
142
- for (const child of liveChildren) {
143
- try { child.kill("SIGTERM"); } catch {}
144
- }
146
+ for (const child of liveChildren) killPiTree(child, "SIGTERM");
145
147
  });
146
148
 
147
149
  const emit = (event: Record<string, unknown>) => {
@@ -303,6 +305,16 @@ export default function (pi: ExtensionAPI) {
303
305
  extensions: childExtensions,
304
306
  env: childConfig ? { AGENT_HUB_DELEGATE_CONFIG: JSON.stringify(childConfig) } : undefined,
305
307
  cwd: config.cwd,
308
+ // Each nested child owns its group. The SIGTERM trap above forwards
309
+ // parent cancellation so detached children cannot become orphans.
310
+ detached: true,
311
+ signal: _signal,
312
+ // `null` is the explicit `off` override; preserve it rather than
313
+ // silently restoring the default for terminal children.
314
+ toolWatchdog: { timeoutMs: config.reconSearchTimeoutMs === undefined ? 120_000 : config.reconSearchTimeoutMs },
315
+ // Whole-run bound from the hub's mode budget: a hung delegate (the
316
+ // 92-minute conventions scout) must not hold its parent hostage.
317
+ turnDeadlineMs: config.turnDeadlineMs === undefined ? null : config.turnDeadlineMs,
306
318
  }, {
307
319
  onProcess: (p) => { childProc = p; liveChildren.add(p); },
308
320
  onTextDelta: (delta) => queueDelta("text", delta),
@@ -325,8 +337,8 @@ export default function (pi: ExtensionAPI) {
325
337
 
326
338
  flushTimeline();
327
339
  const elapsed = Date.now() - startTime;
328
- const code = res.spawnError ? 1 : (res.exitCode ?? 1);
329
- emit({ t: "exit", id: childId, code, elapsed, ts: Date.now() });
340
+ const code = res.spawnError ? 1 : (res.termination ? (res.termination.reason === "cancelled" ? 130 : res.termination.reason === "drift_stop" ? 125 : 124) : (res.exitCode ?? 1));
341
+ emit({ t: "exit", id: childId, code, elapsed, termination: res.termination, ts: Date.now() });
330
342
 
331
343
  if (res.spawnError) {
332
344
  const spawnFailure = `Delegate ${childId} failed to spawn: ${res.spawnError}`;
@@ -338,7 +350,18 @@ export default function (pi: ExtensionAPI) {
338
350
  }
339
351
 
340
352
  let output = res.output;
341
- if (code !== 0) {
353
+ if (res.termination) {
354
+ const reason = res.termination.reason;
355
+ const tool = res.termination.tool;
356
+ const explanation = reason === "tool_timeout"
357
+ ? `exceeded its per-tool watchdog on ${tool?.toolName || "tool"} (${tool?.toolCallId || "unknown"})`
358
+ : reason === "turn_timeout"
359
+ ? "exceeded the per-run deadline (mode budget / agent-turn-timeout-s)"
360
+ : reason === "drift_stop"
361
+ ? "was stopped by the drift watchdog"
362
+ : "was cancelled by its caller";
363
+ output = `${reason}: delegate ${childId} ${explanation}; terminationConfirmed=${res.termination.confirmed}.`;
364
+ } else if (code !== 0) {
342
365
  const errTail = res.stderr.trim().slice(-1000);
343
366
  output = output
344
367
  ? `${output}\n\n[stderr]\n${errTail}`
@@ -354,9 +377,9 @@ export default function (pi: ExtensionAPI) {
354
377
 
355
378
  return {
356
379
  content: [{ type: "text" as const, text:
357
- `[delegate ${childId} · ${roleDef.model} · ${effectiveTools}] ${code === 0 ? "done" : "error"} ` +
380
+ `[delegate ${childId} · ${roleDef.model} · ${effectiveTools}] ${res.termination ? res.termination.reason : code === 0 ? "done" : "error"} ` +
358
381
  `in ${Math.round(elapsed / 1000)}s${noteBlock}\n\n${digest.text}` }],
359
- details: { id: childId, role: roleKey, model: roleDef.model, status: code === 0 ? "done" : "error", elapsed, resultPath: childResultFile, digestFound: digest.hasDigest },
382
+ details: { id: childId, role: roleKey, model: roleDef.model, status: res.termination ? res.termination.reason : code === 0 ? "done" : "error", elapsed, resultPath: childResultFile, digestFound: digest.hasDigest, termination: res.termination },
360
383
  };
361
384
  },
362
385
  });