@chankov/agent-fleet 2.0.10 → 2.0.12

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 (1058) hide show
  1. package/.pi/agent-fleet/scripts/flow.ts +26 -8
  2. package/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +1 -1
  3. package/.pi/agent-fleet/scripts/lib/herdr-layout.ts +3 -3
  4. package/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +56 -12
  5. package/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
  6. package/.pi/agent-fleet/scripts/workflows/lib/run.ts +2 -2
  7. package/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  8. package/.pi/agent-fleet/scripts/workflows/lib/trace.ts +2 -2
  9. package/.pi/agent-fleet/scripts/workflows/wf-scout.ts +3 -1
  10. package/.pi/harnesses/agent-hub/README.md +113 -21
  11. package/.pi/harnesses/agent-hub/acceptance.ts +137 -0
  12. package/.pi/harnesses/agent-hub/assertion-ledger.js +15 -6
  13. package/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
  14. package/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  15. package/.pi/harnesses/agent-hub/budget-recovery.ts +136 -19
  16. package/.pi/harnesses/agent-hub/capability-packs.ts +6 -2
  17. package/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  18. package/.pi/harnesses/agent-hub/commands/context.ts +2 -0
  19. package/.pi/harnesses/agent-hub/commands/recover.ts +52 -0
  20. package/.pi/harnesses/agent-hub/commands/retry.ts +1 -1
  21. package/.pi/harnesses/agent-hub/config/agents.ts +1 -0
  22. package/.pi/harnesses/agent-hub/config/model-profiles.ts +20 -1
  23. package/.pi/harnesses/agent-hub/config/overrides.ts +8 -1
  24. package/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +10 -2
  25. package/.pi/harnesses/agent-hub/context/budgets.ts +2 -0
  26. package/.pi/harnesses/agent-hub/context-budget-snapshot.ts +1 -1
  27. package/.pi/harnesses/agent-hub/context-window.js +2 -0
  28. package/.pi/harnesses/agent-hub/delegate.ts +22 -3
  29. package/.pi/harnesses/agent-hub/deterministic-fs.ts +127 -0
  30. package/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  31. package/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  32. package/.pi/harnesses/agent-hub/dispatch-coms.ts +20 -5
  33. package/.pi/harnesses/agent-hub/dispatch-native-complete.ts +23 -8
  34. package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +74 -7
  35. package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +61 -52
  36. package/.pi/harnesses/agent-hub/dispatch-native-types.ts +23 -2
  37. package/.pi/harnesses/agent-hub/dispatch-native.ts +25 -12
  38. package/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  39. package/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  40. package/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  41. package/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  42. package/.pi/harnesses/agent-hub/drift-watchdog.js +140 -9
  43. package/.pi/harnesses/agent-hub/filesystem-tool.ts +73 -0
  44. package/.pi/harnesses/agent-hub/helpers.ts +5 -1
  45. package/.pi/harnesses/agent-hub/hub-state-audit.js +1 -0
  46. package/.pi/harnesses/agent-hub/index.ts +208 -39
  47. package/.pi/harnesses/agent-hub/input/completions.ts +8 -2
  48. package/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +4 -2
  49. package/.pi/harnesses/agent-hub/monitor-lifecycle.ts +1 -1
  50. package/.pi/harnesses/agent-hub/no-progress.ts +348 -65
  51. package/.pi/harnesses/agent-hub/package.json +1 -1
  52. package/.pi/harnesses/agent-hub/policy/work-mode.ts +12 -5
  53. package/.pi/harnesses/agent-hub/process-obligations.ts +57 -0
  54. package/.pi/harnesses/agent-hub/prompts/context.ts +5 -1
  55. package/.pi/harnesses/agent-hub/prompts/fragments.ts +5 -2
  56. package/.pi/harnesses/agent-hub/prompts/session-start.ts +2 -2
  57. package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +1 -1
  58. package/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  59. package/.pi/harnesses/agent-hub/recover-policy.ts +27 -0
  60. package/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  61. package/.pi/harnesses/agent-hub/recovery-contract.ts +80 -0
  62. package/.pi/harnesses/agent-hub/research/controls.ts +1 -1
  63. package/.pi/harnesses/agent-hub/research/runtime.ts +2 -1
  64. package/.pi/harnesses/agent-hub/research/spawn-run.ts +21 -6
  65. package/.pi/harnesses/agent-hub/return-extract.js +3 -1
  66. package/.pi/harnesses/agent-hub/review-findings.js +2 -0
  67. package/.pi/harnesses/agent-hub/run-budget.js +6 -1
  68. package/.pi/harnesses/agent-hub/run-namespace.js +6 -0
  69. package/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
  70. package/.pi/harnesses/agent-hub/session-audit.ts +226 -0
  71. package/.pi/harnesses/agent-hub/spawn.ts +133 -11
  72. package/.pi/harnesses/agent-hub/system1-activity.ts +443 -0
  73. package/.pi/harnesses/agent-hub/system1-report.ts +84 -0
  74. package/.pi/harnesses/agent-hub/system1-runtime.ts +273 -0
  75. package/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
  76. package/.pi/harnesses/agent-hub/timeline.ts +23 -5
  77. package/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
  78. package/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
  79. package/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  80. package/.pi/harnesses/agent-hub/tools/action-executors.ts +41 -5
  81. package/.pi/harnesses/agent-hub/tools/context.ts +9 -1
  82. package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +1 -1
  83. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +189 -26
  84. package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +2 -2
  85. package/.pi/harnesses/agent-hub/tools/run-flow.ts +122 -0
  86. package/.pi/harnesses/agent-hub/tools/set-task-tier.ts +5 -3
  87. package/.pi/harnesses/agent-hub/tools/spawn-research.ts +4 -1
  88. package/.pi/harnesses/agent-hub/tools/verification-contract.ts +5 -2
  89. package/.pi/harnesses/agent-hub/types.ts +3 -0
  90. package/.pi/harnesses/agent-hub/ui/activity-dots.ts +12 -3
  91. package/.pi/harnesses/agent-hub/ui/context-budget.ts +4 -3
  92. package/.pi/harnesses/agent-hub/ui/detail-panel.ts +11 -18
  93. package/.pi/harnesses/agent-hub/ui/fleet-actions.ts +3 -1
  94. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +2 -2
  95. package/.pi/harnesses/agent-hub/ui/fleet-source.ts +14 -1
  96. package/.pi/harnesses/agent-hub/ui/grid.ts +6 -6
  97. package/.pi/harnesses/agent-hub/ui/pool.ts +1 -1
  98. package/.pi/harnesses/agent-hub/ui/zoom.ts +5 -3
  99. package/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  100. package/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  101. package/.pi/harnesses/agent-hub/work-mode.ts +8 -2
  102. package/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
  103. package/.pi/harnesses/ask-user-remote/runtime-ask.ts +31 -6
  104. package/.pi/harnesses/coms/package.json +1 -1
  105. package/.pi/harnesses/damage-control-continue/index.ts +9 -0
  106. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  107. package/.pi/harnesses/lib/coms-core.ts +1 -1
  108. package/.pi/harnesses/lib/context-budget.ts +1 -1
  109. package/.pi/harnesses/lib/deterministic-handle-path.ts +23 -0
  110. package/.pi/harnesses/lib/fleet-dashboard-view.ts +3 -1
  111. package/.pi/harnesses/lib/fleet-detail-view.ts +35 -4
  112. package/.pi/harnesses/lib/fleet-read-model.ts +206 -14
  113. package/.pi/harnesses/lib/fleet-strip-view.ts +17 -5
  114. package/.pi/harnesses/lib/hermes-monitor-registry.ts +1 -1
  115. package/.pi/harnesses/lib/spawned-peers.js +1 -0
  116. package/.pi/harnesses/lib/system1/config.js +61 -0
  117. package/.pi/harnesses/lib/system1/contracts.ts +152 -0
  118. package/.pi/harnesses/lib/system1/demo.ts +106 -0
  119. package/.pi/harnesses/lib/system1/jev.ts +503 -0
  120. package/.pi/harnesses/lib/system1/service.ts +245 -0
  121. package/.versions/2.0.11/.pi/agent-fleet/hermes/README.md +347 -0
  122. package/.versions/2.0.11/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  123. package/.versions/2.0.11/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  124. package/.versions/2.0.11/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  125. package/.versions/2.0.11/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  126. package/.versions/2.0.11/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  127. package/.versions/2.0.11/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  128. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  129. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  130. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  131. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  132. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  133. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  134. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  135. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  136. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  137. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  138. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  139. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  140. package/.versions/2.0.11/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  141. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  142. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  143. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  144. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  145. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  146. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  147. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  148. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  149. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  150. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  151. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  152. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  153. package/.versions/2.0.11/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  154. package/.versions/2.0.11/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  155. package/.versions/2.0.11/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  156. package/.versions/2.0.11/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  157. package/.versions/2.0.11/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
  158. package/.versions/2.0.11/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
  159. package/.versions/2.0.11/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
  160. package/.versions/2.0.11/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
  161. package/.versions/2.0.11/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
  162. package/.versions/2.0.11/.pi/agent-fleet/scripts/fleet.ts +216 -0
  163. package/.versions/2.0.11/.pi/agent-fleet/scripts/flow.ts +155 -0
  164. package/.versions/2.0.11/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  165. package/.versions/2.0.11/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  166. package/.versions/2.0.11/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  167. package/.versions/2.0.11/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  168. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
  169. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  170. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  171. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
  172. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
  173. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
  174. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
  175. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
  176. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/flow-command.ts +93 -0
  177. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
  178. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  179. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  180. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  181. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  182. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  183. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  184. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  185. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  186. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  187. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  188. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  189. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  190. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  191. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  192. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  193. package/.versions/2.0.11/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
  194. package/.versions/2.0.11/.pi/agent-fleet/scripts/package-lock.json +35 -0
  195. package/.versions/2.0.11/.pi/agent-fleet/scripts/package.json +9 -0
  196. package/.versions/2.0.11/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  197. package/.versions/2.0.11/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
  198. package/.versions/2.0.11/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
  199. package/.versions/2.0.11/.pi/agent-fleet/scripts/team-up.ts +378 -0
  200. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +177 -0
  201. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  202. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  203. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
  204. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  205. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  206. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
  207. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
  208. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  209. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  210. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  211. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
  212. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  213. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  214. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
  215. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
  216. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  217. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
  218. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  219. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
  220. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  221. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  222. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  223. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  224. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  225. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  226. package/.versions/2.0.11/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  227. package/.versions/2.0.11/.pi/agents/dispatch-policy.yaml +32 -0
  228. package/.versions/2.0.11/.pi/agents/model-profiles.yaml +83 -0
  229. package/.versions/2.0.11/.pi/agents/peers.yaml +147 -0
  230. package/.versions/2.0.11/.pi/agents/teams.yaml +41 -0
  231. package/.versions/2.0.11/.pi/agents/voices.yaml +13 -0
  232. package/.versions/2.0.11/.pi/damage-control-rules.yaml +297 -0
  233. package/.versions/2.0.11/.pi/extensions/btw/README.md +120 -0
  234. package/.versions/2.0.11/.pi/extensions/btw/index.ts +914 -0
  235. package/.versions/2.0.11/.pi/extensions/btw/package.json +6 -0
  236. package/.versions/2.0.11/.pi/extensions/btw/state.js +179 -0
  237. package/.versions/2.0.11/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  238. package/.versions/2.0.11/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  239. package/.versions/2.0.11/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  240. package/.versions/2.0.11/.pi/extensions/compact-and-continue/README.md +42 -0
  241. package/.versions/2.0.11/.pi/extensions/compact-and-continue/index.ts +120 -0
  242. package/.versions/2.0.11/.pi/extensions/compact-and-continue/package.json +6 -0
  243. package/.versions/2.0.11/.pi/extensions/mcp-bridge/README.md +46 -0
  244. package/.versions/2.0.11/.pi/extensions/mcp-bridge/index.ts +206 -0
  245. package/.versions/2.0.11/.pi/extensions/mcp-bridge/package.json +6 -0
  246. package/.versions/2.0.11/.pi/extensions/package-lock.json +1175 -0
  247. package/.versions/2.0.11/.pi/extensions/package.json +9 -0
  248. package/.versions/2.0.11/.pi/extensions/pi-voice-stt/README.md +224 -0
  249. package/.versions/2.0.11/.pi/extensions/pi-voice-stt/config.ts +198 -0
  250. package/.versions/2.0.11/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  251. package/.versions/2.0.11/.pi/extensions/pi-voice-stt/index.ts +248 -0
  252. package/.versions/2.0.11/.pi/extensions/pi-voice-stt/package.json +6 -0
  253. package/.versions/2.0.11/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  254. package/.versions/2.0.11/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  255. package/.versions/2.0.11/.pi/harnesses/agent-hub/README.md +1252 -0
  256. package/.versions/2.0.11/.pi/harnesses/agent-hub/acceptance.ts +199 -0
  257. package/.versions/2.0.11/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  258. package/.versions/2.0.11/.pi/harnesses/agent-hub/artifacts.js +146 -0
  259. package/.versions/2.0.11/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
  260. package/.versions/2.0.11/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
  261. package/.versions/2.0.11/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  262. package/.versions/2.0.11/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  263. package/.versions/2.0.11/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
  264. package/.versions/2.0.11/.pi/harnesses/agent-hub/budget-recovery.ts +191 -0
  265. package/.versions/2.0.11/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  266. package/.versions/2.0.11/.pi/harnesses/agent-hub/capability-packs.ts +183 -0
  267. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  268. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  269. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  270. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  271. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  272. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  273. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  274. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  275. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  276. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  277. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  278. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  279. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
  280. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  281. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  282. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  283. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/context.ts +44 -0
  284. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  285. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  286. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  287. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  288. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  289. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  290. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  291. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  292. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  293. package/.versions/2.0.11/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  294. package/.versions/2.0.11/.pi/harnesses/agent-hub/config/agents.ts +178 -0
  295. package/.versions/2.0.11/.pi/harnesses/agent-hub/config/model-profiles.ts +235 -0
  296. package/.versions/2.0.11/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
  297. package/.versions/2.0.11/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  298. package/.versions/2.0.11/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
  299. package/.versions/2.0.11/.pi/harnesses/agent-hub/context/budgets.ts +204 -0
  300. package/.versions/2.0.11/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  301. package/.versions/2.0.11/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  302. package/.versions/2.0.11/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  303. package/.versions/2.0.11/.pi/harnesses/agent-hub/context-window.js +106 -0
  304. package/.versions/2.0.11/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  305. package/.versions/2.0.11/.pi/harnesses/agent-hub/delegate.ts +463 -0
  306. package/.versions/2.0.11/.pi/harnesses/agent-hub/deterministic-fs.ts +127 -0
  307. package/.versions/2.0.11/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  308. package/.versions/2.0.11/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  309. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-coms.ts +237 -0
  310. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  311. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-native-complete.ts +163 -0
  312. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +223 -0
  313. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +197 -0
  314. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-native-types.ts +245 -0
  315. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-native.ts +226 -0
  316. package/.versions/2.0.11/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  317. package/.versions/2.0.11/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  318. package/.versions/2.0.11/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
  319. package/.versions/2.0.11/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  320. package/.versions/2.0.11/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
  321. package/.versions/2.0.11/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  322. package/.versions/2.0.11/.pi/harnesses/agent-hub/filesystem-tool.ts +73 -0
  323. package/.versions/2.0.11/.pi/harnesses/agent-hub/fixtures/registration-surface.json +60 -0
  324. package/.versions/2.0.11/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  325. package/.versions/2.0.11/.pi/harnesses/agent-hub/footer.ts +30 -0
  326. package/.versions/2.0.11/.pi/harnesses/agent-hub/helpers.ts +270 -0
  327. package/.versions/2.0.11/.pi/harnesses/agent-hub/hub-state-audit.js +65 -0
  328. package/.versions/2.0.11/.pi/harnesses/agent-hub/index.ts +2263 -0
  329. package/.versions/2.0.11/.pi/harnesses/agent-hub/input/completions.ts +76 -0
  330. package/.versions/2.0.11/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
  331. package/.versions/2.0.11/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
  332. package/.versions/2.0.11/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  333. package/.versions/2.0.11/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  334. package/.versions/2.0.11/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
  335. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  336. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  337. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  338. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  339. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  340. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  341. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  342. package/.versions/2.0.11/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  343. package/.versions/2.0.11/.pi/harnesses/agent-hub/no-progress.ts +206 -0
  344. package/.versions/2.0.11/.pi/harnesses/agent-hub/package.json +7 -0
  345. package/.versions/2.0.11/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  346. package/.versions/2.0.11/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  347. package/.versions/2.0.11/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  348. package/.versions/2.0.11/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  349. package/.versions/2.0.11/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  350. package/.versions/2.0.11/.pi/harnesses/agent-hub/policy/work-mode.ts +126 -0
  351. package/.versions/2.0.11/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  352. package/.versions/2.0.11/.pi/harnesses/agent-hub/presentation.ts +48 -0
  353. package/.versions/2.0.11/.pi/harnesses/agent-hub/process-obligations.ts +57 -0
  354. package/.versions/2.0.11/.pi/harnesses/agent-hub/prompts/context.ts +51 -0
  355. package/.versions/2.0.11/.pi/harnesses/agent-hub/prompts/fragments.ts +118 -0
  356. package/.versions/2.0.11/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  357. package/.versions/2.0.11/.pi/harnesses/agent-hub/prompts/system-prompt.ts +112 -0
  358. package/.versions/2.0.11/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  359. package/.versions/2.0.11/.pi/harnesses/agent-hub/recovery-contract.ts +78 -0
  360. package/.versions/2.0.11/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  361. package/.versions/2.0.11/.pi/harnesses/agent-hub/research/runtime.ts +193 -0
  362. package/.versions/2.0.11/.pi/harnesses/agent-hub/research/spawn-run.ts +171 -0
  363. package/.versions/2.0.11/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  364. package/.versions/2.0.11/.pi/harnesses/agent-hub/return-contract.js +327 -0
  365. package/.versions/2.0.11/.pi/harnesses/agent-hub/return-extract.js +75 -0
  366. package/.versions/2.0.11/.pi/harnesses/agent-hub/review-findings.js +102 -0
  367. package/.versions/2.0.11/.pi/harnesses/agent-hub/run-budget.js +537 -0
  368. package/.versions/2.0.11/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  369. package/.versions/2.0.11/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
  370. package/.versions/2.0.11/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  371. package/.versions/2.0.11/.pi/harnesses/agent-hub/scope-gate.js +123 -0
  372. package/.versions/2.0.11/.pi/harnesses/agent-hub/session-audit.ts +161 -0
  373. package/.versions/2.0.11/.pi/harnesses/agent-hub/session-health.js +110 -0
  374. package/.versions/2.0.11/.pi/harnesses/agent-hub/session-start.ts +42 -0
  375. package/.versions/2.0.11/.pi/harnesses/agent-hub/spawn.ts +458 -0
  376. package/.versions/2.0.11/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
  377. package/.versions/2.0.11/.pi/harnesses/agent-hub/timeline.ts +54 -0
  378. package/.versions/2.0.11/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
  379. package/.versions/2.0.11/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
  380. package/.versions/2.0.11/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  381. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/action-executors.ts +185 -0
  382. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  383. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/context.ts +142 -0
  384. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +82 -0
  385. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +485 -0
  386. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  387. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
  388. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
  389. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/run-flow.ts +122 -0
  390. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  391. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/spawn-research.ts +65 -0
  392. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  393. package/.versions/2.0.11/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
  394. package/.versions/2.0.11/.pi/harnesses/agent-hub/types.ts +65 -0
  395. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
  396. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
  397. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
  398. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/fleet-actions.ts +76 -0
  399. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +99 -0
  400. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  401. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/fleet-source.ts +157 -0
  402. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/grid.ts +154 -0
  403. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  404. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  405. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  406. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  407. package/.versions/2.0.11/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
  408. package/.versions/2.0.11/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  409. package/.versions/2.0.11/.pi/harnesses/agent-hub/version.ts +42 -0
  410. package/.versions/2.0.11/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  411. package/.versions/2.0.11/.pi/harnesses/agent-hub/work-mode.ts +173 -0
  412. package/.versions/2.0.11/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
  413. package/.versions/2.0.11/.pi/harnesses/ask-user-remote/README.md +59 -0
  414. package/.versions/2.0.11/.pi/harnesses/ask-user-remote/index.ts +558 -0
  415. package/.versions/2.0.11/.pi/harnesses/ask-user-remote/questions.ts +161 -0
  416. package/.versions/2.0.11/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  417. package/.versions/2.0.11/.pi/harnesses/ask-user-remote/runtime-ask.ts +68 -0
  418. package/.versions/2.0.11/.pi/harnesses/coms/README.md +100 -0
  419. package/.versions/2.0.11/.pi/harnesses/coms/index.ts +282 -0
  420. package/.versions/2.0.11/.pi/harnesses/coms/package.json +7 -0
  421. package/.versions/2.0.11/.pi/harnesses/coms/version.ts +42 -0
  422. package/.versions/2.0.11/.pi/harnesses/damage-control-continue/README.md +135 -0
  423. package/.versions/2.0.11/.pi/harnesses/damage-control-continue/index.ts +550 -0
  424. package/.versions/2.0.11/.pi/harnesses/damage-control-continue/package.json +7 -0
  425. package/.versions/2.0.11/.pi/harnesses/damage-control-continue/version.ts +42 -0
  426. package/.versions/2.0.11/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  427. package/.versions/2.0.11/.pi/harnesses/lib/coms-core-io.ts +385 -0
  428. package/.versions/2.0.11/.pi/harnesses/lib/coms-core.ts +577 -0
  429. package/.versions/2.0.11/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  430. package/.versions/2.0.11/.pi/harnesses/lib/context-budget-child-prompt.ts +180 -0
  431. package/.versions/2.0.11/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
  432. package/.versions/2.0.11/.pi/harnesses/lib/context-budget-view.ts +107 -0
  433. package/.versions/2.0.11/.pi/harnesses/lib/context-budget.ts +114 -0
  434. package/.versions/2.0.11/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  435. package/.versions/2.0.11/.pi/harnesses/lib/deterministic-handle-path.ts +23 -0
  436. package/.versions/2.0.11/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  437. package/.versions/2.0.11/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  438. package/.versions/2.0.11/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  439. package/.versions/2.0.11/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  440. package/.versions/2.0.11/.pi/harnesses/lib/fleet-dashboard-view.ts +134 -0
  441. package/.versions/2.0.11/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
  442. package/.versions/2.0.11/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  443. package/.versions/2.0.11/.pi/harnesses/lib/fleet-panel.ts +34 -0
  444. package/.versions/2.0.11/.pi/harnesses/lib/fleet-read-model.ts +213 -0
  445. package/.versions/2.0.11/.pi/harnesses/lib/fleet-selection.ts +24 -0
  446. package/.versions/2.0.11/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
  447. package/.versions/2.0.11/.pi/harnesses/lib/fleet-strip-view.ts +132 -0
  448. package/.versions/2.0.11/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  449. package/.versions/2.0.11/.pi/harnesses/lib/herdr-client.ts +472 -0
  450. package/.versions/2.0.11/.pi/harnesses/lib/herdr-presence.ts +399 -0
  451. package/.versions/2.0.11/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  452. package/.versions/2.0.11/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  453. package/.versions/2.0.11/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  454. package/.versions/2.0.11/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  455. package/.versions/2.0.11/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  456. package/.versions/2.0.11/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  457. package/.versions/2.0.11/.pi/harnesses/lib/spawned-peers.js +190 -0
  458. package/.versions/2.0.11/.pi/harnesses/lib/update-check.ts +222 -0
  459. package/.versions/2.0.11/.pi/harnesses/package-lock.json +2039 -0
  460. package/.versions/2.0.11/.pi/harnesses/package.json +10 -0
  461. package/.versions/2.0.11/.pi/prompts/af-build.md +24 -0
  462. package/.versions/2.0.11/.pi/prompts/af-code-simplify.md +22 -0
  463. package/.versions/2.0.11/.pi/prompts/af-constraints.md +31 -0
  464. package/.versions/2.0.11/.pi/prompts/af-plan.md +17 -0
  465. package/.versions/2.0.11/.pi/prompts/af-review.md +16 -0
  466. package/.versions/2.0.11/.pi/prompts/af-set-hermes-telegram.md +15 -0
  467. package/.versions/2.0.11/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  468. package/.versions/2.0.11/.pi/prompts/af-ship.md +17 -0
  469. package/.versions/2.0.11/.pi/prompts/af-spec.md +15 -0
  470. package/.versions/2.0.11/.pi/prompts/af-test.md +19 -0
  471. package/.versions/2.0.11/.pi/skills/bowser/SKILL.md +145 -0
  472. package/.versions/2.0.11/.version +1 -0
  473. package/.versions/2.0.11/agents/architect.md +25 -0
  474. package/.versions/2.0.11/agents/bowser.md +28 -0
  475. package/.versions/2.0.11/agents/builder.md +56 -0
  476. package/.versions/2.0.11/agents/code-reviewer.md +210 -0
  477. package/.versions/2.0.11/agents/deep-researcher.md +33 -0
  478. package/.versions/2.0.11/agents/documenter.md +23 -0
  479. package/.versions/2.0.11/agents/orchestrator.md +23 -0
  480. package/.versions/2.0.11/agents/plan-reviewer.md +84 -0
  481. package/.versions/2.0.11/agents/planner.md +106 -0
  482. package/.versions/2.0.11/agents/releaser.md +25 -0
  483. package/.versions/2.0.11/agents/researcher.md +31 -0
  484. package/.versions/2.0.11/agents/security-auditor.md +168 -0
  485. package/.versions/2.0.11/agents/test-engineer.md +154 -0
  486. package/.versions/2.0.11/agents/web-debugger.md +44 -0
  487. package/.versions/2.0.11/agents/web-performance-auditor.md +194 -0
  488. package/.versions/2.0.11/bin/catalog/harness-runtime-closure.json +61 -0
  489. package/.versions/2.0.11/codex/fleet-session-client/SKILL.md +34 -0
  490. package/.versions/2.0.11/codex/fleet-session-client.zip +0 -0
  491. package/.versions/2.0.11/docs/ARCHITECTURE.md +595 -0
  492. package/.versions/2.0.11/docs/agent-fleet-setup.md +586 -0
  493. package/.versions/2.0.11/docs/claude-code-coms-bridge.md +134 -0
  494. package/.versions/2.0.11/docs/codex-session-bridge.md +219 -0
  495. package/.versions/2.0.11/docs/coms-hermes-bridge.md +188 -0
  496. package/.versions/2.0.11/docs/getting-started.md +126 -0
  497. package/.versions/2.0.11/docs/npm-install.md +383 -0
  498. package/.versions/2.0.11/docs/pi-extensions.md +449 -0
  499. package/.versions/2.0.11/docs/pi-setup.md +92 -0
  500. package/.versions/2.0.11/docs/skill-anatomy.md +150 -0
  501. package/.versions/2.0.11/install-manifest.json +3020 -0
  502. package/.versions/2.0.11/justfile +247 -0
  503. package/.versions/2.0.11/manifest-meta.json +970 -0
  504. package/.versions/2.0.11/references/accessibility-checklist.md +160 -0
  505. package/.versions/2.0.11/references/communication-contract.md +26 -0
  506. package/.versions/2.0.11/references/definition-of-done.md +67 -0
  507. package/.versions/2.0.11/references/fleet-coordination-patterns.md +171 -0
  508. package/.versions/2.0.11/references/observability-checklist.md +92 -0
  509. package/.versions/2.0.11/references/orchestration-patterns.md +370 -0
  510. package/.versions/2.0.11/references/performance-checklist.md +236 -0
  511. package/.versions/2.0.11/references/prompting-patterns.md +380 -0
  512. package/.versions/2.0.11/references/security-checklist.md +245 -0
  513. package/.versions/2.0.11/references/testing-patterns.md +235 -0
  514. package/.versions/2.0.11/references/workflow-authoring.md +304 -0
  515. package/.versions/2.0.11/skills/_internal/grilling.md +59 -0
  516. package/.versions/2.0.11/skills/browser-testing-with-devtools/SKILL.md +351 -0
  517. package/.versions/2.0.11/skills/code-review-and-quality/SKILL.md +396 -0
  518. package/.versions/2.0.11/skills/compound-learning/SKILL.md +137 -0
  519. package/.versions/2.0.11/skills/constraint-driven-development/SKILL.md +338 -0
  520. package/.versions/2.0.11/skills/constraint-driven-development/references/floor-guard.md +99 -0
  521. package/.versions/2.0.11/skills/context-engineering/SKILL.md +341 -0
  522. package/.versions/2.0.11/skills/deprecation-and-migration/SKILL.md +247 -0
  523. package/.versions/2.0.11/skills/designing-agents/SKILL.md +394 -0
  524. package/.versions/2.0.11/skills/designing-agents/pi-harness-authoring.md +222 -0
  525. package/.versions/2.0.11/skills/drafting-workflows/SKILL.md +143 -0
  526. package/.versions/2.0.11/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  527. package/.versions/2.0.11/skills/frontend-ui-engineering/SKILL.md +328 -0
  528. package/.versions/2.0.11/skills/git-workflow-and-versioning/SKILL.md +316 -0
  529. package/.versions/2.0.11/skills/idea-refine/SKILL.md +182 -0
  530. package/.versions/2.0.11/skills/idea-refine/examples.md +238 -0
  531. package/.versions/2.0.11/skills/idea-refine/frameworks.md +99 -0
  532. package/.versions/2.0.11/skills/idea-refine/refinement-criteria.md +113 -0
  533. package/.versions/2.0.11/skills/idea-refine/scripts/idea-refine.sh +15 -0
  534. package/.versions/2.0.11/skills/incremental-implementation/SKILL.md +302 -0
  535. package/.versions/2.0.11/skills/interview-me/SKILL.md +226 -0
  536. package/.versions/2.0.11/skills/orchestration-verification/SKILL.md +182 -0
  537. package/.versions/2.0.11/skills/peer-coms/SKILL.md +90 -0
  538. package/.versions/2.0.11/skills/performance-optimization/SKILL.md +496 -0
  539. package/.versions/2.0.11/skills/planning-and-task-breakdown/SKILL.md +289 -0
  540. package/.versions/2.0.11/skills/security-and-hardening/SKILL.md +524 -0
  541. package/.versions/2.0.11/skills/spec-driven-development/SKILL.md +295 -0
  542. package/.versions/2.0.11/skills/using-agent-skills/SKILL.md +198 -0
  543. package/.versions/2.0.11/vendor/agent-skills-upstream/LICENSE +21 -0
  544. package/.versions/2.0.11/vendor/agent-skills-upstream/README.md +430 -0
  545. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  546. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  547. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  548. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  549. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  550. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  551. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  552. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  553. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  554. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  555. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  556. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  557. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  558. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  559. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  560. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  561. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  562. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  563. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  564. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  565. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  566. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  567. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  568. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  569. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  570. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  571. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  572. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  573. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  574. package/.versions/2.0.11/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  575. package/.versions/2.0.12/.pi/agent-fleet/hermes/README.md +347 -0
  576. package/.versions/2.0.12/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  577. package/.versions/2.0.12/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  578. package/.versions/2.0.12/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  579. package/.versions/2.0.12/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  580. package/.versions/2.0.12/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  581. package/.versions/2.0.12/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  582. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  583. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  584. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  585. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  586. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  587. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  588. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  589. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  590. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  591. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  592. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  593. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  594. package/.versions/2.0.12/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  595. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  596. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  597. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  598. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  599. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  600. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  601. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  602. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  603. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  604. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  605. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  606. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  607. package/.versions/2.0.12/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  608. package/.versions/2.0.12/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  609. package/.versions/2.0.12/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  610. package/.versions/2.0.12/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  611. package/.versions/2.0.12/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
  612. package/.versions/2.0.12/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
  613. package/.versions/2.0.12/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
  614. package/.versions/2.0.12/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
  615. package/.versions/2.0.12/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
  616. package/.versions/2.0.12/.pi/agent-fleet/scripts/fleet.ts +216 -0
  617. package/.versions/2.0.12/.pi/agent-fleet/scripts/flow.ts +155 -0
  618. package/.versions/2.0.12/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  619. package/.versions/2.0.12/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  620. package/.versions/2.0.12/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  621. package/.versions/2.0.12/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  622. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
  623. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  624. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  625. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
  626. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
  627. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
  628. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
  629. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
  630. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/flow-command.ts +93 -0
  631. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
  632. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  633. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  634. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  635. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  636. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  637. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  638. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  639. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  640. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  641. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  642. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  643. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  644. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  645. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  646. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  647. package/.versions/2.0.12/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
  648. package/.versions/2.0.12/.pi/agent-fleet/scripts/package-lock.json +35 -0
  649. package/.versions/2.0.12/.pi/agent-fleet/scripts/package.json +9 -0
  650. package/.versions/2.0.12/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  651. package/.versions/2.0.12/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
  652. package/.versions/2.0.12/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
  653. package/.versions/2.0.12/.pi/agent-fleet/scripts/team-up.ts +378 -0
  654. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +177 -0
  655. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  656. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  657. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
  658. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  659. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  660. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
  661. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
  662. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  663. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  664. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  665. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
  666. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  667. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  668. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
  669. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
  670. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  671. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
  672. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  673. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
  674. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  675. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  676. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  677. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  678. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  679. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  680. package/.versions/2.0.12/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  681. package/.versions/2.0.12/.pi/agents/dispatch-policy.yaml +32 -0
  682. package/.versions/2.0.12/.pi/agents/model-profiles.yaml +83 -0
  683. package/.versions/2.0.12/.pi/agents/peers.yaml +147 -0
  684. package/.versions/2.0.12/.pi/agents/teams.yaml +41 -0
  685. package/.versions/2.0.12/.pi/agents/voices.yaml +13 -0
  686. package/.versions/2.0.12/.pi/damage-control-rules.yaml +297 -0
  687. package/.versions/2.0.12/.pi/extensions/btw/README.md +120 -0
  688. package/.versions/2.0.12/.pi/extensions/btw/index.ts +914 -0
  689. package/.versions/2.0.12/.pi/extensions/btw/package.json +6 -0
  690. package/.versions/2.0.12/.pi/extensions/btw/state.js +179 -0
  691. package/.versions/2.0.12/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  692. package/.versions/2.0.12/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  693. package/.versions/2.0.12/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  694. package/.versions/2.0.12/.pi/extensions/compact-and-continue/README.md +42 -0
  695. package/.versions/2.0.12/.pi/extensions/compact-and-continue/index.ts +120 -0
  696. package/.versions/2.0.12/.pi/extensions/compact-and-continue/package.json +6 -0
  697. package/.versions/2.0.12/.pi/extensions/mcp-bridge/README.md +46 -0
  698. package/.versions/2.0.12/.pi/extensions/mcp-bridge/index.ts +206 -0
  699. package/.versions/2.0.12/.pi/extensions/mcp-bridge/package.json +6 -0
  700. package/.versions/2.0.12/.pi/extensions/package-lock.json +1175 -0
  701. package/.versions/2.0.12/.pi/extensions/package.json +9 -0
  702. package/.versions/2.0.12/.pi/extensions/pi-voice-stt/README.md +224 -0
  703. package/.versions/2.0.12/.pi/extensions/pi-voice-stt/config.ts +198 -0
  704. package/.versions/2.0.12/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  705. package/.versions/2.0.12/.pi/extensions/pi-voice-stt/index.ts +248 -0
  706. package/.versions/2.0.12/.pi/extensions/pi-voice-stt/package.json +6 -0
  707. package/.versions/2.0.12/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  708. package/.versions/2.0.12/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  709. package/.versions/2.0.12/.pi/harnesses/agent-hub/README.md +1309 -0
  710. package/.versions/2.0.12/.pi/harnesses/agent-hub/acceptance.ts +199 -0
  711. package/.versions/2.0.12/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  712. package/.versions/2.0.12/.pi/harnesses/agent-hub/artifacts.js +146 -0
  713. package/.versions/2.0.12/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
  714. package/.versions/2.0.12/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
  715. package/.versions/2.0.12/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  716. package/.versions/2.0.12/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  717. package/.versions/2.0.12/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
  718. package/.versions/2.0.12/.pi/harnesses/agent-hub/budget-recovery.ts +214 -0
  719. package/.versions/2.0.12/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  720. package/.versions/2.0.12/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
  721. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  722. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  723. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  724. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  725. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  726. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  727. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  728. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  729. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  730. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  731. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  732. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  733. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
  734. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  735. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  736. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  737. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/context.ts +45 -0
  738. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  739. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  740. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  741. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  742. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  743. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  744. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/recover.ts +52 -0
  745. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  746. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  747. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  748. package/.versions/2.0.12/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  749. package/.versions/2.0.12/.pi/harnesses/agent-hub/config/agents.ts +178 -0
  750. package/.versions/2.0.12/.pi/harnesses/agent-hub/config/model-profiles.ts +235 -0
  751. package/.versions/2.0.12/.pi/harnesses/agent-hub/config/overrides.ts +160 -0
  752. package/.versions/2.0.12/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  753. package/.versions/2.0.12/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
  754. package/.versions/2.0.12/.pi/harnesses/agent-hub/context/budgets.ts +204 -0
  755. package/.versions/2.0.12/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  756. package/.versions/2.0.12/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  757. package/.versions/2.0.12/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  758. package/.versions/2.0.12/.pi/harnesses/agent-hub/context-window.js +108 -0
  759. package/.versions/2.0.12/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  760. package/.versions/2.0.12/.pi/harnesses/agent-hub/delegate.ts +465 -0
  761. package/.versions/2.0.12/.pi/harnesses/agent-hub/deterministic-fs.ts +127 -0
  762. package/.versions/2.0.12/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  763. package/.versions/2.0.12/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  764. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-coms.ts +252 -0
  765. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  766. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-native-complete.ts +169 -0
  767. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +223 -0
  768. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +202 -0
  769. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-native-types.ts +251 -0
  770. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-native.ts +226 -0
  771. package/.versions/2.0.12/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  772. package/.versions/2.0.12/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  773. package/.versions/2.0.12/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  774. package/.versions/2.0.12/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  775. package/.versions/2.0.12/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  776. package/.versions/2.0.12/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  777. package/.versions/2.0.12/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
  778. package/.versions/2.0.12/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  779. package/.versions/2.0.12/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
  780. package/.versions/2.0.12/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  781. package/.versions/2.0.12/.pi/harnesses/agent-hub/filesystem-tool.ts +73 -0
  782. package/.versions/2.0.12/.pi/harnesses/agent-hub/fixtures/registration-surface.json +61 -0
  783. package/.versions/2.0.12/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  784. package/.versions/2.0.12/.pi/harnesses/agent-hub/footer.ts +30 -0
  785. package/.versions/2.0.12/.pi/harnesses/agent-hub/helpers.ts +270 -0
  786. package/.versions/2.0.12/.pi/harnesses/agent-hub/hub-state-audit.js +65 -0
  787. package/.versions/2.0.12/.pi/harnesses/agent-hub/index.ts +2301 -0
  788. package/.versions/2.0.12/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  789. package/.versions/2.0.12/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
  790. package/.versions/2.0.12/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +125 -0
  791. package/.versions/2.0.12/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  792. package/.versions/2.0.12/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  793. package/.versions/2.0.12/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
  794. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  795. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  796. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  797. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  798. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  799. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  800. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  801. package/.versions/2.0.12/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  802. package/.versions/2.0.12/.pi/harnesses/agent-hub/no-progress.ts +359 -0
  803. package/.versions/2.0.12/.pi/harnesses/agent-hub/package.json +7 -0
  804. package/.versions/2.0.12/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  805. package/.versions/2.0.12/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  806. package/.versions/2.0.12/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  807. package/.versions/2.0.12/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  808. package/.versions/2.0.12/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  809. package/.versions/2.0.12/.pi/harnesses/agent-hub/policy/work-mode.ts +126 -0
  810. package/.versions/2.0.12/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  811. package/.versions/2.0.12/.pi/harnesses/agent-hub/presentation.ts +48 -0
  812. package/.versions/2.0.12/.pi/harnesses/agent-hub/process-obligations.ts +57 -0
  813. package/.versions/2.0.12/.pi/harnesses/agent-hub/prompts/context.ts +51 -0
  814. package/.versions/2.0.12/.pi/harnesses/agent-hub/prompts/fragments.ts +118 -0
  815. package/.versions/2.0.12/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  816. package/.versions/2.0.12/.pi/harnesses/agent-hub/prompts/system-prompt.ts +112 -0
  817. package/.versions/2.0.12/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  818. package/.versions/2.0.12/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  819. package/.versions/2.0.12/.pi/harnesses/agent-hub/recover-policy.ts +27 -0
  820. package/.versions/2.0.12/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  821. package/.versions/2.0.12/.pi/harnesses/agent-hub/recovery-contract.ts +80 -0
  822. package/.versions/2.0.12/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  823. package/.versions/2.0.12/.pi/harnesses/agent-hub/research/runtime.ts +193 -0
  824. package/.versions/2.0.12/.pi/harnesses/agent-hub/research/spawn-run.ts +171 -0
  825. package/.versions/2.0.12/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  826. package/.versions/2.0.12/.pi/harnesses/agent-hub/return-contract.js +327 -0
  827. package/.versions/2.0.12/.pi/harnesses/agent-hub/return-extract.js +77 -0
  828. package/.versions/2.0.12/.pi/harnesses/agent-hub/review-findings.js +104 -0
  829. package/.versions/2.0.12/.pi/harnesses/agent-hub/run-budget.js +542 -0
  830. package/.versions/2.0.12/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  831. package/.versions/2.0.12/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
  832. package/.versions/2.0.12/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  833. package/.versions/2.0.12/.pi/harnesses/agent-hub/scope-gate.js +123 -0
  834. package/.versions/2.0.12/.pi/harnesses/agent-hub/session-audit.ts +226 -0
  835. package/.versions/2.0.12/.pi/harnesses/agent-hub/session-health.js +110 -0
  836. package/.versions/2.0.12/.pi/harnesses/agent-hub/session-start.ts +42 -0
  837. package/.versions/2.0.12/.pi/harnesses/agent-hub/spawn.ts +526 -0
  838. package/.versions/2.0.12/.pi/harnesses/agent-hub/system1-activity.ts +443 -0
  839. package/.versions/2.0.12/.pi/harnesses/agent-hub/system1-report.ts +84 -0
  840. package/.versions/2.0.12/.pi/harnesses/agent-hub/system1-runtime.ts +273 -0
  841. package/.versions/2.0.12/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
  842. package/.versions/2.0.12/.pi/harnesses/agent-hub/timeline.ts +72 -0
  843. package/.versions/2.0.12/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
  844. package/.versions/2.0.12/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
  845. package/.versions/2.0.12/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  846. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/action-executors.ts +185 -0
  847. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  848. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/context.ts +142 -0
  849. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +82 -0
  850. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +498 -0
  851. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  852. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
  853. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
  854. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/run-flow.ts +122 -0
  855. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  856. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/spawn-research.ts +65 -0
  857. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  858. package/.versions/2.0.12/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
  859. package/.versions/2.0.12/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  860. package/.versions/2.0.12/.pi/harnesses/agent-hub/types.ts +66 -0
  861. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  862. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/context-budget.ts +87 -0
  863. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/detail-panel.ts +171 -0
  864. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  865. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +99 -0
  866. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  867. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/fleet-source.ts +170 -0
  868. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/grid.ts +154 -0
  869. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  870. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  871. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  872. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  873. package/.versions/2.0.12/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  874. package/.versions/2.0.12/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  875. package/.versions/2.0.12/.pi/harnesses/agent-hub/version.ts +42 -0
  876. package/.versions/2.0.12/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  877. package/.versions/2.0.12/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  878. package/.versions/2.0.12/.pi/harnesses/agent-hub/work-mode.ts +173 -0
  879. package/.versions/2.0.12/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
  880. package/.versions/2.0.12/.pi/harnesses/ask-user-remote/README.md +59 -0
  881. package/.versions/2.0.12/.pi/harnesses/ask-user-remote/index.ts +558 -0
  882. package/.versions/2.0.12/.pi/harnesses/ask-user-remote/questions.ts +161 -0
  883. package/.versions/2.0.12/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  884. package/.versions/2.0.12/.pi/harnesses/ask-user-remote/runtime-ask.ts +68 -0
  885. package/.versions/2.0.12/.pi/harnesses/coms/README.md +100 -0
  886. package/.versions/2.0.12/.pi/harnesses/coms/index.ts +282 -0
  887. package/.versions/2.0.12/.pi/harnesses/coms/package.json +7 -0
  888. package/.versions/2.0.12/.pi/harnesses/coms/version.ts +42 -0
  889. package/.versions/2.0.12/.pi/harnesses/damage-control-continue/README.md +135 -0
  890. package/.versions/2.0.12/.pi/harnesses/damage-control-continue/index.ts +550 -0
  891. package/.versions/2.0.12/.pi/harnesses/damage-control-continue/package.json +7 -0
  892. package/.versions/2.0.12/.pi/harnesses/damage-control-continue/version.ts +42 -0
  893. package/.versions/2.0.12/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  894. package/.versions/2.0.12/.pi/harnesses/lib/coms-core-io.ts +385 -0
  895. package/.versions/2.0.12/.pi/harnesses/lib/coms-core.ts +577 -0
  896. package/.versions/2.0.12/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  897. package/.versions/2.0.12/.pi/harnesses/lib/context-budget-child-prompt.ts +180 -0
  898. package/.versions/2.0.12/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
  899. package/.versions/2.0.12/.pi/harnesses/lib/context-budget-view.ts +107 -0
  900. package/.versions/2.0.12/.pi/harnesses/lib/context-budget.ts +114 -0
  901. package/.versions/2.0.12/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  902. package/.versions/2.0.12/.pi/harnesses/lib/deterministic-handle-path.ts +23 -0
  903. package/.versions/2.0.12/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  904. package/.versions/2.0.12/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  905. package/.versions/2.0.12/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  906. package/.versions/2.0.12/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  907. package/.versions/2.0.12/.pi/harnesses/lib/fleet-dashboard-view.ts +136 -0
  908. package/.versions/2.0.12/.pi/harnesses/lib/fleet-detail-view.ts +278 -0
  909. package/.versions/2.0.12/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  910. package/.versions/2.0.12/.pi/harnesses/lib/fleet-panel.ts +34 -0
  911. package/.versions/2.0.12/.pi/harnesses/lib/fleet-read-model.ts +405 -0
  912. package/.versions/2.0.12/.pi/harnesses/lib/fleet-selection.ts +24 -0
  913. package/.versions/2.0.12/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
  914. package/.versions/2.0.12/.pi/harnesses/lib/fleet-strip-view.ts +144 -0
  915. package/.versions/2.0.12/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  916. package/.versions/2.0.12/.pi/harnesses/lib/herdr-client.ts +472 -0
  917. package/.versions/2.0.12/.pi/harnesses/lib/herdr-presence.ts +399 -0
  918. package/.versions/2.0.12/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  919. package/.versions/2.0.12/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  920. package/.versions/2.0.12/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  921. package/.versions/2.0.12/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  922. package/.versions/2.0.12/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  923. package/.versions/2.0.12/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  924. package/.versions/2.0.12/.pi/harnesses/lib/spawned-peers.js +191 -0
  925. package/.versions/2.0.12/.pi/harnesses/lib/system1/config.js +61 -0
  926. package/.versions/2.0.12/.pi/harnesses/lib/system1/contracts.ts +152 -0
  927. package/.versions/2.0.12/.pi/harnesses/lib/system1/demo.ts +106 -0
  928. package/.versions/2.0.12/.pi/harnesses/lib/system1/jev.ts +503 -0
  929. package/.versions/2.0.12/.pi/harnesses/lib/system1/service.ts +245 -0
  930. package/.versions/2.0.12/.pi/harnesses/lib/update-check.ts +222 -0
  931. package/.versions/2.0.12/.pi/harnesses/package-lock.json +2039 -0
  932. package/.versions/2.0.12/.pi/harnesses/package.json +10 -0
  933. package/.versions/2.0.12/.pi/prompts/af-build.md +24 -0
  934. package/.versions/2.0.12/.pi/prompts/af-code-simplify.md +22 -0
  935. package/.versions/2.0.12/.pi/prompts/af-constraints.md +31 -0
  936. package/.versions/2.0.12/.pi/prompts/af-plan.md +17 -0
  937. package/.versions/2.0.12/.pi/prompts/af-review.md +16 -0
  938. package/.versions/2.0.12/.pi/prompts/af-set-hermes-telegram.md +15 -0
  939. package/.versions/2.0.12/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  940. package/.versions/2.0.12/.pi/prompts/af-ship.md +17 -0
  941. package/.versions/2.0.12/.pi/prompts/af-spec.md +15 -0
  942. package/.versions/2.0.12/.pi/prompts/af-test.md +19 -0
  943. package/.versions/2.0.12/.pi/skills/bowser/SKILL.md +145 -0
  944. package/.versions/2.0.12/.version +1 -0
  945. package/.versions/2.0.12/agents/architect.md +25 -0
  946. package/.versions/2.0.12/agents/bowser.md +28 -0
  947. package/.versions/2.0.12/agents/builder.md +56 -0
  948. package/.versions/2.0.12/agents/code-reviewer.md +210 -0
  949. package/.versions/2.0.12/agents/deep-researcher.md +33 -0
  950. package/.versions/2.0.12/agents/documenter.md +23 -0
  951. package/.versions/2.0.12/agents/orchestrator.md +23 -0
  952. package/.versions/2.0.12/agents/plan-reviewer.md +84 -0
  953. package/.versions/2.0.12/agents/planner.md +106 -0
  954. package/.versions/2.0.12/agents/releaser.md +25 -0
  955. package/.versions/2.0.12/agents/researcher.md +31 -0
  956. package/.versions/2.0.12/agents/security-auditor.md +168 -0
  957. package/.versions/2.0.12/agents/test-engineer.md +154 -0
  958. package/.versions/2.0.12/agents/web-debugger.md +44 -0
  959. package/.versions/2.0.12/agents/web-performance-auditor.md +194 -0
  960. package/.versions/2.0.12/bin/catalog/harness-runtime-closure.json +61 -0
  961. package/.versions/2.0.12/codex/fleet-session-client/SKILL.md +34 -0
  962. package/.versions/2.0.12/codex/fleet-session-client.zip +0 -0
  963. package/.versions/2.0.12/docs/ARCHITECTURE.md +705 -0
  964. package/.versions/2.0.12/docs/agent-fleet-setup.md +682 -0
  965. package/.versions/2.0.12/docs/claude-code-coms-bridge.md +134 -0
  966. package/.versions/2.0.12/docs/codex-session-bridge.md +219 -0
  967. package/.versions/2.0.12/docs/coms-hermes-bridge.md +188 -0
  968. package/.versions/2.0.12/docs/getting-started.md +126 -0
  969. package/.versions/2.0.12/docs/npm-install.md +468 -0
  970. package/.versions/2.0.12/docs/pi-extensions.md +449 -0
  971. package/.versions/2.0.12/docs/pi-setup.md +92 -0
  972. package/.versions/2.0.12/docs/skill-anatomy.md +150 -0
  973. package/.versions/2.0.12/install-manifest.json +3053 -0
  974. package/.versions/2.0.12/justfile +247 -0
  975. package/.versions/2.0.12/manifest-meta.json +995 -0
  976. package/.versions/2.0.12/references/accessibility-checklist.md +160 -0
  977. package/.versions/2.0.12/references/communication-contract.md +26 -0
  978. package/.versions/2.0.12/references/definition-of-done.md +67 -0
  979. package/.versions/2.0.12/references/fleet-coordination-patterns.md +171 -0
  980. package/.versions/2.0.12/references/observability-checklist.md +92 -0
  981. package/.versions/2.0.12/references/orchestration-patterns.md +370 -0
  982. package/.versions/2.0.12/references/performance-checklist.md +236 -0
  983. package/.versions/2.0.12/references/prompting-patterns.md +380 -0
  984. package/.versions/2.0.12/references/security-checklist.md +245 -0
  985. package/.versions/2.0.12/references/testing-patterns.md +235 -0
  986. package/.versions/2.0.12/references/workflow-authoring.md +304 -0
  987. package/.versions/2.0.12/skills/_internal/grilling.md +59 -0
  988. package/.versions/2.0.12/skills/browser-testing-with-devtools/SKILL.md +351 -0
  989. package/.versions/2.0.12/skills/code-review-and-quality/SKILL.md +396 -0
  990. package/.versions/2.0.12/skills/compound-learning/SKILL.md +137 -0
  991. package/.versions/2.0.12/skills/constraint-driven-development/SKILL.md +338 -0
  992. package/.versions/2.0.12/skills/constraint-driven-development/references/floor-guard.md +99 -0
  993. package/.versions/2.0.12/skills/context-engineering/SKILL.md +341 -0
  994. package/.versions/2.0.12/skills/deprecation-and-migration/SKILL.md +247 -0
  995. package/.versions/2.0.12/skills/designing-agents/SKILL.md +394 -0
  996. package/.versions/2.0.12/skills/designing-agents/pi-harness-authoring.md +222 -0
  997. package/.versions/2.0.12/skills/drafting-workflows/SKILL.md +143 -0
  998. package/.versions/2.0.12/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  999. package/.versions/2.0.12/skills/frontend-ui-engineering/SKILL.md +328 -0
  1000. package/.versions/2.0.12/skills/git-workflow-and-versioning/SKILL.md +316 -0
  1001. package/.versions/2.0.12/skills/idea-refine/SKILL.md +182 -0
  1002. package/.versions/2.0.12/skills/idea-refine/examples.md +238 -0
  1003. package/.versions/2.0.12/skills/idea-refine/frameworks.md +99 -0
  1004. package/.versions/2.0.12/skills/idea-refine/refinement-criteria.md +113 -0
  1005. package/.versions/2.0.12/skills/idea-refine/scripts/idea-refine.sh +15 -0
  1006. package/.versions/2.0.12/skills/incremental-implementation/SKILL.md +302 -0
  1007. package/.versions/2.0.12/skills/interview-me/SKILL.md +226 -0
  1008. package/.versions/2.0.12/skills/orchestration-verification/SKILL.md +182 -0
  1009. package/.versions/2.0.12/skills/peer-coms/SKILL.md +90 -0
  1010. package/.versions/2.0.12/skills/performance-optimization/SKILL.md +496 -0
  1011. package/.versions/2.0.12/skills/planning-and-task-breakdown/SKILL.md +289 -0
  1012. package/.versions/2.0.12/skills/security-and-hardening/SKILL.md +524 -0
  1013. package/.versions/2.0.12/skills/spec-driven-development/SKILL.md +295 -0
  1014. package/.versions/2.0.12/skills/using-agent-skills/SKILL.md +198 -0
  1015. package/.versions/2.0.12/vendor/agent-skills-upstream/LICENSE +21 -0
  1016. package/.versions/2.0.12/vendor/agent-skills-upstream/README.md +430 -0
  1017. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  1018. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  1019. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  1020. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  1021. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  1022. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  1023. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  1024. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  1025. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  1026. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  1027. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  1028. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  1029. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  1030. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  1031. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  1032. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  1033. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  1034. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  1035. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  1036. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  1037. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  1038. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  1039. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  1040. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  1041. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  1042. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  1043. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  1044. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  1045. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  1046. package/.versions/2.0.12/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  1047. package/CHANGELOG.md +18 -0
  1048. package/README.md +1 -0
  1049. package/bin/catalog/harness-runtime-closure.json +29 -0
  1050. package/bin/cli.js +18 -7
  1051. package/bin/lib/doctor.js +146 -2
  1052. package/docs/ARCHITECTURE.md +292 -3
  1053. package/docs/agent-fleet-setup.md +96 -0
  1054. package/docs/npm-install.md +87 -2
  1055. package/docs/workflows.md +8 -2
  1056. package/install-manifest.json +64 -2
  1057. package/manifest-meta.json +25 -0
  1058. package/package.json +6 -2
@@ -0,0 +1,819 @@
1
+ """The fleet reports its own transitions instead of being watched.
2
+
3
+ A panel you have to keep open is a panel you stop opening. This module turns
4
+ consecutive `/sessions` payloads into a short list of things that HAPPENED —
5
+ someone is stuck on a question, a session ended, a heartbeat stopped — and hands
6
+ them to two sinks: a ring buffer the pane drains into toasts, and, only when it
7
+ is explicitly configured, `hermes send` for the phone.
8
+
9
+ Three layers, deliberately separate:
10
+
11
+ diff_snapshots(prev, next) -> [Event] pure. No I/O, no clock of its own —
12
+ time comes from `collected_at` — so
13
+ every rule is testable from fixtures.
14
+ Watcher the memory: the 20s debounce on
15
+ `needs_answer`, event collapse, the
16
+ per-minute cap, sequence numbers and
17
+ the bounded buffer.
18
+ EventStream one subscriber's view of that buffer,
19
+ shaped for a WebSocket: the backlog it
20
+ missed, then frames as they happen.
21
+ collect_snapshot / run_forever the I/O: the same composition
22
+ `/sessions` serves, on a timer.
23
+
24
+ Rules that are not negotiable:
25
+
26
+ - **A herdr outage is not fleet news.** When herdr does not answer, every row
27
+ degrades to `unknown`; diffing that against a healthy snapshot would report
28
+ the whole fleet as having changed. Such a snapshot is discarded whole and
29
+ `prev` is kept, so whatever really happened during the blindness is
30
+ reported once, against real evidence, when herdr comes back.
31
+ - **No message leaves the machine without an explicit opt-in.** The Telegram
32
+ sink does not exist unless a config file says `enabled: true` and names a
33
+ target. Absent config, absent file, unreadable file — no sink.
34
+ - **A sink can never break the watcher.** Sinks are called inside a
35
+ try/except; a failing `hermes send` costs a line on stderr.
36
+ - **The push is an accelerator, never the contract.** `GET /events?after=…`
37
+ stays the feed of record; `EventStream` hands the same numbered events to a
38
+ socket sooner. Both share one cursor, so anything the socket drops the next
39
+ poll picks up.
40
+ """
41
+
42
+ import asyncio
43
+ import json
44
+ import os
45
+ import queue
46
+ import subprocess
47
+ import sys
48
+ import threading
49
+ from collections import deque
50
+ from dataclasses import dataclass, field, replace
51
+ from datetime import datetime, timezone
52
+ from pathlib import Path
53
+
54
+ # The gateway imports the plugin api by path, which does not put this directory
55
+ # on sys.path; `python3 watch.py --daemon` needs the same guarantee.
56
+ _HERE = Path(__file__).resolve().parent
57
+ if str(_HERE) not in sys.path:
58
+ sys.path.insert(0, str(_HERE))
59
+
60
+ import coms_registry # noqa: E402
61
+ import herdr_source # noqa: E402
62
+ import sessions # noqa: E402
63
+
64
+ # A question has to persist this long before it is worth a notification. An
65
+ # orchestrator that asks something and answers itself two polls later was never
66
+ # news, and a fleet that pings the phone for those stops being read.
67
+ HOLD_MS = 20_000
68
+
69
+ # The same (kind, agent) is not repeated inside this window even if the state
70
+ # flaps. Transitions are edge-triggered, so this is the second line of defence.
71
+ COLLAPSE_MS = 60_000
72
+
73
+ # Hard ceiling per rolling minute. A fleet that is genuinely falling over
74
+ # produces one `throttled` event saying how much was suppressed, not forty
75
+ # toasts.
76
+ MAX_PER_MINUTE = 12
77
+
78
+ # Events kept for `since()`. Bounded, per process, lost on restart — the same
79
+ # contract as the dispatch transcript.
80
+ BUFFER_SIZE = 200
81
+
82
+ # How long a stream waits for news before saying something anyway. The frame is
83
+ # empty, and it is not for the events: it tells the pane the socket is still the
84
+ # live feed, which is the only reason the pane is allowed to slow its poll down.
85
+ # A socket that stops speaking therefore degrades to "poll every 5s" on its own,
86
+ # without anyone having to detect a broken connection.
87
+ STREAM_KEEPALIVE_S = 20.0
88
+
89
+ # Batches one slow client may fall behind before the stream stops queueing for
90
+ # it. Dropping is safe by construction: the poll shares the cursor, so a dropped
91
+ # batch arrives late rather than never — which is exactly why the poll stays.
92
+ STREAM_QUEUE = 64
93
+
94
+ # How often the background runner takes its own snapshot. The pane polls at 3s
95
+ # while it is visible; this is for when it is not, so it trades latency for a
96
+ # quarter of the subprocess cost. `0` disables the thread entirely.
97
+ DEFAULT_INTERVAL_S = 15.0
98
+
99
+ # Where the Telegram opt-in lives. Profile-scoped rather than in the repo,
100
+ # because the plugin directory is a symlink INTO the repo on a normal install.
101
+ CONFIG_ENV = "AGENT_FLEET_WATCH_CONFIG"
102
+ CONFIG_BASENAME = "agent-fleet-watch.json"
103
+ INTERVAL_ENV = "AGENT_FLEET_WATCH_INTERVAL"
104
+
105
+ # What `hermes send --to` and `--profile` may contain, checked before either
106
+ # reaches argv. Mirrors HERMES_PROFILE_RE in .pi/agent-fleet/scripts/coms-hermes-bridge.ts.
107
+ _TARGET_CHARS = set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:._-")
108
+
109
+ NEEDS_ANSWER = "needs_answer"
110
+ UNBLOCKED = "unblocked"
111
+ FINISHED = "finished"
112
+ VANISHED = "vanished"
113
+ STALE = "stale"
114
+ DISPATCH_ANSWERED = "dispatch_answered"
115
+ DISPATCH_FAILED = "dispatch_failed"
116
+ THROTTLED = "throttled"
117
+
118
+ # Only `needs_answer` waits. Everything else describes something already over,
119
+ # and holding it back would only make it arrive late.
120
+ _HELD_KINDS = (NEEDS_ANSWER,)
121
+
122
+ # The renderer's words for a dispatch that did not answer (presentation.js),
123
+ # repeated here so one vocabulary reaches both the pane and the phone.
124
+ _DISPATCH_LABEL = {"error": "refused", "failed": "not delivered", "timeout": "no answer"}
125
+
126
+ _TERMINAL_DISPATCH = {"answered", "error", "failed", "timeout"}
127
+
128
+
129
+ @dataclass(frozen=True)
130
+ class Event:
131
+ """One thing that happened, already in words.
132
+
133
+ `seq` is assigned by the buffer, not by the detector: the pure layer has no
134
+ idea how many events came before it, and must not pretend to.
135
+ """
136
+
137
+ kind: str
138
+ project: str
139
+ name: str
140
+ message: str
141
+ at: str
142
+ seq: int = 0
143
+
144
+ @property
145
+ def key(self) -> tuple[str, str, str]:
146
+ return (self.kind, self.project, self.name)
147
+
148
+ def as_dict(self) -> dict:
149
+ return {
150
+ "seq": self.seq,
151
+ "kind": self.kind,
152
+ "project": self.project,
153
+ "name": self.name,
154
+ "message": self.message,
155
+ "at": self.at,
156
+ }
157
+
158
+
159
+ def format_age(seconds) -> str:
160
+ """`45s`, `3m12s`, `2h13m` — the port of formatAge() in presentation.js.
161
+
162
+ An unreadable input is the empty string, never `0s`: a caller pasting that
163
+ into a sentence must render nothing rather than make a claim.
164
+ """
165
+ if not isinstance(seconds, (int, float)) or isinstance(seconds, bool) or seconds < 0:
166
+ return ""
167
+ whole = int(seconds)
168
+ if whole < 60:
169
+ return f"{whole}s"
170
+ if whole < 3600:
171
+ return f"{whole // 60}m{whole % 60:02d}s"
172
+ if whole < 86400:
173
+ return f"{whole // 3600}h{(whole % 3600) // 60}m"
174
+ return f"{whole // 86400}d{(whole % 86400) // 3600}h"
175
+
176
+
177
+ def _who(project: str, name: str) -> str:
178
+ return f"{name} · {project}"
179
+
180
+
181
+ def rows_by_key(snapshot: dict | None) -> dict[tuple[str, str], dict]:
182
+ """`(project, name)` -> row, flattened out of the grouped payload."""
183
+ index: dict[tuple[str, str], dict] = {}
184
+ for group in (snapshot or {}).get("projects") or []:
185
+ project = group.get("project") or ""
186
+ for row in group.get("sessions") or []:
187
+ name = row.get("name")
188
+ if name:
189
+ index[(project, name)] = row
190
+ return index
191
+
192
+
193
+ def dispatches_by_id(snapshot: dict | None) -> dict[str, dict]:
194
+ return {
195
+ row["msg_id"]: row
196
+ for row in (snapshot or {}).get("dispatches") or []
197
+ if isinstance(row, dict) and row.get("msg_id")
198
+ }
199
+
200
+
201
+ def is_evidence(snapshot: dict | None) -> bool:
202
+ """Whether this snapshot can be compared with another one at all.
203
+
204
+ A payload herdr did not contribute to says nothing about what anyone is
205
+ doing — every row reads `unknown` for one reason that has nothing to do with
206
+ the fleet. Diffing it would announce the entire roster twice: once as it
207
+ goes blind, once as it comes back.
208
+ """
209
+ if not isinstance(snapshot, dict) or snapshot.get("herdr") is not True:
210
+ return False
211
+ return coms_registry.parse_timestamp_ms(snapshot.get("collected_at")) is not None
212
+
213
+
214
+ def diff_snapshots(prev: dict | None, nxt: dict) -> list[Event]:
215
+ """Every transition between two comparable snapshots, in a stable order.
216
+
217
+ Pure: the only clock is `nxt["collected_at"]`. The FIRST snapshot produces
218
+ nothing — a fleet that already exists is not news, and reporting it would
219
+ make every gateway restart announce the whole roster.
220
+ """
221
+ at = str(nxt.get("collected_at") or "")
222
+ if prev is None:
223
+ return []
224
+
225
+ before = rows_by_key(prev)
226
+ after = rows_by_key(nxt)
227
+ events: list[Event] = []
228
+
229
+ for key in sorted(before):
230
+ project, name = key
231
+ old = before[key]
232
+ new = after.get(key)
233
+
234
+ if new is None:
235
+ # Gone from the registry means the process is gone: `entry_is_live`
236
+ # probes the pid. Whether that is good news depends entirely on what
237
+ # it was doing when we last looked.
238
+ uptime = format_age(old.get("uptime_s"))
239
+ after_clause = f" after {uptime}" if uptime else ""
240
+ if old.get("state") == "working":
241
+ events.append(
242
+ Event(VANISHED, project, name, f"{_who(project, name)} vanished while working{after_clause}", at)
243
+ )
244
+ else:
245
+ events.append(Event(FINISHED, project, name, f"{_who(project, name)} ended{after_clause}", at))
246
+ continue
247
+
248
+ was_blocked = bool(old.get("needs_answer"))
249
+ is_blocked = bool(new.get("needs_answer"))
250
+ if is_blocked and not was_blocked:
251
+ events.append(Event(NEEDS_ANSWER, project, name, f"{_who(project, name)} needs an answer", at))
252
+ elif was_blocked and not is_blocked:
253
+ events.append(Event(UNBLOCKED, project, name, f"{_who(project, name)} is no longer waiting", at))
254
+
255
+ if new.get("stale") and not old.get("stale"):
256
+ age = format_age(new.get("heartbeat_age_s"))
257
+ for_clause = f" for {age}" if age else ""
258
+ events.append(
259
+ Event(STALE, project, name, f"{_who(project, name)} has not heartbeat{for_clause}", at)
260
+ )
261
+
262
+ old_dispatches = dispatches_by_id(prev)
263
+ for msg_id, dispatch in sorted(dispatches_by_id(nxt).items()):
264
+ status = dispatch.get("status")
265
+ was = (old_dispatches.get(msg_id) or {}).get("status")
266
+ # Only the crossing into a terminal state. A dispatch that is already
267
+ # answered when we first see it was answered before we were watching.
268
+ if status not in _TERMINAL_DISPATCH or was == status or msg_id not in old_dispatches:
269
+ continue
270
+ project = dispatch.get("project") or ""
271
+ name = dispatch.get("name") or ""
272
+ if status == "answered":
273
+ events.append(Event(DISPATCH_ANSWERED, project, name, f"{_who(project, name)} answered", at))
274
+ else:
275
+ reason = dispatch.get("detail") or _DISPATCH_LABEL.get(status, status)
276
+ events.append(Event(DISPATCH_FAILED, project, name, f"{_who(project, name)}: {reason}", at))
277
+
278
+ return events
279
+
280
+
281
+ @dataclass
282
+ class _Held:
283
+ event: Event
284
+ since_ms: float
285
+
286
+
287
+ @dataclass
288
+ class Watcher:
289
+ """The memory around `diff_snapshots`: debounce, collapse, cap, buffer.
290
+
291
+ Thread-safe because two things feed it — the `/sessions` request handler and
292
+ the background runner — and one thing drains it.
293
+ """
294
+
295
+ hold_ms: float = HOLD_MS
296
+ collapse_ms: float = COLLAPSE_MS
297
+ max_per_minute: int = MAX_PER_MINUTE
298
+ capacity: int = BUFFER_SIZE
299
+ sinks: list = field(default_factory=list)
300
+
301
+ def __post_init__(self):
302
+ self._lock = threading.RLock()
303
+ self._prev: dict | None = None
304
+ self._held: dict[tuple[str, str], _Held] = {}
305
+ self._emitted: dict[tuple[str, str, str], float] = {}
306
+ self._window: deque[float] = deque()
307
+ self._throttled_at: float | None = None
308
+ self._buffer: deque[Event] = deque(maxlen=self.capacity)
309
+ self._seq = 0
310
+ # Outbound work never runs on the thread that observed. `hermes send`
311
+ # is a subprocess with a timeout, and a `/sessions` request must not
312
+ # wait on it — nor hold the lock the pane's next poll needs.
313
+ self._outbox: queue.Queue = queue.Queue(maxsize=200)
314
+ self._sender: threading.Thread | None = None
315
+ # Live listeners (one per open WebSocket). Separate from `sinks`: a sink
316
+ # is a channel out of the machine and runs on its own thread, a
317
+ # subscriber is a client already waiting and is handed the batch
318
+ # directly.
319
+ self._subscribers: list = []
320
+ # Monotone: snapshots from two feeders can arrive out of order, and time
321
+ # running backwards would release a hold early or reopen the cap.
322
+ self._clock = 0.0
323
+
324
+ # ── the in ─────────────────────────────────────────────────────────────
325
+
326
+ def observe(self, snapshot: dict) -> list[Event]:
327
+ """Fold one snapshot in and return whatever became news because of it."""
328
+ if not is_evidence(snapshot):
329
+ return []
330
+
331
+ with self._lock:
332
+ now_ms = max(self._clock, coms_registry.parse_timestamp_ms(snapshot.get("collected_at")) or 0.0)
333
+ self._clock = now_ms
334
+ raw = diff_snapshots(self._prev, snapshot)
335
+ self._prev = snapshot
336
+
337
+ ready: list[Event] = []
338
+ for event in raw:
339
+ key = (event.project, event.name)
340
+ if event.kind in _HELD_KINDS:
341
+ self._held.setdefault(key, _Held(event, now_ms))
342
+ elif event.kind == UNBLOCKED and key in self._held:
343
+ # Answered inside the debounce. We never said it was
344
+ # waiting, so saying it has stopped is noise about nothing.
345
+ del self._held[key]
346
+ else:
347
+ ready.append(event)
348
+
349
+ ready.extend(self._release_held(snapshot, now_ms))
350
+ numbered = self._emit(ready, now_ms)
351
+
352
+ # Outside the lock on purpose — see `_outbox`.
353
+ if numbered:
354
+ self._forward(numbered)
355
+ self._publish(numbered)
356
+ return numbered
357
+
358
+ def _release_held(self, snapshot: dict, now_ms: float) -> list[Event]:
359
+ """Questions that outlived the debounce, and the ones that never will.
360
+
361
+ A row that stopped waiting before the hold expired is dropped in
362
+ silence: it was answered inside 20 seconds, so there is nothing to tell
363
+ anyone, and — since no `needs_answer` was ever sent — no `unblocked`
364
+ either. That pairing is the whole point of holding it here rather than
365
+ filtering on the way out.
366
+ """
367
+ rows = rows_by_key(snapshot)
368
+ released: list[Event] = []
369
+ for key, held in list(self._held.items()):
370
+ row = rows.get(key)
371
+ if row is None or not row.get("needs_answer"):
372
+ del self._held[key]
373
+ continue
374
+ if now_ms - held.since_ms >= self.hold_ms:
375
+ del self._held[key]
376
+ # Re-stamped: the event is dated when it is told, not when the
377
+ # question first appeared — the message says "needs an answer",
378
+ # present tense, and it is true at this snapshot.
379
+ released.append(replace(held.event, at=str(snapshot.get("collected_at") or held.event.at)))
380
+ return released
381
+
382
+ def _emit(self, events: list[Event], now_ms: float) -> list[Event]:
383
+ """Collapse, cap, number, buffer. Called under the lock."""
384
+ kept: list[Event] = []
385
+ for event in events:
386
+ last = self._emitted.get(event.key)
387
+ if last is not None and now_ms - last < self.collapse_ms:
388
+ continue
389
+ self._emitted[event.key] = now_ms
390
+ kept.append(event)
391
+
392
+ # The ledger only matters inside the collapse window; keeping a row for
393
+ # every agent that ever existed would be a slow leak in a long-lived
394
+ # gateway.
395
+ self._emitted = {key: at for key, at in self._emitted.items() if now_ms - at < self.collapse_ms}
396
+
397
+ while self._window and now_ms - self._window[0] > 60_000:
398
+ self._window.popleft()
399
+
400
+ allowed = max(0, self.max_per_minute - len(self._window))
401
+ suppressed = max(0, len(kept) - allowed)
402
+ kept = kept[:allowed]
403
+ if suppressed > 0:
404
+ # One line about the flood rather than the flood. Repeated at most
405
+ # once a minute, so a fleet stuck in a loop cannot escalate through
406
+ # its own throttle notice.
407
+ if self._throttled_at is None or now_ms - self._throttled_at >= 60_000:
408
+ self._throttled_at = now_ms
409
+ kept.append(
410
+ Event(
411
+ THROTTLED,
412
+ "",
413
+ "",
414
+ f"{suppressed} more fleet events suppressed this minute",
415
+ datetime.fromtimestamp(now_ms / 1000, timezone.utc).isoformat(timespec="seconds").replace("+00:00", "Z"),
416
+ )
417
+ )
418
+
419
+ numbered: list[Event] = []
420
+ for event in kept:
421
+ self._seq += 1
422
+ self._window.append(now_ms)
423
+ stamped = replace(event, seq=self._seq)
424
+ self._buffer.append(stamped)
425
+ numbered.append(stamped)
426
+
427
+ return numbered
428
+
429
+ def _forward(self, events: list[Event]) -> None:
430
+ """Hand the batch to the sender thread; never block the caller.
431
+
432
+ A full outbox means the sinks are slower than the fleet is eventful. The
433
+ batch is dropped with a line on stderr rather than queued forever: these
434
+ are notifications about a live fleet, and a message about a question
435
+ somebody answered ten minutes ago is worse than no message.
436
+ """
437
+ if not self.sinks:
438
+ return
439
+ self._ensure_sender()
440
+ try:
441
+ self._outbox.put_nowait(events)
442
+ except queue.Full:
443
+ print(f"agent-fleet-herdr: watch outbox full, dropped {len(events)} events", file=sys.stderr)
444
+
445
+ def _ensure_sender(self) -> None:
446
+ with self._lock:
447
+ if self._sender is not None and self._sender.is_alive():
448
+ return
449
+ self._sender = threading.Thread(target=self._drain, name="agent-fleet-watch-send", daemon=True)
450
+ self._sender.start()
451
+
452
+ def _drain(self) -> None:
453
+ while True:
454
+ events = self._outbox.get()
455
+ try:
456
+ for sink in self.sinks:
457
+ try:
458
+ sink(events)
459
+ except Exception as error: # a sink is never allowed to stop the watcher
460
+ print(f"agent-fleet-herdr: watch sink failed: {error}", file=sys.stderr)
461
+ finally:
462
+ self._outbox.task_done()
463
+
464
+ def flush(self) -> None:
465
+ """Block until the outbox is empty. For tests and for `--once`."""
466
+ self._outbox.join()
467
+
468
+ # ── the out ────────────────────────────────────────────────────────────
469
+
470
+ def since(self, after: int = 0) -> dict:
471
+ """Everything numbered above `after`, plus where the sequence now is.
472
+
473
+ `seq` is returned even when the list is empty, so a client that has been
474
+ away longer than the buffer resumes from the present instead of
475
+ replaying whatever survived.
476
+ """
477
+ with self._lock:
478
+ events = [event for event in self._buffer if event.seq > after]
479
+ return {"events": [event.as_dict() for event in events], "seq": self._seq}
480
+
481
+ def subscribe(self, callback):
482
+ """Be told, instead of asking. Returns the unsubscribe.
483
+
484
+ `callback(events)` runs on whichever thread observed the snapshot — a
485
+ `/sessions` request handler or the background runner — so a subscriber
486
+ must not block and must not raise. `EventStream`, the only one that
487
+ matters, does nothing but hand the batch to an event loop.
488
+
489
+ This does not replace `since()`: a subscriber is only told what happens
490
+ while it is subscribed, and the buffer is what covers the gap around
491
+ that. Both are used together, in that order.
492
+ """
493
+ with self._lock:
494
+ self._subscribers.append(callback)
495
+
496
+ def unsubscribe() -> None:
497
+ with self._lock:
498
+ if callback in self._subscribers:
499
+ self._subscribers.remove(callback)
500
+
501
+ return unsubscribe
502
+
503
+ def _publish(self, events: list[Event]) -> None:
504
+ """Fan a batch out to the live listeners. Called outside the lock.
505
+
506
+ Same rule as the sinks, for the same reason: a listener that raises is
507
+ a client with a problem, not a fleet with one.
508
+ """
509
+ with self._lock:
510
+ subscribers = list(self._subscribers)
511
+ for callback in subscribers:
512
+ try:
513
+ callback(events)
514
+ except Exception as error: # a listener is never allowed to stop the watcher
515
+ print(f"agent-fleet-herdr: watch subscriber failed: {error}", file=sys.stderr)
516
+
517
+
518
+ class EventStream:
519
+ """One WebSocket's view of the watcher: the backlog it missed, then live.
520
+
521
+ Subscribe first, read the backlog second. The other order has a hole in it —
522
+ an event landing between the two would be in neither — and this order can
523
+ only produce a duplicate, which is the failure worth having: every frame is
524
+ filtered against the cursor, so a repeat dies here instead of becoming a
525
+ second toast.
526
+
527
+ The cursor is the same number `GET /events?after=` takes, on purpose. The
528
+ two feeds are interchangeable, which is what makes the poll a real fallback
529
+ rather than a second implementation of the same idea.
530
+ """
531
+
532
+ def __init__(self, watcher: Watcher, after: int = 0, loop=None, maxsize: int = STREAM_QUEUE):
533
+ self._watcher = watcher
534
+ self._seq = max(0, int(after or 0))
535
+ # Captured at construction, on the thread that will consume the frames:
536
+ # events arrive on somebody else's thread and have to be handed over.
537
+ self._loop = loop or asyncio.get_running_loop()
538
+ self._queue: asyncio.Queue = asyncio.Queue(maxsize=maxsize)
539
+ self._unsubscribe = watcher.subscribe(self._offer)
540
+
541
+ def _offer(self, events: list[Event]) -> None:
542
+ """Called by the watcher, on the watcher's thread. Must not block."""
543
+ try:
544
+ self._loop.call_soon_threadsafe(self._enqueue, events)
545
+ except RuntimeError:
546
+ # The loop is closed — this connection is already gone and the
547
+ # unsubscribe is racing us. Nothing to report.
548
+ pass
549
+
550
+ def _enqueue(self, events: list[Event]) -> None:
551
+ try:
552
+ self._queue.put_nowait(events)
553
+ except asyncio.QueueFull:
554
+ # See STREAM_QUEUE: the poll shares this cursor, so the client gets
555
+ # these events late rather than not at all.
556
+ print(
557
+ f"agent-fleet-herdr: event stream is behind, dropped {len(events)} events",
558
+ file=sys.stderr,
559
+ )
560
+
561
+ def backlog(self) -> dict:
562
+ """Whatever the buffer holds past the cursor — the first frame sent."""
563
+ payload = self._watcher.since(self._seq)
564
+ return self._frame(payload.get("events") or [], payload.get("seq"))
565
+
566
+ async def next_frame(self, timeout: float = STREAM_KEEPALIVE_S) -> dict:
567
+ """The next batch, or an empty keepalive once `timeout` passes."""
568
+ try:
569
+ events = await asyncio.wait_for(self._queue.get(), timeout)
570
+ except asyncio.TimeoutError:
571
+ return {"events": [], "seq": self._seq, "keepalive": True}
572
+ return self._frame(events)
573
+
574
+ def _frame(self, events, seq=None) -> dict:
575
+ """Serialize, drop anything at or behind the cursor, advance it.
576
+
577
+ Takes `Event`s (from the subscription) or dicts (from the buffer)
578
+ because both feed the same connection.
579
+ """
580
+ rows = [event.as_dict() if isinstance(event, Event) else dict(event) for event in events]
581
+ fresh = [row for row in rows if _row_seq(row) > self._seq]
582
+ self._seq = max([self._seq, int(seq or 0), *[_row_seq(row) for row in fresh]])
583
+ return {"events": fresh, "seq": self._seq}
584
+
585
+ def close(self) -> None:
586
+ self._unsubscribe()
587
+
588
+
589
+ def _row_seq(row: dict) -> int:
590
+ try:
591
+ return int(row.get("seq") or 0)
592
+ except (TypeError, ValueError):
593
+ return 0
594
+
595
+
596
+ # ── the I/O side ───────────────────────────────────────────────────────────
597
+
598
+
599
+ def collect_snapshot(dispatcher=None) -> dict:
600
+ """The `/sessions` payload — the one composition, used by both feeders.
601
+
602
+ Raises `coms_registry.RegistryUnavailable` when the registry itself cannot
603
+ be read; a herdr that does not answer is a normal payload with `herdr:
604
+ false`, exactly as the endpoint promises.
605
+ """
606
+ projects = coms_registry.live_sessions_by_project()
607
+ try:
608
+ panes, pane_total = herdr_source.pane_snapshot()
609
+ except herdr_source.HerdrUnavailable:
610
+ panes, pane_total = None, None
611
+ payload = sessions.build_sessions(projects, panes, pane_total=pane_total)
612
+ if dispatcher is not None:
613
+ payload["dispatches"] = dispatcher.recent()
614
+ return payload
615
+
616
+
617
+ def config_path() -> Path:
618
+ override = os.environ.get(CONFIG_ENV)
619
+ if override:
620
+ return Path(override).expanduser()
621
+ return Path(os.environ.get("HERMES_HOME") or "~/.hermes").expanduser() / CONFIG_BASENAME
622
+
623
+
624
+ def _safe_token(value) -> str | None:
625
+ if not isinstance(value, str) or not value or len(value) > 64:
626
+ return None
627
+ return value if set(value) <= _TARGET_CHARS else None
628
+
629
+
630
+ def load_config(path: Path | None = None) -> dict:
631
+ """The opt-in, or `{}`.
632
+
633
+ Every failure — no file, bad JSON, unreadable — is the same answer: there is
634
+ no configuration, so there is no outbound sink. A notification channel that
635
+ turns itself on because a file half-parsed is not a channel anyone should
636
+ trust.
637
+ """
638
+ path = path if path is not None else config_path()
639
+ try:
640
+ parsed = json.loads(Path(path).read_text(encoding="utf-8"))
641
+ except (OSError, ValueError):
642
+ return {}
643
+ return parsed if isinstance(parsed, dict) else {}
644
+
645
+
646
+ class HermesSink:
647
+ """`hermes send --to <target>` for each event, one subprocess at a time.
648
+
649
+ Spawned exactly as .pi/agent-fleet/scripts/coms-hermes-bridge.ts spawns it — no shell, and
650
+ the target and profile are validated against a character class before they
651
+ reach argv, because both come out of a config file.
652
+ """
653
+
654
+ def __init__(self, target: str, profile: str | None = None, kinds=None, timeout_s: float = 20.0, runner=None):
655
+ self.target = target
656
+ self.profile = profile
657
+ # `None` means every kind. An explicit list is the way to get only the
658
+ # two that wake a phone at night.
659
+ self.kinds = set(kinds) if kinds else None
660
+ self.timeout_s = timeout_s
661
+ self._run = runner or subprocess.run
662
+
663
+ def __call__(self, events) -> None:
664
+ for event in events:
665
+ if self.kinds is not None and event.kind not in self.kinds:
666
+ continue
667
+ args = ["hermes"]
668
+ if self.profile:
669
+ args += ["--profile", self.profile]
670
+ args += ["send", "--to", self.target, event.message]
671
+ try:
672
+ result = self._run(args, capture_output=True, text=True, timeout=self.timeout_s, check=False)
673
+ except (OSError, subprocess.SubprocessError) as error:
674
+ print(f"agent-fleet-herdr: hermes send failed: {error}", file=sys.stderr)
675
+ continue
676
+ if getattr(result, "returncode", 1) != 0:
677
+ detail = (getattr(result, "stderr", "") or getattr(result, "stdout", "") or "").strip()
678
+ print(f"agent-fleet-herdr: hermes send failed: {detail}", file=sys.stderr)
679
+
680
+
681
+ def build_sink(config: dict):
682
+ """The Telegram sink, or `None` — which is what an absent opt-in means.
683
+
684
+ Three separate things must be true and are checked separately, so a
685
+ half-written config is off rather than aimed somewhere unintended:
686
+ `telegram.enabled is True`, a target that survives validation, and — if
687
+ given — a profile that does too.
688
+ """
689
+ telegram = config.get("telegram")
690
+ if not isinstance(telegram, dict) or telegram.get("enabled") is not True:
691
+ return None
692
+ target = _safe_token(telegram.get("target"))
693
+ if target is None:
694
+ print("agent-fleet-herdr: watch config has telegram.enabled but no usable target", file=sys.stderr)
695
+ return None
696
+ profile = telegram.get("profile")
697
+ if profile is not None and _safe_token(profile) is None:
698
+ print("agent-fleet-herdr: watch config has an unusable telegram.profile", file=sys.stderr)
699
+ return None
700
+ kinds = telegram.get("kinds")
701
+ return HermesSink(target, profile=profile, kinds=kinds if isinstance(kinds, list) else None)
702
+
703
+
704
+ def build_watcher(config: dict | None = None) -> Watcher:
705
+ config = load_config() if config is None else config
706
+ sink = build_sink(config)
707
+ return Watcher(sinks=[sink] if sink else [])
708
+
709
+
710
+ def interval_from(config: dict) -> float:
711
+ """Seconds between the runner's own snapshots; `0` means no runner.
712
+
713
+ The environment wins over the file so the background thread can be switched
714
+ off for one process — a test run, a second gateway — without editing a
715
+ config that another process is reading.
716
+ """
717
+ override = os.environ.get(INTERVAL_ENV)
718
+ if override is not None:
719
+ try:
720
+ return max(0.0, float(override))
721
+ except ValueError:
722
+ print(f"agent-fleet-herdr: {INTERVAL_ENV}={override!r} is not a number", file=sys.stderr)
723
+ value = config.get("interval_s", DEFAULT_INTERVAL_S)
724
+ if not isinstance(value, (int, float)) or isinstance(value, bool) or value < 0:
725
+ return DEFAULT_INTERVAL_S
726
+ return float(value)
727
+
728
+
729
+ def run_forever(watcher: Watcher, interval_s: float, dispatcher=None, stop: threading.Event | None = None) -> None:
730
+ """Snapshot on a timer until told to stop. Survives every source failing.
731
+
732
+ The loop is what makes the pane optional: the request handler only feeds the
733
+ watcher while someone is polling, and the whole point of this phase is to
734
+ learn about a stuck agent when nobody is looking.
735
+ """
736
+ stop = stop or threading.Event()
737
+ while not stop.is_set():
738
+ try:
739
+ watcher.observe(collect_snapshot(dispatcher))
740
+ except Exception as error: # a bad snapshot must not end the thread
741
+ print(f"agent-fleet-herdr: watch poll failed: {error}", file=sys.stderr)
742
+ stop.wait(interval_s)
743
+
744
+
745
+ _runner_lock = threading.Lock()
746
+ _runner: threading.Thread | None = None
747
+
748
+
749
+ def ensure_runner(watcher: Watcher, interval_s: float, dispatcher=None) -> threading.Thread | None:
750
+ """Start the background loop once, on first use. Idempotent by design.
751
+
752
+ Lazy rather than at import: the gateway constructs its routers whether or
753
+ not anyone opens the pane, and a plugin nobody uses should not be running
754
+ `herdr agent list` in a loop.
755
+ """
756
+ global _runner
757
+ if interval_s <= 0:
758
+ return None
759
+ with _runner_lock:
760
+ if _runner is not None and _runner.is_alive():
761
+ return _runner
762
+ _runner = threading.Thread(
763
+ target=run_forever,
764
+ args=(watcher, interval_s, dispatcher),
765
+ name="agent-fleet-watch",
766
+ daemon=True,
767
+ )
768
+ _runner.start()
769
+ return _runner
770
+
771
+
772
+ def main(argv: list[str] | None = None) -> int:
773
+ """`python3 watch.py --daemon` — the watcher without a Desktop window.
774
+
775
+ The in-gateway runner dies with the process that hosts it, and the Desktop's
776
+ own gateway dies with the Desktop app. Anything that has to reach a phone
777
+ while nothing is open belongs here, under systemd or a terminal.
778
+ """
779
+ argv = list(sys.argv[1:] if argv is None else argv)
780
+ config = load_config()
781
+ interval = interval_from(config)
782
+ if "--interval" in argv:
783
+ try:
784
+ interval = float(argv[argv.index("--interval") + 1])
785
+ except (IndexError, ValueError):
786
+ print("--interval wants a number of seconds", file=sys.stderr)
787
+ return 2
788
+
789
+ watcher = build_watcher(config)
790
+ if not watcher.sinks and "--daemon" in argv:
791
+ print(
792
+ f"agent-fleet-herdr: no outbound sink configured ({config_path()}); "
793
+ "the daemon will detect events and send nothing",
794
+ file=sys.stderr,
795
+ )
796
+
797
+ # There is nothing to report from a single snapshot — the first one is never
798
+ # news — so the one-shot mode prints what the watcher SEES. That is the
799
+ # question worth asking a live gateway: is the payload the one I expect?
800
+ if "--snapshot" in argv:
801
+ print(json.dumps(collect_snapshot(), indent=2))
802
+ return 0
803
+
804
+ if "--daemon" not in argv:
805
+ print(__doc__)
806
+ print("usage: watch.py --daemon [--interval SECONDS] | --snapshot", file=sys.stderr)
807
+ return 2
808
+
809
+ interval = interval or DEFAULT_INTERVAL_S
810
+ print(f"agent-fleet-herdr: watching every {interval:g}s", file=sys.stderr)
811
+ try:
812
+ run_forever(watcher, interval)
813
+ except KeyboardInterrupt:
814
+ return 0
815
+ return 0
816
+
817
+
818
+ if __name__ == "__main__":
819
+ raise SystemExit(main())