@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
@@ -1,16 +1,7 @@
1
1
  /**
2
2
  * spawnPiAgent — the ONE place agent-hub code spawns a headless `pi` child and
3
- * parses its JSON event stream. Used by the hub itself (specialist dispatch +
4
- * research helpers, index.ts) and by the injected delegate extension
5
- * (delegate.ts), so the spawn args and stream parsing never exist in two
6
- * copies.
7
- *
8
- * The child is always `pi --mode json -p --no-extensions` with explicit `-e`
9
- * extensions (damage-control first, delegate when the persona declares
10
- * subagents), a model, a tool allowlist, and a session file. NOTE: pi's
11
- * `--tools` allowlist applies to extension-registered tools too, so a tool a
12
- * `-e` extension provides (e.g. `delegate`) must be NAMED in `tools` or the
13
- * child model never sees it (validated 2026-06-11).
3
+ * parses its JSON event stream. Research helpers and read-only delegate children
4
+ * opt into the per-tool watchdog here, rather than trusting an agent-side timer.
14
5
  */
15
6
 
16
7
  import { spawn, type ChildProcess } from "child_process";
@@ -21,49 +12,97 @@ export interface PiUsage {
21
12
  [k: string]: any;
22
13
  }
23
14
 
15
+ export interface ToolTimeout {
16
+ toolCallId: string;
17
+ toolName: string;
18
+ args: string;
19
+ startedAt: number;
20
+ deadlineAt: number;
21
+ }
22
+
23
+ export interface Termination {
24
+ reason: "tool_timeout" | "turn_timeout" | "drift_stop" | "cancelled";
25
+ confirmed: boolean;
26
+ escalated: boolean;
27
+ tool?: ToolTimeout;
28
+ }
29
+
30
+ /** External run control handed to the caller via onControl (drift watchdog). */
31
+ export interface PiRunControl {
32
+ /** Terminate the child group with the given classification (default "drift_stop"). */
33
+ terminate(reason?: "drift_stop" | "cancelled"): void;
34
+ }
35
+
36
+ export interface ToolWatchdogOptions {
37
+ /** Per read-only tool call deadline. null disables the watchdog. */
38
+ timeoutMs: number | null;
39
+ /** Grace after SIGTERM, followed by SIGKILL. Kept injectable for focused tests. */
40
+ termGraceMs?: number;
41
+ /** Bound on final settlement; never wait forever for close or inherited pipes. */
42
+ settleGraceMs?: number;
43
+ /** Only these tool names are watched (research/delegate read-only surface). */
44
+ tools?: readonly string[];
45
+ }
46
+
24
47
  export interface SpawnPiAgentOptions {
25
48
  model: string;
26
49
  tools: string;
27
50
  thinking: string;
28
51
  appendSystemPrompt: string;
29
52
  sessionFile: string;
30
- /** Pass `-c` so the child resumes sessionFile instead of starting fresh. */
31
53
  resume?: boolean;
32
54
  prompt: string;
33
- /** `-e` extension paths, in order (damage-control first). */
34
55
  extensions?: string[];
35
- /** Extra env on top of process.env (e.g. AGENT_HUB_DELEGATE_CONFIG). */
36
56
  env?: Record<string, string>;
37
- /**
38
- * Spawn the child as its own process group leader (setsid). The kill
39
- * cascade relies on this: delegate children spawned INSIDE the child
40
- * inherit its group, so signalling the negative PID kills the whole tree.
41
- */
57
+ /** Own a process group. Required for a watchdog/cancellation kill cascade. */
42
58
  detached?: boolean;
43
59
  cwd?: string;
60
+ /** Parent tool cancellation; classified separately from a tool timeout. */
61
+ signal?: AbortSignal;
62
+ toolWatchdog?: ToolWatchdogOptions;
63
+ /**
64
+ * Whole-run deadline: one timer from spawn start; on expiry the child group is
65
+ * terminated with reason "turn_timeout" (same SIGTERM→SIGKILL→settle cascade as
66
+ * the per-tool watchdog). null/undefined disables it. Unlike the tool watchdog
67
+ * this bounds the ENTIRE run, thinking and non-watched tools included.
68
+ */
69
+ turnDeadlineMs?: number | null;
44
70
  }
45
71
 
46
72
  export interface SpawnPiAgentCallbacks {
47
- /** Fires immediately after spawn so the caller can store the proc for kill. */
48
73
  onProcess?(proc: ChildProcess): void;
74
+ /** Receives a terminate handle for parent-side classified stops (drift watchdog). */
75
+ onControl?(control: PiRunControl): void;
49
76
  onTextDelta?(delta: string): void;
50
77
  onThinkingDelta?(delta: string): void;
51
- onToolStart?(toolName: string, argStr: string): void;
52
- /**
53
- * Usage from the stream: per assistant message (`message_end`) and once at
54
- * the end with the final assistant message (`agent_end`).
55
- */
78
+ onToolStart?(toolName: string, argStr: string, toolCallId?: string): void;
79
+ /** isError is present only when the event stream carries an error flag. */
80
+ onToolEnd?(toolName: string, toolCallId?: string, isError?: boolean): void;
56
81
  onUsage?(usage: PiUsage, source: "message_end" | "agent_end"): void;
57
82
  }
58
83
 
59
84
  export interface SpawnPiAgentResult {
60
- /** Concatenated assistant text deltas. */
61
85
  output: string;
62
- /** Process exit code; null when the child died from a signal (e.g. SIGTERM). */
63
86
  exitCode: number | null;
64
87
  stderr: string;
65
- /** Set when the process could not be spawned at all (proc `error` event). */
66
88
  spawnError?: string;
89
+ /** Present only when parent-side bounded termination was requested. */
90
+ termination?: Termination;
91
+ }
92
+
93
+ const DEFAULT_TERM_GRACE_MS = 1_000;
94
+ const DEFAULT_SETTLE_GRACE_MS = 1_000;
95
+ const WATCHED_TOOLS = new Set(["read", "grep", "find", "ls"]);
96
+
97
+ /** Signal an explicitly owned process group, falling back only for legacy callers. */
98
+ export function killPiTree(proc: ChildProcess, signal: NodeJS.Signals = "SIGTERM"): void {
99
+ const pid = proc.pid;
100
+ if (pid == null) return;
101
+ try {
102
+ process.kill(-pid, signal);
103
+ } catch {
104
+ try { proc.kill(signal); } catch {}
105
+ }
67
106
  }
68
107
 
69
108
  export function spawnPiAgent(
@@ -71,54 +110,119 @@ export function spawnPiAgent(
71
110
  cbs: SpawnPiAgentCallbacks = {},
72
111
  ): Promise<SpawnPiAgentResult> {
73
112
  const args = [
74
- "--mode", "json",
75
- "-p",
76
- "--no-extensions",
113
+ "--mode", "json", "-p", "--no-extensions",
77
114
  ...(opts.extensions || []).flatMap(e => ["-e", e]),
78
- "--model", opts.model,
79
- "--tools", opts.tools,
80
- "--thinking", opts.thinking,
81
- "--append-system-prompt", opts.appendSystemPrompt,
82
- "--session", opts.sessionFile,
115
+ "--model", opts.model, "--tools", opts.tools, "--thinking", opts.thinking,
116
+ "--append-system-prompt", opts.appendSystemPrompt, "--session", opts.sessionFile,
83
117
  ];
84
118
  if (opts.resume) args.push("-c");
85
119
 
120
+ const watchdog = opts.toolWatchdog;
121
+ const turnDeadlineMs = opts.turnDeadlineMs ?? null;
122
+ // A watchdog or deadline must own its group: group signalling remains valid even
123
+ // after the pi leader exits while an inherited-stdio descendant is still alive.
124
+ const ownsGroup = opts.detached === true || watchdog !== undefined || opts.signal !== undefined || turnDeadlineMs != null || cbs.onControl !== undefined;
125
+ const watchedTools = new Set(watchdog?.tools ?? WATCHED_TOOLS);
126
+ const timeoutMs = watchdog?.timeoutMs ?? null;
127
+ const termGraceMs = watchdog?.termGraceMs ?? DEFAULT_TERM_GRACE_MS;
128
+ const settleGraceMs = watchdog?.settleGraceMs ?? DEFAULT_SETTLE_GRACE_MS;
129
+
86
130
  const textChunks: string[] = [];
87
131
  const stderrChunks: string[] = [];
88
-
89
132
  return new Promise((resolve) => {
90
133
  const proc = spawn("pi", args, {
91
- // pi's CLI does not accept a standalone `--` option separator, so pass
92
- // the prompt through stdin. Print mode documents stdin as prompt input,
93
- // and this keeps prompts that start with `-` from being parsed as flags.
94
134
  stdio: ["pipe", "pipe", "pipe"],
95
135
  env: { ...process.env, ...(opts.env || {}) },
96
136
  ...(opts.cwd ? { cwd: opts.cwd } : {}),
97
- ...(opts.detached ? { detached: true } : {}),
137
+ ...(ownsGroup ? { detached: true } : {}),
98
138
  });
99
139
  cbs.onProcess?.(proc);
100
140
  proc.stdin?.on("error", () => {});
101
141
  proc.stdin?.end(opts.prompt);
102
142
 
103
143
  let buffer = "";
144
+ let settled = false;
145
+ let closeSeen = false;
146
+ let termination: Termination | undefined;
147
+ let termTimer: ReturnType<typeof setTimeout> | undefined;
148
+ let settleTimer: ReturnType<typeof setTimeout> | undefined;
149
+ let deadlineTimer: ReturnType<typeof setTimeout> | undefined;
150
+ const calls = new Map<string, ToolTimeout & { timer: ReturnType<typeof setTimeout> }>();
151
+
152
+ const clearCalls = () => {
153
+ for (const call of calls.values()) clearTimeout(call.timer);
154
+ calls.clear();
155
+ };
156
+ const cleanup = () => {
157
+ clearCalls();
158
+ if (termTimer) clearTimeout(termTimer);
159
+ if (settleTimer) clearTimeout(settleTimer);
160
+ if (deadlineTimer) clearTimeout(deadlineTimer);
161
+ opts.signal?.removeEventListener("abort", onAbort);
162
+ };
163
+ const settle = (code: number | null, spawnError?: string) => {
164
+ if (settled) return;
165
+ settled = true;
166
+ cleanup();
167
+ if (termination) termination.confirmed = closeSeen;
168
+ // A pipe held by a descendant must not hold the caller forever.
169
+ try { proc.stdin?.destroy(); } catch {}
170
+ try { proc.stdout?.destroy(); } catch {}
171
+ try { proc.stderr?.destroy(); } catch {}
172
+ resolve({ output: textChunks.join(""), exitCode: code, stderr: stderrChunks.join(""), ...(spawnError ? { spawnError } : {}), ...(termination ? { termination } : {}) });
173
+ };
174
+ const terminate = (reason: Termination["reason"], tool?: ToolTimeout) => {
175
+ // The first classification wins; later cancellation/exit events keep it.
176
+ if (termination) return;
177
+ termination = { reason, confirmed: false, escalated: false, ...(tool ? { tool } : {}) };
178
+ clearCalls();
179
+ killPiTree(proc, "SIGTERM");
180
+ termTimer = setTimeout(() => {
181
+ if (settled) return;
182
+ termination!.escalated = true;
183
+ killPiTree(proc, "SIGKILL");
184
+ }, termGraceMs);
185
+ settleTimer = setTimeout(() => settle(null), termGraceMs + settleGraceMs);
186
+ };
187
+ const onAbort = () => terminate("cancelled");
188
+ if (opts.signal?.aborted) onAbort();
189
+ else opts.signal?.addEventListener("abort", onAbort, { once: true });
190
+ // External classified stop (drift watchdog): same first-classification-wins
191
+ // cascade as every other termination path; harmless after settle.
192
+ cbs.onControl?.({ terminate: (reason = "drift_stop") => { if (!settled) terminate(reason); } });
193
+ if (turnDeadlineMs != null) {
194
+ deadlineTimer = setTimeout(() => terminate("turn_timeout"), turnDeadlineMs);
195
+ }
196
+
197
+ const toolId = (event: any) => String(event.toolCallId ?? event.tool_call_id ?? event.id ?? "");
104
198
  const handleEvent = (event: any) => {
105
199
  if (event.type === "message_update") {
106
200
  const delta = event.assistantMessageEvent;
107
- if (delta?.type === "text_delta") {
108
- textChunks.push(delta.delta || "");
109
- cbs.onTextDelta?.(delta.delta || "");
110
- } else if (delta?.type === "thinking_delta") {
111
- cbs.onThinkingDelta?.(delta.delta || "");
112
- }
201
+ if (delta?.type === "text_delta") { textChunks.push(delta.delta || ""); cbs.onTextDelta?.(delta.delta || ""); }
202
+ else if (delta?.type === "thinking_delta") cbs.onThinkingDelta?.(delta.delta || "");
113
203
  } else if (event.type === "tool_execution_start") {
114
204
  let argStr = "";
115
- try { argStr = event.args != null ? JSON.stringify(event.args) : ""; } catch { argStr = ""; }
116
- cbs.onToolStart?.(event.toolName || "tool", argStr);
205
+ try { argStr = event.args != null ? JSON.stringify(event.args) : ""; } catch {}
206
+ const id = toolId(event);
207
+ const name = event.toolName || "tool";
208
+ cbs.onToolStart?.(name, argStr, id || undefined);
209
+ if (timeoutMs != null && id && watchedTools.has(name) && !calls.has(id)) {
210
+ const startedAt = Date.now();
211
+ const call: ToolTimeout = { toolCallId: id, toolName: name, args: argStr, startedAt, deadlineAt: startedAt + timeoutMs };
212
+ calls.set(id, { ...call, timer: setTimeout(() => terminate("tool_timeout", call), timeoutMs) });
213
+ }
214
+ } else if (event.type === "tool_execution_end") {
215
+ const id = toolId(event);
216
+ if (id) {
217
+ const call = calls.get(id);
218
+ if (call) { clearTimeout(call.timer); calls.delete(id); }
219
+ }
220
+ const rawIsError = event.isError ?? event.is_error ?? event.result?.isError ?? event.result?.is_error;
221
+ cbs.onToolEnd?.(event.toolName || "tool", id || undefined, typeof rawIsError === "boolean" ? rawIsError : undefined);
117
222
  } else if (event.type === "message_end") {
118
223
  if (event.message?.usage) cbs.onUsage?.(event.message.usage, "message_end");
119
224
  } else if (event.type === "agent_end") {
120
- const msgs = event.messages || [];
121
- const last = [...msgs].reverse().find((m: any) => m.role === "assistant");
225
+ const last = [...(event.messages || [])].reverse().find((m: any) => m.role === "assistant");
122
226
  if (last?.usage) cbs.onUsage?.(last.usage, "agent_end");
123
227
  }
124
228
  };
@@ -128,52 +232,15 @@ export function spawnPiAgent(
128
232
  buffer += chunk;
129
233
  const lines = buffer.split("\n");
130
234
  buffer = lines.pop() || "";
131
- for (const line of lines) {
132
- if (!line.trim()) continue;
133
- try { handleEvent(JSON.parse(line)); } catch {}
134
- }
235
+ for (const line of lines) { if (line.trim()) try { handleEvent(JSON.parse(line)); } catch {} }
135
236
  });
136
-
137
237
  proc.stderr!.setEncoding("utf-8");
138
- proc.stderr!.on("data", (chunk: string) => {
139
- stderrChunks.push(chunk);
140
- });
141
-
238
+ proc.stderr!.on("data", (chunk: string) => stderrChunks.push(chunk));
142
239
  proc.on("close", (code) => {
143
- if (buffer.trim()) {
144
- try { handleEvent(JSON.parse(buffer)); } catch {}
145
- }
146
- resolve({
147
- output: textChunks.join(""),
148
- exitCode: code,
149
- stderr: stderrChunks.join(""),
150
- });
151
- });
152
-
153
- proc.on("error", (err) => {
154
- resolve({
155
- output: "",
156
- exitCode: 1,
157
- stderr: stderrChunks.join(""),
158
- spawnError: err.message,
159
- });
240
+ closeSeen = true;
241
+ if (buffer.trim()) try { handleEvent(JSON.parse(buffer)); } catch {}
242
+ settle(code);
160
243
  });
244
+ proc.on("error", (err) => settle(1, err.message));
161
245
  });
162
246
  }
163
-
164
- /**
165
- * Kill a spawned pi child and — when it was spawned `detached` — its whole
166
- * process group, so delegate children and grandchildren die with their parent.
167
- * For a non-detached child the group kill fails with ESRCH (its pgid is the
168
- * hub's, not its own pid) and we fall back to a single-process SIGTERM, which
169
- * matches the pre-cascade behavior.
170
- */
171
- export function killPiTree(proc: ChildProcess, signal: NodeJS.Signals = "SIGTERM"): void {
172
- const pid = proc.pid;
173
- if (pid == null) return;
174
- try {
175
- process.kill(-pid, signal);
176
- } catch {
177
- try { proc.kill(signal); } catch {}
178
- }
179
- }
@@ -0,0 +1,18 @@
1
+ import { readFileSync } from "node:fs";
2
+
3
+ export const VERSION_STATUS_KEY = "00-agent-fleet-version";
4
+
5
+ function readAdjacentVersion(): string | null {
6
+ try {
7
+ const manifest = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8"));
8
+ return typeof manifest.version === "string" && manifest.version.length > 0 ? manifest.version : null;
9
+ } catch {
10
+ return null;
11
+ }
12
+ }
13
+
14
+ export const HARNESS_VERSION = readAdjacentVersion();
15
+
16
+ export function registerVersionStatus(ctx: { ui?: { setStatus?: (key: string, text: string) => void } }): void {
17
+ if (HARNESS_VERSION) ctx.ui?.setStatus?.(VERSION_STATUS_KEY, `v${HARNESS_VERSION}`);
18
+ }
@@ -13,6 +13,16 @@ peers through per-project registry files under `~/.pi/coms/projects/<project>/ag
13
13
  Surfaces a live "pool" widget of connected peers, with ping and keepalive cycles and a
14
14
  clean shutdown lifecycle.
15
15
 
16
+ ## Version footer and provenance
17
+
18
+ This persistent-UI harness shows `v<version>` below the prompt. It shares one common-key
19
+ status with `agent-hub` and `damage-control-continue`, so a stack renders the
20
+ version once. The root `package.json` is canonical; `bin/sync-harness-versions.js` synchronizes
21
+ its value into this adjacent manifest. The local `version.ts` reader is retained so a copied or
22
+ symlinked harness resolves its own adjacent stamp, not the launch directory. That provenance
23
+ pair does not carry dependencies: copy/symlink targets still require the existing full
24
+ `.pi/harnesses/` dependency installation.
25
+
16
26
  ## Presence backends: herdr vs files
17
27
 
18
28
  Presence (who's alive, what state they're in) is pluggable; the **envelope transport,
@@ -23,6 +23,7 @@ import * as fs from "node:fs";
23
23
  import * as path from "node:path";
24
24
  import * as os from "node:os";
25
25
  import * as crypto from "node:crypto";
26
+ import { registerVersionStatus } from "./version.ts";
26
27
 
27
28
  import {
28
29
  formatPeerStatus,
@@ -783,6 +784,7 @@ export default function (pi: ExtensionAPI) {
783
784
 
784
785
  // ━━ session_start ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
785
786
  pi.on("session_start", async (_event, ctx) => {
787
+ registerVersionStatus(ctx);
786
788
  currentCtx = ctx;
787
789
 
788
790
  // 1. Resolve identity from CLI flags > frontmatter > defaults.
@@ -1,6 +1,7 @@
1
1
  {
2
- "name": "agent-fleet-pi-coms",
3
- "private": true,
4
- "type": "module",
5
- "main": "index.ts"
2
+ "name": "agent-fleet-pi-coms",
3
+ "private": true,
4
+ "type": "module",
5
+ "main": "index.ts",
6
+ "version": "0.0.4"
6
7
  }
@@ -0,0 +1,18 @@
1
+ import { readFileSync } from "node:fs";
2
+
3
+ export const VERSION_STATUS_KEY = "00-agent-fleet-version";
4
+
5
+ function readAdjacentVersion(): string | null {
6
+ try {
7
+ const manifest = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8"));
8
+ return typeof manifest.version === "string" && manifest.version.length > 0 ? manifest.version : null;
9
+ } catch {
10
+ return null;
11
+ }
12
+ }
13
+
14
+ export const HARNESS_VERSION = readAdjacentVersion();
15
+
16
+ export function registerVersionStatus(ctx: { ui?: { setStatus?: (key: string, text: string) => void } }): void {
17
+ if (HARNESS_VERSION) ctx.ui?.setStatus?.(VERSION_STATUS_KEY, `v${HARNESS_VERSION}`);
18
+ }
@@ -6,23 +6,26 @@ Safety auditing — blocks destructive tool calls, but lets the agent **adapt an
6
6
 
7
7
  ## What it does
8
8
 
9
- Same rule engine as [`damage-control`](../damage-control/README.md) — it loads
10
- `.pi/damage-control-rules.yaml` (`bashToolPatterns`, `zeroAccessPaths`,
9
+ It loads `.pi/damage-control-rules.yaml` (`bashToolPatterns`, `zeroAccessPaths`,
11
10
  `readOnlyPaths`, `noDeletePaths`) and checks every tool call against it.
12
11
 
13
- The difference is what happens on a match:
12
+ On a match, `damage-control-continue` replaces the tool result with **actionable
13
+ feedback** that distinguishes destructive from non-destructive intent and tells
14
+ the agent how to adapt. It does **not** call `ctx.abort()`: the blocked operation
15
+ fails closed, but the turn continues so the agent can report the block or take a
16
+ safe alternative. Protected-path calls may proceed only through the explicit
17
+ approval/exemption paths below; inherently dangerous command patterns never can.
14
18
 
15
- - **`damage-control`** replaces the tool result with a block message **and calls
16
- `ctx.abort()`**, ending the agent's turn (hard stop).
17
- - **`damage-control-continue`** replaces the tool result with **actionable
18
- feedback** that distinguishes destructive from non-destructive intent and tells
19
- the agent how to adapt — and does **not** abort. The turn continues, so the
20
- agent can recover (e.g. assume a `.env` key exists instead of reading it to
21
- verify) instead of dead-ending.
19
+ ## Version footer and provenance
22
20
 
23
- By default both variants hard-block. The choice is whether the agent's turn dies
24
- or keeps going — plus, in this variant, whether **you** let the call through via
25
- exemptions (below).
21
+ This persistent-UI harness shows `v<version>` below the prompt. It shares one common-key
22
+ status with `agent-hub` and `coms`, so a stack renders the version once. Its
23
+ version remains separate from the mutable `damage-control` status: active-rule and
24
+ last-violation feedback never replaces it. The root `package.json` is canonical;
25
+ `bin/sync-harness-versions.js` synchronizes its value into this adjacent manifest. The local
26
+ `version.ts` reader supports copied or symlinked harness directories by resolving that adjacent
27
+ stamp, but those targets still require the pre-existing full `.pi/harnesses/` dependency
28
+ installation.
26
29
 
27
30
  ## Exemptions — allow access per turn or per session
28
31
 
@@ -49,28 +52,27 @@ re-prompt you; no answer within 60s fails closed.
49
52
  **Escalation from headless children**: when this harness runs inside a subagent
50
53
  spawned by agent-hub (no UI, `AGENT_HUB_ASK_ENDPOINT` set), a path block sends an
51
54
  `access_request` to the hub's coms socket instead. The dispatcher session shows
52
- who is asking, for what, and why it was blocked — *Deny / Allow once / Allow for
53
- this agent / Allow for all agents (session)*. The child waits up to 60s and fails
54
- closed on timeout; a late answer still lands in the shared exemptions file, so
55
- the next attempt (from any child) passes. At most 3 escalations per child run;
56
- denials are cached.
55
+ who is asking, for what, and why it was blocked. Ordinary protected reads/writes
56
+ offer *Deny / Allow once / Allow for this agent / Allow for all agents (session)*.
57
+ A protected deletion offers only *Deny / Allow once*, so approving one file does
58
+ not grant its parent directory. The child waits up to 60s and fails closed on
59
+ timeout. At most 3 escalations per child run; denials are cached.
57
60
 
58
61
  **Shared exemptions file**: agent-hub keeps one session-scoped file
59
62
  (`~/.pi/coms/exemptions/<session>.json`, deleted on shutdown) and passes it to
60
63
  every spawned child via `AGENT_HUB_EXEMPTIONS_FILE`. `/allow <pattern> session`
61
- in the hub lands there, so it covers the whole team — including hard-stop
62
- [`damage-control`](../damage-control/README.md) specialists, which honor the
63
- file but never prompt or escalate. It is re-read on every block, so mid-session
64
- grants reach already-running children. Everything (grants, revokes, escalation
64
+ in the hub lands there, so it covers the whole team. Every native specialist,
65
+ research helper, and nested delegate uses this harness and re-reads the file on
66
+ every block, so mid-session grants reach already-running children. Everything
67
+ (grants, revokes, escalation
65
68
  outcomes) is logged to the `damage-control-log` session entries.
66
69
 
67
70
  ## When it's used (this repo)
68
71
 
69
- `just hub` / `just hub-solo` load this variant for the **orchestrator/dispatcher
70
- main session**, and the hub re-loads it into spawned **research helpers**
71
- (`researcher` / `deep-researcher`) — both need to recover from a blocked read and
72
- keep going rather than abort. Every other spawned specialist (builder,
73
- test-engineer, …) keeps the hard-stop `damage-control` harness.
72
+ `just hub` / `just hub-solo` load this harness for the **orchestrator/dispatcher
73
+ main session**, and Agent Hub re-loads it into every native **specialist, research
74
+ helper, and nested delegate**. If the harness cannot be resolved, Agent Hub
75
+ refuses guarded child dispatch rather than launching an unprotected process.
74
76
 
75
77
  ## Commands & tools
76
78
 
@@ -107,10 +109,9 @@ pi -e .pi/harnesses/damage-control-continue/index.ts -e .pi/harnesses/agent-hub/
107
109
 
108
110
  - Theme integration removed — the `themeMap.ts` import and the `applyExtensionDefaults()`
109
111
  call were stripped (this repo does not ship pi themes).
110
- - The `find` tool's `pattern` is matched against `zeroAccessPaths` (mirrors the
111
- hardening in this repo's `damage-control`), closing a gap where `find` could
112
- still locate secret files.
112
+ - The `find` tool's `pattern` is matched against `zeroAccessPaths`, closing a gap
113
+ where `find` could still locate secret files.
113
114
  - Exemption layer added (not in upstream): `/allow`/`/allowed`/`/revoke`,
114
115
  block-time approval dialog, and escalation from headless agent-hub children to
115
116
  the dispatcher — see the Exemptions section above. Shared plumbing lives in
116
- [`../damage-control/shared.ts`](../damage-control/shared.ts).
117
+ [`../lib/damage-control-shared.ts`](../lib/damage-control-shared.ts).
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Damage-Control (continue) — same rules as damage-control, but the agent keeps working
2
+ * Damage-Control (continue) — fail-closed guardrails without aborting the agent turn
3
3
  *
4
- * Difference from damage-control/index.ts:
5
- * - The blocked tool result is replaced with actionable feedback that
4
+ * On a blocked tool call:
5
+ * - The result is replaced with actionable feedback that
6
6
  * distinguishes destructive vs non-destructive intent and tells the
7
7
  * agent how to adapt.
8
8
  * - We do NOT call ctx.abort(), so the agent's turn continues and can
@@ -23,10 +23,9 @@
23
23
  * dispatcher over its coms socket and waits for the user's decision;
24
24
  * timeout or denial fails closed.
25
25
  *
26
- * In this repo it is the default guardrail for the orchestrator/dispatcher
27
- * (the agent-hub main session) and for spawned research helpers, which need
28
- * to recover from a blocked read and keep going rather than abort the turn.
29
- * Other specialists (builder, etc.) keep the hard-stop damage-control harness.
26
+ * In this repo it is the only supported safety harness: the agent-hub main
27
+ * session and every native specialist, research helper, and nested delegate
28
+ * use it. Missing safety plumbing makes Agent Hub refuse child dispatch.
30
29
  *
31
30
  * Usage: pi -e .pi/harnesses/damage-control-continue/index.ts
32
31
  */
@@ -50,7 +49,9 @@ import {
50
49
  type AccessRequest,
51
50
  type Exemption,
52
51
  type ExemptionScope,
53
- } from "../damage-control/shared.ts";
52
+ type PathRuleCategory,
53
+ } from "../lib/damage-control-shared.ts";
54
+ import { registerVersionStatus } from "./version.ts";
54
55
 
55
56
  interface Rule {
56
57
  pattern: string;
@@ -264,6 +265,7 @@ export default function (pi: ExtensionAPI) {
264
265
  });
265
266
 
266
267
  pi.on("session_start", async (_event, ctx) => {
268
+ registerVersionStatus(ctx);
267
269
  const projectRulesPath = path.join(ctx.cwd, ".pi", "damage-control-rules.yaml");
268
270
  const globalRulesPath = path.join(os.homedir(), ".pi", "damage-control-rules.yaml");
269
271
  const rulesPath = fs.existsSync(projectRulesPath) ? projectRulesPath : fs.existsSync(globalRulesPath) ? globalRulesPath : null;
@@ -297,6 +299,7 @@ export default function (pi: ExtensionAPI) {
297
299
  // those are exemptible/escalatable. Destructive bashToolPatterns leave
298
300
  // this null and can never be exempted.
299
301
  let matchedPattern: string | null = null;
302
+ let matchedCategory: PathRuleCategory | null = null;
300
303
 
301
304
  const checkPaths = (pathsToCheck: string[]) => {
302
305
  for (const p of pathsToCheck) {
@@ -304,6 +307,7 @@ export default function (pi: ExtensionAPI) {
304
307
  for (const zap of rules.zeroAccessPaths) {
305
308
  if (isPathMatch(resolved, zap, ctx.cwd)) {
306
309
  matchedPattern = zap;
310
+ matchedCategory = "zero_access";
307
311
  return `Access to zero-access path restricted: ${zap}`;
308
312
  }
309
313
  }
@@ -323,6 +327,7 @@ export default function (pi: ExtensionAPI) {
323
327
  if (event.input.glob.includes(zap) || isPathMatch(event.input.glob, zap, ctx.cwd)) {
324
328
  violationReason = `Glob matches zero-access path: ${zap}`;
325
329
  matchedPattern = zap;
330
+ matchedCategory = "zero_access";
326
331
  break;
327
332
  }
328
333
  }
@@ -335,6 +340,7 @@ export default function (pi: ExtensionAPI) {
335
340
  if (event.input.pattern.includes(zap) || isPathMatch(event.input.pattern, zap, ctx.cwd)) {
336
341
  violationReason = `Find pattern matches zero-access path: ${zap}`;
337
342
  matchedPattern = zap;
343
+ matchedCategory = "zero_access";
338
344
  break;
339
345
  }
340
346
  }
@@ -362,6 +368,7 @@ export default function (pi: ExtensionAPI) {
362
368
  if (command.includes(zap)) {
363
369
  violationReason = `Bash command references zero-access path: ${zap}`;
364
370
  matchedPattern = zap;
371
+ matchedCategory = "zero_access";
365
372
  break;
366
373
  }
367
374
  }
@@ -372,6 +379,7 @@ export default function (pi: ExtensionAPI) {
372
379
  if (command.includes(rop) && (/[\s>|]/.test(command) || command.includes("rm") || command.includes("mv") || command.includes("sed"))) {
373
380
  violationReason = `Bash command may modify read-only path: ${rop}`;
374
381
  matchedPattern = rop;
382
+ matchedCategory = "read_only";
375
383
  break;
376
384
  }
377
385
  }
@@ -386,6 +394,7 @@ export default function (pi: ExtensionAPI) {
386
394
  if (matched) {
387
395
  violationReason = `Bash command attempts to delete/move protected path: ${ndp}`;
388
396
  matchedPattern = ndp;
397
+ matchedCategory = "no_delete";
389
398
  break;
390
399
  }
391
400
  }
@@ -398,6 +407,7 @@ export default function (pi: ExtensionAPI) {
398
407
  if (isPathMatch(resolved, rop, ctx.cwd)) {
399
408
  violationReason = `Modification of read-only path restricted: ${rop}`;
400
409
  matchedPattern = rop;
410
+ matchedCategory = "read_only";
401
411
  break;
402
412
  }
403
413
  }
@@ -429,9 +439,12 @@ export default function (pi: ExtensionAPI) {
429
439
  const ONCE = "Allow once";
430
440
  const TURN = "Allow for this turn";
431
441
  const SESSION = "Allow for this session";
442
+ const choices = matchedCategory === "no_delete"
443
+ ? [KEEP, ONCE]
444
+ : [KEEP, ONCE, TURN, SESSION];
432
445
  const choice = await ctx.ui.select(
433
446
  `🛡️ Blocked: ${event.toolName} — ${violationReason}`,
434
- [KEEP, ONCE, TURN, SESSION],
447
+ choices,
435
448
  { timeout: PROMPT_TIMEOUT_MS },
436
449
  );
437
450
  if (choice === ONCE) {
@@ -468,6 +481,7 @@ export default function (pi: ExtensionAPI) {
468
481
  tool: event.toolName,
469
482
  rule: violationReason,
470
483
  pattern: matchedPattern,
484
+ category: matchedCategory!,
471
485
  invocation: invocation.slice(0, 500),
472
486
  };
473
487
  const decision = await requestAccessFromHub(endpoint, req);
@@ -1,6 +1,7 @@
1
1
  {
2
- "name": "agent-fleet-pi-damage-control-continue",
3
- "private": true,
4
- "type": "module",
5
- "main": "index.ts"
2
+ "name": "agent-fleet-pi-damage-control-continue",
3
+ "private": true,
4
+ "type": "module",
5
+ "main": "index.ts",
6
+ "version": "0.0.4"
6
7
  }