@chankov/agent-fleet 0.0.3 → 0.0.5

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 (608) hide show
  1. package/.claude/commands/set-hermes-telegram.md +15 -0
  2. package/.claude/commands/setup-agent-fleet.md +1 -1
  3. package/.opencode/commands/af-set-hermes-telegram.md +15 -0
  4. package/.opencode/commands/af-setup-agent-fleet.md +1 -1
  5. package/.pi/agents/dispatch-policy.yaml +1 -1
  6. package/.pi/agents/peers.yaml +4 -4
  7. package/.pi/extensions/chrome-devtools-mcp/README.md +1 -1
  8. package/.pi/extensions/mcp-bridge/README.md +1 -1
  9. package/.pi/harnesses/agent-hub/README.md +223 -40
  10. package/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  11. package/.pi/harnesses/agent-hub/delegate.ts +32 -9
  12. package/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  13. package/.pi/harnesses/agent-hub/footer.ts +29 -0
  14. package/.pi/harnesses/agent-hub/helpers.ts +49 -0
  15. package/.pi/harnesses/agent-hub/index.ts +1037 -246
  16. package/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  17. package/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  18. package/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  19. package/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  20. package/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  21. package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  22. package/.pi/harnesses/agent-hub/package.json +5 -4
  23. package/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  24. package/.pi/harnesses/agent-hub/run-budget.js +155 -0
  25. package/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  26. package/.pi/harnesses/agent-hub/spawn.ts +161 -94
  27. package/.pi/harnesses/agent-hub/version.ts +18 -0
  28. package/.pi/harnesses/ask-user-remote/README.md +1 -0
  29. package/.pi/harnesses/ask-user-remote/index.ts +36 -8
  30. package/.pi/harnesses/coms/README.md +15 -5
  31. package/.pi/harnesses/coms/index.ts +2 -0
  32. package/.pi/harnesses/coms/package.json +5 -4
  33. package/.pi/harnesses/coms/version.ts +18 -0
  34. package/.pi/harnesses/damage-control-continue/README.md +36 -35
  35. package/.pi/harnesses/damage-control-continue/index.ts +23 -9
  36. package/.pi/harnesses/damage-control-continue/package.json +5 -4
  37. package/.pi/harnesses/damage-control-continue/version.ts +18 -0
  38. package/.pi/harnesses/{damage-control/shared.ts → lib/damage-control-shared.ts} +20 -6
  39. package/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  40. package/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
  41. package/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  42. package/.pi/harnesses/lib/hermes-monitor-socket.ts +118 -0
  43. package/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  44. package/.pi/prompts/set-hermes-telegram.md +15 -0
  45. package/.pi/prompts/setup-agent-fleet.md +1 -1
  46. package/.versions/0.0.4/.claude/commands/build.md +44 -0
  47. package/.versions/0.0.4/.claude/commands/code-simplify.md +22 -0
  48. package/.versions/0.0.4/.claude/commands/design-agent.md +14 -0
  49. package/.versions/0.0.4/.claude/commands/doctor-agent-fleet.md +17 -0
  50. package/.versions/0.0.4/.claude/commands/orchestrate.md +112 -0
  51. package/.versions/0.0.4/.claude/commands/plan.md +16 -0
  52. package/.versions/0.0.4/.claude/commands/prime.md +22 -0
  53. package/.versions/0.0.4/.claude/commands/review.md +16 -0
  54. package/.versions/0.0.4/.claude/commands/setup-agent-fleet.md +25 -0
  55. package/.versions/0.0.4/.claude/commands/ship.md +72 -0
  56. package/.versions/0.0.4/.claude/commands/spec.md +15 -0
  57. package/.versions/0.0.4/.claude/commands/test.md +19 -0
  58. package/.versions/0.0.4/.claude/commands/webperf.md +32 -0
  59. package/.versions/0.0.4/.claude/orchestrate-teams.yaml +24 -0
  60. package/.versions/0.0.4/.opencode/commands/af-build.md +17 -0
  61. package/.versions/0.0.4/.opencode/commands/af-code-simplify.md +16 -0
  62. package/.versions/0.0.4/.opencode/commands/af-compound.md +16 -0
  63. package/.versions/0.0.4/.opencode/commands/af-design-agent.md +15 -0
  64. package/.versions/0.0.4/.opencode/commands/af-doctor-agent-fleet.md +17 -0
  65. package/.versions/0.0.4/.opencode/commands/af-orchestrate.md +112 -0
  66. package/.versions/0.0.4/.opencode/commands/af-plan.md +16 -0
  67. package/.versions/0.0.4/.opencode/commands/af-prime.md +22 -0
  68. package/.versions/0.0.4/.opencode/commands/af-review.md +15 -0
  69. package/.versions/0.0.4/.opencode/commands/af-setup-agent-fleet.md +15 -0
  70. package/.versions/0.0.4/.opencode/commands/af-ship.md +16 -0
  71. package/.versions/0.0.4/.opencode/commands/af-spec.md +16 -0
  72. package/.versions/0.0.4/.opencode/commands/af-test.md +21 -0
  73. package/.versions/0.0.4/.opencode/commands/af-webperf.md +32 -0
  74. package/.versions/0.0.4/.opencode/orchestrate-teams.yaml +24 -0
  75. package/.versions/0.0.4/.pi/agents/dispatch-policy.yaml +32 -0
  76. package/.versions/0.0.4/.pi/agents/model-profiles.yaml +20 -0
  77. package/.versions/0.0.4/.pi/agents/peers.yaml +146 -0
  78. package/.versions/0.0.4/.pi/agents/teams.yaml +39 -0
  79. package/.versions/0.0.4/.pi/damage-control-rules.yaml +297 -0
  80. package/.versions/0.0.4/.pi/extensions/agent-fleet-update-check/README.md +58 -0
  81. package/.versions/0.0.4/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  82. package/{.pi/harnesses/damage-control → .versions/0.0.4/.pi/extensions/agent-fleet-update-check}/package.json +1 -1
  83. package/.versions/0.0.4/.pi/extensions/btw/README.md +118 -0
  84. package/.versions/0.0.4/.pi/extensions/btw/index.ts +917 -0
  85. package/.versions/0.0.4/.pi/extensions/btw/package.json +6 -0
  86. package/.versions/0.0.4/.pi/extensions/btw/state.js +179 -0
  87. package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
  88. package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
  89. package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  90. package/.versions/0.0.4/.pi/extensions/compact-and-continue/README.md +42 -0
  91. package/.versions/0.0.4/.pi/extensions/compact-and-continue/index.ts +120 -0
  92. package/.versions/0.0.4/.pi/extensions/compact-and-continue/package.json +6 -0
  93. package/.versions/0.0.4/.pi/extensions/mcp-bridge/README.md +46 -0
  94. package/.versions/0.0.4/.pi/extensions/mcp-bridge/index.ts +206 -0
  95. package/.versions/0.0.4/.pi/extensions/mcp-bridge/package.json +6 -0
  96. package/.versions/0.0.4/.pi/extensions/package-lock.json +1143 -0
  97. package/.versions/0.0.4/.pi/extensions/package.json +9 -0
  98. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/README.md +201 -0
  99. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/config.ts +198 -0
  100. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  101. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/index.ts +248 -0
  102. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/package.json +6 -0
  103. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  104. package/.versions/0.0.4/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  105. package/.versions/0.0.4/.pi/harnesses/agent-hub/README.md +798 -0
  106. package/.versions/0.0.4/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  107. package/.versions/0.0.4/.pi/harnesses/agent-hub/artifacts.js +92 -0
  108. package/.versions/0.0.4/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  109. package/.versions/0.0.4/.pi/harnesses/agent-hub/delegate.ts +386 -0
  110. package/.versions/0.0.4/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  111. package/.versions/0.0.4/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  112. package/.versions/0.0.4/.pi/harnesses/agent-hub/footer.ts +29 -0
  113. package/.versions/0.0.4/.pi/harnesses/agent-hub/helpers.ts +214 -0
  114. package/.versions/0.0.4/.pi/harnesses/agent-hub/index.ts +8045 -0
  115. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  116. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  117. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  118. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  119. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  120. package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  121. package/.versions/0.0.4/.pi/harnesses/agent-hub/package.json +7 -0
  122. package/.versions/0.0.4/.pi/harnesses/agent-hub/research-retention.js +34 -0
  123. package/.versions/0.0.4/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  124. package/.versions/0.0.4/.pi/harnesses/agent-hub/return-contract.js +215 -0
  125. package/.versions/0.0.4/.pi/harnesses/agent-hub/run-budget.js +155 -0
  126. package/.versions/0.0.4/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  127. package/.versions/0.0.4/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  128. package/.versions/0.0.4/.pi/harnesses/agent-hub/spawn.ts +246 -0
  129. package/.versions/0.0.4/.pi/harnesses/agent-hub/version.ts +18 -0
  130. package/.versions/0.0.4/.pi/harnesses/ask-user-remote/README.md +18 -0
  131. package/.versions/0.0.4/.pi/harnesses/ask-user-remote/index.ts +293 -0
  132. package/.versions/0.0.4/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  133. package/.versions/0.0.4/.pi/harnesses/coms/README.md +92 -0
  134. package/.versions/0.0.4/.pi/harnesses/coms/index.ts +1745 -0
  135. package/.versions/0.0.4/.pi/harnesses/coms/package.json +7 -0
  136. package/.versions/0.0.4/.pi/harnesses/coms/version.ts +18 -0
  137. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/README.md +117 -0
  138. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/index.ts +536 -0
  139. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/package.json +7 -0
  140. package/.versions/0.0.4/.pi/harnesses/damage-control-continue/version.ts +18 -0
  141. package/.versions/0.0.4/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  142. package/.versions/0.0.4/.pi/harnesses/lib/herdr-client.ts +458 -0
  143. package/.versions/0.0.4/.pi/harnesses/lib/herdr-presence.ts +288 -0
  144. package/.versions/0.0.4/.pi/harnesses/package-lock.json +35 -0
  145. package/.versions/0.0.4/.pi/harnesses/package.json +9 -0
  146. package/.versions/0.0.4/.pi/prompts/build.md +24 -0
  147. package/.versions/0.0.4/.pi/prompts/code-simplify.md +22 -0
  148. package/.versions/0.0.4/.pi/prompts/doctor-agent-fleet.md +15 -0
  149. package/.versions/0.0.4/.pi/prompts/plan.md +16 -0
  150. package/.versions/0.0.4/.pi/prompts/review.md +16 -0
  151. package/.versions/0.0.4/.pi/prompts/setup-agent-fleet.md +27 -0
  152. package/.versions/0.0.4/.pi/prompts/ship.md +17 -0
  153. package/.versions/0.0.4/.pi/prompts/spec.md +15 -0
  154. package/.versions/0.0.4/.pi/prompts/test.md +19 -0
  155. package/.versions/0.0.4/.pi/skills/bowser/SKILL.md +145 -0
  156. package/.versions/0.0.4/.version +1 -0
  157. package/.versions/0.0.4/agents/architect.md +23 -0
  158. package/.versions/0.0.4/agents/bowser.md +26 -0
  159. package/.versions/0.0.4/agents/builder.md +53 -0
  160. package/.versions/0.0.4/agents/code-reviewer.md +205 -0
  161. package/.versions/0.0.4/agents/deep-researcher.md +31 -0
  162. package/.versions/0.0.4/agents/documenter.md +18 -0
  163. package/.versions/0.0.4/agents/orchestrator.md +54 -0
  164. package/.versions/0.0.4/agents/plan-reviewer.md +60 -0
  165. package/.versions/0.0.4/agents/planner.md +69 -0
  166. package/.versions/0.0.4/agents/releaser.md +24 -0
  167. package/.versions/0.0.4/agents/researcher.md +28 -0
  168. package/.versions/0.0.4/agents/security-auditor.md +166 -0
  169. package/.versions/0.0.4/agents/test-engineer.md +151 -0
  170. package/.versions/0.0.4/agents/web-debugger.md +42 -0
  171. package/.versions/0.0.4/agents/web-performance-auditor.md +192 -0
  172. package/.versions/0.0.4/codex/CONDUCTOR.md +148 -0
  173. package/.versions/0.0.4/docs/ARCHITECTURE.md +210 -0
  174. package/.versions/0.0.4/docs/agent-fleet-setup.md +366 -0
  175. package/.versions/0.0.4/docs/claude-code-coms-bridge.md +103 -0
  176. package/.versions/0.0.4/docs/codex-remote-conductor.md +170 -0
  177. package/.versions/0.0.4/docs/coms-hermes-bridge.md +121 -0
  178. package/.versions/0.0.4/docs/getting-started.md +183 -0
  179. package/.versions/0.0.4/docs/npm-install.md +337 -0
  180. package/.versions/0.0.4/docs/opencode-setup.md +248 -0
  181. package/.versions/0.0.4/docs/pi-extensions.md +288 -0
  182. package/.versions/0.0.4/docs/pi-setup.md +463 -0
  183. package/.versions/0.0.4/docs/skill-anatomy.md +150 -0
  184. package/.versions/0.0.4/hermes/README.md +228 -0
  185. package/.versions/0.0.4/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  186. package/.versions/0.0.4/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  187. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +15 -0
  188. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +19 -0
  189. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +13 -0
  190. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +11 -0
  191. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +9 -0
  192. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +17 -0
  193. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +34 -0
  194. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +151 -0
  195. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +39 -0
  196. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  197. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +12 -0
  198. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  199. package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +22 -0
  200. package/.versions/0.0.4/hermes/skills/hub-conductor/SKILL.md +84 -0
  201. package/.versions/0.0.4/hermes/skills/hub-liaison/SKILL.md +84 -0
  202. package/.versions/0.0.4/hooks/SIMPLIFY-IGNORE.md +90 -0
  203. package/.versions/0.0.4/hooks/coms-stop-hook.mjs +73 -0
  204. package/.versions/0.0.4/hooks/hooks.json +14 -0
  205. package/.versions/0.0.4/hooks/session-start.sh +74 -0
  206. package/.versions/0.0.4/hooks/simplify-ignore.sh +302 -0
  207. package/.versions/0.0.4/justfile +256 -0
  208. package/.versions/0.0.4/references/accessibility-checklist.md +160 -0
  209. package/.versions/0.0.4/references/definition-of-done.md +67 -0
  210. package/.versions/0.0.4/references/fleet-coordination-patterns.md +151 -0
  211. package/.versions/0.0.4/references/observability-checklist.md +91 -0
  212. package/.versions/0.0.4/references/orchestration-patterns.md +370 -0
  213. package/.versions/0.0.4/references/performance-checklist.md +153 -0
  214. package/.versions/0.0.4/references/prompting-patterns.md +380 -0
  215. package/.versions/0.0.4/references/security-checklist.md +179 -0
  216. package/.versions/0.0.4/references/testing-patterns.md +236 -0
  217. package/.versions/0.0.4/scripts/codex-conductor.ts +41 -0
  218. package/.versions/0.0.4/scripts/codex-remote-control.ts +167 -0
  219. package/.versions/0.0.4/scripts/coms-claude-bridge.ts +286 -0
  220. package/.versions/0.0.4/scripts/coms-cli.ts +484 -0
  221. package/.versions/0.0.4/scripts/coms-hermes-bridge.ts +403 -0
  222. package/.versions/0.0.4/scripts/hermes-monitor-capability-runner.ts +25 -0
  223. package/.versions/0.0.4/scripts/hermes-monitor-scenario.ts +7 -0
  224. package/.versions/0.0.4/scripts/lib/claude-bridge-core.ts +100 -0
  225. package/.versions/0.0.4/scripts/lib/codex-conductor.ts +88 -0
  226. package/.versions/0.0.4/scripts/lib/codex-remote-control.ts +480 -0
  227. package/.versions/0.0.4/scripts/lib/coms-envelope.ts +539 -0
  228. package/.versions/0.0.4/scripts/lib/fake-herdr-server.ts +88 -0
  229. package/.versions/0.0.4/scripts/lib/herdr-layout.ts +263 -0
  230. package/.versions/0.0.4/scripts/lib/hermes-bridge-core.ts +238 -0
  231. package/.versions/0.0.4/scripts/lib/hermes-monitor-herdr.ts +28 -0
  232. package/.versions/0.0.4/scripts/lib/hermes-monitor-model.ts +9 -0
  233. package/.versions/0.0.4/scripts/lib/hermes-monitor-registry.ts +6 -0
  234. package/.versions/0.0.4/scripts/lib/hermes-monitor-socket.ts +118 -0
  235. package/.versions/0.0.4/scripts/lib/hermes-monitor-store.ts +31 -0
  236. package/.versions/0.0.4/scripts/lib/persona-banner.ts +62 -0
  237. package/.versions/0.0.4/scripts/lib/spawn-stagger.ts +101 -0
  238. package/.versions/0.0.4/scripts/lib/team-project.ts +184 -0
  239. package/.versions/0.0.4/scripts/lib/team-snapshot.ts +147 -0
  240. package/.versions/0.0.4/scripts/peer-banner.ts +40 -0
  241. package/.versions/0.0.4/scripts/team-snapshot.ts +238 -0
  242. package/.versions/0.0.4/scripts/team-up.ts +333 -0
  243. package/.versions/0.0.4/skills/_internal/grilling.md +11 -0
  244. package/.versions/0.0.4/skills/browser-testing-with-devtools/SKILL.md +352 -0
  245. package/.versions/0.0.4/skills/code-review-and-quality/SKILL.md +381 -0
  246. package/.versions/0.0.4/skills/compound-learning/SKILL.md +137 -0
  247. package/.versions/0.0.4/skills/context-engineering/SKILL.md +291 -0
  248. package/.versions/0.0.4/skills/deprecation-and-migration/SKILL.md +206 -0
  249. package/.versions/0.0.4/skills/designing-agents/SKILL.md +394 -0
  250. package/.versions/0.0.4/skills/designing-agents/pi-harness-authoring.md +222 -0
  251. package/.versions/0.0.4/skills/frontend-ui-engineering/SKILL.md +328 -0
  252. package/.versions/0.0.4/skills/git-workflow-and-versioning/SKILL.md +316 -0
  253. package/.versions/0.0.4/skills/guided-workspace-setup/SKILL.md +535 -0
  254. package/.versions/0.0.4/skills/guided-workspace-setup/companion-manifest.json +33 -0
  255. package/.versions/0.0.4/skills/idea-refine/SKILL.md +182 -0
  256. package/.versions/0.0.4/skills/idea-refine/examples.md +238 -0
  257. package/.versions/0.0.4/skills/idea-refine/frameworks.md +99 -0
  258. package/.versions/0.0.4/skills/idea-refine/refinement-criteria.md +113 -0
  259. package/.versions/0.0.4/skills/idea-refine/scripts/idea-refine.sh +15 -0
  260. package/.versions/0.0.4/skills/incremental-implementation/SKILL.md +287 -0
  261. package/.versions/0.0.4/skills/interview-me/SKILL.md +226 -0
  262. package/.versions/0.0.4/skills/orchestration-verification/SKILL.md +181 -0
  263. package/.versions/0.0.4/skills/peer-coms/SKILL.md +90 -0
  264. package/.versions/0.0.4/skills/performance-optimization/SKILL.md +350 -0
  265. package/.versions/0.0.4/skills/planning-and-task-breakdown/SKILL.md +236 -0
  266. package/.versions/0.0.4/skills/security-and-hardening/SKILL.md +461 -0
  267. package/.versions/0.0.4/skills/spec-driven-development/SKILL.md +245 -0
  268. package/.versions/0.0.4/skills/using-agent-skills/SKILL.md +199 -0
  269. package/.versions/0.0.4/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  270. package/.versions/0.0.4/vendor/agent-skills-upstream/LICENSE +21 -0
  271. package/.versions/0.0.4/vendor/agent-skills-upstream/README.md +11 -0
  272. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  273. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  274. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  275. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  276. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  277. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  278. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  279. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  280. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  281. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  282. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  283. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  284. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  285. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  286. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  287. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  288. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  289. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  290. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  291. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  292. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  293. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  294. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  295. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  296. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  297. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  298. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  299. package/.versions/0.0.4/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  300. package/.versions/0.0.5/.claude/commands/build.md +44 -0
  301. package/.versions/0.0.5/.claude/commands/code-simplify.md +22 -0
  302. package/.versions/0.0.5/.claude/commands/design-agent.md +14 -0
  303. package/.versions/0.0.5/.claude/commands/doctor-agent-fleet.md +17 -0
  304. package/.versions/0.0.5/.claude/commands/orchestrate.md +112 -0
  305. package/.versions/0.0.5/.claude/commands/plan.md +16 -0
  306. package/.versions/0.0.5/.claude/commands/prime.md +22 -0
  307. package/.versions/0.0.5/.claude/commands/review.md +16 -0
  308. package/.versions/0.0.5/.claude/commands/set-hermes-telegram.md +15 -0
  309. package/.versions/0.0.5/.claude/commands/setup-agent-fleet.md +25 -0
  310. package/.versions/0.0.5/.claude/commands/ship.md +72 -0
  311. package/.versions/0.0.5/.claude/commands/spec.md +15 -0
  312. package/.versions/0.0.5/.claude/commands/test.md +19 -0
  313. package/.versions/0.0.5/.claude/commands/webperf.md +32 -0
  314. package/.versions/0.0.5/.claude/orchestrate-teams.yaml +24 -0
  315. package/.versions/0.0.5/.opencode/commands/af-build.md +17 -0
  316. package/.versions/0.0.5/.opencode/commands/af-code-simplify.md +16 -0
  317. package/.versions/0.0.5/.opencode/commands/af-compound.md +16 -0
  318. package/.versions/0.0.5/.opencode/commands/af-design-agent.md +15 -0
  319. package/.versions/0.0.5/.opencode/commands/af-doctor-agent-fleet.md +17 -0
  320. package/.versions/0.0.5/.opencode/commands/af-orchestrate.md +112 -0
  321. package/.versions/0.0.5/.opencode/commands/af-plan.md +16 -0
  322. package/.versions/0.0.5/.opencode/commands/af-prime.md +22 -0
  323. package/.versions/0.0.5/.opencode/commands/af-review.md +15 -0
  324. package/.versions/0.0.5/.opencode/commands/af-set-hermes-telegram.md +15 -0
  325. package/.versions/0.0.5/.opencode/commands/af-setup-agent-fleet.md +15 -0
  326. package/.versions/0.0.5/.opencode/commands/af-ship.md +16 -0
  327. package/.versions/0.0.5/.opencode/commands/af-spec.md +16 -0
  328. package/.versions/0.0.5/.opencode/commands/af-test.md +21 -0
  329. package/.versions/0.0.5/.opencode/commands/af-webperf.md +32 -0
  330. package/.versions/0.0.5/.opencode/orchestrate-teams.yaml +24 -0
  331. package/.versions/0.0.5/.pi/agents/dispatch-policy.yaml +32 -0
  332. package/.versions/0.0.5/.pi/agents/model-profiles.yaml +20 -0
  333. package/.versions/0.0.5/.pi/agents/peers.yaml +146 -0
  334. package/.versions/0.0.5/.pi/agents/teams.yaml +39 -0
  335. package/.versions/0.0.5/.pi/damage-control-rules.yaml +297 -0
  336. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/README.md +58 -0
  337. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  338. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  339. package/.versions/0.0.5/.pi/extensions/btw/README.md +118 -0
  340. package/.versions/0.0.5/.pi/extensions/btw/index.ts +917 -0
  341. package/.versions/0.0.5/.pi/extensions/btw/package.json +6 -0
  342. package/.versions/0.0.5/.pi/extensions/btw/state.js +179 -0
  343. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
  344. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
  345. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  346. package/.versions/0.0.5/.pi/extensions/compact-and-continue/README.md +42 -0
  347. package/.versions/0.0.5/.pi/extensions/compact-and-continue/index.ts +120 -0
  348. package/.versions/0.0.5/.pi/extensions/compact-and-continue/package.json +6 -0
  349. package/.versions/0.0.5/.pi/extensions/mcp-bridge/README.md +46 -0
  350. package/.versions/0.0.5/.pi/extensions/mcp-bridge/index.ts +206 -0
  351. package/.versions/0.0.5/.pi/extensions/mcp-bridge/package.json +6 -0
  352. package/.versions/0.0.5/.pi/extensions/package-lock.json +1143 -0
  353. package/.versions/0.0.5/.pi/extensions/package.json +9 -0
  354. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/README.md +201 -0
  355. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/config.ts +198 -0
  356. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  357. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/index.ts +248 -0
  358. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/package.json +6 -0
  359. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  360. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  361. package/.versions/0.0.5/.pi/harnesses/agent-hub/README.md +798 -0
  362. package/.versions/0.0.5/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  363. package/.versions/0.0.5/.pi/harnesses/agent-hub/artifacts.js +92 -0
  364. package/.versions/0.0.5/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  365. package/.versions/0.0.5/.pi/harnesses/agent-hub/delegate.ts +386 -0
  366. package/.versions/0.0.5/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  367. package/.versions/0.0.5/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  368. package/.versions/0.0.5/.pi/harnesses/agent-hub/footer.ts +29 -0
  369. package/.versions/0.0.5/.pi/harnesses/agent-hub/helpers.ts +214 -0
  370. package/.versions/0.0.5/.pi/harnesses/agent-hub/index.ts +8045 -0
  371. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  372. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  373. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  374. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  375. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  376. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  377. package/.versions/0.0.5/.pi/harnesses/agent-hub/package.json +7 -0
  378. package/.versions/0.0.5/.pi/harnesses/agent-hub/research-retention.js +34 -0
  379. package/.versions/0.0.5/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  380. package/.versions/0.0.5/.pi/harnesses/agent-hub/return-contract.js +215 -0
  381. package/.versions/0.0.5/.pi/harnesses/agent-hub/run-budget.js +155 -0
  382. package/.versions/0.0.5/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  383. package/.versions/0.0.5/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  384. package/.versions/0.0.5/.pi/harnesses/agent-hub/spawn.ts +246 -0
  385. package/.versions/0.0.5/.pi/harnesses/agent-hub/version.ts +18 -0
  386. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/README.md +19 -0
  387. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/index.ts +321 -0
  388. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  389. package/.versions/0.0.5/.pi/harnesses/coms/README.md +92 -0
  390. package/.versions/0.0.5/.pi/harnesses/coms/index.ts +1745 -0
  391. package/.versions/0.0.5/.pi/harnesses/coms/package.json +7 -0
  392. package/.versions/0.0.5/.pi/harnesses/coms/version.ts +18 -0
  393. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/README.md +117 -0
  394. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/index.ts +536 -0
  395. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/package.json +7 -0
  396. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/version.ts +18 -0
  397. package/.versions/0.0.5/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  398. package/.versions/0.0.5/.pi/harnesses/lib/herdr-client.ts +458 -0
  399. package/.versions/0.0.5/.pi/harnesses/lib/herdr-presence.ts +288 -0
  400. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  401. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
  402. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  403. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-socket.ts +118 -0
  404. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  405. package/.versions/0.0.5/.pi/harnesses/package-lock.json +35 -0
  406. package/.versions/0.0.5/.pi/harnesses/package.json +9 -0
  407. package/.versions/0.0.5/.pi/prompts/build.md +24 -0
  408. package/.versions/0.0.5/.pi/prompts/code-simplify.md +22 -0
  409. package/.versions/0.0.5/.pi/prompts/doctor-agent-fleet.md +15 -0
  410. package/.versions/0.0.5/.pi/prompts/plan.md +16 -0
  411. package/.versions/0.0.5/.pi/prompts/review.md +16 -0
  412. package/.versions/0.0.5/.pi/prompts/set-hermes-telegram.md +15 -0
  413. package/.versions/0.0.5/.pi/prompts/setup-agent-fleet.md +27 -0
  414. package/.versions/0.0.5/.pi/prompts/ship.md +17 -0
  415. package/.versions/0.0.5/.pi/prompts/spec.md +15 -0
  416. package/.versions/0.0.5/.pi/prompts/test.md +19 -0
  417. package/.versions/0.0.5/.pi/skills/bowser/SKILL.md +145 -0
  418. package/.versions/0.0.5/.version +1 -0
  419. package/.versions/0.0.5/agents/architect.md +23 -0
  420. package/.versions/0.0.5/agents/bowser.md +26 -0
  421. package/.versions/0.0.5/agents/builder.md +53 -0
  422. package/.versions/0.0.5/agents/code-reviewer.md +205 -0
  423. package/.versions/0.0.5/agents/deep-researcher.md +31 -0
  424. package/.versions/0.0.5/agents/documenter.md +18 -0
  425. package/.versions/0.0.5/agents/orchestrator.md +54 -0
  426. package/.versions/0.0.5/agents/plan-reviewer.md +60 -0
  427. package/.versions/0.0.5/agents/planner.md +69 -0
  428. package/.versions/0.0.5/agents/releaser.md +24 -0
  429. package/.versions/0.0.5/agents/researcher.md +28 -0
  430. package/.versions/0.0.5/agents/security-auditor.md +166 -0
  431. package/.versions/0.0.5/agents/test-engineer.md +151 -0
  432. package/.versions/0.0.5/agents/web-debugger.md +42 -0
  433. package/.versions/0.0.5/agents/web-performance-auditor.md +192 -0
  434. package/.versions/0.0.5/codex/CONDUCTOR.md +148 -0
  435. package/.versions/0.0.5/docs/ARCHITECTURE.md +210 -0
  436. package/.versions/0.0.5/docs/agent-fleet-setup.md +366 -0
  437. package/.versions/0.0.5/docs/claude-code-coms-bridge.md +103 -0
  438. package/.versions/0.0.5/docs/codex-remote-conductor.md +170 -0
  439. package/.versions/0.0.5/docs/coms-hermes-bridge.md +179 -0
  440. package/.versions/0.0.5/docs/getting-started.md +183 -0
  441. package/.versions/0.0.5/docs/npm-install.md +337 -0
  442. package/.versions/0.0.5/docs/opencode-setup.md +249 -0
  443. package/.versions/0.0.5/docs/pi-extensions.md +293 -0
  444. package/.versions/0.0.5/docs/pi-setup.md +472 -0
  445. package/.versions/0.0.5/docs/skill-anatomy.md +150 -0
  446. package/.versions/0.0.5/hermes/README.md +231 -0
  447. package/.versions/0.0.5/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  448. package/.versions/0.0.5/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  449. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +15 -0
  450. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +19 -0
  451. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +13 -0
  452. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +11 -0
  453. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +9 -0
  454. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +17 -0
  455. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +34 -0
  456. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +151 -0
  457. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +39 -0
  458. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  459. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +12 -0
  460. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  461. package/.versions/0.0.5/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +22 -0
  462. package/.versions/0.0.5/hermes/skills/hub-conductor/SKILL.md +84 -0
  463. package/.versions/0.0.5/hermes/skills/hub-liaison/SKILL.md +84 -0
  464. package/.versions/0.0.5/hooks/SIMPLIFY-IGNORE.md +90 -0
  465. package/.versions/0.0.5/hooks/coms-stop-hook.mjs +73 -0
  466. package/.versions/0.0.5/hooks/hooks.json +14 -0
  467. package/.versions/0.0.5/hooks/session-start.sh +74 -0
  468. package/.versions/0.0.5/hooks/simplify-ignore.sh +302 -0
  469. package/.versions/0.0.5/justfile +245 -0
  470. package/.versions/0.0.5/references/accessibility-checklist.md +160 -0
  471. package/.versions/0.0.5/references/definition-of-done.md +67 -0
  472. package/.versions/0.0.5/references/fleet-coordination-patterns.md +151 -0
  473. package/.versions/0.0.5/references/observability-checklist.md +91 -0
  474. package/.versions/0.0.5/references/orchestration-patterns.md +370 -0
  475. package/.versions/0.0.5/references/performance-checklist.md +153 -0
  476. package/.versions/0.0.5/references/prompting-patterns.md +380 -0
  477. package/.versions/0.0.5/references/security-checklist.md +179 -0
  478. package/.versions/0.0.5/references/testing-patterns.md +236 -0
  479. package/.versions/0.0.5/scripts/codex-conductor.ts +41 -0
  480. package/.versions/0.0.5/scripts/codex-remote-control.ts +167 -0
  481. package/.versions/0.0.5/scripts/coms-claude-bridge.ts +286 -0
  482. package/.versions/0.0.5/scripts/coms-cli.ts +484 -0
  483. package/.versions/0.0.5/scripts/coms-hermes-bridge.ts +413 -0
  484. package/.versions/0.0.5/scripts/fleet.ts +141 -0
  485. package/.versions/0.0.5/scripts/hermes-monitor-capability-runner.ts +25 -0
  486. package/.versions/0.0.5/scripts/hermes-monitor-scenario.ts +7 -0
  487. package/.versions/0.0.5/scripts/lib/claude-bridge-core.ts +100 -0
  488. package/.versions/0.0.5/scripts/lib/codex-conductor.ts +88 -0
  489. package/.versions/0.0.5/scripts/lib/codex-remote-control.ts +480 -0
  490. package/.versions/0.0.5/scripts/lib/coms-envelope.ts +539 -0
  491. package/.versions/0.0.5/scripts/lib/fake-herdr-server.ts +88 -0
  492. package/.versions/0.0.5/scripts/lib/fleet-command.ts +109 -0
  493. package/.versions/0.0.5/scripts/lib/herdr-layout.ts +263 -0
  494. package/.versions/0.0.5/scripts/lib/hermes-bridge-core.ts +241 -0
  495. package/.versions/0.0.5/scripts/lib/hermes-monitor-herdr.ts +2 -0
  496. package/.versions/0.0.5/scripts/lib/hermes-monitor-model.ts +3 -0
  497. package/.versions/0.0.5/scripts/lib/hermes-monitor-registry.ts +2 -0
  498. package/.versions/0.0.5/scripts/lib/hermes-monitor-socket.ts +2 -0
  499. package/.versions/0.0.5/scripts/lib/hermes-monitor-store.ts +2 -0
  500. package/.versions/0.0.5/scripts/lib/persona-banner.ts +62 -0
  501. package/.versions/0.0.5/scripts/lib/spawn-stagger.ts +101 -0
  502. package/.versions/0.0.5/scripts/lib/team-project.ts +191 -0
  503. package/.versions/0.0.5/scripts/lib/team-snapshot.ts +147 -0
  504. package/.versions/0.0.5/scripts/peer-banner.ts +40 -0
  505. package/.versions/0.0.5/scripts/team-snapshot.ts +237 -0
  506. package/.versions/0.0.5/scripts/team-up.ts +351 -0
  507. package/.versions/0.0.5/skills/_internal/grilling.md +11 -0
  508. package/.versions/0.0.5/skills/browser-testing-with-devtools/SKILL.md +352 -0
  509. package/.versions/0.0.5/skills/code-review-and-quality/SKILL.md +381 -0
  510. package/.versions/0.0.5/skills/compound-learning/SKILL.md +137 -0
  511. package/.versions/0.0.5/skills/context-engineering/SKILL.md +291 -0
  512. package/.versions/0.0.5/skills/deprecation-and-migration/SKILL.md +206 -0
  513. package/.versions/0.0.5/skills/designing-agents/SKILL.md +394 -0
  514. package/.versions/0.0.5/skills/designing-agents/pi-harness-authoring.md +222 -0
  515. package/.versions/0.0.5/skills/frontend-ui-engineering/SKILL.md +328 -0
  516. package/.versions/0.0.5/skills/git-workflow-and-versioning/SKILL.md +316 -0
  517. package/.versions/0.0.5/skills/guided-workspace-setup/SKILL.md +542 -0
  518. package/.versions/0.0.5/skills/guided-workspace-setup/companion-manifest.json +35 -0
  519. package/.versions/0.0.5/skills/idea-refine/SKILL.md +182 -0
  520. package/.versions/0.0.5/skills/idea-refine/examples.md +238 -0
  521. package/.versions/0.0.5/skills/idea-refine/frameworks.md +99 -0
  522. package/.versions/0.0.5/skills/idea-refine/refinement-criteria.md +113 -0
  523. package/.versions/0.0.5/skills/idea-refine/scripts/idea-refine.sh +15 -0
  524. package/.versions/0.0.5/skills/incremental-implementation/SKILL.md +287 -0
  525. package/.versions/0.0.5/skills/interview-me/SKILL.md +226 -0
  526. package/.versions/0.0.5/skills/orchestration-verification/SKILL.md +181 -0
  527. package/.versions/0.0.5/skills/peer-coms/SKILL.md +90 -0
  528. package/.versions/0.0.5/skills/performance-optimization/SKILL.md +350 -0
  529. package/.versions/0.0.5/skills/planning-and-task-breakdown/SKILL.md +236 -0
  530. package/.versions/0.0.5/skills/security-and-hardening/SKILL.md +461 -0
  531. package/.versions/0.0.5/skills/spec-driven-development/SKILL.md +245 -0
  532. package/.versions/0.0.5/skills/using-agent-skills/SKILL.md +199 -0
  533. package/.versions/0.0.5/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  534. package/.versions/0.0.5/vendor/agent-skills-upstream/LICENSE +21 -0
  535. package/.versions/0.0.5/vendor/agent-skills-upstream/README.md +11 -0
  536. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  537. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  538. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  539. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  540. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  541. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  542. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  543. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  544. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  545. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  546. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  547. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  548. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  549. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  550. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  551. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  552. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  553. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  554. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  555. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  556. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  557. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  558. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  559. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  560. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  561. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  562. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  563. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  564. package/CHANGELOG.md +62 -0
  565. package/README.md +17 -16
  566. package/agents/builder.md +1 -1
  567. package/agents/code-reviewer.md +1 -1
  568. package/agents/deep-researcher.md +3 -3
  569. package/agents/orchestrator.md +20 -11
  570. package/agents/plan-reviewer.md +3 -3
  571. package/agents/test-engineer.md +11 -4
  572. package/bin/cli.js +83 -1
  573. package/bin/lib/set-hermes-telegram.js +323 -0
  574. package/bin/lib/validate-overrides.js +19 -0
  575. package/bin/sync-harness-versions.js +94 -0
  576. package/docs/ARCHITECTURE.md +49 -4
  577. package/docs/agent-fleet-setup.md +11 -1
  578. package/docs/claude-code-coms-bridge.md +4 -4
  579. package/docs/codex-remote-conductor.md +12 -12
  580. package/docs/coms-hermes-bridge.md +62 -4
  581. package/docs/getting-started.md +4 -4
  582. package/docs/opencode-setup.md +1 -0
  583. package/docs/pi-extensions.md +73 -33
  584. package/docs/pi-setup.md +23 -8
  585. package/hermes/README.md +191 -8
  586. package/justfile +143 -158
  587. package/package.json +13 -5
  588. package/references/fleet-coordination-patterns.md +1 -1
  589. package/scripts/coms-hermes-bridge.ts +18 -8
  590. package/scripts/fleet.ts +141 -0
  591. package/scripts/lib/fake-herdr-server.ts +88 -0
  592. package/scripts/lib/fleet-command.ts +109 -0
  593. package/scripts/lib/hermes-bridge-core.ts +5 -2
  594. package/scripts/lib/hermes-monitor-herdr.ts +2 -0
  595. package/scripts/lib/hermes-monitor-model.ts +3 -0
  596. package/scripts/lib/hermes-monitor-registry.ts +2 -0
  597. package/scripts/lib/hermes-monitor-socket.ts +2 -0
  598. package/scripts/lib/hermes-monitor-store.ts +2 -0
  599. package/scripts/lib/team-project.ts +10 -3
  600. package/scripts/team-snapshot.ts +4 -5
  601. package/scripts/team-up.ts +24 -6
  602. package/skills/designing-agents/SKILL.md +2 -2
  603. package/skills/designing-agents/pi-harness-authoring.md +26 -13
  604. package/skills/guided-workspace-setup/SKILL.md +22 -12
  605. package/skills/guided-workspace-setup/companion-manifest.json +3 -1
  606. package/skills/peer-coms/SKILL.md +1 -1
  607. package/.pi/harnesses/damage-control/README.md +0 -65
  608. package/.pi/harnesses/damage-control/index.ts +0 -250
@@ -0,0 +1,386 @@
1
+ /**
2
+ * delegate — the injected extension that gives an agent-hub specialist a
3
+ * mid-turn `delegate(role, instruction, context?, allow_write?)` tool.
4
+ *
5
+ * The hub adds `-e delegate.ts` (plus `delegate` in the child's `--tools`
6
+ * allowlist — pi's allowlist applies to extension tools too) when a dispatched
7
+ * persona declares `subagents:` in its frontmatter. Everything this extension
8
+ * may spawn comes from AGENT_HUB_DELEGATE_CONFIG (JSON, serialized by the
9
+ * hub): the declared sub-roles and their models, the remaining depth budget,
10
+ * the tree-wide remaining spawn budget, and the event directory. The child
11
+ * process NEVER re-parses persona files — model choice is configuration, not
12
+ * the LLM's whim.
13
+ *
14
+ * Budgets (readable refusals, never silent):
15
+ * - tree-wide spawn budget: at most 4 delegate children per dispatch
16
+ * - depth budget: each child receives `depth − 1`; the hub normally omits
17
+ * delegate tooling from children at remaining depth 0, so a persona with
18
+ * `delegate_depth: 1` (the default and max) can spawn terminal children
19
+ *
20
+ * Write safety: a child is read-only (read,grep,find,ls) unless it is the ONLY
21
+ * live child and the parent passed `allow_write: true` — then it inherits the
22
+ * parent's tools, intersected with the role's declared `tools:` cap when one
23
+ * exists. Concurrent children are always forced read-only (two agents editing
24
+ * the same files is not solvable with guardrails).
25
+ *
26
+ * Observability: every spawn/timeline/usage/exit is appended as JSONL to
27
+ * `<eventDir>/events.jsonl`. The hub watches that file and renders children as
28
+ * nested rows under the parent's grid card (openable via /zoom). Kill cascade:
29
+ * children are spawned in THIS process's group (the hub spawns specialists
30
+ * detached), so `/agents-kill` on the parent SIGTERMs the whole tree; a
31
+ * SIGTERM trap forwards to live children as a fallback.
32
+ */
33
+
34
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
35
+ import { Type } from "@sinclair/typebox";
36
+ import { appendFileSync, mkdirSync, writeFileSync } from "fs";
37
+ import type { ChildProcess } from "child_process";
38
+ import { spawnPiAgent, killPiTree } from "./spawn.ts";
39
+ import {
40
+ delegateBudgetRefusal,
41
+ DELEGATE_TREE_SPAWN_BUDGET,
42
+ normalizeDelegateRuntimeBudgets,
43
+ planDelegateSpawn,
44
+ resolveDelegateTools,
45
+ safeAgentKey,
46
+ safePathWithin,
47
+ } from "./helpers.ts";
48
+
49
+ const DEFAULT_CALL_BUDGET = DELEGATE_TREE_SPAWN_BUDGET;
50
+ const RESULT_CAP = 2000;
51
+ const DIGEST_MAX_LINES = 30;
52
+ // How often buffered text/thinking deltas are flushed into the event file.
53
+ const TIMELINE_FLUSH_MS = 700;
54
+
55
+ // Serialized by the hub into AGENT_HUB_DELEGATE_CONFIG. `tag` is this
56
+ // process's node id in the delegation tree ("root" for the specialist itself);
57
+ // nested delegate.ts instances get their child id as tag, so every event line
58
+ // carries an unambiguous parent chain.
59
+ export interface DelegateConfig {
60
+ persona: string;
61
+ tag: string;
62
+ roles: Record<string, { model: string; tools?: string }>;
63
+ depth: number;
64
+ callBudget: number;
65
+ remainingSpawns?: number;
66
+ parentTools: string;
67
+ personaPrompt: string;
68
+ eventDir: string;
69
+ damageControl?: string;
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;
75
+ cwd: string;
76
+ }
77
+
78
+ // Appended to every child's system prompt so it knows its place in the tree
79
+ // and reports tersely (its full report returns through the tool result, which
80
+ // lands in the parent's context).
81
+ function subagentProtocol(persona: string, role: string, canDelegate: boolean): string {
82
+ return `
83
+
84
+ ## You are the "${role}" sub-agent of a ${persona} specialist
85
+ Your parent delegated ONE specific task to you. Do exactly that task — do not
86
+ widen scope, do not start unrelated work. Your full output is written to a result
87
+ file, but your parent receives only a compact digest. End your final message with
88
+ a \`DIGEST:\` section of no more than 30 lines, self-contained, with path:line
89
+ citations where relevant. Put the most important findings and next actions there.${canDelegate ? `
90
+ You may delegate narrow sub-tasks further via your own delegate tool, within
91
+ its declared roles and remaining tree budget.` : `
92
+ You CANNOT delegate further — your remaining depth is 0, so this child has no
93
+ delegate tooling. Do the work yourself with the tools you have.`}`;
94
+ }
95
+
96
+ function childResultDigest(output: string, resultPath: string): { text: string; hasDigest: boolean } {
97
+ const lines = String(output || "").split(/\r?\n/);
98
+ const marker = lines.map(l => l.trim()).findIndex(l => /^DIGEST:\s*$/i.test(l));
99
+ if (marker >= 0) {
100
+ const digestLines = lines.slice(marker, marker + DIGEST_MAX_LINES);
101
+ return {
102
+ text: capInline(`${digestLines.join("\n")}\n\nFull output: ${resultPath}\nRead the result file only if this digest is insufficient.`),
103
+ hasDigest: true,
104
+ };
105
+ }
106
+ const fallback = lines.slice(0, DIGEST_MAX_LINES).join("\n");
107
+ return {
108
+ text: capInline(`${fallback}\n\n[no DIGEST section — full output at ${resultPath}]`),
109
+ hasDigest: false,
110
+ };
111
+ }
112
+
113
+ function capInline(text: string): string {
114
+ return text.length > RESULT_CAP ? text.slice(0, RESULT_CAP) + "\n... [digest truncated]" : text;
115
+ }
116
+
117
+ export default function (pi: ExtensionAPI) {
118
+ let cfg: DelegateConfig | null = null;
119
+ try {
120
+ cfg = JSON.parse(process.env.AGENT_HUB_DELEGATE_CONFIG || "");
121
+ } catch {
122
+ cfg = null;
123
+ }
124
+ // Misconfigured (or launched outside the hub): register nothing — the
125
+ // parent simply has no delegate tool.
126
+ if (!cfg || !cfg.roles || !cfg.eventDir) return;
127
+ const config = cfg;
128
+ const budgets = normalizeDelegateRuntimeBudgets(config, DEFAULT_CALL_BUDGET);
129
+ config.depth = budgets.depth;
130
+ config.callBudget = budgets.callBudget;
131
+ config.remainingSpawns = budgets.remainingSpawns;
132
+
133
+ let callCount = 0;
134
+ let childSeq = 0;
135
+ // Synchronous reservation counter for the write-safety gate. Incremented at
136
+ // the gate (before any await), so two parallel delegate calls can never both
137
+ // observe "I am the only child" — do NOT replace this with liveChildren.size,
138
+ // which only grows once the child process actually spawns.
139
+ let liveCount = 0;
140
+ const liveChildren = new Set<ChildProcess>();
141
+
142
+ // Fallback cascade: the primary kill path is the process group (the hub
143
+ // signals the specialist's negative PID), but if only this process is
144
+ // terminated, forward the signal to any live children.
145
+ process.on("SIGTERM", () => {
146
+ for (const child of liveChildren) killPiTree(child, "SIGTERM");
147
+ });
148
+
149
+ const emit = (event: Record<string, unknown>) => {
150
+ try {
151
+ appendFileSync(safePathWithin(config.eventDir, "events.jsonl"), JSON.stringify(event) + "\n", "utf-8");
152
+ } catch {}
153
+ };
154
+
155
+ const roleNames = Object.keys(config.roles).filter((name) => {
156
+ try { safeAgentKey(name); return true; } catch { return false; }
157
+ });
158
+ if (roleNames.length === 0) return;
159
+
160
+ pi.registerTool({
161
+ name: "delegate",
162
+ label: "Delegate",
163
+ description:
164
+ `Spawn one of your declared sub-agents on its pre-configured model and wait for its report. ` +
165
+ `Declared roles: ${roleNames.join(", ")}. Use it to fan out scoped sub-tasks (reviews, scans, ` +
166
+ `doc checks) instead of doing everything yourself; at most ${DELEGATE_TREE_SPAWN_BUDGET} ` +
167
+ `children may be spawned per dispatch, and parallel children are forced read-only. The child ` +
168
+ `does not share your context — pass everything it needs in \`instruction\`/\`context\`.`,
169
+ parameters: Type.Object({
170
+ role: Type.String({ description: `Declared sub-role to spawn. One of: ${roleNames.join(", ")}` }),
171
+ instruction: Type.String({ description: "The specific, self-contained task for the sub-agent." }),
172
+ context: Type.Optional(Type.String({
173
+ description: "Optional background brief pasted above the instruction (the child shares none of " +
174
+ "your context). The keyword 'fork' (full context fork) is accepted but treated as a summary " +
175
+ "brief in v1 — write the brief out.",
176
+ })),
177
+ allow_write: Type.Optional(Type.Boolean({
178
+ description: "Let the child inherit your tools (including write access). Honored only while it " +
179
+ "is your ONLY live child; concurrent children are always read-only. A role-level tools cap " +
180
+ "still wins and refuses delegation if it leaves no tools.",
181
+ })),
182
+ }),
183
+
184
+ async execute(_toolCallId, params, _signal, onUpdate) {
185
+ const { role, instruction, context, allow_write } = params as {
186
+ role: string; instruction: string; context?: string; allow_write?: boolean;
187
+ };
188
+
189
+ // Readable refusals — budget exhaustion is an answer, not a mystery.
190
+ const budgetRefusal = delegateBudgetRefusal({
191
+ depth: config.depth,
192
+ callBudget: config.callBudget,
193
+ remainingSpawns: config.remainingSpawns ?? 0,
194
+ callCount,
195
+ });
196
+ if (budgetRefusal) {
197
+ return { content: [{ type: "text" as const, text: budgetRefusal }] };
198
+ }
199
+ const roleKey = roleNames.find(r => r.toLowerCase() === role.toLowerCase());
200
+ if (!roleKey) {
201
+ return {
202
+ content: [{ type: "text" as const, text:
203
+ `Delegation refused: "${role}" is not a declared sub-role. Declared roles: ` +
204
+ `${roleNames.join(", ")}.` }],
205
+ };
206
+ }
207
+ const roleDef = config.roles[roleKey];
208
+
209
+ // Write safety: read-only unless this is the only live child AND the
210
+ // parent explicitly granted write. The role's tools cap always wins.
211
+ const tools = resolveDelegateTools({
212
+ parentTools: config.parentTools,
213
+ roleTools: roleDef.tools,
214
+ allowWrite: allow_write === true,
215
+ concurrent: liveCount > 0,
216
+ });
217
+ if (tools.refused) {
218
+ return {
219
+ content: [{ type: "text" as const, text:
220
+ `Delegation refused: role "${roleKey}" declares tools "${roleDef.tools}" but none are ` +
221
+ `available under the current parent/concurrency tool policy.` }],
222
+ };
223
+ }
224
+ const effectiveTools = tools.effectiveTools;
225
+ const writeDowngraded = tools.writeDowngraded;
226
+
227
+ callCount++;
228
+ childSeq++;
229
+ const plan = planDelegateSpawn({
230
+ tag: config.tag,
231
+ roleKey,
232
+ childSeq,
233
+ depth: config.depth,
234
+ remainingSpawns: config.remainingSpawns ?? 0,
235
+ effectiveTools,
236
+ damageControl: config.damageControl,
237
+ delegateExt: config.delegateExt,
238
+ });
239
+ config.remainingSpawns = plan.nextRemainingSpawns;
240
+ const childId = plan.childId;
241
+ const childDepth = plan.childDepth;
242
+ const childRemainingSpawns = plan.childRemainingSpawns;
243
+ const childCanDelegate = plan.childCanDelegate;
244
+ const childExtensions = plan.childExtensions;
245
+ const childTools = plan.childTools;
246
+ const childConfig: DelegateConfig | null = plan.includeDelegateConfig ? {
247
+ ...config,
248
+ tag: childId,
249
+ depth: childDepth,
250
+ remainingSpawns: childRemainingSpawns,
251
+ parentTools: effectiveTools,
252
+ } : null;
253
+
254
+ const sessionsDir = safePathWithin(config.eventDir, "sessions");
255
+ const resultsDir = safePathWithin(config.eventDir, "results");
256
+ const childSessionFile = safePathWithin(sessionsDir, `${childId}.jsonl`);
257
+ const childResultFile = safePathWithin(resultsDir, `${childId}.md`);
258
+ try { mkdirSync(sessionsDir, { recursive: true }); } catch {}
259
+ try { mkdirSync(resultsDir, { recursive: true }); } catch {}
260
+
261
+ emit({
262
+ t: "spawn", id: childId, parent: config.tag, role: roleKey,
263
+ model: roleDef.model, tools: effectiveTools, remainingSpawns: childRemainingSpawns, ts: Date.now(),
264
+ });
265
+ onUpdate?.({
266
+ content: [{ type: "text", text: `Delegating to ${roleKey} (${roleDef.model})...` }],
267
+ details: { id: childId, role: roleKey, model: roleDef.model, status: "running" },
268
+ });
269
+
270
+ // Buffered timeline streaming: coalesce text/thinking deltas and flush
271
+ // them into the event file on an interval (and on tool/exit), so the
272
+ // hub can render a live /zoom timeline without an event per token.
273
+ let pendingKind: "text" | "thinking" | null = null;
274
+ let pendingDelta = "";
275
+ const flushTimeline = () => {
276
+ if (!pendingKind || !pendingDelta) return;
277
+ emit({ t: "timeline", id: childId, kind: pendingKind, delta: pendingDelta });
278
+ pendingDelta = "";
279
+ };
280
+ const queueDelta = (kind: "text" | "thinking", delta: string) => {
281
+ if (pendingKind !== kind) flushTimeline();
282
+ pendingKind = kind;
283
+ pendingDelta += delta;
284
+ };
285
+ const flushTimer = setInterval(flushTimeline, TIMELINE_FLUSH_MS);
286
+
287
+ const startTime = Date.now();
288
+ let childProc: ChildProcess | null = null;
289
+ const mode = context?.trim().toLowerCase();
290
+ const brief = context && mode !== "summary" && mode !== "fork" ? context : undefined;
291
+ const prompt = brief
292
+ ? `## Context from your parent\n${brief}\n\n## Your task\n${instruction}`
293
+ : instruction;
294
+
295
+ let res;
296
+ liveCount++;
297
+ try {
298
+ res = await spawnPiAgent({
299
+ model: roleDef.model,
300
+ tools: childTools,
301
+ thinking: "off",
302
+ appendSystemPrompt: subagentProtocol(config.persona, roleKey, childCanDelegate),
303
+ sessionFile: childSessionFile,
304
+ prompt,
305
+ extensions: childExtensions,
306
+ env: childConfig ? { AGENT_HUB_DELEGATE_CONFIG: JSON.stringify(childConfig) } : undefined,
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,
318
+ }, {
319
+ onProcess: (p) => { childProc = p; liveChildren.add(p); },
320
+ onTextDelta: (delta) => queueDelta("text", delta),
321
+ onThinkingDelta: (delta) => queueDelta("thinking", delta),
322
+ onToolStart: (toolName, argStr) => {
323
+ flushTimeline();
324
+ emit({ t: "tool", id: childId, name: toolName, args: argStr.slice(0, 500) });
325
+ },
326
+ onUsage: (usage, source) => {
327
+ if (source === "message_end") {
328
+ emit({ t: "usage", id: childId, input: usage.input || 0, output: usage.output || 0 });
329
+ }
330
+ },
331
+ });
332
+ } finally {
333
+ liveCount--;
334
+ clearInterval(flushTimer);
335
+ if (childProc) liveChildren.delete(childProc);
336
+ }
337
+
338
+ flushTimeline();
339
+ const elapsed = Date.now() - startTime;
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() });
342
+
343
+ if (res.spawnError) {
344
+ const spawnFailure = `Delegate ${childId} failed to spawn: ${res.spawnError}`;
345
+ try { writeFileSync(childResultFile, spawnFailure + "\n", "utf-8"); } catch {}
346
+ return {
347
+ content: [{ type: "text" as const, text: `${spawnFailure}\n\nFull output: ${childResultFile}` }],
348
+ details: { id: childId, role: roleKey, status: "error", resultPath: childResultFile },
349
+ };
350
+ }
351
+
352
+ let output = res.output;
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) {
365
+ const errTail = res.stderr.trim().slice(-1000);
366
+ output = output
367
+ ? `${output}\n\n[stderr]\n${errTail}`
368
+ : `Delegate ${childId} exited with code ${code} and produced no output.\n\n[stderr]\n${errTail}`;
369
+ }
370
+ try { writeFileSync(childResultFile, output, "utf-8"); } catch {}
371
+ const digest = childResultDigest(output, childResultFile);
372
+
373
+ const notes: string[] = [];
374
+ if (writeDowngraded) notes.push("allow_write ignored — other children were live, so it ran read-only");
375
+ if (mode === "fork") notes.push("context: fork is not supported in v1 — the child started fresh from your instruction");
376
+ const noteBlock = notes.length > 0 ? `\n[note: ${notes.join("; ")}]` : "";
377
+
378
+ return {
379
+ content: [{ type: "text" as const, text:
380
+ `[delegate ${childId} · ${roleDef.model} · ${effectiveTools}] ${res.termination ? res.termination.reason : code === 0 ? "done" : "error"} ` +
381
+ `in ${Math.round(elapsed / 1000)}s${noteBlock}\n\n${digest.text}` }],
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 },
383
+ };
384
+ },
385
+ });
386
+ }
@@ -0,0 +1,165 @@
1
+ // Drift watchdog — the pure policy core behind in-flight specialist
2
+ // observation. Layer 1 is deterministic rules over the child's tool event
3
+ // stream (zero tokens); a firing rule is an ESCALATION SIGNAL, not a verdict —
4
+ // the harness then asks a cheap LLM judge (layer 2) whether the run is still
5
+ // on task, and only a DRIFTING/STUCK verdict terminates it (`drift_stop`).
6
+ // Everything here is data + pure functions so the policy is unit-testable
7
+ // away from the harness.
8
+
9
+ import { checkScope } from "./scope-gate.js";
10
+
11
+ export const WATCHDOG_SETTINGS = ["on", "off", "auto"];
12
+ export const DEFAULT_WATCHDOG_SETTING = "auto";
13
+
14
+ /** "On", " AUTO " → canonical setting, or null when unrecognized. */
15
+ export function normalizeWatchdogSetting(value) {
16
+ const v = String(value ?? "").trim().toLowerCase();
17
+ return WATCHDOG_SETTINGS.includes(v) ? v : null;
18
+ }
19
+
20
+ /**
21
+ * Is the watchdog armed for one dispatch? Precedence: the dispatch_agent
22
+ * `watchdog` param (boolean) > the per-agent /watchdog override ("on"/"off")
23
+ * > the hub-wide setting ("on"/"auto" arm, "off" disarms).
24
+ */
25
+ export function resolveWatchdogActive(dispatchParam, agentOverride, hubSetting) {
26
+ if (dispatchParam === true) return true;
27
+ if (dispatchParam === false) return false;
28
+ if (agentOverride === "on") return true;
29
+ if (agentOverride === "off") return false;
30
+ return normalizeWatchdogSetting(hubSetting) !== "off";
31
+ }
32
+
33
+ // Conservative thresholds: a false positive kills a productive run, so every
34
+ // rule needs sustained evidence before it fires.
35
+ export const DRIFT_DEFAULTS = {
36
+ writeTools: ["write", "edit"],
37
+ maxRepeats: 4,
38
+ maxConsecutiveFailures: 5,
39
+ maxToolCalls: 200,
40
+ trailLimit: 60,
41
+ };
42
+
43
+ const pathFromArgs = (argStr) => {
44
+ try {
45
+ const args = JSON.parse(argStr || "{}");
46
+ for (const key of ["path", "file_path", "filePath", "file", "filename"]) {
47
+ if (typeof args[key] === "string" && args[key].trim()) return args[key].trim();
48
+ }
49
+ } catch {}
50
+ return null;
51
+ };
52
+
53
+ /**
54
+ * Per-run monitor fed from the tool event stream. `onToolStart(tool, argStr)`
55
+ * and `onToolEnd(tool, isError)` return `null` while the run looks healthy, or
56
+ * `{ rule, detail }` when a rule crosses its threshold:
57
+ * scope — a write-capable tool touched a path outside the declared scope
58
+ * loop — the exact same (tool, args) call repeated maxRepeats times
59
+ * failures — maxConsecutiveFailures failed tool calls in a row
60
+ * toolcap — maxToolCalls total tool calls in one run
61
+ * Each rule instance fires once (at the crossing), so the caller escalates —
62
+ * it never gets spammed. `trail(n)` returns the recent tool trail for the judge.
63
+ */
64
+ export function createDriftMonitor(cfg = {}) {
65
+ const scopeGlobs = (cfg.scopeGlobs || []).filter(Boolean);
66
+ const writeTools = new Set(cfg.writeTools || DRIFT_DEFAULTS.writeTools);
67
+ const maxRepeats = cfg.maxRepeats ?? DRIFT_DEFAULTS.maxRepeats;
68
+ const maxConsecutiveFailures = cfg.maxConsecutiveFailures ?? DRIFT_DEFAULTS.maxConsecutiveFailures;
69
+ const maxToolCalls = cfg.maxToolCalls ?? DRIFT_DEFAULTS.maxToolCalls;
70
+ const trailLimit = cfg.trailLimit ?? DRIFT_DEFAULTS.trailLimit;
71
+
72
+ const callCounts = new Map();
73
+ const trailLines = [];
74
+ let totalCalls = 0;
75
+ let consecutiveFailures = 0;
76
+
77
+ const pushTrail = (line) => {
78
+ trailLines.push(line);
79
+ if (trailLines.length > trailLimit) trailLines.shift();
80
+ };
81
+
82
+ return {
83
+ onToolStart(toolName, argStr) {
84
+ totalCalls++;
85
+ pushTrail(`${toolName} ${String(argStr || "").slice(0, 120)}`.trim());
86
+
87
+ if (scopeGlobs.length > 0 && writeTools.has(toolName)) {
88
+ const path = pathFromArgs(argStr);
89
+ if (path && checkScope([path], scopeGlobs).outOfScope.length > 0) {
90
+ return { rule: "scope", detail: `${toolName} touched ${path} — outside the declared scope (${scopeGlobs.join(", ")})` };
91
+ }
92
+ }
93
+
94
+ const fingerprint = `${toolName}::${argStr || ""}`;
95
+ const count = (callCounts.get(fingerprint) || 0) + 1;
96
+ callCounts.set(fingerprint, count);
97
+ if (count === maxRepeats) {
98
+ return { rule: "loop", detail: `${toolName} called ${count}× with identical arguments — likely stuck in a loop` };
99
+ }
100
+
101
+ if (totalCalls === maxToolCalls) {
102
+ return { rule: "toolcap", detail: `${totalCalls} tool calls in one run — far beyond a focused task` };
103
+ }
104
+ return null;
105
+ },
106
+
107
+ onToolEnd(_toolName, isError) {
108
+ if (isError === true) {
109
+ consecutiveFailures++;
110
+ pushTrail(" ↳ FAILED");
111
+ if (consecutiveFailures % maxConsecutiveFailures === 0) {
112
+ return { rule: "failures", detail: `${consecutiveFailures} consecutive failed tool calls — no forward progress` };
113
+ }
114
+ } else if (isError === false) {
115
+ consecutiveFailures = 0;
116
+ }
117
+ // isError undefined: the stream carries no error flag — rule stays inert.
118
+ return null;
119
+ },
120
+
121
+ trail(n = 40) {
122
+ return trailLines.slice(-n);
123
+ },
124
+ };
125
+ }
126
+
127
+ /**
128
+ * The one-shot judge prompt: original task + declared scope + recent trail +
129
+ * the rule that fired. The judge answers with a single machine-parseable line.
130
+ */
131
+ export function buildJudgePrompt({ agent, task, scopeGlobs = [], trail = [], violation }) {
132
+ const scopeBlock = scopeGlobs.length > 0
133
+ ? `\n## Declared file scope\n${scopeGlobs.map(s => `- ${s}`).join("\n")}\n`
134
+ : "";
135
+ return `You are a drift watchdog judging whether a running coding agent is still on task.
136
+ Do not solve the task. Judge only whether the agent's recent actions serve it.
137
+
138
+ ## Agent
139
+ ${agent}
140
+
141
+ ## Original task (verbatim)
142
+ ${task}
143
+ ${scopeBlock}
144
+ ## Escalation signal
145
+ Rule "${violation?.rule || "unknown"}" fired: ${violation?.detail || "(no detail)"}
146
+
147
+ ## Recent tool trail (oldest first)
148
+ ${trail.length > 0 ? trail.join("\n") : "(no tool calls recorded)"}
149
+
150
+ ## Your answer
151
+ Reply with EXACTLY one line, nothing else:
152
+ VERDICT: ON_TRACK — <why the actions still serve the task>
153
+ VERDICT: DRIFTING — <what the agent is doing instead of the task>
154
+ VERDICT: STUCK — <the loop or dead end it cannot escape>
155
+ Prefer ON_TRACK unless the trail clearly contradicts the task: false alarms kill
156
+ productive work.`;
157
+ }
158
+
159
+ /** Parse the judge's reply. Returns { verdict, reason } or null when unparseable. */
160
+ export function parseJudgeVerdict(text) {
161
+ const matches = [...String(text ?? "").matchAll(/VERDICT:\s*(ON_TRACK|DRIFTING|STUCK)\s*(?:[—:-]\s*(.*))?/gi)];
162
+ if (matches.length === 0) return null;
163
+ const last = matches[matches.length - 1];
164
+ return { verdict: last[1].toLowerCase(), reason: (last[2] || "").trim() };
165
+ }
@@ -0,0 +1,96 @@
1
+ import { isAbsolute, relative, resolve } from "node:path";
2
+
3
+ const KNOWN_TAGS = new Set(["test", "runtime-ui", "code-grep", "manual"]);
4
+
5
+ export function validateEvidence(tag, evidence, options = {}) {
6
+ const normalizedTag = String(tag || "").trim().toLowerCase();
7
+ const text = String(evidence || "").trim();
8
+ if (!KNOWN_TAGS.has(normalizedTag)) {
9
+ return { ok: false, reason: `Unknown assertion tag "${tag}"; expected one of test, runtime-ui, code-grep, manual.` };
10
+ }
11
+ if (!text) return { ok: false, reason: "Evidence is required." };
12
+
13
+ if (normalizedTag === "test") return validateTestEvidence(text);
14
+ if (normalizedTag === "runtime-ui") return validateRuntimeUiEvidence(text, options);
15
+ if (normalizedTag === "code-grep") return validateCodeGrepEvidence(text);
16
+ if (normalizedTag === "manual") return validateManualEvidence(text);
17
+ return { ok: false, reason: `Unknown assertion tag "${tag}".` };
18
+ }
19
+
20
+ function validateTestEvidence(text) {
21
+ const hasIdentifier = /(?:\b(?:npm|pnpm|yarn|node|npx|vitest|jest|pytest|playwright|cargo|go test|bun)\b|\btest(?:s| name| file)?\b|`[^`]+`)/i.test(text);
22
+ const hasOutcome = /(?:\bpass(?:ed|es)?\b|\bgreen\b|\bok\b|\bexit\s*0\b|\b0\s+fail(?:ed|ures)?\b|\b\d+\/\d+\b|✓|✔)/i.test(text);
23
+ if (!hasIdentifier && !hasOutcome) return { ok: false, reason: "Test evidence must name the command/test identifier and its outcome." };
24
+ if (!hasIdentifier) return { ok: false, reason: "Test evidence must name the command or test identifier." };
25
+ if (!hasOutcome) return { ok: false, reason: "Test evidence must include the test outcome (pass/fail count, exit status, or equivalent)." };
26
+ return { ok: true };
27
+ }
28
+
29
+ function validateRuntimeUiEvidence(text, options) {
30
+ const candidates = extractPathCandidates(text).filter((p) => /(?:^|\/)artifacts\/evidence\//.test(normalizePath(p)));
31
+ if (candidates.length === 0) {
32
+ return { ok: false, reason: "Runtime-ui evidence must reference a session artifact path under artifacts/evidence/." };
33
+ }
34
+ const fileExists = typeof options.fileExists === "function" ? options.fileExists : () => false;
35
+ const evidenceRoot = options.evidenceRoot ? resolve(options.evidenceRoot) : null;
36
+ const resolvedCandidates = candidates.map((p) => resolveSessionEvidenceCandidate(p, evidenceRoot)).filter(Boolean);
37
+ if (resolvedCandidates.length === 0) {
38
+ return { ok: false, reason: "Runtime-ui evidence must reference a session artifact evidence path, not a repo-local ./artifacts path." };
39
+ }
40
+ const existing = resolvedCandidates.find((p) => {
41
+ try { return fileExists(p); } catch { return false; }
42
+ });
43
+ if (!existing) {
44
+ return { ok: false, reason: `Runtime-ui evidence artifact does not exist: ${resolvedCandidates[0]}.` };
45
+ }
46
+ return { ok: true };
47
+ }
48
+
49
+ function validateCodeGrepEvidence(text) {
50
+ const hasPattern = /(?:\bpattern\s*:|\bregex\s*:|\bgrep\b|`[^`]+`|\/[^/]+\/)/i.test(text);
51
+ const hasSample = /(?:\bmatch(?:ed|es)?\b|\bno[- ]?match(?:es)?\b|\b0\s+matches\b|\bfound\b|\bnot found\b|[\w./-]+:\d+)/i.test(text);
52
+ if (!hasPattern && !hasSample) return { ok: false, reason: "Code-grep evidence must include the searched pattern and a match/no-match result sample." };
53
+ if (!hasPattern) return { ok: false, reason: "Code-grep evidence must include the searched pattern." };
54
+ if (!hasSample) return { ok: false, reason: "Code-grep evidence must include a match/no-match result sample." };
55
+ return { ok: true };
56
+ }
57
+
58
+ function validateManualEvidence(text) {
59
+ const hasConfirmation = /(?:\bask_user\b|\bhuman\s+confirm(?:ed|ation)\b|\buser\s+(?:confirmed|said|approved|chose|answered)\b|\bmanual\s+confirm(?:ed|ation)\b|"[^"]+")/i.test(text);
60
+ if (!hasConfirmation) return { ok: false, reason: "Manual evidence must reference the ask_user answer or explicit user confirmation." };
61
+ return { ok: true };
62
+ }
63
+
64
+ function extractPathCandidates(text) {
65
+ const out = [];
66
+ const re = /(?:^|[\s(\[])(["']?)([^"'\s)\]]*(?:\.pi\/agent-sessions\/)?artifacts\/evidence\/[^"'\s)\]]+)\1/g;
67
+ let match;
68
+ while ((match = re.exec(text))) out.push(match[2].replace(/[.,;:]+$/, ""));
69
+ return out;
70
+ }
71
+
72
+ function resolveSessionEvidenceCandidate(candidate, evidenceRoot) {
73
+ const raw = String(candidate || "").trim();
74
+ const normalized = normalizePath(raw);
75
+ if (normalized.startsWith("./artifacts/evidence/")) return null;
76
+ if (evidenceRoot && normalized.startsWith("artifacts/evidence/")) {
77
+ return resolve(evidenceRoot, normalized.slice("artifacts/evidence/".length));
78
+ }
79
+ if (evidenceRoot && normalized.startsWith(".pi/agent-sessions/artifacts/evidence/")) {
80
+ return resolve(evidenceRoot, normalized.slice(".pi/agent-sessions/artifacts/evidence/".length));
81
+ }
82
+ if (isAbsolute(raw)) {
83
+ const abs = resolve(raw);
84
+ return !evidenceRoot || isWithin(evidenceRoot, abs) ? abs : null;
85
+ }
86
+ return null;
87
+ }
88
+
89
+ function isWithin(root, target) {
90
+ const rel = relative(resolve(root), resolve(target));
91
+ return rel === "" || (!!rel && !rel.startsWith("..") && !isAbsolute(rel));
92
+ }
93
+
94
+ function normalizePath(value) {
95
+ return String(value || "").replace(/\\/g, "/");
96
+ }
@@ -0,0 +1,29 @@
1
+ type FooterTheme = {
2
+ fg(color: string, text: string): string;
3
+ };
4
+
5
+ export function composeHubFooterLeft(
6
+ version: string | null,
7
+ model: string,
8
+ thinkingSuffix: string,
9
+ team: string,
10
+ ): string {
11
+ return [version ? `v${version}` : "", `${model}${thinkingSuffix}`, team]
12
+ .filter(Boolean)
13
+ .join(" · ");
14
+ }
15
+
16
+ export function renderHubFooterLeft(
17
+ theme: FooterTheme,
18
+ version: string | null,
19
+ model: string,
20
+ thinkingSuffix: string,
21
+ team: string,
22
+ ): string {
23
+ const metadata = [version ? `v${version}` : "", `${model}${thinkingSuffix}`]
24
+ .filter(Boolean)
25
+ .join(" · ");
26
+ const dimMetadata = theme.fg("dim", ` ${metadata}`);
27
+ const separator = metadata && team ? theme.fg("muted", " · ") : "";
28
+ return dimMetadata + separator + (team ? theme.fg("accent", team) : "");
29
+ }