@chankov/agent-fleet 2.0.8 → 2.0.10

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 (912) hide show
  1. package/.pi/extensions/pi-voice-stt/README.md +24 -5
  2. package/.pi/extensions/pi-voice-stt/examples/stt.json +4 -4
  3. package/.pi/harnesses/agent-hub/README.md +20 -6
  4. package/.pi/harnesses/agent-hub/footer.ts +1 -1
  5. package/.pi/harnesses/agent-hub/index.ts +47 -66
  6. package/.pi/harnesses/agent-hub/input/shortcuts.ts +2 -0
  7. package/.pi/harnesses/agent-hub/package.json +1 -1
  8. package/.pi/harnesses/agent-hub/return-contract.js +34 -0
  9. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +80 -18
  10. package/.pi/harnesses/agent-hub/ui/fleet-actions.ts +76 -0
  11. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +16 -42
  12. package/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  13. package/.pi/harnesses/agent-hub/ui/fleet-source.ts +157 -0
  14. package/.pi/harnesses/agent-hub/ui/grid.ts +145 -33
  15. package/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -139
  16. package/.pi/harnesses/coms/package.json +1 -1
  17. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  18. package/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  19. package/.pi/harnesses/lib/fleet-dashboard-ops.ts +17 -0
  20. package/.pi/harnesses/lib/fleet-dashboard-view.ts +22 -36
  21. package/.pi/harnesses/lib/fleet-read-model.ts +109 -27
  22. package/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
  23. package/.pi/harnesses/lib/fleet-strip-view.ts +132 -0
  24. package/.versions/2.0.10/.pi/agent-fleet/hermes/README.md +347 -0
  25. package/.versions/2.0.10/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  26. package/.versions/2.0.10/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  27. package/.versions/2.0.10/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  28. package/.versions/2.0.10/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  29. package/.versions/2.0.10/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  30. package/.versions/2.0.10/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  31. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  32. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  33. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  34. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  35. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  36. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  37. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  38. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  39. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  40. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  41. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  42. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  43. package/.versions/2.0.10/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  44. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  45. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  46. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  47. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  48. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  49. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  50. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  51. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  52. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  53. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  54. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  55. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  56. package/.versions/2.0.10/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  57. package/.versions/2.0.10/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  58. package/.versions/2.0.10/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  59. package/.versions/2.0.10/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  60. package/.versions/2.0.10/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
  61. package/.versions/2.0.10/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
  62. package/.versions/2.0.10/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
  63. package/.versions/2.0.10/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
  64. package/.versions/2.0.10/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
  65. package/.versions/2.0.10/.pi/agent-fleet/scripts/fleet.ts +216 -0
  66. package/.versions/2.0.10/.pi/agent-fleet/scripts/flow.ts +137 -0
  67. package/.versions/2.0.10/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  68. package/.versions/2.0.10/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  69. package/.versions/2.0.10/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  70. package/.versions/2.0.10/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  71. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
  72. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  73. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  74. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
  75. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
  76. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
  77. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
  78. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
  79. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/flow-command.ts +93 -0
  80. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
  81. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  82. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  83. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  84. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  85. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  86. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  87. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  88. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  89. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  90. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  91. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  92. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  93. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  94. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  95. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  96. package/.versions/2.0.10/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
  97. package/.versions/2.0.10/.pi/agent-fleet/scripts/package-lock.json +35 -0
  98. package/.versions/2.0.10/.pi/agent-fleet/scripts/package.json +9 -0
  99. package/.versions/2.0.10/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  100. package/.versions/2.0.10/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
  101. package/.versions/2.0.10/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
  102. package/.versions/2.0.10/.pi/agent-fleet/scripts/team-up.ts +378 -0
  103. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +133 -0
  104. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  105. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  106. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
  107. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  108. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  109. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
  110. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  111. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  112. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  113. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
  114. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  115. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  116. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
  117. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
  118. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
  119. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  120. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
  121. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  122. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  123. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  124. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  125. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  126. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  127. package/.versions/2.0.10/.pi/agent-fleet/scripts/workflows/wf-scout.ts +38 -0
  128. package/.versions/2.0.10/.pi/agents/dispatch-policy.yaml +32 -0
  129. package/.versions/2.0.10/.pi/agents/model-profiles.yaml +83 -0
  130. package/.versions/2.0.10/.pi/agents/peers.yaml +147 -0
  131. package/.versions/2.0.10/.pi/agents/teams.yaml +41 -0
  132. package/.versions/2.0.10/.pi/agents/voices.yaml +13 -0
  133. package/.versions/2.0.10/.pi/damage-control-rules.yaml +297 -0
  134. package/.versions/2.0.10/.pi/extensions/btw/README.md +120 -0
  135. package/.versions/2.0.10/.pi/extensions/btw/index.ts +914 -0
  136. package/.versions/2.0.10/.pi/extensions/btw/package.json +6 -0
  137. package/.versions/2.0.10/.pi/extensions/btw/state.js +179 -0
  138. package/.versions/2.0.10/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  139. package/.versions/2.0.10/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  140. package/.versions/2.0.10/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  141. package/.versions/2.0.10/.pi/extensions/compact-and-continue/README.md +42 -0
  142. package/.versions/2.0.10/.pi/extensions/compact-and-continue/index.ts +120 -0
  143. package/.versions/2.0.10/.pi/extensions/compact-and-continue/package.json +6 -0
  144. package/.versions/2.0.10/.pi/extensions/mcp-bridge/README.md +46 -0
  145. package/.versions/2.0.10/.pi/extensions/mcp-bridge/index.ts +206 -0
  146. package/.versions/2.0.10/.pi/extensions/mcp-bridge/package.json +6 -0
  147. package/.versions/2.0.10/.pi/extensions/package-lock.json +1175 -0
  148. package/.versions/2.0.10/.pi/extensions/package.json +9 -0
  149. package/.versions/2.0.10/.pi/extensions/pi-voice-stt/README.md +224 -0
  150. package/.versions/2.0.10/.pi/extensions/pi-voice-stt/config.ts +198 -0
  151. package/.versions/2.0.10/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  152. package/.versions/2.0.10/.pi/extensions/pi-voice-stt/index.ts +248 -0
  153. package/.versions/2.0.10/.pi/extensions/pi-voice-stt/package.json +6 -0
  154. package/.versions/2.0.10/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  155. package/.versions/2.0.10/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  156. package/.versions/2.0.10/.pi/harnesses/agent-hub/README.md +1217 -0
  157. package/.versions/2.0.10/.pi/harnesses/agent-hub/acceptance.ts +62 -0
  158. package/.versions/2.0.10/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  159. package/.versions/2.0.10/.pi/harnesses/agent-hub/artifacts.js +146 -0
  160. package/.versions/2.0.10/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  161. package/.versions/2.0.10/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  162. package/.versions/2.0.10/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
  163. package/.versions/2.0.10/.pi/harnesses/agent-hub/budget-recovery.ts +97 -0
  164. package/.versions/2.0.10/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  165. package/.versions/2.0.10/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
  166. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  167. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  168. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  169. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  170. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  171. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  172. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  173. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  174. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  175. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  176. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  177. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
  178. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  179. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  180. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  181. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/context.ts +43 -0
  182. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  183. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  184. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  185. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  186. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  187. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  188. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  189. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  190. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  191. package/.versions/2.0.10/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  192. package/.versions/2.0.10/.pi/harnesses/agent-hub/config/agents.ts +177 -0
  193. package/.versions/2.0.10/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
  194. package/.versions/2.0.10/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
  195. package/.versions/2.0.10/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  196. package/.versions/2.0.10/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +213 -0
  197. package/.versions/2.0.10/.pi/harnesses/agent-hub/context/budgets.ts +202 -0
  198. package/.versions/2.0.10/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  199. package/.versions/2.0.10/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  200. package/.versions/2.0.10/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  201. package/.versions/2.0.10/.pi/harnesses/agent-hub/context-window.js +106 -0
  202. package/.versions/2.0.10/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  203. package/.versions/2.0.10/.pi/harnesses/agent-hub/delegate.ts +446 -0
  204. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-coms.ts +237 -0
  205. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  206. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-native-complete.ts +154 -0
  207. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
  208. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +193 -0
  209. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-native-types.ts +230 -0
  210. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-native.ts +213 -0
  211. package/.versions/2.0.10/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  212. package/.versions/2.0.10/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  213. package/.versions/2.0.10/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
  214. package/.versions/2.0.10/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  215. package/.versions/2.0.10/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
  216. package/.versions/2.0.10/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  217. package/.versions/2.0.10/.pi/harnesses/agent-hub/fixtures/registration-surface.json +57 -0
  218. package/.versions/2.0.10/.pi/harnesses/agent-hub/footer.ts +30 -0
  219. package/.versions/2.0.10/.pi/harnesses/agent-hub/helpers.ts +266 -0
  220. package/.versions/2.0.10/.pi/harnesses/agent-hub/hub-state-audit.js +64 -0
  221. package/.versions/2.0.10/.pi/harnesses/agent-hub/index.ts +2132 -0
  222. package/.versions/2.0.10/.pi/harnesses/agent-hub/input/completions.ts +76 -0
  223. package/.versions/2.0.10/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
  224. package/.versions/2.0.10/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
  225. package/.versions/2.0.10/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  226. package/.versions/2.0.10/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  227. package/.versions/2.0.10/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
  228. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  229. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  230. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  231. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  232. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  233. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  234. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  235. package/.versions/2.0.10/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  236. package/.versions/2.0.10/.pi/harnesses/agent-hub/no-progress.ts +76 -0
  237. package/.versions/2.0.10/.pi/harnesses/agent-hub/package.json +7 -0
  238. package/.versions/2.0.10/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  239. package/.versions/2.0.10/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  240. package/.versions/2.0.10/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  241. package/.versions/2.0.10/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  242. package/.versions/2.0.10/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  243. package/.versions/2.0.10/.pi/harnesses/agent-hub/policy/work-mode.ts +119 -0
  244. package/.versions/2.0.10/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  245. package/.versions/2.0.10/.pi/harnesses/agent-hub/presentation.ts +48 -0
  246. package/.versions/2.0.10/.pi/harnesses/agent-hub/prompts/context.ts +47 -0
  247. package/.versions/2.0.10/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
  248. package/.versions/2.0.10/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  249. package/.versions/2.0.10/.pi/harnesses/agent-hub/prompts/system-prompt.ts +112 -0
  250. package/.versions/2.0.10/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  251. package/.versions/2.0.10/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  252. package/.versions/2.0.10/.pi/harnesses/agent-hub/research/runtime.ts +192 -0
  253. package/.versions/2.0.10/.pi/harnesses/agent-hub/research/spawn-run.ts +156 -0
  254. package/.versions/2.0.10/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  255. package/.versions/2.0.10/.pi/harnesses/agent-hub/return-contract.js +327 -0
  256. package/.versions/2.0.10/.pi/harnesses/agent-hub/return-extract.js +75 -0
  257. package/.versions/2.0.10/.pi/harnesses/agent-hub/review-findings.js +102 -0
  258. package/.versions/2.0.10/.pi/harnesses/agent-hub/run-budget.js +537 -0
  259. package/.versions/2.0.10/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  260. package/.versions/2.0.10/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  261. package/.versions/2.0.10/.pi/harnesses/agent-hub/scope-gate.js +123 -0
  262. package/.versions/2.0.10/.pi/harnesses/agent-hub/session-health.js +110 -0
  263. package/.versions/2.0.10/.pi/harnesses/agent-hub/session-start.ts +42 -0
  264. package/.versions/2.0.10/.pi/harnesses/agent-hub/spawn.ts +404 -0
  265. package/.versions/2.0.10/.pi/harnesses/agent-hub/timeline.ts +54 -0
  266. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/action-executors.ts +149 -0
  267. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  268. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/context.ts +134 -0
  269. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +82 -0
  270. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +335 -0
  271. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  272. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
  273. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
  274. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
  275. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
  276. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  277. package/.versions/2.0.10/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
  278. package/.versions/2.0.10/.pi/harnesses/agent-hub/types.ts +63 -0
  279. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
  280. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
  281. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
  282. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/fleet-actions.ts +76 -0
  283. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +99 -0
  284. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  285. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/fleet-source.ts +157 -0
  286. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/grid.ts +154 -0
  287. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  288. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  289. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  290. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  291. package/.versions/2.0.10/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
  292. package/.versions/2.0.10/.pi/harnesses/agent-hub/version.ts +42 -0
  293. package/.versions/2.0.10/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  294. package/.versions/2.0.10/.pi/harnesses/agent-hub/work-mode.ts +167 -0
  295. package/.versions/2.0.10/.pi/harnesses/ask-user-remote/README.md +59 -0
  296. package/.versions/2.0.10/.pi/harnesses/ask-user-remote/index.ts +558 -0
  297. package/.versions/2.0.10/.pi/harnesses/ask-user-remote/questions.ts +161 -0
  298. package/.versions/2.0.10/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  299. package/.versions/2.0.10/.pi/harnesses/ask-user-remote/runtime-ask.ts +43 -0
  300. package/.versions/2.0.10/.pi/harnesses/coms/README.md +100 -0
  301. package/.versions/2.0.10/.pi/harnesses/coms/index.ts +282 -0
  302. package/.versions/2.0.10/.pi/harnesses/coms/package.json +7 -0
  303. package/.versions/2.0.10/.pi/harnesses/coms/version.ts +42 -0
  304. package/.versions/2.0.10/.pi/harnesses/damage-control-continue/README.md +135 -0
  305. package/.versions/2.0.10/.pi/harnesses/damage-control-continue/index.ts +541 -0
  306. package/.versions/2.0.10/.pi/harnesses/damage-control-continue/package.json +7 -0
  307. package/.versions/2.0.10/.pi/harnesses/damage-control-continue/version.ts +42 -0
  308. package/.versions/2.0.10/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
  309. package/.versions/2.0.10/.pi/harnesses/lib/coms-core-io.ts +385 -0
  310. package/.versions/2.0.10/.pi/harnesses/lib/coms-core.ts +577 -0
  311. package/.versions/2.0.10/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  312. package/.versions/2.0.10/.pi/harnesses/lib/context-budget-child-prompt.ts +180 -0
  313. package/.versions/2.0.10/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
  314. package/.versions/2.0.10/.pi/harnesses/lib/context-budget-view.ts +107 -0
  315. package/.versions/2.0.10/.pi/harnesses/lib/context-budget.ts +114 -0
  316. package/.versions/2.0.10/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  317. package/.versions/2.0.10/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  318. package/.versions/2.0.10/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  319. package/.versions/2.0.10/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  320. package/.versions/2.0.10/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  321. package/.versions/2.0.10/.pi/harnesses/lib/fleet-dashboard-view.ts +134 -0
  322. package/.versions/2.0.10/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
  323. package/.versions/2.0.10/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  324. package/.versions/2.0.10/.pi/harnesses/lib/fleet-panel.ts +34 -0
  325. package/.versions/2.0.10/.pi/harnesses/lib/fleet-read-model.ts +213 -0
  326. package/.versions/2.0.10/.pi/harnesses/lib/fleet-selection.ts +24 -0
  327. package/.versions/2.0.10/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
  328. package/.versions/2.0.10/.pi/harnesses/lib/fleet-strip-view.ts +132 -0
  329. package/.versions/2.0.10/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  330. package/.versions/2.0.10/.pi/harnesses/lib/herdr-client.ts +472 -0
  331. package/.versions/2.0.10/.pi/harnesses/lib/herdr-presence.ts +399 -0
  332. package/.versions/2.0.10/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  333. package/.versions/2.0.10/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  334. package/.versions/2.0.10/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  335. package/.versions/2.0.10/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  336. package/.versions/2.0.10/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  337. package/.versions/2.0.10/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  338. package/.versions/2.0.10/.pi/harnesses/lib/spawned-peers.js +190 -0
  339. package/.versions/2.0.10/.pi/harnesses/lib/update-check.ts +222 -0
  340. package/.versions/2.0.10/.pi/harnesses/package-lock.json +2039 -0
  341. package/.versions/2.0.10/.pi/harnesses/package.json +10 -0
  342. package/.versions/2.0.10/.pi/prompts/af-build.md +24 -0
  343. package/.versions/2.0.10/.pi/prompts/af-code-simplify.md +22 -0
  344. package/.versions/2.0.10/.pi/prompts/af-constraints.md +31 -0
  345. package/.versions/2.0.10/.pi/prompts/af-plan.md +17 -0
  346. package/.versions/2.0.10/.pi/prompts/af-review.md +16 -0
  347. package/.versions/2.0.10/.pi/prompts/af-set-hermes-telegram.md +15 -0
  348. package/.versions/2.0.10/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  349. package/.versions/2.0.10/.pi/prompts/af-ship.md +17 -0
  350. package/.versions/2.0.10/.pi/prompts/af-spec.md +15 -0
  351. package/.versions/2.0.10/.pi/prompts/af-test.md +19 -0
  352. package/.versions/2.0.10/.pi/skills/bowser/SKILL.md +145 -0
  353. package/.versions/2.0.10/.version +1 -0
  354. package/.versions/2.0.10/agents/architect.md +25 -0
  355. package/.versions/2.0.10/agents/bowser.md +28 -0
  356. package/.versions/2.0.10/agents/builder.md +56 -0
  357. package/.versions/2.0.10/agents/code-reviewer.md +210 -0
  358. package/.versions/2.0.10/agents/deep-researcher.md +33 -0
  359. package/.versions/2.0.10/agents/documenter.md +23 -0
  360. package/.versions/2.0.10/agents/orchestrator.md +23 -0
  361. package/.versions/2.0.10/agents/plan-reviewer.md +84 -0
  362. package/.versions/2.0.10/agents/planner.md +106 -0
  363. package/.versions/2.0.10/agents/releaser.md +25 -0
  364. package/.versions/2.0.10/agents/researcher.md +31 -0
  365. package/.versions/2.0.10/agents/security-auditor.md +168 -0
  366. package/.versions/2.0.10/agents/test-engineer.md +154 -0
  367. package/.versions/2.0.10/agents/web-debugger.md +44 -0
  368. package/.versions/2.0.10/agents/web-performance-auditor.md +194 -0
  369. package/.versions/2.0.10/bin/catalog/harness-runtime-closure.json +32 -0
  370. package/.versions/2.0.10/codex/fleet-session-client/SKILL.md +34 -0
  371. package/.versions/2.0.10/codex/fleet-session-client.zip +0 -0
  372. package/.versions/2.0.10/docs/ARCHITECTURE.md +416 -0
  373. package/.versions/2.0.10/docs/agent-fleet-setup.md +586 -0
  374. package/.versions/2.0.10/docs/claude-code-coms-bridge.md +134 -0
  375. package/.versions/2.0.10/docs/codex-session-bridge.md +219 -0
  376. package/.versions/2.0.10/docs/coms-hermes-bridge.md +188 -0
  377. package/.versions/2.0.10/docs/getting-started.md +126 -0
  378. package/.versions/2.0.10/docs/npm-install.md +383 -0
  379. package/.versions/2.0.10/docs/pi-extensions.md +449 -0
  380. package/.versions/2.0.10/docs/pi-setup.md +92 -0
  381. package/.versions/2.0.10/docs/skill-anatomy.md +150 -0
  382. package/.versions/2.0.10/install-manifest.json +2991 -0
  383. package/.versions/2.0.10/justfile +247 -0
  384. package/.versions/2.0.10/manifest-meta.json +970 -0
  385. package/.versions/2.0.10/references/accessibility-checklist.md +160 -0
  386. package/.versions/2.0.10/references/communication-contract.md +26 -0
  387. package/.versions/2.0.10/references/definition-of-done.md +67 -0
  388. package/.versions/2.0.10/references/fleet-coordination-patterns.md +171 -0
  389. package/.versions/2.0.10/references/observability-checklist.md +92 -0
  390. package/.versions/2.0.10/references/orchestration-patterns.md +370 -0
  391. package/.versions/2.0.10/references/performance-checklist.md +236 -0
  392. package/.versions/2.0.10/references/prompting-patterns.md +380 -0
  393. package/.versions/2.0.10/references/security-checklist.md +245 -0
  394. package/.versions/2.0.10/references/testing-patterns.md +235 -0
  395. package/.versions/2.0.10/references/workflow-authoring.md +304 -0
  396. package/.versions/2.0.10/skills/_internal/grilling.md +59 -0
  397. package/.versions/2.0.10/skills/browser-testing-with-devtools/SKILL.md +351 -0
  398. package/.versions/2.0.10/skills/code-review-and-quality/SKILL.md +396 -0
  399. package/.versions/2.0.10/skills/compound-learning/SKILL.md +137 -0
  400. package/.versions/2.0.10/skills/constraint-driven-development/SKILL.md +338 -0
  401. package/.versions/2.0.10/skills/constraint-driven-development/references/floor-guard.md +99 -0
  402. package/.versions/2.0.10/skills/context-engineering/SKILL.md +341 -0
  403. package/.versions/2.0.10/skills/deprecation-and-migration/SKILL.md +247 -0
  404. package/.versions/2.0.10/skills/designing-agents/SKILL.md +394 -0
  405. package/.versions/2.0.10/skills/designing-agents/pi-harness-authoring.md +222 -0
  406. package/.versions/2.0.10/skills/drafting-workflows/SKILL.md +143 -0
  407. package/.versions/2.0.10/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  408. package/.versions/2.0.10/skills/frontend-ui-engineering/SKILL.md +328 -0
  409. package/.versions/2.0.10/skills/git-workflow-and-versioning/SKILL.md +316 -0
  410. package/.versions/2.0.10/skills/idea-refine/SKILL.md +182 -0
  411. package/.versions/2.0.10/skills/idea-refine/examples.md +238 -0
  412. package/.versions/2.0.10/skills/idea-refine/frameworks.md +99 -0
  413. package/.versions/2.0.10/skills/idea-refine/refinement-criteria.md +113 -0
  414. package/.versions/2.0.10/skills/idea-refine/scripts/idea-refine.sh +15 -0
  415. package/.versions/2.0.10/skills/incremental-implementation/SKILL.md +302 -0
  416. package/.versions/2.0.10/skills/interview-me/SKILL.md +226 -0
  417. package/.versions/2.0.10/skills/orchestration-verification/SKILL.md +182 -0
  418. package/.versions/2.0.10/skills/peer-coms/SKILL.md +90 -0
  419. package/.versions/2.0.10/skills/performance-optimization/SKILL.md +496 -0
  420. package/.versions/2.0.10/skills/planning-and-task-breakdown/SKILL.md +289 -0
  421. package/.versions/2.0.10/skills/security-and-hardening/SKILL.md +524 -0
  422. package/.versions/2.0.10/skills/spec-driven-development/SKILL.md +295 -0
  423. package/.versions/2.0.10/skills/using-agent-skills/SKILL.md +198 -0
  424. package/.versions/2.0.10/vendor/agent-skills-upstream/LICENSE +21 -0
  425. package/.versions/2.0.10/vendor/agent-skills-upstream/README.md +430 -0
  426. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  427. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  428. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  429. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  430. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  431. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  432. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  433. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  434. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  435. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  436. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  437. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  438. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  439. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  440. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  441. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  442. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  443. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  444. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  445. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  446. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  447. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  448. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  449. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  450. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  451. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  452. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  453. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  454. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  455. package/.versions/2.0.10/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  456. package/.versions/2.0.9/.pi/agent-fleet/hermes/README.md +347 -0
  457. package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  458. package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  459. package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  460. package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  461. package/.versions/2.0.9/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
  462. package/.versions/2.0.9/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
  463. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
  464. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  465. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  466. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  467. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  468. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  469. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  470. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  471. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  472. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  473. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  474. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  475. package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  476. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
  477. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
  478. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
  479. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
  480. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  481. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  482. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  483. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  484. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  485. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  486. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  487. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  488. package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  489. package/.versions/2.0.9/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
  490. package/.versions/2.0.9/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
  491. package/.versions/2.0.9/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
  492. package/.versions/2.0.9/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
  493. package/.versions/2.0.9/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
  494. package/.versions/2.0.9/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
  495. package/.versions/2.0.9/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
  496. package/.versions/2.0.9/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
  497. package/.versions/2.0.9/.pi/agent-fleet/scripts/fleet.ts +216 -0
  498. package/.versions/2.0.9/.pi/agent-fleet/scripts/flow.ts +137 -0
  499. package/.versions/2.0.9/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
  500. package/.versions/2.0.9/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
  501. package/.versions/2.0.9/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
  502. package/.versions/2.0.9/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
  503. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
  504. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
  505. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
  506. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
  507. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
  508. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
  509. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
  510. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
  511. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/flow-command.ts +93 -0
  512. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
  513. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
  514. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
  515. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
  516. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
  517. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
  518. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
  519. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
  520. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
  521. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
  522. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
  523. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
  524. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
  525. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
  526. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
  527. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
  528. package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
  529. package/.versions/2.0.9/.pi/agent-fleet/scripts/package-lock.json +35 -0
  530. package/.versions/2.0.9/.pi/agent-fleet/scripts/package.json +9 -0
  531. package/.versions/2.0.9/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
  532. package/.versions/2.0.9/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
  533. package/.versions/2.0.9/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
  534. package/.versions/2.0.9/.pi/agent-fleet/scripts/team-up.ts +378 -0
  535. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +133 -0
  536. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
  537. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
  538. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
  539. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
  540. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
  541. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
  542. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
  543. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
  544. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
  545. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
  546. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
  547. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
  548. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
  549. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
  550. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
  551. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
  552. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
  553. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
  554. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
  555. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
  556. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
  557. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
  558. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
  559. package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-scout.ts +38 -0
  560. package/.versions/2.0.9/.pi/agents/dispatch-policy.yaml +32 -0
  561. package/.versions/2.0.9/.pi/agents/model-profiles.yaml +83 -0
  562. package/.versions/2.0.9/.pi/agents/peers.yaml +147 -0
  563. package/.versions/2.0.9/.pi/agents/teams.yaml +41 -0
  564. package/.versions/2.0.9/.pi/agents/voices.yaml +13 -0
  565. package/.versions/2.0.9/.pi/damage-control-rules.yaml +297 -0
  566. package/.versions/2.0.9/.pi/extensions/btw/README.md +120 -0
  567. package/.versions/2.0.9/.pi/extensions/btw/index.ts +914 -0
  568. package/.versions/2.0.9/.pi/extensions/btw/package.json +6 -0
  569. package/.versions/2.0.9/.pi/extensions/btw/state.js +179 -0
  570. package/.versions/2.0.9/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  571. package/.versions/2.0.9/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  572. package/.versions/2.0.9/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  573. package/.versions/2.0.9/.pi/extensions/compact-and-continue/README.md +42 -0
  574. package/.versions/2.0.9/.pi/extensions/compact-and-continue/index.ts +120 -0
  575. package/.versions/2.0.9/.pi/extensions/compact-and-continue/package.json +6 -0
  576. package/.versions/2.0.9/.pi/extensions/mcp-bridge/README.md +46 -0
  577. package/.versions/2.0.9/.pi/extensions/mcp-bridge/index.ts +206 -0
  578. package/.versions/2.0.9/.pi/extensions/mcp-bridge/package.json +6 -0
  579. package/.versions/2.0.9/.pi/extensions/package-lock.json +1175 -0
  580. package/.versions/2.0.9/.pi/extensions/package.json +9 -0
  581. package/.versions/2.0.9/.pi/extensions/pi-voice-stt/README.md +205 -0
  582. package/.versions/2.0.9/.pi/extensions/pi-voice-stt/config.ts +198 -0
  583. package/.versions/2.0.9/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  584. package/.versions/2.0.9/.pi/extensions/pi-voice-stt/index.ts +248 -0
  585. package/.versions/2.0.9/.pi/extensions/pi-voice-stt/package.json +6 -0
  586. package/.versions/2.0.9/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  587. package/.versions/2.0.9/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  588. package/.versions/2.0.9/.pi/harnesses/agent-hub/README.md +1217 -0
  589. package/.versions/2.0.9/.pi/harnesses/agent-hub/acceptance.ts +62 -0
  590. package/.versions/2.0.9/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  591. package/.versions/2.0.9/.pi/harnesses/agent-hub/artifacts.js +146 -0
  592. package/.versions/2.0.9/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  593. package/.versions/2.0.9/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  594. package/.versions/2.0.9/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
  595. package/.versions/2.0.9/.pi/harnesses/agent-hub/budget-recovery.ts +97 -0
  596. package/.versions/2.0.9/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  597. package/.versions/2.0.9/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
  598. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  599. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  600. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  601. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  602. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  603. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  604. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  605. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  606. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  607. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  608. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  609. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
  610. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  611. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  612. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  613. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/context.ts +43 -0
  614. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  615. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  616. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  617. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  618. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  619. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  620. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
  621. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  622. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  623. package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  624. package/.versions/2.0.9/.pi/harnesses/agent-hub/config/agents.ts +177 -0
  625. package/.versions/2.0.9/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
  626. package/.versions/2.0.9/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
  627. package/.versions/2.0.9/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  628. package/.versions/2.0.9/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +213 -0
  629. package/.versions/2.0.9/.pi/harnesses/agent-hub/context/budgets.ts +202 -0
  630. package/.versions/2.0.9/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  631. package/.versions/2.0.9/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  632. package/.versions/2.0.9/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  633. package/.versions/2.0.9/.pi/harnesses/agent-hub/context-window.js +106 -0
  634. package/.versions/2.0.9/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  635. package/.versions/2.0.9/.pi/harnesses/agent-hub/delegate.ts +446 -0
  636. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-coms.ts +237 -0
  637. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  638. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-complete.ts +154 -0
  639. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
  640. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +193 -0
  641. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-types.ts +230 -0
  642. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native.ts +213 -0
  643. package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  644. package/.versions/2.0.9/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  645. package/.versions/2.0.9/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
  646. package/.versions/2.0.9/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  647. package/.versions/2.0.9/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
  648. package/.versions/2.0.9/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  649. package/.versions/2.0.9/.pi/harnesses/agent-hub/fixtures/registration-surface.json +57 -0
  650. package/.versions/2.0.9/.pi/harnesses/agent-hub/footer.ts +30 -0
  651. package/.versions/2.0.9/.pi/harnesses/agent-hub/helpers.ts +266 -0
  652. package/.versions/2.0.9/.pi/harnesses/agent-hub/hub-state-audit.js +64 -0
  653. package/.versions/2.0.9/.pi/harnesses/agent-hub/index.ts +2132 -0
  654. package/.versions/2.0.9/.pi/harnesses/agent-hub/input/completions.ts +76 -0
  655. package/.versions/2.0.9/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
  656. package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
  657. package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  658. package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
  659. package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
  660. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  661. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  662. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  663. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  664. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  665. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  666. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  667. package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  668. package/.versions/2.0.9/.pi/harnesses/agent-hub/no-progress.ts +76 -0
  669. package/.versions/2.0.9/.pi/harnesses/agent-hub/package.json +7 -0
  670. package/.versions/2.0.9/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  671. package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  672. package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  673. package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  674. package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
  675. package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/work-mode.ts +119 -0
  676. package/.versions/2.0.9/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  677. package/.versions/2.0.9/.pi/harnesses/agent-hub/presentation.ts +48 -0
  678. package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/context.ts +47 -0
  679. package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
  680. package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  681. package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/system-prompt.ts +112 -0
  682. package/.versions/2.0.9/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  683. package/.versions/2.0.9/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  684. package/.versions/2.0.9/.pi/harnesses/agent-hub/research/runtime.ts +192 -0
  685. package/.versions/2.0.9/.pi/harnesses/agent-hub/research/spawn-run.ts +156 -0
  686. package/.versions/2.0.9/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  687. package/.versions/2.0.9/.pi/harnesses/agent-hub/return-contract.js +293 -0
  688. package/.versions/2.0.9/.pi/harnesses/agent-hub/return-extract.js +75 -0
  689. package/.versions/2.0.9/.pi/harnesses/agent-hub/review-findings.js +102 -0
  690. package/.versions/2.0.9/.pi/harnesses/agent-hub/run-budget.js +537 -0
  691. package/.versions/2.0.9/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  692. package/.versions/2.0.9/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  693. package/.versions/2.0.9/.pi/harnesses/agent-hub/scope-gate.js +123 -0
  694. package/.versions/2.0.9/.pi/harnesses/agent-hub/session-health.js +110 -0
  695. package/.versions/2.0.9/.pi/harnesses/agent-hub/session-start.ts +42 -0
  696. package/.versions/2.0.9/.pi/harnesses/agent-hub/spawn.ts +404 -0
  697. package/.versions/2.0.9/.pi/harnesses/agent-hub/timeline.ts +54 -0
  698. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/action-executors.ts +149 -0
  699. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  700. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/context.ts +134 -0
  701. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +82 -0
  702. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +273 -0
  703. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  704. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
  705. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
  706. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
  707. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
  708. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  709. package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
  710. package/.versions/2.0.9/.pi/harnesses/agent-hub/types.ts +63 -0
  711. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
  712. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
  713. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
  714. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-actions.ts +76 -0
  715. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +99 -0
  716. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
  717. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-source.ts +157 -0
  718. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/grid.ts +154 -0
  719. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  720. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  721. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  722. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
  723. package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
  724. package/.versions/2.0.9/.pi/harnesses/agent-hub/version.ts +42 -0
  725. package/.versions/2.0.9/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  726. package/.versions/2.0.9/.pi/harnesses/agent-hub/work-mode.ts +167 -0
  727. package/.versions/2.0.9/.pi/harnesses/ask-user-remote/README.md +59 -0
  728. package/.versions/2.0.9/.pi/harnesses/ask-user-remote/index.ts +558 -0
  729. package/.versions/2.0.9/.pi/harnesses/ask-user-remote/questions.ts +161 -0
  730. package/.versions/2.0.9/.pi/harnesses/ask-user-remote/race-core.js +124 -0
  731. package/.versions/2.0.9/.pi/harnesses/ask-user-remote/runtime-ask.ts +43 -0
  732. package/.versions/2.0.9/.pi/harnesses/coms/README.md +100 -0
  733. package/.versions/2.0.9/.pi/harnesses/coms/index.ts +282 -0
  734. package/.versions/2.0.9/.pi/harnesses/coms/package.json +7 -0
  735. package/.versions/2.0.9/.pi/harnesses/coms/version.ts +42 -0
  736. package/.versions/2.0.9/.pi/harnesses/damage-control-continue/README.md +135 -0
  737. package/.versions/2.0.9/.pi/harnesses/damage-control-continue/index.ts +541 -0
  738. package/.versions/2.0.9/.pi/harnesses/damage-control-continue/package.json +7 -0
  739. package/.versions/2.0.9/.pi/harnesses/damage-control-continue/version.ts +42 -0
  740. package/.versions/2.0.9/.pi/harnesses/lib/coms-core-io.ts +385 -0
  741. package/.versions/2.0.9/.pi/harnesses/lib/coms-core.ts +577 -0
  742. package/.versions/2.0.9/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  743. package/.versions/2.0.9/.pi/harnesses/lib/context-budget-child-prompt.ts +180 -0
  744. package/.versions/2.0.9/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
  745. package/.versions/2.0.9/.pi/harnesses/lib/context-budget-view.ts +107 -0
  746. package/.versions/2.0.9/.pi/harnesses/lib/context-budget.ts +114 -0
  747. package/.versions/2.0.9/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  748. package/.versions/2.0.9/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  749. package/.versions/2.0.9/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  750. package/.versions/2.0.9/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  751. package/.versions/2.0.9/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
  752. package/.versions/2.0.9/.pi/harnesses/lib/fleet-dashboard-view.ts +134 -0
  753. package/.versions/2.0.9/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
  754. package/.versions/2.0.9/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  755. package/.versions/2.0.9/.pi/harnesses/lib/fleet-panel.ts +34 -0
  756. package/.versions/2.0.9/.pi/harnesses/lib/fleet-read-model.ts +213 -0
  757. package/.versions/2.0.9/.pi/harnesses/lib/fleet-selection.ts +24 -0
  758. package/.versions/2.0.9/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
  759. package/.versions/2.0.9/.pi/harnesses/lib/fleet-strip-view.ts +132 -0
  760. package/.versions/2.0.9/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  761. package/.versions/2.0.9/.pi/harnesses/lib/herdr-client.ts +472 -0
  762. package/.versions/2.0.9/.pi/harnesses/lib/herdr-presence.ts +399 -0
  763. package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  764. package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  765. package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  766. package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  767. package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  768. package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  769. package/.versions/2.0.9/.pi/harnesses/lib/spawned-peers.js +190 -0
  770. package/.versions/2.0.9/.pi/harnesses/lib/update-check.ts +222 -0
  771. package/.versions/2.0.9/.pi/harnesses/package-lock.json +2039 -0
  772. package/.versions/2.0.9/.pi/harnesses/package.json +10 -0
  773. package/.versions/2.0.9/.pi/prompts/af-build.md +24 -0
  774. package/.versions/2.0.9/.pi/prompts/af-code-simplify.md +22 -0
  775. package/.versions/2.0.9/.pi/prompts/af-constraints.md +31 -0
  776. package/.versions/2.0.9/.pi/prompts/af-plan.md +17 -0
  777. package/.versions/2.0.9/.pi/prompts/af-review.md +16 -0
  778. package/.versions/2.0.9/.pi/prompts/af-set-hermes-telegram.md +15 -0
  779. package/.versions/2.0.9/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  780. package/.versions/2.0.9/.pi/prompts/af-ship.md +17 -0
  781. package/.versions/2.0.9/.pi/prompts/af-spec.md +15 -0
  782. package/.versions/2.0.9/.pi/prompts/af-test.md +19 -0
  783. package/.versions/2.0.9/.pi/skills/bowser/SKILL.md +145 -0
  784. package/.versions/2.0.9/.version +1 -0
  785. package/.versions/2.0.9/agents/architect.md +25 -0
  786. package/.versions/2.0.9/agents/bowser.md +28 -0
  787. package/.versions/2.0.9/agents/builder.md +56 -0
  788. package/.versions/2.0.9/agents/code-reviewer.md +210 -0
  789. package/.versions/2.0.9/agents/deep-researcher.md +33 -0
  790. package/.versions/2.0.9/agents/documenter.md +23 -0
  791. package/.versions/2.0.9/agents/orchestrator.md +23 -0
  792. package/.versions/2.0.9/agents/plan-reviewer.md +84 -0
  793. package/.versions/2.0.9/agents/planner.md +106 -0
  794. package/.versions/2.0.9/agents/releaser.md +25 -0
  795. package/.versions/2.0.9/agents/researcher.md +31 -0
  796. package/.versions/2.0.9/agents/security-auditor.md +168 -0
  797. package/.versions/2.0.9/agents/test-engineer.md +154 -0
  798. package/.versions/2.0.9/agents/web-debugger.md +44 -0
  799. package/.versions/2.0.9/agents/web-performance-auditor.md +194 -0
  800. package/.versions/2.0.9/bin/catalog/harness-runtime-closure.json +32 -0
  801. package/.versions/2.0.9/codex/fleet-session-client/SKILL.md +34 -0
  802. package/.versions/2.0.9/codex/fleet-session-client.zip +0 -0
  803. package/.versions/2.0.9/docs/ARCHITECTURE.md +416 -0
  804. package/.versions/2.0.9/docs/agent-fleet-setup.md +568 -0
  805. package/.versions/2.0.9/docs/claude-code-coms-bridge.md +134 -0
  806. package/.versions/2.0.9/docs/codex-session-bridge.md +219 -0
  807. package/.versions/2.0.9/docs/coms-hermes-bridge.md +188 -0
  808. package/.versions/2.0.9/docs/getting-started.md +126 -0
  809. package/.versions/2.0.9/docs/npm-install.md +356 -0
  810. package/.versions/2.0.9/docs/pi-extensions.md +449 -0
  811. package/.versions/2.0.9/docs/pi-setup.md +76 -0
  812. package/.versions/2.0.9/docs/skill-anatomy.md +150 -0
  813. package/.versions/2.0.9/install-manifest.json +2991 -0
  814. package/.versions/2.0.9/justfile +247 -0
  815. package/.versions/2.0.9/manifest-meta.json +970 -0
  816. package/.versions/2.0.9/references/accessibility-checklist.md +160 -0
  817. package/.versions/2.0.9/references/communication-contract.md +26 -0
  818. package/.versions/2.0.9/references/definition-of-done.md +67 -0
  819. package/.versions/2.0.9/references/fleet-coordination-patterns.md +171 -0
  820. package/.versions/2.0.9/references/observability-checklist.md +92 -0
  821. package/.versions/2.0.9/references/orchestration-patterns.md +370 -0
  822. package/.versions/2.0.9/references/performance-checklist.md +236 -0
  823. package/.versions/2.0.9/references/prompting-patterns.md +380 -0
  824. package/.versions/2.0.9/references/security-checklist.md +245 -0
  825. package/.versions/2.0.9/references/testing-patterns.md +235 -0
  826. package/.versions/2.0.9/references/workflow-authoring.md +304 -0
  827. package/.versions/2.0.9/skills/_internal/grilling.md +59 -0
  828. package/.versions/2.0.9/skills/browser-testing-with-devtools/SKILL.md +351 -0
  829. package/.versions/2.0.9/skills/code-review-and-quality/SKILL.md +396 -0
  830. package/.versions/2.0.9/skills/compound-learning/SKILL.md +137 -0
  831. package/.versions/2.0.9/skills/constraint-driven-development/SKILL.md +338 -0
  832. package/.versions/2.0.9/skills/constraint-driven-development/references/floor-guard.md +99 -0
  833. package/.versions/2.0.9/skills/context-engineering/SKILL.md +341 -0
  834. package/.versions/2.0.9/skills/deprecation-and-migration/SKILL.md +247 -0
  835. package/.versions/2.0.9/skills/designing-agents/SKILL.md +394 -0
  836. package/.versions/2.0.9/skills/designing-agents/pi-harness-authoring.md +222 -0
  837. package/.versions/2.0.9/skills/drafting-workflows/SKILL.md +143 -0
  838. package/.versions/2.0.9/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  839. package/.versions/2.0.9/skills/frontend-ui-engineering/SKILL.md +328 -0
  840. package/.versions/2.0.9/skills/git-workflow-and-versioning/SKILL.md +316 -0
  841. package/.versions/2.0.9/skills/idea-refine/SKILL.md +182 -0
  842. package/.versions/2.0.9/skills/idea-refine/examples.md +238 -0
  843. package/.versions/2.0.9/skills/idea-refine/frameworks.md +99 -0
  844. package/.versions/2.0.9/skills/idea-refine/refinement-criteria.md +113 -0
  845. package/.versions/2.0.9/skills/idea-refine/scripts/idea-refine.sh +15 -0
  846. package/.versions/2.0.9/skills/incremental-implementation/SKILL.md +302 -0
  847. package/.versions/2.0.9/skills/interview-me/SKILL.md +226 -0
  848. package/.versions/2.0.9/skills/orchestration-verification/SKILL.md +181 -0
  849. package/.versions/2.0.9/skills/peer-coms/SKILL.md +90 -0
  850. package/.versions/2.0.9/skills/performance-optimization/SKILL.md +496 -0
  851. package/.versions/2.0.9/skills/planning-and-task-breakdown/SKILL.md +289 -0
  852. package/.versions/2.0.9/skills/security-and-hardening/SKILL.md +524 -0
  853. package/.versions/2.0.9/skills/spec-driven-development/SKILL.md +295 -0
  854. package/.versions/2.0.9/skills/using-agent-skills/SKILL.md +198 -0
  855. package/.versions/2.0.9/vendor/agent-skills-upstream/LICENSE +21 -0
  856. package/.versions/2.0.9/vendor/agent-skills-upstream/README.md +430 -0
  857. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
  858. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  859. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  860. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  861. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  862. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
  863. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
  864. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
  865. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  866. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  867. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
  868. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  869. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  870. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  871. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  872. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  873. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  874. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  875. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  876. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  877. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  878. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
  879. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
  880. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
  881. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
  882. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
  883. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
  884. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
  885. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
  886. package/.versions/2.0.9/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
  887. package/CHANGELOG.md +35 -0
  888. package/agents/architect.md +1 -1
  889. package/agents/bowser.md +1 -1
  890. package/agents/builder.md +1 -1
  891. package/agents/code-reviewer.md +1 -1
  892. package/agents/deep-researcher.md +1 -1
  893. package/agents/documenter.md +1 -1
  894. package/agents/orchestrator.md +1 -1
  895. package/agents/plan-reviewer.md +1 -1
  896. package/agents/planner.md +1 -1
  897. package/agents/releaser.md +1 -1
  898. package/agents/researcher.md +1 -1
  899. package/agents/security-auditor.md +1 -1
  900. package/agents/test-engineer.md +1 -1
  901. package/agents/web-debugger.md +1 -1
  902. package/agents/web-performance-auditor.md +1 -1
  903. package/bin/cli.js +8 -5
  904. package/bin/lib/path-boundaries.js +5 -6
  905. package/bin/lib/stt-wizard.js +154 -23
  906. package/docs/agent-fleet-setup.md +26 -8
  907. package/docs/npm-install.md +29 -2
  908. package/docs/pi-extensions.md +3 -0
  909. package/docs/pi-setup.md +16 -0
  910. package/install-manifest.json +1 -1
  911. package/package.json +45 -13
  912. package/skills/orchestration-verification/SKILL.md +1 -0
@@ -1,5 +1,7 @@
1
1
  import type { FleetRow } from "./fleet-read-model.ts";
2
2
  import { moveSelection, type Selection } from "./fleet-selection.ts";
3
+ import { confirmFleetAction, type FleetConfirmation } from "./fleet-dashboard-ops.ts";
4
+ import { safeTerminalText, treePrefix, type TextMetrics } from "./fleet-strip-view.ts";
3
5
 
4
6
  export interface ThemeLike { fg(color: string, text: string): string; bold(text: string): string; bg?(color: string, text: string): string; }
5
7
  export const FLEET_CHROME_ROWS = 4;
@@ -14,61 +16,46 @@ export interface FleetViewModel {
14
16
  comsLines?: readonly string[];
15
17
  }
16
18
 
17
- const ANSI = /\x1b\[[0-?]*[ -/]*[@-~]/g;
18
- const visibleWidth = (text: string) => Array.from(text.replace(ANSI, "")).length;
19
- /** Truncate terminal-styled text without cutting an ANSI sequence; close SGR styling when clipped. */
20
- const ellipsis = (text: string, width: number) => {
21
- if (visibleWidth(text) <= width) return text;
22
- if (width <= 0) return "";
23
- let out = "", visible = 0, i = 0, styled = false;
24
- const limit = Math.max(0, width - 1);
25
- while (i < text.length && visible < limit) {
26
- if (text[i] === "\x1b") {
27
- const match = text.slice(i).match(/^\x1b\[[0-?]*[ -/]*[@-~]/);
28
- if (match) { out += match[0]; styled = match[0] !== "\x1b[0m"; i += match[0].length; continue; }
29
- }
30
- const char = String.fromCodePoint(text.codePointAt(i)!);
31
- out += char; visible++; i += char.length;
32
- }
33
- return `${out}${width > 1 ? "…" : ""}${styled ? "\x1b[0m" : ""}`;
34
- };
19
+ const fit = (text: string, width: number, metrics: TextMetrics) => metrics.truncateToWidth(text, Math.max(0, width));
20
+ const padCells = (text: string, width: number, metrics: TextMetrics) => text + " ".repeat(Math.max(0, width - metrics.visibleWidth(text)));
35
21
  const duration = (ms: number) => ms < 60_000 ? `${Math.round(ms / 1000)}s` : `${Math.floor(ms / 60_000)}:${String(Math.round(ms / 1000) % 60).padStart(2, "0")}`;
36
22
  const tokens = (n: number | null) => n == null ? "—" : n >= 1000 ? `${Math.round(n / 1000)}k` : String(n);
37
23
  const glyph = (row: FleetRow) => row.status === "running" ? "●" : row.status === "done" ? "✓" : row.status === "error" ? "✗" : row.status === "pending" ? "◌" : row.status === "stale" ? "○" : "▪";
38
24
  const context = (pct: number | null) => pct == null ? "[automatic] —" : `[${"#".repeat(Math.max(0, Math.min(10, Math.round(pct / 10))))}${"·".repeat(Math.max(0, 10 - Math.round(pct / 10)))}] ${Math.round(pct)}%`;
39
25
 
40
26
  /** Render a constant-height, width-bounded fleet list without pi runtime dependencies. */
41
- export function renderFleetDashboard(vm: FleetViewModel, width: number, bodyHeight: number, theme: ThemeLike): string[] {
27
+ export function renderFleetDashboard(vm: FleetViewModel, width: number, bodyHeight: number, theme: ThemeLike, metrics: TextMetrics): string[] {
42
28
  const w = Math.max(1, width), body = Math.max(0, bodyHeight);
43
29
  const summary = `${vm.summary.running} running · ${vm.summary.done} done${vm.summary.failed ? ` · ${vm.summary.failed} failed` : ""} · ${duration(vm.summary.wallMs)} · ${tokens(vm.summary.totalTokens)} tok`;
44
- const header = ellipsis(` Fleet ${vm.filterQuery ? `· filter: ${vm.filterQuery}` : ""}`, Math.max(1, w - summary.length - 1));
45
- const lines: string[] = [ellipsis(theme.bold(header) + " " + theme.fg("dim", summary), w), theme.fg("dim", "╭" + "─".repeat(Math.max(0, w - 2)) + "╮")];
30
+ const title = ` Fleet ${vm.filterQuery ? `· filter: ${safeTerminalText(vm.filterQuery)}` : ""}`;
31
+ const header = fit(title, Math.max(1, w - metrics.visibleWidth(summary) - 1), metrics);
32
+ const lines: string[] = [fit(theme.bold(header) + " " + theme.fg("dim", summary), w, metrics), theme.fg("dim", "╭" + "─".repeat(Math.max(0, w - 2)) + "╮")];
46
33
  if (vm.rows.length === 0) {
47
34
  const message = "no agents dispatched yet";
48
- lines.push(...Array.from({ length: body }, (_, i) => i === Math.floor(body / 2) ? ellipsis(theme.fg("dim", message.padStart(Math.floor((w + message.length) / 2))), w) : ""));
35
+ lines.push(...Array.from({ length: body }, (_, i) => i === Math.floor(body / 2) ? fit(theme.fg("dim", " ".repeat(Math.max(0, Math.floor((w - metrics.visibleWidth(message)) / 2))) + message), w, metrics) : ""));
49
36
  } else {
50
37
  const offset = Math.max(0, Math.min(vm.scrollOffset ?? 0, Math.max(0, vm.rows.length - body)));
51
38
  for (let i = 0; i < body; i++) {
52
39
  const row = vm.rows[offset + i];
53
40
  if (!row) { lines.push(""); continue; }
54
41
  const selected = offset + i === vm.selection.index;
55
- const indent = row.depth ? " " + "└ ".repeat(row.depth) : " ";
56
- const name = `${selected ? "❯" : " "} ${glyph(row)} ${indent}${row.name}`;
57
- const parts = [name, row.kind, row.model, context(row.contextPct), tokens(row.contextTokens), duration(row.elapsed), row.toolCount == null ? "—" : String(row.toolCount), row.lastWork];
42
+ const indent = treePrefix(row.lastAtDepth, row.depth);
43
+ const name = `${selected ? "❯" : " "} ${indent}${glyph(row)} ${safeTerminalText(row.name)}`;
44
+ const parts = [name, row.kind, `${row.backend === "coms" ? "⇄ " : ""}${safeTerminalText(row.model)}`, context(row.contextPct), tokens(row.contextTokens), duration(row.elapsed), row.toolCount == null ? "—" : String(row.toolCount), safeTerminalText(row.lastWork)];
58
45
  const count = w < 80 ? 4 : w < 105 ? 6 : 8;
59
- const line = ellipsis(parts.slice(0, count).join(" "), w);
60
- lines.push(selected && theme.bg ? theme.bg("selectedBg", line.padEnd(w)) : line);
46
+ const line = fit(parts.slice(0, count).join(" "), w, metrics);
47
+ lines.push(selected && theme.bg ? theme.bg("selectedBg", padCells(line, w, metrics)) : line);
61
48
  }
62
49
  }
63
50
  lines.push(theme.fg("dim", "╰" + "─".repeat(Math.max(0, w - 2)) + "╯"));
64
- lines.push(ellipsis(theme.fg("dim", vm.confirmation ?? "↑↓ select · Enter open · h history · m substitute · x kill · r restart · f filter · a all · q close"), w));
51
+ lines.push(fit(theme.fg("dim", vm.confirmation ?? "↑↓ select · Enter open · h history · m substitute · x kill · r restart · f filter · a all · q close"), w, metrics));
65
52
  const coms = vm.comsLines ?? [];
66
53
  lines.push(...coms);
67
54
  const total = body + FLEET_CHROME_ROWS + coms.length;
68
55
  return lines.slice(0, total).concat(Array(Math.max(0, total - lines.length)).fill(""));
69
56
  }
70
57
 
71
- export type DashboardConfirm = { action: "kill" | "restart"; key: string; until: number } | null;
58
+ export type DashboardConfirm = FleetConfirmation;
72
59
  export interface DashboardControllerState {
73
60
  selection: Selection;
74
61
  scrollOffset: number;
@@ -90,7 +77,7 @@ export type DashboardIntent =
90
77
  export function dashboardTransition(
91
78
  input: string,
92
79
  state: DashboardControllerState,
93
- rows: readonly { key: string }[],
80
+ rows: readonly { key: string; runToken?: string }[],
94
81
  bodyHeight: number,
95
82
  now = Date.now(),
96
83
  ): DashboardIntent {
@@ -108,6 +95,7 @@ export function dashboardTransition(
108
95
  return null;
109
96
  }
110
97
  const selected = rows[state.selection.index];
98
+ if (input !== "x" && input !== "r") state.confirm = null;
111
99
  if (input === "\u001b[A" || input === "k" || input === "\u001b[B" || input === "j") {
112
100
  moveSelection(state.selection, rows, input === "\u001b[A" || input === "k" ? -1 : 1);
113
101
  const viewport = Math.max(1, bodyHeight);
@@ -136,12 +124,10 @@ export function dashboardTransition(
136
124
  if (input === "x" || input === "r") {
137
125
  if (!selected) return null;
138
126
  const action = input === "x" ? "kill" : "restart";
139
- if (state.confirm?.action === action && state.confirm.key === selected.key && state.confirm.until > now) {
140
- state.confirm = null;
141
- return action === "kill" ? { kill: selected.key } : { restart: selected.key };
142
- }
143
- state.confirm = { action, key: selected.key, until: now + 2000 };
144
- return null;
127
+ const result = confirmFleetAction(state.confirm, action, selected, now);
128
+ state.confirm = result.confirmation;
129
+ if (!result.confirmed) return null;
130
+ return action === "kill" ? { kill: selected.key } : { restart: selected.key };
145
131
  }
146
132
  if (input === "\u001b" || input === "q") return "close";
147
133
  return null;
@@ -1,5 +1,6 @@
1
1
  export type FleetKind = "specialist" | "research" | "delegate" | "peer";
2
2
  export type FleetStatus = "idle" | "running" | "done" | "error" | "pending" | "stale";
3
+ export type FleetTimingKind = "run" | "wait" | "unknown";
3
4
 
4
5
  export interface FleetRow {
5
6
  key: string;
@@ -14,21 +15,29 @@ export interface FleetRow {
14
15
  contextTokens: number | null;
15
16
  elapsed: number;
16
17
  startedAt?: number;
18
+ endedAt?: number;
19
+ timingKind?: FleetTimingKind;
20
+ runToken?: string;
21
+ aliasKeys?: readonly string[];
22
+ peerPresence?: "present" | "pending" | "stale";
17
23
  toolCount: number | null;
18
24
  lastWork: string;
19
25
  hasTimeline: boolean;
20
26
  colorHex?: string;
27
+ lastAtDepth?: readonly boolean[];
28
+ /** Included only to preserve the path to an eligible descendant. */
29
+ structuralOnly?: boolean;
21
30
  }
22
31
 
23
- export interface DelegateInput extends Omit<FleetRow, "kind" | "parentKey" | "depth" | "backend" | "hasTimeline"> {
32
+ export interface DelegateInput extends Omit<FleetRow, "kind" | "parentKey" | "depth" | "backend" | "hasTimeline" | "lastAtDepth" | "structuralOnly"> {
24
33
  children?: readonly DelegateInput[];
25
34
  }
26
- export interface SpecialistInput extends Omit<FleetRow, "kind" | "parentKey" | "depth"> {
35
+ export interface SpecialistInput extends Omit<FleetRow, "kind" | "parentKey" | "depth" | "lastAtDepth" | "structuralOnly"> {
27
36
  delegates?: readonly DelegateInput[];
28
37
  }
29
- export interface ResearchInput extends Omit<FleetRow, "kind" | "parentKey" | "depth"> {}
30
- export interface PeerInput extends Omit<FleetRow, "kind" | "parentKey" | "depth" | "backend" | "hasTimeline" | "status" | "contextPct" | "contextTokens" | "toolCount" | "elapsed"> {
31
- /** Registry-only entries have not answered a ping. */
38
+ export interface ResearchInput extends Omit<FleetRow, "kind" | "parentKey" | "depth" | "lastAtDepth" | "structuralOnly"> {}
39
+ export interface PeerInput extends Omit<FleetRow, "kind" | "parentKey" | "depth" | "backend" | "hasTimeline" | "status" | "contextPct" | "contextTokens" | "toolCount" | "elapsed" | "lastAtDepth" | "structuralOnly"> {
40
+ /** Registry-only entries have not answered a ping; this is presence, not a task queue. */
32
41
  pending?: boolean;
33
42
  staleCount?: number;
34
43
  status?: FleetStatus;
@@ -40,16 +49,16 @@ export interface FleetSource {
40
49
  peers: readonly PeerInput[];
41
50
  }
42
51
  export interface FleetFilter { showFinished: boolean; query?: string; }
52
+ export interface WidgetSelectionPin { key: string; runToken?: string; }
43
53
 
44
54
  /** Convert an authoritative run interval into row timing without re-anchoring completed work. */
45
- export function fleetTiming(interval: { startedAt: number; endedAt: number | null } | undefined, now = Date.now()): Pick<FleetRow, "startedAt" | "elapsed"> {
46
- if (!interval) return { startedAt: undefined, elapsed: 0 };
55
+ export function fleetTiming(interval: { startedAt: number; endedAt: number | null } | undefined, now = Date.now()): Pick<FleetRow, "startedAt" | "endedAt" | "elapsed" | "timingKind"> {
56
+ if (!interval) return { startedAt: undefined, endedAt: undefined, elapsed: 0, timingKind: "unknown" };
47
57
  const endedAt = interval.endedAt ?? now;
48
- return { startedAt: interval.startedAt, elapsed: Math.max(0, endedAt - interval.startedAt) };
58
+ return { startedAt: interval.startedAt, endedAt: interval.endedAt ?? undefined, elapsed: Math.max(0, endedAt - interval.startedAt), timingKind: "run" };
49
59
  }
50
60
 
51
61
  const statusOrder: Record<FleetStatus, number> = { running: 0, pending: 1, error: 2, done: 3, idle: 3, stale: 3 };
52
- // A roster member is idle until dispatched, not finished; keep it visible by default.
53
62
  const hiddenWhenFinished = new Set<FleetStatus>(["done", "stale"]);
54
63
 
55
64
  function compareRows(a: FleetRow, b: FleetRow): number {
@@ -64,6 +73,27 @@ function matches(row: FleetRow, query: string): boolean {
64
73
 
65
74
  interface FleetNode { row: FleetRow; children: FleetNode[]; }
66
75
 
76
+ /** Add branch metadata after filtering, preserving the supplied pre-order. */
77
+ export function withTreeMetadata(rows: readonly FleetRow[]): FleetRow[] {
78
+ const included = new Set(rows.map(row => row.key));
79
+ const children = new Map<string | undefined, FleetRow[]>();
80
+ for (const row of rows) {
81
+ const parent = row.parentKey && included.has(row.parentKey) ? row.parentKey : undefined;
82
+ const list = children.get(parent) ?? [];
83
+ list.push(row);
84
+ children.set(parent, list);
85
+ }
86
+ const out: FleetRow[] = [];
87
+ const emit = (row: FleetRow, path: readonly boolean[]) => {
88
+ out.push({ ...row, depth: path.length, parentKey: row.parentKey && included.has(row.parentKey) ? row.parentKey : undefined, lastAtDepth: path });
89
+ const nested = children.get(row.key) ?? [];
90
+ nested.forEach((child, index) => emit(child, [...path, index === nested.length - 1]));
91
+ };
92
+ const roots = children.get(undefined) ?? [];
93
+ roots.forEach(row => emit(row, []));
94
+ return out;
95
+ }
96
+
67
97
  /** Collapse local specialists, delegate trees, research, and coms peers into stable display rows. */
68
98
  export function buildFleetRows(src: FleetSource, filter: FleetFilter): FleetRow[] {
69
99
  const query = filter.query?.trim().toLowerCase() ?? "";
@@ -78,8 +108,9 @@ export function buildFleetRows(src: FleetSource, filter: FleetFilter): FleetRow[
78
108
  });
79
109
  for (const input of src.research) roots.push({ row: { ...input, kind: "research", depth: 0 }, children: [] });
80
110
  for (const input of src.peers) {
81
- const status: FleetStatus = input.pending ? "pending" : (input.staleCount ?? 0) >= 3 ? "stale" : (input.status ?? "idle");
82
- roots.push({ row: { ...input, kind: "peer", depth: 0, status, backend: "coms", contextPct: null, contextTokens: null, toolCount: null, elapsed: input.elapsed ?? 0, hasTimeline: false }, children: [] });
111
+ const stale = (input.staleCount ?? 0) >= 3;
112
+ const status: FleetStatus = input.status ?? (input.pending ? "pending" : stale ? "stale" : "idle");
113
+ roots.push({ row: { ...input, kind: "peer", depth: 0, status, backend: "coms", contextPct: null, contextTokens: null, toolCount: null, elapsed: input.elapsed ?? 0, timingKind: input.timingKind ?? "unknown", peerPresence: input.peerPresence ?? (input.pending ? "pending" : stale ? "stale" : "present"), hasTimeline: false }, children: [] });
83
114
  }
84
115
  roots.sort((a, b) => compareRows(a.row, b.row));
85
116
  const visible = (node: FleetNode): boolean => {
@@ -89,34 +120,85 @@ export function buildFleetRows(src: FleetSource, filter: FleetFilter): FleetRow[
89
120
  return own || children.length > 0;
90
121
  };
91
122
  const out: FleetRow[] = [];
92
- const emit = (node: FleetNode) => {
93
- out.push(node.row);
94
- for (const child of node.children) emit(child);
95
- };
123
+ const emit = (node: FleetNode) => { out.push(node.row); for (const child of node.children) emit(child); };
96
124
  for (const root of roots) if (visible(root)) emit(root);
97
- return out;
125
+ return withTreeMetadata(out);
126
+ }
127
+
128
+ /** Select widget rows using a single snapshot clock and exact terminal retention. */
129
+ export function selectWidgetRows(rows: readonly FleetRow[], now: number, pin?: WidgetSelectionPin): FleetRow[] {
130
+ const byKey = new Map(rows.map(row => [row.key, row]));
131
+ const include = new Set<string>();
132
+ for (const row of rows) {
133
+ const activeTask = row.kind !== "peer" && (row.status === "running" || row.status === "pending");
134
+ const activePeer = row.kind === "peer" && row.status === "running";
135
+ const retained = row.kind !== "peer" && (row.status === "done" || row.status === "error") && row.endedAt != null && now < row.endedAt + 10_000;
136
+ const pinned = !!pin && row.key === pin.key && (row.status === "done" || row.status === "error") && row.runToken === pin.runToken;
137
+ if (activeTask || activePeer || retained || pinned) include.add(row.key);
138
+ }
139
+ for (const key of [...include]) {
140
+ let row = byKey.get(key);
141
+ const seen = new Set<string>();
142
+ while (row?.parentKey && !seen.has(row.parentKey)) {
143
+ seen.add(row.parentKey); include.add(row.parentKey); row = byKey.get(row.parentKey);
144
+ }
145
+ }
146
+ return withTreeMetadata(rows.filter(row => include.has(row.key)).map(row => ({ ...row, structuralOnly: !(
147
+ (row.kind !== "peer" && (row.status === "running" || row.status === "pending")) ||
148
+ (row.kind === "peer" && row.status === "running") ||
149
+ (row.kind !== "peer" && (row.status === "done" || row.status === "error") && row.endedAt != null && now < row.endedAt + 10_000) ||
150
+ (!!pin && row.key === pin.key && row.runToken === pin.runToken)
151
+ ) })));
98
152
  }
99
153
 
100
154
  /** Total covered length of possibly overlapping intervals. */
101
155
  export function unionMs(intervals: readonly [number, number][]): number {
102
156
  if (intervals.length === 0) return 0;
103
157
  const sorted = intervals.slice().sort((a, b) => a[0] - b[0]);
104
- let total = 0;
105
- let start = sorted[0][0];
106
- let end = sorted[0][1];
158
+ let total = 0, start = sorted[0][0], end = sorted[0][1];
107
159
  for (let i = 1; i < sorted.length; i++) {
108
160
  const [nextStart, nextEnd] = sorted[i];
109
- if (nextStart > end) {
110
- total += end - start;
111
- [start, end] = [nextStart, nextEnd];
112
- } else if (nextEnd > end) {
113
- end = nextEnd;
114
- }
161
+ if (nextStart > end) { total += end - start; [start, end] = [nextStart, nextEnd]; }
162
+ else if (nextEnd > end) end = nextEnd;
115
163
  }
116
164
  return total + end - start;
117
165
  }
118
166
 
119
- /** Aggregate visible rows; callers use unionMs(intervals) for overlap-aware wall time. */
167
+ export interface StripSummary {
168
+ running: number;
169
+ peerActive: number;
170
+ done: number;
171
+ failed: number;
172
+ contextMax: number | null;
173
+ contextKnown: number;
174
+ contextTotal: number;
175
+ wallMs: number;
176
+ wallKnown: number;
177
+ wallTotal: number;
178
+ }
179
+
180
+ /** Aggregate the whole eligible widget set, excluding peer waits and structural context. */
181
+ export function summariseWidget(rows: readonly FleetRow[]): StripSummary {
182
+ let running = 0, peerActive = 0, done = 0, failed = 0, contextMax: number | null = null, contextKnown = 0, contextTotal = 0, wallKnown = 0, wallTotal = 0;
183
+ const intervals: Array<[number, number]> = [];
184
+ for (const row of rows) {
185
+ if (row.structuralOnly) continue;
186
+ if (row.kind === "peer") { if (row.status === "running") peerActive++; continue; }
187
+ if (row.status === "running") {
188
+ running++; contextTotal++;
189
+ if (row.contextPct != null && Number.isFinite(row.contextPct)) { contextKnown++; contextMax = Math.max(contextMax ?? -Infinity, row.contextPct); }
190
+ }
191
+ if (row.status === "done") done++;
192
+ if (row.status === "error") failed++;
193
+ if (["running", "done", "error"].includes(row.status)) {
194
+ wallTotal++;
195
+ if (row.timingKind === "run" && row.startedAt != null) { wallKnown++; intervals.push([row.startedAt, row.endedAt ?? row.startedAt + Math.max(0, row.elapsed)]); }
196
+ }
197
+ }
198
+ return { running, peerActive, done, failed, contextMax, contextKnown, contextTotal, wallMs: unionMs(intervals), wallKnown, wallTotal };
199
+ }
200
+
201
+ /** Backward-compatible dashboard aggregate. */
120
202
  export function summarise(rows: readonly FleetRow[]): { running: number; done: number; failed: number; totalTokens: number; intervals: Array<[number, number]> } {
121
203
  const intervals: Array<[number, number]> = [];
122
204
  let running = 0, done = 0, failed = 0, totalTokens = 0;
@@ -125,7 +207,7 @@ export function summarise(rows: readonly FleetRow[]): { running: number; done: n
125
207
  if (row.status === "done") done++;
126
208
  if (row.status === "error") failed++;
127
209
  if (row.contextTokens != null) totalTokens += row.contextTokens;
128
- if (row.startedAt != null) intervals.push([row.startedAt, row.startedAt + Math.max(0, row.elapsed)]);
210
+ if (row.timingKind !== "wait" && row.startedAt != null) intervals.push([row.startedAt, row.endedAt ?? row.startedAt + Math.max(0, row.elapsed)]);
129
211
  }
130
212
  return { running, done, failed, totalTokens, intervals };
131
213
  }
@@ -0,0 +1,74 @@
1
+ import { confirmFleetAction, type FleetConfirmation } from "./fleet-dashboard-ops.ts";
2
+ import type { FleetRow } from "./fleet-read-model.ts";
3
+
4
+ export interface FleetStripState {
5
+ active: boolean;
6
+ selectedKey?: string;
7
+ index: number;
8
+ offset: number;
9
+ confirmation: FleetConfirmation;
10
+ pendingAction: boolean;
11
+ }
12
+ export interface FleetStripGate {
13
+ interactiveAvailable: boolean;
14
+ focused: boolean;
15
+ editorEmpty: boolean;
16
+ autocomplete: boolean;
17
+ modal: boolean;
18
+ bodyRows: number;
19
+ }
20
+ export interface FleetStripInput { data: string; keyRelease?: boolean; paste?: boolean; }
21
+ export type FleetStripIntent = { type: "open" | "kill" | "restart"; key: string; runToken?: string };
22
+ export interface FleetStripTransition { state: FleetStripState; consume: boolean; intent?: FleetStripIntent; }
23
+
24
+ export function initialFleetStripState(): FleetStripState {
25
+ return { active: false, index: 0, offset: 0, confirmation: null, pendingAction: false };
26
+ }
27
+
28
+ export function reconcileStripState(state: FleetStripState, rows: readonly FleetRow[], bodyRows: number): FleetStripState {
29
+ const next = { ...state };
30
+ let index = next.selectedKey ? rows.findIndex(row => row.key === next.selectedKey || row.aliasKeys?.includes(next.selectedKey!)) : -1;
31
+ if (index < 0) index = Math.max(0, Math.min(next.index, Math.max(0, rows.length - 1)));
32
+ next.index = index;
33
+ next.selectedKey = rows[index]?.key;
34
+ const body = Math.max(0, bodyRows);
35
+ if (body === 0) {
36
+ next.active = false;
37
+ next.confirmation = null;
38
+ next.offset = 0;
39
+ } else {
40
+ if (index < next.offset) next.offset = index;
41
+ else if (index >= next.offset + body) next.offset = index - body + 1;
42
+ next.offset = Math.max(0, Math.min(next.offset, Math.max(0, rows.length - body)));
43
+ }
44
+ if (!rows.some(row => row.key === next.confirmation?.key && row.runToken === next.confirmation?.runToken)) next.confirmation = null;
45
+ return next;
46
+ }
47
+
48
+ const gateOpen = (gate: FleetStripGate, rows: readonly FleetRow[]) => gate.interactiveAvailable && gate.focused && gate.editorEmpty && !gate.autocomplete && !gate.modal && gate.bodyRows > 0 && rows.length > 0;
49
+
50
+ /** Pure focused-editor keyboard controller. Unknown input always passes through once. */
51
+ export function fleetStripTransition(input: FleetStripInput, state: FleetStripState, rows: readonly FleetRow[], gate: FleetStripGate, now: number): FleetStripTransition {
52
+ let next = reconcileStripState(state, rows, gate.bodyRows);
53
+ if (input.keyRelease || input.paste || !gateOpen(gate, rows)) return { state: { ...next, active: false, confirmation: null }, consume: false };
54
+ const data = input.data;
55
+ if (data === "toggle") return { state: { ...next, active: !next.active, confirmation: null }, consume: true };
56
+ if (!next.active) return { state: next, consume: false };
57
+ if (data === "\u001b") return { state: { ...next, active: false, confirmation: null }, consume: true };
58
+ const direction = data === "k" ? -1 : data === "j" ? 1 : 0;
59
+ if (direction) {
60
+ const index = Math.max(0, Math.min(rows.length - 1, next.index + direction));
61
+ next = reconcileStripState({ ...next, index, selectedKey: rows[index]?.key, confirmation: null }, rows, gate.bodyRows);
62
+ return { state: next, consume: true };
63
+ }
64
+ const selected = rows[next.index];
65
+ if (data === "\r" && selected) return { state: { ...next, active: false, confirmation: null }, consume: true, intent: { type: "open", key: selected.key, runToken: selected.runToken } };
66
+ if ((data === "x" || data === "r") && selected) {
67
+ if (next.pendingAction) return { state: next, consume: true };
68
+ const action = data === "x" ? "kill" : "restart";
69
+ const result = confirmFleetAction(next.confirmation, action, selected, now);
70
+ next = { ...next, confirmation: result.confirmation };
71
+ return result.confirmed ? { state: { ...next, pendingAction: true }, consume: true, intent: { type: action, key: selected.key, runToken: selected.runToken } } : { state: next, consume: true };
72
+ }
73
+ return { state: { ...next, active: false, confirmation: null }, consume: false };
74
+ }
@@ -0,0 +1,132 @@
1
+ import type { FleetRow, StripSummary } from "./fleet-read-model.ts";
2
+ import type { ThemeLike } from "./fleet-dashboard-view.ts";
3
+
4
+ export interface TextMetrics {
5
+ visibleWidth(text: string): number;
6
+ truncateToWidth(text: string, width: number): string;
7
+ }
8
+ export interface StripWindow {
9
+ rows: readonly FleetRow[];
10
+ offset: number;
11
+ above: number;
12
+ below: number;
13
+ activeAbove: number;
14
+ activeBelow: number;
15
+ ancestorPath: readonly string[];
16
+ }
17
+ export interface StripViewModel {
18
+ active: boolean;
19
+ interactiveAvailable: boolean;
20
+ selectedKey?: string;
21
+ summary: StripSummary;
22
+ window: StripWindow;
23
+ maxRows: number;
24
+ confirmation?: string;
25
+ }
26
+
27
+ export function treePrefix(lastAtDepth: readonly boolean[] | undefined, depth = 0): string {
28
+ if (!lastAtDepth) return " ".repeat(Math.max(0, depth));
29
+ if (!lastAtDepth.length) return "";
30
+ return lastAtDepth.slice(0, -1).map(last => last ? " " : "│ ").join("") + (lastAtDepth.at(-1) ? "└─ " : "├─ ");
31
+ }
32
+
33
+ const active = (row: FleetRow) => row.status === "running" || (row.status === "pending" && row.kind !== "peer");
34
+
35
+ /** A bounded contiguous pre-order viewport; selection and offset are already reconciled. */
36
+ export function visibleWindow(rows: readonly FleetRow[], selectedIndex: number, offset: number, bodyRows: number): StripWindow {
37
+ const body = Math.max(0, Math.floor(bodyRows));
38
+ if (!body || !rows.length) return { rows: [], offset: 0, above: 0, below: rows.length, activeAbove: 0, activeBelow: rows.filter(active).length, ancestorPath: [] };
39
+ const selected = Math.max(0, Math.min(rows.length - 1, selectedIndex));
40
+ let start = Math.max(0, Math.min(Math.floor(offset), Math.max(0, rows.length - body)));
41
+ if (selected < start) start = selected;
42
+ else if (selected >= start + body) start = selected - body + 1;
43
+ start = Math.max(0, Math.min(start, Math.max(0, rows.length - body)));
44
+ const slice = rows.slice(start, start + body);
45
+ const byKey = new Map(rows.map(row => [row.key, row]));
46
+ const ancestors: string[] = [];
47
+ let cursor = slice[0];
48
+ const seen = new Set<string>();
49
+ while (cursor?.parentKey && !seen.has(cursor.parentKey)) {
50
+ seen.add(cursor.parentKey);
51
+ const parent = byKey.get(cursor.parentKey);
52
+ if (!parent) break;
53
+ if (rows.indexOf(parent) < start) ancestors.unshift(parent.name);
54
+ cursor = parent;
55
+ }
56
+ const below = Math.max(0, rows.length - start - slice.length);
57
+ return {
58
+ rows: slice, offset: start, above: start, below,
59
+ activeAbove: rows.slice(0, start).filter(active).length,
60
+ activeBelow: rows.slice(start + slice.length).filter(active).length,
61
+ ancestorPath: ancestors,
62
+ };
63
+ }
64
+
65
+ /** Remove hostile terminal controls and force arbitrary source fields onto one line. */
66
+ export function safeTerminalText(value: unknown): string {
67
+ return String(value ?? "")
68
+ .replace(/\x1b\][^\x07]*(?:\x07|\x1b\\)/g, "")
69
+ .replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "")
70
+ .replace(/[\x00-\x1f\x7f-\x9f]+/g, " ")
71
+ .replace(/\s+/g, " ").trim();
72
+ }
73
+
74
+ const duration = (row: FleetRow) => row.timingKind === "unknown" || row.startedAt == null ? "—" : row.elapsed < 60_000 ? `${Math.floor(row.elapsed / 1000)}s` : `${Math.floor(row.elapsed / 60_000)}m${String(Math.floor(row.elapsed / 1000) % 60).padStart(2, "0")}s`;
75
+ const glyph = (row: FleetRow) => row.status === "running" ? "●" : row.status === "pending" ? "◦" : row.status === "done" ? "✓" : row.status === "error" ? "✗" : row.status === "stale" ? "○" : "▪";
76
+ const ctx = (row: FleetRow) => row.contextPct == null ? "ctx —" : `ctx ${Math.round(row.contextPct)}%`;
77
+ function padLeft(value: string, width: number, metrics: TextMetrics): string { return " ".repeat(Math.max(0, width - metrics.visibleWidth(value))) + value; }
78
+ function fit(value: string, width: number, metrics: TextMetrics): string { return metrics.truncateToWidth(value, Math.max(0, width)); }
79
+
80
+ export function summaryFields(summary: StripSummary): string[] {
81
+ const fields = [`${summary.running} running`, `${summary.peerActive} peer active`];
82
+ const wallPartial = summary.wallKnown < summary.wallTotal ? ` (${summary.wallKnown}/${summary.wallTotal} known)` : "";
83
+ fields.push(`wall ${summary.wallKnown ? Math.floor(summary.wallMs / 1000) + "s" : "—"}${wallPartial}`);
84
+ const contextPartial = summary.contextKnown < summary.contextTotal ? ` (${summary.contextKnown}/${summary.contextTotal} known)` : "";
85
+ fields.push(`ctx max ${summary.contextMax == null ? "—" : Math.round(summary.contextMax) + "%"}${contextPartial}`);
86
+ return fields;
87
+ }
88
+ export function summaryText(summary: StripSummary): string { return summaryFields(summary).join(" · "); }
89
+
90
+ function collapsedSummary(summary: StripSummary, width: number, hint: string, metrics: TextMetrics): string {
91
+ const fields = summaryFields(summary);
92
+ for (let count = fields.length; count > 0; count--) {
93
+ const candidate = ` ${fields.slice(0, count).join(" · ")}${hint}`;
94
+ if (metrics.visibleWidth(candidate) <= width) return candidate;
95
+ }
96
+ return fit(` ${fields[0] ?? ""}`, width, metrics);
97
+ }
98
+
99
+ /** Pure, display-cell bounded widget rendering. */
100
+ export function renderFleetStrip(vm: StripViewModel, width: number, theme: ThemeLike, metrics: TextMetrics): string[] {
101
+ const budget = Math.max(0, Math.floor(vm.maxRows));
102
+ const w = Math.max(0, Math.floor(width));
103
+ if (!budget || !w || (!vm.window.rows.length && vm.summary.running + vm.summary.peerActive === 0)) return [];
104
+ const hint = vm.interactiveAvailable ? " · Alt+I inspect" : "";
105
+ const collapsed = fit(theme.fg("dim", collapsedSummary(vm.summary, w, hint, metrics)), w, metrics);
106
+ if (!vm.active || budget < 4) return [collapsed].slice(0, budget);
107
+ const body = Math.max(0, budget - 3);
108
+ const windowRows = vm.window.rows.slice(0, body);
109
+ const help = vm.confirmation ?? "j/k select · Alt+I collapse · enter open · x/r confirm · esc back";
110
+ const breadcrumb = vm.window.ancestorPath.length ? ` · ${safeTerminalText(vm.window.ancestorPath.join(" / "))}` : "";
111
+ const above = vm.window.above ? `↑ ${vm.window.above} more · ${vm.window.activeAbove} active${breadcrumb}` : "";
112
+ const below = vm.window.below ? `↓ ${vm.window.below} more · ${vm.window.activeBelow} active` : "";
113
+ const lines = [fit(theme.fg("dim", help), w, metrics), fit(theme.fg("dim", above), w, metrics)];
114
+ for (const row of windowRows) {
115
+ const marker = row.key === vm.selectedKey ? "❯" : " ";
116
+ const backend = row.backend === "coms" ? "⇄ " : "";
117
+ const identity = `${treePrefix(row.lastAtDepth, row.depth)}${glyph(row)} ${safeTerminalText(row.name)}`;
118
+ const elapsed = padLeft(duration(row), 6, metrics);
119
+ let line: string;
120
+ if (w < 80) line = `${marker} ${identity} ${elapsed}`;
121
+ else if (w < 105) line = `${marker} ${identity} ${backend}${safeTerminalText(row.model)} ${ctx(row)} ${elapsed}`;
122
+ else line = `${marker} ${identity} ${backend}${safeTerminalText(row.model)} ${elapsed} ${row.toolCount == null ? "—" : row.toolCount} tools ${ctx(row)} ${safeTerminalText(row.lastWork)}`;
123
+ line = fit(line, w, metrics);
124
+ if (row.key === vm.selectedKey && theme.bg) {
125
+ const cells = metrics.visibleWidth(line);
126
+ line = theme.bg("selectedBg", line + " ".repeat(Math.max(0, w - cells)));
127
+ }
128
+ lines.push(line);
129
+ }
130
+ lines.push(fit(theme.fg("dim", below), w, metrics));
131
+ return lines.slice(0, budget);
132
+ }