@chankov/agent-fleet 0.0.4 → 0.0.6

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 (614) hide show
  1. package/.claude/commands/set-hermes-telegram.md +15 -0
  2. package/.opencode/commands/af-set-hermes-telegram.md +15 -0
  3. package/.pi/agents/dispatch-policy.yaml +1 -1
  4. package/.pi/agents/peers.yaml +4 -4
  5. package/.pi/extensions/agent-fleet-update-check/README.md +4 -4
  6. package/.pi/extensions/btw/README.md +10 -10
  7. package/.pi/extensions/btw/index.ts +11 -11
  8. package/.pi/extensions/chrome-devtools-mcp/README.md +3 -3
  9. package/.pi/extensions/chrome-devtools-mcp/index.ts +1 -0
  10. package/.pi/extensions/compact-and-continue/README.md +2 -2
  11. package/.pi/extensions/mcp-bridge/README.md +1 -1
  12. package/.pi/extensions/pi-voice-stt/README.md +7 -7
  13. package/.pi/extensions/pi-voice-stt/index.ts +4 -4
  14. package/.pi/harnesses/agent-hub/README.md +84 -84
  15. package/.pi/harnesses/agent-hub/backend-policy.js +1 -1
  16. package/.pi/harnesses/agent-hub/delegate.ts +3 -3
  17. package/.pi/harnesses/agent-hub/drift-watchdog.js +1 -1
  18. package/.pi/harnesses/agent-hub/index.ts +254 -254
  19. package/.pi/harnesses/agent-hub/monitor-lifecycle.ts +1 -1
  20. package/.pi/harnesses/agent-hub/monitor-publisher.ts +3 -3
  21. package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +1 -1
  22. package/.pi/harnesses/agent-hub/package.json +1 -1
  23. package/.pi/harnesses/agent-hub/run-budget.js +1 -1
  24. package/.pi/harnesses/ask-user-remote/README.md +1 -0
  25. package/.pi/harnesses/ask-user-remote/index.ts +36 -8
  26. package/.pi/harnesses/coms/README.md +7 -7
  27. package/.pi/harnesses/coms/index.ts +13 -13
  28. package/.pi/harnesses/coms/package.json +1 -1
  29. package/.pi/harnesses/damage-control-continue/README.md +16 -16
  30. package/.pi/harnesses/damage-control-continue/index.ts +11 -11
  31. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  32. package/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  33. package/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
  34. package/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  35. package/.pi/harnesses/lib/hermes-monitor-socket.ts +118 -0
  36. package/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  37. package/.pi/prompts/af-doctor-agent-fleet.md +15 -0
  38. package/.pi/prompts/af-set-hermes-telegram.md +15 -0
  39. package/.pi/prompts/af-setup-agent-fleet.md +27 -0
  40. package/.versions/0.0.5/.claude/commands/build.md +44 -0
  41. package/.versions/0.0.5/.claude/commands/code-simplify.md +22 -0
  42. package/.versions/0.0.5/.claude/commands/design-agent.md +14 -0
  43. package/.versions/0.0.5/.claude/commands/doctor-agent-fleet.md +17 -0
  44. package/.versions/0.0.5/.claude/commands/orchestrate.md +112 -0
  45. package/.versions/0.0.5/.claude/commands/plan.md +16 -0
  46. package/.versions/0.0.5/.claude/commands/prime.md +22 -0
  47. package/.versions/0.0.5/.claude/commands/review.md +16 -0
  48. package/.versions/0.0.5/.claude/commands/set-hermes-telegram.md +15 -0
  49. package/.versions/0.0.5/.claude/commands/setup-agent-fleet.md +25 -0
  50. package/.versions/0.0.5/.claude/commands/ship.md +72 -0
  51. package/.versions/0.0.5/.claude/commands/spec.md +15 -0
  52. package/.versions/0.0.5/.claude/commands/test.md +19 -0
  53. package/.versions/0.0.5/.claude/commands/webperf.md +32 -0
  54. package/.versions/0.0.5/.claude/orchestrate-teams.yaml +24 -0
  55. package/.versions/0.0.5/.opencode/commands/af-build.md +17 -0
  56. package/.versions/0.0.5/.opencode/commands/af-code-simplify.md +16 -0
  57. package/.versions/0.0.5/.opencode/commands/af-compound.md +16 -0
  58. package/.versions/0.0.5/.opencode/commands/af-design-agent.md +15 -0
  59. package/.versions/0.0.5/.opencode/commands/af-doctor-agent-fleet.md +17 -0
  60. package/.versions/0.0.5/.opencode/commands/af-orchestrate.md +112 -0
  61. package/.versions/0.0.5/.opencode/commands/af-plan.md +16 -0
  62. package/.versions/0.0.5/.opencode/commands/af-prime.md +22 -0
  63. package/.versions/0.0.5/.opencode/commands/af-review.md +15 -0
  64. package/.versions/0.0.5/.opencode/commands/af-set-hermes-telegram.md +15 -0
  65. package/.versions/0.0.5/.opencode/commands/af-setup-agent-fleet.md +15 -0
  66. package/.versions/0.0.5/.opencode/commands/af-ship.md +16 -0
  67. package/.versions/0.0.5/.opencode/commands/af-spec.md +16 -0
  68. package/.versions/0.0.5/.opencode/commands/af-test.md +21 -0
  69. package/.versions/0.0.5/.opencode/commands/af-webperf.md +32 -0
  70. package/.versions/0.0.5/.opencode/orchestrate-teams.yaml +24 -0
  71. package/.versions/0.0.5/.pi/agents/dispatch-policy.yaml +32 -0
  72. package/.versions/0.0.5/.pi/agents/model-profiles.yaml +20 -0
  73. package/.versions/0.0.5/.pi/agents/peers.yaml +146 -0
  74. package/.versions/0.0.5/.pi/agents/teams.yaml +39 -0
  75. package/.versions/0.0.5/.pi/damage-control-rules.yaml +297 -0
  76. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/README.md +58 -0
  77. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  78. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  79. package/.versions/0.0.5/.pi/extensions/btw/README.md +118 -0
  80. package/.versions/0.0.5/.pi/extensions/btw/index.ts +917 -0
  81. package/.versions/0.0.5/.pi/extensions/btw/package.json +6 -0
  82. package/.versions/0.0.5/.pi/extensions/btw/state.js +179 -0
  83. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
  84. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
  85. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  86. package/.versions/0.0.5/.pi/extensions/compact-and-continue/README.md +42 -0
  87. package/.versions/0.0.5/.pi/extensions/compact-and-continue/index.ts +120 -0
  88. package/.versions/0.0.5/.pi/extensions/compact-and-continue/package.json +6 -0
  89. package/.versions/0.0.5/.pi/extensions/mcp-bridge/README.md +46 -0
  90. package/.versions/0.0.5/.pi/extensions/mcp-bridge/index.ts +206 -0
  91. package/.versions/0.0.5/.pi/extensions/mcp-bridge/package.json +6 -0
  92. package/.versions/0.0.5/.pi/extensions/package-lock.json +1143 -0
  93. package/.versions/0.0.5/.pi/extensions/package.json +9 -0
  94. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/README.md +201 -0
  95. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/config.ts +198 -0
  96. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  97. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/index.ts +248 -0
  98. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/package.json +6 -0
  99. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  100. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  101. package/.versions/0.0.5/.pi/harnesses/agent-hub/README.md +798 -0
  102. package/.versions/0.0.5/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  103. package/.versions/0.0.5/.pi/harnesses/agent-hub/artifacts.js +92 -0
  104. package/.versions/0.0.5/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  105. package/.versions/0.0.5/.pi/harnesses/agent-hub/delegate.ts +386 -0
  106. package/.versions/0.0.5/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  107. package/.versions/0.0.5/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  108. package/.versions/0.0.5/.pi/harnesses/agent-hub/footer.ts +29 -0
  109. package/.versions/0.0.5/.pi/harnesses/agent-hub/helpers.ts +214 -0
  110. package/.versions/0.0.5/.pi/harnesses/agent-hub/index.ts +8045 -0
  111. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  112. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  113. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  114. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  115. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  116. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  117. package/.versions/0.0.5/.pi/harnesses/agent-hub/package.json +7 -0
  118. package/.versions/0.0.5/.pi/harnesses/agent-hub/research-retention.js +34 -0
  119. package/.versions/0.0.5/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  120. package/.versions/0.0.5/.pi/harnesses/agent-hub/return-contract.js +215 -0
  121. package/.versions/0.0.5/.pi/harnesses/agent-hub/run-budget.js +155 -0
  122. package/.versions/0.0.5/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  123. package/.versions/0.0.5/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  124. package/.versions/0.0.5/.pi/harnesses/agent-hub/spawn.ts +246 -0
  125. package/.versions/0.0.5/.pi/harnesses/agent-hub/version.ts +18 -0
  126. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/README.md +19 -0
  127. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/index.ts +321 -0
  128. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  129. package/.versions/0.0.5/.pi/harnesses/coms/README.md +92 -0
  130. package/.versions/0.0.5/.pi/harnesses/coms/index.ts +1745 -0
  131. package/.versions/0.0.5/.pi/harnesses/coms/package.json +7 -0
  132. package/.versions/0.0.5/.pi/harnesses/coms/version.ts +18 -0
  133. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/README.md +117 -0
  134. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/index.ts +536 -0
  135. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/package.json +7 -0
  136. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/version.ts +18 -0
  137. package/.versions/0.0.5/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  138. package/.versions/0.0.5/.pi/harnesses/lib/herdr-client.ts +458 -0
  139. package/.versions/0.0.5/.pi/harnesses/lib/herdr-presence.ts +288 -0
  140. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  141. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
  142. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  143. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-socket.ts +118 -0
  144. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  145. package/.versions/0.0.5/.pi/harnesses/package-lock.json +35 -0
  146. package/.versions/0.0.5/.pi/harnesses/package.json +9 -0
  147. package/.versions/0.0.5/.pi/prompts/build.md +24 -0
  148. package/.versions/0.0.5/.pi/prompts/code-simplify.md +22 -0
  149. package/.versions/0.0.5/.pi/prompts/plan.md +16 -0
  150. package/.versions/0.0.5/.pi/prompts/review.md +16 -0
  151. package/.versions/0.0.5/.pi/prompts/set-hermes-telegram.md +15 -0
  152. package/.versions/0.0.5/.pi/prompts/ship.md +17 -0
  153. package/.versions/0.0.5/.pi/prompts/spec.md +15 -0
  154. package/.versions/0.0.5/.pi/prompts/test.md +19 -0
  155. package/.versions/0.0.5/.pi/skills/bowser/SKILL.md +145 -0
  156. package/.versions/0.0.5/.version +1 -0
  157. package/.versions/0.0.5/agents/architect.md +23 -0
  158. package/.versions/0.0.5/agents/bowser.md +26 -0
  159. package/.versions/0.0.5/agents/builder.md +53 -0
  160. package/.versions/0.0.5/agents/code-reviewer.md +205 -0
  161. package/.versions/0.0.5/agents/deep-researcher.md +31 -0
  162. package/.versions/0.0.5/agents/documenter.md +18 -0
  163. package/.versions/0.0.5/agents/orchestrator.md +54 -0
  164. package/.versions/0.0.5/agents/plan-reviewer.md +60 -0
  165. package/.versions/0.0.5/agents/planner.md +69 -0
  166. package/.versions/0.0.5/agents/releaser.md +24 -0
  167. package/.versions/0.0.5/agents/researcher.md +28 -0
  168. package/.versions/0.0.5/agents/security-auditor.md +166 -0
  169. package/.versions/0.0.5/agents/test-engineer.md +151 -0
  170. package/.versions/0.0.5/agents/web-debugger.md +42 -0
  171. package/.versions/0.0.5/agents/web-performance-auditor.md +192 -0
  172. package/.versions/0.0.5/codex/CONDUCTOR.md +148 -0
  173. package/.versions/0.0.5/docs/ARCHITECTURE.md +210 -0
  174. package/.versions/0.0.5/docs/agent-fleet-setup.md +366 -0
  175. package/.versions/0.0.5/docs/claude-code-coms-bridge.md +103 -0
  176. package/.versions/0.0.5/docs/codex-remote-conductor.md +170 -0
  177. package/.versions/0.0.5/docs/coms-hermes-bridge.md +179 -0
  178. package/.versions/0.0.5/docs/getting-started.md +183 -0
  179. package/.versions/0.0.5/docs/npm-install.md +337 -0
  180. package/.versions/0.0.5/docs/opencode-setup.md +249 -0
  181. package/.versions/0.0.5/docs/pi-extensions.md +293 -0
  182. package/.versions/0.0.5/docs/pi-setup.md +472 -0
  183. package/.versions/0.0.5/docs/skill-anatomy.md +150 -0
  184. package/.versions/0.0.5/hermes/README.md +231 -0
  185. package/.versions/0.0.5/hermes/skills/hub-conductor/SKILL.md +84 -0
  186. package/.versions/0.0.5/hermes/skills/hub-liaison/SKILL.md +84 -0
  187. package/.versions/0.0.5/hooks/SIMPLIFY-IGNORE.md +90 -0
  188. package/.versions/0.0.5/hooks/coms-stop-hook.mjs +73 -0
  189. package/.versions/0.0.5/hooks/hooks.json +14 -0
  190. package/.versions/0.0.5/hooks/session-start.sh +74 -0
  191. package/.versions/0.0.5/hooks/simplify-ignore.sh +302 -0
  192. package/.versions/0.0.5/justfile +245 -0
  193. package/.versions/0.0.5/references/accessibility-checklist.md +160 -0
  194. package/.versions/0.0.5/references/definition-of-done.md +67 -0
  195. package/.versions/0.0.5/references/fleet-coordination-patterns.md +151 -0
  196. package/.versions/0.0.5/references/observability-checklist.md +91 -0
  197. package/.versions/0.0.5/references/orchestration-patterns.md +370 -0
  198. package/.versions/0.0.5/references/performance-checklist.md +153 -0
  199. package/.versions/0.0.5/references/prompting-patterns.md +380 -0
  200. package/.versions/0.0.5/references/security-checklist.md +179 -0
  201. package/.versions/0.0.5/references/testing-patterns.md +236 -0
  202. package/.versions/0.0.5/scripts/codex-conductor.ts +41 -0
  203. package/.versions/0.0.5/scripts/codex-remote-control.ts +167 -0
  204. package/.versions/0.0.5/scripts/coms-claude-bridge.ts +286 -0
  205. package/.versions/0.0.5/scripts/coms-cli.ts +484 -0
  206. package/.versions/0.0.5/scripts/coms-hermes-bridge.ts +413 -0
  207. package/.versions/0.0.5/scripts/fleet.ts +141 -0
  208. package/.versions/0.0.5/scripts/hermes-monitor-capability-runner.ts +25 -0
  209. package/.versions/0.0.5/scripts/hermes-monitor-scenario.ts +7 -0
  210. package/.versions/0.0.5/scripts/lib/claude-bridge-core.ts +100 -0
  211. package/.versions/0.0.5/scripts/lib/codex-conductor.ts +88 -0
  212. package/.versions/0.0.5/scripts/lib/codex-remote-control.ts +480 -0
  213. package/.versions/0.0.5/scripts/lib/coms-envelope.ts +539 -0
  214. package/.versions/0.0.5/scripts/lib/fake-herdr-server.ts +88 -0
  215. package/.versions/0.0.5/scripts/lib/fleet-command.ts +109 -0
  216. package/.versions/0.0.5/scripts/lib/herdr-layout.ts +263 -0
  217. package/.versions/0.0.5/scripts/lib/hermes-bridge-core.ts +241 -0
  218. package/.versions/0.0.5/scripts/lib/hermes-monitor-herdr.ts +2 -0
  219. package/.versions/0.0.5/scripts/lib/hermes-monitor-model.ts +3 -0
  220. package/.versions/0.0.5/scripts/lib/hermes-monitor-registry.ts +2 -0
  221. package/.versions/0.0.5/scripts/lib/hermes-monitor-socket.ts +2 -0
  222. package/.versions/0.0.5/scripts/lib/hermes-monitor-store.ts +2 -0
  223. package/.versions/0.0.5/scripts/lib/persona-banner.ts +62 -0
  224. package/.versions/0.0.5/scripts/lib/spawn-stagger.ts +101 -0
  225. package/.versions/0.0.5/scripts/lib/team-project.ts +191 -0
  226. package/.versions/0.0.5/scripts/lib/team-snapshot.ts +147 -0
  227. package/.versions/0.0.5/scripts/peer-banner.ts +40 -0
  228. package/.versions/0.0.5/scripts/team-snapshot.ts +237 -0
  229. package/.versions/0.0.5/scripts/team-up.ts +351 -0
  230. package/.versions/0.0.5/skills/_internal/grilling.md +11 -0
  231. package/.versions/0.0.5/skills/browser-testing-with-devtools/SKILL.md +352 -0
  232. package/.versions/0.0.5/skills/code-review-and-quality/SKILL.md +381 -0
  233. package/.versions/0.0.5/skills/compound-learning/SKILL.md +137 -0
  234. package/.versions/0.0.5/skills/context-engineering/SKILL.md +291 -0
  235. package/.versions/0.0.5/skills/deprecation-and-migration/SKILL.md +206 -0
  236. package/.versions/0.0.5/skills/designing-agents/SKILL.md +394 -0
  237. package/.versions/0.0.5/skills/designing-agents/pi-harness-authoring.md +222 -0
  238. package/.versions/0.0.5/skills/frontend-ui-engineering/SKILL.md +328 -0
  239. package/.versions/0.0.5/skills/git-workflow-and-versioning/SKILL.md +316 -0
  240. package/.versions/0.0.5/skills/guided-workspace-setup/SKILL.md +542 -0
  241. package/.versions/0.0.5/skills/guided-workspace-setup/companion-manifest.json +35 -0
  242. package/.versions/0.0.5/skills/idea-refine/SKILL.md +182 -0
  243. package/.versions/0.0.5/skills/idea-refine/examples.md +238 -0
  244. package/.versions/0.0.5/skills/idea-refine/frameworks.md +99 -0
  245. package/.versions/0.0.5/skills/idea-refine/refinement-criteria.md +113 -0
  246. package/.versions/0.0.5/skills/idea-refine/scripts/idea-refine.sh +15 -0
  247. package/.versions/0.0.5/skills/incremental-implementation/SKILL.md +287 -0
  248. package/.versions/0.0.5/skills/interview-me/SKILL.md +226 -0
  249. package/.versions/0.0.5/skills/orchestration-verification/SKILL.md +181 -0
  250. package/.versions/0.0.5/skills/peer-coms/SKILL.md +90 -0
  251. package/.versions/0.0.5/skills/performance-optimization/SKILL.md +350 -0
  252. package/.versions/0.0.5/skills/planning-and-task-breakdown/SKILL.md +236 -0
  253. package/.versions/0.0.5/skills/security-and-hardening/SKILL.md +461 -0
  254. package/.versions/0.0.5/skills/spec-driven-development/SKILL.md +245 -0
  255. package/.versions/0.0.5/skills/using-agent-skills/SKILL.md +199 -0
  256. package/.versions/0.0.5/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  257. package/.versions/0.0.5/vendor/agent-skills-upstream/LICENSE +21 -0
  258. package/.versions/0.0.5/vendor/agent-skills-upstream/README.md +11 -0
  259. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  260. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  261. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  262. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  263. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  264. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  265. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  266. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  267. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  268. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  269. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  270. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  271. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  272. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  273. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  274. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  275. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  276. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  277. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  278. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  279. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  280. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  281. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  282. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  283. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  284. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  285. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  286. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  287. package/.versions/0.0.6/.claude/commands/build.md +44 -0
  288. package/.versions/0.0.6/.claude/commands/code-simplify.md +22 -0
  289. package/.versions/0.0.6/.claude/commands/design-agent.md +14 -0
  290. package/.versions/0.0.6/.claude/commands/doctor-agent-fleet.md +17 -0
  291. package/.versions/0.0.6/.claude/commands/orchestrate.md +112 -0
  292. package/.versions/0.0.6/.claude/commands/plan.md +16 -0
  293. package/.versions/0.0.6/.claude/commands/prime.md +22 -0
  294. package/.versions/0.0.6/.claude/commands/review.md +16 -0
  295. package/.versions/0.0.6/.claude/commands/set-hermes-telegram.md +15 -0
  296. package/.versions/0.0.6/.claude/commands/setup-agent-fleet.md +25 -0
  297. package/.versions/0.0.6/.claude/commands/ship.md +72 -0
  298. package/.versions/0.0.6/.claude/commands/spec.md +15 -0
  299. package/.versions/0.0.6/.claude/commands/test.md +19 -0
  300. package/.versions/0.0.6/.claude/commands/webperf.md +32 -0
  301. package/.versions/0.0.6/.claude/orchestrate-teams.yaml +24 -0
  302. package/.versions/0.0.6/.opencode/commands/af-build.md +17 -0
  303. package/.versions/0.0.6/.opencode/commands/af-code-simplify.md +16 -0
  304. package/.versions/0.0.6/.opencode/commands/af-compound.md +16 -0
  305. package/.versions/0.0.6/.opencode/commands/af-design-agent.md +15 -0
  306. package/.versions/0.0.6/.opencode/commands/af-doctor-agent-fleet.md +17 -0
  307. package/.versions/0.0.6/.opencode/commands/af-orchestrate.md +112 -0
  308. package/.versions/0.0.6/.opencode/commands/af-plan.md +16 -0
  309. package/.versions/0.0.6/.opencode/commands/af-prime.md +22 -0
  310. package/.versions/0.0.6/.opencode/commands/af-review.md +15 -0
  311. package/.versions/0.0.6/.opencode/commands/af-set-hermes-telegram.md +15 -0
  312. package/.versions/0.0.6/.opencode/commands/af-setup-agent-fleet.md +15 -0
  313. package/.versions/0.0.6/.opencode/commands/af-ship.md +16 -0
  314. package/.versions/0.0.6/.opencode/commands/af-spec.md +16 -0
  315. package/.versions/0.0.6/.opencode/commands/af-test.md +21 -0
  316. package/.versions/0.0.6/.opencode/commands/af-webperf.md +32 -0
  317. package/.versions/0.0.6/.opencode/orchestrate-teams.yaml +24 -0
  318. package/.versions/0.0.6/.pi/agents/dispatch-policy.yaml +32 -0
  319. package/.versions/0.0.6/.pi/agents/model-profiles.yaml +20 -0
  320. package/.versions/0.0.6/.pi/agents/peers.yaml +146 -0
  321. package/.versions/0.0.6/.pi/agents/teams.yaml +39 -0
  322. package/.versions/0.0.6/.pi/damage-control-rules.yaml +297 -0
  323. package/.versions/0.0.6/.pi/extensions/agent-fleet-update-check/README.md +58 -0
  324. package/.versions/0.0.6/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  325. package/.versions/0.0.6/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  326. package/.versions/0.0.6/.pi/extensions/btw/README.md +118 -0
  327. package/.versions/0.0.6/.pi/extensions/btw/index.ts +917 -0
  328. package/.versions/0.0.6/.pi/extensions/btw/package.json +6 -0
  329. package/.versions/0.0.6/.pi/extensions/btw/state.js +179 -0
  330. package/.versions/0.0.6/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
  331. package/.versions/0.0.6/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  332. package/.versions/0.0.6/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  333. package/.versions/0.0.6/.pi/extensions/compact-and-continue/README.md +42 -0
  334. package/.versions/0.0.6/.pi/extensions/compact-and-continue/index.ts +120 -0
  335. package/.versions/0.0.6/.pi/extensions/compact-and-continue/package.json +6 -0
  336. package/.versions/0.0.6/.pi/extensions/mcp-bridge/README.md +46 -0
  337. package/.versions/0.0.6/.pi/extensions/mcp-bridge/index.ts +206 -0
  338. package/.versions/0.0.6/.pi/extensions/mcp-bridge/package.json +6 -0
  339. package/.versions/0.0.6/.pi/extensions/package-lock.json +1143 -0
  340. package/.versions/0.0.6/.pi/extensions/package.json +9 -0
  341. package/.versions/0.0.6/.pi/extensions/pi-voice-stt/README.md +201 -0
  342. package/.versions/0.0.6/.pi/extensions/pi-voice-stt/config.ts +198 -0
  343. package/.versions/0.0.6/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  344. package/.versions/0.0.6/.pi/extensions/pi-voice-stt/index.ts +248 -0
  345. package/.versions/0.0.6/.pi/extensions/pi-voice-stt/package.json +6 -0
  346. package/.versions/0.0.6/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  347. package/.versions/0.0.6/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  348. package/.versions/0.0.6/.pi/harnesses/agent-hub/README.md +798 -0
  349. package/.versions/0.0.6/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  350. package/.versions/0.0.6/.pi/harnesses/agent-hub/artifacts.js +92 -0
  351. package/.versions/0.0.6/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  352. package/.versions/0.0.6/.pi/harnesses/agent-hub/delegate.ts +386 -0
  353. package/.versions/0.0.6/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  354. package/.versions/0.0.6/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  355. package/.versions/0.0.6/.pi/harnesses/agent-hub/footer.ts +29 -0
  356. package/.versions/0.0.6/.pi/harnesses/agent-hub/helpers.ts +214 -0
  357. package/.versions/0.0.6/.pi/harnesses/agent-hub/index.ts +8045 -0
  358. package/.versions/0.0.6/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  359. package/.versions/0.0.6/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  360. package/.versions/0.0.6/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  361. package/.versions/0.0.6/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  362. package/.versions/0.0.6/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  363. package/.versions/0.0.6/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  364. package/.versions/0.0.6/.pi/harnesses/agent-hub/package.json +7 -0
  365. package/.versions/0.0.6/.pi/harnesses/agent-hub/research-retention.js +34 -0
  366. package/.versions/0.0.6/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  367. package/.versions/0.0.6/.pi/harnesses/agent-hub/return-contract.js +215 -0
  368. package/.versions/0.0.6/.pi/harnesses/agent-hub/run-budget.js +155 -0
  369. package/.versions/0.0.6/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  370. package/.versions/0.0.6/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  371. package/.versions/0.0.6/.pi/harnesses/agent-hub/spawn.ts +246 -0
  372. package/.versions/0.0.6/.pi/harnesses/agent-hub/version.ts +18 -0
  373. package/.versions/0.0.6/.pi/harnesses/ask-user-remote/README.md +19 -0
  374. package/.versions/0.0.6/.pi/harnesses/ask-user-remote/index.ts +321 -0
  375. package/.versions/0.0.6/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  376. package/.versions/0.0.6/.pi/harnesses/coms/README.md +92 -0
  377. package/.versions/0.0.6/.pi/harnesses/coms/index.ts +1745 -0
  378. package/.versions/0.0.6/.pi/harnesses/coms/package.json +7 -0
  379. package/.versions/0.0.6/.pi/harnesses/coms/version.ts +18 -0
  380. package/.versions/0.0.6/.pi/harnesses/damage-control-continue/README.md +117 -0
  381. package/.versions/0.0.6/.pi/harnesses/damage-control-continue/index.ts +536 -0
  382. package/.versions/0.0.6/.pi/harnesses/damage-control-continue/package.json +7 -0
  383. package/.versions/0.0.6/.pi/harnesses/damage-control-continue/version.ts +18 -0
  384. package/.versions/0.0.6/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  385. package/.versions/0.0.6/.pi/harnesses/lib/herdr-client.ts +458 -0
  386. package/.versions/0.0.6/.pi/harnesses/lib/herdr-presence.ts +288 -0
  387. package/.versions/0.0.6/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  388. package/.versions/0.0.6/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
  389. package/.versions/0.0.6/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  390. package/.versions/0.0.6/.pi/harnesses/lib/hermes-monitor-socket.ts +118 -0
  391. package/.versions/0.0.6/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  392. package/.versions/0.0.6/.pi/harnesses/package-lock.json +35 -0
  393. package/.versions/0.0.6/.pi/harnesses/package.json +9 -0
  394. package/.versions/0.0.6/.pi/prompts/af-build.md +24 -0
  395. package/.versions/0.0.6/.pi/prompts/af-code-simplify.md +22 -0
  396. package/.versions/0.0.6/.pi/prompts/af-doctor-agent-fleet.md +15 -0
  397. package/.versions/0.0.6/.pi/prompts/af-plan.md +16 -0
  398. package/.versions/0.0.6/.pi/prompts/af-review.md +16 -0
  399. package/.versions/0.0.6/.pi/prompts/af-set-hermes-telegram.md +15 -0
  400. package/.versions/0.0.6/.pi/prompts/af-setup-agent-fleet.md +27 -0
  401. package/.versions/0.0.6/.pi/prompts/af-ship.md +17 -0
  402. package/.versions/0.0.6/.pi/prompts/af-spec.md +15 -0
  403. package/.versions/0.0.6/.pi/prompts/af-test.md +19 -0
  404. package/.versions/0.0.6/.pi/skills/bowser/SKILL.md +145 -0
  405. package/.versions/0.0.6/.version +1 -0
  406. package/.versions/0.0.6/agents/architect.md +23 -0
  407. package/.versions/0.0.6/agents/bowser.md +26 -0
  408. package/.versions/0.0.6/agents/builder.md +53 -0
  409. package/.versions/0.0.6/agents/code-reviewer.md +205 -0
  410. package/.versions/0.0.6/agents/deep-researcher.md +31 -0
  411. package/.versions/0.0.6/agents/documenter.md +18 -0
  412. package/.versions/0.0.6/agents/orchestrator.md +54 -0
  413. package/.versions/0.0.6/agents/plan-reviewer.md +60 -0
  414. package/.versions/0.0.6/agents/planner.md +69 -0
  415. package/.versions/0.0.6/agents/releaser.md +24 -0
  416. package/.versions/0.0.6/agents/researcher.md +28 -0
  417. package/.versions/0.0.6/agents/security-auditor.md +166 -0
  418. package/.versions/0.0.6/agents/test-engineer.md +151 -0
  419. package/.versions/0.0.6/agents/web-debugger.md +42 -0
  420. package/.versions/0.0.6/agents/web-performance-auditor.md +192 -0
  421. package/.versions/0.0.6/codex/CONDUCTOR.md +148 -0
  422. package/.versions/0.0.6/docs/ARCHITECTURE.md +210 -0
  423. package/.versions/0.0.6/docs/agent-fleet-setup.md +366 -0
  424. package/.versions/0.0.6/docs/claude-code-coms-bridge.md +103 -0
  425. package/.versions/0.0.6/docs/codex-remote-conductor.md +170 -0
  426. package/.versions/0.0.6/docs/coms-hermes-bridge.md +179 -0
  427. package/.versions/0.0.6/docs/getting-started.md +183 -0
  428. package/.versions/0.0.6/docs/npm-install.md +337 -0
  429. package/.versions/0.0.6/docs/opencode-setup.md +249 -0
  430. package/.versions/0.0.6/docs/pi-extensions.md +293 -0
  431. package/.versions/0.0.6/docs/pi-setup.md +476 -0
  432. package/.versions/0.0.6/docs/skill-anatomy.md +150 -0
  433. package/.versions/0.0.6/hermes/README.md +231 -0
  434. package/.versions/0.0.6/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  435. package/.versions/0.0.6/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  436. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +15 -0
  437. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +19 -0
  438. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +13 -0
  439. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +11 -0
  440. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +9 -0
  441. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +17 -0
  442. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +34 -0
  443. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +151 -0
  444. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +39 -0
  445. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  446. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +12 -0
  447. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  448. package/.versions/0.0.6/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +22 -0
  449. package/.versions/0.0.6/hermes/skills/hub-conductor/SKILL.md +84 -0
  450. package/.versions/0.0.6/hermes/skills/hub-liaison/SKILL.md +84 -0
  451. package/.versions/0.0.6/hooks/SIMPLIFY-IGNORE.md +90 -0
  452. package/.versions/0.0.6/hooks/coms-stop-hook.mjs +73 -0
  453. package/.versions/0.0.6/hooks/hooks.json +14 -0
  454. package/.versions/0.0.6/hooks/session-start.sh +74 -0
  455. package/.versions/0.0.6/hooks/simplify-ignore.sh +302 -0
  456. package/.versions/0.0.6/justfile +245 -0
  457. package/.versions/0.0.6/references/accessibility-checklist.md +160 -0
  458. package/.versions/0.0.6/references/definition-of-done.md +67 -0
  459. package/.versions/0.0.6/references/fleet-coordination-patterns.md +151 -0
  460. package/.versions/0.0.6/references/observability-checklist.md +91 -0
  461. package/.versions/0.0.6/references/orchestration-patterns.md +370 -0
  462. package/.versions/0.0.6/references/performance-checklist.md +153 -0
  463. package/.versions/0.0.6/references/prompting-patterns.md +380 -0
  464. package/.versions/0.0.6/references/security-checklist.md +179 -0
  465. package/.versions/0.0.6/references/testing-patterns.md +236 -0
  466. package/.versions/0.0.6/scripts/codex-conductor.ts +41 -0
  467. package/.versions/0.0.6/scripts/codex-remote-control.ts +167 -0
  468. package/.versions/0.0.6/scripts/coms-claude-bridge.ts +286 -0
  469. package/.versions/0.0.6/scripts/coms-cli.ts +484 -0
  470. package/.versions/0.0.6/scripts/coms-hermes-bridge.ts +413 -0
  471. package/.versions/0.0.6/scripts/fleet.ts +141 -0
  472. package/.versions/0.0.6/scripts/hermes-monitor-capability-runner.ts +25 -0
  473. package/.versions/0.0.6/scripts/hermes-monitor-scenario.ts +7 -0
  474. package/.versions/0.0.6/scripts/lib/claude-bridge-core.ts +100 -0
  475. package/.versions/0.0.6/scripts/lib/codex-conductor.ts +88 -0
  476. package/.versions/0.0.6/scripts/lib/codex-remote-control.ts +480 -0
  477. package/.versions/0.0.6/scripts/lib/coms-envelope.ts +539 -0
  478. package/.versions/0.0.6/scripts/lib/fake-herdr-server.ts +88 -0
  479. package/.versions/0.0.6/scripts/lib/fleet-command.ts +109 -0
  480. package/.versions/0.0.6/scripts/lib/herdr-layout.ts +263 -0
  481. package/.versions/0.0.6/scripts/lib/hermes-bridge-core.ts +241 -0
  482. package/.versions/0.0.6/scripts/lib/hermes-monitor-herdr.ts +2 -0
  483. package/.versions/0.0.6/scripts/lib/hermes-monitor-model.ts +3 -0
  484. package/.versions/0.0.6/scripts/lib/hermes-monitor-registry.ts +2 -0
  485. package/.versions/0.0.6/scripts/lib/hermes-monitor-socket.ts +2 -0
  486. package/.versions/0.0.6/scripts/lib/hermes-monitor-store.ts +2 -0
  487. package/.versions/0.0.6/scripts/lib/persona-banner.ts +62 -0
  488. package/.versions/0.0.6/scripts/lib/spawn-stagger.ts +101 -0
  489. package/.versions/0.0.6/scripts/lib/team-project.ts +191 -0
  490. package/.versions/0.0.6/scripts/lib/team-snapshot.ts +147 -0
  491. package/.versions/0.0.6/scripts/peer-banner.ts +40 -0
  492. package/.versions/0.0.6/scripts/team-snapshot.ts +237 -0
  493. package/.versions/0.0.6/scripts/team-up.ts +351 -0
  494. package/.versions/0.0.6/skills/_internal/grilling.md +11 -0
  495. package/.versions/0.0.6/skills/browser-testing-with-devtools/SKILL.md +352 -0
  496. package/.versions/0.0.6/skills/code-review-and-quality/SKILL.md +381 -0
  497. package/.versions/0.0.6/skills/compound-learning/SKILL.md +137 -0
  498. package/.versions/0.0.6/skills/context-engineering/SKILL.md +291 -0
  499. package/.versions/0.0.6/skills/deprecation-and-migration/SKILL.md +206 -0
  500. package/.versions/0.0.6/skills/designing-agents/SKILL.md +394 -0
  501. package/.versions/0.0.6/skills/designing-agents/pi-harness-authoring.md +222 -0
  502. package/.versions/0.0.6/skills/frontend-ui-engineering/SKILL.md +328 -0
  503. package/.versions/0.0.6/skills/git-workflow-and-versioning/SKILL.md +316 -0
  504. package/.versions/0.0.6/skills/guided-workspace-setup/SKILL.md +544 -0
  505. package/.versions/0.0.6/skills/guided-workspace-setup/companion-manifest.json +35 -0
  506. package/.versions/0.0.6/skills/idea-refine/SKILL.md +182 -0
  507. package/.versions/0.0.6/skills/idea-refine/examples.md +238 -0
  508. package/.versions/0.0.6/skills/idea-refine/frameworks.md +99 -0
  509. package/.versions/0.0.6/skills/idea-refine/refinement-criteria.md +113 -0
  510. package/.versions/0.0.6/skills/idea-refine/scripts/idea-refine.sh +15 -0
  511. package/.versions/0.0.6/skills/incremental-implementation/SKILL.md +287 -0
  512. package/.versions/0.0.6/skills/interview-me/SKILL.md +226 -0
  513. package/.versions/0.0.6/skills/orchestration-verification/SKILL.md +181 -0
  514. package/.versions/0.0.6/skills/peer-coms/SKILL.md +90 -0
  515. package/.versions/0.0.6/skills/performance-optimization/SKILL.md +350 -0
  516. package/.versions/0.0.6/skills/planning-and-task-breakdown/SKILL.md +236 -0
  517. package/.versions/0.0.6/skills/security-and-hardening/SKILL.md +461 -0
  518. package/.versions/0.0.6/skills/spec-driven-development/SKILL.md +245 -0
  519. package/.versions/0.0.6/skills/using-agent-skills/SKILL.md +199 -0
  520. package/.versions/0.0.6/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  521. package/.versions/0.0.6/vendor/agent-skills-upstream/LICENSE +21 -0
  522. package/.versions/0.0.6/vendor/agent-skills-upstream/README.md +11 -0
  523. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  524. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  525. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  526. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  527. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  528. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  529. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  530. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  531. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  532. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  533. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  534. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  535. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  536. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  537. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  538. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  539. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  540. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  541. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  542. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  543. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  544. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  545. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  546. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  547. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  548. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  549. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  550. package/.versions/0.0.6/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  551. package/CHANGELOG.md +15 -0
  552. package/README.md +38 -36
  553. package/agents/documenter.md +1 -1
  554. package/agents/releaser.md +1 -1
  555. package/bin/cli.js +103 -21
  556. package/bin/lib/bootstrap.js +16 -16
  557. package/bin/lib/doctor.js +1 -1
  558. package/bin/lib/set-hermes-telegram.js +323 -0
  559. package/docs/ARCHITECTURE.md +8 -8
  560. package/docs/agent-fleet-setup.md +12 -12
  561. package/docs/claude-code-coms-bridge.md +4 -4
  562. package/docs/codex-remote-conductor.md +12 -12
  563. package/docs/coms-hermes-bridge.md +62 -4
  564. package/docs/getting-started.md +4 -4
  565. package/docs/npm-install.md +21 -21
  566. package/docs/opencode-setup.md +1 -0
  567. package/docs/pi-extensions.md +36 -31
  568. package/docs/pi-setup.md +66 -53
  569. package/hermes/README.md +14 -11
  570. package/justfile +141 -152
  571. package/package.json +6 -3
  572. package/references/fleet-coordination-patterns.md +3 -3
  573. package/scripts/coms-hermes-bridge.ts +18 -8
  574. package/scripts/fleet.ts +141 -0
  575. package/scripts/lib/fleet-command.ts +109 -0
  576. package/scripts/lib/hermes-bridge-core.ts +5 -2
  577. package/scripts/lib/hermes-monitor-herdr.ts +2 -28
  578. package/scripts/lib/hermes-monitor-model.ts +3 -9
  579. package/scripts/lib/hermes-monitor-registry.ts +2 -6
  580. package/scripts/lib/hermes-monitor-socket.ts +2 -118
  581. package/scripts/lib/hermes-monitor-store.ts +2 -31
  582. package/scripts/lib/team-project.ts +10 -3
  583. package/scripts/team-snapshot.ts +4 -5
  584. package/scripts/team-up.ts +24 -6
  585. package/skills/browser-testing-with-devtools/SKILL.md +1 -1
  586. package/skills/compound-learning/SKILL.md +3 -3
  587. package/skills/guided-workspace-setup/SKILL.md +27 -18
  588. package/skills/guided-workspace-setup/companion-manifest.json +3 -1
  589. package/skills/peer-coms/SKILL.md +1 -1
  590. package/hermes/plugins/agent-fleet-monitor/dashboard/dist/index.js +0 -10
  591. /package/.pi/prompts/{build.md → af-build.md} +0 -0
  592. /package/.pi/prompts/{code-simplify.md → af-code-simplify.md} +0 -0
  593. /package/.pi/prompts/{plan.md → af-plan.md} +0 -0
  594. /package/.pi/prompts/{review.md → af-review.md} +0 -0
  595. /package/.pi/prompts/{ship.md → af-ship.md} +0 -0
  596. /package/.pi/prompts/{spec.md → af-spec.md} +0 -0
  597. /package/.pi/prompts/{test.md → af-test.md} +0 -0
  598. /package/{.pi → .versions/0.0.5/.pi}/prompts/doctor-agent-fleet.md +0 -0
  599. /package/{.pi → .versions/0.0.5/.pi}/prompts/setup-agent-fleet.md +0 -0
  600. /package/{hermes → .versions/0.0.5/hermes}/desktop-plugins/agent-fleet-monitor/plugin.js +0 -0
  601. /package/{hermes → .versions/0.0.5/hermes}/desktop-plugins/agent-fleet-monitor/state.js +0 -0
  602. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +0 -0
  603. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +0 -0
  604. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +0 -0
  605. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +0 -0
  606. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +0 -0
  607. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +0 -0
  608. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +0 -0
  609. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter.py +0 -0
  610. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter.test.py +0 -0
  611. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/manifest.json +0 -0
  612. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +0 -0
  613. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/plugin_api.py +0 -0
  614. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +0 -0
@@ -0,0 +1,288 @@
1
+ // .pi/harnesses/lib/herdr-presence.ts
2
+ //
3
+ // The herdr presence backend for the coms layer (used by both the standalone
4
+ // coms harness and the copy embedded in agent-hub). Two halves:
5
+ //
6
+ // - HerdrPresence — reports THIS agent's state into its pane
7
+ // (pane.report_agent) so the herdr sidebar shows live pi agent states.
8
+ // - HerdrAgentWatch — watches OTHER agents via agent.list +
9
+ // events.subscribe (push, no polling): global pane.created/closed/exited
10
+ // plus a per-pane agent_status_changed subscription for every tracked
11
+ // pane (herdr has no wildcard for that topic — spike finding). When the
12
+ // tracked pane set changes, the stream is torn down and resubscribed.
13
+ //
14
+ // Wire constraint baked in (measured live, herdr 0.7.1): `custom_status` is
15
+ // truncated to 32 chars by the server — no JSON fits. formatPeerStatus()
16
+ // therefore emits `<name> <pct>% q<depth>` with the coms peer NAME FIRST, so
17
+ // watchers can join a herdr pane back to the registry entry that carries the
18
+ // full agent card. parsePeerName() is the inverse.
19
+ //
20
+ // Pure module: no pi imports; erasable-TS; testable under node --test.
21
+
22
+ import {
23
+ herdr,
24
+ herdrAvailable,
25
+ subscribe,
26
+ type HerdrClientOptions,
27
+ type SubscribeHandle,
28
+ type Subscription,
29
+ } from "./herdr-client.ts";
30
+
31
+ export const CUSTOM_STATUS_MAX = 32;
32
+
33
+ // HERDR_ENV=1 + HERDR_PANE_ID mark a process running inside a herdr pane.
34
+ export function herdrPaneId(env: NodeJS.ProcessEnv = process.env): string | null {
35
+ if (env.HERDR_ENV !== "1") return null;
36
+ return env.HERDR_PANE_ID || null;
37
+ }
38
+
39
+ // True when this process should use the herdr presence backend: inside a
40
+ // herdr pane AND the server answers ping.
41
+ export async function herdrPresenceAvailable(
42
+ opts: HerdrClientOptions = {},
43
+ env: NodeJS.ProcessEnv = process.env,
44
+ ): Promise<boolean> {
45
+ if (!herdrPaneId(env)) return false;
46
+ return (await herdrAvailable(opts)) !== null;
47
+ }
48
+
49
+ // `<name> <pct>% q<depth>` truncated to the 32-char server cap, name first.
50
+ export function formatPeerStatus(name: string, contextUsedPct: number, queueDepth: number): string {
51
+ const s = `${name} ${Math.round(contextUsedPct)}% q${queueDepth}`;
52
+ return s.length <= CUSTOM_STATUS_MAX ? s : s.slice(0, CUSTOM_STATUS_MAX);
53
+ }
54
+
55
+ // Inverse of formatPeerStatus: the peer name is everything before the last
56
+ // ` <pct>% q<n>` tail (tolerates a name that was itself truncated).
57
+ export function parsePeerName(customStatus: string | undefined | null): string | null {
58
+ if (!customStatus) return null;
59
+ const m = customStatus.match(/^(.*?)\s+\d+%\s+q\d*$/);
60
+ const name = (m ? m[1] : customStatus).trim();
61
+ return name || null;
62
+ }
63
+
64
+ export type PresenceState = "idle" | "working" | "blocked" | "unknown";
65
+
66
+ export interface HerdrPresenceOptions extends HerdrClientOptions {
67
+ paneId: string;
68
+ // Identity herdr uses to arbitrate reporting authority (required by the
69
+ // API). Convention: `coms:<session_id>`.
70
+ source: string;
71
+ // Detected-agent label shown in the sidebar; pi peers report "pi".
72
+ agentLabel?: string;
73
+ }
74
+
75
+ // Reports this agent's state into its herdr pane. All calls are best-effort:
76
+ // presence must never break the session, so errors resolve false.
77
+ //
78
+ // Two wire calls per report (both idempotent): pane.report_agent carries the
79
+ // state and covers panes herdr's built-in detection does NOT recognize; for
80
+ // recognized panes (pi has a detection manifest) that call is accepted but
81
+ // IGNORED — detection holds agent authority — so pane.report_metadata carries
82
+ // the custom_status annotation that detection cannot provide. Measured live
83
+ // on herdr 0.7.1; see docs/plans/herdr/spike-notes.md.
84
+ export class HerdrPresence {
85
+ private opts: HerdrPresenceOptions;
86
+
87
+ constructor(opts: HerdrPresenceOptions) {
88
+ this.opts = opts;
89
+ }
90
+
91
+ async report(state: PresenceState, customStatus: string): Promise<boolean> {
92
+ const status = customStatus.slice(0, CUSTOM_STATUS_MAX);
93
+ const agent = this.opts.agentLabel ?? "pi";
94
+ let ok = false;
95
+ try {
96
+ await herdr.paneReportAgent(
97
+ { pane_id: this.opts.paneId, source: this.opts.source, agent, state, custom_status: status },
98
+ this.opts,
99
+ );
100
+ ok = true;
101
+ } catch {
102
+ // fall through — metadata may still land
103
+ }
104
+ try {
105
+ await herdr.paneReportMetadata(
106
+ {
107
+ pane_id: this.opts.paneId,
108
+ source: this.opts.source,
109
+ agent,
110
+ custom_status: status,
111
+ // Expire if this reporter dies without releasing: a bit over
112
+ // two keepalive cycles keeps the annotation fresh-or-gone.
113
+ ttl_ms: 90_000,
114
+ },
115
+ this.opts,
116
+ );
117
+ ok = true;
118
+ } catch {
119
+ // best-effort
120
+ }
121
+ return ok;
122
+ }
123
+
124
+ async release(): Promise<void> {
125
+ try {
126
+ await herdr.paneReleaseAgent(
127
+ { pane_id: this.opts.paneId, source: this.opts.source, agent: this.opts.agentLabel ?? "pi" },
128
+ this.opts,
129
+ );
130
+ } catch {
131
+ // best-effort
132
+ }
133
+ }
134
+ }
135
+
136
+ export interface HerdrAgentInfo {
137
+ pane_id: string;
138
+ agent?: string;
139
+ agent_status?: string;
140
+ custom_status?: string;
141
+ workspace_id?: string;
142
+ [key: string]: unknown;
143
+ }
144
+
145
+ export interface AgentWatchOptions extends HerdrClientOptions {
146
+ // Called with the full current agent set after every change (initial
147
+ // snapshot included). Consumers diff/join against their own state.
148
+ onChange: (agents: HerdrAgentInfo[]) => void;
149
+ // This process's own pane — excluded from the tracked set.
150
+ ownPaneId?: string | null;
151
+ onError?: (err: Error) => void;
152
+ reconnectDelayMs?: number;
153
+ }
154
+
155
+ // Push-driven view of the herdr agent population. start() takes an
156
+ // agent.list snapshot and opens the event stream; pane lifecycle events
157
+ // refresh the snapshot (and the per-pane subscription set).
158
+ export class HerdrAgentWatch {
159
+ private opts: AgentWatchOptions;
160
+ private agents = new Map<string, HerdrAgentInfo>();
161
+ private stream: SubscribeHandle | null = null;
162
+ private stopped = false;
163
+ private resyncTimer: ReturnType<typeof setTimeout> | null = null;
164
+ // Pane-id set the live stream was opened with. resync() only tears the
165
+ // stream down when the set actually changed — an unconditional resubscribe
166
+ // would loop forever through onConnect → resync → resubscribe → onConnect,
167
+ // hammering the server with stream churn (seen live: herdr pegged a core).
168
+ private subscribedKey: string | null = null;
169
+
170
+ constructor(opts: AgentWatchOptions) {
171
+ this.opts = opts;
172
+ }
173
+
174
+ current(): HerdrAgentInfo[] {
175
+ return [...this.agents.values()];
176
+ }
177
+
178
+ async start(): Promise<void> {
179
+ await this.resync();
180
+ }
181
+
182
+ stop(): void {
183
+ this.stopped = true;
184
+ this.stream?.close();
185
+ this.stream = null;
186
+ this.subscribedKey = null;
187
+ if (this.resyncTimer) clearTimeout(this.resyncTimer);
188
+ this.resyncTimer = null;
189
+ }
190
+
191
+ // Re-list agents, rebuild the subscription set if it changed, notify.
192
+ private async resync(): Promise<void> {
193
+ if (this.stopped) return;
194
+ try {
195
+ const { agents } = await herdr.agentList(this.opts);
196
+ this.agents.clear();
197
+ for (const a of agents as HerdrAgentInfo[]) {
198
+ const paneId = a.pane_id as string | undefined;
199
+ if (!paneId || paneId === this.opts.ownPaneId) continue;
200
+ this.agents.set(paneId, a);
201
+ }
202
+ } catch (err) {
203
+ this.opts.onError?.(err as Error);
204
+ }
205
+ const key = [...this.agents.keys()].sort().join("\n");
206
+ if (this.stream === null || key !== this.subscribedKey) this.resubscribe(key);
207
+ this.opts.onChange(this.current());
208
+ }
209
+
210
+ // Debounced resync: lifecycle events often arrive in bursts (layout.apply
211
+ // creates N panes); one refresh after the burst is enough.
212
+ private scheduleResync(): void {
213
+ if (this.stopped || this.resyncTimer) return;
214
+ this.resyncTimer = setTimeout(() => {
215
+ this.resyncTimer = null;
216
+ void this.resync();
217
+ }, 250);
218
+ }
219
+
220
+ private resubscribe(key: string): void {
221
+ this.stream?.close();
222
+ this.subscribedKey = null;
223
+ if (this.stopped) return;
224
+ const subs: Subscription[] = [
225
+ { type: "pane.created" },
226
+ { type: "pane.closed" },
227
+ { type: "pane.exited" },
228
+ { type: "workspace.closed" },
229
+ ];
230
+ for (const paneId of this.agents.keys()) {
231
+ subs.push({ type: "pane.agent_status_changed", pane_id: paneId });
232
+ }
233
+ // The ack of THIS deliberately opened stream must not resync: the
234
+ // snapshot is milliseconds old, and resyncing here restarts the
235
+ // subscribe/close loop. Only a genuine drop + reconnect (events
236
+ // possibly missed while disconnected) warrants a fresh snapshot.
237
+ let initialAck = true;
238
+ this.stream = subscribe(subs, (ev) => this.handleEvent(ev.event, ev.data), {
239
+ socketPath: this.opts.socketPath,
240
+ reconnectDelayMs: this.opts.reconnectDelayMs,
241
+ onError: this.opts.onError,
242
+ onConnect: () => {
243
+ if (initialAck) {
244
+ initialAck = false;
245
+ return;
246
+ }
247
+ this.scheduleResync();
248
+ },
249
+ });
250
+ this.subscribedKey = key;
251
+ }
252
+
253
+ private handleEvent(event: string, data: Record<string, unknown>): void {
254
+ const paneId = data.pane_id as string | undefined;
255
+ switch (event) {
256
+ case "pane.agent_status_changed": {
257
+ if (!paneId) return;
258
+ const existing = this.agents.get(paneId);
259
+ if (existing) {
260
+ existing.agent_status = data.agent_status as string;
261
+ if (typeof data.agent === "string") existing.agent = data.agent;
262
+ if (typeof data.custom_status === "string") existing.custom_status = data.custom_status;
263
+ this.opts.onChange(this.current());
264
+ } else {
265
+ // Status for a pane we don't track yet (e.g. agent detected
266
+ // after creation) — refresh the snapshot.
267
+ this.scheduleResync();
268
+ }
269
+ return;
270
+ }
271
+ case "pane.closed":
272
+ case "pane.exited": {
273
+ if (paneId && this.agents.delete(paneId)) {
274
+ this.opts.onChange(this.current());
275
+ }
276
+ // The pane set changed either way — resubscribe without the
277
+ // dead pane (and catch anything created meanwhile).
278
+ this.scheduleResync();
279
+ return;
280
+ }
281
+ case "pane.created":
282
+ case "workspace.closed": {
283
+ this.scheduleResync();
284
+ return;
285
+ }
286
+ }
287
+ }
288
+ }
@@ -0,0 +1,28 @@
1
+ import { herdr, subscribe, type HerdrClientOptions, type SubscribeHandle } from "./herdr-client.ts";
2
+
3
+ export interface HubCorrelation { workspaceId?: string; hubPaneId?: string; status: "correlated" | "uncorrelated" | "reconnecting"; }
4
+
5
+ export async function correlateHubPane(env: NodeJS.ProcessEnv = process.env, opts: HerdrClientOptions = {}): Promise<HubCorrelation> {
6
+ const hubPaneId = env.HERDR_PANE_ID;
7
+ if (env.HERDR_ENV !== "1" || !hubPaneId) return { status: "uncorrelated" };
8
+ try { const { pane } = await herdr.paneGet(hubPaneId, { socketPath: env.HERDR_SOCKET_PATH, ...opts }); return { workspaceId: pane.workspace_id, hubPaneId, status: "correlated" }; }
9
+ catch { return { hubPaneId, status: "reconnecting" }; }
10
+ }
11
+
12
+ export function watchHubMonitor(options: { env?: NodeJS.ProcessEnv; onStatus: (value: HubCorrelation) => void; onOutput?: (output: { sequence: number; text: string }) => void; initialCursor?: number; reconnectDelayMs?: number }): SubscribeHandle | null {
13
+ const env = options.env ?? process.env;
14
+ const paneId = env.HERDR_PANE_ID;
15
+ if (env.HERDR_ENV !== "1" || !paneId) { options.onStatus({ status: "uncorrelated" }); return null; }
16
+ let cursor = options.initialCursor ?? 0;
17
+ const refresh = async () => {
18
+ try {
19
+ const { pane } = await herdr.paneGet(paneId, { socketPath: env.HERDR_SOCKET_PATH });
20
+ options.onStatus({ workspaceId: pane.workspace_id, hubPaneId: paneId, status: "correlated" });
21
+ const output = (pane as { monitor_resync_output?: { sequence?: number; text?: string } }).monitor_resync_output;
22
+ if (output && typeof output.sequence === "number" && output.sequence > cursor && typeof output.text === "string") { cursor = output.sequence; options.onOutput?.({ sequence: output.sequence, text: output.text }); }
23
+ } catch { options.onStatus({ hubPaneId: paneId, status: "reconnecting" }); }
24
+ };
25
+ void refresh();
26
+ let connected = false;
27
+ return subscribe([{ type: "pane.agent_status_changed", pane_id: paneId }], () => void refresh(), { socketPath: env.HERDR_SOCKET_PATH, reconnectDelayMs: options.reconnectDelayMs, onConnect: () => { if (connected) options.onStatus({ hubPaneId: paneId, status: "reconnecting" }); connected = true; void refresh(); }, onError: () => options.onStatus({ hubPaneId: paneId, status: "reconnecting" }) });
28
+ }
@@ -0,0 +1,9 @@
1
+ export type MonitorTaskState = "starting" | "running" | "cancelling" | "completed" | "blocked" | "failed" | "cancelled" | "orphaned" | "recovering";
2
+ export const TERMINAL_TASK_STATES = new Set<MonitorTaskState>(["completed","blocked","failed","cancelled","orphaned"]);export type MonitorTaskKind="parent"|"child";
3
+ export interface MonitorTask{id:string;generation:number;kind:MonitorTaskKind;state:MonitorTaskState;parentId?:string;parentGeneration?:number;hubInstanceId?:string;checkoutId?:string;specialist?:string;workspaceId?:string;hubPaneId?:string;ownerSessionId?:string;ownerLeaseExpiresAt?:string;}
4
+ export interface CreateParentTaskInput{id:string;generation:number;hubInstanceId:string;checkoutId:string;ownerSessionId?:string;ownerLeaseExpiresAt?:string;}
5
+ export interface CreateChildTaskInput{id:string;generation:number;parentId:string;parentGeneration:number;specialist:string;workspaceId?:string;hubPaneId?:string;ownerSessionId?:string;ownerLeaseExpiresAt?:string;}
6
+ function requireStableIdentity(id:string,generation:number){if(!id)throw Error("task id is required");if(!Number.isInteger(generation)||generation<1)throw Error("task generation must be a positive integer");}const owner=(i:any)=>({...((i.ownerSessionId)?{ownerSessionId:i.ownerSessionId}:{}),...((i.ownerLeaseExpiresAt)?{ownerLeaseExpiresAt:i.ownerLeaseExpiresAt}:{})});
7
+ export function createParentTask(input:CreateParentTaskInput):MonitorTask{requireStableIdentity(input.id,input.generation);if(!input.hubInstanceId||!input.checkoutId)throw Error("parent correlation is required");return{id:input.id,generation:input.generation,kind:"parent",state:"starting",hubInstanceId:input.hubInstanceId,checkoutId:input.checkoutId,...owner(input)};}
8
+ export function createChildTask(input:CreateChildTaskInput):MonitorTask{requireStableIdentity(input.id,input.generation);if(!input.parentId||!Number.isInteger(input.parentGeneration)||input.parentGeneration<1||!input.specialist)throw Error("child hierarchy is required");return{id:input.id,generation:input.generation,kind:"child",state:"starting",parentId:input.parentId,parentGeneration:input.parentGeneration,specialist:input.specialist,...(input.workspaceId?{workspaceId:input.workspaceId}:{}),...(input.hubPaneId?{hubPaneId:input.hubPaneId}:{}),...owner(input)};}
9
+ export function transitionTask(task:MonitorTask,state:MonitorTaskState):MonitorTask{if(TERMINAL_TASK_STATES.has(task.state))throw Error(`terminal task ${task.id} cannot mutate`);if(state==="starting")throw Error("tasks cannot transition back to starting");return{...task,state};}export function continueTask(task:MonitorTask):MonitorTask{if(task.state!=="blocked")throw Error(`only blocked task ${task.id} can continue`);return{...task,generation:task.generation+1,state:"starting"};}
@@ -0,0 +1,6 @@
1
+ import * as crypto from "node:crypto"; import * as fs from "node:fs"; import * as path from "node:path";
2
+ export interface MonitorRegistration {profileKey:string;namespacePath:string;socketPath:string;socketDir:string;token:string;namespaceMode:number;tokenMode:number;discoveryPath:string;snapshot():unknown;cancel?(r:{taskId:string;generation:number}):unknown|Promise<unknown>;output?(r:{taskId:string;generation:number;afterSequence:number}):unknown|Promise<unknown>;cleanup():void;renew():void;leaseMs:number;ownerId?:string;leaseExpiresAt?:string;}
3
+ export interface MonitorRegistryOptions {runtimeDir:string;now?:()=>Date;pid?:number;leaseMs?:number;beforeRenewPublish?:()=>void;} export interface RegisterMonitorInput {profilePath:string;profileId?:string;hubInstanceId:string;snapshot:()=>unknown;}
4
+ const D=0o700,F=0o600;const validDiscovery=(d:any)=>typeof d?.owner==="string"&&/^[0-9a-f-]{36}$/i.test(d.owner)&&typeof d.token==="string"&&/^token-[0-9a-f-]{36}$/i.test(d.token)&&typeof d.socket==="string"&&/^@runtime\/s\/[a-f0-9]+\/s$/.test(d.socket)&&typeof d.lease?.hub==="string"&&/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(d.lease.hub)&&Number.isInteger(d.lease?.pid)&&d.lease.pid>0&&typeof d.lease?.startedAt==="string"&&!Number.isNaN(Date.parse(d.lease.startedAt))&&typeof d.lease?.expiresAt==="string"&&!Number.isNaN(Date.parse(d.lease.expiresAt));const mode=(p:string)=>fs.statSync(p).mode&0o777;function dir(p:string){if(!path.isAbsolute(p))throw Error("monitor runtime directory must be absolute");fs.mkdirSync(p,{recursive:true,mode:D});if(fs.lstatSync(p).isSymbolicLink())throw Error("monitor runtime directory must not be a symlink");fs.chmodSync(p,D);}export function canonicalMonitorProfileId(id:string){if(!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(id)||id.includes(".."))throw Error("monitor profile id is unsafe");return crypto.createHash("sha256").update(id).digest("hex");}function profile(p:string,id?:string){if(id)return canonicalMonitorProfileId(id);const real=fs.realpathSync(p);if(!fs.statSync(real).isDirectory())throw Error("monitor profile path must be a directory");return crypto.createHash("sha256").update(real).digest("hex");}function hub(id:string){if(!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(id)||id.includes(".."))throw Error("hub instance id is unsafe");return crypto.createHash("sha256").update(id).digest("hex");}function atomic(p:string,s:string){const t=`${p}.${process.pid}.${crypto.randomBytes(4).toString("hex")}.tmp`;fs.writeFileSync(t,s,{mode:F,flag:"wx"});fs.chmodSync(t,F);fs.renameSync(t,p);}
5
+ export class MonitorRegistry {private runtimeDir:string;private now:()=>Date;private pid:number;private leaseMs:number;private beforeRenewPublish?:()=>void;constructor(o:MonitorRegistryOptions){this.runtimeDir=o.runtimeDir;this.now=o.now??(()=>new Date());this.pid=o.pid??process.pid;this.leaseMs=o.leaseMs??30_000;this.beforeRenewPublish=o.beforeRenewPublish;dir(this.runtimeDir);}register(input:RegisterMonitorInput):MonitorRegistration{const key=profile(input.profilePath,input.profileId),h=hub(input.hubInstanceId),ns=path.join(this.runtimeDir,key,h);dir(path.join(this.runtimeDir,key));dir(ns);for(const file of fs.readdirSync(ns).filter(x=>x.startsWith("discovery-"))){const discoveryPath=path.join(ns,file);try{const d=JSON.parse(fs.readFileSync(discoveryPath,"utf8"));if(!validDiscovery(d)||d.token!==`token-${d.owner}`||d.socket!==`@runtime/s/${crypto.createHash("sha256").update(`${key}:${h}:${d.owner}`).digest("hex").slice(0,32)}/s`)throw new Error("monitor discovery metadata is malformed");if(new Date(d.lease?.expiresAt).getTime()>this.now().getTime()){const error:any=Error("monitor namespace is owned by an active lease");error.leaseExpiresAt=d.lease.expiresAt;throw error;}const tokenName=d.token;if(typeof tokenName==="string"&&/^token-[0-9a-f-]+$/.test(tokenName))try{fs.unlinkSync(path.join(ns,tokenName))}catch(e:any){if(e?.code!=="ENOENT")throw e;}fs.unlinkSync(discoveryPath);const socket=typeof d.socket==="string"?d.socket:"";if(socket.startsWith("@runtime/s/")&&socket.endsWith("/s")){const socketDir=path.join(this.runtimeDir,socket.slice("@runtime/".length,-2));if(socketDir.startsWith(path.join(this.runtimeDir,"s")+path.sep))try{fs.rmSync(socketDir,{recursive:true,force:true})}catch{}}}catch(e:any){if(/active lease|malformed/.test(String(e)))throw e;if(e instanceof SyntaxError||e instanceof TypeError||e instanceof RangeError)throw new Error("monitor discovery metadata is malformed");}}
6
+ const owner=crypto.randomUUID(),socketDir=path.join(this.runtimeDir,"s",crypto.createHash("sha256").update(`${key}:${h}:${owner}`).digest("hex").slice(0,32));dir(socketDir);const tokenPath=path.join(ns,`token-${owner}`),discoveryPath=path.join(ns,`discovery-${owner}.json`),socketPath=path.join(socketDir,"s"),token=crypto.randomBytes(32).toString("hex"),started=this.now();atomic(tokenPath,token);const tokenFd=fs.openSync(tokenPath,"r");const write=(issued:Date)=>atomic(discoveryPath,JSON.stringify({owner,socket:`@runtime/s/${path.basename(socketDir)}/s`,token:path.basename(tokenPath),lease:{hub:input.hubInstanceId,pid:this.pid,startedAt:started.toISOString(),expiresAt:new Date(issued.getTime()+this.leaseMs).toISOString()}}));write(started);const owns=()=>{try{return fs.fstatSync(tokenFd).nlink===1&&fs.readFileSync(tokenPath,"utf8")===token&&JSON.parse(fs.readFileSync(discoveryPath,"utf8")).owner===owner;}catch{return false;}};const cleanup=()=>{if(!owns())return;for(const p of [tokenPath,discoveryPath])try{fs.unlinkSync(p)}catch(e:any){if(e?.code!=="ENOENT")throw e;}finally{try{fs.closeSync(tokenFd)}catch{}}};return{profileKey:key,ownerId:owner,leaseExpiresAt:new Date(started.getTime()+this.leaseMs).toISOString(),namespacePath:ns,socketPath,socketDir,token,namespaceMode:mode(ns),tokenMode:mode(tokenPath),discoveryPath,snapshot:input.snapshot,cleanup,renew:()=>{if(!owns())throw Error("monitor ownership lost");this.beforeRenewPublish?.();if(!owns())throw Error("monitor ownership lost");const renewedAt=this.now();write(renewedAt);if(!owns()){try{if(JSON.parse(fs.readFileSync(discoveryPath,"utf8")).owner===owner)fs.unlinkSync(discoveryPath)}catch{}throw Error("monitor ownership lost");}return{leaseExpiresAt:new Date(renewedAt.getTime()+this.leaseMs).toISOString()};},leaseMs:this.leaseMs};} evidenceForOwner(ownerId:string,hubInstanceId:string){try{if(!/^[0-9a-f-]{36}$/i.test(ownerId))throw Error("malformed");const h=hub(hubInstanceId);for(const profileKey of fs.readdirSync(this.runtimeDir)){const p=path.join(this.runtimeDir,profileKey,h,`discovery-${ownerId}.json`);if(!fs.existsSync(p))continue;const d=JSON.parse(fs.readFileSync(p,"utf8"));if(!validDiscovery(d)||d.owner!==ownerId||d.token!==`token-${ownerId}`)throw Error("malformed");const token=path.join(path.dirname(p),d.token),socket=path.join(this.runtimeDir,d.socket.slice("@runtime/".length));return{owner:fs.existsSync(token),socket:fs.existsSync(socket),session:fs.existsSync(token),expired:new Date(d.lease.expiresAt).getTime()<=this.now().getTime()};}return{owner:false,socket:false,session:false,expired:true};}catch(error){return{transient:true,error};}}}
@@ -0,0 +1,118 @@
1
+ import * as crypto from "node:crypto";
2
+ import * as fs from "node:fs";
3
+ import * as net from "node:net";
4
+ import * as path from "node:path";
5
+
6
+ import type { MonitorRegistration } from "./hermes-monitor-registry.ts";
7
+
8
+ export const MAX_SOCKET_FRAME_BYTES = 64 * 1024;
9
+ export const MAX_SNAPSHOT_BYTES = 256 * 1024;
10
+ export const MAX_CANCEL_RESPONSE_BYTES = 16 * 1024;
11
+ export const PARTIAL_FRAME_TIMEOUT_MS = 1000;
12
+ export const MAX_SOCKET_CONNECTIONS = 32;
13
+ export const MAX_TASK_ID_LENGTH = 128;
14
+ export const MAX_AFTER_SEQUENCE = 1_000_000_000;
15
+ /** 2 MiB covers the 256 KiB retained UTF-8 output after worst-case JSON escaping plus its envelope. */
16
+ export const MAX_OUTPUT_RESPONSE_BYTES = 2 * 1024 * 1024;
17
+
18
+ interface SnapshotRequest {
19
+ type: "snapshot";
20
+ token: string;
21
+ }
22
+
23
+ function authorized(actual: string, expected: string): boolean {
24
+ const actualBytes = Buffer.from(actual);
25
+ const expectedBytes = Buffer.from(expected);
26
+ return actualBytes.length === expectedBytes.length && crypto.timingSafeEqual(actualBytes, expectedBytes);
27
+ }
28
+
29
+ function validTaskRequest(taskId: unknown, generation: unknown, afterSequence?: unknown): boolean { return typeof taskId === "string" && /^[A-Za-z0-9][A-Za-z0-9._:-]*$/.test(taskId) && taskId.length <= MAX_TASK_ID_LENGTH && Number.isInteger(generation) && (generation as number) >= 1 && (afterSequence === undefined || (Number.isInteger(afterSequence) && (afterSequence as number) >= 0 && (afterSequence as number) <= MAX_AFTER_SEQUENCE)); }
30
+
31
+ function parseRequest(frame: string): SnapshotRequest | null {
32
+ try {
33
+ const value = JSON.parse(frame) as Partial<SnapshotRequest>;
34
+ if (value.type !== "snapshot" || typeof value.token !== "string") return null;
35
+ return { type: "snapshot", token: value.token };
36
+ } catch {
37
+ return null;
38
+ }
39
+ }
40
+
41
+ export class MonitorSocketServer {
42
+ private readonly registration: MonitorRegistration;
43
+ private readonly server: net.Server;
44
+ private connections = 0;
45
+
46
+ constructor(registration: MonitorRegistration) {
47
+ this.registration = registration;
48
+ this.server = net.createServer((socket) => {
49
+ if (this.connections >= MAX_SOCKET_CONNECTIONS) { socket.destroy(); return; }
50
+ this.connections += 1;
51
+ socket.once("close", () => { this.connections -= 1; });
52
+ this.handle(socket);
53
+ });
54
+ }
55
+
56
+ private assertOwnedSocketPath(): void {
57
+ if (!this.registration.socketDir || path.resolve(this.registration.socketPath) !== path.join(path.resolve(this.registration.socketDir), "s")) throw new Error("monitor socket path is not registry-owned");
58
+ if (fs.lstatSync(this.registration.socketDir).isSymbolicLink() || (fs.statSync(this.registration.socketDir).mode & 0o777) !== 0o700) throw new Error("monitor socket directory is unsafe");
59
+ }
60
+ private async removeVerifiedStaleSocket(): Promise<void> {
61
+ this.assertOwnedSocketPath(); if (!fs.existsSync(this.registration.socketPath)) return;
62
+ const active=await new Promise<boolean>(resolve=>{const probe=net.createConnection(this.registration.socketPath);probe.once("connect",()=>{probe.destroy();resolve(true);});probe.once("error",()=>resolve(false));});
63
+ if (active) throw new Error("monitor socket is already active");
64
+ if (fs.lstatSync(this.registration.socketPath).isSymbolicLink()) throw new Error("monitor socket must not be a symlink"); fs.unlinkSync(this.registration.socketPath);
65
+ }
66
+ async listen(): Promise<void> {
67
+ await this.removeVerifiedStaleSocket(); return new Promise((resolve, reject) => { this.server.once("error", reject); this.server.listen(this.registration.socketPath, () => { this.server.off("error", reject); fs.chmodSync(this.registration.socketPath, 0o600); resolve(); }); });
68
+ }
69
+
70
+ async close(): Promise<void> {
71
+ await new Promise<void>((resolve, reject) => this.server.close((error) => error ? reject(error) : resolve()));
72
+ this.assertOwnedSocketPath(); try { fs.unlinkSync(this.registration.socketPath); } catch (error: any) { if (error?.code !== "ENOENT") throw error; }
73
+ }
74
+
75
+ mode(): number {
76
+ return fs.statSync(this.registration.socketPath).mode & 0o777;
77
+ }
78
+
79
+ private handle(socket: net.Socket): void {
80
+ let buffer = "";
81
+ let handled = false;
82
+ const deadline = setTimeout(() => { if (!handled) socket.destroy(); }, PARTIAL_FRAME_TIMEOUT_MS);
83
+ socket.on("data", (chunk) => {
84
+ if (handled) return;
85
+ buffer += chunk.toString("utf8");
86
+ if (Buffer.byteLength(buffer, "utf8") > MAX_SOCKET_FRAME_BYTES) {
87
+ socket.destroy();
88
+ return;
89
+ }
90
+ const newline = buffer.indexOf("\n");
91
+ if (newline < 0) return;
92
+ handled = true;
93
+ const request = parseRequest(buffer.slice(0, newline));
94
+ clearTimeout(deadline);
95
+ let value: { type?: string; token?: string; taskId?: string; generation?: number };
96
+ try { value = JSON.parse(buffer.slice(0, newline)) as typeof value; } catch { socket.destroy(); return; }
97
+ if (value.type === "output") {
98
+ if (!authorized(String(value.token ?? ""), this.registration.token)) { socket.end(JSON.stringify({ ok: false, error: "unauthorized" }) + "\n"); return; }
99
+ if (!this.registration.output || (value as any).afterSequence === undefined || !validTaskRequest(value.taskId, value.generation, (value as any).afterSequence)) { socket.destroy(); return; }
100
+ Promise.resolve().then(()=>this.registration.output!({ taskId: value.taskId!, generation: value.generation!, afterSequence: (value as any).afterSequence })).then((output) => { const body=JSON.stringify({ ok:true, output }); if(Buffer.byteLength(body)>MAX_OUTPUT_RESPONSE_BYTES) socket.end(JSON.stringify({ok:false,error:"response_too_large"})+"\n"); else socket.end(body+"\n"); }).catch(()=>socket.end(JSON.stringify({ok:false,error:"monitor_unavailable"})+"\n")); return;
101
+ }
102
+ if (value.type === "cancel") {
103
+ if (!authorized(String(value.token ?? ""), this.registration.token)) { socket.end(JSON.stringify({ ok: false, error: "unauthorized" }) + "\n"); return; }
104
+ if (!this.registration.cancel || !validTaskRequest(value.taskId, value.generation)) { socket.destroy(); return; }
105
+ Promise.resolve().then(()=>this.registration.cancel!({ taskId: value.taskId!, generation: value.generation! })).then((result) => { const body=JSON.stringify({ ok: true, result }); if (Buffer.byteLength(body, "utf8") > MAX_CANCEL_RESPONSE_BYTES) socket.end(JSON.stringify({ok:false,error:"response_too_large"})+"\n"); else socket.end(body + "\n"); }).catch(()=>socket.end(JSON.stringify({ok:false,error:"monitor_unavailable"})+"\n")); return;
106
+ }
107
+ if (!request || !authorized(request.token, this.registration.token)) {
108
+ if (request) socket.end(JSON.stringify({ ok: false, error: "unauthorized" }) + "\n");
109
+ else socket.destroy();
110
+ return;
111
+ }
112
+ try { const response = JSON.stringify({ ok: true, snapshot: this.registration.snapshot() }); if (Buffer.byteLength(response, "utf8") > MAX_SNAPSHOT_BYTES) socket.end(JSON.stringify({ok:false,error:"response_too_large"})+"\n"); else socket.end(response + "\n"); } catch { socket.end(JSON.stringify({ok:false,error:"monitor_unavailable"})+"\n"); }
113
+ });
114
+ socket.on("end", () => {
115
+ if (!handled) socket.destroy();
116
+ });
117
+ }
118
+ }
@@ -0,0 +1,31 @@
1
+ import { createChildTask, createParentTask, type CreateChildTaskInput, type CreateParentTaskInput, type MonitorTask } from "./hermes-monitor-model.ts";
2
+ export const MAX_OUTPUT_BYTES=256*1024;
3
+ export const MONITOR_RETENTION_MS=7*24*60*60*1000;
4
+ export const MONITOR_RETENTION_MAX=200;
5
+ const terminal=new Set(["completed","blocked","failed","cancelled","orphaned","done"]);
6
+ const active=(state:string)=>state==="starting"||state==="running"||state==="cancelling"||state==="recovering";
7
+ export function pruneMonitorTasks<T extends {state:string;updatedAt?:string}>(options:{now:Date;tasks:T[]}):T[]{const cutoff=options.now.getTime()-MONITOR_RETENTION_MS;const running=options.tasks.filter(t=>active(t.state));const terminalTasks=options.tasks.filter(t=>!active(t.state)&&(!t.updatedAt||new Date(t.updatedAt).getTime()>=cutoff)).sort((a,b)=>new Date(a.updatedAt??0).getTime()-new Date(b.updatedAt??0).getTime()).slice(-MONITOR_RETENTION_MAX);return [...running,...terminalTasks];}
8
+ export interface MonitorOutput{text:string;sequence:number;firstSequence:number;truncated:boolean}
9
+ interface StoredOutput{chunks:{sequence:number;text:string}[];sequence:number;truncated:boolean}
10
+ interface StoredTask{task:MonitorTask;output:StoredOutput;createdAt:string;updatedAt:string}
11
+ function suffix(text:string,limit:number){let bytes=0;const chars:string[]=[];for(const char of Array.from(text).reverse()){const size=Buffer.byteLength(char);if(bytes+size>limit)break;chars.push(char);bytes+=size;}return chars.reverse().join("");}
12
+
13
+ export class MonitorStore {
14
+ private readonly tasks=new Map<string,StoredTask>(); private readonly now:()=>Date;
15
+ constructor(options:{now?:()=>Date}={}){this.now=options.now??(()=>new Date());}
16
+ private key(id:string,generation:number){return `${id}:${generation}`;} private stamp(){return this.now().toISOString();}
17
+ createParent(input:CreateParentTaskInput){return this.add(createParentTask(input));}
18
+ createChild(input:CreateChildTaskInput){if(![...this.tasks.values()].some(s=>s.task.id===input.parentId&&s.task.generation===input.parentGeneration&&s.task.kind==="parent"))throw new Error(`parent task ${input.parentId} was not found`);return this.add(createChildTask(input));}
19
+ patch(id:string,generation:number,values:any){const stored=this.require(id,generation);Object.assign(stored.task,values);stored.updatedAt=this.stamp();return stored.task;}
20
+ transition(id:string,generation:number,state:any){const stored=this.require(id,generation);if(terminal.has(stored.task.state))throw new Error("terminal transition");stored.task.state=state;stored.updatedAt=this.stamp();return stored.task;}
21
+ get(id:string,generation?:number){return generation===undefined?[...this.tasks.values()].find(s=>s.task.id===id)?.task:this.tasks.get(this.key(id,generation))?.task;}
22
+ appendPublicOutput(id:string,generation:number,text:string){const stored=this.require(id,generation);if(terminal.has(stored.task.state))throw new Error("terminal output");const sequence=stored.output.sequence+1, chunk=suffix(text,MAX_OUTPUT_BYTES),chunks=[...stored.output.chunks,{sequence,text:chunk}];let bytes=chunks.reduce((n,c)=>n+Buffer.byteLength(c.text),0),truncated=stored.output.truncated||bytes<Buffer.byteLength(text);while(bytes>MAX_OUTPUT_BYTES&&chunks.length>1){bytes-=Buffer.byteLength(chunks.shift()!.text);truncated=true;}stored.output={chunks,sequence,truncated};stored.updatedAt=this.stamp();return this.outputAfter(stored.output,0);}
23
+ readOutput(id:string,generation:number,afterSequence:number){return this.outputAfter(this.require(id,generation).output,afterSequence);}
24
+ snapshot(){return {tasks:[...this.tasks.values()].map(s=>this.publicTask(s))};} durableSnapshot(){return{tasks:[...this.tasks.values()].map(s=>({...this.publicTask(s),outputChunks:s.output.chunks.map(c=>({...c}),),outputLatestSequence:s.output.sequence,outputFirstSequence:s.output.chunks[0]?.sequence??0,outputTruncated:s.output.truncated}))};} restore(rows:any[]){for(const row of rows){const key=this.key(row.id,row.generation);if(this.tasks.has(key))continue;const output=row.output??"";this.tasks.set(key,{task:{...row},output:{chunks:Array.isArray(row.outputChunks)?row.outputChunks.map((c:any)=>({sequence:c.sequence,text:c.text})):output?[{sequence:row.outputSequence??1,text:output}]:[],sequence:row.outputLatestSequence??row.outputSequence??0,truncated:row.outputTruncated??!!row.truncated},createdAt:row.createdAt??this.stamp(),updatedAt:row.updatedAt??this.stamp()});}}
25
+ prune(now=this.now()){const cutoff=now.getTime()-MONITOR_RETENTION_MS;const values=[...this.tasks.values()];const protectedIds=new Set<string>();for(const s of values)if(active(s.task.state)){protectedIds.add(this.key(s.task.id,s.task.generation));if(s.task.parentId)for(const p of values)if(p.task.id===s.task.parentId)protectedIds.add(this.key(p.task.id,p.task.generation));for(const c of values)if(c.task.parentId===s.task.id)protectedIds.add(this.key(c.task.id,c.task.generation));}const candidates=values.filter(s=>!active(s.task.state)&&!protectedIds.has(this.key(s.task.id,s.task.generation))).sort((a,b)=>Date.parse(a.updatedAt)-Date.parse(b.updatedAt));const expired=candidates.filter(s=>Date.parse(s.updatedAt)<cutoff);for(const s of expired)this.tasks.delete(this.key(s.task.id,s.task.generation));const remaining=[...this.tasks.values()].filter(s=>!active(s.task.state)&&!protectedIds.has(this.key(s.task.id,s.task.generation))).sort((a,b)=>Date.parse(a.updatedAt)-Date.parse(b.updatedAt));while(remaining.length>MONITOR_RETENTION_MAX){const oldest=remaining.shift()!;this.tasks.delete(this.key(oldest.task.id,oldest.task.generation));}return this.snapshot();}
26
+ private add(task:MonitorTask){const key=this.key(task.id,task.generation);if(this.tasks.has(key))throw new Error(`task ${task.id} generation ${task.generation} already exists`);const stamp=this.stamp();this.tasks.set(key,{task,output:{chunks:[],sequence:0,truncated:false},createdAt:stamp,updatedAt:stamp});return task;}
27
+ private publicTask(s:StoredTask){const output=this.outputAfter(s.output,0);return {...s.task,createdAt:s.createdAt,updatedAt:s.updatedAt,outputSequence:output.sequence,firstSequence:output.firstSequence,truncated:output.truncated};}
28
+ private outputAfter(output:StoredOutput,after:number):MonitorOutput{return{text:output.chunks.filter(c=>c.sequence>after).map(c=>c.text).join(""),sequence:output.sequence,firstSequence:output.chunks[0]?.sequence??0,truncated:output.truncated};}
29
+ private require(id:string,generation:number){const stored=this.tasks.get(this.key(id,generation));if(!stored)throw new Error(`task ${id} generation ${generation} was not found`);return stored;}
30
+ }
31
+ export function createMonitorStore(options:{now:()=>Date}){const store=new MonitorStore(options);const baseSnapshot=store.snapshot.bind(store);return Object.assign(store,{snapshot(){const all=(baseSnapshot() as any).tasks;return{tasks:all.filter((t:any)=>t.kind==='parent').map((parent:any)=>({id:parent.id,generation:parent.generation,children:all.filter((child:any)=>child.parentId===parent.id).map((child:any)=>({id:child.id,generation:child.generation,state:child.state,workspaceId:child.workspaceId,hubPaneId:child.hubPaneId,outputSequence:child.outputSequence,updatedAt:child.updatedAt}))}))};}});}
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "agent-fleet-pi-harnesses-runtime-deps",
3
+ "lockfileVersion": 3,
4
+ "requires": true,
5
+ "packages": {
6
+ "": {
7
+ "name": "agent-fleet-pi-harnesses-runtime-deps",
8
+ "dependencies": {
9
+ "@sinclair/typebox": "^0.34.0",
10
+ "yaml": "^2.8.0"
11
+ }
12
+ },
13
+ "node_modules/@sinclair/typebox": {
14
+ "version": "0.34.49",
15
+ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.49.tgz",
16
+ "integrity": "sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==",
17
+ "license": "MIT"
18
+ },
19
+ "node_modules/yaml": {
20
+ "version": "2.9.0",
21
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
22
+ "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
23
+ "license": "ISC",
24
+ "bin": {
25
+ "yaml": "bin.mjs"
26
+ },
27
+ "engines": {
28
+ "node": ">= 14.6"
29
+ },
30
+ "funding": {
31
+ "url": "https://github.com/sponsors/eemeli"
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "agent-fleet-pi-harnesses-runtime-deps",
3
+ "private": true,
4
+ "type": "module",
5
+ "dependencies": {
6
+ "@sinclair/typebox": "^0.34.0",
7
+ "yaml": "^2.8.0"
8
+ }
9
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Implement the next task incrementally — build, test, verify, request review
3
+ ---
4
+
5
+ Load and follow the `incremental-implementation` and `test-driven-development` skills before proceeding.
6
+
7
+ Pick the next pending task from the plan. For each task:
8
+
9
+ 1. Read the task's acceptance criteria
10
+ 2. Load relevant context (existing code, patterns, types)
11
+ 3. Write a failing test for the expected behavior (RED)
12
+ 4. Implement the minimum code to pass the test (GREEN)
13
+ 5. Run the full test suite to check for regressions
14
+ 6. Run the build to verify compilation
15
+ 7. Present the Standard Slice Summary and ask the user to choose between:
16
+ - **Approve & continue** — proceed to the next slice
17
+ - **Request changes** — revise within the same slice, then re-summarize and re-ask
18
+ - **Compact & continue** — call `request_compaction` (from the `compact-and-continue` extension) with a self-contained `continuationPrompt` describing the remaining slices and the next concrete action, then end the turn so compaction runs; pi will auto-resume from the continuation prompt
19
+ - **Stop here** — leave changes unstaged and end the session
20
+ Use the `ask_user` tool (from `pi-ask-user`) when available; otherwise ask in chat. Wait for an explicit choice — do not proceed on silence. If the `request_compaction` tool is not registered (extension not installed), omit the "Compact & continue" option.
21
+ 8. Leave changes unstaged; the user handles staging and commits manually
22
+ 9. Mark the task complete and move to the next one only after approval
23
+
24
+ If any step fails, load and follow the `debugging-and-error-recovery` skill.
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: Simplify code for clarity and maintainability — reduce complexity without changing behavior
3
+ ---
4
+
5
+ Load and follow the `code-simplification` skill before proceeding.
6
+
7
+ Simplify recently changed code (or the specified scope) while preserving exact behavior:
8
+
9
+ 1. Read the repository agent guide and study project conventions
10
+ 2. Identify the target code — recent changes unless a broader scope is specified
11
+ 3. Understand the code's purpose, callers, edge cases, and test coverage before touching it
12
+ 4. Scan for simplification opportunities:
13
+ - Deep nesting → guard clauses or extracted helpers
14
+ - Long functions → split by responsibility
15
+ - Nested ternaries → if/else or switch
16
+ - Generic names → descriptive names
17
+ - Duplicated logic → shared functions
18
+ - Dead code → remove after confirming
19
+ 5. Apply each simplification incrementally — run tests after each change
20
+ 6. Verify all tests pass, the build succeeds, and the diff is clean
21
+
22
+ If tests fail after a simplification, revert that change and reconsider. Load and follow `code-review-and-quality` to review the result.
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: Break work into small verifiable tasks with acceptance criteria and dependency ordering
3
+ ---
4
+
5
+ Load and follow the `planning-and-task-breakdown` skill before proceeding.
6
+
7
+ Read the existing spec (SPEC.md or equivalent) and the relevant codebase sections. Then:
8
+
9
+ 1. Enter plan mode — read only, no code changes
10
+ 2. Identify the dependency graph between components
11
+ 3. Slice work vertically (one complete path per task, not horizontal layers)
12
+ 4. Write tasks with acceptance criteria and verification steps
13
+ 5. Add checkpoints between phases
14
+ 6. Present the plan for human review
15
+
16
+ Save the plan to the location the `planning-and-task-breakdown` skill defines (default `docs/plans/{area}/PLAN-{prd-name}-{phase}.md`, with the task list embedded — no separate todo file; overridable per project via `.ai/agent-fleet-overrides.md`). Match the project's existing `docs`/`Docs` capitalization.
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: Conduct a five-axis code review — correctness, readability, architecture, security, performance
3
+ ---
4
+
5
+ Load and follow the `code-review-and-quality` skill before proceeding.
6
+
7
+ Review the current changes (staged or recent commits) across all five axes:
8
+
9
+ 1. **Correctness** — Does it match the spec? Edge cases handled? Tests adequate?
10
+ 2. **Readability** — Clear names? Straightforward logic? Well-organized?
11
+ 3. **Architecture** — Follows existing patterns? Clean boundaries? Right abstraction level?
12
+ 4. **Security** — Input validated? Secrets safe? Auth checked? Load and follow the `security-and-hardening` skill where relevant.
13
+ 5. **Performance** — No N+1 queries? No unbounded ops? Load and follow the `performance-optimization` skill where relevant.
14
+
15
+ Categorize findings as Critical, Important, or Suggestion.
16
+ Output a structured review with specific file:line references and fix recommendations.