@chankov/agent-fleet 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (861) hide show
  1. package/.pi/agent-fleet/hooks/coms-stop-hook.mjs +53 -13
  2. package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
  3. package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
  4. package/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +4 -0
  5. package/.pi/agent-fleet/scripts/fleet.ts +13 -17
  6. package/.pi/agent-fleet/scripts/flow.ts +2 -2
  7. package/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
  8. package/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
  9. package/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
  10. package/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
  11. package/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
  12. package/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
  13. package/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +20 -13
  14. package/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
  15. package/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
  16. package/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
  17. package/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
  18. package/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +23 -13
  19. package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +100 -14
  20. package/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +1 -1
  21. package/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
  22. package/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +9 -3
  23. package/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +32 -16
  24. package/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +41 -21
  25. package/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +21 -0
  26. package/.pi/agent-fleet/scripts/lib/fleet-command.ts +4 -8
  27. package/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +2 -1
  28. package/.pi/agent-fleet/scripts/lib/team-project.ts +0 -2
  29. package/.pi/agent-fleet/scripts/team-up.ts +5 -12
  30. package/.pi/agent-fleet/scripts/workflows/lib/git.ts +9 -0
  31. package/.pi/agent-fleet/scripts/workflows/lib/quality.ts +17 -4
  32. package/.pi/agents/model-profiles.yaml +0 -2
  33. package/.pi/harnesses/agent-hub/README.md +116 -67
  34. package/.pi/harnesses/agent-hub/capability-packs.ts +7 -4
  35. package/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
  36. package/.pi/harnesses/agent-hub/commands/context.ts +0 -4
  37. package/.pi/harnesses/agent-hub/commands/recover.ts +2 -1
  38. package/.pi/harnesses/agent-hub/config/agents.ts +3 -1
  39. package/.pi/harnesses/agent-hub/config/model-profiles.ts +3 -0
  40. package/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +14 -1
  41. package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +17 -0
  42. package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +3 -1
  43. package/.pi/harnesses/agent-hub/dispatch-native-types.ts +4 -0
  44. package/.pi/harnesses/agent-hub/dispatch-native.ts +9 -3
  45. package/.pi/harnesses/agent-hub/drift-watchdog.js +5 -10
  46. package/.pi/harnesses/agent-hub/execution-trace.ts +1 -1
  47. package/.pi/harnesses/agent-hub/filesystem-tool.ts +1 -1
  48. package/.pi/harnesses/agent-hub/footer.ts +2 -3
  49. package/.pi/harnesses/agent-hub/helpers.ts +4 -5
  50. package/.pi/harnesses/agent-hub/history-projection.ts +1 -1
  51. package/.pi/harnesses/agent-hub/index.ts +213 -196
  52. package/.pi/harnesses/agent-hub/input/shortcuts.ts +0 -7
  53. package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +0 -2
  54. package/.pi/harnesses/agent-hub/no-progress.ts +14 -9
  55. package/.pi/harnesses/agent-hub/operator-current-state.ts +5 -1
  56. package/.pi/harnesses/agent-hub/package.json +1 -1
  57. package/.pi/harnesses/agent-hub/policy/roster.ts +12 -3
  58. package/.pi/harnesses/agent-hub/policy/work-mode.ts +10 -49
  59. package/.pi/harnesses/agent-hub/poll-command.ts +12 -4
  60. package/.pi/harnesses/agent-hub/proactive-snapshot.ts +12 -4
  61. package/.pi/harnesses/agent-hub/process-obligations.ts +42 -9
  62. package/.pi/harnesses/agent-hub/prompts/context.ts +17 -0
  63. package/.pi/harnesses/agent-hub/prompts/fragments.ts +9 -1
  64. package/.pi/harnesses/agent-hub/prompts/session-start.ts +2 -3
  65. package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +25 -8
  66. package/.pi/harnesses/agent-hub/provider-semaphore.js +5 -0
  67. package/.pi/harnesses/agent-hub/review-continuity.ts +5 -2
  68. package/.pi/harnesses/agent-hub/review-reuse.ts +2 -1
  69. package/.pi/harnesses/agent-hub/run-budget.js +22 -2
  70. package/.pi/harnesses/agent-hub/scope-gate.js +38 -0
  71. package/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
  72. package/.pi/harnesses/agent-hub/task-brief.ts +98 -0
  73. package/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +4 -0
  74. package/.pi/harnesses/agent-hub/tool-catalog-state.ts +5 -3
  75. package/.pi/harnesses/agent-hub/tools/action-executors.ts +5 -7
  76. package/.pi/harnesses/agent-hub/tools/context.ts +2 -0
  77. package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +2 -1
  78. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +184 -33
  79. package/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
  80. package/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
  81. package/.pi/harnesses/agent-hub/tools/run-flow.ts +41 -10
  82. package/.pi/harnesses/agent-hub/tools/team-adjust.ts +1 -1
  83. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +12 -2
  84. package/.pi/harnesses/agent-hub/work-mode.ts +44 -49
  85. package/.pi/harnesses/agent-hub/write-isolation.ts +53 -8
  86. package/.pi/harnesses/coms/package.json +1 -1
  87. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  88. package/.pi/harnesses/lib/codex-compat.ts +97 -0
  89. package/.pi/harnesses/lib/codex-contract.ts +259 -0
  90. package/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
  91. package/.pi/harnesses/lib/coms-core.ts +8 -4
  92. package/.pi/harnesses/lib/context-budget-child-prompt.ts +1 -1
  93. package/.pi/harnesses/lib/context-budget-hub-prompt.ts +6 -3
  94. package/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
  95. package/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
  96. package/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
  97. package/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
  98. package/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
  99. package/.pi/harnesses/lib/fleet-connection-control.ts +20 -3
  100. package/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
  101. package/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
  102. package/.pi/harnesses/lib/fleet-notification-validation.ts +80 -25
  103. package/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
  104. package/.versions/2.2.0/.pi/agent-fleet/hermes/README.md +347 -0
  105. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  106. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  107. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  108. package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  109. package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  110. package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  111. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  112. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  113. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  114. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  115. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  116. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  117. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  118. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  119. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  120. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  121. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  122. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  123. package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  124. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  125. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  126. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  127. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  128. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  129. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  130. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  131. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  132. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  133. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  134. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  135. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  136. package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  137. package/.versions/2.2.0/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  138. package/.versions/2.2.0/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
  139. package/.versions/2.2.0/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  140. package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
  141. package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
  142. package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
  143. package/.versions/2.2.0/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
  144. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
  145. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
  146. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
  147. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
  148. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
  149. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
  150. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
  151. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
  152. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
  153. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
  154. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
  155. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
  156. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
  157. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
  158. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
  159. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
  160. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
  161. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
  162. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
  163. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
  164. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
  165. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
  166. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
  167. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
  168. package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
  169. package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
  170. package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
  171. package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet.ts +244 -0
  172. package/.versions/2.2.0/.pi/agent-fleet/scripts/flow.ts +166 -0
  173. package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  174. package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  175. package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  176. package/.versions/2.2.0/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  177. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
  178. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
  179. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
  180. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
  181. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
  182. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
  183. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
  184. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
  185. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
  186. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
  187. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
  188. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
  189. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
  190. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  191. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  192. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
  193. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
  194. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
  195. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
  196. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
  197. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
  198. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
  199. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
  200. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
  201. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
  202. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
  203. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
  204. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
  205. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
  206. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
  207. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
  208. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
  209. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
  210. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
  211. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
  212. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
  213. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
  214. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
  215. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
  216. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
  217. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
  218. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
  219. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  220. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  221. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  222. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  223. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  224. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  225. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  226. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  227. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  228. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  229. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
  230. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  231. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  232. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
  233. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  234. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
  235. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  236. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
  237. package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
  238. package/.versions/2.2.0/.pi/agent-fleet/scripts/package-lock.json +57 -0
  239. package/.versions/2.2.0/.pi/agent-fleet/scripts/package.json +10 -0
  240. package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  241. package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
  242. package/.versions/2.2.0/.pi/agent-fleet/scripts/pi-session.ts +9 -0
  243. package/.versions/2.2.0/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
  244. package/.versions/2.2.0/.pi/agent-fleet/scripts/team-up.ts +378 -0
  245. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
  246. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  247. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  248. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
  249. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  250. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  251. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
  252. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
  253. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  254. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  255. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  256. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
  257. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  258. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  259. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
  260. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
  261. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
  262. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
  263. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
  264. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  265. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
  266. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
  267. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  268. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  269. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  270. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  271. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  272. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  273. package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
  274. package/.versions/2.2.0/.pi/agents/dispatch-policy.yaml +32 -0
  275. package/.versions/2.2.0/.pi/agents/model-profiles.yaml +132 -0
  276. package/.versions/2.2.0/.pi/agents/peers.yaml +147 -0
  277. package/.versions/2.2.0/.pi/agents/teams.yaml +41 -0
  278. package/.versions/2.2.0/.pi/agents/voices.yaml +13 -0
  279. package/.versions/2.2.0/.pi/damage-control-rules.yaml +297 -0
  280. package/.versions/2.2.0/.pi/extensions/btw/README.md +120 -0
  281. package/.versions/2.2.0/.pi/extensions/btw/index.ts +916 -0
  282. package/.versions/2.2.0/.pi/extensions/btw/package.json +6 -0
  283. package/.versions/2.2.0/.pi/extensions/btw/state.js +179 -0
  284. package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  285. package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  286. package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  287. package/.versions/2.2.0/.pi/extensions/compact-and-continue/README.md +42 -0
  288. package/.versions/2.2.0/.pi/extensions/compact-and-continue/index.ts +136 -0
  289. package/.versions/2.2.0/.pi/extensions/compact-and-continue/package.json +6 -0
  290. package/.versions/2.2.0/.pi/extensions/mcp-bridge/README.md +46 -0
  291. package/.versions/2.2.0/.pi/extensions/mcp-bridge/index.ts +206 -0
  292. package/.versions/2.2.0/.pi/extensions/mcp-bridge/package.json +6 -0
  293. package/.versions/2.2.0/.pi/extensions/package-lock.json +1175 -0
  294. package/.versions/2.2.0/.pi/extensions/package.json +9 -0
  295. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/README.md +224 -0
  296. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/config.ts +199 -0
  297. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  298. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
  299. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/package.json +6 -0
  300. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  301. package/.versions/2.2.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  302. package/.versions/2.2.0/.pi/harnesses/agent-hub/README.md +1633 -0
  303. package/.versions/2.2.0/.pi/harnesses/agent-hub/acceptance.ts +204 -0
  304. package/.versions/2.2.0/.pi/harnesses/agent-hub/access-approval.ts +266 -0
  305. package/.versions/2.2.0/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
  306. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
  307. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
  308. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
  309. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
  310. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
  311. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
  312. package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
  313. package/.versions/2.2.0/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
  314. package/.versions/2.2.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
  315. package/.versions/2.2.0/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
  316. package/.versions/2.2.0/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
  317. package/.versions/2.2.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  318. package/.versions/2.2.0/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
  319. package/.versions/2.2.0/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
  320. package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  321. package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
  322. package/.versions/2.2.0/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
  323. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  324. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  325. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  326. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  327. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  328. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  329. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  330. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  331. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  332. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  333. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  334. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
  335. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  336. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  337. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/config.ts +9 -0
  338. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  339. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context.ts +43 -0
  340. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  341. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  342. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  343. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  344. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  345. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  346. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/recover.ts +62 -0
  347. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  348. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
  349. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
  350. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  351. package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  352. package/.versions/2.2.0/.pi/harnesses/agent-hub/config/agents.ts +183 -0
  353. package/.versions/2.2.0/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
  354. package/.versions/2.2.0/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
  355. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  356. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
  357. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
  358. package/.versions/2.2.0/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  359. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  360. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
  361. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
  362. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
  363. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
  364. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
  365. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
  366. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
  367. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
  368. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
  369. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
  370. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
  371. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
  372. package/.versions/2.2.0/.pi/harnesses/agent-hub/context-window.js +108 -0
  373. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
  374. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
  375. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
  376. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
  377. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
  378. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
  379. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
  380. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
  381. package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
  382. package/.versions/2.2.0/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  383. package/.versions/2.2.0/.pi/harnesses/agent-hub/delegate.ts +478 -0
  384. package/.versions/2.2.0/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
  385. package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
  386. package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
  387. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
  388. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  389. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
  390. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
  391. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
  392. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
  393. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
  394. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  395. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
  396. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
  397. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
  398. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
  399. package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
  400. package/.versions/2.2.0/.pi/harnesses/agent-hub/docs-lane.js +123 -0
  401. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
  402. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
  403. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
  404. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
  405. package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
  406. package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
  407. package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  408. package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
  409. package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
  410. package/.versions/2.2.0/.pi/harnesses/agent-hub/external-blocker.js +92 -0
  411. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
  412. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
  413. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
  414. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
  415. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
  416. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
  417. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
  418. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
  419. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
  420. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
  421. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
  422. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
  423. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
  424. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
  425. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
  426. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
  427. package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
  428. package/.versions/2.2.0/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
  429. package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
  430. package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
  431. package/.versions/2.2.0/.pi/harnesses/agent-hub/footer.ts +29 -0
  432. package/.versions/2.2.0/.pi/harnesses/agent-hub/helpers.ts +269 -0
  433. package/.versions/2.2.0/.pi/harnesses/agent-hub/history-projection.ts +116 -0
  434. package/.versions/2.2.0/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
  435. package/.versions/2.2.0/.pi/harnesses/agent-hub/index.ts +2722 -0
  436. package/.versions/2.2.0/.pi/harnesses/agent-hub/input/completions.ts +82 -0
  437. package/.versions/2.2.0/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
  438. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
  439. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  440. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  441. package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
  442. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  443. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  444. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  445. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  446. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  447. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  448. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  449. package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  450. package/.versions/2.2.0/.pi/harnesses/agent-hub/no-progress.ts +627 -0
  451. package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-current-state.ts +57 -0
  452. package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
  453. package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
  454. package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
  455. package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
  456. package/.versions/2.2.0/.pi/harnesses/agent-hub/package.json +7 -0
  457. package/.versions/2.2.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  458. package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
  459. package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
  460. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  461. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  462. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  463. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
  464. package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/work-mode.ts +103 -0
  465. package/.versions/2.2.0/.pi/harnesses/agent-hub/poll-command.ts +184 -0
  466. package/.versions/2.2.0/.pi/harnesses/agent-hub/presentation.ts +54 -0
  467. package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
  468. package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
  469. package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
  470. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
  471. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
  472. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
  473. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
  474. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
  475. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
  476. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
  477. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
  478. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
  479. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
  480. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
  481. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
  482. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
  483. package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
  484. package/.versions/2.2.0/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
  485. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
  486. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
  487. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
  488. package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
  489. package/.versions/2.2.0/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
  490. package/.versions/2.2.0/.pi/harnesses/agent-hub/reconcile.ts +26 -0
  491. package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
  492. package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-state.ts +104 -0
  493. package/.versions/2.2.0/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
  494. package/.versions/2.2.0/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
  495. package/.versions/2.2.0/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  496. package/.versions/2.2.0/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
  497. package/.versions/2.2.0/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
  498. package/.versions/2.2.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  499. package/.versions/2.2.0/.pi/harnesses/agent-hub/return-contract.js +371 -0
  500. package/.versions/2.2.0/.pi/harnesses/agent-hub/return-extract.js +77 -0
  501. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-closure.ts +43 -0
  502. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
  503. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-findings.js +96 -0
  504. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
  505. package/.versions/2.2.0/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
  506. package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
  507. package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
  508. package/.versions/2.2.0/.pi/harnesses/agent-hub/run-budget.js +362 -0
  509. package/.versions/2.2.0/.pi/harnesses/agent-hub/run-namespace.js +93 -0
  510. package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
  511. package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
  512. package/.versions/2.2.0/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
  513. package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-gate.js +271 -0
  514. package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
  515. package/.versions/2.2.0/.pi/harnesses/agent-hub/session-audit.ts +331 -0
  516. package/.versions/2.2.0/.pi/harnesses/agent-hub/session-health.js +110 -0
  517. package/.versions/2.2.0/.pi/harnesses/agent-hub/session-start.ts +42 -0
  518. package/.versions/2.2.0/.pi/harnesses/agent-hub/spawn.ts +702 -0
  519. package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
  520. package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
  521. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
  522. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
  523. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-report.ts +275 -0
  524. package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
  525. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-brief.ts +98 -0
  526. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
  527. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
  528. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
  529. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
  530. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
  531. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
  532. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
  533. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
  534. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
  535. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
  536. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
  537. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
  538. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
  539. package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
  540. package/.versions/2.2.0/.pi/harnesses/agent-hub/timeline.ts +72 -0
  541. package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
  542. package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
  543. package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
  544. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
  545. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
  546. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
  547. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  548. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/context.ts +149 -0
  549. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
  550. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +928 -0
  551. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
  552. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  553. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
  554. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
  555. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
  556. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
  557. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
  558. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
  559. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
  560. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  561. package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
  562. package/.versions/2.2.0/.pi/harnesses/agent-hub/tsconfig.json +22 -0
  563. package/.versions/2.2.0/.pi/harnesses/agent-hub/types.ts +66 -0
  564. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
  565. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
  566. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
  567. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
  568. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
  569. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  570. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
  571. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
  572. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  573. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  574. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  575. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  576. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
  577. package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
  578. package/.versions/2.2.0/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
  579. package/.versions/2.2.0/.pi/harnesses/agent-hub/version.ts +42 -0
  580. package/.versions/2.2.0/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
  581. package/.versions/2.2.0/.pi/harnesses/agent-hub/work-mode.ts +183 -0
  582. package/.versions/2.2.0/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
  583. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/README.md +59 -0
  584. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/index.ts +571 -0
  585. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/questions.ts +206 -0
  586. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  587. package/.versions/2.2.0/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
  588. package/.versions/2.2.0/.pi/harnesses/coms/README.md +105 -0
  589. package/.versions/2.2.0/.pi/harnesses/coms/index.ts +308 -0
  590. package/.versions/2.2.0/.pi/harnesses/coms/package.json +7 -0
  591. package/.versions/2.2.0/.pi/harnesses/coms/version.ts +42 -0
  592. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/README.md +161 -0
  593. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/index.ts +659 -0
  594. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/package.json +7 -0
  595. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
  596. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
  597. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
  598. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
  599. package/.versions/2.2.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
  600. package/.versions/2.2.0/.pi/harnesses/lib/approval-wait.ts +17 -0
  601. package/.versions/2.2.0/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
  602. package/.versions/2.2.0/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  603. package/.versions/2.2.0/.pi/harnesses/lib/clarification-policy.ts +9 -0
  604. package/.versions/2.2.0/.pi/harnesses/lib/codex-compat.ts +97 -0
  605. package/.versions/2.2.0/.pi/harnesses/lib/codex-contract.ts +259 -0
  606. package/.versions/2.2.0/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
  607. package/.versions/2.2.0/.pi/harnesses/lib/coms-core-io.ts +422 -0
  608. package/.versions/2.2.0/.pi/harnesses/lib/coms-core.ts +738 -0
  609. package/.versions/2.2.0/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
  610. package/.versions/2.2.0/.pi/harnesses/lib/coms-observation.ts +74 -0
  611. package/.versions/2.2.0/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
  612. package/.versions/2.2.0/.pi/harnesses/lib/coms-response-read.ts +107 -0
  613. package/.versions/2.2.0/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
  614. package/.versions/2.2.0/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
  615. package/.versions/2.2.0/.pi/harnesses/lib/context-budget-view.ts +112 -0
  616. package/.versions/2.2.0/.pi/harnesses/lib/context-budget.ts +114 -0
  617. package/.versions/2.2.0/.pi/harnesses/lib/context-compaction-policy.js +35 -0
  618. package/.versions/2.2.0/.pi/harnesses/lib/damage-action-hash.ts +28 -0
  619. package/.versions/2.2.0/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
  620. package/.versions/2.2.0/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
  621. package/.versions/2.2.0/.pi/harnesses/lib/damage-control-shared.ts +276 -0
  622. package/.versions/2.2.0/.pi/harnesses/lib/damage-guard-port.ts +25 -0
  623. package/.versions/2.2.0/.pi/harnesses/lib/damage-policy.ts +35 -0
  624. package/.versions/2.2.0/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
  625. package/.versions/2.2.0/.pi/harnesses/lib/damage-result-view.ts +16 -0
  626. package/.versions/2.2.0/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
  627. package/.versions/2.2.0/.pi/harnesses/lib/exact-permission-port.ts +38 -0
  628. package/.versions/2.2.0/.pi/harnesses/lib/execution-trace.ts +45 -0
  629. package/.versions/2.2.0/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  630. package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  631. package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  632. package/.versions/2.2.0/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
  633. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
  634. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
  635. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
  636. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
  637. package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
  638. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
  639. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
  640. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
  641. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
  642. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
  643. package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/view.ts +338 -0
  644. package/.versions/2.2.0/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
  645. package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  646. package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
  647. package/.versions/2.2.0/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
  648. package/.versions/2.2.0/.pi/harnesses/lib/fleet-event-source.ts +21 -0
  649. package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
  650. package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
  651. package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
  652. package/.versions/2.2.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  653. package/.versions/2.2.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
  654. package/.versions/2.2.0/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
  655. package/.versions/2.2.0/.pi/harnesses/lib/fleet-read-model.ts +609 -0
  656. package/.versions/2.2.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
  657. package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
  658. package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
  659. package/.versions/2.2.0/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
  660. package/.versions/2.2.0/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  661. package/.versions/2.2.0/.pi/harnesses/lib/herdr-client.ts +472 -0
  662. package/.versions/2.2.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
  663. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  664. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  665. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  666. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  667. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  668. package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  669. package/.versions/2.2.0/.pi/harnesses/lib/identical-dialog.ts +27 -0
  670. package/.versions/2.2.0/.pi/harnesses/lib/installation-state.js +62 -0
  671. package/.versions/2.2.0/.pi/harnesses/lib/peer-target.ts +24 -0
  672. package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.js +117 -0
  673. package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.ts +32 -0
  674. package/.versions/2.2.0/.pi/harnesses/lib/process-shared.ts +9 -0
  675. package/.versions/2.2.0/.pi/harnesses/lib/resource-closure.js +26 -0
  676. package/.versions/2.2.0/.pi/harnesses/lib/safe-source-read.js +29 -0
  677. package/.versions/2.2.0/.pi/harnesses/lib/semantic-approval.ts +80 -0
  678. package/.versions/2.2.0/.pi/harnesses/lib/session-target.ts +62 -0
  679. package/.versions/2.2.0/.pi/harnesses/lib/spawned-peers.js +191 -0
  680. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-agentic.js +15 -0
  681. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
  682. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
  683. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
  684. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-json.js +37 -0
  685. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-loader.js +53 -0
  686. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-proactive.js +68 -0
  687. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-triage.js +42 -0
  688. package/.versions/2.2.0/.pi/harnesses/lib/system1/config-v2.js +112 -0
  689. package/.versions/2.2.0/.pi/harnesses/lib/system1/config.js +50 -0
  690. package/.versions/2.2.0/.pi/harnesses/lib/system1/contracts.ts +154 -0
  691. package/.versions/2.2.0/.pi/harnesses/lib/system1/demo.ts +95 -0
  692. package/.versions/2.2.0/.pi/harnesses/lib/system1/jev.ts +503 -0
  693. package/.versions/2.2.0/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
  694. package/.versions/2.2.0/.pi/harnesses/lib/system1/selection.js +11 -0
  695. package/.versions/2.2.0/.pi/harnesses/lib/system1/service.ts +245 -0
  696. package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
  697. package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
  698. package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
  699. package/.versions/2.2.0/.pi/harnesses/lib/target-capabilities.js +7 -0
  700. package/.versions/2.2.0/.pi/harnesses/lib/update-check.ts +227 -0
  701. package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.js +115 -0
  702. package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.ts +22 -0
  703. package/.versions/2.2.0/.pi/harnesses/package-lock.json +2121 -0
  704. package/.versions/2.2.0/.pi/harnesses/package.json +13 -0
  705. package/.versions/2.2.0/.pi/prompts/af-build.md +27 -0
  706. package/.versions/2.2.0/.pi/prompts/af-code-simplify.md +22 -0
  707. package/.versions/2.2.0/.pi/prompts/af-constraints.md +31 -0
  708. package/.versions/2.2.0/.pi/prompts/af-plan.md +17 -0
  709. package/.versions/2.2.0/.pi/prompts/af-review.md +16 -0
  710. package/.versions/2.2.0/.pi/prompts/af-set-hermes-telegram.md +15 -0
  711. package/.versions/2.2.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  712. package/.versions/2.2.0/.pi/prompts/af-setup-rules.md +20 -0
  713. package/.versions/2.2.0/.pi/prompts/af-ship.md +17 -0
  714. package/.versions/2.2.0/.pi/prompts/af-spec.md +15 -0
  715. package/.versions/2.2.0/.pi/prompts/af-test.md +19 -0
  716. package/.versions/2.2.0/.pi/skills/bowser/SKILL.md +145 -0
  717. package/.versions/2.2.0/.version +1 -0
  718. package/.versions/2.2.0/agents/architect.md +24 -0
  719. package/.versions/2.2.0/agents/bowser.md +28 -0
  720. package/.versions/2.2.0/agents/builder.md +55 -0
  721. package/.versions/2.2.0/agents/code-reviewer.md +209 -0
  722. package/.versions/2.2.0/agents/deep-researcher.md +32 -0
  723. package/.versions/2.2.0/agents/documenter.md +22 -0
  724. package/.versions/2.2.0/agents/plan-reviewer.md +83 -0
  725. package/.versions/2.2.0/agents/planner.md +107 -0
  726. package/.versions/2.2.0/agents/releaser.md +24 -0
  727. package/.versions/2.2.0/agents/researcher.md +30 -0
  728. package/.versions/2.2.0/agents/security-auditor.md +167 -0
  729. package/.versions/2.2.0/agents/test-engineer.md +153 -0
  730. package/.versions/2.2.0/agents/web-debugger.md +44 -0
  731. package/.versions/2.2.0/agents/web-performance-auditor.md +194 -0
  732. package/.versions/2.2.0/bin/catalog/harness-runtime-closure.json +85 -0
  733. package/.versions/2.2.0/docs/ARCHITECTURE.md +1291 -0
  734. package/.versions/2.2.0/docs/agent-fleet-setup.md +1161 -0
  735. package/.versions/2.2.0/docs/claude-code-coms-bridge.md +147 -0
  736. package/.versions/2.2.0/docs/codex-local-mcp.md +520 -0
  737. package/.versions/2.2.0/docs/codex-session-bridge.md +44 -0
  738. package/.versions/2.2.0/docs/codex-setup.md +183 -0
  739. package/.versions/2.2.0/docs/coms-hermes-bridge.md +188 -0
  740. package/.versions/2.2.0/docs/fleet-native-voice.md +151 -0
  741. package/.versions/2.2.0/docs/getting-started.md +126 -0
  742. package/.versions/2.2.0/docs/npm-install.md +535 -0
  743. package/.versions/2.2.0/docs/pi-extensions.md +450 -0
  744. package/.versions/2.2.0/docs/pi-setup.md +92 -0
  745. package/.versions/2.2.0/docs/skill-anatomy.md +150 -0
  746. package/.versions/2.2.0/install-manifest.json +3226 -0
  747. package/.versions/2.2.0/justfile +246 -0
  748. package/.versions/2.2.0/manifest-meta.json +1098 -0
  749. package/.versions/2.2.0/references/accessibility-checklist.md +160 -0
  750. package/.versions/2.2.0/references/communication-contract.md +26 -0
  751. package/.versions/2.2.0/references/definition-of-done.md +67 -0
  752. package/.versions/2.2.0/references/fleet-coordination-patterns.md +171 -0
  753. package/.versions/2.2.0/references/observability-checklist.md +92 -0
  754. package/.versions/2.2.0/references/orchestration-patterns.md +370 -0
  755. package/.versions/2.2.0/references/performance-checklist.md +236 -0
  756. package/.versions/2.2.0/references/prompting-patterns.md +380 -0
  757. package/.versions/2.2.0/references/security-checklist.md +245 -0
  758. package/.versions/2.2.0/references/testing-patterns.md +235 -0
  759. package/.versions/2.2.0/references/workflow-authoring.md +304 -0
  760. package/.versions/2.2.0/skills/_internal/grilling.md +59 -0
  761. package/.versions/2.2.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
  762. package/.versions/2.2.0/skills/code-review-and-quality/SKILL.md +396 -0
  763. package/.versions/2.2.0/skills/compound-learning/SKILL.md +137 -0
  764. package/.versions/2.2.0/skills/constraint-driven-development/SKILL.md +338 -0
  765. package/.versions/2.2.0/skills/constraint-driven-development/references/floor-guard.md +99 -0
  766. package/.versions/2.2.0/skills/context-engineering/SKILL.md +341 -0
  767. package/.versions/2.2.0/skills/deprecation-and-migration/SKILL.md +247 -0
  768. package/.versions/2.2.0/skills/designing-agents/SKILL.md +394 -0
  769. package/.versions/2.2.0/skills/designing-agents/pi-harness-authoring.md +222 -0
  770. package/.versions/2.2.0/skills/drafting-workflows/SKILL.md +143 -0
  771. package/.versions/2.2.0/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  772. package/.versions/2.2.0/skills/fleet-connect/SKILL.md +29 -0
  773. package/.versions/2.2.0/skills/fleet-connect.zip +0 -0
  774. package/.versions/2.2.0/skills/fleet-native-voice/SKILL.md +103 -0
  775. package/.versions/2.2.0/skills/fleet-native-voice/agents/openai.yaml +4 -0
  776. package/.versions/2.2.0/skills/fleet-native-voice.zip +0 -0
  777. package/.versions/2.2.0/skills/frontend-ui-engineering/SKILL.md +328 -0
  778. package/.versions/2.2.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
  779. package/.versions/2.2.0/skills/idea-refine/SKILL.md +182 -0
  780. package/.versions/2.2.0/skills/idea-refine/examples.md +238 -0
  781. package/.versions/2.2.0/skills/idea-refine/frameworks.md +99 -0
  782. package/.versions/2.2.0/skills/idea-refine/refinement-criteria.md +113 -0
  783. package/.versions/2.2.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
  784. package/.versions/2.2.0/skills/incremental-implementation/SKILL.md +353 -0
  785. package/.versions/2.2.0/skills/incremental-implementation.zip +0 -0
  786. package/.versions/2.2.0/skills/interview-me/SKILL.md +226 -0
  787. package/.versions/2.2.0/skills/orchestration-verification/SKILL.md +182 -0
  788. package/.versions/2.2.0/skills/peer-coms/SKILL.md +90 -0
  789. package/.versions/2.2.0/skills/performance-optimization/SKILL.md +496 -0
  790. package/.versions/2.2.0/skills/planning-and-task-breakdown/SKILL.md +318 -0
  791. package/.versions/2.2.0/skills/planning-and-task-breakdown.zip +0 -0
  792. package/.versions/2.2.0/skills/repository-ai-setup/SKILL.md +135 -0
  793. package/.versions/2.2.0/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
  794. package/.versions/2.2.0/skills/repository-ai-setup/references/apply-contract.md +74 -0
  795. package/.versions/2.2.0/skills/repository-ai-setup/references/provenance-template.md +16 -0
  796. package/.versions/2.2.0/skills/repository-ai-setup/references/setup-flow.md +108 -0
  797. package/.versions/2.2.0/skills/repository-ai-setup/references/verify-setup.md +20 -0
  798. package/.versions/2.2.0/skills/repository-ai-setup.zip +0 -0
  799. package/.versions/2.2.0/skills/security-and-hardening/SKILL.md +524 -0
  800. package/.versions/2.2.0/skills/spec-driven-development/SKILL.md +295 -0
  801. package/.versions/2.2.0/skills/spec-driven-development.zip +0 -0
  802. package/.versions/2.2.0/skills/using-agent-skills/SKILL.md +198 -0
  803. package/.versions/2.2.0/vendor/agent-skills-upstream/LICENSE +21 -0
  804. package/.versions/2.2.0/vendor/agent-skills-upstream/README.md +430 -0
  805. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  806. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  807. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  808. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  809. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  810. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  811. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  812. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  813. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  814. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  815. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  816. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  817. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  818. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  819. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  820. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  821. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  822. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  823. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  824. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  825. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  826. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  827. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  828. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  829. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  830. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  831. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  832. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  833. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  834. package/.versions/2.2.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  835. package/CHANGELOG.md +33 -0
  836. package/README.md +7 -10
  837. package/bin/lib/set-codex-mcp.js +1 -1
  838. package/bin/lib/validate-overrides.js +8 -1
  839. package/docs/ARCHITECTURE.md +122 -26
  840. package/docs/MIGRATION-agent-fleet.md +26 -5
  841. package/docs/agent-fleet-setup.md +44 -26
  842. package/docs/claude-code-coms-bridge.md +1 -1
  843. package/docs/codex-local-mcp.md +29 -12
  844. package/docs/codex-session-bridge.md +2 -2
  845. package/docs/codex-setup.md +1 -1
  846. package/docs/fleet-native-voice.md +10 -4
  847. package/docs/npm-install.md +1 -1
  848. package/docs/pi-extensions.md +13 -18
  849. package/docs/system1-agentic.md +1 -1
  850. package/docs/system1-file-discovery.md +2 -2
  851. package/docs/workflows.md +24 -1
  852. package/install-manifest.json +15 -28
  853. package/justfile +3 -4
  854. package/manifest-meta.json +13 -2
  855. package/package.json +4 -2
  856. package/skills/fleet-connect/SKILL.md +20 -16
  857. package/skills/fleet-connect.zip +0 -0
  858. package/skills/fleet-native-voice.zip +0 -0
  859. package/.pi/harnesses/agent-hub/commands/work-mode.ts +0 -29
  860. package/.pi/harnesses/agent-hub/work-mode-controls.ts +0 -56
  861. package/agents/orchestrator.md +0 -22
@@ -3,15 +3,16 @@ import { Type } from "@sinclair/typebox";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import {sessionRootsFromEnv,resolveSessionRoots,withSessionRoots,validateSessionRoots} from '../../lib/workspace-context.ts';
5
5
  import { mkdirSync, mkdtempSync, rmSync,realpathSync } from "node:fs";
6
- import { join } from "node:path";
6
+ import { isAbsolute, join, relative, sep } from "node:path";
7
7
  import { tmpdir } from "node:os";
8
8
  import { executeFlow, type HubScoutExecution } from "../../../agent-fleet/scripts/flow.ts";
9
+ import { insideRepository } from "../../../agent-fleet/scripts/workflows/lib/git.ts";
9
10
  import { createIsolatedWorkingTreeSnapshot, type IsolatedSnapshotManifest } from "../../../agent-fleet/scripts/workflows/lib/isolated-snapshot.ts";
10
11
  import type { ScoutWorkflowDeps } from "../../../agent-fleet/scripts/workflows/wf-scout.ts";
11
12
  import { worktreeRevision } from "../scope-gate.js";
12
13
  import { buildRuntimeResult } from "../acceptance.ts";
13
14
 
14
- export interface RunFlowParams { procedure: "scout"; request: string; invocation_id: string }
15
+ export interface RunFlowParams { procedure: "scout"; request: string; invocation_id: string; repo?: string }
15
16
  export interface HubFlowBudgetReservation { charged: boolean; operation: "research"; owner: "hub"; refusal?: string }
16
17
  export interface RunFlowDeps {
17
18
  sessionDir(): string | null;
@@ -25,6 +26,29 @@ export interface RunFlowDeps {
25
26
  scoutAgent?: ScoutWorkflowDeps["agent"];
26
27
  worktreeRevision?: typeof worktreeRevision;
27
28
  buildRuntimeResult?: typeof buildRuntimeResult;
29
+ /** Nested repositories the task already uses; named in the refusal when `repo` is missing. */
30
+ nestedRepositories?(): readonly string[];
31
+ }
32
+
33
+ type SessionRoots = ReturnType<typeof resolveSessionRoots>;
34
+ /** D9: at a workspace root that is not a repository, scout works in exactly one nested repository the caller names. */
35
+ function nestedTarget(roots: SessionRoots | undefined, cwd: string, repo: string | undefined, known: (() => readonly string[]) | undefined): { binding?: SessionRoots } | { refusal: string } {
36
+ if (repo === undefined) {
37
+ if (roots?.mode === "targeted" || insideRepository(cwd)) return {};
38
+ const list = known?.() ?? [];
39
+ return { refusal: `The workspace root is not a Git repository; pass repo: with the nested repository to scout${list.length ? ` (this task uses ${list.join(", ")})` : ""}.` };
40
+ }
41
+ if (roots?.mode === "targeted") return { refusal: "repo is unavailable in a session already bound to a target checkout." };
42
+ if (insideRepository(cwd)) return { refusal: "repo applies only when the workspace root is not a Git repository." };
43
+ if (repo.length > 512) return { refusal: "repo must be at most 512 characters." };
44
+ const path = repo.trim().replaceAll("\\", "/").replace(/\/+$/, "");
45
+ if (!path || isAbsolute(path) || path.split("/").includes("..")) return { refusal: `repo must be a path inside the workspace: ${JSON.stringify(repo)}` };
46
+ let binding: SessionRoots;
47
+ try { binding = resolveSessionRoots(cwd, { worktree: path }); }
48
+ catch (error) { return { refusal: `repo ${JSON.stringify(repo)} is not a nested repository checkout: ${message(error)}` }; }
49
+ const fromRoot = relative(cwd, binding.executionRoot);
50
+ if (!fromRoot || fromRoot === ".." || fromRoot.startsWith(`..${sep}`) || isAbsolute(fromRoot)) return { refusal: `repo must lie inside the workspace: ${JSON.stringify(repo)}` };
51
+ return { binding };
28
52
  }
29
53
 
30
54
  interface StoredRun { promise: Promise<any>; controller: AbortController; request: string;scope:string }
@@ -43,17 +67,20 @@ export function registerRunFlow(pi: ExtensionAPI, deps: RunFlowDeps): void {
43
67
  let sessionEpoch=0;
44
68
  pi.on("session_shutdown", () => {sessionEpoch++;for (const run of runs.values()) run.controller.abort("session shutdown");runs.clear();activeId=null;});
45
69
  pi.registerTool({
46
- name: "run_flow", label: "Run Flow", description: "Run the read-only scout workflow in an isolated no-branch snapshot. Initial T13 surface; writable flows are unavailable.",
70
+ name: "run_flow", label: "Run Flow", description: "Run the read-only scout workflow in an isolated no-branch snapshot; writable flows are unavailable.",
47
71
  parameters: Type.Object({
48
72
  procedure: Type.Literal("scout"),
49
73
  request: Type.String({ minLength: 1, description: "Exact read-only reconnaissance question." }),
50
74
  invocation_id: Type.String({ minLength: 8, maxLength: 128, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]+$", description: "Stable idempotency key; duplicates return the existing run." }),
75
+ // Every workspace pays for this schema, so `repo` stays bare: the nested-workspace capsule
76
+ // line and the no-charge refusal at a non-Git root say when and how to pass it.
77
+ repo: Type.Optional(Type.String()),
51
78
  }, { additionalProperties: false }),
52
79
  execute(_toolCallId, raw, signal, onUpdate, ctx) {
53
80
  const params = raw as RunFlowParams;
54
81
  const epoch=sessionEpoch;
55
- let scope:string;
56
- try{const roots=sessionRootsFromEnv(),cwd=realpathSync(ctx.cwd||process.cwd());if(roots?.mode==='targeted'&&cwd!==roots.executionRoot)return Promise.resolve(failure('target-refused','flow_source_target_mismatch',false,false));scope=roots?.targetId??cwd;}catch{return Promise.resolve(failure('target-refused','flow_source_target_unavailable',false,false));}
82
+ let scope:string;let selected:SessionRoots|undefined;
83
+ try{const roots=sessionRootsFromEnv(),cwd=realpathSync(ctx.cwd||process.cwd());if(roots?.mode==='targeted'&&cwd!==roots.executionRoot)return Promise.resolve(failure('target-refused','flow_source_target_mismatch',false,false));const target=nestedTarget(roots,cwd,params.repo,deps.nestedRepositories);if('refusal' in target)return Promise.resolve(failure('target-refused',target.refusal,false,false));selected=target.binding;scope=selected?.targetId??roots?.targetId??cwd;}catch{return Promise.resolve(failure('target-refused','flow_source_target_unavailable',false,false));}
57
84
  const existing = runs.get(params.invocation_id);
58
85
  if (existing) {
59
86
  if (existing.request !== params.request || existing.scope!==scope) return Promise.resolve({ content: [{ type: "text", text: "Stale duplicate refused: invocation_id is already bound to different scout inputs; no budget charged." }], details: { status: "stale-duplicate", budgetCharged: false, executionStarted: false } });
@@ -73,11 +100,12 @@ export function registerRunFlow(pi: ExtensionAPI, deps: RunFlowDeps): void {
73
100
  try {
74
101
  const sessionDir = deps.sessionDir();
75
102
  if (!sessionDir) return failure("invalid-environment", "run_flow requires an active managed Hub session", false, false);
76
- const sourceCwd = ctx.cwd || process.cwd();
77
- const sourceBinding=sessionRootsFromEnv();if(sourceBinding?.mode==='targeted'&&realpathSync(sourceCwd)!==sourceBinding.executionRoot)throw Error('flow_source_target_mismatch');
103
+ // A named nested repository is the snapshot source; configuration still comes from the workspace root.
104
+ const workspaceCwd = ctx.cwd || process.cwd(), sourceCwd = selected?.executionRoot ?? workspaceCwd;
105
+ const sourceBinding=selected??sessionRootsFromEnv();if(sourceBinding?.mode==='targeted'&&realpathSync(sourceCwd)!==sourceBinding.executionRoot)throw Error('flow_source_target_mismatch');
78
106
  let config;
79
107
  try {
80
- config = deps.effectiveScoutConfig(sourceCwd);
108
+ config = deps.effectiveScoutConfig(selected ? workspaceCwd : sourceCwd);
81
109
  const allowedTools = new Set(["read", "grep", "find", "ls"]);
82
110
  if (!config.allowlisted || config.tools.length === 0 || config.tools.some(tool => !allowedTools.has(tool))) throw new Error("effective scout configuration is not allowlisted filesystem-read-only");
83
111
  } catch (error) { return failure("preflight-refused", error, false, false); }
@@ -88,7 +116,8 @@ export function registerRunFlow(pi: ExtensionAPI, deps: RunFlowDeps): void {
88
116
  snapshotRoot = realpathSync(mkdtempSync(join(tmpdir(), "agent-fleet-scout-snapshot-")));
89
117
  const workspace = join(snapshotRoot, "workspace"), manifestPath = join(artifactDir, "snapshot-manifest.json");
90
118
  let manifest: IsolatedSnapshotManifest;
91
- try { manifest = (deps.createSnapshot ?? createIsolatedWorkingTreeSnapshot)(sourceCwd, workspace, manifestPath); }
119
+ const createSnapshot = () => (deps.createSnapshot ?? createIsolatedWorkingTreeSnapshot)(sourceCwd, workspace, manifestPath);
120
+ try { manifest = selected ? withSessionRoots(selected, createSnapshot) : createSnapshot(); }
92
121
  catch (error) { return failure("snapshot-refused", error, false, false); }
93
122
  const snapshotBinding=sourceBinding?.mode==='targeted'?resolveSessionRoots(sourceBinding.workspaceRoot,{worktree:workspace}):undefined;
94
123
  let budget: HubFlowBudgetReservation;
@@ -118,7 +147,9 @@ export function registerRunFlow(pi: ExtensionAPI, deps: RunFlowDeps): void {
118
147
  });
119
148
  const obligations = deps.processObligations();
120
149
  const details = { status: result.status, runId, invocationId: params.invocation_id, procedure: "scout", budgetCharged: true, budgetOwner: "hub", budgetOperation: "research", executionStarted: true, flowAcceptance: { accepted: result.accepted, status: result.status, reason: result.reason ?? null }, parentAcceptance: { accepted: false, status: "not_accepted", assertionsProven: [], obligations }, runtimeResult, effectiveConfiguration: config, snapshot: { ...(sourceBinding?{sourceTargetId:sourceBinding.targetId,workspaceRoot:sourceBinding.workspaceRoot,snapshotTargetId:snapshotBinding?.targetId,executionRoot:workspace}:{}), schema: manifest.schema, sourceRevision: manifest.sourceRevision, sourceStateHash: manifest.sourceStateHash, manifestPath, originalRevisionUnchanged: unchanged }, tracePath: join(artifactDir, "trace.jsonl") };
121
- return { content: [{ type: "text", text: `${result.banner}\nFlow acceptance is separate; parent task remains not accepted and no assertion was promoted.\nTrace: ${details.tracePath}` }], details };
150
+ const repository = selected ? relative(realpathSync(workspaceCwd), selected.executionRoot).split(sep).join("/") : undefined;
151
+ if (repository) Object.assign(details.snapshot, { repository });
152
+ return { content: [{ type: "text", text: `${result.banner}\n${repository ? `Scouted nested repository ${repository}; paths in this result are relative to it.\n` : ""}Flow acceptance is separate; parent task remains not accepted and no assertion was promoted.\nTrace: ${details.tracePath}` }], details };
122
153
  } catch (error) {
123
154
  return failure(executionStarted ? "result-failed" : "setup-failed", error, budgetCharged, executionStarted, runId ? { runId } : {});
124
155
  } finally {
@@ -8,7 +8,7 @@ export function registerTeamAdjust(pi: ExtensionAPI, toolCtx: ToolContext): void
8
8
  name: "team_adjust",
9
9
  label: "Team Adjust",
10
10
  description:
11
- "Add or drop a specialist persona in the ACTIVE team (the roster you can dispatch to). Use sparingly, when the current roster genuinely cannot serve the task (e.g. add security-auditor for a security-sensitive change, drop an unused specialist). Not available at trivial/small tiers. The human sees every change and can revert with /af-agents-add /af-agents-drop.",
11
+ "Add or drop a persona in the active team. Rarely needed: dispatch_agent to any installed agent adds it automatically. Drop only an agent that actively gets in the way; keeping added agents costs nothing. The human sees every change and can revert with /af-agents-add /af-agents-drop.",
12
12
  parameters: Type.Object({
13
13
  action: Type.String({ description: "add | drop" }),
14
14
  agent: Type.String({ description: "Persona name (case-insensitive), e.g. security-auditor" }),
@@ -1,3 +1,7 @@
1
+ import {chatLines,chatTransition,type ChatView} from '../../lib/fleet-codex-chat-view.ts';
2
+ import type {BootstrapChatRow} from '../../../agent-fleet/scripts/lib/fleet-codex-bootstrap.ts';
3
+ import type {BootstrapNamespace} from '../../lib/fleet-notification-bootstrap.ts';
4
+ import {namespaceKey} from '../../lib/fleet-codex-namespace.ts';
1
5
  import { Key, matchesKey, truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
2
6
  import type { ChildProcess } from "node:child_process";
3
7
  import type { ModelPolicy } from "../policy/models.ts";
@@ -74,6 +78,8 @@ export interface FleetDashboardDeps<TDef extends DetailAgentDef, TAgent extends
74
78
  abortComs(state: TAgent): void;
75
79
  getComsLines(width: number, theme: { fg(color: string, text: string): string }): string[];
76
80
  getConnectionLines?(width:number,theme:{fg(color:string,text:string):string}):string[];
81
+ getCodexChats?():BootstrapChatRow[];
82
+ codexChatAction?(kind:'enable'|'disable'|'preflight',namespace:BootstrapNamespace,ctx:DetailUiContext):Promise<void>;
77
83
  }
78
84
 
79
85
  type SubstitutionPicker = { stage: "source" | "target"; source?: string; choices: FleetModelChoice[]; index: number; scrollOffset: number };
@@ -113,6 +119,7 @@ export function createFleetDashboard<TDef extends DetailAgentDef, TAgent extends
113
119
  async function openFleetDashboard(ctx: DetailUiContext, startSubstitution = false): Promise<void> {
114
120
  const resources = createPanelResources(), selection: Selection = { index: 0 };
115
121
  let connections=false,connectionOffset=0;
122
+ const chats:ChatView={detail:false,offset:0},chatAction:{afterClose?:()=>Promise<void>}={};
116
123
  let scrollOffset = 0, filtering = false, detailVerbose = false, confirm: DashboardConfirm = null;
117
124
  let reviewHistory = false, historyIndex = 0, findingIndex = 0, historyOffset = 0, evidence: string | null | undefined, evidenceFinding: ProactiveFindingView | undefined, evidenceOffset = 0;
118
125
  const history = () => deps.getProactive?.()?.owners.flatMap(owner => owner.history.map(review => ({ owner, review }))) ?? [];
@@ -121,6 +128,7 @@ export function createFleetDashboard<TDef extends DetailAgentDef, TAgent extends
121
128
  try { await ctx.ui.custom((tui: any, theme: any, _kb: any, done: (result?: unknown) => void) => {
122
129
  attachFleetDashboardTicker(resources, () => tui.requestRender());
123
130
  return { render: (w: number) => { const now = Date.now(), rows = fleetRows(false, now); reconcileSelection(selection, rows);
131
+ if(connections&&deps.getCodexChats){const items=deps.getCodexChats(),height=Math.max(4,tui.terminal?.rows??24),content=chatLines(chats,items),body=height-3,index=items.findIndex(r=>namespaceKey(r.namespace)===chats.selected);if(!chats.detail){if(index<chats.offset)chats.offset=Math.max(0,index);if(index>=chats.offset+body)chats.offset=index-body+1;}chats.offset=clampScroll(chats.offset,content.length,body);return fitToHeight(['Codex чатове — cached данни, не live delivery proof',...content.slice(chats.offset,chats.offset+body),chats.detail?'↑↓ scroll · e включи/reconnect · d изключи · p preflight · Esc списък':'↑↓ избери чат · Enter детайли · e включи/reconnect · d изключи · p preflight · Esc назад'].map(line=>truncateToWidth(safeTerminalText(line),w)),height);}
124
132
  if(connections){const height=Math.max(4,tui.terminal?.rows??24),content=deps.getConnectionLines?.(w,theme)??['Connection status unavailable'];connectionOffset=clampScroll(connectionOffset,content.length,height-3);return fitToHeight(['Chat connections — observed state, not delivery proof',...content.slice(connectionOffset,connectionOffset+height-3),'↑↓ / PgUp/PgDn/Home/End scroll · Esc back'].map(line=>truncateToWidth(safeTerminalText(line),w)),height);}
125
133
  const comsLines = deps.getComsLines(w, theme); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS + comsLines.length, 0); if (evidence !== undefined) return fitToHeight(evidenceLines(evidence, w, body, evidenceOffset, evidenceFinding), body + FLEET_CHROME_ROWS + comsLines.length);
126
134
  if (picker) return renderFleetSubstitutionPicker(picker.stage, picker.source, picker.choices, picker, w, body, theme);
@@ -128,9 +136,10 @@ export function createFleetDashboard<TDef extends DetailAgentDef, TAgent extends
128
136
  const taskTriage = deps.getTaskTriage?.(), listBody = fleetDashboardListBody(body, rows.length, taskTriage);
129
137
  if (listBody > 0 && rows.length) { if (selection.index < scrollOffset) scrollOffset = selection.index; else if (selection.index >= scrollOffset + listBody) scrollOffset = selection.index - listBody + 1; }
130
138
  scrollOffset = clampScroll(scrollOffset, rows.length, listBody); const summary = summarise(rows); const lines = renderFleetDashboard({ rows, selection, scrollOffset, filterQuery: deps.getFilter(), showFinished: deps.getShowFinished(), confirmation: confirm && confirm.until > now ? `press ${confirm.action === "kill" ? "x" : "r"} again to ${confirm.action} ${rows.find(row => row.key === confirm!.key && row.runToken === confirm!.runToken)?.name ?? "agent"}` : undefined, summary: { ...summary, wallMs: unionMs(summary.intervals) }, proactive: deps.getProactive?.(), taskTriage, comsLines }, w, body, theme, { visibleWidth, truncateToWidth }); if (deps.getProactive?.()?.owners.some(owner => owner.history.length)) lines[body + 3] = truncateToWidth(" ←→ thinking · 1 System 1 communication · p reviews · h history · Enter detail · Esc close", w); if (deps.openSystem1 && !deps.getProactive?.()?.owners.some(owner => owner.history.length)) lines[body + 3] = truncateToWidth(" ←→ thinking · 1 System 1 communication · h history · Enter detail · Esc close", w); lines[body+3]=truncateToWidth(' 2 chats · '+lines[body+3],w);return lines; },
131
- handleInput: async (data: string) => { const now = Date.now(), rows = fleetRows(false, now); reconcileSelection(selection, rows); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS + deps.getComsLines(tui.terminal?.columns ?? 80, theme).length, 0), input = toInput(data);
139
+ handleInput: async (data: string) => { if(chatAction.afterClose)return;const now = Date.now(), rows = fleetRows(false, now); reconcileSelection(selection, rows); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS + deps.getComsLines(tui.terminal?.columns ?? 80, theme).length, 0), input = toInput(data);
140
+ if(connections&&deps.getCodexChats){const intent=chatTransition(input,chats,deps.getCodexChats());if(intent==='back')connections=false;else if(intent==='presence_required')ctx.ui.notify('Липсва еднозначна прясна native presence; извикай fleet_diagnostics в точния Codex чат. Няма автоматичен probe/start/replay.','warning');else if(intent&&deps.codexChatAction){chatAction.afterClose=()=>deps.codexChatAction!(intent.action,intent.namespace,ctx);done();return;}tui.requestRender();return;}
132
141
  if(connections){if(input==='\u001b'||input==='q')connections=false;else connectionOffset=evidenceScroll(input,connectionOffset,deps.getConnectionLines?.(tui.terminal?.columns??80,theme).length??0,Math.max(1,(tui.terminal?.rows??24)-3));tui.requestRender();return;}
133
- if(input==='2'&&!filtering&&!picker&&!reviewHistory&&evidence===undefined){connections=true;connectionOffset=0;confirm=null;tui.requestRender();return;}
142
+ if(input==='2'&&!filtering&&!picker&&!reviewHistory&&evidence===undefined){connections=true;connectionOffset=0;chats.offset=0;chats.detail=false;confirm=null;tui.requestRender();return;}
134
143
  if (evidence !== undefined) { if (input === "\u001b" || input === "q") { evidence = undefined; evidenceFinding = undefined; } else evidenceOffset = evidenceScroll(input, evidenceOffset, proactiveEvidenceContent(evidence, evidenceFinding, tui.terminal?.columns ?? 80).length, body); tui.requestRender(); return; }
135
144
  if (reviewHistory) {
136
145
  const entries = history();
@@ -157,6 +166,7 @@ export function createFleetDashboard<TDef extends DetailAgentDef, TAgent extends
157
166
  if (intent === "close") done(); else if (intent === "history") { confirm = null; await deps.openHistory(ctx); } else if (intent === "config") { confirm = null; if (deps.openConfig) await deps.openConfig(ctx); else ctx.ui.notify("Run /af-config or press Alt+, for the Fleet config screen.", "info"); } else if (intent === "substitute") { confirm = null; const choices = substitutionSourceChoices(); if (!choices.length) ctx.ui.notify("No configured persona or sub-role models are available as substitution sources.", "warning"); else picker = { stage: "source", choices, index: 0, scrollOffset: 0 }; } else if (intent && typeof intent === "object" && "open" in intent) { const selected = rows.find(row => row.key === intent.open); confirm = null; if (selected) detailVerbose = await deps.actions.open(selected.key, selected.runToken, ctx, detailVerbose); } else if (intent && typeof intent === "object" && "kill" in intent) { const selected = rows.find(row => row.key === intent.kill); if (selected) await deps.actions.execute("kill", selected.key, selected.runToken, ctx); else ctx.ui.notify("Selected fleet row no longer exists.", "warning"); } else if (intent && typeof intent === "object" && "restart" in intent) { const selected = rows.find(row => row.key === intent.restart); if (selected) await restartRow(selected, ctx); } tui.requestRender(); },
158
167
  invalidate() {}, dispose: () => resources.dispose() };
159
168
  }, FULLSCREEN_OVERLAY); } finally { resources.dispose(); }
169
+ if(chatAction.afterClose)await chatAction.afterClose();
160
170
  }
161
171
 
162
172
  return { fleetRows, openFleetDashboard };
@@ -1,10 +1,17 @@
1
- export const WORK_MODES = ["operator", "orchestrator"] as const;
1
+ /**
2
+ * The Hub has one work mode: the operator (PHILOSOPHY, 2026-11-11). The former
3
+ * delegate-only "orchestrator" mode was removed; sessions saved in it, and the
4
+ * deprecated --work-mode flag, continue as the operator.
5
+ */
6
+ export const WORK_MODES = ["operator"] as const;
2
7
  export type WorkMode = (typeof WORK_MODES)[number];
8
+ /** The removed delegate-only mode, recognised only to migrate old sessions and flags. */
9
+ export const RETIRED_WORK_MODE = "orchestrator";
3
10
 
4
11
  export const WORK_MODE_ENTRY_TYPE = "agent-hub-work-mode";
5
12
  const LEGACY_POSTURE_ENTRY_TYPE = "agent-hub-posture";
6
13
 
7
- export const FLEET_TOOLS = ["dispatch_agent", "dispatch_triage", "spawn_research", "set_task_tier", "team_adjust"] as const;
14
+ export const FLEET_TOOLS = ["dispatch_agent", "dispatch_triage", "spawn_research", "poll_panel", "set_task_tier", "team_adjust"] as const;
8
15
  export const VERIFICATION_TOOLS = ["set_assertions", "update_assertion", "get_assertions"] as const;
9
16
  /** Compatibility export for callers that need every orchestration-owned tool. */
10
17
  export const ORCHESTRATION_TOOLS = [...FLEET_TOOLS, ...VERIFICATION_TOOLS] as const;
@@ -34,20 +41,13 @@ export function parseWorkMode(value: unknown): WorkMode | null {
34
41
  return WORK_MODES.includes(normalized as WorkMode) ? normalized as WorkMode : null;
35
42
  }
36
43
 
37
- export function resolveStartupWorkMode(options: {
38
- explicitWorkMode?: unknown;
39
- hasExplicitRoster?: boolean;
40
- }): WorkMode {
41
- if (options.explicitWorkMode !== undefined) {
42
- const explicit = parseWorkMode(options.explicitWorkMode);
43
- if (!explicit) throw new Error(`Unknown work mode "${String(options.explicitWorkMode)}"; expected operator|orchestrator.`);
44
- return explicit;
45
- }
46
- return options.hasExplicitRoster ? "orchestrator" : "operator";
44
+ /** True for the removed mode's name, so callers can tell a migration from a typo. */
45
+ export function isRetiredWorkMode(value: unknown): boolean {
46
+ return typeof value === "string" && value.trim() === RETIRED_WORK_MODE;
47
47
  }
48
48
 
49
- /** Restores canonical work-mode entries and legacy posture entries from older sessions. */
50
- export function latestPersistedWorkMode(entries: readonly unknown[]): WorkMode | null {
49
+ /** The latest persisted work-mode value (canonical or legacy posture entry), raw. */
50
+ function latestPersistedWorkModeValue(entries: readonly unknown[]): unknown {
51
51
  for (let i = entries.length - 1; i >= 0; i--) {
52
52
  const entry = entries[i] as { type?: unknown; customType?: unknown; data?: { workMode?: unknown; posture?: unknown } } | null;
53
53
  if (entry?.type !== "custom") continue;
@@ -56,24 +56,19 @@ export function latestPersistedWorkMode(entries: readonly unknown[]): WorkMode |
56
56
  : entry.customType === LEGACY_POSTURE_ENTRY_TYPE
57
57
  ? entry.data?.posture
58
58
  : undefined;
59
- const persisted = parseWorkMode(value);
60
- if (persisted) return persisted;
59
+ if (parseWorkMode(value) || isRetiredWorkMode(value)) return value;
61
60
  }
62
- return null;
61
+ return undefined;
63
62
  }
64
63
 
65
- export function resolveSessionWorkMode(options: {
66
- entries: readonly unknown[];
67
- explicitWorkMode?: unknown;
68
- hasExplicitRoster?: boolean;
69
- }): WorkMode {
70
- if (options.explicitWorkMode !== undefined) {
71
- return resolveStartupWorkMode({ explicitWorkMode: options.explicitWorkMode });
72
- }
73
- return latestPersistedWorkMode(options.entries)
74
- ?? resolveStartupWorkMode({ hasExplicitRoster: options.hasExplicitRoster });
64
+ /** True when an older session was last saved in the removed orchestrator mode. */
65
+ export function sessionSavedInRetiredWorkMode(entries: readonly unknown[]): boolean {
66
+ return isRetiredWorkMode(latestPersistedWorkModeValue(entries));
75
67
  }
76
68
 
69
+ export const RETIRED_WORK_MODE_NOTICE =
70
+ "Orchestrator work mode was removed: the Hub has one operator that works directly and delegates on its own judgment. This session continues as the operator; --work-mode and /af-work-mode no longer exist.";
71
+
77
72
  export const NATIVE_ROSTER_STATE_VERSION = 1 as const;
78
73
  export const NATIVE_ROSTER_ENTRY_TYPE = "agent-hub-native-roster";
79
74
 
@@ -130,29 +125,30 @@ export function resolveSessionRoster(options: {
130
125
  return { source, roster: { name, members }, diagnostic: null };
131
126
  }
132
127
 
133
- export function workModePrompt(workMode: WorkMode): { intro: string; hardRules: string } {
134
- if (workMode === "operator") {
135
- return {
136
- intro: "You are the Fleet operator. You may work on the codebase directly and may also coordinate specialist agents when delegation adds value.",
137
- hardRules: `- You MAY read, execute, edit, and write directly in operator work mode.
138
- - Use direct tools for focused work when they are the simplest path; delegate when specialization, parallelism, or independent verification adds value.
139
- - Give concurrent writable agents explicit non-overlapping scopes and inspect overlap warnings before proceeding.
140
- - For inspection, use the active catalog's read/grep/find/ls with an explicit target path (or the filesystem tool when enabled). A refused shell string needs no planner and no slash reset; preflight refusals carry their authoritative tier/catalog/revision snapshot.`,
141
- };
142
- }
128
+ /** Operator guidance on when to delegate. Stable policy: no counters or task state. */
129
+ export const OPERATOR_DELEGATION_GUIDE = `## When to delegate
130
+ Delegation is your judgment, not an obligation.
131
+ - Research: delegate by default with \`spawn_research\`; start independent questions in parallel in one turn and work from the findings.
132
+ - Build: make a small, focused change yourself. Delegate a larger coherent change to one builder.
133
+ - Review: a non-trivial change always gets review from a separate agent via \`dispatch_agent\` (coms peers too; a \`coms_send\` reply is no review). Review your own edits with native \`review_mode: "operator-current-state"\`. With parallel builders, review each finished area (\`parallel: true\`), then with no writer running one final review of the whole change closes the task.
134
+ - Decisions: for an architectural choice, uncertain diagnosis, choice between approaches or risky change, call \`poll_panel\` with one self-contained question. Never poll facts; deep research stays one model.
135
+ - Research and polls run in parallel freely. Writers (write, edit or bash; reviewers too) run one at a time unless each gets \`parallel: true\` and a disjoint scope of exact existing paths; the sandbox then confines each. You edit shared files (package.json, locks, manifests) after writers finish and run the full checks with no writer active.
136
+ - Every delegate receives the task brief (\`artifacts/briefs/\`). Keep its "Operator notes" current with decisions and open questions. Read a delegate's return path instead of dispatching again.`;
137
+
138
+ /** The operator prompt. The removed orchestrator variant had no direct tools. */
139
+ export function workModePrompt(): { intro: string; hardRules: string; delegationGuide: string } {
143
140
  return {
144
- intro: "You are a dispatcher agent — an orchestrator. You coordinate specialist agents to accomplish tasks. You have no generic direct coding tools.",
145
- hardRules: `- NEVER try to execute, edit, or write repository code directly — you have no generic bash/write/edit tools.
146
- - \`filesystem\` is a narrow direct inspection exception: always available in orchestrator for read-only stat, inventory, excerpt, and readback. Use stat and bounded excerpts with offset/max_bytes even for large files. The 64 KiB whole-turn output ceiling includes inventory. On too_large, reduce the page or continue next turn; use a helper when useful. Never retry an unchanged refusal. Snapshot stays profile-gated. It grants no arbitrary write or shell authority.
147
- - Tool availability is never gate admission: a visible tool can still refuse under tier, process, budget, or safety gates. Read the refusal's snapshot and correct the prerequisite; routine slash resets are not the recovery path.
148
- - Optionally use \`dispatch_triage\` for System 1 persona/risk advice before dispatch when it is listed in the active tools. It is not a gate or permission; low predicted risk never removes checks. Do not call it when it is absent.
149
- - When listed, \`ask_system1\` provides bounded semantic judgments over explicitly selected evidence. Follow its configured usage policy; recommended mode offers it for concrete unresolved judgments; direct reasoning and reads need no preliminary helper call. It never executes shell, grants permission, closes gates or replaces required reading/review. Do not call it when absent.
150
- - ALWAYS use \`dispatch_agent\` to get implementation work done; use \`spawn_research\` for recon that \`filesystem\` cannot answer.`,
141
+ delegationGuide: OPERATOR_DELEGATION_GUIDE,
142
+ intro: "You are the Fleet operator. You work on the codebase directly and delegate to specialist and research agents whenever that keeps your context focused, adds an independent view, or lets independent work run in parallel.",
143
+ hardRules: `- You MAY read, execute, edit, and write directly.
144
+ - Use direct tools for focused work when they are the simplest path; delegate when specialization, parallelism, or independent verification adds value.
145
+ - For inspection, use the active catalog's read/grep/find/ls with an explicit target path (or the filesystem tool when enabled). A refused shell string needs no planner and no slash reset; preflight refusals carry their authoritative tier/catalog/revision snapshot.
146
+ - Tool availability is never gate admission: a listed tool can still refuse; read the refusal's snapshot and fix the prerequisite.
147
+ - \`dispatch_triage\`, when listed, is optional advice; never a gate or permission.`,
151
148
  };
152
149
  }
153
150
 
154
151
  export function resolveWorkModeTools(options: {
155
- workMode: WorkMode;
156
152
  baselineTools: readonly string[];
157
153
  comsReady: boolean;
158
154
  herdrReady: boolean;
@@ -167,7 +163,7 @@ export function resolveWorkModeTools(options: {
167
163
  capabilityPacks?: readonly ("core" | "fleet" | "verification" | "peer" | "workspace" | "compaction")[];
168
164
  }): string[] {
169
165
  const packs = new Set(options.capabilityPacks ?? ["core", "fleet", "verification", "peer", "workspace"]);
170
- const tools = options.workMode === "operator" && packs.has("core")
166
+ const tools = packs.has("core")
171
167
  ? options.baselineTools.filter(name => !HUB_OWNED_TOOLS.has(name))
172
168
  : [];
173
169
 
@@ -181,8 +177,7 @@ export function resolveWorkModeTools(options: {
181
177
  if (packs.has("core") && options.agenticAskEnabled === true) tools.push("ask_system1");
182
178
  if (packs.has("core") && options.fileDiscoveryEnabled === true) tools.push("ask_system1_files");
183
179
  if (packs.has("compaction")) tools.push("request_compaction");
184
- // Operator inspection stays profile-gated. Orchestrator always gets the same
185
- // tool, but snapshot remains refused unless deterministic-tools is on.
186
- if (options.deterministicTools === true || options.workMode === "orchestrator") tools.push("filesystem");
180
+ // The filesystem inspection tool stays profile-gated (deterministic-tools).
181
+ if (options.deterministicTools === true) tools.push("filesystem");
187
182
  return [...new Set(tools)];
188
183
  }
@@ -1,6 +1,6 @@
1
1
  import { spawnSync } from "node:child_process";
2
- import { accessSync, lstatSync, realpathSync, statSync } from "node:fs";
3
- import { delimiter, isAbsolute, relative, resolve } from "node:path";
2
+ import { accessSync, existsSync, lstatSync, readdirSync, realpathSync, statSync } from "node:fs";
3
+ import { delimiter, isAbsolute, join, relative, resolve } from "node:path";
4
4
  import { constants } from "node:fs";
5
5
 
6
6
  export type WriteIsolationBackend = "auto" | "bubblewrap" | "seatbelt" | "missing";
@@ -15,6 +15,14 @@ export interface WriteIsolationRequest {
15
15
  runtimePaths?: string[];
16
16
  artifactPaths?: string[];
17
17
  tempPaths?: string[];
18
+ /**
19
+ * Directories where Pi creates `<file>.lock` directories beside its state files
20
+ * (its agent directory and the project `.pi`). New entries may be created there;
21
+ * every existing entry stays read-only unless listed in `stateFiles`.
22
+ */
23
+ lockDirectories?: string[];
24
+ /** Existing Pi state files a child may rewrite (for example auth.json on token refresh). */
25
+ stateFiles?: string[];
18
26
  command?: string;
19
27
  args?: string[];
20
28
  env?: Record<string, string>;
@@ -41,6 +49,8 @@ export interface WriteIsolationResult extends WriteIsolationPolicy {
41
49
  seatbeltProfile?: string;
42
50
  writableFiles?: string[];
43
51
  writableDirectories?: string[];
52
+ /** Directories where only new entries (Pi lock directories) are writable. */
53
+ lockDirectories?: string[];
44
54
  }
45
55
 
46
56
  const GLOB_META = /[*?\[\]{}!]/;
@@ -125,8 +135,34 @@ function resolveApprovedPaths(input: WriteIsolationRequest): { files: string[];
125
135
  return { files: [...new Set(files)], directories: [...new Set(directories)] };
126
136
  }
127
137
 
128
- function seatbeltProfile(files: string[], directories: string[]): string {
138
+ /** Canonical lock directories and the existing entries inside them that must stay read-only. */
139
+ export function resolveLockDirectories(input: Pick<WriteIsolationRequest, "lockDirectories" | "stateFiles">): { directories: string[]; readOnlyEntries: string[]; stateFiles: string[] } {
140
+ const stateFiles = [...new Set((input.stateFiles ?? []).filter(path => existsSync(path)).map(path => canonicalTrustedPath(path)))];
141
+ const directories: string[] = [];
142
+ const readOnlyEntries: string[] = [];
143
+ for (const raw of input.lockDirectories ?? []) {
144
+ if (!raw || !existsSync(raw) || !statSync(raw).isDirectory()) continue;
145
+ const dir = canonicalTrustedPath(raw);
146
+ if (directories.includes(dir)) continue;
147
+ directories.push(dir);
148
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
149
+ const path = join(dir, entry.name);
150
+ // Symlinks are not rebound: their targets keep the outer read-only root.
151
+ if (entry.isSymbolicLink() || stateFiles.includes(path)) continue;
152
+ readOnlyEntries.push(path);
153
+ }
154
+ }
155
+ return { directories, readOnlyEntries, stateFiles };
156
+ }
157
+
158
+ function seatbeltRegexPath(path: string): string {
159
+ return path.replace(/[\\^$.*+?()[\]{}|"]/g, "\\$&");
160
+ }
161
+
162
+ function seatbeltProfile(files: string[], directories: string[], lockDirectories: string[] = []): string {
129
163
  const grants = [
164
+ // Pi's own lock directories (`<state>.json.lock`) beside its state files; nothing else there.
165
+ ...lockDirectories.map(path => `(regex #"^${seatbeltRegexPath(path)}/[^/]+\\.lock(/.*)?$")`),
130
166
  ...files.map(path => `(literal ${quoteSeatbelt(path)})`),
131
167
  ...directories.flatMap(path => [`(literal ${quoteSeatbelt(path)})`, `(subpath ${quoteSeatbelt(path)})`]),
132
168
  // Ordinary stdio/redirection needs these device nodes. Keep them literal:
@@ -157,7 +193,8 @@ export function confineNativeChild(input: WriteIsolationRequest): WriteIsolation
157
193
  if (selected !== expected) return { ...base, applied: false, failClosed: true, reason: `${selected} is not the native write-isolation backend for ${platform}`, cwd };
158
194
 
159
195
  let approved: { files: string[]; directories: string[] };
160
- try { approved = resolveApprovedPaths(input); }
196
+ let locks: ReturnType<typeof resolveLockDirectories>;
197
+ try { approved = resolveApprovedPaths(input); locks = resolveLockDirectories(input); }
161
198
  catch (error) { return { ...base, applied: false, failClosed: true, reason: error instanceof Error ? error.message : String(error), cwd }; }
162
199
  if (approved.files.length === 0 && approved.directories.length === 0)
163
200
  return { ...base, applied: false, failClosed: true, reason: "no approved writable paths; refusing sandbox launch with an empty grant set", cwd };
@@ -166,6 +203,14 @@ export function confineNativeChild(input: WriteIsolationRequest): WriteIsolation
166
203
  if (!backendPath) return { ...base, applied: false, failClosed: true, reason: `${selected} backend unavailable; refusing unsandboxed execution`, cwd };
167
204
  if (selected === "bubblewrap") {
168
205
  const deviceArgs = ["/dev/null", "/dev/tty"].filter(path => { try { accessSync(path); return true; } catch { return false; } }).flatMap(path => ["--dev-bind", path, path]);
206
+ // Order matters: a later mount wins for its subtree. Lock directories become
207
+ // writable for new entries, their existing entries go back to read-only, then
208
+ // Pi state files and finally the approved grants (which may lie inside them).
209
+ const lockBinds = [
210
+ ...locks.directories.flatMap(path => ["--bind", path, path]),
211
+ ...locks.readOnlyEntries.flatMap(path => ["--ro-bind", path, path]),
212
+ ...locks.stateFiles.flatMap(path => ["--bind", path, path]),
213
+ ];
169
214
  const binds = [
170
215
  ...approved.directories.flatMap(path => ["--bind", path, path]),
171
216
  ...approved.files.flatMap(path => ["--bind", path, path]),
@@ -174,14 +219,14 @@ export function confineNativeChild(input: WriteIsolationRequest): WriteIsolation
174
219
  ...base, applied: true, failClosed: true, command: backendPath,
175
220
  // Do not use bwrap --new-session: the Hub deliberately owns one detached
176
221
  // process group so its existing cancellation cascade reaches descendants.
177
- args: ["--die-with-parent", "--ro-bind", "/", "/", ...deviceArgs, ...binds, "--chdir", cwd, "--", command, ...originalArgs],
178
- cwd, env: input.env, writableFiles: approved.files, writableDirectories: approved.directories,
222
+ args: ["--die-with-parent", "--ro-bind", "/", "/", ...deviceArgs, ...lockBinds, ...binds, "--chdir", cwd, "--", command, ...originalArgs],
223
+ cwd, env: input.env, writableFiles: [...approved.files, ...locks.stateFiles], writableDirectories: approved.directories, lockDirectories: locks.directories,
179
224
  };
180
225
  }
181
- const profile = seatbeltProfile(approved.files, approved.directories);
226
+ const profile = seatbeltProfile([...approved.files, ...locks.stateFiles], approved.directories, locks.directories);
182
227
  return {
183
228
  ...base, applied: true, failClosed: true, command: backendPath,
184
229
  args: ["-p", profile, "--", command, ...originalArgs], cwd, env: input.env,
185
- seatbeltProfile: profile, writableFiles: approved.files, writableDirectories: approved.directories,
230
+ seatbeltProfile: profile, writableFiles: [...approved.files, ...locks.stateFiles], writableDirectories: approved.directories, lockDirectories: locks.directories,
186
231
  };
187
232
  }
@@ -3,5 +3,5 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "version": "2.1.2"
6
+ "version": "2.2.0"
7
7
  }
@@ -3,5 +3,5 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "version": "2.1.2"
6
+ "version": "2.2.0"
7
7
  }
@@ -0,0 +1,97 @@
1
+ /** Pure version prefilter, not queue compatibility or delivery qualification.
2
+ * No default policy: callers must supply an explicit minimum and denylist.
3
+ * Runtime admission still requires identity, contract, consumer and authority evidence.
4
+ */
5
+ type Version = {core: readonly [string, string, string]; prerelease: readonly string[]};
6
+ type Order = -1 | 0 | 1;
7
+ export type CodexVersionAssessment =
8
+ | {eligible: true; reason: 'meets_minimum'}
9
+ | {eligible: false; reason: 'invalid_policy' | 'invalid_version' | 'denied_version' | 'below_minimum'};
10
+
11
+ const maxVersionLength = 256;
12
+ const maxDenylistEntries = 128;
13
+ const versionPattern = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
14
+ const numeric = (value: string) => /^[0-9]+$/.test(value);
15
+
16
+ function parseVersion(value: unknown): Version | undefined {
17
+ if (typeof value !== 'string' || value.length > maxVersionLength) return;
18
+ const match = versionPattern.exec(value);
19
+ if (!match) return;
20
+ const prerelease = match[4]?.split('.') ?? [];
21
+ if (prerelease.some(part => numeric(part) && part.length > 1 && part[0] === '0')) return;
22
+ return {core: [match[1], match[2], match[3]], prerelease};
23
+ }
24
+
25
+ /** The measured initialize UA grammar and our exact Fleet originators only.
26
+ * The first product token carries the daemon build, never the SDK suffix.
27
+ * Version observation is NOT Desktop
28
+ * identity, MCP clientInfo or loaded-consumer evidence. Shared by observer and
29
+ * pinned queue connections so suffix handling cannot diverge. */
30
+ export function codexDaemonVersionFromUserAgent(value:unknown):string|undefined {
31
+ if(typeof value!=='string'||value.length>4096||/[\u0000-\u001f\u007f]/.test(value))return;
32
+ const match=/^(?:Codex Desktop|agent_fleet_contract_observer|agent_fleet_queue_bridge)\/([^\s()]+)(?:\s|$)/.exec(value);
33
+ return match&&parseVersion(match[1])?match[1]:undefined;
34
+ }
35
+
36
+ function compareNumeric(left: string, right: string): Order {
37
+ if (left === right) return 0;
38
+ if (left.length !== right.length) return left.length < right.length ? -1 : 1;
39
+ return left < right ? -1 : 1;
40
+ }
41
+
42
+ function compare(left: Version, right: Version): Order {
43
+ for (let i = 0; i < 3; i++) {
44
+ const order = compareNumeric(left.core[i], right.core[i]);
45
+ if (order !== 0) return order;
46
+ }
47
+ if (left.prerelease.length === 0 || right.prerelease.length === 0) {
48
+ if (left.prerelease.length === right.prerelease.length) return 0;
49
+ return left.prerelease.length === 0 ? 1 : -1;
50
+ }
51
+ for (let i = 0; i < Math.min(left.prerelease.length, right.prerelease.length); i++) {
52
+ const a = left.prerelease[i], b = right.prerelease[i];
53
+ if (a === b) continue;
54
+ const aNumeric = numeric(a), bNumeric = numeric(b);
55
+ if (aNumeric && bNumeric) return compareNumeric(a, b);
56
+ if (aNumeric !== bNumeric) return aNumeric ? -1 : 1;
57
+ return a < b ? -1 : 1;
58
+ }
59
+ return left.prerelease.length === right.prerelease.length ? 0 : left.prerelease.length < right.prerelease.length ? -1 : 1;
60
+ }
61
+
62
+ /** Strict SemVer 2.0 precedence for <=256 ASCII characters; build metadata is
63
+ * validated but ignored in precedence. Invalid input returns undefined, not 0.
64
+ * Callers must extract actual version fields separately; banners/UA are invalid.
65
+ */
66
+ export function compareCodexVersions(left: unknown, right: unknown): Order | undefined {
67
+ const a = parseVersion(left), b = parseVersion(right);
68
+ return a && b ? compare(a, b) : undefined;
69
+ }
70
+
71
+ /** Policy is inert JSON data: {minimum: string, denylist: string[]} (<=128 entries).
72
+ * Malformed JSON-shaped policy/entries fail closed. This is not an exception
73
+ * boundary for arbitrary JavaScript getters/Proxies or a validator of symbol keys.
74
+ * Policy validation precedes version validation, then denial precedes minimum.
75
+ * Denials compare SemVer precedence,
76
+ * so adding/changing build metadata cannot evade a denied release.
77
+ * eligible:true establishes ONLY the version prefilter, never runtime readiness.
78
+ */
79
+ export function assessCodexVersion(observed: unknown, policy: unknown): CodexVersionAssessment {
80
+ const invalidPolicy = {eligible: false, reason: 'invalid_policy'} as const;
81
+ if (!policy || typeof policy !== 'object' || Array.isArray(policy)) return invalidPolicy;
82
+ if (Object.keys(policy).length !== 2 || !Object.hasOwn(policy, 'minimum') || !Object.hasOwn(policy, 'denylist')) return invalidPolicy;
83
+ const {minimum, denylist} = policy as {minimum: unknown; denylist: unknown};
84
+ const floor = parseVersion(minimum);
85
+ if (!floor || !Array.isArray(denylist) || denylist.length > maxDenylistEntries) return invalidPolicy;
86
+ const denied: Version[] = [];
87
+ for (const entry of denylist) {
88
+ const parsed = parseVersion(entry);
89
+ if (!parsed) return invalidPolicy;
90
+ denied.push(parsed);
91
+ }
92
+ const version = parseVersion(observed);
93
+ if (!version) return {eligible: false, reason: 'invalid_version'};
94
+ if (denied.some(entry => compare(version, entry) === 0)) return {eligible: false, reason: 'denied_version'};
95
+ if (compare(version, floor) < 0) return {eligible: false, reason: 'below_minimum'};
96
+ return {eligible: true, reason: 'meets_minimum'};
97
+ }