@chankov/agent-fleet 2.2.0 → 2.2.2

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 (1485) hide show
  1. package/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +11 -3
  2. package/.pi/agent-fleet/scripts/lib/codex-connection-history.ts +51 -0
  3. package/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +2 -2
  4. package/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +10 -7
  5. package/.pi/harnesses/agent-hub/README.md +8 -0
  6. package/.pi/harnesses/agent-hub/codex-bootstrap.ts +31 -31
  7. package/.pi/harnesses/agent-hub/package.json +1 -1
  8. package/.pi/harnesses/agent-hub/task-triage-runtime.ts +3 -1
  9. package/.pi/harnesses/agent-hub/tools/action-executors.ts +2 -0
  10. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +2 -2
  11. package/.pi/harnesses/coms/package.json +1 -1
  12. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  13. package/.pi/harnesses/lib/fleet-codex-chat-view.ts +28 -16
  14. package/.pi/harnesses/lib/fleet-connection-diagnostics.ts +7 -0
  15. package/.pi/harnesses/lib/fleet-notification-bootstrap.ts +35 -15
  16. package/.versions/2.2.1/.pi/agent-fleet/hermes/README.md +347 -0
  17. package/.versions/2.2.1/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  18. package/.versions/2.2.1/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  19. package/.versions/2.2.1/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  20. package/.versions/2.2.1/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  21. package/.versions/2.2.1/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  22. package/.versions/2.2.1/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  23. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  24. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  25. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  26. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  27. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  28. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  29. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  30. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  31. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  32. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  33. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  34. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  35. package/.versions/2.2.1/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  36. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  37. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  38. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  39. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  40. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  41. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  42. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  43. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  44. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  45. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  46. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  47. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  48. package/.versions/2.2.1/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  49. package/.versions/2.2.1/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  50. package/.versions/2.2.1/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
  51. package/.versions/2.2.1/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  52. package/.versions/2.2.1/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
  53. package/.versions/2.2.1/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
  54. package/.versions/2.2.1/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
  55. package/.versions/2.2.1/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  56. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
  57. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
  58. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
  59. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
  60. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
  61. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
  62. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
  63. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
  64. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
  65. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
  66. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
  67. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
  68. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
  69. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
  70. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
  71. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
  72. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
  73. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
  74. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
  75. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
  76. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
  77. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
  78. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
  79. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
  80. package/.versions/2.2.1/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
  81. package/.versions/2.2.1/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
  82. package/.versions/2.2.1/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
  83. package/.versions/2.2.1/.pi/agent-fleet/scripts/fleet.ts +244 -0
  84. package/.versions/2.2.1/.pi/agent-fleet/scripts/flow.ts +166 -0
  85. package/.versions/2.2.1/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  86. package/.versions/2.2.1/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  87. package/.versions/2.2.1/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  88. package/.versions/2.2.1/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  89. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
  90. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
  91. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +52 -0
  92. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
  93. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-connection-history.ts +51 -0
  94. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
  95. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
  96. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
  97. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
  98. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
  99. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
  100. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
  101. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
  102. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
  103. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  104. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  105. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
  106. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
  107. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
  108. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
  109. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +207 -0
  110. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
  111. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
  112. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
  113. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
  114. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
  115. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
  116. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
  117. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
  118. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
  119. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
  120. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
  121. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
  122. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
  123. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
  124. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
  125. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
  126. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
  127. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
  128. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
  129. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
  130. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
  131. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
  132. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  133. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  134. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  135. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  136. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  137. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  138. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  139. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  140. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  141. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  142. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  143. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  144. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  145. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  146. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  147. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  148. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  149. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
  150. package/.versions/2.2.1/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
  151. package/.versions/2.2.1/.pi/agent-fleet/scripts/package-lock.json +57 -0
  152. package/.versions/2.2.1/.pi/agent-fleet/scripts/package.json +10 -0
  153. package/.versions/2.2.1/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  154. package/.versions/2.2.1/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
  155. package/.versions/2.2.1/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  156. package/.versions/2.2.1/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
  157. package/.versions/2.2.1/.pi/agent-fleet/scripts/team-up.ts +378 -0
  158. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
  159. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  160. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  161. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
  162. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  163. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  164. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
  165. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
  166. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  167. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  168. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  169. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
  170. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  171. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  172. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
  173. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
  174. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
  175. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  176. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
  177. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  178. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
  179. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
  180. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  181. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  182. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  183. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  184. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  185. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  186. package/.versions/2.2.1/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  187. package/.versions/2.2.1/.pi/agents/dispatch-policy.yaml +32 -0
  188. package/.versions/2.2.1/.pi/agents/model-profiles.yaml +132 -0
  189. package/.versions/2.2.1/.pi/agents/peers.yaml +147 -0
  190. package/.versions/2.2.1/.pi/agents/teams.yaml +41 -0
  191. package/.versions/2.2.1/.pi/agents/voices.yaml +13 -0
  192. package/.versions/2.2.1/.pi/damage-control-rules.yaml +297 -0
  193. package/.versions/2.2.1/.pi/extensions/btw/README.md +120 -0
  194. package/.versions/2.2.1/.pi/extensions/btw/index.ts +916 -0
  195. package/.versions/2.2.1/.pi/extensions/btw/package.json +6 -0
  196. package/.versions/2.2.1/.pi/extensions/btw/state.js +179 -0
  197. package/.versions/2.2.1/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  198. package/.versions/2.2.1/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  199. package/.versions/2.2.1/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  200. package/.versions/2.2.1/.pi/extensions/compact-and-continue/README.md +42 -0
  201. package/.versions/2.2.1/.pi/extensions/compact-and-continue/index.ts +136 -0
  202. package/.versions/2.2.1/.pi/extensions/compact-and-continue/package.json +6 -0
  203. package/.versions/2.2.1/.pi/extensions/mcp-bridge/README.md +46 -0
  204. package/.versions/2.2.1/.pi/extensions/mcp-bridge/index.ts +206 -0
  205. package/.versions/2.2.1/.pi/extensions/mcp-bridge/package.json +6 -0
  206. package/.versions/2.2.1/.pi/extensions/package-lock.json +1175 -0
  207. package/.versions/2.2.1/.pi/extensions/package.json +9 -0
  208. package/.versions/2.2.1/.pi/extensions/pi-voice-stt/README.md +224 -0
  209. package/.versions/2.2.1/.pi/extensions/pi-voice-stt/config.ts +199 -0
  210. package/.versions/2.2.1/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  211. package/.versions/2.2.1/.pi/extensions/pi-voice-stt/index.ts +248 -0
  212. package/.versions/2.2.1/.pi/extensions/pi-voice-stt/package.json +6 -0
  213. package/.versions/2.2.1/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  214. package/.versions/2.2.1/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  215. package/.versions/2.2.1/.pi/harnesses/agent-hub/README.md +1641 -0
  216. package/.versions/2.2.1/.pi/harnesses/agent-hub/acceptance.ts +204 -0
  217. package/.versions/2.2.1/.pi/harnesses/agent-hub/access-approval.ts +266 -0
  218. package/.versions/2.2.1/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
  219. package/.versions/2.2.1/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
  220. package/.versions/2.2.1/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
  221. package/.versions/2.2.1/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
  222. package/.versions/2.2.1/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
  223. package/.versions/2.2.1/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
  224. package/.versions/2.2.1/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
  225. package/.versions/2.2.1/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
  226. package/.versions/2.2.1/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
  227. package/.versions/2.2.1/.pi/harnesses/agent-hub/artifacts.js +146 -0
  228. package/.versions/2.2.1/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
  229. package/.versions/2.2.1/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
  230. package/.versions/2.2.1/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  231. package/.versions/2.2.1/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  232. package/.versions/2.2.1/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
  233. package/.versions/2.2.1/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  234. package/.versions/2.2.1/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
  235. package/.versions/2.2.1/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
  236. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  237. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  238. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  239. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  240. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  241. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  242. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  243. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  244. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  245. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  246. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  247. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  248. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  249. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  250. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/config.ts +9 -0
  251. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  252. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/context.ts +43 -0
  253. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  254. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  255. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  256. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  257. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  258. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  259. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/recover.ts +62 -0
  260. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  261. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  262. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  263. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  264. package/.versions/2.2.1/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  265. package/.versions/2.2.1/.pi/harnesses/agent-hub/config/agents.ts +183 -0
  266. package/.versions/2.2.1/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
  267. package/.versions/2.2.1/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
  268. package/.versions/2.2.1/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  269. package/.versions/2.2.1/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
  270. package/.versions/2.2.1/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
  271. package/.versions/2.2.1/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  272. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  273. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
  274. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
  275. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
  276. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
  277. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
  278. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
  279. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
  280. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
  281. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
  282. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
  283. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
  284. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
  285. package/.versions/2.2.1/.pi/harnesses/agent-hub/context-window.js +108 -0
  286. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
  287. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
  288. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
  289. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
  290. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
  291. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
  292. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
  293. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
  294. package/.versions/2.2.1/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
  295. package/.versions/2.2.1/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  296. package/.versions/2.2.1/.pi/harnesses/agent-hub/delegate.ts +478 -0
  297. package/.versions/2.2.1/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
  298. package/.versions/2.2.1/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  299. package/.versions/2.2.1/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  300. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
  301. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  302. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
  303. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
  304. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
  305. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
  306. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
  307. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  308. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
  309. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
  310. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  311. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  312. package/.versions/2.2.1/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  313. package/.versions/2.2.1/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  314. package/.versions/2.2.1/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  315. package/.versions/2.2.1/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  316. package/.versions/2.2.1/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  317. package/.versions/2.2.1/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  318. package/.versions/2.2.1/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
  319. package/.versions/2.2.1/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  320. package/.versions/2.2.1/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  321. package/.versions/2.2.1/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
  322. package/.versions/2.2.1/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
  323. package/.versions/2.2.1/.pi/harnesses/agent-hub/external-blocker.js +92 -0
  324. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
  325. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
  326. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
  327. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
  328. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
  329. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
  330. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
  331. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
  332. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
  333. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
  334. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
  335. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
  336. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
  337. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
  338. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
  339. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
  340. package/.versions/2.2.1/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
  341. package/.versions/2.2.1/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
  342. package/.versions/2.2.1/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
  343. package/.versions/2.2.1/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  344. package/.versions/2.2.1/.pi/harnesses/agent-hub/footer.ts +29 -0
  345. package/.versions/2.2.1/.pi/harnesses/agent-hub/helpers.ts +269 -0
  346. package/.versions/2.2.1/.pi/harnesses/agent-hub/history-projection.ts +116 -0
  347. package/.versions/2.2.1/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
  348. package/.versions/2.2.1/.pi/harnesses/agent-hub/index.ts +2722 -0
  349. package/.versions/2.2.1/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  350. package/.versions/2.2.1/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
  351. package/.versions/2.2.1/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
  352. package/.versions/2.2.1/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  353. package/.versions/2.2.1/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  354. package/.versions/2.2.1/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
  355. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  356. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  357. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  358. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  359. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  360. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  361. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  362. package/.versions/2.2.1/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  363. package/.versions/2.2.1/.pi/harnesses/agent-hub/no-progress.ts +627 -0
  364. package/.versions/2.2.1/.pi/harnesses/agent-hub/operator-current-state.ts +57 -0
  365. package/.versions/2.2.1/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
  366. package/.versions/2.2.1/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
  367. package/.versions/2.2.1/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  368. package/.versions/2.2.1/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
  369. package/.versions/2.2.1/.pi/harnesses/agent-hub/package.json +7 -0
  370. package/.versions/2.2.1/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  371. package/.versions/2.2.1/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
  372. package/.versions/2.2.1/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
  373. package/.versions/2.2.1/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  374. package/.versions/2.2.1/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  375. package/.versions/2.2.1/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  376. package/.versions/2.2.1/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
  377. package/.versions/2.2.1/.pi/harnesses/agent-hub/policy/work-mode.ts +103 -0
  378. package/.versions/2.2.1/.pi/harnesses/agent-hub/poll-command.ts +184 -0
  379. package/.versions/2.2.1/.pi/harnesses/agent-hub/presentation.ts +54 -0
  380. package/.versions/2.2.1/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
  381. package/.versions/2.2.1/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
  382. package/.versions/2.2.1/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
  383. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
  384. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  385. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
  386. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
  387. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  388. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  389. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
  390. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
  391. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
  392. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
  393. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  394. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  395. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
  396. package/.versions/2.2.1/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
  397. package/.versions/2.2.1/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
  398. package/.versions/2.2.1/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
  399. package/.versions/2.2.1/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
  400. package/.versions/2.2.1/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
  401. package/.versions/2.2.1/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
  402. package/.versions/2.2.1/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
  403. package/.versions/2.2.1/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  404. package/.versions/2.2.1/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  405. package/.versions/2.2.1/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  406. package/.versions/2.2.1/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
  407. package/.versions/2.2.1/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  408. package/.versions/2.2.1/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  409. package/.versions/2.2.1/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
  410. package/.versions/2.2.1/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
  411. package/.versions/2.2.1/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  412. package/.versions/2.2.1/.pi/harnesses/agent-hub/return-contract.js +371 -0
  413. package/.versions/2.2.1/.pi/harnesses/agent-hub/return-extract.js +77 -0
  414. package/.versions/2.2.1/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  415. package/.versions/2.2.1/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
  416. package/.versions/2.2.1/.pi/harnesses/agent-hub/review-findings.js +96 -0
  417. package/.versions/2.2.1/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
  418. package/.versions/2.2.1/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
  419. package/.versions/2.2.1/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  420. package/.versions/2.2.1/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  421. package/.versions/2.2.1/.pi/harnesses/agent-hub/run-budget.js +362 -0
  422. package/.versions/2.2.1/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  423. package/.versions/2.2.1/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
  424. package/.versions/2.2.1/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
  425. package/.versions/2.2.1/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
  426. package/.versions/2.2.1/.pi/harnesses/agent-hub/scope-gate.js +271 -0
  427. package/.versions/2.2.1/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
  428. package/.versions/2.2.1/.pi/harnesses/agent-hub/session-audit.ts +331 -0
  429. package/.versions/2.2.1/.pi/harnesses/agent-hub/session-health.js +110 -0
  430. package/.versions/2.2.1/.pi/harnesses/agent-hub/session-start.ts +42 -0
  431. package/.versions/2.2.1/.pi/harnesses/agent-hub/spawn.ts +702 -0
  432. package/.versions/2.2.1/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
  433. package/.versions/2.2.1/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
  434. package/.versions/2.2.1/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  435. package/.versions/2.2.1/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
  436. package/.versions/2.2.1/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  437. package/.versions/2.2.1/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
  438. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-brief.ts +98 -0
  439. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
  440. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
  441. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
  442. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
  443. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
  444. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  445. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
  446. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  447. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  448. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  449. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  450. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-runtime.ts +132 -0
  451. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  452. package/.versions/2.2.1/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  453. package/.versions/2.2.1/.pi/harnesses/agent-hub/timeline.ts +72 -0
  454. package/.versions/2.2.1/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
  455. package/.versions/2.2.1/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
  456. package/.versions/2.2.1/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  457. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/action-executors.ts +216 -0
  458. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
  459. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
  460. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  461. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/context.ts +149 -0
  462. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
  463. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +928 -0
  464. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  465. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  466. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
  467. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
  468. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
  469. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
  470. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
  471. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  472. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
  473. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  474. package/.versions/2.2.1/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
  475. package/.versions/2.2.1/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  476. package/.versions/2.2.1/.pi/harnesses/agent-hub/types.ts +66 -0
  477. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  478. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
  479. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  480. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  481. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
  482. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  483. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  484. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  485. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  486. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  487. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  488. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  489. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  490. package/.versions/2.2.1/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  491. package/.versions/2.2.1/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  492. package/.versions/2.2.1/.pi/harnesses/agent-hub/version.ts +42 -0
  493. package/.versions/2.2.1/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  494. package/.versions/2.2.1/.pi/harnesses/agent-hub/work-mode.ts +183 -0
  495. package/.versions/2.2.1/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
  496. package/.versions/2.2.1/.pi/harnesses/ask-user-remote/README.md +59 -0
  497. package/.versions/2.2.1/.pi/harnesses/ask-user-remote/index.ts +571 -0
  498. package/.versions/2.2.1/.pi/harnesses/ask-user-remote/questions.ts +206 -0
  499. package/.versions/2.2.1/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  500. package/.versions/2.2.1/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
  501. package/.versions/2.2.1/.pi/harnesses/coms/README.md +105 -0
  502. package/.versions/2.2.1/.pi/harnesses/coms/index.ts +308 -0
  503. package/.versions/2.2.1/.pi/harnesses/coms/package.json +7 -0
  504. package/.versions/2.2.1/.pi/harnesses/coms/version.ts +42 -0
  505. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/README.md +161 -0
  506. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/index.ts +659 -0
  507. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/package.json +7 -0
  508. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
  509. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
  510. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
  511. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
  512. package/.versions/2.2.1/.pi/harnesses/damage-control-continue/version.ts +42 -0
  513. package/.versions/2.2.1/.pi/harnesses/lib/approval-wait.ts +17 -0
  514. package/.versions/2.2.1/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
  515. package/.versions/2.2.1/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  516. package/.versions/2.2.1/.pi/harnesses/lib/clarification-policy.ts +9 -0
  517. package/.versions/2.2.1/.pi/harnesses/lib/codex-compat.ts +97 -0
  518. package/.versions/2.2.1/.pi/harnesses/lib/codex-contract.ts +259 -0
  519. package/.versions/2.2.1/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
  520. package/.versions/2.2.1/.pi/harnesses/lib/coms-core-io.ts +422 -0
  521. package/.versions/2.2.1/.pi/harnesses/lib/coms-core.ts +738 -0
  522. package/.versions/2.2.1/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
  523. package/.versions/2.2.1/.pi/harnesses/lib/coms-observation.ts +74 -0
  524. package/.versions/2.2.1/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
  525. package/.versions/2.2.1/.pi/harnesses/lib/coms-response-read.ts +107 -0
  526. package/.versions/2.2.1/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
  527. package/.versions/2.2.1/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
  528. package/.versions/2.2.1/.pi/harnesses/lib/context-budget-view.ts +112 -0
  529. package/.versions/2.2.1/.pi/harnesses/lib/context-budget.ts +114 -0
  530. package/.versions/2.2.1/.pi/harnesses/lib/context-compaction-policy.js +35 -0
  531. package/.versions/2.2.1/.pi/harnesses/lib/damage-action-hash.ts +28 -0
  532. package/.versions/2.2.1/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
  533. package/.versions/2.2.1/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
  534. package/.versions/2.2.1/.pi/harnesses/lib/damage-control-shared.ts +276 -0
  535. package/.versions/2.2.1/.pi/harnesses/lib/damage-guard-port.ts +25 -0
  536. package/.versions/2.2.1/.pi/harnesses/lib/damage-policy.ts +35 -0
  537. package/.versions/2.2.1/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
  538. package/.versions/2.2.1/.pi/harnesses/lib/damage-result-view.ts +16 -0
  539. package/.versions/2.2.1/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
  540. package/.versions/2.2.1/.pi/harnesses/lib/exact-permission-port.ts +38 -0
  541. package/.versions/2.2.1/.pi/harnesses/lib/execution-trace.ts +45 -0
  542. package/.versions/2.2.1/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  543. package/.versions/2.2.1/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  544. package/.versions/2.2.1/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  545. package/.versions/2.2.1/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
  546. package/.versions/2.2.1/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
  547. package/.versions/2.2.1/.pi/harnesses/lib/fleet-codex-chat-view.ts +55 -0
  548. package/.versions/2.2.1/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
  549. package/.versions/2.2.1/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
  550. package/.versions/2.2.1/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
  551. package/.versions/2.2.1/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
  552. package/.versions/2.2.1/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
  553. package/.versions/2.2.1/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
  554. package/.versions/2.2.1/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
  555. package/.versions/2.2.1/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
  556. package/.versions/2.2.1/.pi/harnesses/lib/fleet-config/view.ts +338 -0
  557. package/.versions/2.2.1/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
  558. package/.versions/2.2.1/.pi/harnesses/lib/fleet-connection-diagnostics.ts +7 -0
  559. package/.versions/2.2.1/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  560. package/.versions/2.2.1/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
  561. package/.versions/2.2.1/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  562. package/.versions/2.2.1/.pi/harnesses/lib/fleet-event-source.ts +21 -0
  563. package/.versions/2.2.1/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
  564. package/.versions/2.2.1/.pi/harnesses/lib/fleet-notification-bootstrap.ts +172 -0
  565. package/.versions/2.2.1/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
  566. package/.versions/2.2.1/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  567. package/.versions/2.2.1/.pi/harnesses/lib/fleet-panel.ts +34 -0
  568. package/.versions/2.2.1/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
  569. package/.versions/2.2.1/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  570. package/.versions/2.2.1/.pi/harnesses/lib/fleet-selection.ts +24 -0
  571. package/.versions/2.2.1/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  572. package/.versions/2.2.1/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  573. package/.versions/2.2.1/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
  574. package/.versions/2.2.1/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  575. package/.versions/2.2.1/.pi/harnesses/lib/herdr-client.ts +472 -0
  576. package/.versions/2.2.1/.pi/harnesses/lib/herdr-presence.ts +399 -0
  577. package/.versions/2.2.1/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  578. package/.versions/2.2.1/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  579. package/.versions/2.2.1/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  580. package/.versions/2.2.1/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  581. package/.versions/2.2.1/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  582. package/.versions/2.2.1/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  583. package/.versions/2.2.1/.pi/harnesses/lib/identical-dialog.ts +27 -0
  584. package/.versions/2.2.1/.pi/harnesses/lib/installation-state.js +62 -0
  585. package/.versions/2.2.1/.pi/harnesses/lib/peer-target.ts +24 -0
  586. package/.versions/2.2.1/.pi/harnesses/lib/policy-roots.js +117 -0
  587. package/.versions/2.2.1/.pi/harnesses/lib/policy-roots.ts +32 -0
  588. package/.versions/2.2.1/.pi/harnesses/lib/process-shared.ts +9 -0
  589. package/.versions/2.2.1/.pi/harnesses/lib/resource-closure.js +26 -0
  590. package/.versions/2.2.1/.pi/harnesses/lib/safe-source-read.js +29 -0
  591. package/.versions/2.2.1/.pi/harnesses/lib/semantic-approval.ts +80 -0
  592. package/.versions/2.2.1/.pi/harnesses/lib/session-target.ts +62 -0
  593. package/.versions/2.2.1/.pi/harnesses/lib/spawned-peers.js +191 -0
  594. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-agentic.js +15 -0
  595. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
  596. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
  597. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
  598. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-json.js +37 -0
  599. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-loader.js +53 -0
  600. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-proactive.js +68 -0
  601. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-triage.js +42 -0
  602. package/.versions/2.2.1/.pi/harnesses/lib/system1/config-v2.js +112 -0
  603. package/.versions/2.2.1/.pi/harnesses/lib/system1/config.js +50 -0
  604. package/.versions/2.2.1/.pi/harnesses/lib/system1/contracts.ts +154 -0
  605. package/.versions/2.2.1/.pi/harnesses/lib/system1/demo.ts +95 -0
  606. package/.versions/2.2.1/.pi/harnesses/lib/system1/jev.ts +503 -0
  607. package/.versions/2.2.1/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
  608. package/.versions/2.2.1/.pi/harnesses/lib/system1/selection.js +11 -0
  609. package/.versions/2.2.1/.pi/harnesses/lib/system1/service.ts +245 -0
  610. package/.versions/2.2.1/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  611. package/.versions/2.2.1/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  612. package/.versions/2.2.1/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  613. package/.versions/2.2.1/.pi/harnesses/lib/target-capabilities.js +7 -0
  614. package/.versions/2.2.1/.pi/harnesses/lib/update-check.ts +227 -0
  615. package/.versions/2.2.1/.pi/harnesses/lib/workspace-context.js +115 -0
  616. package/.versions/2.2.1/.pi/harnesses/lib/workspace-context.ts +22 -0
  617. package/.versions/2.2.1/.pi/harnesses/package-lock.json +2121 -0
  618. package/.versions/2.2.1/.pi/harnesses/package.json +13 -0
  619. package/.versions/2.2.1/.pi/prompts/af-build.md +27 -0
  620. package/.versions/2.2.1/.pi/prompts/af-code-simplify.md +22 -0
  621. package/.versions/2.2.1/.pi/prompts/af-constraints.md +31 -0
  622. package/.versions/2.2.1/.pi/prompts/af-plan.md +17 -0
  623. package/.versions/2.2.1/.pi/prompts/af-review.md +16 -0
  624. package/.versions/2.2.1/.pi/prompts/af-set-hermes-telegram.md +15 -0
  625. package/.versions/2.2.1/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  626. package/.versions/2.2.1/.pi/prompts/af-setup-rules.md +20 -0
  627. package/.versions/2.2.1/.pi/prompts/af-ship.md +17 -0
  628. package/.versions/2.2.1/.pi/prompts/af-spec.md +15 -0
  629. package/.versions/2.2.1/.pi/prompts/af-test.md +19 -0
  630. package/.versions/2.2.1/.pi/skills/bowser/SKILL.md +145 -0
  631. package/.versions/2.2.1/.version +1 -0
  632. package/.versions/2.2.1/agents/architect.md +24 -0
  633. package/.versions/2.2.1/agents/bowser.md +28 -0
  634. package/.versions/2.2.1/agents/builder.md +55 -0
  635. package/.versions/2.2.1/agents/code-reviewer.md +209 -0
  636. package/.versions/2.2.1/agents/deep-researcher.md +32 -0
  637. package/.versions/2.2.1/agents/documenter.md +22 -0
  638. package/.versions/2.2.1/agents/plan-reviewer.md +83 -0
  639. package/.versions/2.2.1/agents/planner.md +107 -0
  640. package/.versions/2.2.1/agents/releaser.md +24 -0
  641. package/.versions/2.2.1/agents/researcher.md +30 -0
  642. package/.versions/2.2.1/agents/security-auditor.md +167 -0
  643. package/.versions/2.2.1/agents/test-engineer.md +153 -0
  644. package/.versions/2.2.1/agents/web-debugger.md +44 -0
  645. package/.versions/2.2.1/agents/web-performance-auditor.md +194 -0
  646. package/.versions/2.2.1/bin/catalog/harness-runtime-closure.json +85 -0
  647. package/.versions/2.2.1/docs/ARCHITECTURE.md +1291 -0
  648. package/.versions/2.2.1/docs/agent-fleet-setup.md +1161 -0
  649. package/.versions/2.2.1/docs/claude-code-coms-bridge.md +147 -0
  650. package/.versions/2.2.1/docs/codex-local-mcp.md +520 -0
  651. package/.versions/2.2.1/docs/codex-session-bridge.md +44 -0
  652. package/.versions/2.2.1/docs/codex-setup.md +183 -0
  653. package/.versions/2.2.1/docs/coms-hermes-bridge.md +188 -0
  654. package/.versions/2.2.1/docs/fleet-native-voice.md +151 -0
  655. package/.versions/2.2.1/docs/getting-started.md +126 -0
  656. package/.versions/2.2.1/docs/npm-install.md +535 -0
  657. package/.versions/2.2.1/docs/pi-extensions.md +450 -0
  658. package/.versions/2.2.1/docs/pi-setup.md +92 -0
  659. package/.versions/2.2.1/docs/skill-anatomy.md +150 -0
  660. package/.versions/2.2.1/install-manifest.json +3227 -0
  661. package/.versions/2.2.1/justfile +246 -0
  662. package/.versions/2.2.1/manifest-meta.json +1099 -0
  663. package/.versions/2.2.1/references/accessibility-checklist.md +160 -0
  664. package/.versions/2.2.1/references/communication-contract.md +26 -0
  665. package/.versions/2.2.1/references/definition-of-done.md +67 -0
  666. package/.versions/2.2.1/references/fleet-coordination-patterns.md +171 -0
  667. package/.versions/2.2.1/references/observability-checklist.md +92 -0
  668. package/.versions/2.2.1/references/orchestration-patterns.md +370 -0
  669. package/.versions/2.2.1/references/performance-checklist.md +236 -0
  670. package/.versions/2.2.1/references/prompting-patterns.md +380 -0
  671. package/.versions/2.2.1/references/security-checklist.md +245 -0
  672. package/.versions/2.2.1/references/testing-patterns.md +235 -0
  673. package/.versions/2.2.1/references/workflow-authoring.md +304 -0
  674. package/.versions/2.2.1/skills/_internal/grilling.md +59 -0
  675. package/.versions/2.2.1/skills/browser-testing-with-devtools/SKILL.md +351 -0
  676. package/.versions/2.2.1/skills/code-review-and-quality/SKILL.md +396 -0
  677. package/.versions/2.2.1/skills/compound-learning/SKILL.md +137 -0
  678. package/.versions/2.2.1/skills/constraint-driven-development/SKILL.md +338 -0
  679. package/.versions/2.2.1/skills/constraint-driven-development/references/floor-guard.md +99 -0
  680. package/.versions/2.2.1/skills/context-engineering/SKILL.md +341 -0
  681. package/.versions/2.2.1/skills/deprecation-and-migration/SKILL.md +247 -0
  682. package/.versions/2.2.1/skills/designing-agents/SKILL.md +394 -0
  683. package/.versions/2.2.1/skills/designing-agents/pi-harness-authoring.md +222 -0
  684. package/.versions/2.2.1/skills/drafting-workflows/SKILL.md +143 -0
  685. package/.versions/2.2.1/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  686. package/.versions/2.2.1/skills/fleet-connect/SKILL.md +29 -0
  687. package/.versions/2.2.1/skills/fleet-connect.zip +0 -0
  688. package/.versions/2.2.1/skills/fleet-native-voice/SKILL.md +103 -0
  689. package/.versions/2.2.1/skills/fleet-native-voice/agents/openai.yaml +4 -0
  690. package/.versions/2.2.1/skills/fleet-native-voice.zip +0 -0
  691. package/.versions/2.2.1/skills/frontend-ui-engineering/SKILL.md +328 -0
  692. package/.versions/2.2.1/skills/git-workflow-and-versioning/SKILL.md +316 -0
  693. package/.versions/2.2.1/skills/idea-refine/SKILL.md +182 -0
  694. package/.versions/2.2.1/skills/idea-refine/examples.md +238 -0
  695. package/.versions/2.2.1/skills/idea-refine/frameworks.md +99 -0
  696. package/.versions/2.2.1/skills/idea-refine/refinement-criteria.md +113 -0
  697. package/.versions/2.2.1/skills/idea-refine/scripts/idea-refine.sh +15 -0
  698. package/.versions/2.2.1/skills/incremental-implementation/SKILL.md +353 -0
  699. package/.versions/2.2.1/skills/incremental-implementation.zip +0 -0
  700. package/.versions/2.2.1/skills/interview-me/SKILL.md +226 -0
  701. package/.versions/2.2.1/skills/orchestration-verification/SKILL.md +182 -0
  702. package/.versions/2.2.1/skills/peer-coms/SKILL.md +90 -0
  703. package/.versions/2.2.1/skills/performance-optimization/SKILL.md +496 -0
  704. package/.versions/2.2.1/skills/planning-and-task-breakdown/SKILL.md +318 -0
  705. package/.versions/2.2.1/skills/planning-and-task-breakdown.zip +0 -0
  706. package/.versions/2.2.1/skills/repository-ai-setup/SKILL.md +135 -0
  707. package/.versions/2.2.1/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  708. package/.versions/2.2.1/skills/repository-ai-setup/references/apply-contract.md +74 -0
  709. package/.versions/2.2.1/skills/repository-ai-setup/references/provenance-template.md +16 -0
  710. package/.versions/2.2.1/skills/repository-ai-setup/references/setup-flow.md +108 -0
  711. package/.versions/2.2.1/skills/repository-ai-setup/references/verify-setup.md +20 -0
  712. package/.versions/2.2.1/skills/repository-ai-setup.zip +0 -0
  713. package/.versions/2.2.1/skills/security-and-hardening/SKILL.md +524 -0
  714. package/.versions/2.2.1/skills/spec-driven-development/SKILL.md +295 -0
  715. package/.versions/2.2.1/skills/spec-driven-development.zip +0 -0
  716. package/.versions/2.2.1/skills/using-agent-skills/SKILL.md +198 -0
  717. package/.versions/2.2.1/vendor/agent-skills-upstream/LICENSE +21 -0
  718. package/.versions/2.2.1/vendor/agent-skills-upstream/README.md +430 -0
  719. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  720. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  721. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  722. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  723. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  724. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  725. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  726. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  727. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  728. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  729. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  730. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  731. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  732. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  733. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  734. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  735. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  736. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  737. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  738. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  739. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  740. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  741. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  742. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  743. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  744. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  745. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  746. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  747. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  748. package/.versions/2.2.1/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  749. package/.versions/2.2.2/.pi/agent-fleet/hermes/README.md +347 -0
  750. package/.versions/2.2.2/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  751. package/.versions/2.2.2/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  752. package/.versions/2.2.2/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  753. package/.versions/2.2.2/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  754. package/.versions/2.2.2/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  755. package/.versions/2.2.2/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  756. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  757. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  758. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  759. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  760. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  761. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  762. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  763. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  764. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  765. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  766. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  767. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  768. package/.versions/2.2.2/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  769. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  770. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  771. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  772. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  773. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  774. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  775. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  776. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  777. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  778. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  779. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  780. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  781. package/.versions/2.2.2/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  782. package/.versions/2.2.2/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  783. package/.versions/2.2.2/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
  784. package/.versions/2.2.2/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  785. package/.versions/2.2.2/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
  786. package/.versions/2.2.2/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
  787. package/.versions/2.2.2/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
  788. package/.versions/2.2.2/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  789. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
  790. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
  791. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
  792. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
  793. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
  794. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
  795. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
  796. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
  797. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
  798. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
  799. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
  800. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
  801. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
  802. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
  803. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
  804. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
  805. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
  806. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
  807. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
  808. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
  809. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
  810. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
  811. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
  812. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
  813. package/.versions/2.2.2/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
  814. package/.versions/2.2.2/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
  815. package/.versions/2.2.2/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
  816. package/.versions/2.2.2/.pi/agent-fleet/scripts/fleet.ts +244 -0
  817. package/.versions/2.2.2/.pi/agent-fleet/scripts/flow.ts +166 -0
  818. package/.versions/2.2.2/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  819. package/.versions/2.2.2/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  820. package/.versions/2.2.2/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  821. package/.versions/2.2.2/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  822. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
  823. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
  824. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +52 -0
  825. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
  826. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-connection-history.ts +51 -0
  827. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
  828. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
  829. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
  830. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
  831. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
  832. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
  833. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
  834. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
  835. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
  836. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  837. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  838. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
  839. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
  840. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
  841. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
  842. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +207 -0
  843. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
  844. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
  845. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
  846. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
  847. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
  848. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
  849. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
  850. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
  851. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
  852. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
  853. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
  854. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
  855. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
  856. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
  857. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
  858. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
  859. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
  860. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
  861. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
  862. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
  863. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
  864. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
  865. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  866. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  867. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  868. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  869. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  870. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  871. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  872. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  873. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  874. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  875. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  876. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  877. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  878. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  879. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  880. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  881. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  882. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
  883. package/.versions/2.2.2/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
  884. package/.versions/2.2.2/.pi/agent-fleet/scripts/package-lock.json +57 -0
  885. package/.versions/2.2.2/.pi/agent-fleet/scripts/package.json +10 -0
  886. package/.versions/2.2.2/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  887. package/.versions/2.2.2/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
  888. package/.versions/2.2.2/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  889. package/.versions/2.2.2/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
  890. package/.versions/2.2.2/.pi/agent-fleet/scripts/team-up.ts +378 -0
  891. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
  892. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  893. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  894. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
  895. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  896. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  897. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
  898. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
  899. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  900. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  901. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  902. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
  903. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  904. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  905. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
  906. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
  907. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
  908. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  909. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
  910. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  911. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
  912. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
  913. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  914. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  915. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  916. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  917. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  918. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  919. package/.versions/2.2.2/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  920. package/.versions/2.2.2/.pi/agents/dispatch-policy.yaml +32 -0
  921. package/.versions/2.2.2/.pi/agents/model-profiles.yaml +132 -0
  922. package/.versions/2.2.2/.pi/agents/peers.yaml +147 -0
  923. package/.versions/2.2.2/.pi/agents/teams.yaml +41 -0
  924. package/.versions/2.2.2/.pi/agents/voices.yaml +13 -0
  925. package/.versions/2.2.2/.pi/damage-control-rules.yaml +297 -0
  926. package/.versions/2.2.2/.pi/extensions/btw/README.md +120 -0
  927. package/.versions/2.2.2/.pi/extensions/btw/index.ts +916 -0
  928. package/.versions/2.2.2/.pi/extensions/btw/package.json +6 -0
  929. package/.versions/2.2.2/.pi/extensions/btw/state.js +179 -0
  930. package/.versions/2.2.2/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  931. package/.versions/2.2.2/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  932. package/.versions/2.2.2/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  933. package/.versions/2.2.2/.pi/extensions/compact-and-continue/README.md +42 -0
  934. package/.versions/2.2.2/.pi/extensions/compact-and-continue/index.ts +136 -0
  935. package/.versions/2.2.2/.pi/extensions/compact-and-continue/package.json +6 -0
  936. package/.versions/2.2.2/.pi/extensions/mcp-bridge/README.md +46 -0
  937. package/.versions/2.2.2/.pi/extensions/mcp-bridge/index.ts +206 -0
  938. package/.versions/2.2.2/.pi/extensions/mcp-bridge/package.json +6 -0
  939. package/.versions/2.2.2/.pi/extensions/package-lock.json +1175 -0
  940. package/.versions/2.2.2/.pi/extensions/package.json +9 -0
  941. package/.versions/2.2.2/.pi/extensions/pi-voice-stt/README.md +224 -0
  942. package/.versions/2.2.2/.pi/extensions/pi-voice-stt/config.ts +199 -0
  943. package/.versions/2.2.2/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  944. package/.versions/2.2.2/.pi/extensions/pi-voice-stt/index.ts +248 -0
  945. package/.versions/2.2.2/.pi/extensions/pi-voice-stt/package.json +6 -0
  946. package/.versions/2.2.2/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  947. package/.versions/2.2.2/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  948. package/.versions/2.2.2/.pi/harnesses/agent-hub/README.md +1641 -0
  949. package/.versions/2.2.2/.pi/harnesses/agent-hub/acceptance.ts +204 -0
  950. package/.versions/2.2.2/.pi/harnesses/agent-hub/access-approval.ts +266 -0
  951. package/.versions/2.2.2/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
  952. package/.versions/2.2.2/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
  953. package/.versions/2.2.2/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
  954. package/.versions/2.2.2/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
  955. package/.versions/2.2.2/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
  956. package/.versions/2.2.2/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
  957. package/.versions/2.2.2/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
  958. package/.versions/2.2.2/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
  959. package/.versions/2.2.2/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
  960. package/.versions/2.2.2/.pi/harnesses/agent-hub/artifacts.js +146 -0
  961. package/.versions/2.2.2/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
  962. package/.versions/2.2.2/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
  963. package/.versions/2.2.2/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  964. package/.versions/2.2.2/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  965. package/.versions/2.2.2/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
  966. package/.versions/2.2.2/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  967. package/.versions/2.2.2/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
  968. package/.versions/2.2.2/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
  969. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  970. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  971. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  972. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  973. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  974. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  975. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  976. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  977. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  978. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  979. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  980. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  981. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  982. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  983. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/config.ts +9 -0
  984. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  985. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/context.ts +43 -0
  986. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  987. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  988. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  989. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  990. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  991. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  992. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/recover.ts +62 -0
  993. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  994. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  995. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  996. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  997. package/.versions/2.2.2/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  998. package/.versions/2.2.2/.pi/harnesses/agent-hub/config/agents.ts +183 -0
  999. package/.versions/2.2.2/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
  1000. package/.versions/2.2.2/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
  1001. package/.versions/2.2.2/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  1002. package/.versions/2.2.2/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
  1003. package/.versions/2.2.2/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
  1004. package/.versions/2.2.2/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  1005. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  1006. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
  1007. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
  1008. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
  1009. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
  1010. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
  1011. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
  1012. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
  1013. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
  1014. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
  1015. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
  1016. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
  1017. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
  1018. package/.versions/2.2.2/.pi/harnesses/agent-hub/context-window.js +108 -0
  1019. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
  1020. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
  1021. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
  1022. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
  1023. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
  1024. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
  1025. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
  1026. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
  1027. package/.versions/2.2.2/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
  1028. package/.versions/2.2.2/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  1029. package/.versions/2.2.2/.pi/harnesses/agent-hub/delegate.ts +478 -0
  1030. package/.versions/2.2.2/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
  1031. package/.versions/2.2.2/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  1032. package/.versions/2.2.2/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  1033. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
  1034. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  1035. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
  1036. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
  1037. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
  1038. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
  1039. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
  1040. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  1041. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
  1042. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
  1043. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  1044. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  1045. package/.versions/2.2.2/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  1046. package/.versions/2.2.2/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  1047. package/.versions/2.2.2/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  1048. package/.versions/2.2.2/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  1049. package/.versions/2.2.2/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  1050. package/.versions/2.2.2/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  1051. package/.versions/2.2.2/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
  1052. package/.versions/2.2.2/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  1053. package/.versions/2.2.2/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  1054. package/.versions/2.2.2/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
  1055. package/.versions/2.2.2/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
  1056. package/.versions/2.2.2/.pi/harnesses/agent-hub/external-blocker.js +92 -0
  1057. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
  1058. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
  1059. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
  1060. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
  1061. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
  1062. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
  1063. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
  1064. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
  1065. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
  1066. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
  1067. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
  1068. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
  1069. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
  1070. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
  1071. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
  1072. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
  1073. package/.versions/2.2.2/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
  1074. package/.versions/2.2.2/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
  1075. package/.versions/2.2.2/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
  1076. package/.versions/2.2.2/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  1077. package/.versions/2.2.2/.pi/harnesses/agent-hub/footer.ts +29 -0
  1078. package/.versions/2.2.2/.pi/harnesses/agent-hub/helpers.ts +269 -0
  1079. package/.versions/2.2.2/.pi/harnesses/agent-hub/history-projection.ts +116 -0
  1080. package/.versions/2.2.2/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
  1081. package/.versions/2.2.2/.pi/harnesses/agent-hub/index.ts +2722 -0
  1082. package/.versions/2.2.2/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  1083. package/.versions/2.2.2/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
  1084. package/.versions/2.2.2/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
  1085. package/.versions/2.2.2/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  1086. package/.versions/2.2.2/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  1087. package/.versions/2.2.2/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
  1088. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  1089. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  1090. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  1091. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  1092. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  1093. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  1094. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  1095. package/.versions/2.2.2/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  1096. package/.versions/2.2.2/.pi/harnesses/agent-hub/no-progress.ts +627 -0
  1097. package/.versions/2.2.2/.pi/harnesses/agent-hub/operator-current-state.ts +57 -0
  1098. package/.versions/2.2.2/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
  1099. package/.versions/2.2.2/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
  1100. package/.versions/2.2.2/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  1101. package/.versions/2.2.2/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
  1102. package/.versions/2.2.2/.pi/harnesses/agent-hub/package.json +7 -0
  1103. package/.versions/2.2.2/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  1104. package/.versions/2.2.2/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
  1105. package/.versions/2.2.2/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
  1106. package/.versions/2.2.2/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  1107. package/.versions/2.2.2/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  1108. package/.versions/2.2.2/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  1109. package/.versions/2.2.2/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
  1110. package/.versions/2.2.2/.pi/harnesses/agent-hub/policy/work-mode.ts +103 -0
  1111. package/.versions/2.2.2/.pi/harnesses/agent-hub/poll-command.ts +184 -0
  1112. package/.versions/2.2.2/.pi/harnesses/agent-hub/presentation.ts +54 -0
  1113. package/.versions/2.2.2/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
  1114. package/.versions/2.2.2/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
  1115. package/.versions/2.2.2/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
  1116. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
  1117. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  1118. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
  1119. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
  1120. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  1121. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  1122. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
  1123. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
  1124. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
  1125. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
  1126. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  1127. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  1128. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
  1129. package/.versions/2.2.2/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
  1130. package/.versions/2.2.2/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
  1131. package/.versions/2.2.2/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
  1132. package/.versions/2.2.2/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
  1133. package/.versions/2.2.2/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
  1134. package/.versions/2.2.2/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
  1135. package/.versions/2.2.2/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
  1136. package/.versions/2.2.2/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  1137. package/.versions/2.2.2/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  1138. package/.versions/2.2.2/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  1139. package/.versions/2.2.2/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
  1140. package/.versions/2.2.2/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  1141. package/.versions/2.2.2/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  1142. package/.versions/2.2.2/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
  1143. package/.versions/2.2.2/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
  1144. package/.versions/2.2.2/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  1145. package/.versions/2.2.2/.pi/harnesses/agent-hub/return-contract.js +371 -0
  1146. package/.versions/2.2.2/.pi/harnesses/agent-hub/return-extract.js +77 -0
  1147. package/.versions/2.2.2/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  1148. package/.versions/2.2.2/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
  1149. package/.versions/2.2.2/.pi/harnesses/agent-hub/review-findings.js +96 -0
  1150. package/.versions/2.2.2/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
  1151. package/.versions/2.2.2/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
  1152. package/.versions/2.2.2/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  1153. package/.versions/2.2.2/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  1154. package/.versions/2.2.2/.pi/harnesses/agent-hub/run-budget.js +362 -0
  1155. package/.versions/2.2.2/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  1156. package/.versions/2.2.2/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
  1157. package/.versions/2.2.2/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
  1158. package/.versions/2.2.2/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
  1159. package/.versions/2.2.2/.pi/harnesses/agent-hub/scope-gate.js +271 -0
  1160. package/.versions/2.2.2/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
  1161. package/.versions/2.2.2/.pi/harnesses/agent-hub/session-audit.ts +331 -0
  1162. package/.versions/2.2.2/.pi/harnesses/agent-hub/session-health.js +110 -0
  1163. package/.versions/2.2.2/.pi/harnesses/agent-hub/session-start.ts +42 -0
  1164. package/.versions/2.2.2/.pi/harnesses/agent-hub/spawn.ts +702 -0
  1165. package/.versions/2.2.2/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
  1166. package/.versions/2.2.2/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
  1167. package/.versions/2.2.2/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  1168. package/.versions/2.2.2/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
  1169. package/.versions/2.2.2/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  1170. package/.versions/2.2.2/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
  1171. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-brief.ts +98 -0
  1172. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
  1173. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
  1174. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
  1175. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
  1176. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
  1177. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  1178. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
  1179. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  1180. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  1181. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  1182. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  1183. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-runtime.ts +132 -0
  1184. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  1185. package/.versions/2.2.2/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  1186. package/.versions/2.2.2/.pi/harnesses/agent-hub/timeline.ts +72 -0
  1187. package/.versions/2.2.2/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
  1188. package/.versions/2.2.2/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
  1189. package/.versions/2.2.2/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  1190. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/action-executors.ts +216 -0
  1191. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
  1192. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
  1193. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  1194. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/context.ts +149 -0
  1195. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
  1196. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +928 -0
  1197. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  1198. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  1199. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
  1200. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
  1201. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
  1202. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
  1203. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
  1204. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  1205. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
  1206. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  1207. package/.versions/2.2.2/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
  1208. package/.versions/2.2.2/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  1209. package/.versions/2.2.2/.pi/harnesses/agent-hub/types.ts +66 -0
  1210. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  1211. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
  1212. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  1213. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  1214. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
  1215. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  1216. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  1217. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  1218. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  1219. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  1220. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  1221. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  1222. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  1223. package/.versions/2.2.2/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  1224. package/.versions/2.2.2/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  1225. package/.versions/2.2.2/.pi/harnesses/agent-hub/version.ts +42 -0
  1226. package/.versions/2.2.2/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  1227. package/.versions/2.2.2/.pi/harnesses/agent-hub/work-mode.ts +183 -0
  1228. package/.versions/2.2.2/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
  1229. package/.versions/2.2.2/.pi/harnesses/ask-user-remote/README.md +59 -0
  1230. package/.versions/2.2.2/.pi/harnesses/ask-user-remote/index.ts +571 -0
  1231. package/.versions/2.2.2/.pi/harnesses/ask-user-remote/questions.ts +206 -0
  1232. package/.versions/2.2.2/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  1233. package/.versions/2.2.2/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
  1234. package/.versions/2.2.2/.pi/harnesses/coms/README.md +105 -0
  1235. package/.versions/2.2.2/.pi/harnesses/coms/index.ts +308 -0
  1236. package/.versions/2.2.2/.pi/harnesses/coms/package.json +7 -0
  1237. package/.versions/2.2.2/.pi/harnesses/coms/version.ts +42 -0
  1238. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/README.md +161 -0
  1239. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/index.ts +659 -0
  1240. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/package.json +7 -0
  1241. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
  1242. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
  1243. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
  1244. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
  1245. package/.versions/2.2.2/.pi/harnesses/damage-control-continue/version.ts +42 -0
  1246. package/.versions/2.2.2/.pi/harnesses/lib/approval-wait.ts +17 -0
  1247. package/.versions/2.2.2/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
  1248. package/.versions/2.2.2/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  1249. package/.versions/2.2.2/.pi/harnesses/lib/clarification-policy.ts +9 -0
  1250. package/.versions/2.2.2/.pi/harnesses/lib/codex-compat.ts +97 -0
  1251. package/.versions/2.2.2/.pi/harnesses/lib/codex-contract.ts +259 -0
  1252. package/.versions/2.2.2/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
  1253. package/.versions/2.2.2/.pi/harnesses/lib/coms-core-io.ts +422 -0
  1254. package/.versions/2.2.2/.pi/harnesses/lib/coms-core.ts +738 -0
  1255. package/.versions/2.2.2/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
  1256. package/.versions/2.2.2/.pi/harnesses/lib/coms-observation.ts +74 -0
  1257. package/.versions/2.2.2/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
  1258. package/.versions/2.2.2/.pi/harnesses/lib/coms-response-read.ts +107 -0
  1259. package/.versions/2.2.2/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
  1260. package/.versions/2.2.2/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
  1261. package/.versions/2.2.2/.pi/harnesses/lib/context-budget-view.ts +112 -0
  1262. package/.versions/2.2.2/.pi/harnesses/lib/context-budget.ts +114 -0
  1263. package/.versions/2.2.2/.pi/harnesses/lib/context-compaction-policy.js +35 -0
  1264. package/.versions/2.2.2/.pi/harnesses/lib/damage-action-hash.ts +28 -0
  1265. package/.versions/2.2.2/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
  1266. package/.versions/2.2.2/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
  1267. package/.versions/2.2.2/.pi/harnesses/lib/damage-control-shared.ts +276 -0
  1268. package/.versions/2.2.2/.pi/harnesses/lib/damage-guard-port.ts +25 -0
  1269. package/.versions/2.2.2/.pi/harnesses/lib/damage-policy.ts +35 -0
  1270. package/.versions/2.2.2/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
  1271. package/.versions/2.2.2/.pi/harnesses/lib/damage-result-view.ts +16 -0
  1272. package/.versions/2.2.2/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
  1273. package/.versions/2.2.2/.pi/harnesses/lib/exact-permission-port.ts +38 -0
  1274. package/.versions/2.2.2/.pi/harnesses/lib/execution-trace.ts +45 -0
  1275. package/.versions/2.2.2/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  1276. package/.versions/2.2.2/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  1277. package/.versions/2.2.2/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  1278. package/.versions/2.2.2/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
  1279. package/.versions/2.2.2/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
  1280. package/.versions/2.2.2/.pi/harnesses/lib/fleet-codex-chat-view.ts +55 -0
  1281. package/.versions/2.2.2/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
  1282. package/.versions/2.2.2/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
  1283. package/.versions/2.2.2/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
  1284. package/.versions/2.2.2/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
  1285. package/.versions/2.2.2/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
  1286. package/.versions/2.2.2/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
  1287. package/.versions/2.2.2/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
  1288. package/.versions/2.2.2/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
  1289. package/.versions/2.2.2/.pi/harnesses/lib/fleet-config/view.ts +338 -0
  1290. package/.versions/2.2.2/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
  1291. package/.versions/2.2.2/.pi/harnesses/lib/fleet-connection-diagnostics.ts +7 -0
  1292. package/.versions/2.2.2/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  1293. package/.versions/2.2.2/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
  1294. package/.versions/2.2.2/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  1295. package/.versions/2.2.2/.pi/harnesses/lib/fleet-event-source.ts +21 -0
  1296. package/.versions/2.2.2/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
  1297. package/.versions/2.2.2/.pi/harnesses/lib/fleet-notification-bootstrap.ts +172 -0
  1298. package/.versions/2.2.2/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
  1299. package/.versions/2.2.2/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  1300. package/.versions/2.2.2/.pi/harnesses/lib/fleet-panel.ts +34 -0
  1301. package/.versions/2.2.2/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
  1302. package/.versions/2.2.2/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  1303. package/.versions/2.2.2/.pi/harnesses/lib/fleet-selection.ts +24 -0
  1304. package/.versions/2.2.2/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  1305. package/.versions/2.2.2/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  1306. package/.versions/2.2.2/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
  1307. package/.versions/2.2.2/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  1308. package/.versions/2.2.2/.pi/harnesses/lib/herdr-client.ts +472 -0
  1309. package/.versions/2.2.2/.pi/harnesses/lib/herdr-presence.ts +399 -0
  1310. package/.versions/2.2.2/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  1311. package/.versions/2.2.2/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  1312. package/.versions/2.2.2/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  1313. package/.versions/2.2.2/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  1314. package/.versions/2.2.2/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  1315. package/.versions/2.2.2/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  1316. package/.versions/2.2.2/.pi/harnesses/lib/identical-dialog.ts +27 -0
  1317. package/.versions/2.2.2/.pi/harnesses/lib/installation-state.js +62 -0
  1318. package/.versions/2.2.2/.pi/harnesses/lib/peer-target.ts +24 -0
  1319. package/.versions/2.2.2/.pi/harnesses/lib/policy-roots.js +117 -0
  1320. package/.versions/2.2.2/.pi/harnesses/lib/policy-roots.ts +32 -0
  1321. package/.versions/2.2.2/.pi/harnesses/lib/process-shared.ts +9 -0
  1322. package/.versions/2.2.2/.pi/harnesses/lib/resource-closure.js +26 -0
  1323. package/.versions/2.2.2/.pi/harnesses/lib/safe-source-read.js +29 -0
  1324. package/.versions/2.2.2/.pi/harnesses/lib/semantic-approval.ts +80 -0
  1325. package/.versions/2.2.2/.pi/harnesses/lib/session-target.ts +62 -0
  1326. package/.versions/2.2.2/.pi/harnesses/lib/spawned-peers.js +191 -0
  1327. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-agentic.js +15 -0
  1328. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
  1329. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
  1330. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
  1331. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-json.js +37 -0
  1332. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-loader.js +53 -0
  1333. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-proactive.js +68 -0
  1334. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-triage.js +42 -0
  1335. package/.versions/2.2.2/.pi/harnesses/lib/system1/config-v2.js +112 -0
  1336. package/.versions/2.2.2/.pi/harnesses/lib/system1/config.js +50 -0
  1337. package/.versions/2.2.2/.pi/harnesses/lib/system1/contracts.ts +154 -0
  1338. package/.versions/2.2.2/.pi/harnesses/lib/system1/demo.ts +95 -0
  1339. package/.versions/2.2.2/.pi/harnesses/lib/system1/jev.ts +503 -0
  1340. package/.versions/2.2.2/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
  1341. package/.versions/2.2.2/.pi/harnesses/lib/system1/selection.js +11 -0
  1342. package/.versions/2.2.2/.pi/harnesses/lib/system1/service.ts +245 -0
  1343. package/.versions/2.2.2/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  1344. package/.versions/2.2.2/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  1345. package/.versions/2.2.2/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  1346. package/.versions/2.2.2/.pi/harnesses/lib/target-capabilities.js +7 -0
  1347. package/.versions/2.2.2/.pi/harnesses/lib/update-check.ts +227 -0
  1348. package/.versions/2.2.2/.pi/harnesses/lib/workspace-context.js +115 -0
  1349. package/.versions/2.2.2/.pi/harnesses/lib/workspace-context.ts +22 -0
  1350. package/.versions/2.2.2/.pi/harnesses/package-lock.json +2121 -0
  1351. package/.versions/2.2.2/.pi/harnesses/package.json +13 -0
  1352. package/.versions/2.2.2/.pi/prompts/af-build.md +27 -0
  1353. package/.versions/2.2.2/.pi/prompts/af-code-simplify.md +22 -0
  1354. package/.versions/2.2.2/.pi/prompts/af-constraints.md +31 -0
  1355. package/.versions/2.2.2/.pi/prompts/af-plan.md +17 -0
  1356. package/.versions/2.2.2/.pi/prompts/af-review.md +16 -0
  1357. package/.versions/2.2.2/.pi/prompts/af-set-hermes-telegram.md +15 -0
  1358. package/.versions/2.2.2/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  1359. package/.versions/2.2.2/.pi/prompts/af-setup-rules.md +20 -0
  1360. package/.versions/2.2.2/.pi/prompts/af-ship.md +17 -0
  1361. package/.versions/2.2.2/.pi/prompts/af-spec.md +15 -0
  1362. package/.versions/2.2.2/.pi/prompts/af-test.md +19 -0
  1363. package/.versions/2.2.2/.pi/skills/bowser/SKILL.md +145 -0
  1364. package/.versions/2.2.2/.version +1 -0
  1365. package/.versions/2.2.2/agents/architect.md +24 -0
  1366. package/.versions/2.2.2/agents/bowser.md +28 -0
  1367. package/.versions/2.2.2/agents/builder.md +55 -0
  1368. package/.versions/2.2.2/agents/code-reviewer.md +209 -0
  1369. package/.versions/2.2.2/agents/deep-researcher.md +32 -0
  1370. package/.versions/2.2.2/agents/documenter.md +22 -0
  1371. package/.versions/2.2.2/agents/plan-reviewer.md +83 -0
  1372. package/.versions/2.2.2/agents/planner.md +107 -0
  1373. package/.versions/2.2.2/agents/releaser.md +24 -0
  1374. package/.versions/2.2.2/agents/researcher.md +30 -0
  1375. package/.versions/2.2.2/agents/security-auditor.md +167 -0
  1376. package/.versions/2.2.2/agents/test-engineer.md +153 -0
  1377. package/.versions/2.2.2/agents/web-debugger.md +44 -0
  1378. package/.versions/2.2.2/agents/web-performance-auditor.md +194 -0
  1379. package/.versions/2.2.2/bin/catalog/harness-runtime-closure.json +85 -0
  1380. package/.versions/2.2.2/docs/ARCHITECTURE.md +1291 -0
  1381. package/.versions/2.2.2/docs/agent-fleet-setup.md +1161 -0
  1382. package/.versions/2.2.2/docs/claude-code-coms-bridge.md +147 -0
  1383. package/.versions/2.2.2/docs/codex-local-mcp.md +520 -0
  1384. package/.versions/2.2.2/docs/codex-session-bridge.md +44 -0
  1385. package/.versions/2.2.2/docs/codex-setup.md +183 -0
  1386. package/.versions/2.2.2/docs/coms-hermes-bridge.md +188 -0
  1387. package/.versions/2.2.2/docs/fleet-native-voice.md +151 -0
  1388. package/.versions/2.2.2/docs/getting-started.md +126 -0
  1389. package/.versions/2.2.2/docs/npm-install.md +535 -0
  1390. package/.versions/2.2.2/docs/pi-extensions.md +450 -0
  1391. package/.versions/2.2.2/docs/pi-setup.md +92 -0
  1392. package/.versions/2.2.2/docs/skill-anatomy.md +150 -0
  1393. package/.versions/2.2.2/install-manifest.json +3227 -0
  1394. package/.versions/2.2.2/justfile +246 -0
  1395. package/.versions/2.2.2/manifest-meta.json +1099 -0
  1396. package/.versions/2.2.2/references/accessibility-checklist.md +160 -0
  1397. package/.versions/2.2.2/references/communication-contract.md +26 -0
  1398. package/.versions/2.2.2/references/definition-of-done.md +67 -0
  1399. package/.versions/2.2.2/references/fleet-coordination-patterns.md +171 -0
  1400. package/.versions/2.2.2/references/observability-checklist.md +92 -0
  1401. package/.versions/2.2.2/references/orchestration-patterns.md +370 -0
  1402. package/.versions/2.2.2/references/performance-checklist.md +236 -0
  1403. package/.versions/2.2.2/references/prompting-patterns.md +380 -0
  1404. package/.versions/2.2.2/references/security-checklist.md +245 -0
  1405. package/.versions/2.2.2/references/testing-patterns.md +235 -0
  1406. package/.versions/2.2.2/references/workflow-authoring.md +304 -0
  1407. package/.versions/2.2.2/skills/_internal/grilling.md +59 -0
  1408. package/.versions/2.2.2/skills/browser-testing-with-devtools/SKILL.md +351 -0
  1409. package/.versions/2.2.2/skills/code-review-and-quality/SKILL.md +396 -0
  1410. package/.versions/2.2.2/skills/compound-learning/SKILL.md +137 -0
  1411. package/.versions/2.2.2/skills/constraint-driven-development/SKILL.md +338 -0
  1412. package/.versions/2.2.2/skills/constraint-driven-development/references/floor-guard.md +99 -0
  1413. package/.versions/2.2.2/skills/context-engineering/SKILL.md +341 -0
  1414. package/.versions/2.2.2/skills/deprecation-and-migration/SKILL.md +247 -0
  1415. package/.versions/2.2.2/skills/designing-agents/SKILL.md +394 -0
  1416. package/.versions/2.2.2/skills/designing-agents/pi-harness-authoring.md +222 -0
  1417. package/.versions/2.2.2/skills/drafting-workflows/SKILL.md +143 -0
  1418. package/.versions/2.2.2/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  1419. package/.versions/2.2.2/skills/fleet-connect/SKILL.md +29 -0
  1420. package/.versions/2.2.2/skills/fleet-connect.zip +0 -0
  1421. package/.versions/2.2.2/skills/fleet-native-voice/SKILL.md +103 -0
  1422. package/.versions/2.2.2/skills/fleet-native-voice/agents/openai.yaml +4 -0
  1423. package/.versions/2.2.2/skills/fleet-native-voice.zip +0 -0
  1424. package/.versions/2.2.2/skills/frontend-ui-engineering/SKILL.md +328 -0
  1425. package/.versions/2.2.2/skills/git-workflow-and-versioning/SKILL.md +316 -0
  1426. package/.versions/2.2.2/skills/idea-refine/SKILL.md +182 -0
  1427. package/.versions/2.2.2/skills/idea-refine/examples.md +238 -0
  1428. package/.versions/2.2.2/skills/idea-refine/frameworks.md +99 -0
  1429. package/.versions/2.2.2/skills/idea-refine/refinement-criteria.md +113 -0
  1430. package/.versions/2.2.2/skills/idea-refine/scripts/idea-refine.sh +15 -0
  1431. package/.versions/2.2.2/skills/incremental-implementation/SKILL.md +353 -0
  1432. package/.versions/2.2.2/skills/incremental-implementation.zip +0 -0
  1433. package/.versions/2.2.2/skills/interview-me/SKILL.md +226 -0
  1434. package/.versions/2.2.2/skills/orchestration-verification/SKILL.md +182 -0
  1435. package/.versions/2.2.2/skills/peer-coms/SKILL.md +90 -0
  1436. package/.versions/2.2.2/skills/performance-optimization/SKILL.md +496 -0
  1437. package/.versions/2.2.2/skills/planning-and-task-breakdown/SKILL.md +318 -0
  1438. package/.versions/2.2.2/skills/planning-and-task-breakdown.zip +0 -0
  1439. package/.versions/2.2.2/skills/repository-ai-setup/SKILL.md +135 -0
  1440. package/.versions/2.2.2/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  1441. package/.versions/2.2.2/skills/repository-ai-setup/references/apply-contract.md +74 -0
  1442. package/.versions/2.2.2/skills/repository-ai-setup/references/provenance-template.md +16 -0
  1443. package/.versions/2.2.2/skills/repository-ai-setup/references/setup-flow.md +108 -0
  1444. package/.versions/2.2.2/skills/repository-ai-setup/references/verify-setup.md +20 -0
  1445. package/.versions/2.2.2/skills/repository-ai-setup.zip +0 -0
  1446. package/.versions/2.2.2/skills/security-and-hardening/SKILL.md +524 -0
  1447. package/.versions/2.2.2/skills/spec-driven-development/SKILL.md +295 -0
  1448. package/.versions/2.2.2/skills/spec-driven-development.zip +0 -0
  1449. package/.versions/2.2.2/skills/using-agent-skills/SKILL.md +198 -0
  1450. package/.versions/2.2.2/vendor/agent-skills-upstream/LICENSE +21 -0
  1451. package/.versions/2.2.2/vendor/agent-skills-upstream/README.md +430 -0
  1452. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  1453. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  1454. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  1455. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  1456. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  1457. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  1458. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  1459. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  1460. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  1461. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  1462. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  1463. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  1464. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  1465. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  1466. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  1467. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  1468. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  1469. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  1470. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  1471. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  1472. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  1473. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  1474. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  1475. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  1476. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  1477. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  1478. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  1479. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  1480. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  1481. package/.versions/2.2.2/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  1482. package/CHANGELOG.md +29 -0
  1483. package/install-manifest.json +2 -1
  1484. package/manifest-meta.json +1 -0
  1485. package/package.json +1 -1
@@ -0,0 +1,218 @@
1
+ import {spawn} from 'node:child_process';
2
+ import {createHash} from 'node:crypto';
3
+ import {constants,type BigIntStats} from 'node:fs';
4
+ import {lstat,mkdir,mkdtemp,open,realpath,rm,stat,type FileHandle} from 'node:fs/promises';
5
+ import {delimiter,dirname,isAbsolute,join} from 'node:path';
6
+ import {tmpdir} from 'node:os';
7
+ import {compareCodexVersions,codexDaemonVersionFromUserAgent} from '../../../harnesses/lib/codex-compat.ts';
8
+
9
+ export class CodexMeasurementError extends Error {
10
+ readonly code: string;
11
+ constructor(code: string) { super(code); this.code = code; }
12
+ }
13
+ function fail(code: string): never { throw new CodexMeasurementError(code); }
14
+ const epoch = (value: unknown): value is string => typeof value === 'string' && value.length > 0 && value.length <= 1024 && !/[\u0000-\u0020\u007f]/.test(value);
15
+ const version = (value: unknown): value is string => typeof value === 'string' && compareCodexVersions(value, value) === 0;
16
+ const sha = (bytes: string | Buffer) => createHash('sha256').update(bytes).digest('hex');
17
+ type Options = {timeoutMs?: number; signal?: AbortSignal};
18
+ function deadline(options: Options, fallback: number) {
19
+ const timeout = options.timeoutMs ?? fallback, signal = options.signal;
20
+ if (!Number.isSafeInteger(timeout) || timeout < 1 || timeout > 30000) fail('invalid_timeout');
21
+ const controller = new AbortController(), expires = performance.now() + timeout; let reason = 'measurement_cancelled';
22
+ const stop = (code: string) => { if (!controller.signal.aborted) { reason = code; controller.abort(); } };
23
+ const abort = () => stop(performance.now() >= expires ? 'measurement_timeout' : 'measurement_cancelled');
24
+ if (signal?.aborted) fail(reason);
25
+ signal?.addEventListener('abort', abort, {once: true});
26
+ const timer = setTimeout(() => stop('measurement_timeout'), timeout);
27
+ // A fulfilled callback/microtask can run before an already-due timer. Never
28
+ // publish an overdue observation merely because that timer has not run yet.
29
+ const check = () => { if (performance.now() >= expires) stop('measurement_timeout'); if (controller.signal.aborted) fail(reason); };
30
+ return {signal: controller.signal, check, error: () => new CodexMeasurementError(reason), close: () => { clearTimeout(timer); signal?.removeEventListener('abort', abort); controller.abort(); }};
31
+ }
32
+
33
+ export interface DaemonObservationRpc {
34
+ /** Trusted connect-only provider. Both callbacks must honor abort and clean up
35
+ * their own transport. They must not start/resume/queue/approve anything.
36
+ * Existing CodexUnixQueueRpc is NOT loosened or automatically wired here.
37
+ */
38
+ socketEpoch(signal: AbortSignal): unknown | Promise<unknown>;
39
+ /** socketEpoch is captured/checked connection metadata, NEVER a server result
40
+ * or an ambient path snapshot. The provider must fence against expectedEpoch.
41
+ */
42
+ initialize(signal: AbortSignal, expectedEpoch: string): Promise<{result: unknown; socketEpoch: string}>;
43
+ }
44
+ export type DaemonMeasurement = {kind: 'initialize_version_observation'; version: string; socketEpoch: string};
45
+ /** Version claim from the measured UA grammar only; NOT Desktop identity, MCP
46
+ * clientInfo, current consumer presence or persistent approval evidence.
47
+ */
48
+ export async function measureDaemon(rpc: DaemonObservationRpc, options: Options = {}): Promise<DaemonMeasurement> {
49
+ const scope = deadline(options, 3000);
50
+ const cancelled = new Promise<never>((_, reject) => scope.signal.addEventListener('abort', () => reject(scope.error()), {once: true}));
51
+ const work = async (): Promise<DaemonMeasurement> => {
52
+ scope.check(); const before = await rpc.socketEpoch(scope.signal); scope.check();
53
+ if (!epoch(before)) fail('invalid_socket_epoch');
54
+ const initialized = await rpc.initialize(scope.signal, before); scope.check();
55
+ if (!initialized || typeof initialized !== 'object' || !epoch(initialized.socketEpoch) || initialized.socketEpoch !== before) fail('initialize_epoch_mismatch');
56
+ const observed = initialized.result;
57
+ const ua = observed && typeof observed === 'object' && !Array.isArray(observed) ? (observed as {userAgent?: unknown}).userAgent : undefined;
58
+ // Shared exact measured prefix; no guessed alias or clientInfo/CLI fallback.
59
+ const observedVersion=codexDaemonVersionFromUserAgent(ua);
60
+ if (!observedVersion) fail('daemon_version_unavailable');
61
+ const after = await rpc.socketEpoch(scope.signal); scope.check();
62
+ if (!epoch(after) || before !== after) fail('socket_epoch_changed');
63
+ return {kind: 'initialize_version_observation', version: observedVersion, socketEpoch: before};
64
+ };
65
+ try { return await Promise.race([work(), cancelled]); }
66
+ catch (error) { if (error instanceof CodexMeasurementError) throw error; throw new CodexMeasurementError('daemon_observation_failed'); }
67
+ finally { scope.close(); }
68
+ }
69
+
70
+ /** Revalidate the previously selected CLI bytes/alias identity without running
71
+ * any command. A cached schema snapshot is not permission to trust a changed
72
+ * executable. This remains byte identity, not daemon/Desktop process identity. */
73
+ export async function schemaExportStillCurrent(binary:string,evidence:{binaryEpoch:string;binarySha256:string},options:Options={}){
74
+ const scope=deadline(options,2000);try{if(typeof process.getuid!=='function')return false;scope.check();const current=await binarySnapshot(binary,scope.check,process.getuid());scope.check();return current.epoch===evidence.binaryEpoch&&current.sha256===evidence.binarySha256;}finally{scope.close();}
75
+ }
76
+
77
+ const sourceFiles = ['ClientRequest.json','ClientNotification.json','JSONRPCResponse.json','JSONRPCError.json','v1/InitializeResponse.json','v2/ThreadReadResponse.json','v2/ThreadLoadedListResponse.json','v2/ThreadQueueAddResponse.json','v2/ThreadQueueListResponse.json'] as const;
78
+ const maxBinaryBytes = 512 * 1024 * 1024, maxFileBytes = 16 * 1024 * 1024, maxTotalBytes = 32 * 1024 * 1024;
79
+ const stamp = (s: BigIntStats) => [s.dev,s.ino,s.size,s.mode,s.uid,s.gid,s.nlink,s.mtimeNs,s.ctimeNs].map(String).join(':');
80
+ async function binarySnapshot(path: string, check: () => void, owner: number) {
81
+ check(); const alias = await lstat(path, {bigint: true}); const resolved = await realpath(path);
82
+ const uid = BigInt(owner), checked = new Set<string>();
83
+ // A safe file mode alone cannot stop another UID replacing it through a
84
+ // writable ancestor. Execute only through physically trusted parent chains.
85
+ for (const parent of [dirname(resolved), await realpath(dirname(path))]) {
86
+ for (let dir = parent; !checked.has(dir); dir = dirname(dir)) {
87
+ check(); checked.add(dir); const s = await lstat(dir, {bigint: true});
88
+ if (!s.isDirectory() || s.isSymbolicLink() || (s.uid !== uid && s.uid !== 0n) || ((Number(s.mode) & 0o022) !== 0 && (Number(s.mode) & 0o1000) === 0)) fail('unsafe_binary_parent');
89
+ }
90
+ }
91
+ const before = await lstat(resolved, {bigint: true});
92
+ if (!before.isFile() || before.isSymbolicLink() || (before.uid !== uid && before.uid !== 0n) || (alias.uid !== uid && alias.uid !== 0n) || (Number(before.mode) & 0o6022) !== 0 || (Number(before.mode) & 0o111) === 0) fail('unsafe_binary');
93
+ if (before.size < 1n || before.size > BigInt(maxBinaryBytes)) fail('binary_limit');
94
+ const handle = await open(resolved, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
95
+ const hash = createHash('sha256'); let total = 0;
96
+ try {
97
+ if (stamp(await handle.stat({bigint: true})) !== stamp(before)) fail('binary_changed');
98
+ const buffer = Buffer.alloc(1024 * 1024);
99
+ while (true) { check(); const {bytesRead} = await handle.read(buffer, 0, buffer.length, null); if (!bytesRead) break; total += bytesRead; if (total > maxBinaryBytes) fail('binary_limit'); hash.update(buffer.subarray(0, bytesRead)); }
100
+ if (total !== Number(before.size) || stamp(await handle.stat({bigint: true})) !== stamp(before) || stamp(await stat(resolved, {bigint: true})) !== stamp(before) || stamp(await lstat(path, {bigint: true})) !== stamp(alias) || await realpath(path) !== resolved) fail('binary_changed');
101
+ } finally { await handle.close(); }
102
+ check(); const digest = hash.digest('hex');
103
+ return {path: resolved, sha256: digest, epoch: sha(JSON.stringify([path,resolved,stamp(alias),stamp(before),digest]))};
104
+ }
105
+
106
+ /** Fixed local subcommands only. Minimal isolated HOME/CODEX_HOME; no inherited
107
+ * agent grants, auth, NODE_OPTIONS or model/provider configuration. This is not
108
+ * an OS/network sandbox: the explicitly selected executable must be trusted.
109
+ */
110
+ function command(binary: string, args: string[], cwd: string, env: NodeJS.ProcessEnv, scope: ReturnType<typeof deadline>): Promise<Buffer> {
111
+ scope.check();
112
+ return new Promise((resolve, reject) => {
113
+ let error: CodexMeasurementError | undefined, stdout = 0, stderr = 0;
114
+ const chunks: Buffer[] = [];
115
+ const child = spawn(binary, args, {cwd, env, shell: false, detached: true, windowsHide: true, stdio: ['ignore','pipe','pipe']});
116
+ const kill = () => { if (child.pid) try { process.kill(-child.pid, 'SIGKILL'); } catch { child.kill('SIGKILL'); } };
117
+ const abort = () => { error ??= scope.error(); kill(); };
118
+ scope.signal.addEventListener('abort', abort, {once: true});
119
+ child.on('error', () => { error ??= new CodexMeasurementError('binary_command_failed'); });
120
+ child.stdout.on('data', (data: Buffer) => { stdout += data.length; if (stdout > 16384) { error ??= new CodexMeasurementError('command_output_limit'); kill(); } else chunks.push(data); });
121
+ child.stderr.on('data', (data: Buffer) => { stderr += data.length; if (stderr > 16384) { error ??= new CodexMeasurementError('command_output_limit'); kill(); } });
122
+ child.on('close', code => { scope.signal.removeEventListener('abort', abort); if (error) reject(error); else if (code !== 0) reject(new CodexMeasurementError('binary_command_failed')); else resolve(Buffer.concat(chunks)); });
123
+ if (scope.signal.aborted) abort();
124
+ });
125
+ }
126
+
127
+ export type SchemaExportObservation = {
128
+ kind: 'schema_export_observation'; version: string; socketEpoch: string;
129
+ binarySha256: string; binaryEpoch: string;
130
+ documents: Record<string, unknown>; sourceHashes: Record<string, string>;
131
+ };
132
+ /** Offline fixed schema export in an owned 0700 temp root, only after EXACT CLI
133
+ * version match (including build metadata). No install/update/start commands.
134
+ * Returns data after cleanup, never a ready/compatible verdict. Epoch freshness
135
+ * must be rechecked by the future caller; no live RPC adapter is installed here.
136
+ */
137
+ export async function exportSchema(binary: string, daemon: DaemonMeasurement, options: Options = {}): Promise<SchemaExportObservation> {
138
+ const uid = process.getuid?.();
139
+ if (process.platform === 'win32' || uid === undefined) fail('unsupported_platform');
140
+ if (typeof binary !== 'string' || !isAbsolute(binary) || binary.includes('\0')) fail('invalid_binary_path');
141
+ const observedVersion = daemon?.version, socketEpoch = daemon?.socketEpoch;
142
+ if (daemon?.kind !== 'initialize_version_observation' || !version(observedVersion) || !epoch(socketEpoch)) fail('invalid_daemon_measurement');
143
+ const scope = deadline(options, 30000);
144
+ let root: string | undefined, rootIdentity: string | undefined, rootHandle: FileHandle | undefined;
145
+ let hasResult = false;
146
+ try {
147
+ scope.check();
148
+ const requestedTemp = tmpdir(); if (!isAbsolute(requestedTemp)) fail('unsafe_temp_parent');
149
+ const base = await realpath(requestedTemp), parent = await lstat(base);
150
+ if (!parent.isDirectory() || (parent.uid !== uid && parent.uid !== 0) || ((parent.mode & 0o022) !== 0 && (parent.mode & 0o1000) === 0)) fail('unsafe_temp_parent');
151
+ root = await mkdtemp(join(base, 'fleet-codex-schema-')); rootIdentity = stamp(await lstat(root, {bigint: true}));
152
+ // Pin the directory inode through cleanup: unlink/recreate cannot reuse it and
153
+ // masquerade as our original root while this handle remains open.
154
+ rootHandle = await open(root, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_DIRECTORY);
155
+ if (stamp(await rootHandle.stat({bigint: true})).split(':').slice(0,2).join(':') !== rootIdentity.split(':').slice(0,2).join(':')) fail('unsafe_export_root');
156
+ const home = join(root, 'home'), codexHome = join(root, 'codex-home'), temp = join(root, 'tmp'), output = join(root, 'schema');
157
+ for (const dir of [home,codexHome,temp,output]) await mkdir(dir, {mode: 0o700});
158
+ const env = {PATH: [dirname(process.execPath),'/usr/bin','/bin'].join(delimiter), HOME: home, CODEX_HOME: codexHome, TMPDIR: temp, TMP: temp, TEMP: temp, LANG: 'C.UTF-8', LC_ALL: 'C.UTF-8', TERM: 'dumb', NO_COLOR: '1'};
159
+ const privateRoot = async () => {
160
+ const current = await lstat(root!, {bigint: true});
161
+ if (!current.isDirectory() || current.isSymbolicLink() || current.uid !== BigInt(uid) || (Number(current.mode) & 0o077) !== 0 || stamp(current).split(':').slice(0,2).join(':') !== rootIdentity?.split(':').slice(0,2).join(':')) fail('unsafe_export_root');
162
+ };
163
+ await privateRoot();
164
+ const before = await binarySnapshot(binary, scope.check, uid);
165
+ const rawVersion = new TextDecoder('utf-8', {fatal: true}).decode(await command(before.path, ['--version'], root, env, scope));
166
+ const match = /^codex-cli ([^\r\n ]+)(?:\r?\n)?$/.exec(rawVersion);
167
+ if (!match || !version(match[1]) || match[1] !== observedVersion) fail('export_version_mismatch');
168
+ await privateRoot();
169
+ if ((await binarySnapshot(binary, scope.check, uid)).epoch !== before.epoch) fail('binary_changed');
170
+ await command(before.path, ['app-server','generate-json-schema','--experimental','--out',output], root, env, scope);
171
+ await privateRoot();
172
+ if ((await binarySnapshot(binary, scope.check, uid)).epoch !== before.epoch) fail('binary_changed');
173
+ const documents: Record<string, unknown> = {}, sourceHashes: Record<string, string> = {}; let total = 0;
174
+ for (const file of sourceFiles) {
175
+ scope.check();
176
+ const path = join(output, file);
177
+ for (const dir of file.includes('/') ? [output,dirname(path)] : [output]) { const s = await lstat(dir); if (!s.isDirectory() || s.isSymbolicLink() || s.uid !== uid) fail('unsafe_schema_output'); }
178
+ const entry = await lstat(path, {bigint: true});
179
+ if (!entry.isFile() || entry.isSymbolicLink() || entry.nlink !== 1n) fail('unsafe_schema_output');
180
+ const handle = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
181
+ let bytes: Buffer;
182
+ try {
183
+ const initial = await handle.stat({bigint: true});
184
+ if (stamp(initial) !== stamp(entry)) fail('schema_output_changed');
185
+ if (!initial.isFile() || initial.nlink !== 1n || initial.uid !== BigInt(uid)) fail('unsafe_schema_output');
186
+ if (initial.size < 1n || initial.size > BigInt(maxFileBytes) || total + Number(initial.size) > maxTotalBytes) fail('schema_output_limit');
187
+ const buffer = Buffer.alloc(Number(initial.size) + 1); let offset = 0;
188
+ while (offset < buffer.length) { scope.check(); const {bytesRead} = await handle.read(buffer, offset, buffer.length - offset, null); if (!bytesRead) break; offset += bytesRead; }
189
+ bytes = buffer.subarray(0, offset);
190
+ if (bytes.length !== Number(initial.size) || stamp(await handle.stat({bigint: true})) !== stamp(initial)) fail('schema_output_changed');
191
+ } finally { await handle.close(); }
192
+ total += bytes.length;
193
+ let parsed: unknown;
194
+ try { parsed = JSON.parse(new TextDecoder('utf-8', {fatal: true}).decode(bytes)); } catch { fail('invalid_schema_document'); }
195
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) fail('invalid_schema_document');
196
+ documents[file] = parsed; sourceHashes[file] = sha(bytes);
197
+ }
198
+ scope.check(); hasResult = true;
199
+ return {kind: 'schema_export_observation', version: observedVersion, socketEpoch, binarySha256: before.sha256, binaryEpoch: before.epoch, documents, sourceHashes};
200
+ } catch (error) { if (error instanceof CodexMeasurementError) throw error; if (scope.signal.aborted) throw scope.error(); throw new CodexMeasurementError('schema_export_failed'); }
201
+ finally {
202
+ try {
203
+ try {
204
+ if (root) {
205
+ // Directory timestamps change as children are created; bind only dev+inode.
206
+ try {
207
+ const current = await lstat(root, {bigint: true});
208
+ if (stamp(current).split(':').slice(0,2).join(':') !== rootIdentity?.split(':').slice(0,2).join(':') || !current.isDirectory() || current.isSymbolicLink() || current.uid !== BigInt(uid)) fail('unsafe_export_cleanup');
209
+ await rm(root, {recursive: true, force: false});
210
+ } catch (error) { if (error instanceof CodexMeasurementError) throw error; throw new CodexMeasurementError('schema_export_cleanup_failed'); }
211
+ }
212
+ } finally { if (rootHandle) try { await rootHandle.close(); } catch { fail('schema_export_cleanup_failed'); } }
213
+ // Cleanup is mandatory even after cancellation. A completed observation may
214
+ // leave the helper only if its budget/caller is still live after cleanup.
215
+ if (hasResult) scope.check();
216
+ } finally { scope.close(); }
217
+ }
218
+ }
@@ -0,0 +1,61 @@
1
+ import {createHash,randomUUID} from 'node:crypto';
2
+ import {opendir,lstat,unlink} from 'node:fs/promises';
3
+ import {join} from 'node:path';
4
+ import {namespaceKey,bootstrapNamespace,type BootstrapPresence} from '../../../harnesses/lib/fleet-bootstrap-channel.ts';
5
+ import type {ConversationKey,TargetEpoch} from './fleet-codex-allowlist.ts';
6
+ import {validInstructionTarget} from '../../../harnesses/lib/fleet-target-identity.ts';
7
+ import {privateDirectory,readPrivateJson,writePrivateJson,privateFileIdentity,canonicalPrivatePath} from './codex-bootstrap-files.ts';
8
+ const TTL=600000,uuid=(v:unknown):v is string=>typeof v==='string'&&/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/.test(v);
9
+ const object=(v:unknown):v is Record<string,any>=>!!v&&typeof v==='object'&&!Array.isArray(v);
10
+ export type NativePresence={schema:'fleet-native-presence/v1';observation:BootstrapPresence;observedAt:number};
11
+ export type NativeAttachRequest={schema:'fleet-native-attach-request/v1';id:string;namespace:ConversationKey;hostInstance:string;owner:TargetEpoch;createdAt:number};
12
+ const hash=(c:ConversationKey)=>createHash('sha256').update(namespaceKey(c)).digest('hex');
13
+ export function validNativeObservation(v:unknown):v is BootstrapPresence{return object(v)&&Object.keys(v).sort().join(',')==='catalog,clientInfo,hostInstance,namespace,protocolVersion'&&bootstrapNamespace(v.namespace)&&uuid(v.hostInstance)&&v.protocolVersion==='2025-06-18'&&(v.clientInfo===null||object(v.clientInfo)&&Object.keys(v.clientInfo).sort().join(',')==='name,version'&&typeof v.clientInfo.name==='string'&&typeof v.clientInfo.version==='string'&&[v.clientInfo.name,v.clientInfo.version].every(x=>x.length>=1&&x.length<=256&&!/[\u0000-\u001f\u007f]/.test(x)))&&Array.isArray(v.catalog)&&v.catalog.length<=128&&Array.from(v.catalog).every(x=>typeof x==='string'&&/^[A-Za-z0-9._-]{1,128}$/.test(x))&&new Set(v.catalog).size===v.catalog.length;}
14
+ /** Private metadata rendezvous, not policy/config/consent. No new listener or
15
+ * broadcast to unrelated AF projects. Native publishes only observed context;
16
+ * AF may ask its exact owner to attach, but only a later Pi-confirmed coordinator
17
+ * command can reach the Codex writer. No directory repair/foreign file cleanup. */
18
+ export class NativePresenceDirectory {
19
+ readonly root:string;readonly #now:()=>number;readonly #issued=new Map<string,{path:string;identity:string}>();
20
+ constructor(root:string,now=Date.now){if(!canonicalPrivatePath(root))throw Error('native_presence_root');this.root=root;this.#now=now;}
21
+ #time(){const now=this.#now();if(!Number.isSafeInteger(now)||now<0)throw Error('native_presence_clock');return now;}
22
+ #path(o:BootstrapPresence){return join(this.root,'presence-'+hash(o.namespace)+'-'+o.hostInstance+'.json');}
23
+ async publish(value:BootstrapPresence,signal?:AbortSignal){
24
+ const seen=structuredClone(value);if(!validNativeObservation(seen))throw Error('native_presence_invalid');const record:NativePresence={schema:'fleet-native-presence/v1',observation:seen,observedAt:this.#time()};
25
+ await writePrivateJson(this.#path(seen),record,{signal,createParent:true});return structuredClone(record);
26
+ }
27
+ async #files(prefix:'presence-'|'request-',signal?:AbortSignal){
28
+ try{await privateDirectory(this.root);}catch(e){if((e as any)?.code==='ENOENT')return [];throw e;}
29
+ const dir=await opendir(this.root),files:{name:string;value:any;identity:string}[]=[];let count=0,total=0;
30
+ try{for await(const entry of dir){if(signal?.aborted)throw Error('native_presence_cancelled');if(++count>128)throw Error('native_presence_limit');if(!entry.name.startsWith(prefix)||!entry.name.endsWith('.json'))continue;
31
+ let at:Awaited<ReturnType<typeof readPrivateJson>>;try{at=await readPrivateJson(join(this.root,entry.name),32768,signal);}catch(e){if(!(e instanceof Error)||e.message!=='bootstrap_file_changed')throw e;at=await readPrivateJson(join(this.root,entry.name),32768,signal);}if(!at)throw Error('native_presence_changed');total+=Buffer.byteLength(JSON.stringify(at.value));if(total>1048576)throw Error('native_presence_limit');files.push({name:entry.name,...at});
32
+ }}finally{try{await dir.close();}catch(e){if((e as any)?.code!=='ERR_DIR_CLOSED')throw e;}}return files;
33
+ }
34
+ async list(signal?:AbortSignal){
35
+ const result:Readonly<NativePresence&{fresh:boolean}>[]=[];const now=this.#time();
36
+ for(const file of await this.#files('presence-',signal)){
37
+ const v=file.value;if(!object(v)||Object.keys(v).sort().join(',')!=='observation,observedAt,schema'||v.schema!=='fleet-native-presence/v1'||!validNativeObservation(v.observation)||!Number.isSafeInteger(v.observedAt)||v.observedAt>now+1000||file.name!=='presence-'+hash(v.observation.namespace)+'-'+v.observation.hostInstance+'.json')throw Error('native_presence_invalid');
38
+ result.push({...structuredClone(v as NativePresence),fresh:now-v.observedAt<TTL});
39
+ }return result;
40
+ }
41
+ async requestAttach(seen:NativePresence,owner:TargetEpoch,signal?:AbortSignal){
42
+ const selected={schema:seen.schema,observation:structuredClone(seen.observation),observedAt:seen.observedAt},target=structuredClone(owner),now=this.#time();if(selected.schema!=='fleet-native-presence/v1'||!validNativeObservation(selected.observation)||!validInstructionTarget(target)||!Number.isSafeInteger(selected.observedAt)||now-selected.observedAt>=TTL||selected.observedAt>now+1000)throw Error('native_presence_stale');
43
+ await privateDirectory(this.root);const current=await readPrivateJson(this.#path(selected.observation),32768,signal);if(!current||current.value?.schema!==selected.schema||JSON.stringify(current.value.observation)!==JSON.stringify(selected.observation)||!Number.isSafeInteger(current.value.observedAt)||current.value.observedAt<selected.observedAt||this.#time()-current.value.observedAt>=TTL||current.value.observedAt>this.#time()+1000)throw Error('native_presence_changed');
44
+ const request:NativeAttachRequest={schema:'fleet-native-attach-request/v1',id:randomUUID(),namespace:selected.observation.namespace,hostInstance:selected.observation.hostInstance,owner:target,createdAt:this.#time()};
45
+ const path=join(this.root,'request-'+request.id+'.json');if(this.#issued.size>=32)throw Error('native_presence_request_capacity');const identity=await writePrivateJson(path,request,{signal,expected:null});this.#issued.set(request.id,{path,identity});return request.id;
46
+ }
47
+ async requests(hostInstance:string,signal?:AbortSignal){
48
+ const result:{request:NativeAttachRequest;path:string;identity:string}[]=[];const now=this.#time();
49
+ for(const file of await this.#files('request-',signal)){
50
+ const v=file.value;if(!object(v)||Object.keys(v).sort().join(',')!=='createdAt,hostInstance,id,namespace,owner,schema'||v.schema!=='fleet-native-attach-request/v1'||!uuid(v.id)||!uuid(v.hostInstance)||!bootstrapNamespace(v.namespace)||!validInstructionTarget(v.owner)||!Number.isSafeInteger(v.createdAt)||v.createdAt>now+1000||file.name!=='request-'+v.id+'.json')throw Error('native_presence_request_invalid');
51
+ if(now-v.createdAt>=5000){await this.consume(join(this.root,file.name),file.identity).catch(()=>{});continue;}
52
+ if(v.hostInstance===hostInstance)result.push({request:structuredClone(v as NativeAttachRequest),path:join(this.root,file.name),identity:file.identity});
53
+ }return result;
54
+ }
55
+ async consume(path:string,expected:string){
56
+ if(!path.startsWith(this.root+'/')||!/^request-[a-f0-9-]{36}\.json$/.test(path.slice(this.root.length+1)))throw Error('native_presence_path');
57
+ const current=await lstat(path);if(privateFileIdentity(current)!==expected)throw Error('native_presence_changed');await unlink(path);
58
+ }
59
+ async cancelAttach(id:string){const issued=this.#issued.get(id);if(!issued)return;this.#issued.delete(id);try{await this.consume(issued.path,issued.identity);}catch(e){if((e as any)?.code!=='ENOENT')throw e;}}
60
+ async remove(observed:BootstrapPresence){const path=this.#path(observed),old=await readPrivateJson(path);if(!old)return;if(old.value?.observation?.hostInstance!==observed.hostInstance)throw Error('native_presence_changed');const at=await lstat(path);if(privateFileIdentity(at)!==old.identity)throw Error('native_presence_changed');await unlink(path);}
61
+ }
@@ -0,0 +1,135 @@
1
+ import {constants,type BigIntStats} from 'node:fs';
2
+ import {lstat,open,type FileHandle} from 'node:fs/promises';
3
+ import {isAbsolute,normalize,resolve,join,dirname,basename,sep} from 'node:path';
4
+ import {createHash} from 'node:crypto';
5
+
6
+ export const codexProbeReaderVersion='codex-local-rollout-ack/v1';
7
+ export type ProbeCheckpoint=Readonly<{kind:typeof codexProbeReaderVersion}>;
8
+ export type LocalProbeAck=Readonly<{source:'local_codex_rollout_jsonl';readerVersion:typeof codexProbeReaderVersion;threadId:string;probeId:string;receiptId:string}>;
9
+ type Parent={path:string;identity:string};
10
+ type Entry={allowGroupWrite:boolean;file:FileHandle;path:string;threadId:string;identity:string;parents:Parent[];offset:number;skip:boolean;pending:Buffer;bytes:number;records:number;used:boolean;closed:boolean;signal:AbortSignal;cancel:AbortController;abandon?:()=>void;closing?:Promise<void>};
11
+ function fail(code:string):never{throw Error(code);}
12
+ const uuid=(v:unknown):v is string=>typeof v==='string'&&/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/.test(v);
13
+ const identity=(s:BigIntStats)=>[s.dev,s.ino,s.uid,s.mode,s.nlink].join(':');
14
+ const parentIdentity=(s:BigIntStats)=>[s.dev,s.ino,s.uid,s.mode].join(':');
15
+ const object=(v:unknown):v is Record<string,any>=>!!v&&typeof v==='object'&&!Array.isArray(v);
16
+ const decoder=new TextDecoder('utf-8',{fatal:true});
17
+
18
+ /** Bounded local O_RDONLY reader, not a daemon/thread API or Desktop attestor.
19
+ * Never exposes transcript text. Caller obtains path from the exact metadata
20
+ * thread, separately checks notLoaded/versions/identity, and uses a fresh nonce.
21
+ * Only trusted server code constructs this reader; no model/tool path arguments.
22
+ * Filesystem/proc calls are not forcibly interruptible, but overdue evidence is
23
+ * never published. Strict ACK reads never repair permissions. Separate post-consent securing only removes group-write bits; no traversal fallback, content writes or watcher. */
24
+ export class CodexProbeTranscript {
25
+ readonly #home:string;readonly #sessions:string;readonly #uid:bigint;readonly #timeout:number;readonly #poll:number;
26
+ readonly #entries=new WeakMap<ProbeCheckpoint,Entry>();readonly #active=new Set<ProbeCheckpoint>();readonly #stop=new AbortController();
27
+ readonly #openingTasks=new Set<Promise<ProbeCheckpoint>>();readonly #closing=new Set<Promise<void>>();#opening=0;
28
+ constructor(options:{codexHome:string;timeoutMs?:number;pollMs?:number}){
29
+ if(typeof options?.codexHome!=='string'||options.codexHome.length>4096||/[\u0000-\u001f\u007f]/.test(options.codexHome)||!isAbsolute(options.codexHome)||resolve(options.codexHome)!==options.codexHome||options.codexHome===sep||typeof process.getuid!=='function')fail('probe_reader_options_invalid');
30
+ this.#home=options.codexHome;this.#sessions=join(this.#home,'sessions');this.#uid=BigInt(process.getuid());this.#timeout=options.timeoutMs??120000;this.#poll=options.pollMs??100;
31
+ if(!Number.isInteger(this.#timeout)||this.#timeout<1||this.#timeout>120000||!Number.isInteger(this.#poll)||this.#poll<1||this.#poll>1000)fail('probe_reader_options_invalid');
32
+ }
33
+ #check(signal:AbortSignal,deadline:number){if(signal.aborted||this.#stop.signal.aborted)fail('probe_reader_cancelled');if(performance.now()>=deadline)fail('probe_reader_timeout');}
34
+ #signal(signal:AbortSignal,extra?:AbortSignal){if(!(signal instanceof AbortSignal))fail('probe_reader_options_invalid');try{return AbortSignal.any([signal,this.#stop.signal,...(extra?[extra]:[])]);}catch{fail('probe_reader_options_invalid');}}
35
+ async #io<T>(signal:AbortSignal,deadline:number,fn:()=>Promise<T>){this.#check(signal,deadline);const value=await fn();this.#check(signal,deadline);return value;}
36
+ #directory(s:BigIntStats,owned:boolean,allowGroupWrite=false){if(!s.isDirectory()||s.isSymbolicLink()||(owned&&(s.uid!==this.#uid||(s.mode&(allowGroupWrite?0o002n:0o022n))!==0n)))fail('probe_reader_unsafe_path');}
37
+ #file(s:BigIntStats,allowGroupWrite=false){if(!s.isFile()||s.uid!==this.#uid||s.nlink!==1n||(s.mode&(allowGroupWrite?0o002n:0o022n))!==0n||s.size<1n||s.size>2n*1024n*1024n*1024n)fail('probe_reader_unsafe_file');}
38
+ async #parents(path:string,signal:AbortSignal,deadline:number,allowGroupWrite=false){
39
+ const parents:Parent[]=[];
40
+ for(let p=dirname(path);;p=dirname(p)){
41
+ if(parents.length>=64)fail('probe_reader_unsafe_path');const s=await this.#io(signal,deadline,()=>lstat(p,{bigint:true}));this.#directory(s,p===this.#home||p.startsWith(this.#home+sep),allowGroupWrite&&(p===this.#sessions||p.startsWith(this.#sessions+sep)));parents.push({path:p,identity:parentIdentity(s)});if(p===dirname(p))break;
42
+ }
43
+ return parents;
44
+ }
45
+ async #verify(e:Entry,signal:AbortSignal,deadline:number){
46
+ if(e.closed)fail('probe_reader_closed');
47
+ for(const parent of e.parents){const s=await this.#io(signal,deadline,()=>lstat(parent.path,{bigint:true}));this.#directory(s,parent.path===this.#home||parent.path.startsWith(this.#home+sep),e.allowGroupWrite&&(parent.path===this.#sessions||parent.path.startsWith(this.#sessions+sep)));if(parentIdentity(s)!==parent.identity)fail('probe_reader_changed');}
48
+ const at=await this.#io(signal,deadline,()=>lstat(e.path,{bigint:true})),held=await this.#io(signal,deadline,()=>e.file.stat({bigint:true}));this.#file(at,e.allowGroupWrite);this.#file(held,e.allowGroupWrite);
49
+ if(identity(at)!==e.identity||identity(held)!==e.identity||held.size<BigInt(e.offset))fail('probe_reader_changed');return Number(held.size);
50
+ }
51
+ checkpoint(path:string,threadId:string,signal:AbortSignal):Promise<ProbeCheckpoint>{
52
+ return this.#acquire(path,threadId,signal,false);
53
+ }
54
+ #acquire(path:string,threadId:string,signal:AbortSignal,allowGroupWrite:boolean){
55
+ const work=this.#checkpoint(path,threadId,signal,allowGroupWrite);this.#openingTasks.add(work);void work.then(()=>this.#openingTasks.delete(work),()=>this.#openingTasks.delete(work));return work;
56
+ }
57
+ async #checkpoint(path:string,threadId:string,signal:AbortSignal,allowGroupWrite=false):Promise<ProbeCheckpoint>{
58
+ if(typeof path!=='string'||path.length>4096||/[\u0000-\u001f\u007f]/.test(path)||!isAbsolute(path)||normalize(path)!==path||!path.startsWith(this.#sessions+sep)||!uuid(threadId)||!basename(path).startsWith('rollout-')||!basename(path).endsWith('-'+threadId+'.jsonl')||this.#active.size+this.#closing.size+this.#opening>=16)fail('probe_reader_unsafe_path');
59
+ const scoped=this.#signal(signal),deadline=performance.now()+this.#timeout;this.#check(scoped,deadline);this.#opening++;
60
+ let file:FileHandle|undefined;
61
+ try{
62
+ const parents=await this.#parents(path,scoped,deadline,allowGroupWrite),before=await this.#io(scoped,deadline,()=>lstat(path,{bigint:true}));this.#file(before,allowGroupWrite);
63
+ // Acquisition assigns the handle before checking an overdue/cancelled result.
64
+ this.#check(scoped,deadline);file=await open(path,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);this.#check(scoped,deadline);
65
+ const held=await this.#io(scoped,deadline,()=>file!.stat({bigint:true}));this.#file(held,allowGroupWrite);if(identity(held)!==identity(before))fail('probe_reader_changed');
66
+ const cancel=new AbortController();
67
+ const e:Entry={allowGroupWrite,file,path,threadId,identity:identity(held),parents,offset:Number(held.size),skip:false,pending:Buffer.alloc(0),bytes:0,records:0,used:false,closed:false,signal:scoped,cancel};
68
+ await this.#verify(e,scoped,deadline);
69
+ const head=Buffer.alloc(Math.min(Number(held.size),256*1024));const result=await this.#io(scoped,deadline,()=>file!.read(head,0,head.length,0));const first=head.subarray(0,result.bytesRead),end=first.indexOf(10);if(end<0)fail('probe_reader_invalid_header');
70
+ let metadata:unknown;try{metadata=JSON.parse(decoder.decode(first.subarray(0,end)));}catch{fail('probe_reader_invalid_header');}
71
+ if(!object(metadata)||metadata.type!=='session_meta'||!object(metadata.payload)||metadata.payload.id!==threadId)fail('probe_reader_thread_mismatch');
72
+ const last=Buffer.alloc(1);await this.#io(scoped,deadline,()=>file!.read(last,0,1,e.offset-1));e.skip=last[0]!==10;
73
+ await this.#verify(e,scoped,deadline);this.#check(scoped,deadline);
74
+ const token:ProbeCheckpoint=Object.freeze({kind:codexProbeReaderVersion});this.#entries.set(token,e);this.#active.add(token);e.abandon=()=>{void this.close(token);};e.signal.addEventListener('abort',e.abandon,{once:true});file=undefined;return token;
75
+ }catch(error){if(error instanceof Error&&/^probe_reader_[a-z_]+$/.test(error.message))throw error;return fail('probe_reader_io_failed');}
76
+ finally{if(file)await file.close().catch(()=>{});this.#opening--;}
77
+ }
78
+ /** Read-only preparation accepts repairable group-write bits, never ACK evidence. */
79
+ async checkCapability(path:string,threadId:string,signal:AbortSignal){
80
+ const token=await this.#acquire(path,threadId,signal,true);await this.close(token);
81
+ }
82
+ /** Called only after native Pi consent. Tightens exact owned session ancestors
83
+ * and file via no-follow pinned handles; never recursive and never adds a bit.
84
+ * A partial failure is not rolled back by widening permissions. */
85
+ async securePermissions(path:string,threadId:string,signal:AbortSignal,guard:()=>void){
86
+ guard();const token=await this.#acquire(path,threadId,signal,true),e=this.#entries.get(token)!,deadline=performance.now()+this.#timeout;
87
+ try{
88
+ for(const parent of [...e.parents].reverse()){
89
+ if(parent.path!==this.#sessions&&!parent.path.startsWith(this.#sessions+sep))continue;
90
+ guard();await this.#verify(e,signal,deadline);
91
+ const handle=await open(parent.path,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_DIRECTORY);
92
+ try{
93
+ const before=await handle.stat({bigint:true});if(parentIdentity(before)!==parent.identity)fail('probe_reader_changed');
94
+ guard();this.#check(signal,deadline);
95
+ if(before.mode&0o020n)await handle.chmod(Number(before.mode&0o7777n&~0o020n));
96
+ parent.identity=parentIdentity(await handle.stat({bigint:true}));
97
+ }finally{await handle.close();}
98
+ guard();await this.#verify(e,signal,deadline);
99
+ }
100
+ guard();await this.#verify(e,signal,deadline);const before=await e.file.stat({bigint:true});
101
+ guard();this.#check(signal,deadline);if(before.mode&0o020n)await e.file.chmod(Number(before.mode&0o7777n&~0o020n));
102
+ e.identity=identity(await e.file.stat({bigint:true}));e.allowGroupWrite=false;
103
+ guard();await this.#verify(e,signal,deadline);
104
+ }finally{await this.close(token);}
105
+ }
106
+ #match(e:Entry,line:Buffer,probeId:string):LocalProbeAck|undefined{
107
+ if(++e.records>4096||line.length>65536)fail('probe_reader_limit');if(!line.length)return;
108
+ let record:unknown;try{record=JSON.parse(decoder.decode(line));}catch{fail('probe_reader_invalid_record');}
109
+ if(!object(record)||record.type!=='response_item'||!object(record.payload))return;
110
+ const p=record.payload;if(p.type!=='message'||p.role!=='assistant'||p.phase!=='final_answer'||!Array.isArray(p.content)||p.content.length!==1)return;
111
+ const part=p.content[0];if(!object(part)||part.type!=='output_text'||part.text!=='FLEET_PROBE_ACK '+probeId)return;
112
+ return {source:'local_codex_rollout_jsonl',readerVersion:codexProbeReaderVersion,threadId:e.threadId,probeId,receiptId:'rollout:'+createHash('sha256').update(line).digest('hex')};
113
+ }
114
+ async #sleep(signal:AbortSignal,ms:number){await new Promise<void>((resolve,reject)=>{const abort=()=>{clearTimeout(timer);signal.removeEventListener('abort',abort);reject(Error('probe_reader_cancelled'));};const timer=setTimeout(()=>{signal.removeEventListener('abort',abort);resolve();},ms);signal.addEventListener('abort',abort,{once:true});if(signal.aborted)abort();});}
115
+ async waitForAck(token:ProbeCheckpoint,probeId:string,signal:AbortSignal):Promise<LocalProbeAck>{
116
+ const e=this.#entries.get(token);if(!e||e.closed||e.used||!uuid(probeId))fail('probe_reader_checkpoint_invalid');e.used=true;
117
+ try{
118
+ const scoped=AbortSignal.any([this.#signal(signal,e.cancel.signal),e.signal]),deadline=performance.now()+this.#timeout;
119
+ while(true){
120
+ this.#check(scoped,deadline);const size=await this.#verify(e,scoped,deadline);
121
+ if(size>e.offset){
122
+ if(e.bytes>=2*1024*1024)fail('probe_reader_limit');const chunk=Buffer.alloc(Math.min(65536,size-e.offset,2*1024*1024-e.bytes));
123
+ const got=await this.#io(scoped,deadline,()=>e.file.read(chunk,0,chunk.length,e.offset));if(!got.bytesRead)fail('probe_reader_changed');e.offset+=got.bytesRead;e.bytes+=got.bytesRead;
124
+ let bytes=Buffer.concat([e.pending,chunk.subarray(0,got.bytesRead)]),end:number;
125
+ while((end=bytes.indexOf(10))>=0){this.#check(scoped,deadline);const line=bytes.subarray(0,end);bytes=bytes.subarray(end+1);if(e.skip){e.skip=false;continue;}const ack=this.#match(e,line,probeId);if(ack){await this.#verify(e,scoped,deadline);this.#check(scoped,deadline);return ack;}}
126
+ if(bytes.length>65536)fail('probe_reader_limit');e.pending=Buffer.from(bytes);continue;
127
+ }
128
+ await this.#sleep(scoped,Math.max(1,Math.min(this.#poll,deadline-performance.now())));
129
+ }
130
+ }catch(error){if(error instanceof Error&&/^probe_reader_[a-z_]+$/.test(error.message))throw error;fail('probe_reader_io_failed');}
131
+ finally{await this.close(token);}
132
+ }
133
+ async close(token:ProbeCheckpoint){const e=this.#entries.get(token);if(!e)return;if(e.closing)return e.closing;e.closed=true;if(e.abandon)e.signal.removeEventListener('abort',e.abandon);e.cancel.abort();this.#active.delete(token);let work!:Promise<void>;work=e.file.close().catch(()=>{}).finally(()=>{this.#entries.delete(token);this.#closing.delete(work);});e.closing=work;this.#closing.add(work);return work;}
134
+ async stop(){this.#stop.abort();await Promise.allSettled([...this.#openingTasks]);await Promise.all([...this.#active].map(token=>this.close(token)));await Promise.all([...this.#closing]);}
135
+ }
@@ -0,0 +1,72 @@
1
+ import {constants,lstatSync,openSync,fstatSync,readSync,closeSync,type Stats} from 'node:fs';
2
+ import {dirname} from 'node:path';
3
+ import {readPrivateJson,writePrivateJson,privateFileIdentity} from './codex-bootstrap-files.ts';
4
+ import type {ConversationKey,TargetEpoch,Right} from './fleet-codex-allowlist.ts';
5
+ import {targetKey} from '../../../harnesses/lib/fleet-target-identity.ts';
6
+
7
+ export type SendState={storeId:string;namespace:ConversationKey;revision:number;bindings:{alias:string;target:TargetEpoch;rights:Right[];status:string;expiresAt?:number}[]};
8
+ type Step={from:number;to:number;alias:string;send:boolean;before:string;after:string};
9
+ type Lineage={schema:'fleet-send-lineage/v1';storeId:string;namespace:ConversationKey;steps:Step[]};
10
+ const limit=64,maxBytes=32768,same=(a:unknown,b:unknown)=>JSON.stringify(a)===JSON.stringify(b);
11
+ const keys=(v:any,names:string[])=>v&&typeof v==='object'&&!Array.isArray(v)&&same(Object.keys(v).sort(),[...names].sort());
12
+ const digest=(v:unknown)=>typeof v==='string'&&/^[a-f0-9]{64}$/.test(v);
13
+ function decode(value:unknown,state:SendState):Lineage{
14
+ const v=value as Lineage;
15
+ if(!keys(v,['schema','storeId','namespace','steps'])||v.schema!=='fleet-send-lineage/v1'||v.storeId!==state.storeId||!same(v.namespace,state.namespace)||!Array.isArray(v.steps)||v.steps.length>limit)throw Error('send_lineage_invalid');
16
+ let previous=-1;
17
+ for(const s of v.steps){if(!keys(s,['from','to','alias','send','before','after'])||!Number.isSafeInteger(s.from)||s.from<0||s.from>=Number.MAX_SAFE_INTEGER||s.to!==s.from+1||s.from<=previous||typeof s.alias!=='string'||s.alias.length<1||s.alias.length>1024||typeof s.send!=='boolean'||!digest(s.before)||!digest(s.after))throw Error('send_lineage_invalid');previous=s.from;}
18
+ return v;
19
+ }
20
+ function changed<T extends SendState>(before:T,alias:string,send:boolean):T{
21
+ const next=structuredClone(before),b=next.bindings.find(b=>b.alias===alias);
22
+ if(!b||b.status!=='active'||b.rights[0]!=='read'||next.revision>=Number.MAX_SAFE_INTEGER)throw Error('send_lineage_invalid');
23
+ b.rights=['read',...(send?['send' as const]:[]),...(b.rights.includes('approve')?['approve' as const]:[])];next.revision++;return next;
24
+ }
25
+ /** Prepare the exact send-only proof before policy rename, under its existing
26
+ * lock. A future/failed write proves nothing until that after-state is current. */
27
+ export async function prepareSendLineage<T extends SendState>(path:string,before:T,after:T,alias:string,send:boolean,hash:(s:T)=>string,signal?:AbortSignal){
28
+ const next=changed(before,alias,send);if(!same(next,after))return;
29
+ const prior=await readPrivateJson(path,maxBytes,signal);
30
+ const lineage:Lineage=prior?decode(prior.value,before):{schema:'fleet-send-lineage/v1',storeId:before.storeId,namespace:structuredClone(before.namespace),steps:[]};
31
+ // Supersede an uncommitted future proof. Past gaps remain gaps, never authority.
32
+ lineage.steps=lineage.steps.filter(s=>s.from<before.revision);
33
+ lineage.steps.push({from:before.revision,to:after.revision,alias,send,before:hash(before),after:hash(after)});lineage.steps=lineage.steps.slice(-limit);
34
+ while(Buffer.byteLength(JSON.stringify(lineage)+'\n')>maxBytes&&lineage.steps.length>1)lineage.steps.shift();
35
+ await writePrivateJson(path,lineage,{signal,expected:prior?.identity??null});
36
+ }
37
+ /** A failed explicit write can leave a future proof. An equivalent generic
38
+ * reconnect/no-op must retire it before publication, including before a later
39
+ * explicit send can extend the chain. Real read/approve revocations cannot
40
+ * match a send-only state and never depend on optional continuity metadata. */
41
+ export async function retireFutureSendLineage<T extends SendState>(path:string,before:T,after:T,signal?:AbortSignal){
42
+ const couldMatch=before.bindings.some(b=>b.status==='active'&&b.rights[0]==='read'&&[false,true].some(send=>same(changed(before,b.alias,send),after)));
43
+ if(!couldMatch)return;
44
+ const prior=await readPrivateJson(path,maxBytes,signal);if(!prior)return;
45
+ const lineage=decode(prior.value,before),steps=lineage.steps.filter(s=>s.from<before.revision);if(steps.length===lineage.steps.length)return;
46
+ lineage.steps=steps;await writePrivateJson(path,lineage,{signal,expected:prior.identity});
47
+ }
48
+ function readNow(path:string):unknown{
49
+ const uid=process.getuid?.();if(uid===undefined)throw Error('send_lineage_unsafe');
50
+ for(let p=dirname(path);;p=dirname(p)){const s=lstatSync(p);if(!s.isDirectory()||s.isSymbolicLink()||(s.uid!==uid&&s.uid!==0)||((s.mode&0o022)!==0&&!(s.uid===0&&(s.mode&0o1000)!==0))||(p===dirname(path)&&(s.uid!==uid||(s.mode&0o077)!==0)))throw Error('send_lineage_unsafe');if(p===dirname(p))break;}
51
+ const parentStamp=(s:Stats)=>[s.dev,s.ino,s.uid,s.mode].join(':');
52
+ const parent=parentStamp(lstatSync(dirname(path))),before=lstatSync(path);
53
+ const safe=(s:Stats)=>{if(!s.isFile()||s.isSymbolicLink()||s.uid!==uid||(s.mode&0o077)!==0||s.nlink!==1||s.size<1||s.size>maxBytes)throw Error('send_lineage_unsafe');};safe(before);
54
+ const fd=openSync(path,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);
55
+ try{const held=fstatSync(fd);safe(held);if(privateFileIdentity(held)!==privateFileIdentity(before))throw Error('send_lineage_changed');const bytes=Buffer.alloc(held.size+1);let count=0;
56
+ while(count<bytes.length){const n=readSync(fd,bytes,count,bytes.length-count,null);if(!n)break;count+=n;}
57
+ if(count!==held.size||privateFileIdentity(fstatSync(fd))!==privateFileIdentity(held)||privateFileIdentity(lstatSync(path))!==privateFileIdentity(held)||parentStamp(lstatSync(dirname(path)))!==parent)throw Error('send_lineage_changed');
58
+ return JSON.parse(new TextDecoder('utf-8',{fatal:true}).decode(bytes.subarray(0,count)));
59
+ }finally{closeSync(fd);}
60
+ }
61
+ /** Caller pins both policy reads and an issued starting state. Every intermediate
62
+ * state is reconstructed; endpoint equality cannot hide revoke/re-enroll ABA. */
63
+ export function verifySendLineage<T extends SendState>(path:string,before:T,after:T,owner:TargetEpoch,hash:(s:T)=>string):boolean{
64
+ try{const anchor=before.bindings.find(b=>targetKey(b.target)===targetKey(owner));if(!anchor||anchor.status!=='active'||anchor.rights[0]!=='read'||after.revision<=before.revision)return false;
65
+ const lineage=decode(readNow(path),before);let state=structuredClone(before);
66
+ for(const step of lineage.steps){if(step.from<state.revision)continue;if(state.revision===after.revision)break;
67
+ if(step.from!==state.revision||step.alias!==anchor.alias||step.before!==hash(state))return false;
68
+ state=changed(state,step.alias,step.send);if(step.to!==state.revision||step.after!==hash(state))return false;
69
+ }
70
+ return same(state,after);
71
+ }catch{return false;}
72
+ }
@@ -0,0 +1,101 @@
1
+ import {createConnection} from 'node:net';
2
+ import {lstatSync,realpathSync,readlinkSync} from 'node:fs';
3
+ import {dirname,isAbsolute,resolve} from 'node:path';
4
+ import {randomUUID} from 'node:crypto';
5
+ import {CodexDaemonObserver,webSocket,type WsConnection} from './codex-daemon-observer.ts';
6
+ import {compareCodexVersions,codexDaemonVersionFromUserAgent} from '../../../harnesses/lib/codex-compat.ts';
7
+
8
+ export type QueueMethod='thread/read'|'thread/loaded/list'|'thread/queue/list'|'thread/queue/add';
9
+ export class QueueRpcError extends Error {
10
+ readonly code:string;readonly attempted:boolean;
11
+ constructor(code:string,attempted=false){super(code);this.code=code;this.attempted=attempted;}
12
+ }
13
+ /** Connect-only WS-over-Unix client. Never CLI queue, daemon start, resume or auth-file discovery. */
14
+ export class CodexUnixQueueRpc {
15
+ private readonly path:string;
16
+ private readonly timeout:number;
17
+ constructor(options:{socketPath:string;timeoutMs?:number}){
18
+ if(!isAbsolute(options.socketPath)||options.socketPath.length>100||/[:?#%\\\u0000-\u0020]/.test(options.socketPath))throw new QueueRpcError('INVALID_SOCKET_PATH');
19
+ this.path=resolve(options.socketPath);this.timeout=options.timeoutMs??3000;
20
+ if(!Number.isSafeInteger(this.timeout)||this.timeout<1||this.timeout>10000)throw new QueueRpcError('INVALID_TIMEOUT');
21
+ }
22
+ private endpoint(){
23
+ const uid=process.getuid?.();
24
+ const privateParent=(path:string)=>{
25
+ const parent=dirname(path),directory=lstatSync(parent);
26
+ if(!directory.isDirectory()||directory.isSymbolicLink()||directory.uid!==uid||(directory.mode&0o077)!==0||realpathSync(parent)!==parent)throw new QueueRpcError('UNSAFE_SOCKET');
27
+ };
28
+ privateParent(this.path);
29
+ const alias=lstatSync(this.path);
30
+ if(alias.uid!==uid)throw new QueueRpcError('UNSAFE_SOCKET');
31
+ // The managed daemon's official control path is a user-owned symlink in a
32
+ // private directory. Allow one hop only, to a separately checked private socket.
33
+ const path=alias.isSymbolicLink()?resolve(dirname(this.path),readlinkSync(this.path)):this.path;
34
+ if(path.length>100||/[:?#%\\\u0000-\u0020]/.test(path))throw new QueueRpcError('UNSAFE_SOCKET');
35
+ privateParent(path);
36
+ const socket=lstatSync(path);
37
+ if(!socket.isSocket()||socket.isSymbolicLink()||socket.uid!==uid||(socket.mode&0o022)!==0||realpathSync(path)!==path)throw new QueueRpcError('UNSAFE_SOCKET');
38
+ return {path,epoch:`${alias.dev}:${alias.ino}:${path}:${socket.dev}:${socket.ino}`};
39
+ }
40
+ request(method:QueueMethod,params:unknown,options:{signal?:AbortSignal;beforeWrite?:()=>void;pin?:{daemonVersion:string;socketEpoch:string}}={}):Promise<unknown>{
41
+ // Opt-in probe/bootstrap pin. Does not admit a new tuple or attest Desktop.
42
+ options={...options,...(options.pin?{pin:{...options.pin}}:{})};const pin=options.pin,deadline=performance.now()+this.timeout;
43
+ if(pin&&(compareCodexVersions(pin.daemonVersion,pin.daemonVersion)!==0||typeof pin.socketEpoch!=='string'||!/^codex-initialize\/v1:[a-f0-9]{64}$/.test(pin.socketEpoch)))return Promise.reject(new QueueRpcError('INVALID_PIN'));
44
+ const epochObserver=pin?new CodexDaemonObserver({socketPath:this.path}):undefined;
45
+ const pinError=()=>{if(!pin)return undefined;if(options.signal?.aborted)return 'CANCELLED';if(performance.now()>=deadline)return 'TIMEOUT';try{if(epochObserver!.socketEpoch(options.signal??new AbortController().signal)!==pin.socketEpoch)return 'SOCKET_CHANGED';}catch{return 'SOCKET_CHANGED';}return performance.now()>=deadline?'TIMEOUT':undefined;};
46
+ if(pin)try{params=structuredClone(params);}catch{return Promise.reject(new QueueRpcError('REQUEST_LIMIT'));}
47
+ const initialPinError=pinError();if(initialPinError)return Promise.reject(new QueueRpcError(initialPinError));
48
+ if(!['thread/read','thread/loaded/list','thread/queue/list','thread/queue/add'].includes(method))return Promise.reject(new QueueRpcError('METHOD_NOT_ALLOWED'));
49
+ let endpoint:ReturnType<CodexUnixQueueRpc['endpoint']>;
50
+ try{endpoint=this.endpoint();}catch{return Promise.reject(new QueueRpcError('DAEMON_UNAVAILABLE'));}
51
+ if(options.signal?.aborted)return Promise.reject(new QueueRpcError('CANCELLED'));
52
+ return new Promise((resolveRequest,reject)=>{
53
+ let ws:WsConnection|undefined,timer:ReturnType<typeof setTimeout>|undefined,done=false,attempted=false,initialized=false,messages=0;
54
+ const initializeId=randomUUID(),requestId=randomUUID();
55
+ const finish=(error?:string,result?:unknown)=>{
56
+ if(done)return;done=true;clearTimeout(timer);options.signal?.removeEventListener('abort',abort);
57
+ // terminate during CONNECTING may emit an asynchronous error: keep it handled.
58
+ ws?.on('error',()=>{});ws?.removeAllListeners('message');ws?.terminate();
59
+ if(error)reject(new QueueRpcError(error,attempted));else resolveRequest(result);
60
+ };
61
+ const abort=()=>finish('CANCELLED');
62
+ options.signal?.addEventListener('abort',abort,{once:true});
63
+ try{
64
+ ws=new (webSocket())('ws+unix://'+endpoint.path+':/',{createConnection:()=>createConnection(endpoint.path),maxPayload:32768,perMessageDeflate:false,followRedirects:false,handshakeTimeout:this.timeout});
65
+ timer=setTimeout(()=>finish('TIMEOUT'),this.timeout);
66
+ ws.on('open',()=>{
67
+ try{const error=pinError();if(error){finish(error);return;}if(this.endpoint().epoch!==endpoint.epoch||options.signal?.aborted){finish('SOCKET_CHANGED');return;}
68
+ ws!.send(JSON.stringify({id:initializeId,method:'initialize',params:{clientInfo:{name:'agent_fleet_queue_bridge',title:'Fleet queue bridge',version:'1'},capabilities:{experimentalApi:true}}}));
69
+ }catch{finish('INITIALIZE_FAILED');}
70
+ });
71
+ ws.on('message',(data:Buffer,isBinary:boolean)=>{
72
+ if(done)return;if(++messages>256||!Buffer.isBuffer(data)||data.length>32768){finish('RESPONSE_LIMIT');return;}
73
+ if(isBinary){finish('INVALID_RESPONSE');return;}
74
+ let response:any;try{response=JSON.parse(new TextDecoder('utf-8',{fatal:true}).decode(data));}catch{finish('INVALID_JSON');return;}
75
+ if(!response||typeof response!=='object'||Array.isArray(response)){finish('INVALID_RESPONSE');return;}
76
+ if(Object.hasOwn(response,'method'))return;
77
+ if(!initialized&&response.id===initializeId){
78
+ if(Object.hasOwn(response,'error')||!response.result||typeof response.result.userAgent!=='string'){finish('INITIALIZE_REJECTED');return;}
79
+ if(pin){if(codexDaemonVersionFromUserAgent(response.result.userAgent)!==pin.daemonVersion){finish('VERSION_CHANGED');return;}const error=pinError();if(error){finish(error);return;}}
80
+ initialized=true;
81
+ try{
82
+ ws!.send(JSON.stringify({method:'initialized',params:{}}));
83
+ if(this.endpoint().epoch!==endpoint.epoch||options.signal?.aborted){finish('SOCKET_CHANGED');return;}
84
+ const packet=JSON.stringify({id:requestId,method,params});if(Buffer.byteLength(packet)>16384){finish('REQUEST_LIMIT');return;}
85
+ options.beforeWrite?.();
86
+ if(options.signal?.aborted){finish('CANCELLED');return;}
87
+ if(this.endpoint().epoch!==endpoint.epoch){finish('SOCKET_CHANGED');return;}
88
+ const error=pinError();if(error){finish(error);return;}
89
+ attempted=true;ws!.send(packet);
90
+ }catch{finish('PREWRITE_OR_SEND_FAILED');}
91
+ }else if(initialized&&response.id===requestId){
92
+ const error=pinError();if(error){finish(error);return;}
93
+ if(Object.hasOwn(response,'error'))finish('RPC_REJECTED');else if(!Object.hasOwn(response,'result'))finish('INVALID_RESPONSE');else finish(undefined,response.result);
94
+ }
95
+ // Notifications/server requests are never answered with automatic approvals.
96
+ });
97
+ ws.on('error',()=>finish('CONNECTION_ERROR'));ws.on('close',()=>finish('CONNECTION_CLOSED'));
98
+ }catch{finish('CONNECTION_ERROR');}
99
+ });
100
+ }
101
+ }