@chankov/agent-fleet 2.0.23 → 2.1.0

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 (816) hide show
  1. package/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
  2. package/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +59 -0
  3. package/.pi/agent-fleet/scripts/fleet.ts +3 -0
  4. package/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +122 -0
  5. package/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +91 -0
  6. package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +349 -0
  7. package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
  8. package/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +72 -0
  9. package/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
  10. package/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +53 -0
  11. package/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +111 -0
  12. package/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
  13. package/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
  14. package/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +173 -0
  15. package/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +384 -0
  16. package/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
  17. package/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
  18. package/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
  19. package/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
  20. package/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
  21. package/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +23 -0
  22. package/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +81 -0
  23. package/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
  24. package/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
  25. package/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
  26. package/.pi/agent-fleet/scripts/lib/fleet-command.ts +2 -0
  27. package/.pi/agent-fleet/scripts/package-lock.json +22 -0
  28. package/.pi/agent-fleet/scripts/package.json +1 -0
  29. package/.pi/agents/voices.yaml +1 -1
  30. package/.pi/harnesses/agent-hub/README.md +61 -4
  31. package/.pi/harnesses/agent-hub/acceptance.ts +8 -4
  32. package/.pi/harnesses/agent-hub/access-approval.ts +146 -21
  33. package/.pi/harnesses/agent-hub/assertion-ledger.js +1 -0
  34. package/.pi/harnesses/agent-hub/commands/config.ts +9 -0
  35. package/.pi/harnesses/agent-hub/commands/context.ts +1 -0
  36. package/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +2 -2
  37. package/.pi/harnesses/agent-hub/damage-guard-approval.ts +41 -17
  38. package/.pi/harnesses/agent-hub/damage-guard-hub.ts +16 -9
  39. package/.pi/harnesses/agent-hub/damage-guard-state.ts +2 -2
  40. package/.pi/harnesses/agent-hub/dispatch-native-complete.ts +4 -1
  41. package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +4 -1
  42. package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +5 -0
  43. package/.pi/harnesses/agent-hub/dispatch-native-types.ts +1 -1
  44. package/.pi/harnesses/agent-hub/index.ts +73 -8
  45. package/.pi/harnesses/agent-hub/input/shortcuts.ts +3 -0
  46. package/.pi/harnesses/agent-hub/no-progress.ts +3 -3
  47. package/.pi/harnesses/agent-hub/operator-current-state.ts +53 -0
  48. package/.pi/harnesses/agent-hub/orchestration-activation.ts +1 -1
  49. package/.pi/harnesses/agent-hub/package.json +1 -1
  50. package/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
  51. package/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
  52. package/.pi/harnesses/agent-hub/process-obligations.ts +8 -3
  53. package/.pi/harnesses/agent-hub/prompts/fragments.ts +1 -1
  54. package/.pi/harnesses/agent-hub/prompts/session-start.ts +1 -1
  55. package/.pi/harnesses/agent-hub/return-contract.js +24 -2
  56. package/.pi/harnesses/agent-hub/review-reuse.ts +3 -3
  57. package/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
  58. package/.pi/harnesses/agent-hub/runtime-receipts.ts +60 -0
  59. package/.pi/harnesses/agent-hub/runtime-test-check.ts +11 -0
  60. package/.pi/harnesses/agent-hub/spawn.ts +50 -13
  61. package/.pi/harnesses/agent-hub/specialist-result.ts +15 -6
  62. package/.pi/harnesses/agent-hub/system1-communication-store.ts +8 -0
  63. package/.pi/harnesses/agent-hub/task-resume-contract.ts +5 -0
  64. package/.pi/harnesses/agent-hub/task-triage-authorization.ts +36 -17
  65. package/.pi/harnesses/agent-hub/tools/coms-tools.ts +4 -4
  66. package/.pi/harnesses/agent-hub/tools/context.ts +2 -1
  67. package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +2 -0
  68. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +133 -40
  69. package/.pi/harnesses/agent-hub/tools/verification-contract.ts +1 -0
  70. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +3 -1
  71. package/.pi/harnesses/agent-hub/work-mode.ts +3 -1
  72. package/.pi/harnesses/ask-user-remote/README.md +2 -2
  73. package/.pi/harnesses/ask-user-remote/questions.ts +49 -2
  74. package/.pi/harnesses/ask-user-remote/runtime-ask.ts +13 -6
  75. package/.pi/harnesses/coms/README.md +5 -0
  76. package/.pi/harnesses/coms/index.ts +25 -2
  77. package/.pi/harnesses/coms/package.json +1 -1
  78. package/.pi/harnesses/damage-control-continue/index.ts +69 -31
  79. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  80. package/.pi/harnesses/lib/bash-policy-analysis.ts +1 -1
  81. package/.pi/harnesses/lib/coms-core-io.ts +8 -1
  82. package/.pi/harnesses/lib/coms-core.ts +42 -8
  83. package/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
  84. package/.pi/harnesses/lib/coms-observation.ts +74 -0
  85. package/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
  86. package/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
  87. package/.pi/harnesses/lib/damage-control-shared.ts +46 -15
  88. package/.pi/harnesses/lib/exact-permission-port.ts +38 -0
  89. package/.pi/harnesses/lib/fleet-codex-event-bridge.ts +81 -0
  90. package/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
  91. package/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
  92. package/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
  93. package/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
  94. package/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
  95. package/.pi/harnesses/lib/fleet-config/view.ts +338 -0
  96. package/.pi/harnesses/lib/fleet-dashboard-view.ts +3 -1
  97. package/.pi/harnesses/lib/fleet-event-source.ts +21 -0
  98. package/.pi/harnesses/lib/update-check.ts +5 -0
  99. package/.versions/2.1.0/.pi/agent-fleet/hermes/README.md +347 -0
  100. package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  101. package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  102. package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  103. package/.versions/2.1.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  104. package/.versions/2.1.0/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  105. package/.versions/2.1.0/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  106. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  107. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  108. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  109. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  110. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  111. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  112. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  113. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  114. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  115. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  116. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  117. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  118. package/.versions/2.1.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  119. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  120. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  121. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  122. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  123. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  124. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  125. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  126. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  127. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  128. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  129. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  130. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  131. package/.versions/2.1.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  132. package/.versions/2.1.0/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  133. package/.versions/2.1.0/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  134. package/.versions/2.1.0/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  135. package/.versions/2.1.0/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
  136. package/.versions/2.1.0/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
  137. package/.versions/2.1.0/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
  138. package/.versions/2.1.0/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  139. package/.versions/2.1.0/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
  140. package/.versions/2.1.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
  141. package/.versions/2.1.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +59 -0
  142. package/.versions/2.1.0/.pi/agent-fleet/scripts/fleet.ts +248 -0
  143. package/.versions/2.1.0/.pi/agent-fleet/scripts/flow.ts +166 -0
  144. package/.versions/2.1.0/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  145. package/.versions/2.1.0/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  146. package/.versions/2.1.0/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  147. package/.versions/2.1.0/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  148. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
  149. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +122 -0
  150. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +91 -0
  151. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  152. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  153. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +349 -0
  154. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
  155. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +72 -0
  156. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
  157. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +53 -0
  158. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +111 -0
  159. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
  160. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
  161. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +173 -0
  162. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +384 -0
  163. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
  164. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
  165. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
  166. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
  167. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
  168. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +23 -0
  169. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +81 -0
  170. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
  171. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
  172. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
  173. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/fleet-command.ts +268 -0
  174. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
  175. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +238 -0
  176. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  177. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  178. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  179. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  180. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  181. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  182. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  183. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  184. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  185. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  186. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  187. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  188. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  189. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  190. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  191. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  192. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  193. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  194. package/.versions/2.1.0/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
  195. package/.versions/2.1.0/.pi/agent-fleet/scripts/package-lock.json +57 -0
  196. package/.versions/2.1.0/.pi/agent-fleet/scripts/package.json +10 -0
  197. package/.versions/2.1.0/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  198. package/.versions/2.1.0/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
  199. package/.versions/2.1.0/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  200. package/.versions/2.1.0/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
  201. package/.versions/2.1.0/.pi/agent-fleet/scripts/team-up.ts +385 -0
  202. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
  203. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  204. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  205. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
  206. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  207. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  208. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/git.ts +99 -0
  209. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
  210. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  211. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  212. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  213. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
  214. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  215. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  216. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
  217. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/quality.ts +65 -0
  218. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
  219. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  220. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
  221. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  222. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
  223. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
  224. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  225. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  226. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  227. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  228. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  229. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  230. package/.versions/2.1.0/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  231. package/.versions/2.1.0/.pi/agents/dispatch-policy.yaml +32 -0
  232. package/.versions/2.1.0/.pi/agents/model-profiles.yaml +134 -0
  233. package/.versions/2.1.0/.pi/agents/peers.yaml +147 -0
  234. package/.versions/2.1.0/.pi/agents/teams.yaml +41 -0
  235. package/.versions/2.1.0/.pi/agents/voices.yaml +13 -0
  236. package/.versions/2.1.0/.pi/damage-control-rules.yaml +297 -0
  237. package/.versions/2.1.0/.pi/extensions/btw/README.md +120 -0
  238. package/.versions/2.1.0/.pi/extensions/btw/index.ts +916 -0
  239. package/.versions/2.1.0/.pi/extensions/btw/package.json +6 -0
  240. package/.versions/2.1.0/.pi/extensions/btw/state.js +179 -0
  241. package/.versions/2.1.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  242. package/.versions/2.1.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  243. package/.versions/2.1.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  244. package/.versions/2.1.0/.pi/extensions/compact-and-continue/README.md +42 -0
  245. package/.versions/2.1.0/.pi/extensions/compact-and-continue/index.ts +136 -0
  246. package/.versions/2.1.0/.pi/extensions/compact-and-continue/package.json +6 -0
  247. package/.versions/2.1.0/.pi/extensions/mcp-bridge/README.md +46 -0
  248. package/.versions/2.1.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  249. package/.versions/2.1.0/.pi/extensions/mcp-bridge/package.json +6 -0
  250. package/.versions/2.1.0/.pi/extensions/package-lock.json +1175 -0
  251. package/.versions/2.1.0/.pi/extensions/package.json +9 -0
  252. package/.versions/2.1.0/.pi/extensions/pi-voice-stt/README.md +224 -0
  253. package/.versions/2.1.0/.pi/extensions/pi-voice-stt/config.ts +199 -0
  254. package/.versions/2.1.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  255. package/.versions/2.1.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
  256. package/.versions/2.1.0/.pi/extensions/pi-voice-stt/package.json +6 -0
  257. package/.versions/2.1.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  258. package/.versions/2.1.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  259. package/.versions/2.1.0/.pi/harnesses/agent-hub/README.md +1584 -0
  260. package/.versions/2.1.0/.pi/harnesses/agent-hub/acceptance.ts +204 -0
  261. package/.versions/2.1.0/.pi/harnesses/agent-hub/access-approval.ts +266 -0
  262. package/.versions/2.1.0/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
  263. package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
  264. package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
  265. package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
  266. package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
  267. package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
  268. package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
  269. package/.versions/2.1.0/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
  270. package/.versions/2.1.0/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
  271. package/.versions/2.1.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
  272. package/.versions/2.1.0/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
  273. package/.versions/2.1.0/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
  274. package/.versions/2.1.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  275. package/.versions/2.1.0/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  276. package/.versions/2.1.0/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
  277. package/.versions/2.1.0/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  278. package/.versions/2.1.0/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
  279. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  280. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  281. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  282. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  283. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  284. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  285. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  286. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  287. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  288. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  289. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  290. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  291. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  292. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  293. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/config.ts +9 -0
  294. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  295. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/context.ts +47 -0
  296. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  297. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  298. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  299. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  300. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  301. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  302. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
  303. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  304. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  305. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  306. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  307. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  308. package/.versions/2.1.0/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  309. package/.versions/2.1.0/.pi/harnesses/agent-hub/config/agents.ts +181 -0
  310. package/.versions/2.1.0/.pi/harnesses/agent-hub/config/model-profiles.ts +237 -0
  311. package/.versions/2.1.0/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
  312. package/.versions/2.1.0/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  313. package/.versions/2.1.0/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
  314. package/.versions/2.1.0/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
  315. package/.versions/2.1.0/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  316. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  317. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
  318. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
  319. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
  320. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
  321. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
  322. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
  323. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
  324. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-compat.ts +30 -0
  325. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
  326. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
  327. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
  328. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
  329. package/.versions/2.1.0/.pi/harnesses/agent-hub/context-window.js +108 -0
  330. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
  331. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
  332. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
  333. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
  334. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
  335. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
  336. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
  337. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
  338. package/.versions/2.1.0/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
  339. package/.versions/2.1.0/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  340. package/.versions/2.1.0/.pi/harnesses/agent-hub/delegate.ts +478 -0
  341. package/.versions/2.1.0/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
  342. package/.versions/2.1.0/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  343. package/.versions/2.1.0/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  344. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
  345. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  346. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
  347. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +298 -0
  348. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +260 -0
  349. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native-types.ts +293 -0
  350. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-native.ts +236 -0
  351. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  352. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
  353. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
  354. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  355. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  356. package/.versions/2.1.0/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  357. package/.versions/2.1.0/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  358. package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  359. package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  360. package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  361. package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  362. package/.versions/2.1.0/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
  363. package/.versions/2.1.0/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  364. package/.versions/2.1.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  365. package/.versions/2.1.0/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
  366. package/.versions/2.1.0/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
  367. package/.versions/2.1.0/.pi/harnesses/agent-hub/external-blocker.js +92 -0
  368. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
  369. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
  370. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
  371. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
  372. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
  373. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
  374. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
  375. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
  376. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
  377. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
  378. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
  379. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
  380. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
  381. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
  382. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
  383. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
  384. package/.versions/2.1.0/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
  385. package/.versions/2.1.0/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
  386. package/.versions/2.1.0/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
  387. package/.versions/2.1.0/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  388. package/.versions/2.1.0/.pi/harnesses/agent-hub/footer.ts +30 -0
  389. package/.versions/2.1.0/.pi/harnesses/agent-hub/helpers.ts +270 -0
  390. package/.versions/2.1.0/.pi/harnesses/agent-hub/history-projection.ts +116 -0
  391. package/.versions/2.1.0/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
  392. package/.versions/2.1.0/.pi/harnesses/agent-hub/index.ts +2682 -0
  393. package/.versions/2.1.0/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  394. package/.versions/2.1.0/.pi/harnesses/agent-hub/input/shortcuts.ts +23 -0
  395. package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
  396. package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  397. package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +145 -0
  398. package/.versions/2.1.0/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
  399. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  400. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  401. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  402. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  403. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  404. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  405. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  406. package/.versions/2.1.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  407. package/.versions/2.1.0/.pi/harnesses/agent-hub/no-progress.ts +622 -0
  408. package/.versions/2.1.0/.pi/harnesses/agent-hub/operator-current-state.ts +53 -0
  409. package/.versions/2.1.0/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
  410. package/.versions/2.1.0/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
  411. package/.versions/2.1.0/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  412. package/.versions/2.1.0/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
  413. package/.versions/2.1.0/.pi/harnesses/agent-hub/package.json +7 -0
  414. package/.versions/2.1.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  415. package/.versions/2.1.0/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
  416. package/.versions/2.1.0/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
  417. package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  418. package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  419. package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  420. package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  421. package/.versions/2.1.0/.pi/harnesses/agent-hub/policy/work-mode.ts +142 -0
  422. package/.versions/2.1.0/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  423. package/.versions/2.1.0/.pi/harnesses/agent-hub/presentation.ts +54 -0
  424. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
  425. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  426. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
  427. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
  428. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  429. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  430. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
  431. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
  432. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
  433. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
  434. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  435. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  436. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-snapshot.ts +279 -0
  437. package/.versions/2.1.0/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
  438. package/.versions/2.1.0/.pi/harnesses/agent-hub/process-obligations.ts +164 -0
  439. package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/context.ts +55 -0
  440. package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/fragments.ts +86 -0
  441. package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  442. package/.versions/2.1.0/.pi/harnesses/agent-hub/prompts/system-prompt.ts +125 -0
  443. package/.versions/2.1.0/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  444. package/.versions/2.1.0/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  445. package/.versions/2.1.0/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  446. package/.versions/2.1.0/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  447. package/.versions/2.1.0/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
  448. package/.versions/2.1.0/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  449. package/.versions/2.1.0/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  450. package/.versions/2.1.0/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
  451. package/.versions/2.1.0/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
  452. package/.versions/2.1.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  453. package/.versions/2.1.0/.pi/harnesses/agent-hub/return-contract.js +371 -0
  454. package/.versions/2.1.0/.pi/harnesses/agent-hub/return-extract.js +77 -0
  455. package/.versions/2.1.0/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  456. package/.versions/2.1.0/.pi/harnesses/agent-hub/review-continuity.ts +73 -0
  457. package/.versions/2.1.0/.pi/harnesses/agent-hub/review-findings.js +96 -0
  458. package/.versions/2.1.0/.pi/harnesses/agent-hub/review-reuse.ts +47 -0
  459. package/.versions/2.1.0/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
  460. package/.versions/2.1.0/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  461. package/.versions/2.1.0/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  462. package/.versions/2.1.0/.pi/harnesses/agent-hub/run-budget.js +342 -0
  463. package/.versions/2.1.0/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  464. package/.versions/2.1.0/.pi/harnesses/agent-hub/runtime-receipts.ts +60 -0
  465. package/.versions/2.1.0/.pi/harnesses/agent-hub/runtime-test-check.ts +79 -0
  466. package/.versions/2.1.0/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
  467. package/.versions/2.1.0/.pi/harnesses/agent-hub/scope-gate.js +233 -0
  468. package/.versions/2.1.0/.pi/harnesses/agent-hub/session-audit.ts +331 -0
  469. package/.versions/2.1.0/.pi/harnesses/agent-hub/session-health.js +110 -0
  470. package/.versions/2.1.0/.pi/harnesses/agent-hub/session-start.ts +42 -0
  471. package/.versions/2.1.0/.pi/harnesses/agent-hub/spawn.ts +702 -0
  472. package/.versions/2.1.0/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
  473. package/.versions/2.1.0/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
  474. package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  475. package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
  476. package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  477. package/.versions/2.1.0/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
  478. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
  479. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-resume-contract.ts +75 -0
  480. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
  481. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
  482. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
  483. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  484. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
  485. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  486. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  487. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  488. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  489. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
  490. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  491. package/.versions/2.1.0/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  492. package/.versions/2.1.0/.pi/harnesses/agent-hub/timeline.ts +72 -0
  493. package/.versions/2.1.0/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +79 -0
  494. package/.versions/2.1.0/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
  495. package/.versions/2.1.0/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  496. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
  497. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
  498. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
  499. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  500. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/context.ts +145 -0
  501. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +90 -0
  502. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +734 -0
  503. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  504. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  505. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
  506. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
  507. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/run-flow.ts +146 -0
  508. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  509. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
  510. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  511. package/.versions/2.1.0/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
  512. package/.versions/2.1.0/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  513. package/.versions/2.1.0/.pi/harnesses/agent-hub/types.ts +66 -0
  514. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  515. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
  516. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  517. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  518. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +157 -0
  519. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  520. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  521. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  522. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  523. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  524. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  525. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  526. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  527. package/.versions/2.1.0/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  528. package/.versions/2.1.0/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  529. package/.versions/2.1.0/.pi/harnesses/agent-hub/version.ts +42 -0
  530. package/.versions/2.1.0/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  531. package/.versions/2.1.0/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  532. package/.versions/2.1.0/.pi/harnesses/agent-hub/work-mode.ts +188 -0
  533. package/.versions/2.1.0/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
  534. package/.versions/2.1.0/.pi/harnesses/ask-user-remote/README.md +59 -0
  535. package/.versions/2.1.0/.pi/harnesses/ask-user-remote/index.ts +571 -0
  536. package/.versions/2.1.0/.pi/harnesses/ask-user-remote/questions.ts +206 -0
  537. package/.versions/2.1.0/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  538. package/.versions/2.1.0/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
  539. package/.versions/2.1.0/.pi/harnesses/coms/README.md +105 -0
  540. package/.versions/2.1.0/.pi/harnesses/coms/index.ts +308 -0
  541. package/.versions/2.1.0/.pi/harnesses/coms/package.json +7 -0
  542. package/.versions/2.1.0/.pi/harnesses/coms/version.ts +42 -0
  543. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/README.md +161 -0
  544. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/index.ts +659 -0
  545. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/package.json +7 -0
  546. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
  547. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
  548. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
  549. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
  550. package/.versions/2.1.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
  551. package/.versions/2.1.0/.pi/harnesses/lib/approval-wait.ts +17 -0
  552. package/.versions/2.1.0/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
  553. package/.versions/2.1.0/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  554. package/.versions/2.1.0/.pi/harnesses/lib/clarification-policy.ts +9 -0
  555. package/.versions/2.1.0/.pi/harnesses/lib/coms-core-io.ts +422 -0
  556. package/.versions/2.1.0/.pi/harnesses/lib/coms-core.ts +720 -0
  557. package/.versions/2.1.0/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
  558. package/.versions/2.1.0/.pi/harnesses/lib/coms-observation.ts +74 -0
  559. package/.versions/2.1.0/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
  560. package/.versions/2.1.0/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
  561. package/.versions/2.1.0/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
  562. package/.versions/2.1.0/.pi/harnesses/lib/context-budget-view.ts +112 -0
  563. package/.versions/2.1.0/.pi/harnesses/lib/context-budget.ts +114 -0
  564. package/.versions/2.1.0/.pi/harnesses/lib/context-compaction-policy.js +35 -0
  565. package/.versions/2.1.0/.pi/harnesses/lib/damage-action-hash.ts +28 -0
  566. package/.versions/2.1.0/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
  567. package/.versions/2.1.0/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
  568. package/.versions/2.1.0/.pi/harnesses/lib/damage-control-shared.ts +276 -0
  569. package/.versions/2.1.0/.pi/harnesses/lib/damage-guard-port.ts +25 -0
  570. package/.versions/2.1.0/.pi/harnesses/lib/damage-policy.ts +35 -0
  571. package/.versions/2.1.0/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
  572. package/.versions/2.1.0/.pi/harnesses/lib/damage-result-view.ts +16 -0
  573. package/.versions/2.1.0/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
  574. package/.versions/2.1.0/.pi/harnesses/lib/exact-permission-port.ts +38 -0
  575. package/.versions/2.1.0/.pi/harnesses/lib/execution-trace.ts +45 -0
  576. package/.versions/2.1.0/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  577. package/.versions/2.1.0/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  578. package/.versions/2.1.0/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  579. package/.versions/2.1.0/.pi/harnesses/lib/fleet-codex-event-bridge.ts +81 -0
  580. package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
  581. package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
  582. package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
  583. package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
  584. package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
  585. package/.versions/2.1.0/.pi/harnesses/lib/fleet-config/view.ts +338 -0
  586. package/.versions/2.1.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  587. package/.versions/2.1.0/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
  588. package/.versions/2.1.0/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  589. package/.versions/2.1.0/.pi/harnesses/lib/fleet-event-source.ts +21 -0
  590. package/.versions/2.1.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  591. package/.versions/2.1.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
  592. package/.versions/2.1.0/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  593. package/.versions/2.1.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
  594. package/.versions/2.1.0/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  595. package/.versions/2.1.0/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  596. package/.versions/2.1.0/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  597. package/.versions/2.1.0/.pi/harnesses/lib/herdr-client.ts +472 -0
  598. package/.versions/2.1.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
  599. package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  600. package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  601. package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  602. package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  603. package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  604. package/.versions/2.1.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  605. package/.versions/2.1.0/.pi/harnesses/lib/identical-dialog.ts +27 -0
  606. package/.versions/2.1.0/.pi/harnesses/lib/installation-state.js +62 -0
  607. package/.versions/2.1.0/.pi/harnesses/lib/peer-target.ts +24 -0
  608. package/.versions/2.1.0/.pi/harnesses/lib/policy-roots.js +117 -0
  609. package/.versions/2.1.0/.pi/harnesses/lib/policy-roots.ts +32 -0
  610. package/.versions/2.1.0/.pi/harnesses/lib/process-shared.ts +9 -0
  611. package/.versions/2.1.0/.pi/harnesses/lib/resource-closure.js +26 -0
  612. package/.versions/2.1.0/.pi/harnesses/lib/safe-source-read.js +29 -0
  613. package/.versions/2.1.0/.pi/harnesses/lib/semantic-approval.ts +80 -0
  614. package/.versions/2.1.0/.pi/harnesses/lib/session-target.ts +62 -0
  615. package/.versions/2.1.0/.pi/harnesses/lib/spawned-peers.js +191 -0
  616. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-agentic.js +15 -0
  617. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
  618. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
  619. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
  620. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-json.js +37 -0
  621. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-loader.js +53 -0
  622. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-proactive.js +68 -0
  623. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-triage.js +42 -0
  624. package/.versions/2.1.0/.pi/harnesses/lib/system1/config-v2.js +112 -0
  625. package/.versions/2.1.0/.pi/harnesses/lib/system1/config.js +50 -0
  626. package/.versions/2.1.0/.pi/harnesses/lib/system1/contracts.ts +154 -0
  627. package/.versions/2.1.0/.pi/harnesses/lib/system1/demo.ts +95 -0
  628. package/.versions/2.1.0/.pi/harnesses/lib/system1/jev.ts +503 -0
  629. package/.versions/2.1.0/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
  630. package/.versions/2.1.0/.pi/harnesses/lib/system1/selection.js +11 -0
  631. package/.versions/2.1.0/.pi/harnesses/lib/system1/service.ts +245 -0
  632. package/.versions/2.1.0/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  633. package/.versions/2.1.0/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  634. package/.versions/2.1.0/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  635. package/.versions/2.1.0/.pi/harnesses/lib/target-capabilities.js +7 -0
  636. package/.versions/2.1.0/.pi/harnesses/lib/update-check.ts +227 -0
  637. package/.versions/2.1.0/.pi/harnesses/lib/workspace-context.js +115 -0
  638. package/.versions/2.1.0/.pi/harnesses/lib/workspace-context.ts +22 -0
  639. package/.versions/2.1.0/.pi/harnesses/package-lock.json +2121 -0
  640. package/.versions/2.1.0/.pi/harnesses/package.json +13 -0
  641. package/.versions/2.1.0/.pi/prompts/af-build.md +27 -0
  642. package/.versions/2.1.0/.pi/prompts/af-code-simplify.md +22 -0
  643. package/.versions/2.1.0/.pi/prompts/af-constraints.md +31 -0
  644. package/.versions/2.1.0/.pi/prompts/af-plan.md +17 -0
  645. package/.versions/2.1.0/.pi/prompts/af-review.md +16 -0
  646. package/.versions/2.1.0/.pi/prompts/af-set-hermes-telegram.md +15 -0
  647. package/.versions/2.1.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  648. package/.versions/2.1.0/.pi/prompts/af-setup-rules.md +20 -0
  649. package/.versions/2.1.0/.pi/prompts/af-ship.md +17 -0
  650. package/.versions/2.1.0/.pi/prompts/af-spec.md +15 -0
  651. package/.versions/2.1.0/.pi/prompts/af-test.md +19 -0
  652. package/.versions/2.1.0/.pi/skills/bowser/SKILL.md +145 -0
  653. package/.versions/2.1.0/.version +1 -0
  654. package/.versions/2.1.0/agents/architect.md +24 -0
  655. package/.versions/2.1.0/agents/bowser.md +28 -0
  656. package/.versions/2.1.0/agents/builder.md +55 -0
  657. package/.versions/2.1.0/agents/code-reviewer.md +209 -0
  658. package/.versions/2.1.0/agents/deep-researcher.md +32 -0
  659. package/.versions/2.1.0/agents/documenter.md +22 -0
  660. package/.versions/2.1.0/agents/orchestrator.md +22 -0
  661. package/.versions/2.1.0/agents/plan-reviewer.md +83 -0
  662. package/.versions/2.1.0/agents/planner.md +107 -0
  663. package/.versions/2.1.0/agents/releaser.md +24 -0
  664. package/.versions/2.1.0/agents/researcher.md +30 -0
  665. package/.versions/2.1.0/agents/security-auditor.md +167 -0
  666. package/.versions/2.1.0/agents/test-engineer.md +153 -0
  667. package/.versions/2.1.0/agents/web-debugger.md +44 -0
  668. package/.versions/2.1.0/agents/web-performance-auditor.md +194 -0
  669. package/.versions/2.1.0/bin/catalog/harness-runtime-closure.json +85 -0
  670. package/.versions/2.1.0/docs/ARCHITECTURE.md +1158 -0
  671. package/.versions/2.1.0/docs/agent-fleet-setup.md +1143 -0
  672. package/.versions/2.1.0/docs/claude-code-coms-bridge.md +147 -0
  673. package/.versions/2.1.0/docs/codex-local-mcp.md +434 -0
  674. package/.versions/2.1.0/docs/codex-session-bridge.md +44 -0
  675. package/.versions/2.1.0/docs/codex-setup.md +183 -0
  676. package/.versions/2.1.0/docs/coms-hermes-bridge.md +188 -0
  677. package/.versions/2.1.0/docs/fleet-native-voice.md +135 -0
  678. package/.versions/2.1.0/docs/getting-started.md +126 -0
  679. package/.versions/2.1.0/docs/npm-install.md +535 -0
  680. package/.versions/2.1.0/docs/pi-extensions.md +455 -0
  681. package/.versions/2.1.0/docs/pi-setup.md +92 -0
  682. package/.versions/2.1.0/docs/skill-anatomy.md +150 -0
  683. package/.versions/2.1.0/install-manifest.json +3216 -0
  684. package/.versions/2.1.0/justfile +247 -0
  685. package/.versions/2.1.0/manifest-meta.json +1086 -0
  686. package/.versions/2.1.0/references/accessibility-checklist.md +160 -0
  687. package/.versions/2.1.0/references/communication-contract.md +26 -0
  688. package/.versions/2.1.0/references/definition-of-done.md +67 -0
  689. package/.versions/2.1.0/references/fleet-coordination-patterns.md +171 -0
  690. package/.versions/2.1.0/references/observability-checklist.md +92 -0
  691. package/.versions/2.1.0/references/orchestration-patterns.md +370 -0
  692. package/.versions/2.1.0/references/performance-checklist.md +236 -0
  693. package/.versions/2.1.0/references/prompting-patterns.md +380 -0
  694. package/.versions/2.1.0/references/security-checklist.md +245 -0
  695. package/.versions/2.1.0/references/testing-patterns.md +235 -0
  696. package/.versions/2.1.0/references/workflow-authoring.md +304 -0
  697. package/.versions/2.1.0/skills/_internal/grilling.md +59 -0
  698. package/.versions/2.1.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
  699. package/.versions/2.1.0/skills/code-review-and-quality/SKILL.md +396 -0
  700. package/.versions/2.1.0/skills/compound-learning/SKILL.md +137 -0
  701. package/.versions/2.1.0/skills/constraint-driven-development/SKILL.md +338 -0
  702. package/.versions/2.1.0/skills/constraint-driven-development/references/floor-guard.md +99 -0
  703. package/.versions/2.1.0/skills/context-engineering/SKILL.md +341 -0
  704. package/.versions/2.1.0/skills/deprecation-and-migration/SKILL.md +247 -0
  705. package/.versions/2.1.0/skills/designing-agents/SKILL.md +394 -0
  706. package/.versions/2.1.0/skills/designing-agents/pi-harness-authoring.md +222 -0
  707. package/.versions/2.1.0/skills/drafting-workflows/SKILL.md +143 -0
  708. package/.versions/2.1.0/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  709. package/.versions/2.1.0/skills/fleet-native-voice/SKILL.md +73 -0
  710. package/.versions/2.1.0/skills/fleet-native-voice/agents/openai.yaml +4 -0
  711. package/.versions/2.1.0/skills/fleet-native-voice.zip +0 -0
  712. package/.versions/2.1.0/skills/frontend-ui-engineering/SKILL.md +328 -0
  713. package/.versions/2.1.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  714. package/.versions/2.1.0/skills/idea-refine/SKILL.md +182 -0
  715. package/.versions/2.1.0/skills/idea-refine/examples.md +238 -0
  716. package/.versions/2.1.0/skills/idea-refine/frameworks.md +99 -0
  717. package/.versions/2.1.0/skills/idea-refine/refinement-criteria.md +113 -0
  718. package/.versions/2.1.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  719. package/.versions/2.1.0/skills/incremental-implementation/SKILL.md +353 -0
  720. package/.versions/2.1.0/skills/incremental-implementation.zip +0 -0
  721. package/.versions/2.1.0/skills/interview-me/SKILL.md +226 -0
  722. package/.versions/2.1.0/skills/orchestration-verification/SKILL.md +182 -0
  723. package/.versions/2.1.0/skills/peer-coms/SKILL.md +90 -0
  724. package/.versions/2.1.0/skills/performance-optimization/SKILL.md +496 -0
  725. package/.versions/2.1.0/skills/planning-and-task-breakdown/SKILL.md +318 -0
  726. package/.versions/2.1.0/skills/planning-and-task-breakdown.zip +0 -0
  727. package/.versions/2.1.0/skills/repository-ai-setup/SKILL.md +135 -0
  728. package/.versions/2.1.0/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  729. package/.versions/2.1.0/skills/repository-ai-setup/references/apply-contract.md +74 -0
  730. package/.versions/2.1.0/skills/repository-ai-setup/references/provenance-template.md +16 -0
  731. package/.versions/2.1.0/skills/repository-ai-setup/references/setup-flow.md +108 -0
  732. package/.versions/2.1.0/skills/repository-ai-setup/references/verify-setup.md +20 -0
  733. package/.versions/2.1.0/skills/repository-ai-setup.zip +0 -0
  734. package/.versions/2.1.0/skills/security-and-hardening/SKILL.md +524 -0
  735. package/.versions/2.1.0/skills/spec-driven-development/SKILL.md +295 -0
  736. package/.versions/2.1.0/skills/spec-driven-development.zip +0 -0
  737. package/.versions/2.1.0/skills/using-agent-skills/SKILL.md +198 -0
  738. package/.versions/2.1.0/vendor/agent-skills-upstream/LICENSE +21 -0
  739. package/.versions/2.1.0/vendor/agent-skills-upstream/README.md +430 -0
  740. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  741. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  742. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  743. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  744. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  745. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  746. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  747. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  748. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  749. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  750. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  751. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  752. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  753. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  754. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  755. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  756. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  757. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  758. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  759. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  760. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  761. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  762. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  763. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  764. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  765. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  766. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  767. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  768. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  769. package/.versions/2.1.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  770. package/CHANGELOG.md +21 -5
  771. package/README.md +12 -11
  772. package/agents/architect.md +1 -1
  773. package/agents/bowser.md +1 -1
  774. package/agents/builder.md +1 -1
  775. package/agents/code-reviewer.md +1 -1
  776. package/agents/plan-reviewer.md +1 -1
  777. package/agents/planner.md +1 -1
  778. package/agents/test-engineer.md +1 -1
  779. package/agents/web-debugger.md +1 -1
  780. package/agents/web-performance-auditor.md +1 -1
  781. package/bin/cli.js +115 -1
  782. package/bin/lib/apply.js +8 -1
  783. package/bin/lib/features.js +4 -1
  784. package/bin/lib/hermes-profile-artifact.js +21 -10
  785. package/bin/lib/inspect.js +103 -0
  786. package/bin/lib/mcp-probe.js +104 -0
  787. package/bin/lib/public-plan.js +2 -0
  788. package/bin/lib/repair-desired.js +1 -1
  789. package/bin/lib/set-codex-mcp.js +699 -0
  790. package/bin/lib/skill-zip.js +222 -0
  791. package/bin/snapshot-version.js +3 -1
  792. package/docs/ARCHITECTURE.md +147 -12
  793. package/docs/MIGRATION-agent-fleet.md +2 -2
  794. package/docs/agent-fleet-setup.md +39 -2
  795. package/docs/codex-local-mcp.md +434 -0
  796. package/docs/codex-session-bridge.md +28 -203
  797. package/docs/codex-setup.md +183 -0
  798. package/docs/fleet-native-voice.md +135 -0
  799. package/docs/npm-install.md +2 -2
  800. package/docs/session-worktree-targeting.md +79 -79
  801. package/docs/system1-agentic.md +1 -1
  802. package/docs/workflows.md +2 -2
  803. package/install-manifest.json +31 -66
  804. package/manifest-meta.json +47 -57
  805. package/package.json +12 -7
  806. package/skills/fleet-native-voice.zip +0 -0
  807. package/skills/incremental-implementation/SKILL.md +1 -1
  808. package/skills/incremental-implementation.zip +0 -0
  809. package/.pi/agent-fleet/scripts/fleet-codex-client.ts +0 -69
  810. package/.pi/agent-fleet/scripts/fleet-codex-read.py +0 -148
  811. package/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +0 -63
  812. package/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +0 -190
  813. package/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +0 -166
  814. package/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +0 -124
  815. package/codex/fleet-session-client/SKILL.md +0 -34
  816. package/codex/fleet-session-client.zip +0 -0
@@ -0,0 +1,342 @@
1
+ // Usage accounting and task-tier policy. Dispatch/research counts and task/turn
2
+ // duration are observable, never continuation quotas. Individual child deadlines,
3
+ // cancellation and context recycling still bound a physical run.
4
+
5
+ // Task tiers — the dispatcher's complexity triage, child deadlines and delegation.
6
+ // Unset/junk tier is treated as DEFAULT_TASK_TIER (`small`).
7
+ export const TASK_TIERS = ["trivial", "small", "feature", "project"];
8
+ // The tier ASSUMED when the dispatcher never called set_task_tier. It is
9
+ // deliberately not the middle of the range: the tier is task-scoped, so a skipped
10
+ // triage latches for the whole task, and skipped triage is exactly the case where
11
+ // the dispatcher was not thinking about proportionality. Assuming `feature` there
12
+ // unlocked planner/plan-reviewer/security-auditor, loosened the review cap, and
13
+ // handed out the full feature envelope — the over-apparatus failure mode, granted
14
+ // by forgetting a tool call. Assuming `small` costs an explicit escalation (with a
15
+ // reason) when the work really is bigger, which is the cheap direction to be wrong in.
16
+ export const DEFAULT_TASK_TIER = "small";
17
+
18
+ /** "Small", " TRIVIAL " → canonical tier name, or null when unrecognized. */
19
+ export function normalizeTaskTier(value) {
20
+ const v = String(value ?? "").trim().toLowerCase();
21
+ return TASK_TIERS.includes(v) ? v : null;
22
+ }
23
+
24
+ // Session-recycle context threshold (percent, measured over input+cacheRead+
25
+ // cacheWrite): beyond this, resuming the specialist session mostly re-bills
26
+ // stale context, so a fresh session is cheaper than the memory is worth.
27
+ export const RECYCLE_CONTEXT_PCT = 60;
28
+
29
+ // Hard ceiling: at or past a full window the accumulated session no longer
30
+ // fits, so no threshold override may keep it alive. Session 1 of the
31
+ // post-mortem logged 315% → 176% → 100% while the configured threshold was
32
+ // still being consulted as if it were advisory.
33
+ export const HARD_RECYCLE_CONTEXT_PCT = 100;
34
+
35
+ export const TIER_BUDGETS = {
36
+ trivial: {
37
+ agentTurnMs: 10 * 60_000,
38
+ recycleRuns: 3,
39
+ delegation: false,
40
+ },
41
+ small: {
42
+ agentTurnMs: 10 * 60_000,
43
+ recycleRuns: 3,
44
+ delegation: false,
45
+ },
46
+ feature: {
47
+ agentTurnMs: 30 * 60_000,
48
+ recycleRuns: 5,
49
+ delegation: true,
50
+ },
51
+ project: {
52
+ agentTurnMs: 30 * 60_000,
53
+ recycleRuns: 5,
54
+ delegation: true,
55
+ },
56
+ };
57
+
58
+ /** Legacy quota overrides are ignored. Only child deadlines and recycling are configurable. */
59
+ export function resolveTurnBudget(tier, overrides = {}) {
60
+ const base = TIER_BUDGETS[normalizeTaskTier(tier) ?? DEFAULT_TASK_TIER];
61
+ const ceiling = (key) => {
62
+ const override = overrides[key];
63
+ if (override === undefined || override === null) return base[key];
64
+ if (base[key] == null) return override;
65
+ return Math.min(base[key], override);
66
+ };
67
+ return {
68
+ agentTurnMs: ceiling("agentTurnMs"),
69
+ recycleRuns: ceiling("recycleRuns"),
70
+ delegation: base.delegation,
71
+ };
72
+ }
73
+
74
+ /**
75
+ * Recycle the specialist's accumulated session before this run? True when the
76
+ * session already served `recycleRuns` runs, its context reached a full window
77
+ * (HARD_RECYCLE_CONTEXT_PCT, not overridable), or it passed the configured
78
+ * RECYCLE_CONTEXT_PCT — resuming past any of those mostly re-bills stale
79
+ * context on every subsequent model call.
80
+ */
81
+ export function shouldRecycleSession(runsSinceFresh, contextPct, budget, thresholdPct = RECYCLE_CONTEXT_PCT) {
82
+ if (runsSinceFresh <= 0) return false;
83
+ if (contextPct >= HARD_RECYCLE_CONTEXT_PCT) return true;
84
+ if (budget.recycleRuns != null && runsSinceFresh >= budget.recycleRuns) return true;
85
+ return contextPct >= thresholdPct;
86
+ }
87
+
88
+ /**
89
+ * The one case recycling cannot fix: a *fresh* session already measured over a
90
+ * full window means a single run overflowed on its own, so there is no
91
+ * accumulated history to drop. Either `contextWindow` is wrong for that
92
+ * provider or the run genuinely ran over — both need a human, not a retry.
93
+ * Returns the diagnostic line, or null when recycling covers the situation.
94
+ */
95
+ export function contextOverflowDiagnostic(runsSinceFresh, contextPct, { agent = "agent", model = "unknown model" } = {}) {
96
+ if (runsSinceFresh > 0) return null;
97
+ if (!(contextPct >= HARD_RECYCLE_CONTEXT_PCT)) return null;
98
+ return (
99
+ `⚠ ${agent} measured ${Math.round(contextPct)}% context on a fresh session (${model}) — ` +
100
+ "recycling cannot help, one run overflowed the window on its own. Either the resolved " +
101
+ "contextWindow is wrong for this provider or the run genuinely ran over: check the model's " +
102
+ "declared window and narrow the task's inputs."
103
+ );
104
+ }
105
+
106
+ /** One-line usage chip: "Tier: small · 1 disp · 0 res · task 4 disp". Counts, never quotas.
107
+ * @param {{dispatches: number, research: number}} counters this turn
108
+ * @param {string|null} [tier]
109
+ * @param {{dispatches: number}|null} [task] counts for the whole task
110
+ */
111
+ export function budgetStatusLine(counters, tier = null, task = null) {
112
+ const taskSuffix = task ? ` · task ${task.dispatches} disp` : "";
113
+ return `Tier: ${tier || DEFAULT_TASK_TIER} · ${counters.dispatches} disp · ${counters.research} res${taskSuffix}`;
114
+ }
115
+
116
+ // ─────────────────────────────────────────────────────────────────────────────
117
+ // Tier ratchet (the tier is TASK-scoped, not turn-scoped)
118
+ // ─────────────────────────────────────────────────────────────────────────────
119
+ //
120
+ // Turn-scoped tiers cannot bind on a steered run: every follow-up message reset
121
+ // the tier to null, the next dispatch re-assumed `feature`, and a two-word
122
+ // correction ("no, only the one line") bought six fresh dispatches. Worse, the
123
+ // reset direction was always upward — nobody re-declares `trivial` after a
124
+ // steering message, so the effective tier drifted to the ceiling.
125
+ //
126
+ // The tier now survives the turn and moves by ratchet: DOWN is free (cheap and
127
+ // self-limiting), UP costs an explicit reason that is recorded and shown. Only
128
+ // an explicit new task (`set_task_tier` with `new_task: true`) clears it.
129
+
130
+ export const TIER_RANK = { trivial: 0, small: 1, feature: 2, project: 3 };
131
+
132
+ /**
133
+ * Move the task tier from `current` to `next`.
134
+ * Returns { ok, tier, escalated, reason, message }: `tier` is always the tier
135
+ * that should be in force afterwards, so a refused escalation keeps the old one.
136
+ */
137
+ export function applyTierChange(current, next, reason = "") {
138
+ const target = normalizeTaskTier(next);
139
+ if (!target) {
140
+ return {
141
+ ok: false,
142
+ tier: current ?? null,
143
+ escalated: false,
144
+ reason: "unknown_tier",
145
+ message: `Unknown tier "${next}" — expected one of: ${TASK_TIERS.join(", ")}. ` +
146
+ `Tier unchanged (${current ?? "unset"}).`,
147
+ };
148
+ }
149
+ const from = normalizeTaskTier(current);
150
+ if (!from) {
151
+ return { ok: true, tier: target, escalated: false, reason: "initial", message: `Task tier: ${target}.` };
152
+ }
153
+ if (TIER_RANK[target] <= TIER_RANK[from]) {
154
+ return {
155
+ ok: true,
156
+ tier: target,
157
+ escalated: false,
158
+ reason: TIER_RANK[target] === TIER_RANK[from] ? "unchanged" : "lowered",
159
+ message: `Task tier: ${from} → ${target}.`,
160
+ };
161
+ }
162
+ if (!String(reason || "").trim()) {
163
+ return {
164
+ ok: false,
165
+ tier: from,
166
+ escalated: false,
167
+ reason: "raise_without_reason",
168
+ message: `⚠ Tier escalation ${from} → ${target} refused: raising the tier needs an explicit ` +
169
+ "`reason` naming what the ask turned out to contain that the lower tier does not cover. " +
170
+ `Tier stays ${from}. Lowering the tier never needs a reason.`,
171
+ };
172
+ }
173
+ return {
174
+ ok: true,
175
+ tier: target,
176
+ escalated: true,
177
+ reason: "raised",
178
+ message: `⚠ Task tier ESCALATED ${from} → ${target}: ${String(reason).trim()}`,
179
+ };
180
+ }
181
+
182
+ // ─────────────────────────────────────────────────────────────────────────────
183
+ // Task clock — active time is visible accounting, never a continuation quota
184
+ // ─────────────────────────────────────────────────────────────────────────────
185
+
186
+ /**
187
+ * ACTIVE milliseconds in one turn: wall clock minus the time the human was away.
188
+ * A lunch break, an overnight pause or a long `ask_user` answer is not fleet work,
189
+ * so the reported task duration excludes it.
190
+ */
191
+ export function turnActiveMs(turnStartedAt, now, askUserWaitMs = 0) {
192
+ if (!turnStartedAt) return 0;
193
+ return Math.max(0, now - turnStartedAt - Math.max(0, askUserWaitMs || 0));
194
+ }
195
+
196
+ /** A serializable, deterministic task clock. `active` is authoritative. */
197
+ export function createTaskClock() {
198
+ return { active: false, accumulatedMs: 0, turnStartedAt: 0, askUserWaitMs: 0 };
199
+ }
200
+
201
+ /**
202
+ * Open a task turn. A still-open prior interval is closed first as defensive
203
+ * recovery for a missing end event; normal turns are closed by agent_end.
204
+ */
205
+ export function openTaskClock(clock, now) {
206
+ const base = clock?.active ? closeTaskClock(clock, now) : { ...createTaskClock(), ...clock };
207
+ return { ...base, active: true, turnStartedAt: now, askUserWaitMs: 0 };
208
+ }
209
+
210
+ /** Add a completed ask_user wait to the currently open turn. */
211
+ export function addTaskClockWait(clock, waitMs) {
212
+ if (!clock?.active) return { ...createTaskClock(), ...clock };
213
+ return {
214
+ ...clock,
215
+ askUserWaitMs: Math.max(0, clock.askUserWaitMs || 0) + Math.max(0, waitMs || 0),
216
+ };
217
+ }
218
+
219
+ /** Finished turns plus the open turn, excluding completed and in-flight waits. */
220
+ export function taskClockElapsedMs(clock, now, openWaitMs = 0) {
221
+ if (!clock) return 0;
222
+ const accumulated = Math.max(0, clock.accumulatedMs || 0);
223
+ if (!clock.active) return accumulated;
224
+ return accumulated + turnActiveMs(
225
+ clock.turnStartedAt,
226
+ now,
227
+ Math.max(0, clock.askUserWaitMs || 0) + Math.max(0, openWaitMs || 0),
228
+ );
229
+ }
230
+
231
+ /** Close the current turn once. Repeated closes are no-ops. */
232
+ export function closeTaskClock(clock, now) {
233
+ const base = { ...createTaskClock(), ...clock };
234
+ if (!base.active) return base;
235
+ return {
236
+ active: false,
237
+ accumulatedMs: taskClockElapsedMs(base, now),
238
+ turnStartedAt: 0,
239
+ askUserWaitMs: 0,
240
+ };
241
+ }
242
+
243
+ /**
244
+ * Open a fresh task window. During an active turn, the new task begins at the
245
+ * reset instant; between turns, no timestamp is carried into the next task.
246
+ */
247
+ export function resetTaskClock(clock, now) {
248
+ const active = clock?.active === true;
249
+ return {
250
+ active,
251
+ accumulatedMs: 0,
252
+ turnStartedAt: active ? now : 0,
253
+ askUserWaitMs: 0,
254
+ };
255
+ }
256
+
257
+ // ─────────────────────────────────────────────────────────────────────────────
258
+ // Tier persona gate (B3) — heavy apparatus is not available at low tiers
259
+ // ─────────────────────────────────────────────────────────────────────────────
260
+ //
261
+ // "A trivial ask gets one specialist" was prose in the system prompt, and prose
262
+ // lost: a one-line Azure permission change was routed through planner →
263
+ // plan-reviewer → security-auditor and grew a 1216-line plan. These personas
264
+ // each open a pipeline (plans, reviews, findings that ratchet back into the
265
+ // plan), so at trivial/small tiers they are refused in code. The escape hatch is
266
+ // the honest one: raise the tier with a reason.
267
+
268
+ export const HEAVY_PERSONAS = ["architect", "security-auditor", "deep-researcher"];
269
+ export const REVIEW_PERSONAS = ["code-reviewer", "plan-reviewer", "security-auditor"];
270
+ const GATED_TIERS = new Set(["trivial", "small"]);
271
+
272
+ /**
273
+ * Refuse a heavy persona at a low tier. Returns null when allowed, else
274
+ * { reason, message }. Unknown/absent tier never gates here; the harness assumes
275
+ * DEFAULT_TASK_TIER before calling.
276
+ */
277
+ export function checkTierPersonaGate(tier, persona) {
278
+ const t = normalizeTaskTier(tier);
279
+ if (!t || !GATED_TIERS.has(t)) return null;
280
+ const name = String(persona || "").trim().toLowerCase();
281
+ if (!HEAVY_PERSONAS.includes(name)) return null;
282
+ return {
283
+ reason: "tier_persona_gate",
284
+ message: `⚠ ${name} is not available at tier "${t}" — and this dispatch was NOT counted against any budget.\n` +
285
+ `At trivial/small tiers the apparatus is one specialist plus its own evidence: no planning pipeline, ` +
286
+ `no plan review, no separate audit pass. Each of those personas opens a document/finding loop whose ` +
287
+ `output then has to be executed and re-reviewed.\n` +
288
+ `Either dispatch the specialist that does the actual work (builder, test-engineer, code-reviewer, ` +
289
+ `documenter), or — if the ask really is bigger than "${t}" — call set_task_tier with a higher tier ` +
290
+ `AND a reason naming what it turned out to contain. Do not raise the tier merely to unlock a persona.`,
291
+ };
292
+ }
293
+
294
+ // ─────────────────────────────────────────────────────────────────────────────
295
+ // Review finding budget (B6) — a review is a gate, and a gate has a size
296
+ // ─────────────────────────────────────────────────────────────────────────────
297
+ //
298
+ // Unbounded review authority is a ratchet: every round produced new blocking
299
+ // findings, each finding added an invariant to the plan, and the enlarged plan
300
+ // justified another round. PLAN37 recorded P37-001…011, R37-IMM-001 and six
301
+ // script-review remediations — none of which the user asked for. The cap is on
302
+ // BLOCKING findings only; everything else still gets reported, just not as a gate.
303
+
304
+ export const BLOCKING_FINDING_CAPS = { trivial: 1, small: 2, feature: 5, project: null };
305
+
306
+ // Review rounds are observable, never a continuation quota; independent review
307
+ // evidence is unchanged.
308
+
309
+ /** Blocking-finding cap for a tier; null = uncapped (project / unset tier). */
310
+ export function blockingFindingCap(tier) {
311
+ const t = normalizeTaskTier(tier);
312
+ if (!t) return null;
313
+ return BLOCKING_FINDING_CAPS[t] ?? null;
314
+ }
315
+
316
+ /** Is this a review persona (gets the finding-budget clause)? */
317
+ export function isReviewPersona(persona) {
318
+ return REVIEW_PERSONAS.includes(String(persona || "").trim().toLowerCase());
319
+ }
320
+
321
+ /**
322
+ * The finding-budget clause appended to a review persona's task text.
323
+ * Returns null when the persona is not a reviewer or the tier is uncapped.
324
+ */
325
+ export function reviewBudgetClause(tier, persona) {
326
+ if (!isReviewPersona(persona)) return null;
327
+ const cap = blockingFindingCap(tier);
328
+ if (cap == null) return null;
329
+ return [
330
+ `## Finding budget (task tier: ${normalizeTaskTier(tier)})`,
331
+ ``,
332
+ `Report at most ${cap} BLOCKING finding${cap === 1 ? "" : "s"}. Rank by severity and put everything`,
333
+ `else under a "## Non-blocking (optional)" heading — non-blocking findings are advice, and must not`,
334
+ `gate the change or be re-raised as blockers in a later round.`,
335
+ ``,
336
+ `A blocking finding may only enforce an invariant the task, the plan, or the project rules ALREADY`,
337
+ `state. It may NOT introduce a new invariant, a new evidence artifact, a new script/manifest/fixture,`,
338
+ `or a new process requirement — that is scope growth wearing a reviewer's hat. If you believe a new`,
339
+ `invariant is genuinely needed, write it under "## Non-blocking (optional)" as a recommendation for`,
340
+ `the human to decide, and do not block on it.`,
341
+ ].join("\n");
342
+ }
@@ -0,0 +1,93 @@
1
+ // Immutable per-run artifact namespaces — the pure policy core behind "a run's
2
+ // artifacts are never overwritten by the next run".
3
+ //
4
+ // The observed failure: `.pi/agent-sessions/artifacts/` was deleted at session
5
+ // start, and specialist returns were named by a per-session counter
6
+ // (`returns/builder-run1.md`). Two consequences, both hit at once: a later
7
+ // session's `builder-run1.md` occupied the same path as an earlier one, and the
8
+ // start-of-session wipe removed eleven implementation returns and two review
9
+ // artifacts that a post-mortem then had to record as NOT RECOVERABLE.
10
+ //
11
+ // The fix is not retention-by-luck: each session archives the previous session's
12
+ // artifacts into `runs/<runId>/`, a namespace that is written once and never
13
+ // reused, and records it in `runs/index.json`. Pruning is explicit and bounded,
14
+ // so the directory cannot grow without limit either.
15
+
16
+ export const DEFAULT_RUN_HISTORY_KEEP = 10;
17
+ export const RUNS_DIRNAME = "runs";
18
+ export const RUN_INDEX_FILENAME = "index.json";
19
+
20
+ /**
21
+ * Run id: sortable UTC timestamp + a short random suffix, so two sessions
22
+ * starting in the same second still get distinct namespaces.
23
+ * `2026-08-03T09-10-42-a3f9`
24
+ */
25
+ export function makeRunId(date = new Date(), suffix = null) {
26
+ const iso = new Date(date).toISOString().replace(/\.\d+Z$/, "").replace(/:/g, "-");
27
+ const tail = suffix ?? Math.random().toString(36).slice(2, 6);
28
+ return `${iso}-${tail}`;
29
+ }
30
+
31
+ /** A run id we generated (used to filter stray directories out of `runs/`). */
32
+ export function isRunId(name) {
33
+ return /^\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-[a-z0-9]{2,8}$/.test(String(name || ""));
34
+ }
35
+
36
+ /**
37
+ * Which run directories to delete so at most `keep` survive.
38
+ * Run ids sort lexicographically by time, so newest = last. `keep: null`
39
+ * ("off") prunes nothing; non-run-id entries are never touched.
40
+ * @param {string[]} names
41
+ * @param {number|null} [keep]
42
+ */
43
+ export function pruneRunDirs(names, keep = DEFAULT_RUN_HISTORY_KEEP) {
44
+ if (keep == null) return [];
45
+ const runs = (names || []).filter(isRunId).sort();
46
+ const limit = Math.max(0, keep);
47
+ if (runs.length <= limit) return [];
48
+ return runs.slice(0, runs.length - limit);
49
+ }
50
+
51
+ /**
52
+ * The metadata written once into `runs/<runId>/meta.json`. Carries the
53
+ * identifiers a post-mortem needs and could not previously recover: which
54
+ * workspace/project/repo the run belonged to, and when it started and ended.
55
+ * @param {{runId: string, startedAt?: string|number|null, archivedAt?: string|number, cwd?: string|null, project?: string|null, workspace?: string|null, artifactCounts?: Record<string,number>|null}} input
56
+ */
57
+ export function buildRunMeta({ runId, startedAt = null, archivedAt = Date.now(), cwd = null, project = null, workspace = null, artifactCounts = null }) {
58
+ return {
59
+ runId,
60
+ startedAt: startedAt == null ? null : new Date(startedAt).toISOString(),
61
+ archivedAt: new Date(archivedAt).toISOString(),
62
+ cwd,
63
+ project,
64
+ workspace,
65
+ artifactCounts,
66
+ note: "Immutable archive of one agent-hub session's artifacts. Written once; never rewritten.",
67
+ };
68
+ }
69
+
70
+ /**
71
+ * Fold a run entry into `runs/index.json`, newest last, capped at `keep`.
72
+ * Re-indexing the same runId replaces its entry rather than duplicating it.
73
+ * @param {any} existing JSON read from disk; its shape is checked before use.
74
+ * @param {{runId: string, [key: string]: unknown}} entry
75
+ * @param {number|null} [keep]
76
+ */
77
+ export function appendRunIndex(existing, entry, keep = DEFAULT_RUN_HISTORY_KEEP) {
78
+ const runs = Array.isArray(existing?.runs) ? existing.runs.filter((r) => r && r.runId !== entry.runId) : [];
79
+ runs.push(entry);
80
+ runs.sort((a, b) => String(a.runId).localeCompare(String(b.runId)));
81
+ const trimmed = keep == null ? runs : runs.slice(Math.max(0, runs.length - Math.max(0, keep)));
82
+ return { version: 1, updatedAt: new Date().toISOString(), runs: trimmed };
83
+ }
84
+
85
+ /** Parse the `run-history-keep:` overrides value → number, null ("off"), or undefined. */
86
+ export function normalizeRunHistoryKeep(value) {
87
+ const raw = String(value ?? "").trim().toLowerCase();
88
+ if (!raw) return undefined;
89
+ if (raw === "off" || raw === "none" || raw === "0") return null;
90
+ const n = Number(raw);
91
+ if (!Number.isFinite(n) || n < 1) return undefined;
92
+ return Math.floor(n);
93
+ }
@@ -0,0 +1,60 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { lstatSync, readFileSync, realpathSync } from "node:fs";
3
+ import { isAbsolute, relative, resolve } from "node:path";
4
+ import type { AcceptanceRequirement, VerificationCheckInput } from "./acceptance.ts";
5
+
6
+ const hash = (value: string | Buffer) => createHash("sha256").update(value).digest("hex");
7
+ const hex = (value: unknown): value is string => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
8
+ export interface ReceiptCapture {
9
+ taskId: string; generation: string; sessionDir: string; scope: string[]; declarationHash: string;
10
+ epoch: number; captureId: string;
11
+ }
12
+ export interface RuntimeReceipt extends ReceiptCapture {
13
+ originDispatchId: string; backend: "native"; capturedAt: number;
14
+ check: VerificationCheckInput; evidenceHash: string;
15
+ }
16
+ export interface RuntimeReceiptState { generation: string; epoch: number; pending: string[]; records: RuntimeReceipt[]; }
17
+
18
+ /** Journal metadata only; there is deliberately no artifact/log import API. */
19
+ export function normalizeRuntimeReceipts(value: unknown): RuntimeReceiptState | undefined {
20
+ if (value === undefined) return undefined;
21
+ const row = value as RuntimeReceiptState;
22
+ if (!row || typeof row.generation !== "string" || !row.generation || !Number.isSafeInteger(row.epoch) || row.epoch < 0 || !Array.isArray(row.pending) || row.pending.length > 64 || !row.pending.every(id => typeof id === "string" && !!id) || !Array.isArray(row.records) || row.records.length > 64 || Buffer.byteLength(JSON.stringify(row)) > 256 * 1024) throw Error("Invalid runtime receipt journal; dependent effects are blocked.");
23
+ for (const r of row.records) {
24
+ if (!r || r.generation !== row.generation || typeof r.taskId !== "string" || !r.taskId || typeof r.captureId !== "string" || !r.captureId || typeof r.sessionDir !== "string" || !isAbsolute(r.sessionDir) || !Array.isArray(r.scope) || !r.scope.every(s => typeof s === "string") || !hex(r.declarationHash) || r.epoch !== row.epoch || r.backend !== "native" || typeof r.originDispatchId !== "string" || !r.originDispatchId || !Number.isSafeInteger(r.capturedAt) || r.capturedAt <= 0 || !hex(r.evidenceHash) || !["test", "code-grep", "compilation"].includes(r.check?.kind ?? "") || r.check?.producer !== "runtime" || r.check.taskId !== r.taskId || r.check.exitCode !== 0 || !hex(r.check.inspectedRevision) || !Array.isArray(r.check.command) || r.check.command.length !== 1 || typeof r.check.command[0] !== "string" || !r.check.command[0] || typeof r.check.evidenceRef !== "string" || !Array.isArray(r.check.requirementIds) || !Array.isArray(r.check.coverage)) throw Error("Invalid runtime receipt anchor; dependent effects are blocked.");
25
+ }
26
+ return structuredClone(row);
27
+ }
28
+ export function receiptDeclarationHash(requirements: AcceptanceRequirement[], scope: string[], acceptedInput?: string, artifacts: { path: string }[] = []): string {
29
+ return hash(JSON.stringify({ acceptedInput, scope, artifacts: artifacts.map(a => ({ path: a.path, hash: hash(readFileSync(a.path)) })), requirements: requirements.map(r => ({ id:r.id, tag:r.tag, text:r.text, source:r.source, reference:r.reference, criticalConditions:r.criticalConditions ?? [], testCommand:r.testCommand, compilerCommand:r.compilerCommand })) }));
30
+ }
31
+ export function beginReceiptCapture(previous: RuntimeReceiptState | undefined, input: Omit<ReceiptCapture, "generation" | "epoch" | "captureId">, exclusive: boolean): { state: RuntimeReceiptState; capture: ReceiptCapture } {
32
+ const state = normalizeRuntimeReceipts(previous) ?? { generation: randomUUID(), epoch: 0, pending: [], records: [] };
33
+ // An unresolved capture (including a resumed crash) or overlap cannot lend success.
34
+ if (!exclusive || state.pending.length) { state.epoch++; state.records = []; }
35
+ // The caller's existing admission/settlement gates remain authoritative. Once
36
+ // no live writer exists, stale capture markers fence history, not fresh checks.
37
+ if (exclusive) state.pending = [];
38
+ if (state.pending.length >= 64) throw Error("Runtime receipt capture limit reached");
39
+ const capture = { ...input, generation: state.generation, epoch: state.epoch, captureId: randomUUID() };
40
+ state.pending.push(capture.captureId);
41
+ return { state, capture };
42
+ }
43
+ function evidenceBytes(sessionDir: string, path: string): Buffer {
44
+ const base = realpathSync(sessionDir), root = resolve(base, "artifacts/evidence"), file = resolve(path);
45
+ const rel = relative(root, file);
46
+ if (!rel || rel.startsWith("..") || isAbsolute(rel) || realpathSync(root) !== root || realpathSync(file) !== file || !lstatSync(file).isFile() || lstatSync(file).size > 256 * 1024) throw Error("Runtime receipt evidence outside capture root");
47
+ return readFileSync(file);
48
+ }
49
+ export function anchorRuntimeReceipt(capture: ReceiptCapture, check: VerificationCheckInput, originDispatchId: string, serialized: string): RuntimeReceipt {
50
+ const bytes = evidenceBytes(capture.sessionDir, check.evidenceRef);
51
+ if (!bytes.equals(Buffer.from(serialized))) throw Error("Runtime receipt evidence readback mismatch");
52
+ return { ...capture, scope: [...capture.scope], originDispatchId, backend: "native", capturedAt: Date.now(), check: structuredClone(check), evidenceHash: hash(bytes) };
53
+ }
54
+ export function reusableRuntimeChecks(state: RuntimeReceiptState, capture: ReceiptCapture, revision: string): VerificationCheckInput[] {
55
+ if (state.generation !== capture.generation || state.epoch !== capture.epoch || state.pending.length !== 1 || state.pending[0] !== capture.captureId || !hex(revision)) return [];
56
+ return state.records.filter(r => {
57
+ if (r.taskId !== capture.taskId || r.sessionDir !== capture.sessionDir || r.declarationHash !== capture.declarationHash || r.epoch !== capture.epoch || JSON.stringify(r.scope) !== JSON.stringify(capture.scope) || r.check.inspectedRevision !== revision) return false;
58
+ try { return hash(evidenceBytes(capture.sessionDir, r.check.evidenceRef)) === r.evidenceHash; } catch { return false; }
59
+ }).map(r => structuredClone(r.check));
60
+ }
@@ -0,0 +1,79 @@
1
+ import { worktreeRevision } from "./scope-gate.js";
2
+
3
+ /** Set by the native dispatcher, never inferred from a command's shell cwd. */
4
+ export const RUNTIME_TEST_SCOPE_ENV = "AGENT_FLEET_RUNTIME_TEST_SCOPES";
5
+
6
+ export function runtimeTestRevision(cwd: string, rawScopes: string | undefined): () => string {
7
+ let scopes: string[];
8
+ try {
9
+ const parsed = rawScopes === undefined ? [] : JSON.parse(rawScopes);
10
+ if (!Array.isArray(parsed) || parsed.some(scope => typeof scope !== "string" || !scope.trim())) throw new Error("Invalid runtime scope");
11
+ scopes = [...parsed];
12
+ } catch { return () => "unavailable"; }
13
+ // Empty filtering scopes preserve whole-repository single-repo semantics.
14
+ return () => worktreeRevision(cwd, [], scopes);
15
+ }
16
+
17
+ export interface RuntimeTestRecord {
18
+ producer: "agent-fleet.runtime-test/v1";
19
+ command: string;
20
+ exitCode: number | null;
21
+ beforeRevision: string;
22
+ afterRevision: string;
23
+ exclusive?: boolean;
24
+ startedAt?: number;
25
+ finishedAt?: number;
26
+ }
27
+
28
+ /** Observe the existing bash operation, never execute a second command or parse output. */
29
+ export function instrumentBash(createTool: any, operations: any, cwd: string, revision = () => worktreeRevision(cwd, []), options: any = {}) {
30
+ return async (id: string, params: any, signal: any, update: any, ctx?: any) => {
31
+ let record: RuntimeTestRecord | undefined;
32
+ const tool = createTool(cwd, { ...options, operations: { ...operations, exec: async (...args: any[]) => {
33
+ const beforeRevision = revision();
34
+ const result = await operations.exec(...args);
35
+ if (typeof args[0] === "string" && args[0] === (options.commandPrefix ? `${options.commandPrefix}\n${params.command}` : params.command)) record = { producer: "agent-fleet.runtime-test/v1", command: params.command, exitCode: result.exitCode, beforeRevision, afterRevision: revision() };
36
+ return result;
37
+ } } });
38
+ try {
39
+ const result = await tool.execute(id, params, signal, update, ctx);
40
+ return { ...result, details: { ...result.details, runtimeTest: record } };
41
+ } catch (error) {
42
+ if (!record) throw error;
43
+ return { content: [{ type: "text", text: String(error) }], isError: true, details: { runtimeTest: record } };
44
+ }
45
+ };
46
+ }
47
+
48
+ /** Use Pi's tool_result hook: agent-core ignores isError on resolved execute values. */
49
+ export function registerObservedBash(pi: any, api: any, cwd: string, options: any, revision = runtimeTestRevision(cwd, process.env[RUNTIME_TEST_SCOPE_ENV])) {
50
+ const tool = api.createBashToolDefinition(cwd, options);
51
+ pi.registerTool({ ...tool, execute: instrumentBash(api.createBashToolDefinition, api.createLocalBashOperations({ shellPath: options.shellPath }), cwd, revision, options) });
52
+ pi.on("tool_result", (event: any) => {
53
+ if (event.toolName === "bash" && event.details?.runtimeTest?.producer === "agent-fleet.runtime-test/v1" && event.details.runtimeTest.exitCode !== 0)
54
+ return { isError: true };
55
+ });
56
+ }
57
+
58
+ /** Same tool name/schema retains damage-control approval and built-in rendering. */
59
+ export default async function runtimeTestCheck(pi: any) {
60
+ const api = await import("@mariozechner/pi-coding-agent");
61
+ const cwd = process.cwd();
62
+ const settings = api.SettingsManager.create(cwd);
63
+ registerObservedBash(pi, api, cwd, { shellPath: settings.getShellPath(), commandPrefix: settings.getShellCommandPrefix() });
64
+ }
65
+
66
+ /** Accept observer events only on the explicitly enabled native transport and a matching tool start. */
67
+ export function runtimeTestFromResult(enabled: boolean | undefined, startedCommand: string | undefined, toolName: string, result: any): RuntimeTestRecord | null {
68
+ const record = result?.details?.runtimeTest;
69
+ if (!enabled || toolName !== "bash" || record?.producer !== "agent-fleet.runtime-test/v1" || typeof record.command !== "string" || !record.command || startedCommand !== record.command || !Number.isInteger(record.exitCode) || !record.beforeRevision || !record.afterRevision || typeof record.beforeRevision !== "string" || typeof record.afterRevision !== "string") return null;
70
+ return { producer: "agent-fleet.runtime-test/v1", command: record.command, exitCode: record.exitCode, beforeRevision: record.beforeRevision, afterRevision: record.afterRevision };
71
+ }
72
+
73
+ /** A real matched bash result with no usable receipt is an unknown observation,
74
+ * not absence of evidence. It must supersede an older retained success. */
75
+ export function runtimeTestObservationFromResult(enabled: boolean | undefined, startedCommand: string | undefined, toolName: string, result: any): RuntimeTestRecord | null {
76
+ const valid = runtimeTestFromResult(enabled, startedCommand, toolName, result);
77
+ if (valid) return valid;
78
+ return enabled && toolName === "bash" && startedCommand ? { producer: "agent-fleet.runtime-test/v1", command: startedCommand, exitCode: null, beforeRevision: "unavailable", afterRevision: "unavailable" } : null;
79
+ }
@@ -0,0 +1,28 @@
1
+ import { existsSync, realpathSync } from "node:fs";
2
+ import { sessionRootsFromEnv } from '../lib/workspace-context.ts';
3
+ import { join, resolve } from "node:path";
4
+
5
+ const CONTINUE_ENTRY = /damage-control-continue[/\\]index\.ts$/;
6
+ const MISSING_SAFETY_ERROR = "damage-control-continue harness not found — guarded child dispatch refused";
7
+
8
+ /** Resolve only the surviving continue harness; never downgrade to an unguarded or hard-stop child. */
9
+ export function resolveSafetyHarness(cwd: string, argv: string[] = process.argv): string | null {
10
+ const roots=sessionRootsFromEnv();
11
+ if(roots?.mode==='targeted'){
12
+ const candidate=join(roots.resourceRoot,'.pi/harnesses/damage-control-continue/index.ts');
13
+ return existsSync(candidate)&&realpathSync(candidate).startsWith(roots.resourceRoot+'/')?realpathSync(candidate):null;
14
+ }
15
+ for (let i = 0; i < argv.length - 1; i++) {
16
+ if (argv[i] !== "-e" && argv[i] !== "--extension") continue;
17
+ const candidate = resolve(argv[i + 1]);
18
+ if (CONTINUE_ENTRY.test(candidate) && existsSync(candidate)) return candidate;
19
+ }
20
+ const local = join(cwd, ".pi", "harnesses", "damage-control-continue", "index.ts");
21
+ return existsSync(local) ? local : null;
22
+ }
23
+
24
+ export function requireSafetyHarness(path: string | null):
25
+ | { ok: true; extensions: string[] }
26
+ | { ok: false; error: string } {
27
+ return path ? { ok: true, extensions: [path] } : { ok: false, error: MISSING_SAFETY_ERROR };
28
+ }