@chankov/agent-fleet 2.0.22 → 2.0.23

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 (735) hide show
  1. package/.pi/agent-fleet/scripts/coms-claude-bridge.ts +5 -2
  2. package/.pi/agent-fleet/scripts/coms-cli.ts +9 -4
  3. package/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +5 -2
  4. package/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  5. package/.pi/agent-fleet/scripts/fleet.ts +32 -4
  6. package/.pi/agent-fleet/scripts/flow.ts +10 -1
  7. package/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +1 -1
  8. package/.pi/agent-fleet/scripts/lib/fleet-command.ts +14 -0
  9. package/.pi/agent-fleet/scripts/lib/flow-command.ts +9 -0
  10. package/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +14 -6
  11. package/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  12. package/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  13. package/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  14. package/.pi/agent-fleet/scripts/lib/team-snapshot.ts +13 -0
  15. package/.pi/agent-fleet/scripts/peer-launch.ts +17 -11
  16. package/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  17. package/.pi/agent-fleet/scripts/team-snapshot.ts +14 -6
  18. package/.pi/agent-fleet/scripts/team-up.ts +16 -9
  19. package/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +5 -3
  20. package/.pi/agent-fleet/scripts/workflows/lib/env.ts +3 -1
  21. package/.pi/agent-fleet/scripts/workflows/lib/git.ts +4 -1
  22. package/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +10 -5
  23. package/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +15 -8
  24. package/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +5 -4
  25. package/.pi/agent-fleet/scripts/workflows/lib/quality.ts +3 -2
  26. package/.pi/agent-fleet/scripts/workflows/lib/run.ts +1 -0
  27. package/.pi/agent-fleet/scripts/workflows/lib/trace.ts +23 -5
  28. package/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +59 -23
  29. package/.pi/agents/model-profiles.yaml +3 -3
  30. package/.pi/extensions/btw/index.ts +2 -0
  31. package/.pi/extensions/pi-voice-stt/config.ts +5 -4
  32. package/.pi/harnesses/agent-hub/agentic-hub.ts +2 -1
  33. package/.pi/harnesses/agent-hub/config/agents.ts +3 -0
  34. package/.pi/harnesses/agent-hub/config/overrides.ts +4 -3
  35. package/.pi/harnesses/agent-hub/context-continuity-broker.ts +7 -5
  36. package/.pi/harnesses/agent-hub/context-continuity-client.ts +6 -3
  37. package/.pi/harnesses/agent-hub/context-continuity-owners.ts +5 -3
  38. package/.pi/harnesses/agent-hub/damage-guard-hub.ts +4 -2
  39. package/.pi/harnesses/agent-hub/damage-guard-owners.ts +5 -0
  40. package/.pi/harnesses/agent-hub/dispatch-coms.ts +7 -2
  41. package/.pi/harnesses/agent-hub/execution-evidence.ts +20 -4
  42. package/.pi/harnesses/agent-hub/file-discovery/hub.ts +2 -1
  43. package/.pi/harnesses/agent-hub/file-discovery/owners.ts +7 -3
  44. package/.pi/harnesses/agent-hub/index.ts +4 -3
  45. package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +3 -2
  46. package/.pi/harnesses/agent-hub/package.json +1 -1
  47. package/.pi/harnesses/agent-hub/presentation.ts +7 -1
  48. package/.pi/harnesses/agent-hub/proactive-config.ts +2 -1
  49. package/.pi/harnesses/agent-hub/proactive-rules.ts +1 -1
  50. package/.pi/harnesses/agent-hub/proactive-snapshot.ts +12 -4
  51. package/.pi/harnesses/agent-hub/proactive-types.ts +3 -0
  52. package/.pi/harnesses/agent-hub/safety-routing.ts +7 -1
  53. package/.pi/harnesses/agent-hub/scope-gate.js +10 -5
  54. package/.pi/harnesses/agent-hub/spawn.ts +30 -4
  55. package/.pi/harnesses/agent-hub/system1-runtime.ts +9 -3
  56. package/.pi/harnesses/agent-hub/task-triage-config.ts +2 -1
  57. package/.pi/harnesses/agent-hub/tools/fleet-tools.ts +3 -2
  58. package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +11 -6
  59. package/.pi/harnesses/agent-hub/tools/run-flow.ts +21 -11
  60. package/.pi/harnesses/ask-user-remote/index.ts +4 -2
  61. package/.pi/harnesses/coms/package.json +1 -1
  62. package/.pi/harnesses/damage-control-continue/index.ts +23 -2
  63. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  64. package/.pi/harnesses/lib/coms-core-io.ts +2 -0
  65. package/.pi/harnesses/lib/coms-core.ts +7 -1
  66. package/.pi/harnesses/lib/coms-registry-entry.ts +3 -0
  67. package/.pi/harnesses/lib/damage-control-shared.ts +17 -1
  68. package/.pi/harnesses/lib/damage-policy.ts +35 -0
  69. package/.pi/harnesses/lib/peer-target.ts +24 -0
  70. package/.pi/harnesses/lib/policy-roots.js +20 -9
  71. package/.pi/harnesses/lib/policy-roots.ts +2 -1
  72. package/.pi/harnesses/lib/resource-closure.js +26 -0
  73. package/.pi/harnesses/lib/session-target.ts +62 -0
  74. package/.pi/harnesses/lib/system1/config-loader.js +12 -3
  75. package/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  76. package/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  77. package/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  78. package/.pi/harnesses/lib/target-capabilities.js +7 -0
  79. package/.pi/harnesses/lib/workspace-context.js +115 -0
  80. package/.pi/harnesses/lib/workspace-context.ts +22 -0
  81. package/.versions/2.0.23/.pi/agent-fleet/hermes/README.md +347 -0
  82. package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  83. package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  84. package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  85. package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  86. package/.versions/2.0.23/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  87. package/.versions/2.0.23/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  88. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  89. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  90. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  91. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  92. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  93. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  94. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  95. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  96. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  97. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  98. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  99. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  100. package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  101. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  102. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  103. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  104. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  105. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  106. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  107. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  108. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  109. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  110. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  111. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  112. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  113. package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  114. package/.versions/2.0.23/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  115. package/.versions/2.0.23/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  116. package/.versions/2.0.23/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  117. package/.versions/2.0.23/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
  118. package/.versions/2.0.23/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
  119. package/.versions/2.0.23/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
  120. package/.versions/2.0.23/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  121. package/.versions/2.0.23/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
  122. package/.versions/2.0.23/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
  123. package/.versions/2.0.23/.pi/agent-fleet/scripts/fleet.ts +245 -0
  124. package/.versions/2.0.23/.pi/agent-fleet/scripts/flow.ts +166 -0
  125. package/.versions/2.0.23/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  126. package/.versions/2.0.23/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  127. package/.versions/2.0.23/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  128. package/.versions/2.0.23/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  129. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
  130. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  131. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  132. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
  133. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
  134. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
  135. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
  136. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-command.ts +266 -0
  137. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
  138. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +238 -0
  139. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  140. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  141. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  142. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  143. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  144. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  145. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  146. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  147. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  148. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  149. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  150. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  151. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  152. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  153. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  154. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  155. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  156. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  157. package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
  158. package/.versions/2.0.23/.pi/agent-fleet/scripts/package-lock.json +35 -0
  159. package/.versions/2.0.23/.pi/agent-fleet/scripts/package.json +9 -0
  160. package/.versions/2.0.23/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  161. package/.versions/2.0.23/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
  162. package/.versions/2.0.23/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  163. package/.versions/2.0.23/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
  164. package/.versions/2.0.23/.pi/agent-fleet/scripts/team-up.ts +385 -0
  165. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
  166. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  167. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  168. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
  169. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  170. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  171. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/git.ts +99 -0
  172. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
  173. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  174. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  175. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  176. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
  177. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  178. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  179. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
  180. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/quality.ts +65 -0
  181. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
  182. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  183. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
  184. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  185. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
  186. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
  187. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  188. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  189. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  190. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  191. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  192. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  193. package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  194. package/.versions/2.0.23/.pi/agents/dispatch-policy.yaml +32 -0
  195. package/.versions/2.0.23/.pi/agents/model-profiles.yaml +134 -0
  196. package/.versions/2.0.23/.pi/agents/peers.yaml +147 -0
  197. package/.versions/2.0.23/.pi/agents/teams.yaml +41 -0
  198. package/.versions/2.0.23/.pi/agents/voices.yaml +13 -0
  199. package/.versions/2.0.23/.pi/damage-control-rules.yaml +297 -0
  200. package/.versions/2.0.23/.pi/extensions/btw/README.md +120 -0
  201. package/.versions/2.0.23/.pi/extensions/btw/index.ts +916 -0
  202. package/.versions/2.0.23/.pi/extensions/btw/package.json +6 -0
  203. package/.versions/2.0.23/.pi/extensions/btw/state.js +179 -0
  204. package/.versions/2.0.23/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  205. package/.versions/2.0.23/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  206. package/.versions/2.0.23/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  207. package/.versions/2.0.23/.pi/extensions/compact-and-continue/README.md +42 -0
  208. package/.versions/2.0.23/.pi/extensions/compact-and-continue/index.ts +136 -0
  209. package/.versions/2.0.23/.pi/extensions/compact-and-continue/package.json +6 -0
  210. package/.versions/2.0.23/.pi/extensions/mcp-bridge/README.md +46 -0
  211. package/.versions/2.0.23/.pi/extensions/mcp-bridge/index.ts +206 -0
  212. package/.versions/2.0.23/.pi/extensions/mcp-bridge/package.json +6 -0
  213. package/.versions/2.0.23/.pi/extensions/package-lock.json +1175 -0
  214. package/.versions/2.0.23/.pi/extensions/package.json +9 -0
  215. package/.versions/2.0.23/.pi/extensions/pi-voice-stt/README.md +224 -0
  216. package/.versions/2.0.23/.pi/extensions/pi-voice-stt/config.ts +199 -0
  217. package/.versions/2.0.23/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  218. package/.versions/2.0.23/.pi/extensions/pi-voice-stt/index.ts +248 -0
  219. package/.versions/2.0.23/.pi/extensions/pi-voice-stt/package.json +6 -0
  220. package/.versions/2.0.23/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  221. package/.versions/2.0.23/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  222. package/.versions/2.0.23/.pi/harnesses/agent-hub/README.md +1527 -0
  223. package/.versions/2.0.23/.pi/harnesses/agent-hub/acceptance.ts +200 -0
  224. package/.versions/2.0.23/.pi/harnesses/agent-hub/access-approval.ts +141 -0
  225. package/.versions/2.0.23/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
  226. package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
  227. package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
  228. package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
  229. package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
  230. package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
  231. package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
  232. package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
  233. package/.versions/2.0.23/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
  234. package/.versions/2.0.23/.pi/harnesses/agent-hub/artifacts.js +146 -0
  235. package/.versions/2.0.23/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
  236. package/.versions/2.0.23/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
  237. package/.versions/2.0.23/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  238. package/.versions/2.0.23/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  239. package/.versions/2.0.23/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
  240. package/.versions/2.0.23/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  241. package/.versions/2.0.23/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
  242. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  243. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  244. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  245. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  246. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  247. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  248. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  249. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  250. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  251. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  252. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  253. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  254. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  255. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  256. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  257. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/context.ts +46 -0
  258. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  259. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  260. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  261. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  262. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  263. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  264. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
  265. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  266. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  267. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  268. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  269. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  270. package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  271. package/.versions/2.0.23/.pi/harnesses/agent-hub/config/agents.ts +181 -0
  272. package/.versions/2.0.23/.pi/harnesses/agent-hub/config/model-profiles.ts +237 -0
  273. package/.versions/2.0.23/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
  274. package/.versions/2.0.23/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  275. package/.versions/2.0.23/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
  276. package/.versions/2.0.23/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
  277. package/.versions/2.0.23/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  278. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  279. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
  280. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
  281. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
  282. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
  283. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
  284. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
  285. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
  286. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-compat.ts +30 -0
  287. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
  288. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
  289. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
  290. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
  291. package/.versions/2.0.23/.pi/harnesses/agent-hub/context-window.js +108 -0
  292. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-approval.ts +59 -0
  293. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
  294. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
  295. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
  296. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-hub.ts +256 -0
  297. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
  298. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
  299. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
  300. package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
  301. package/.versions/2.0.23/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  302. package/.versions/2.0.23/.pi/harnesses/agent-hub/delegate.ts +478 -0
  303. package/.versions/2.0.23/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
  304. package/.versions/2.0.23/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  305. package/.versions/2.0.23/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  306. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
  307. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  308. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-complete.ts +173 -0
  309. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +295 -0
  310. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +255 -0
  311. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-types.ts +293 -0
  312. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native.ts +236 -0
  313. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  314. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
  315. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
  316. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  317. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  318. package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  319. package/.versions/2.0.23/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  320. package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  321. package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  322. package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  323. package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  324. package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
  325. package/.versions/2.0.23/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  326. package/.versions/2.0.23/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  327. package/.versions/2.0.23/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
  328. package/.versions/2.0.23/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
  329. package/.versions/2.0.23/.pi/harnesses/agent-hub/external-blocker.js +92 -0
  330. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
  331. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
  332. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
  333. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
  334. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
  335. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
  336. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
  337. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
  338. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
  339. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
  340. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
  341. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
  342. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
  343. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
  344. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
  345. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
  346. package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
  347. package/.versions/2.0.23/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
  348. package/.versions/2.0.23/.pi/harnesses/agent-hub/fixtures/registration-surface.json +66 -0
  349. package/.versions/2.0.23/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  350. package/.versions/2.0.23/.pi/harnesses/agent-hub/footer.ts +30 -0
  351. package/.versions/2.0.23/.pi/harnesses/agent-hub/helpers.ts +270 -0
  352. package/.versions/2.0.23/.pi/harnesses/agent-hub/history-projection.ts +116 -0
  353. package/.versions/2.0.23/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
  354. package/.versions/2.0.23/.pi/harnesses/agent-hub/index.ts +2617 -0
  355. package/.versions/2.0.23/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  356. package/.versions/2.0.23/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
  357. package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
  358. package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  359. package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +145 -0
  360. package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
  361. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  362. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  363. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  364. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  365. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  366. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  367. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  368. package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  369. package/.versions/2.0.23/.pi/harnesses/agent-hub/no-progress.ts +622 -0
  370. package/.versions/2.0.23/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
  371. package/.versions/2.0.23/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
  372. package/.versions/2.0.23/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  373. package/.versions/2.0.23/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
  374. package/.versions/2.0.23/.pi/harnesses/agent-hub/package.json +7 -0
  375. package/.versions/2.0.23/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  376. package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  377. package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  378. package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  379. package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  380. package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/work-mode.ts +142 -0
  381. package/.versions/2.0.23/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  382. package/.versions/2.0.23/.pi/harnesses/agent-hub/presentation.ts +54 -0
  383. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
  384. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  385. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
  386. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
  387. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  388. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  389. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
  390. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
  391. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
  392. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
  393. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  394. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  395. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-snapshot.ts +279 -0
  396. package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
  397. package/.versions/2.0.23/.pi/harnesses/agent-hub/process-obligations.ts +159 -0
  398. package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/context.ts +55 -0
  399. package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/fragments.ts +86 -0
  400. package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  401. package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/system-prompt.ts +125 -0
  402. package/.versions/2.0.23/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  403. package/.versions/2.0.23/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  404. package/.versions/2.0.23/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  405. package/.versions/2.0.23/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  406. package/.versions/2.0.23/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
  407. package/.versions/2.0.23/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  408. package/.versions/2.0.23/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  409. package/.versions/2.0.23/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
  410. package/.versions/2.0.23/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
  411. package/.versions/2.0.23/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  412. package/.versions/2.0.23/.pi/harnesses/agent-hub/return-contract.js +349 -0
  413. package/.versions/2.0.23/.pi/harnesses/agent-hub/return-extract.js +77 -0
  414. package/.versions/2.0.23/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  415. package/.versions/2.0.23/.pi/harnesses/agent-hub/review-continuity.ts +73 -0
  416. package/.versions/2.0.23/.pi/harnesses/agent-hub/review-findings.js +96 -0
  417. package/.versions/2.0.23/.pi/harnesses/agent-hub/review-reuse.ts +47 -0
  418. package/.versions/2.0.23/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  419. package/.versions/2.0.23/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  420. package/.versions/2.0.23/.pi/harnesses/agent-hub/run-budget.js +342 -0
  421. package/.versions/2.0.23/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  422. package/.versions/2.0.23/.pi/harnesses/agent-hub/runtime-test-check.ts +68 -0
  423. package/.versions/2.0.23/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
  424. package/.versions/2.0.23/.pi/harnesses/agent-hub/scope-gate.js +233 -0
  425. package/.versions/2.0.23/.pi/harnesses/agent-hub/session-audit.ts +331 -0
  426. package/.versions/2.0.23/.pi/harnesses/agent-hub/session-health.js +110 -0
  427. package/.versions/2.0.23/.pi/harnesses/agent-hub/session-start.ts +42 -0
  428. package/.versions/2.0.23/.pi/harnesses/agent-hub/spawn.ts +665 -0
  429. package/.versions/2.0.23/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
  430. package/.versions/2.0.23/.pi/harnesses/agent-hub/specialist-result.ts +69 -0
  431. package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  432. package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-communication-store.ts +217 -0
  433. package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  434. package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
  435. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
  436. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
  437. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-authorization.ts +151 -0
  438. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
  439. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
  440. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  441. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
  442. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  443. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  444. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  445. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  446. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
  447. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  448. package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  449. package/.versions/2.0.23/.pi/harnesses/agent-hub/timeline.ts +72 -0
  450. package/.versions/2.0.23/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +79 -0
  451. package/.versions/2.0.23/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
  452. package/.versions/2.0.23/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  453. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
  454. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
  455. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
  456. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  457. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/context.ts +144 -0
  458. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
  459. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +641 -0
  460. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  461. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  462. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
  463. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
  464. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/run-flow.ts +146 -0
  465. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  466. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
  467. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  468. package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
  469. package/.versions/2.0.23/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  470. package/.versions/2.0.23/.pi/harnesses/agent-hub/types.ts +66 -0
  471. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  472. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
  473. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  474. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  475. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +155 -0
  476. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  477. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  478. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  479. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  480. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  481. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  482. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  483. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  484. package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  485. package/.versions/2.0.23/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  486. package/.versions/2.0.23/.pi/harnesses/agent-hub/version.ts +42 -0
  487. package/.versions/2.0.23/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  488. package/.versions/2.0.23/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  489. package/.versions/2.0.23/.pi/harnesses/agent-hub/work-mode.ts +186 -0
  490. package/.versions/2.0.23/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
  491. package/.versions/2.0.23/.pi/harnesses/ask-user-remote/README.md +59 -0
  492. package/.versions/2.0.23/.pi/harnesses/ask-user-remote/index.ts +571 -0
  493. package/.versions/2.0.23/.pi/harnesses/ask-user-remote/questions.ts +159 -0
  494. package/.versions/2.0.23/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  495. package/.versions/2.0.23/.pi/harnesses/ask-user-remote/runtime-ask.ts +83 -0
  496. package/.versions/2.0.23/.pi/harnesses/coms/README.md +100 -0
  497. package/.versions/2.0.23/.pi/harnesses/coms/index.ts +285 -0
  498. package/.versions/2.0.23/.pi/harnesses/coms/package.json +7 -0
  499. package/.versions/2.0.23/.pi/harnesses/coms/version.ts +42 -0
  500. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/README.md +161 -0
  501. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/index.ts +621 -0
  502. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/package.json +7 -0
  503. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
  504. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
  505. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
  506. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
  507. package/.versions/2.0.23/.pi/harnesses/damage-control-continue/version.ts +42 -0
  508. package/.versions/2.0.23/.pi/harnesses/lib/approval-wait.ts +17 -0
  509. package/.versions/2.0.23/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
  510. package/.versions/2.0.23/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  511. package/.versions/2.0.23/.pi/harnesses/lib/clarification-policy.ts +9 -0
  512. package/.versions/2.0.23/.pi/harnesses/lib/coms-core-io.ts +415 -0
  513. package/.versions/2.0.23/.pi/harnesses/lib/coms-core.ts +686 -0
  514. package/.versions/2.0.23/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
  515. package/.versions/2.0.23/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
  516. package/.versions/2.0.23/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
  517. package/.versions/2.0.23/.pi/harnesses/lib/context-budget-view.ts +112 -0
  518. package/.versions/2.0.23/.pi/harnesses/lib/context-budget.ts +114 -0
  519. package/.versions/2.0.23/.pi/harnesses/lib/context-compaction-policy.js +35 -0
  520. package/.versions/2.0.23/.pi/harnesses/lib/damage-action-hash.ts +28 -0
  521. package/.versions/2.0.23/.pi/harnesses/lib/damage-control-shared.ts +245 -0
  522. package/.versions/2.0.23/.pi/harnesses/lib/damage-guard-port.ts +25 -0
  523. package/.versions/2.0.23/.pi/harnesses/lib/damage-policy.ts +35 -0
  524. package/.versions/2.0.23/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
  525. package/.versions/2.0.23/.pi/harnesses/lib/damage-result-view.ts +16 -0
  526. package/.versions/2.0.23/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
  527. package/.versions/2.0.23/.pi/harnesses/lib/execution-trace.ts +45 -0
  528. package/.versions/2.0.23/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  529. package/.versions/2.0.23/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  530. package/.versions/2.0.23/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  531. package/.versions/2.0.23/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  532. package/.versions/2.0.23/.pi/harnesses/lib/fleet-dashboard-view.ts +172 -0
  533. package/.versions/2.0.23/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  534. package/.versions/2.0.23/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  535. package/.versions/2.0.23/.pi/harnesses/lib/fleet-panel.ts +34 -0
  536. package/.versions/2.0.23/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  537. package/.versions/2.0.23/.pi/harnesses/lib/fleet-selection.ts +24 -0
  538. package/.versions/2.0.23/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  539. package/.versions/2.0.23/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  540. package/.versions/2.0.23/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  541. package/.versions/2.0.23/.pi/harnesses/lib/herdr-client.ts +472 -0
  542. package/.versions/2.0.23/.pi/harnesses/lib/herdr-presence.ts +399 -0
  543. package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  544. package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  545. package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  546. package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  547. package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  548. package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  549. package/.versions/2.0.23/.pi/harnesses/lib/identical-dialog.ts +27 -0
  550. package/.versions/2.0.23/.pi/harnesses/lib/installation-state.js +62 -0
  551. package/.versions/2.0.23/.pi/harnesses/lib/peer-target.ts +24 -0
  552. package/.versions/2.0.23/.pi/harnesses/lib/policy-roots.js +117 -0
  553. package/.versions/2.0.23/.pi/harnesses/lib/policy-roots.ts +32 -0
  554. package/.versions/2.0.23/.pi/harnesses/lib/process-shared.ts +9 -0
  555. package/.versions/2.0.23/.pi/harnesses/lib/resource-closure.js +26 -0
  556. package/.versions/2.0.23/.pi/harnesses/lib/safe-source-read.js +29 -0
  557. package/.versions/2.0.23/.pi/harnesses/lib/semantic-approval.ts +80 -0
  558. package/.versions/2.0.23/.pi/harnesses/lib/session-target.ts +62 -0
  559. package/.versions/2.0.23/.pi/harnesses/lib/spawned-peers.js +191 -0
  560. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-agentic.js +15 -0
  561. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
  562. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
  563. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
  564. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-json.js +37 -0
  565. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-loader.js +53 -0
  566. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-proactive.js +68 -0
  567. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-triage.js +42 -0
  568. package/.versions/2.0.23/.pi/harnesses/lib/system1/config-v2.js +112 -0
  569. package/.versions/2.0.23/.pi/harnesses/lib/system1/config.js +50 -0
  570. package/.versions/2.0.23/.pi/harnesses/lib/system1/contracts.ts +154 -0
  571. package/.versions/2.0.23/.pi/harnesses/lib/system1/demo.ts +95 -0
  572. package/.versions/2.0.23/.pi/harnesses/lib/system1/jev.ts +503 -0
  573. package/.versions/2.0.23/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
  574. package/.versions/2.0.23/.pi/harnesses/lib/system1/selection.js +11 -0
  575. package/.versions/2.0.23/.pi/harnesses/lib/system1/service.ts +245 -0
  576. package/.versions/2.0.23/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  577. package/.versions/2.0.23/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  578. package/.versions/2.0.23/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  579. package/.versions/2.0.23/.pi/harnesses/lib/target-capabilities.js +7 -0
  580. package/.versions/2.0.23/.pi/harnesses/lib/update-check.ts +222 -0
  581. package/.versions/2.0.23/.pi/harnesses/lib/workspace-context.js +115 -0
  582. package/.versions/2.0.23/.pi/harnesses/lib/workspace-context.ts +22 -0
  583. package/.versions/2.0.23/.pi/harnesses/package-lock.json +2121 -0
  584. package/.versions/2.0.23/.pi/harnesses/package.json +13 -0
  585. package/.versions/2.0.23/.pi/prompts/af-build.md +27 -0
  586. package/.versions/2.0.23/.pi/prompts/af-code-simplify.md +22 -0
  587. package/.versions/2.0.23/.pi/prompts/af-constraints.md +31 -0
  588. package/.versions/2.0.23/.pi/prompts/af-plan.md +17 -0
  589. package/.versions/2.0.23/.pi/prompts/af-review.md +16 -0
  590. package/.versions/2.0.23/.pi/prompts/af-set-hermes-telegram.md +15 -0
  591. package/.versions/2.0.23/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  592. package/.versions/2.0.23/.pi/prompts/af-setup-rules.md +20 -0
  593. package/.versions/2.0.23/.pi/prompts/af-ship.md +17 -0
  594. package/.versions/2.0.23/.pi/prompts/af-spec.md +15 -0
  595. package/.versions/2.0.23/.pi/prompts/af-test.md +19 -0
  596. package/.versions/2.0.23/.pi/skills/bowser/SKILL.md +145 -0
  597. package/.versions/2.0.23/.version +1 -0
  598. package/.versions/2.0.23/agents/architect.md +24 -0
  599. package/.versions/2.0.23/agents/bowser.md +28 -0
  600. package/.versions/2.0.23/agents/builder.md +55 -0
  601. package/.versions/2.0.23/agents/code-reviewer.md +209 -0
  602. package/.versions/2.0.23/agents/deep-researcher.md +32 -0
  603. package/.versions/2.0.23/agents/documenter.md +22 -0
  604. package/.versions/2.0.23/agents/orchestrator.md +22 -0
  605. package/.versions/2.0.23/agents/plan-reviewer.md +83 -0
  606. package/.versions/2.0.23/agents/planner.md +107 -0
  607. package/.versions/2.0.23/agents/releaser.md +24 -0
  608. package/.versions/2.0.23/agents/researcher.md +30 -0
  609. package/.versions/2.0.23/agents/security-auditor.md +167 -0
  610. package/.versions/2.0.23/agents/test-engineer.md +153 -0
  611. package/.versions/2.0.23/agents/web-debugger.md +44 -0
  612. package/.versions/2.0.23/agents/web-performance-auditor.md +194 -0
  613. package/.versions/2.0.23/bin/catalog/harness-runtime-closure.json +85 -0
  614. package/.versions/2.0.23/codex/fleet-session-client/SKILL.md +34 -0
  615. package/.versions/2.0.23/codex/fleet-session-client.zip +0 -0
  616. package/.versions/2.0.23/docs/ARCHITECTURE.md +1023 -0
  617. package/.versions/2.0.23/docs/agent-fleet-setup.md +1106 -0
  618. package/.versions/2.0.23/docs/claude-code-coms-bridge.md +147 -0
  619. package/.versions/2.0.23/docs/codex-session-bridge.md +219 -0
  620. package/.versions/2.0.23/docs/coms-hermes-bridge.md +188 -0
  621. package/.versions/2.0.23/docs/getting-started.md +126 -0
  622. package/.versions/2.0.23/docs/npm-install.md +535 -0
  623. package/.versions/2.0.23/docs/pi-extensions.md +455 -0
  624. package/.versions/2.0.23/docs/pi-setup.md +92 -0
  625. package/.versions/2.0.23/docs/skill-anatomy.md +150 -0
  626. package/.versions/2.0.23/install-manifest.json +3251 -0
  627. package/.versions/2.0.23/justfile +247 -0
  628. package/.versions/2.0.23/manifest-meta.json +1096 -0
  629. package/.versions/2.0.23/references/accessibility-checklist.md +160 -0
  630. package/.versions/2.0.23/references/communication-contract.md +26 -0
  631. package/.versions/2.0.23/references/definition-of-done.md +67 -0
  632. package/.versions/2.0.23/references/fleet-coordination-patterns.md +171 -0
  633. package/.versions/2.0.23/references/observability-checklist.md +92 -0
  634. package/.versions/2.0.23/references/orchestration-patterns.md +370 -0
  635. package/.versions/2.0.23/references/performance-checklist.md +236 -0
  636. package/.versions/2.0.23/references/prompting-patterns.md +380 -0
  637. package/.versions/2.0.23/references/security-checklist.md +245 -0
  638. package/.versions/2.0.23/references/testing-patterns.md +235 -0
  639. package/.versions/2.0.23/references/workflow-authoring.md +304 -0
  640. package/.versions/2.0.23/skills/_internal/grilling.md +59 -0
  641. package/.versions/2.0.23/skills/browser-testing-with-devtools/SKILL.md +351 -0
  642. package/.versions/2.0.23/skills/code-review-and-quality/SKILL.md +396 -0
  643. package/.versions/2.0.23/skills/compound-learning/SKILL.md +137 -0
  644. package/.versions/2.0.23/skills/constraint-driven-development/SKILL.md +338 -0
  645. package/.versions/2.0.23/skills/constraint-driven-development/references/floor-guard.md +99 -0
  646. package/.versions/2.0.23/skills/context-engineering/SKILL.md +341 -0
  647. package/.versions/2.0.23/skills/deprecation-and-migration/SKILL.md +247 -0
  648. package/.versions/2.0.23/skills/designing-agents/SKILL.md +394 -0
  649. package/.versions/2.0.23/skills/designing-agents/pi-harness-authoring.md +222 -0
  650. package/.versions/2.0.23/skills/drafting-workflows/SKILL.md +143 -0
  651. package/.versions/2.0.23/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  652. package/.versions/2.0.23/skills/frontend-ui-engineering/SKILL.md +328 -0
  653. package/.versions/2.0.23/skills/git-workflow-and-versioning/SKILL.md +316 -0
  654. package/.versions/2.0.23/skills/idea-refine/SKILL.md +182 -0
  655. package/.versions/2.0.23/skills/idea-refine/examples.md +238 -0
  656. package/.versions/2.0.23/skills/idea-refine/frameworks.md +99 -0
  657. package/.versions/2.0.23/skills/idea-refine/refinement-criteria.md +113 -0
  658. package/.versions/2.0.23/skills/idea-refine/scripts/idea-refine.sh +15 -0
  659. package/.versions/2.0.23/skills/incremental-implementation/SKILL.md +353 -0
  660. package/.versions/2.0.23/skills/incremental-implementation.zip +0 -0
  661. package/.versions/2.0.23/skills/interview-me/SKILL.md +226 -0
  662. package/.versions/2.0.23/skills/orchestration-verification/SKILL.md +182 -0
  663. package/.versions/2.0.23/skills/peer-coms/SKILL.md +90 -0
  664. package/.versions/2.0.23/skills/performance-optimization/SKILL.md +496 -0
  665. package/.versions/2.0.23/skills/planning-and-task-breakdown/SKILL.md +318 -0
  666. package/.versions/2.0.23/skills/planning-and-task-breakdown.zip +0 -0
  667. package/.versions/2.0.23/skills/repository-ai-setup/SKILL.md +135 -0
  668. package/.versions/2.0.23/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  669. package/.versions/2.0.23/skills/repository-ai-setup/references/apply-contract.md +74 -0
  670. package/.versions/2.0.23/skills/repository-ai-setup/references/provenance-template.md +16 -0
  671. package/.versions/2.0.23/skills/repository-ai-setup/references/setup-flow.md +108 -0
  672. package/.versions/2.0.23/skills/repository-ai-setup/references/verify-setup.md +20 -0
  673. package/.versions/2.0.23/skills/repository-ai-setup.zip +0 -0
  674. package/.versions/2.0.23/skills/security-and-hardening/SKILL.md +524 -0
  675. package/.versions/2.0.23/skills/spec-driven-development/SKILL.md +295 -0
  676. package/.versions/2.0.23/skills/spec-driven-development.zip +0 -0
  677. package/.versions/2.0.23/skills/using-agent-skills/SKILL.md +198 -0
  678. package/.versions/2.0.23/vendor/agent-skills-upstream/LICENSE +21 -0
  679. package/.versions/2.0.23/vendor/agent-skills-upstream/README.md +430 -0
  680. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  681. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  682. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  683. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  684. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  685. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  686. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  687. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  688. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  689. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  690. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  691. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  692. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  693. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  694. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  695. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  696. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  697. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  698. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  699. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  700. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  701. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  702. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  703. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  704. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  705. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  706. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  707. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  708. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  709. package/.versions/2.0.23/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  710. package/CHANGELOG.md +15 -0
  711. package/README.md +4 -1
  712. package/agents/architect.md +1 -1
  713. package/agents/bowser.md +1 -1
  714. package/agents/builder.md +1 -1
  715. package/agents/code-reviewer.md +1 -1
  716. package/agents/deep-researcher.md +1 -1
  717. package/agents/documenter.md +1 -1
  718. package/agents/orchestrator.md +1 -1
  719. package/agents/plan-reviewer.md +1 -1
  720. package/agents/planner.md +1 -1
  721. package/agents/releaser.md +1 -1
  722. package/agents/researcher.md +1 -1
  723. package/agents/security-auditor.md +1 -1
  724. package/agents/test-engineer.md +1 -1
  725. package/agents/web-debugger.md +1 -1
  726. package/agents/web-performance-auditor.md +1 -1
  727. package/bin/catalog/harness-runtime-closure.json +12 -0
  728. package/docs/ARCHITECTURE.md +41 -0
  729. package/docs/agent-fleet-setup.md +5 -2
  730. package/docs/session-worktree-targeting.md +99 -0
  731. package/docs/workflows.md +4 -0
  732. package/install-manifest.json +43 -2
  733. package/justfile +6 -6
  734. package/manifest-meta.json +8 -0
  735. package/package.json +3 -2
@@ -0,0 +1,62 @@
1
+ import {TARGET_CAPABILITIES} from './target-capabilities.js';
2
+ import {realpathSync} from 'node:fs';
3
+ import type {ExtensionAPI} from '@mariozechner/pi-coding-agent';
4
+ import {sessionRootsFromEnv,validateSessionRoots,projectForSession,type SessionRoots} from './workspace-context.ts';
5
+ import {approveWorktreeScope} from './system1/worktree-scopes.ts';
6
+ import {readSystem1Document,loadSystem1Snapshot} from './system1/config-loader.js';
7
+ const ENTRY='fleet-session-roots-v1';
8
+ /** Session metadata binds history to a checkout. It never supplies source consent. */
9
+ export function createSessionTargetGuard(pi:ExtensionAPI){
10
+ let binding:SessionRoots|undefined;let refusal:string|undefined;let initialized=false;
11
+ function current(cwd:string):string|undefined {
12
+ if(refusal)return refusal;
13
+ if(!initialized)return process.env.AF_SESSION_ROOTS?'session_target_not_initialized':undefined;
14
+ try{
15
+ const supplied=sessionRootsFromEnv();
16
+ if(!binding)return supplied?'session_target_changed':undefined;
17
+ validateSessionRoots(binding);
18
+ if(supplied?.targetId!==binding.targetId||realpathSync(cwd)!==binding.executionRoot)return 'session_target_changed';
19
+ return undefined;
20
+ }catch{return 'session_target_stale';}
21
+ }
22
+ async function start(ctx:any){
23
+ refusal=undefined;initialized=true;
24
+ try{
25
+ const supplied=sessionRootsFromEnv();
26
+ if(binding&&supplied?.targetId!==binding.targetId)throw Error('session_target_changed');
27
+ binding??=supplied;
28
+ const branch=ctx.sessionManager?.getBranch?.()??[];
29
+ const saved=branch.filter((entry:any)=>entry.type==='custom'&&entry.customType===ENTRY).at(-1)?.data;
30
+ if(saved){validateSessionRoots(saved);if(!binding||saved.targetId!==binding.targetId)throw Error('resume_target_mismatch');}
31
+ else if(binding){
32
+ if(branch.some((entry:any)=>entry.type==='message'))throw Error('unbound_resume_requires_new_session');
33
+ if(!ctx.sessionManager)throw Error('session_binding_unavailable');
34
+ pi.appendEntry(ENTRY,binding);
35
+ }
36
+ const error=current(ctx.cwd);if(error)throw Error(error);
37
+ }catch(error){refusal=error instanceof Error?error.message:String(error);ctx.ui.notify(`Fleet target refused: ${refusal}. Start a new session from af with the original --worktree.`,'error');}
38
+ }
39
+ pi.registerCommand('af-worktree',{
40
+ description:'Inspect and verify this session’s immutable selected checkout',
41
+ handler:async(args,ctx)=>{
42
+ if(args.trim()&&!['status','verify'].includes(args.trim())){ctx.ui.notify('Usage: /af-worktree [status|verify]. Select another checkout by starting a new just fleet --worktree session.','warning');return;}
43
+ const error=current(ctx.cwd);
44
+ if(error){ctx.ui.notify(`Fleet target refused: ${error}`,'error');return;}
45
+ if(!binding){ctx.ui.notify('Legacy session: no selected worktree');return;}
46
+ const snapshot=loadSystem1Snapshot(binding.executionRoot,binding);
47
+ let flag:string|undefined;try{flag=pi.getFlag('project') as string|undefined;}catch{}
48
+ const project=projectForSession(flag??process.env.AF_TARGET_EFFECTIVE_PROJECT??process.env.AF_TARGET_BASE_PROJECT??'default',binding);
49
+ ctx.ui.notify(JSON.stringify({workspaceRoot:binding.workspaceRoot,resourceRoot:binding.resourceRoot,executionRoot:binding.executionRoot,repositoryRoot:binding.repositoryRoot,targetId:binding.targetId,...project,capabilities:TARGET_CAPABILITIES,configurationStatus:snapshot.status,configurationReason:snapshot.targetReason??null,consumers:Object.fromEntries(Object.entries(snapshot.consumers).map(([name,section]:[string,any])=>[name,{configuredMode:snapshot.document?.consumers?.[name]?.mode??'off',effectiveMode:section.config?.mode??'off',scopeStatus:section.status,reason:section.reason??(section.status==='invalid'?'needs_adaptation':null),providerChecked:false,applicabilityChecked:false}]))},null,2));
50
+ },
51
+ });
52
+ pi.registerCommand('af-worktree-consent',{
53
+ description:'Fresh, exact per-consumer System 1 source-export approval for this checkout',
54
+ handler:async(args,ctx)=>{
55
+ const error=current(ctx.cwd);if(error||binding?.mode!=='targeted'){ctx.ui.notify(`Worktree approval refused: ${error??'target_required'}`,'error');return;}
56
+ const result=await approveWorktreeScope({binding,consumer:args.trim(),readDocument:()=>readSystem1Document(binding!.workspaceRoot),
57
+ ask:ctx.hasUI?async descriptor=>ctx.ui.confirm('Approve this exact worktree source-export scope?',JSON.stringify(descriptor,null,2)):undefined});
58
+ ctx.ui.notify(result.status==='approved'?'Exact worktree scope approved. Restart Fleet with the same --worktree to activate it; modes, limits and include lists were not changed.':`Worktree scope refused: ${result.reason}`,result.status==='approved'?'info':'warning');
59
+ },
60
+ });
61
+ return {start,current};
62
+ }
@@ -0,0 +1,191 @@
1
+ // Spawned coms peers: pane launch, readiness policy and the never-addressed sweep.
2
+ //
3
+ // Lives in the SHARED harness lib, not under agent-hub: `just fleet peer`
4
+ // (.pi/agent-fleet/scripts/peer-launch.ts) launches a single peer with the same pane plumbing
5
+ // and the same readiness timings, and the fleet scripts are installed into
6
+ // target projects that may not have selected the agent-hub harness at all.
7
+ //
8
+ // Root cause this encodes: `herdr_spawn_peer` launches a REUSABLE coms peer —
9
+ // it boots idle and waits for a `coms_send`. Spawning it delivers no work. One
10
+ // session spawned `repair-builder` and `final-test-worker`, sent all twelve of
11
+ // its messages to a third peer, and left two empty panes named like workers.
12
+ // The spawns were a sound reaction to a broken session; nothing told the
13
+ // dispatcher when the peers became addressable, and nothing noticed they never
14
+ // were addressed.
15
+ //
16
+ // Two answers: the spawn returns a readiness verdict instead of a bare pane id,
17
+ // and an unaddressed hub-spawned peer is named at the end of the session.
18
+
19
+ // Second root cause this encodes: herdr's `pane.split` takes NO command — a
20
+ // split always opens a plain interactive shell in `cwd`. The hub used to pass
21
+ // `command: argv` to it; herdr silently ignores unknown params, so every
22
+ // "spawned peer" was an empty shell pane with the right label, the tool
23
+ // reported success, and the peer never existed. `just fleet team` was
24
+ // unaffected because it launches through `layout.apply`, whose pane nodes DO
25
+ // carry an argv. A hub spawn is therefore three steps: split, wait for the
26
+ // pane's shell prompt, then type the command line.
27
+
28
+ /** Longest we wait for a spawned peer to register in the coms pool. */
29
+ export const PEER_READY_TIMEOUT_MS = 45_000;
30
+
31
+ /** Longest we wait for a freshly split pane to reach its shell prompt. */
32
+ export const PANE_PROMPT_TIMEOUT_MS = 10_000;
33
+
34
+ /** Poll interval while watching a new pane for its shell prompt, in ms. */
35
+ export const PANE_PROMPT_POLL_MS = 250;
36
+
37
+ /** Shell metacharacter-free values pass through unquoted; everything else is quoted. */
38
+ const BARE_ARG = /^[A-Za-z0-9._/,:=@%+-]+$/;
39
+
40
+ function shellQuote(arg) {
41
+ const s = String(arg ?? "");
42
+ if (s === "") return "''"; // positional placeholders must survive as empty args
43
+ if (BARE_ARG.test(s)) return s;
44
+ return `'${s.replace(/'/g, `'\\''`)}'`;
45
+ }
46
+
47
+ /**
48
+ * An argv (as built by peerCommand) turned into one line of shell input,
49
+ * newline included. Quoting matters for the empty positional placeholders the
50
+ * `just` recipes use to keep later positionals aligned — unquoted they would
51
+ * vanish and shift `--project` into the model slot.
52
+ */
53
+ export function paneLaunchLine(argv) {
54
+ if (!Array.isArray(argv) || argv.length === 0) {
55
+ throw new Error("paneLaunchLine: empty argv");
56
+ }
57
+ return `${argv.map(shellQuote).join(" ")}\n`;
58
+ }
59
+
60
+ /**
61
+ * Does this pane read end at an interactive shell prompt? Typing before the
62
+ * shell is up can drop the line, and herdr's own `agent.start` refuses a pane
63
+ * that is not at a prompt, so the spawn waits for one. Best-effort by design:
64
+ * the caller sends anyway once PANE_PROMPT_TIMEOUT_MS is spent.
65
+ */
66
+ export function looksLikeShellPrompt(text) {
67
+ if (typeof text !== "string") return false;
68
+ const lines = text.replace(/\r/g, "").split("\n");
69
+ while (lines.length > 0 && lines[lines.length - 1].trim() === "") lines.pop();
70
+ if (lines.length === 0) return false;
71
+ return /[$#%>❯➜›]\s*$/.test(lines[lines.length - 1]);
72
+ }
73
+
74
+ /**
75
+ * Launch an argv in a freshly split pane by typing it at the pane's shell.
76
+ * `client` is the herdr client (paneRead/paneSendText/paneSendKeys).
77
+ *
78
+ * Text and Enter go as separate calls on purpose: bash enables bracketed
79
+ * paste, where a newline inside sent text is inserted into the line editor
80
+ * instead of executing it. A pane that never shows a prompt still gets the
81
+ * command — the shell's input queue survives a slow banner — but the caller
82
+ * is told, because that is also what a pane whose shell died looks like.
83
+ */
84
+ export async function launchPeerInPane(client, paneId, argv, opts = {}) {
85
+ const {
86
+ timeoutMs = PANE_PROMPT_TIMEOUT_MS,
87
+ pollMs = PANE_PROMPT_POLL_MS,
88
+ now = Date.now,
89
+ sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
90
+ } = opts;
91
+ const line = paneLaunchLine(argv).replace(/\n$/, "");
92
+ const started = now();
93
+ let promptSeen = false;
94
+ for (;;) {
95
+ try {
96
+ const { read } = await client.paneRead({ pane_id: paneId, lines: 5 });
97
+ if (looksLikeShellPrompt(read?.text ?? "")) {
98
+ promptSeen = true;
99
+ break;
100
+ }
101
+ } catch {
102
+ // Pane not readable yet; the timeout below bounds the wait.
103
+ }
104
+ if (now() - started >= timeoutMs) break;
105
+ await sleep(pollMs);
106
+ }
107
+ await client.paneSendText(paneId, line);
108
+ await client.paneSendKeys(paneId, ["enter"]);
109
+ return { promptSeen, waitedMs: now() - started };
110
+ }
111
+
112
+ /**
113
+ * Seconds a hub-spawned pi peer should sleep before launching (the justfile
114
+ * recipes honor it as AGENT_FLEET_SPAWN_DELAY). Same stale-OAuth lock race
115
+ * that staggers team spawns: the first peer refreshes the token, so only a
116
+ * sibling spawned inside the warm-up window has to wait. `needed` is
117
+ * oauthNeedsWarmup() re-read at each spawn — once the warmer lands a fresh
118
+ * token it goes false and nobody waits.
119
+ */
120
+ export function spawnStaggerSeconds({ needed, lastSpawnAt, now, warmupSeconds }) {
121
+ if (!needed || !Number.isFinite(warmupSeconds) || warmupSeconds <= 0) return 0;
122
+ if (typeof lastSpawnAt !== "number" || !Number.isFinite(lastSpawnAt)) return 0;
123
+ if (now - lastSpawnAt >= warmupSeconds * 1000) return 0;
124
+ return warmupSeconds;
125
+ }
126
+
127
+ /** Poll backoff while waiting for registration, in ms; the last step repeats. */
128
+ export const PEER_READY_BACKOFF_MS = [250, 500, 1_000, 2_000, 3_000];
129
+
130
+ /** Backoff delay for the nth readiness poll (0-based); the last step repeats. */
131
+ export function peerReadyDelayMs(attempt) {
132
+ const i = Math.max(0, Math.min(Math.floor(attempt) || 0, PEER_READY_BACKOFF_MS.length - 1));
133
+ return PEER_READY_BACKOFF_MS[i];
134
+ }
135
+
136
+ /**
137
+ * The verdict a spawn reports back. `ready` means the peer is in the pool and
138
+ * `coms_send` will reach it; otherwise it is still booting and the caller is
139
+ * told how long we waited rather than being left to guess.
140
+ * @param {{name: string, paneId: string, found: boolean, waitedMs: number, timeoutMs?: number, paneTail?: string}} input
141
+ */
142
+ export function peerReadyVerdict({ name, paneId, found, waitedMs, timeoutMs = PEER_READY_TIMEOUT_MS, paneTail }) {
143
+ if (found) {
144
+ return {
145
+ peer_ready: true,
146
+ peer_name: name,
147
+ pane_id: paneId,
148
+ waited_ms: waitedMs,
149
+ message:
150
+ `Peer "${name}" is ready in pane ${paneId} after ${Math.round(waitedMs / 1000)}s — ` +
151
+ `address it with coms_send(target: "${name}", ...). It boots idle and does no work until you send.`,
152
+ };
153
+ }
154
+ // A peer that missed the window is usually dead, not slow, so the verdict
155
+ // carries the pane's own last words instead of sending the caller off to
156
+ // run herdr_read_pane to find out.
157
+ const tail = typeof paneTail === "string" ? paneTail.trim() : "";
158
+ return {
159
+ peer_ready: false,
160
+ peer_name: name,
161
+ pane_id: paneId,
162
+ waited_ms: waitedMs,
163
+ pane_tail: tail || null,
164
+ message:
165
+ `Peer "${name}" did not register in the coms pool within ${Math.round(timeoutMs / 1000)}s — ` +
166
+ `assume it failed to start rather than that it is slow. Do not coms_send to it. ` +
167
+ `Check coms_list; if it never appears, close the pane with herdr_close_pane.` +
168
+ (tail ? `\n\nLast output of pane ${paneId}:\n${tail}` : ""),
169
+ };
170
+ }
171
+
172
+ /**
173
+ * Sweep report for peers this hub spawned. `entries` carry
174
+ * { name, paneId, addressed } — `addressed` is true once any coms_send targeted
175
+ * that peer. Returns null when every spawned peer got work (the common case).
176
+ */
177
+ export function unaddressedPeerSweep(entries) {
178
+ const idle = (Array.isArray(entries) ? entries : []).filter((e) => e && !e.addressed);
179
+ if (idle.length === 0) return null;
180
+ const rows = idle.map((e) => ` ${e.name} (pane ${e.paneId ?? "?"}) — spawned, never sent to`);
181
+ return {
182
+ count: idle.length,
183
+ peers: idle.map((e) => ({ name: e.name, pane_id: e.paneId ?? null })),
184
+ message: [
185
+ `⚠ ${idle.length} hub-spawned peer(s) never received a message:`,
186
+ ...rows,
187
+ "A spawned peer boots idle and waits — it is holding a pane and a model session for nothing.",
188
+ `Close them with herdr_close_pane (asks for your confirmation) or send them work.`,
189
+ ].join("\n"),
190
+ };
191
+ }
@@ -0,0 +1,15 @@
1
+ // @ts-nocheck
2
+ // Pure Node-compatible consumer configuration; no I/O or provider construction.
3
+ export const GIT_TRACKED_INCLUDE = 'git:tracked';
4
+ export const AGENTIC_LIMITS = Object.freeze({ maxFiles: 20, maxQuestions: 16, maxStateBytes: 8192, maxQuestionsBytes: 16384, maxSourceBytes: 65536, maxRequestBytes: 131072, maxCallsPerSession: 100, timeoutMs: 2000, collectionMs: 1000, maxHandles: 20, maxRetainedBytes: 1048576 });
5
+ export function parseAgenticConfig(value) {
6
+ if (!value || typeof value !== 'object' || Array.isArray(value) || Object.keys(value).some(k => !['mode','remoteContextApproved','include','allowToolOutputs','limits'].includes(k))) throw new Error('Invalid agentic section');
7
+ if (!['off','advisory','recommended'].includes(value.mode) || (value.remoteContextApproved !== undefined && typeof value.remoteContextApproved !== 'boolean') || (value.allowToolOutputs !== undefined && typeof value.allowToolOutputs !== 'boolean')) throw new Error('Invalid agentic mode or consent');
8
+ const include = value.include ?? [];
9
+ if (!Array.isArray(include) || include.length > AGENTIC_LIMITS.maxFiles || include.some(p => typeof p !== 'string' || !p || p.length > 1024 || (p.startsWith('git:') && p !== GIT_TRACKED_INCLUDE) || /[\\\0*?]/.test(p) || p.startsWith('/') || p.replace(/\/$/,'').split('/').some(s => !s || s === '.' || s === '..'))) throw new Error('Invalid include scope');
10
+ const supplied = value.limits ?? {};
11
+ if (!supplied || typeof supplied !== 'object' || Array.isArray(supplied) || Object.keys(supplied).some(k => !Object.hasOwn(AGENTIC_LIMITS,k))) throw new Error('Invalid agentic limits');
12
+ const limits = { ...AGENTIC_LIMITS, ...supplied };
13
+ if (Object.entries(limits).some(([key,n]) => !Number.isSafeInteger(n) || n <= 0 || n > AGENTIC_LIMITS[key])) throw new Error('Invalid agentic limits');
14
+ return { mode:value.mode, remoteContextApproved:value.remoteContextApproved === true, include:[...include], allowToolOutputs:value.allowToolOutputs === true, limits };
15
+ }
@@ -0,0 +1,16 @@
1
+ import { COMPACTION_MIN_PERCENT, COMPACTION_EARLY_PERCENT, COMPACTION_TARGET_PERCENT } from "../context-compaction-policy.js";
2
+ export const CONTEXT_COMPACTION_LIMITS = Object.freeze({timeoutMs:1000,maxStateBytes:8192});
3
+ /** Independent opt-in. Invalid semantic policy cannot disable deterministic recovery. */
4
+ /** @param {unknown} input */
5
+ export function parseContextCompactionConfig(input) {
6
+ const value=/** @type {Record<string,any>} */ (input);
7
+ if(!value || typeof value!== 'object' || Array.isArray(value)) throw Error('Invalid contextCompaction section');
8
+ if(Object.keys(value).some(k=>!['mode','remoteContextApproved','earlyOpportunityPercent','limits'].includes(k)) || !['off','automatic'].includes(value.mode) || (value.remoteContextApproved!==undefined && typeof value.remoteContextApproved!=='boolean')) throw Error('Invalid contextCompaction section');
9
+ const percent=value.earlyOpportunityPercent ?? COMPACTION_EARLY_PERCENT;
10
+ if(typeof percent!== 'number' || !Number.isFinite(percent) || percent<COMPACTION_MIN_PERCENT || percent>COMPACTION_TARGET_PERCENT) throw Error('Invalid early opportunity threshold');
11
+ const supplied=value.limits ?? {};
12
+ if(!supplied || typeof supplied!== 'object' || Array.isArray(supplied) || Object.keys(supplied).some(k=>!Object.hasOwn(CONTEXT_COMPACTION_LIMITS,k))) throw Error('Invalid contextCompaction limits');
13
+ const limits={...CONTEXT_COMPACTION_LIMITS,...supplied};
14
+ if(Object.entries(limits).some(([k,v])=>!Number.isSafeInteger(v) || v<=0 || v>CONTEXT_COMPACTION_LIMITS[/** @type {keyof typeof CONTEXT_COMPACTION_LIMITS} */ (k)]))throw Error('Invalid contextCompaction limits');
15
+ return {mode:value.mode,remoteContextApproved:value.remoteContextApproved===true,earlyOpportunityPercent:percent,limits};
16
+ }
@@ -0,0 +1,24 @@
1
+ // Pure independent configuration. Missing consent never inherits another consumer's scopes.
2
+ export const DAMAGE_GUARD_LIMITS = Object.freeze({
3
+ maxPayloadBytes:16384, hookTimeoutMs:2000, maxFrameBytes:65536,
4
+ outageBackoffMs:5000, approvalTimeoutMs:600000,
5
+ });
6
+ /** @param {unknown} value */
7
+ export function parseDamageGuardConfig(value) {
8
+ /** @param {unknown} v */
9
+ const record = v => v !== null && typeof v === 'object' && !Array.isArray(v);
10
+ if (!record(value)) throw Error('Invalid damageGuard section');
11
+ const section = /** @type {Record<string, any>} */ (value);
12
+ if (Object.keys(section).some(k => !['mode','remoteScopes','include','limits'].includes(k)) || !['off','active'].includes(section.mode)) throw Error('Invalid damageGuard section');
13
+ const suppliedScopes = section.remoteScopes ?? {};
14
+ if (!record(suppliedScopes) || Object.entries(suppliedScopes).some(([k,v]) => !['commands','edits','results'].includes(k) || typeof v !== 'boolean')) throw Error('Invalid damageGuard scopes');
15
+ const remoteScopes = {commands:suppliedScopes.commands === true,edits:suppliedScopes.edits === true,results:suppliedScopes.results === true};
16
+ const include = section.include ?? [];
17
+ if (!Array.isArray(include) || include.length > 20 || include.some(p => typeof p !== 'string' || !p || p.length > 1024 || (p.startsWith('git:') && p !== 'git:tracked') || /[\\\0*?:]/.test(p === 'git:tracked' ? '' : p) || p.startsWith('/') || p.replace(/\/$/,'').split('/').some(s => !s || s === '.' || s === '..'))) throw Error('Invalid include scope');
18
+ if (section.mode === 'active' && Object.values(remoteScopes).some(Boolean) && !include.length) throw Error('Explicit include scope required');
19
+ const supplied = section.limits ?? {};
20
+ if (!record(supplied) || Object.keys(supplied).some(k => !Object.hasOwn(DAMAGE_GUARD_LIMITS,k))) throw Error('Invalid damageGuard limits');
21
+ const limits = {...DAMAGE_GUARD_LIMITS,...supplied};
22
+ if (Object.entries(limits).some(([k,n]) => !Number.isSafeInteger(n) || n <= 0 || n > DAMAGE_GUARD_LIMITS[/** @type {keyof typeof DAMAGE_GUARD_LIMITS} */ (k)])) throw Error('Invalid damageGuard limits');
23
+ return {mode:/** @type {'off'|'active'} */ (section.mode),remoteScopes,include:[...include],limits};
24
+ }
@@ -0,0 +1,23 @@
1
+ // Pure independent consumer configuration. Defaults are also supported maxima.
2
+ export const FILE_DISCOVERY_LIMITS = Object.freeze({
3
+ concurrency: 8, maxQueuedJobs: 32, maxCandidates: 1024,
4
+ maxEvaluationsPerJob: 256, maxCallsPerSession: 10000, maxFileBytes: 65536,
5
+ maxRequestBytes: 131072, maxSourceBytesPerJob: 16777216, discoveryMs: 1000,
6
+ jobTimeoutMs: 20000, resultPageBytes: 32768, maxCacheEntries: 2048,
7
+ });
8
+ /** @param {unknown} value */
9
+ export function parseFileDiscoveryConfig(value) {
10
+ if (!value || typeof value !== 'object' || Array.isArray(value)) throw Error('Invalid fileDiscovery section');
11
+ const section = /** @type {Record<string, any>} */ (value);
12
+ if (Object.keys(section).some(k => !['mode','remoteContextApproved','include','limits','semanticReads'].includes(k)) || !['off','active'].includes(section.mode) || (section.remoteContextApproved !== undefined && typeof section.remoteContextApproved !== 'boolean')) throw Error('Invalid fileDiscovery section');
13
+ const semantic = section.semanticReads === undefined ? {mode:'off'} : section.semanticReads;
14
+ if (!semantic || typeof semantic !== 'object' || Array.isArray(semantic) || Object.keys(semantic).some(k=>k!=='mode') || !['off','active'].includes(semantic.mode)) throw Error('Invalid semanticReads section');
15
+ const include = section.include ?? [];
16
+ if (!Array.isArray(include) || include.length > 20 || include.some(p => typeof p !== 'string' || !p || p.length > 1024 || /[\\\0*?]/.test(p) || p.startsWith('/') || p.replace(/\/$/,'').split('/').some(s => !s || s === '.' || s === '..'))) throw Error('Invalid include scope');
17
+ if (section.mode === 'active' && section.remoteContextApproved === true && !include.length) throw Error('Explicit include scope required');
18
+ const supplied = section.limits ?? {};
19
+ if (!supplied || typeof supplied !== 'object' || Array.isArray(supplied) || Object.keys(supplied).some(k => !Object.hasOwn(FILE_DISCOVERY_LIMITS,k))) throw Error('Invalid fileDiscovery limits');
20
+ const limits = { ...FILE_DISCOVERY_LIMITS, ...supplied };
21
+ if (Object.entries(limits).some(([k,n]) => !Number.isSafeInteger(n) || n <= 0 || n > FILE_DISCOVERY_LIMITS[/** @type {keyof typeof FILE_DISCOVERY_LIMITS} */ (k)])) throw Error('Invalid fileDiscovery limits');
22
+ return { semanticReads:{mode:/** @type {'off'|'active'} */ (semantic.mode)}, mode: /** @type {'off'|'active'} */ (section.mode), remoteContextApproved: section.remoteContextApproved === true, include: /** @type {string[]} */ ([...include]), limits: /** @type {Record<keyof typeof FILE_DISCOVERY_LIMITS, number>} */ (limits) };
23
+ }
@@ -0,0 +1,37 @@
1
+ // @ts-nocheck
2
+ /** JSON parser that refuses duplicate object keys, including escaped aliases. */
3
+ export function parseConfigJson(text) {
4
+ let i = 0;
5
+ const space = () => { while (/\s/.test(text[i] ?? '') && i < text.length) i++; };
6
+ const string = () => {
7
+ const start = i++;
8
+ while (i < text.length) {
9
+ if (text[i] === '\\') { i += 2; continue; }
10
+ if (text[i++] === '"') return JSON.parse(text.slice(start, i));
11
+ }
12
+ throw new Error('Invalid JSON string');
13
+ };
14
+ const value = path => {
15
+ space();
16
+ if (text[i] === '{') {
17
+ i++; space(); const keys = new Set();
18
+ if (text[i] === '}') { i++; return; }
19
+ while (i < text.length) {
20
+ space(); if (text[i] !== '"') throw new Error(`Invalid JSON at ${path}`);
21
+ const key = string();
22
+ if (keys.has(key)) throw new Error(`Duplicate JSON key: ${path}.${key}`);
23
+ keys.add(key); space(); if (text[i++] !== ':') throw new Error(`Invalid JSON at ${path}`);
24
+ value(`${path}.${key}`); space();
25
+ const end = text[i++]; if (end === '}') return; if (end !== ',') throw new Error(`Invalid JSON at ${path}`);
26
+ }
27
+ } else if (text[i] === '[') {
28
+ i++; space(); if (text[i] === ']') { i++; return; }
29
+ let index = 0;
30
+ while (i < text.length) { value(`${path}[${index++}]`); space(); const end = text[i++]; if (end === ']') return; if (end !== ',') throw new Error(`Invalid JSON at ${path}`); }
31
+ } else if (text[i] === '"') { string(); return; }
32
+ else { const start = i; while (i < text.length && !/[\s,}\]]/.test(text[i])) i++; JSON.parse(text.slice(start, i)); return; }
33
+ throw new Error(`Invalid JSON at ${path}`);
34
+ };
35
+ value('$'); space(); if (i !== text.length) throw new Error('Invalid trailing JSON');
36
+ return JSON.parse(text);
37
+ }
@@ -0,0 +1,53 @@
1
+ // @ts-nocheck
2
+ // Caller-owned session I/O boundary; consumers use this snapshot, never legacy files.
3
+ import { closeSync, constants, fstatSync, lstatSync, openSync, readSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { normalizeSystem1Config } from './config-v2.js';
6
+ import { parseConfigJson } from './config-json.js';
7
+ import { system1SelectedByDesired } from './selection.js';
8
+ import { workspaceRoot, sessionRootsFromEnv } from '../workspace-context.js';
9
+ import { gateWorktreeSnapshot, projectWorktreeDocument } from './worktree-scopes.js';
10
+ const MAX_CONFIG_BYTES = 1024 * 1024;
11
+ const sameFile = (a, b) => a.dev === b.dev && a.ino === b.ino;
12
+ function readWorkspaceJson(root, name) {
13
+ let fd;
14
+ try {
15
+ const parent = join(root, '.ai');
16
+ const parentStat = lstatSync(parent);
17
+ if (!parentStat.isDirectory()) return null;
18
+ const path = join(parent, name);
19
+ const stat = lstatSync(path);
20
+ if (!stat.isFile() || stat.size > MAX_CONFIG_BYTES) return null;
21
+ if (typeof constants.O_NOFOLLOW !== 'number') return null;
22
+ fd = openSync(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
23
+ const opened = fstatSync(fd);
24
+ const currentParent = lstatSync(parent);
25
+ if (!opened.isFile() || opened.size > MAX_CONFIG_BYTES || !sameFile(stat, opened) || !currentParent.isDirectory() || !sameFile(parentStat, currentParent)) return null;
26
+ // Bound actual reads as well as metadata: a concurrently growing file is refused.
27
+ const buffer = Buffer.alloc(MAX_CONFIG_BYTES + 1);
28
+ let length = 0, count;
29
+ while (length < buffer.length && (count = readSync(fd, buffer, length, buffer.length - length, null)) > 0) length += count;
30
+ if (length > MAX_CONFIG_BYTES) return null;
31
+ const after = fstatSync(fd);
32
+ if (opened.size !== after.size || opened.mtimeMs !== after.mtimeMs || opened.ctimeMs !== after.ctimeMs) return null;
33
+ return parseConfigJson(buffer.toString('utf8', 0, length));
34
+ } catch (error) { return error.code === 'ENOENT' ? undefined : null; }
35
+ finally { if (fd !== undefined) closeSync(fd); }
36
+ }
37
+ export function readSystem1Document(root,binding=sessionRootsFromEnv()) { return readWorkspaceJson(binding?.workspaceRoot??root, 'system1.json'); }
38
+ export function loadSystem1Snapshot(root,binding=sessionRootsFromEnv()) {
39
+ const document=readSystem1Document(root,binding);
40
+ try {
41
+ const effectiveDocument=projectWorktreeDocument(document,binding);
42
+ const snapshot=normalizeSystem1Config(effectiveDocument);
43
+ return gateWorktreeSnapshot(effectiveDocument===document?snapshot:Object.freeze({...snapshot,document,effectiveDocument}),binding);
44
+ } catch { return Object.freeze({...normalizeSystem1Config(null),targetReason:'ambiguous_worktree_scope'}); }
45
+ }
46
+ export function readSystem1Selected(root) {
47
+ return system1SelectedByDesired(readWorkspaceJson(workspaceRoot(root), 'agent-fleet.json'));
48
+ }
49
+ export function providerDocument(snapshot) {
50
+ if (snapshot.status === 'missing') return undefined;
51
+ if (snapshot.status === 'migration_required') return snapshot.legacyProvider;
52
+ return snapshot.provider ?? null;
53
+ }
@@ -0,0 +1,68 @@
1
+ // Pure configuration validation shared by Node CLI and Hub.
2
+ // @ts-nocheck
3
+ const safePath = (path) => typeof path === "string" && path.length > 0 && path.length <= 256 && !path.includes("\\") && !path.includes("\0") && !path.startsWith("/") && path.split("/").every(s => !!s && s !== "." && s !== ".." && !s.startsWith("."));
4
+ const safeRulePath = (path) => typeof path === "string" && path.startsWith(".ai/") ? safePath(path.slice(4)) : safePath(path);
5
+ const exact = (v, keys) => typeof v === "object" && v !== null && !Array.isArray(v) && Object.keys(v).every(k => keys.includes(k)) && keys.every(k => k in v);
6
+ const paths = (v) => Array.isArray(v) && v.length <= 32 && v.every(safePath) && new Set(v).size === v.length;
7
+ const safeBasename = (v) => typeof v === "string" && safePath(v) && !v.includes("/") && !v.includes("*") && !v.includes("?");
8
+ export function parseLocalBindings(value) {
9
+ if (!Array.isArray(value) || value.length > 16)
10
+ throw new Error("Invalid local bindings");
11
+ return Object.freeze(value.map((item) => {
12
+ if (!exact(item, ["version", "validator", "rule", "applicability", "exceptions", "placement"]) && !exact(item, ["version", "validator", "rule", "applicability", "exceptions"]))
13
+ throw new Error("Invalid local binding schema");
14
+ const b = item;
15
+ if (b.version !== 1 || !["relative-markdown-links", "new-file-placement"].includes(b.validator) ||
16
+ !exact(b.rule, ["path", "heading", "occurrence", "hash"]) || !safeRulePath(b.rule.path) || !b.rule.path.endsWith(".md") ||
17
+ typeof b.rule.heading !== "string" || !b.rule.heading.trim() || b.rule.heading.length > 200 || !Number.isSafeInteger(b.rule.occurrence) || b.rule.occurrence < 1 || !/^[a-f0-9]{64}$/.test(b.rule.hash) ||
18
+ (!exact(b.applicability, ["paths", "kinds"]) && !exact(b.applicability, ["paths", "kinds", "basename"])) || (b.applicability.basename !== undefined && (!safeBasename(b.applicability.basename) || !b.applicability.paths.includes(b.applicability.basename))) || !paths(b.applicability.paths) || !b.applicability.paths.length || !Array.isArray(b.applicability.kinds) || !b.applicability.kinds.length || new Set(b.applicability.kinds).size !== b.applicability.kinds.length || !b.applicability.kinds.every(k => k === "added" || k === "modified") ||
19
+ !exact(b.exceptions, ["paths", "legacy"]) || !paths(b.exceptions.paths) || typeof b.exceptions.legacy !== "boolean" ||
20
+ (b.validator === "new-file-placement" ? !exact(b.placement, ["prefix"]) || !safePath(b.placement.prefix) || b.applicability.kinds.some(k => k !== "added") : b.placement !== undefined))
21
+ throw new Error("Invalid local binding values");
22
+ return Object.freeze({ version: 1, validator: b.validator, rule: Object.freeze({ ...b.rule }), applicability: Object.freeze({ paths: Object.freeze([...b.applicability.paths]), kinds: Object.freeze([...b.applicability.kinds]), ...(b.applicability.basename === undefined ? {} : { basename: b.applicability.basename }) }), exceptions: Object.freeze({ paths: Object.freeze([...b.exceptions.paths]), legacy: b.exceptions.legacy }), ...(b.placement ? { placement: Object.freeze({ ...b.placement }) } : {}) });
23
+ }));
24
+ }
25
+ const DEFAULT_BUDGET = 100;
26
+ export const PROACTIVE_LIMITS = Object.freeze({ maxUnits: 20, maxRetainedBytes: 256 * 1024, maxStateBytes: 32 * 1024, maxQuestions: 16, maxCallsPerTurn: 2, captureMs: 1000, maxFileBytes: 64 * 1024 });
27
+ const keys = new Set(["version", "mode", "remoteContext", "include", "maxEvaluationsPerSession", "localBindings"]);
28
+ const OFF = Object.freeze({ version: 1, mode: "off", remoteContext: "disabled", include: Object.freeze([]), maxEvaluationsPerSession: 0 });
29
+ function includePath(value) {
30
+ if (typeof value !== "string" || !value || value.length > 256 || value.startsWith("/") || value.startsWith(".") || value.includes("\\") || value.includes("\0") || /[{}!\[\]?]/.test(value))
31
+ return false;
32
+ const segments = value.split("/");
33
+ return segments.every(s => !!s && s !== ".." && s !== "." && !s.startsWith(".")) && !segments.some(s => /^(node_modules|vendor|dist|build|coverage|\.git|\.pi)$/i.test(s)) && (segments.length > 1 || !value.includes("*"));
34
+ }
35
+ function externalIncludePath(value, context) {
36
+ if (typeof value !== 'string' || !value.startsWith('../') || value.length > 256 || value.includes('\\') || value.includes('\0') || /[{}!\[\]?]/.test(value)) return false;
37
+ const segments = value.split('/');
38
+ let prefix = 0;
39
+ while (segments[prefix] === '..') prefix++;
40
+ const tail = segments.slice(prefix);
41
+ if (!tail.length || tail.some(s => !s || s === '.' || s === '..' || s.startsWith('.') || /^(?:node_modules|vendor|dist|build|coverage|artifacts|sessions?|transcripts?|credentials?(?:\..*)?|secrets?(?:\..*)?|id_(?:rsa|ed25519)|.*\.(?:pem|key|p12|pfx|sqlite|db|lock))$/i.test(s))) return false;
42
+ // Only a terminal subtree wildcard is contextually authorizable; no glob-prefix widening.
43
+ if (tail.some((s,i) => s.includes('*') && (s !== '**' || i !== tail.length - 1)) || tail[0] === '**') return false;
44
+ return context?.externalIncludeAllowed?.(value) === true;
45
+ }
46
+ export function parseProactiveConfig(value, context) {
47
+ if (typeof value !== "object" || value === null || Array.isArray(value))
48
+ throw new Error("Invalid proactive review config");
49
+ const v = value;
50
+ if (Object.keys(v).some(k => !keys.has(k)) || v.version !== 1 || !["off", "shadow", "advisory"].includes(String(v.mode)))
51
+ throw new Error("Unsupported proactive review config");
52
+ if (v.remoteContext !== undefined && v.remoteContext !== "disabled" && v.remoteContext !== "selected-excerpts")
53
+ throw new Error("Invalid remoteContext");
54
+ if (v.include !== undefined && (!Array.isArray(v.include) || v.include.length > 32 || !v.include.every(path => includePath(path) || externalIncludePath(path, context)) || new Set(v.include).size !== v.include.length))
55
+ throw new Error("Invalid include scope");
56
+ const bindings = v.localBindings === undefined ? undefined : parseLocalBindings(v.localBindings);
57
+ const budget = v.maxEvaluationsPerSession ?? DEFAULT_BUDGET;
58
+ if (!Number.isSafeInteger(budget) || Number(budget) < 0 || Number(budget) > 100)
59
+ throw new Error("Invalid session budget");
60
+ if (v.mode === "off") {
61
+ if ((v.remoteContext && v.remoteContext !== "disabled") || (Array.isArray(v.include) && v.include.length) || bindings?.length || (v.maxEvaluationsPerSession !== undefined && budget !== 0))
62
+ throw new Error("Off config must not authorize capture");
63
+ return OFF;
64
+ }
65
+ if (!Array.isArray(v.include) || !v.include.length)
66
+ throw new Error("Explicit include scope required");
67
+ return Object.freeze({ version: 1, mode: v.mode, remoteContext: (v.remoteContext ?? "disabled"), include: Object.freeze([...v.include]), maxEvaluationsPerSession: Number(budget), ...(bindings ? { localBindings: bindings } : {}) });
68
+ }
@@ -0,0 +1,42 @@
1
+ // Pure configuration validation shared by Node CLI and Hub.
2
+ // @ts-nocheck
3
+ export const TRIAGE_VERSION = "dispatch-triage/v1";
4
+ export const TASK_TRIAGE_QUESTION_VERSION = "task-triage/questions/v1";
5
+ export const TASK_TRIAGE_POLICY_VERSION = "task-triage/policy/v1";
6
+ export const TASK_TRIAGE_STATE_VERSION = "task-triage/state/v1";
7
+ export const TASK_TRIAGE_PROVIDER = "typesafe";
8
+ export const TASK_TRIAGE_MODEL = "jev-1.13.0";
9
+ export const TASK_TRIAGE_LIMITS = Object.freeze({ maxTaskBytes: 40 * 1024, maxStateBytes: 64 * 1024, maxCallsPerSession: 100, timeoutMs: 2000 });
10
+ export function validProfile(p) {
11
+ const x = p;
12
+ return !!x && x.version === TRIAGE_VERSION && x.approved === true && typeof x.evidence === "string" && !!x.evidence.trim()
13
+ && typeof x.provider === "string" && !!x.provider && typeof x.model === "string" && !!x.model
14
+ && [x.languages, x.domains].every(v => Array.isArray(v) && v.length > 0 && v.every(s => typeof s === "string" && !!s))
15
+ && [x.minConfidence, x.minMargin, x.securityThreshold, x.destructiveThreshold].every(v => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= 1);
16
+ }
17
+ export function parseTriageConfig(value) {
18
+ const c = value;
19
+ if (!c || typeof c !== "object" || Array.isArray(c) || Object.keys(c).some(k => !["version", "mode", "remoteContextApproved", "maxCalls", "maxStateBytes", "maxTaskBytes", "maxRoleBytes", "profile", "orchestratorBeforeDispatch"].includes(k)) || c.version !== 1 || !["off", "shadow", "advisory"].includes(c.mode) || typeof c.remoteContextApproved !== "boolean")
20
+ return null;
21
+ if (![c.maxCalls, c.maxStateBytes, c.maxTaskBytes, c.maxRoleBytes].every(n => Number.isSafeInteger(n) && n > 0))
22
+ return null;
23
+ if (c.profile !== undefined && !validProfile(c.profile))
24
+ return null;
25
+ if (c.orchestratorBeforeDispatch !== undefined && typeof c.orchestratorBeforeDispatch !== "boolean")
26
+ return null;
27
+ return JSON.parse(JSON.stringify(c));
28
+ }
29
+ const keys = ["version", "mode", "remoteContextApproved", "provider", "model", "questionVersion", "policyVersion", "limits"];
30
+ export function parseTaskTriageConfig(value) {
31
+ if (!value || typeof value !== "object" || Array.isArray(value))
32
+ return { status: "invalid" };
33
+ const x = value;
34
+ if (Object.keys(x).some(k => !keys.includes(k)) || x.version !== 1 || (x.mode !== "off" && x.mode !== "experimental") || typeof x.remoteContextApproved !== "boolean" || x.provider !== TASK_TRIAGE_PROVIDER || x.model !== TASK_TRIAGE_MODEL || x.questionVersion !== TASK_TRIAGE_QUESTION_VERSION || x.policyVersion !== TASK_TRIAGE_POLICY_VERSION || !x.limits || typeof x.limits !== "object" || Array.isArray(x.limits))
35
+ return { status: "invalid" };
36
+ const limits = x.limits;
37
+ if (Object.keys(limits).length !== Object.keys(TASK_TRIAGE_LIMITS).length || Object.entries(TASK_TRIAGE_LIMITS).some(([k, v]) => limits[k] !== v))
38
+ return { status: "invalid" };
39
+ if (x.mode === "off")
40
+ return x.remoteContextApproved ? { status: "invalid" } : { status: "off" };
41
+ return x.remoteContextApproved ? { status: "active", config: x } : { status: "off" };
42
+ }