@chankov/agent-fleet 2.0.4 → 2.0.5

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 (449) hide show
  1. package/.pi/agents/model-profiles.yaml +39 -34
  2. package/.pi/harnesses/agent-hub/README.md +11 -32
  3. package/.pi/harnesses/agent-hub/context/agent-state.ts +1 -1
  4. package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +2 -0
  5. package/.pi/harnesses/agent-hub/dispatch-native-types.ts +1 -0
  6. package/.pi/harnesses/agent-hub/dispatch-native.ts +31 -19
  7. package/.pi/harnesses/agent-hub/dispatch-observability.ts +6 -1
  8. package/.pi/harnesses/agent-hub/footer.ts +2 -2
  9. package/.pi/harnesses/agent-hub/index.ts +69 -42
  10. package/.pi/harnesses/agent-hub/input/shortcuts.ts +0 -29
  11. package/.pi/harnesses/agent-hub/package.json +1 -1
  12. package/.pi/harnesses/agent-hub/policy/profile-runtime.ts +59 -3
  13. package/.pi/harnesses/agent-hub/research/runtime.ts +3 -1
  14. package/.pi/harnesses/agent-hub/research/spawn-run.ts +4 -0
  15. package/.pi/harnesses/agent-hub/tools/action-executors.ts +5 -4
  16. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +34 -1
  17. package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +4 -2
  18. package/.pi/harnesses/agent-hub/types.ts +1 -0
  19. package/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
  20. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +4 -2
  21. package/.pi/harnesses/agent-hub/ui/grid.ts +16 -118
  22. package/.pi/harnesses/agent-hub/ui/pool.ts +1 -6
  23. package/.pi/harnesses/agent-hub/ui/running-strip.ts +139 -0
  24. package/.pi/harnesses/coms/package.json +1 -1
  25. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  26. package/.pi/harnesses/lib/fleet-dashboard-ops.ts +0 -5
  27. package/.pi/harnesses/lib/fleet-dashboard-view.ts +8 -2
  28. package/.versions/2.0.5/.pi/agents/dispatch-policy.yaml +32 -0
  29. package/.versions/2.0.5/.pi/agents/model-profiles.yaml +83 -0
  30. package/.versions/2.0.5/.pi/agents/peers.yaml +145 -0
  31. package/.versions/2.0.5/.pi/agents/teams.yaml +41 -0
  32. package/.versions/2.0.5/.pi/agents/voices.yaml +13 -0
  33. package/.versions/2.0.5/.pi/damage-control-rules.yaml +297 -0
  34. package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/README.md +57 -0
  35. package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  36. package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  37. package/.versions/2.0.5/.pi/extensions/btw/README.md +120 -0
  38. package/.versions/2.0.5/.pi/extensions/btw/index.ts +914 -0
  39. package/.versions/2.0.5/.pi/extensions/btw/package.json +6 -0
  40. package/.versions/2.0.5/.pi/extensions/btw/state.js +179 -0
  41. package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  42. package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  43. package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  44. package/.versions/2.0.5/.pi/extensions/compact-and-continue/README.md +42 -0
  45. package/.versions/2.0.5/.pi/extensions/compact-and-continue/index.ts +120 -0
  46. package/.versions/2.0.5/.pi/extensions/compact-and-continue/package.json +6 -0
  47. package/.versions/2.0.5/.pi/extensions/mcp-bridge/README.md +46 -0
  48. package/.versions/2.0.5/.pi/extensions/mcp-bridge/index.ts +206 -0
  49. package/.versions/2.0.5/.pi/extensions/mcp-bridge/package.json +6 -0
  50. package/.versions/2.0.5/.pi/extensions/package-lock.json +1175 -0
  51. package/.versions/2.0.5/.pi/extensions/package.json +9 -0
  52. package/.versions/2.0.5/.pi/extensions/pi-voice-stt/README.md +205 -0
  53. package/.versions/2.0.5/.pi/extensions/pi-voice-stt/config.ts +198 -0
  54. package/.versions/2.0.5/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  55. package/.versions/2.0.5/.pi/extensions/pi-voice-stt/index.ts +248 -0
  56. package/.versions/2.0.5/.pi/extensions/pi-voice-stt/package.json +6 -0
  57. package/.versions/2.0.5/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  58. package/.versions/2.0.5/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  59. package/.versions/2.0.5/.pi/harnesses/agent-hub/README.md +1139 -0
  60. package/.versions/2.0.5/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  61. package/.versions/2.0.5/.pi/harnesses/agent-hub/artifacts.js +146 -0
  62. package/.versions/2.0.5/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  63. package/.versions/2.0.5/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  64. package/.versions/2.0.5/.pi/harnesses/agent-hub/budget-continuation.ts +73 -0
  65. package/.versions/2.0.5/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  66. package/.versions/2.0.5/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
  67. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  68. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  69. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  70. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  71. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  72. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  73. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  74. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  75. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  76. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  77. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  78. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  79. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  80. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  81. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/context.ts +41 -0
  82. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  83. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  84. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  85. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  86. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  87. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  88. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  89. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  90. package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  91. package/.versions/2.0.5/.pi/harnesses/agent-hub/config/agents.ts +179 -0
  92. package/.versions/2.0.5/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
  93. package/.versions/2.0.5/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
  94. package/.versions/2.0.5/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  95. package/.versions/2.0.5/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +211 -0
  96. package/.versions/2.0.5/.pi/harnesses/agent-hub/context/budgets.ts +208 -0
  97. package/.versions/2.0.5/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  98. package/.versions/2.0.5/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  99. package/.versions/2.0.5/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  100. package/.versions/2.0.5/.pi/harnesses/agent-hub/context-window.js +106 -0
  101. package/.versions/2.0.5/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  102. package/.versions/2.0.5/.pi/harnesses/agent-hub/delegate.ts +446 -0
  103. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-coms.ts +234 -0
  104. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  105. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-complete.ts +135 -0
  106. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
  107. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +193 -0
  108. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-types.ts +208 -0
  109. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native.ts +199 -0
  110. package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
  111. package/.versions/2.0.5/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  112. package/.versions/2.0.5/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
  113. package/.versions/2.0.5/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  114. package/.versions/2.0.5/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  115. package/.versions/2.0.5/.pi/harnesses/agent-hub/fixtures/registration-surface.json +55 -0
  116. package/.versions/2.0.5/.pi/harnesses/agent-hub/footer.ts +30 -0
  117. package/.versions/2.0.5/.pi/harnesses/agent-hub/helpers.ts +266 -0
  118. package/.versions/2.0.5/.pi/harnesses/agent-hub/hub-state-audit.js +59 -0
  119. package/.versions/2.0.5/.pi/harnesses/agent-hub/index.ts +2115 -0
  120. package/.versions/2.0.5/.pi/harnesses/agent-hub/input/completions.ts +76 -0
  121. package/.versions/2.0.5/.pi/harnesses/agent-hub/input/shortcuts.ts +18 -0
  122. package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
  123. package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  124. package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +141 -0
  125. package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +95 -0
  126. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  127. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  128. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  129. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  130. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  131. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  132. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  133. package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  134. package/.versions/2.0.5/.pi/harnesses/agent-hub/package.json +7 -0
  135. package/.versions/2.0.5/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  136. package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/models.ts +153 -0
  137. package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
  138. package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
  139. package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/roster.ts +79 -0
  140. package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/work-mode.ts +118 -0
  141. package/.versions/2.0.5/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  142. package/.versions/2.0.5/.pi/harnesses/agent-hub/presentation.ts +48 -0
  143. package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/context.ts +46 -0
  144. package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
  145. package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  146. package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/system-prompt.ts +110 -0
  147. package/.versions/2.0.5/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  148. package/.versions/2.0.5/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  149. package/.versions/2.0.5/.pi/harnesses/agent-hub/research/runtime.ts +177 -0
  150. package/.versions/2.0.5/.pi/harnesses/agent-hub/research/spawn-run.ts +148 -0
  151. package/.versions/2.0.5/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  152. package/.versions/2.0.5/.pi/harnesses/agent-hub/return-contract.js +293 -0
  153. package/.versions/2.0.5/.pi/harnesses/agent-hub/return-extract.js +75 -0
  154. package/.versions/2.0.5/.pi/harnesses/agent-hub/review-findings.js +102 -0
  155. package/.versions/2.0.5/.pi/harnesses/agent-hub/run-budget.js +537 -0
  156. package/.versions/2.0.5/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  157. package/.versions/2.0.5/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  158. package/.versions/2.0.5/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  159. package/.versions/2.0.5/.pi/harnesses/agent-hub/session-health.js +110 -0
  160. package/.versions/2.0.5/.pi/harnesses/agent-hub/session-start.ts +42 -0
  161. package/.versions/2.0.5/.pi/harnesses/agent-hub/spawn.ts +404 -0
  162. package/.versions/2.0.5/.pi/harnesses/agent-hub/timeline.ts +54 -0
  163. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/action-executors.ts +149 -0
  164. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  165. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/context.ts +132 -0
  166. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +79 -0
  167. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +232 -0
  168. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  169. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/fleet-tools.ts +202 -0
  170. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
  171. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
  172. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
  173. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  174. package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
  175. package/.versions/2.0.5/.pi/harnesses/agent-hub/types.ts +62 -0
  176. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
  177. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
  178. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
  179. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +125 -0
  180. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/grid.ts +42 -0
  181. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  182. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  183. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/pool.ts +98 -0
  184. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/running-strip.ts +139 -0
  185. package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
  186. package/.versions/2.0.5/.pi/harnesses/agent-hub/version.ts +42 -0
  187. package/.versions/2.0.5/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  188. package/.versions/2.0.5/.pi/harnesses/agent-hub/work-mode.ts +167 -0
  189. package/.versions/2.0.5/.pi/harnesses/ask-user-remote/README.md +53 -0
  190. package/.versions/2.0.5/.pi/harnesses/ask-user-remote/index.ts +532 -0
  191. package/.versions/2.0.5/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  192. package/.versions/2.0.5/.pi/harnesses/coms/README.md +100 -0
  193. package/.versions/2.0.5/.pi/harnesses/coms/index.ts +276 -0
  194. package/.versions/2.0.5/.pi/harnesses/coms/package.json +7 -0
  195. package/.versions/2.0.5/.pi/harnesses/coms/version.ts +42 -0
  196. package/.versions/2.0.5/.pi/harnesses/damage-control-continue/README.md +124 -0
  197. package/.versions/2.0.5/.pi/harnesses/damage-control-continue/index.ts +536 -0
  198. package/.versions/2.0.5/.pi/harnesses/damage-control-continue/package.json +7 -0
  199. package/.versions/2.0.5/.pi/harnesses/damage-control-continue/version.ts +42 -0
  200. package/.versions/2.0.5/.pi/harnesses/lib/coms-core-io.ts +385 -0
  201. package/.versions/2.0.5/.pi/harnesses/lib/coms-core.ts +577 -0
  202. package/.versions/2.0.5/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  203. package/.versions/2.0.5/.pi/harnesses/lib/context-budget-child-prompt.ts +179 -0
  204. package/.versions/2.0.5/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
  205. package/.versions/2.0.5/.pi/harnesses/lib/context-budget-view.ts +107 -0
  206. package/.versions/2.0.5/.pi/harnesses/lib/context-budget.ts +114 -0
  207. package/.versions/2.0.5/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  208. package/.versions/2.0.5/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  209. package/.versions/2.0.5/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  210. package/.versions/2.0.5/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  211. package/.versions/2.0.5/.pi/harnesses/lib/fleet-dashboard-ops.ts +161 -0
  212. package/.versions/2.0.5/.pi/harnesses/lib/fleet-dashboard-view.ts +148 -0
  213. package/.versions/2.0.5/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
  214. package/.versions/2.0.5/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  215. package/.versions/2.0.5/.pi/harnesses/lib/fleet-panel.ts +34 -0
  216. package/.versions/2.0.5/.pi/harnesses/lib/fleet-read-model.ts +131 -0
  217. package/.versions/2.0.5/.pi/harnesses/lib/fleet-selection.ts +24 -0
  218. package/.versions/2.0.5/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  219. package/.versions/2.0.5/.pi/harnesses/lib/herdr-client.ts +472 -0
  220. package/.versions/2.0.5/.pi/harnesses/lib/herdr-presence.ts +399 -0
  221. package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  222. package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  223. package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  224. package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  225. package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  226. package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  227. package/.versions/2.0.5/.pi/harnesses/lib/spawned-peers.js +190 -0
  228. package/.versions/2.0.5/.pi/harnesses/package-lock.json +2039 -0
  229. package/.versions/2.0.5/.pi/harnesses/package.json +10 -0
  230. package/.versions/2.0.5/.pi/prompts/af-build.md +24 -0
  231. package/.versions/2.0.5/.pi/prompts/af-code-simplify.md +22 -0
  232. package/.versions/2.0.5/.pi/prompts/af-plan.md +17 -0
  233. package/.versions/2.0.5/.pi/prompts/af-review.md +16 -0
  234. package/.versions/2.0.5/.pi/prompts/af-set-hermes-telegram.md +15 -0
  235. package/.versions/2.0.5/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  236. package/.versions/2.0.5/.pi/prompts/af-ship.md +17 -0
  237. package/.versions/2.0.5/.pi/prompts/af-spec.md +15 -0
  238. package/.versions/2.0.5/.pi/prompts/af-test.md +19 -0
  239. package/.versions/2.0.5/.pi/skills/bowser/SKILL.md +145 -0
  240. package/.versions/2.0.5/.version +1 -0
  241. package/.versions/2.0.5/agents/architect.md +25 -0
  242. package/.versions/2.0.5/agents/bowser.md +28 -0
  243. package/.versions/2.0.5/agents/builder.md +56 -0
  244. package/.versions/2.0.5/agents/code-reviewer.md +210 -0
  245. package/.versions/2.0.5/agents/deep-researcher.md +33 -0
  246. package/.versions/2.0.5/agents/documenter.md +23 -0
  247. package/.versions/2.0.5/agents/orchestrator.md +23 -0
  248. package/.versions/2.0.5/agents/plan-reviewer.md +84 -0
  249. package/.versions/2.0.5/agents/planner.md +106 -0
  250. package/.versions/2.0.5/agents/releaser.md +25 -0
  251. package/.versions/2.0.5/agents/researcher.md +31 -0
  252. package/.versions/2.0.5/agents/security-auditor.md +168 -0
  253. package/.versions/2.0.5/agents/test-engineer.md +154 -0
  254. package/.versions/2.0.5/agents/web-debugger.md +44 -0
  255. package/.versions/2.0.5/agents/web-performance-auditor.md +194 -0
  256. package/.versions/2.0.5/bin/catalog/harness-runtime-closure.json +36 -0
  257. package/.versions/2.0.5/codex/CONDUCTOR.md +148 -0
  258. package/.versions/2.0.5/docs/ARCHITECTURE.md +407 -0
  259. package/.versions/2.0.5/docs/agent-fleet-setup.md +561 -0
  260. package/.versions/2.0.5/docs/claude-code-coms-bridge.md +133 -0
  261. package/.versions/2.0.5/docs/codex-remote-conductor.md +170 -0
  262. package/.versions/2.0.5/docs/coms-hermes-bridge.md +189 -0
  263. package/.versions/2.0.5/docs/getting-started.md +124 -0
  264. package/.versions/2.0.5/docs/npm-install.md +299 -0
  265. package/.versions/2.0.5/docs/pi-extensions.md +446 -0
  266. package/.versions/2.0.5/docs/pi-setup.md +74 -0
  267. package/.versions/2.0.5/docs/skill-anatomy.md +150 -0
  268. package/.versions/2.0.5/hermes/README.md +347 -0
  269. package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  270. package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  271. package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  272. package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  273. package/.versions/2.0.5/hermes/gates/gate-o-capability.md +8 -0
  274. package/.versions/2.0.5/hermes/gates/gate-o-validator-fixtures.json +1 -0
  275. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
  276. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  277. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  278. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  279. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  280. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  281. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  282. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  283. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  284. package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  285. package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  286. package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  287. package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  288. package/.versions/2.0.5/hermes/skills/hub-conductor/SKILL.md +84 -0
  289. package/.versions/2.0.5/hermes/skills/hub-liaison/SKILL.md +84 -0
  290. package/.versions/2.0.5/hermes/skills/hub-watchdog/SKILL.md +76 -0
  291. package/.versions/2.0.5/hermes/skills/hub-watchdog/manifest.json +1 -0
  292. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  293. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  294. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  295. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  296. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  297. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  298. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  299. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  300. package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  301. package/.versions/2.0.5/hermes/watchdog-tests/__init__.py +0 -0
  302. package/.versions/2.0.5/hooks/coms-stop-hook.mjs +84 -0
  303. package/.versions/2.0.5/install-manifest.json +2942 -0
  304. package/.versions/2.0.5/justfile +289 -0
  305. package/.versions/2.0.5/manifest-meta.json +969 -0
  306. package/.versions/2.0.5/references/accessibility-checklist.md +160 -0
  307. package/.versions/2.0.5/references/communication-contract.md +26 -0
  308. package/.versions/2.0.5/references/definition-of-done.md +67 -0
  309. package/.versions/2.0.5/references/fleet-coordination-patterns.md +171 -0
  310. package/.versions/2.0.5/references/observability-checklist.md +91 -0
  311. package/.versions/2.0.5/references/orchestration-patterns.md +370 -0
  312. package/.versions/2.0.5/references/performance-checklist.md +153 -0
  313. package/.versions/2.0.5/references/prompting-patterns.md +380 -0
  314. package/.versions/2.0.5/references/security-checklist.md +179 -0
  315. package/.versions/2.0.5/references/testing-patterns.md +236 -0
  316. package/.versions/2.0.5/references/workflow-authoring.md +304 -0
  317. package/.versions/2.0.5/scripts/claude-code-preflight.ts +70 -0
  318. package/.versions/2.0.5/scripts/codex-conductor.ts +41 -0
  319. package/.versions/2.0.5/scripts/codex-remote-control.ts +167 -0
  320. package/.versions/2.0.5/scripts/coms-claude-bridge.ts +411 -0
  321. package/.versions/2.0.5/scripts/coms-cli.ts +484 -0
  322. package/.versions/2.0.5/scripts/coms-hermes-bridge.ts +413 -0
  323. package/.versions/2.0.5/scripts/fleet.ts +222 -0
  324. package/.versions/2.0.5/scripts/flow.ts +137 -0
  325. package/.versions/2.0.5/scripts/hermes-monitor-capability-runner.ts +25 -0
  326. package/.versions/2.0.5/scripts/hermes-monitor-scenario.ts +474 -0
  327. package/.versions/2.0.5/scripts/hermes-watchdog-capability-probe.ts +45 -0
  328. package/.versions/2.0.5/scripts/install-hermes-plugin.sh +180 -0
  329. package/.versions/2.0.5/scripts/lib/claude-bridge-core.ts +210 -0
  330. package/.versions/2.0.5/scripts/lib/codex-conductor.ts +88 -0
  331. package/.versions/2.0.5/scripts/lib/codex-remote-control.ts +482 -0
  332. package/.versions/2.0.5/scripts/lib/coms-envelope.ts +582 -0
  333. package/.versions/2.0.5/scripts/lib/fake-herdr-server.ts +88 -0
  334. package/.versions/2.0.5/scripts/lib/fleet-command.ts +270 -0
  335. package/.versions/2.0.5/scripts/lib/flow-command.ts +93 -0
  336. package/.versions/2.0.5/scripts/lib/flow-maintenance.ts +230 -0
  337. package/.versions/2.0.5/scripts/lib/herdr-layout.ts +281 -0
  338. package/.versions/2.0.5/scripts/lib/hermes-bridge-core.ts +241 -0
  339. package/.versions/2.0.5/scripts/lib/hermes-monitor-events.ts +1 -0
  340. package/.versions/2.0.5/scripts/lib/hermes-monitor-herdr.ts +2 -0
  341. package/.versions/2.0.5/scripts/lib/hermes-monitor-model.ts +3 -0
  342. package/.versions/2.0.5/scripts/lib/hermes-monitor-registry.ts +2 -0
  343. package/.versions/2.0.5/scripts/lib/hermes-monitor-socket.ts +2 -0
  344. package/.versions/2.0.5/scripts/lib/hermes-monitor-store.ts +2 -0
  345. package/.versions/2.0.5/scripts/lib/monitor-env.ts +146 -0
  346. package/.versions/2.0.5/scripts/lib/peer-launch.ts +318 -0
  347. package/.versions/2.0.5/scripts/lib/persona-banner.ts +62 -0
  348. package/.versions/2.0.5/scripts/lib/runtime-dependencies.js +124 -0
  349. package/.versions/2.0.5/scripts/lib/spawn-stagger.ts +101 -0
  350. package/.versions/2.0.5/scripts/lib/team-project.ts +213 -0
  351. package/.versions/2.0.5/scripts/lib/team-snapshot.ts +147 -0
  352. package/.versions/2.0.5/scripts/package-lock.json +35 -0
  353. package/.versions/2.0.5/scripts/package.json +9 -0
  354. package/.versions/2.0.5/scripts/peer-banner.ts +40 -0
  355. package/.versions/2.0.5/scripts/peer-launch.ts +285 -0
  356. package/.versions/2.0.5/scripts/team-snapshot.ts +237 -0
  357. package/.versions/2.0.5/scripts/team-up.ts +406 -0
  358. package/.versions/2.0.5/scripts/workflows/lib/agent-phase.ts +133 -0
  359. package/.versions/2.0.5/scripts/workflows/lib/changes.ts +61 -0
  360. package/.versions/2.0.5/scripts/workflows/lib/debate.ts +149 -0
  361. package/.versions/2.0.5/scripts/workflows/lib/env.ts +34 -0
  362. package/.versions/2.0.5/scripts/workflows/lib/envelopes.ts +169 -0
  363. package/.versions/2.0.5/scripts/workflows/lib/gates.ts +81 -0
  364. package/.versions/2.0.5/scripts/workflows/lib/git.ts +96 -0
  365. package/.versions/2.0.5/scripts/workflows/lib/merge.ts +95 -0
  366. package/.versions/2.0.5/scripts/workflows/lib/model-profile.ts +22 -0
  367. package/.versions/2.0.5/scripts/workflows/lib/model-visibility.ts +92 -0
  368. package/.versions/2.0.5/scripts/workflows/lib/permissions.ts +130 -0
  369. package/.versions/2.0.5/scripts/workflows/lib/personas.ts +57 -0
  370. package/.versions/2.0.5/scripts/workflows/lib/poll.ts +86 -0
  371. package/.versions/2.0.5/scripts/workflows/lib/quality.ts +64 -0
  372. package/.versions/2.0.5/scripts/workflows/lib/run.ts +108 -0
  373. package/.versions/2.0.5/scripts/workflows/lib/trace.ts +34 -0
  374. package/.versions/2.0.5/scripts/workflows/lib/voices.ts +128 -0
  375. package/.versions/2.0.5/scripts/workflows/lib/writer-lease.ts +112 -0
  376. package/.versions/2.0.5/scripts/workflows/tsconfig.json +22 -0
  377. package/.versions/2.0.5/scripts/workflows/wf-build-test.ts +61 -0
  378. package/.versions/2.0.5/scripts/workflows/wf-debate.ts +87 -0
  379. package/.versions/2.0.5/scripts/workflows/wf-document.ts +50 -0
  380. package/.versions/2.0.5/scripts/workflows/wf-poll.ts +95 -0
  381. package/.versions/2.0.5/scripts/workflows/wf-quality.ts +20 -0
  382. package/.versions/2.0.5/scripts/workflows/wf-scout.ts +38 -0
  383. package/.versions/2.0.5/skills/_internal/grilling.md +59 -0
  384. package/.versions/2.0.5/skills/browser-testing-with-devtools/SKILL.md +351 -0
  385. package/.versions/2.0.5/skills/code-review-and-quality/SKILL.md +381 -0
  386. package/.versions/2.0.5/skills/compound-learning/SKILL.md +137 -0
  387. package/.versions/2.0.5/skills/context-engineering/SKILL.md +291 -0
  388. package/.versions/2.0.5/skills/deprecation-and-migration/SKILL.md +206 -0
  389. package/.versions/2.0.5/skills/designing-agents/SKILL.md +394 -0
  390. package/.versions/2.0.5/skills/designing-agents/pi-harness-authoring.md +222 -0
  391. package/.versions/2.0.5/skills/drafting-workflows/SKILL.md +143 -0
  392. package/.versions/2.0.5/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  393. package/.versions/2.0.5/skills/frontend-ui-engineering/SKILL.md +328 -0
  394. package/.versions/2.0.5/skills/git-workflow-and-versioning/SKILL.md +316 -0
  395. package/.versions/2.0.5/skills/idea-refine/SKILL.md +182 -0
  396. package/.versions/2.0.5/skills/idea-refine/examples.md +238 -0
  397. package/.versions/2.0.5/skills/idea-refine/frameworks.md +99 -0
  398. package/.versions/2.0.5/skills/idea-refine/refinement-criteria.md +113 -0
  399. package/.versions/2.0.5/skills/idea-refine/scripts/idea-refine.sh +15 -0
  400. package/.versions/2.0.5/skills/incremental-implementation/SKILL.md +298 -0
  401. package/.versions/2.0.5/skills/interview-me/SKILL.md +226 -0
  402. package/.versions/2.0.5/skills/orchestration-verification/SKILL.md +181 -0
  403. package/.versions/2.0.5/skills/peer-coms/SKILL.md +90 -0
  404. package/.versions/2.0.5/skills/performance-optimization/SKILL.md +350 -0
  405. package/.versions/2.0.5/skills/planning-and-task-breakdown/SKILL.md +265 -0
  406. package/.versions/2.0.5/skills/security-and-hardening/SKILL.md +461 -0
  407. package/.versions/2.0.5/skills/spec-driven-development/SKILL.md +256 -0
  408. package/.versions/2.0.5/skills/using-agent-skills/SKILL.md +197 -0
  409. package/.versions/2.0.5/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  410. package/.versions/2.0.5/vendor/agent-skills-upstream/LICENSE +21 -0
  411. package/.versions/2.0.5/vendor/agent-skills-upstream/README.md +11 -0
  412. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  413. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  414. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  415. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  416. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  417. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  418. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  419. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  420. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  421. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  422. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  423. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  424. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  425. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  426. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  427. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  428. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  429. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  430. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  431. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  432. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  433. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  434. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  435. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  436. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  437. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  438. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  439. package/.versions/2.0.5/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  440. package/CHANGELOG.md +6 -0
  441. package/README.md +1 -1
  442. package/agents/builder.md +2 -2
  443. package/agents/documenter.md +2 -1
  444. package/agents/planner.md +2 -1
  445. package/agents/releaser.md +2 -2
  446. package/docs/agent-fleet-setup.md +28 -14
  447. package/docs/pi-extensions.md +3 -4
  448. package/install-manifest.json +1 -1
  449. package/package.json +2 -2
@@ -57,8 +57,64 @@ export function profilePanel(name: string, active = readActiveProfile()) {
57
57
  ];
58
58
  return voices.map(v => ({ thinking: active.profile.defaults.thinking ?? 'off', ...v }));
59
59
  }
60
- export function profilePeerRefusal() {
61
- if (readActiveProfile()?.profile.routing !== 'native')
60
+ export type ProfilePeerRefusal = {
61
+ isError: true;
62
+ content: [{ type: 'text'; text: string }];
63
+ details: { error: 'model-profile-native' | 'model-profile-allowlist' };
64
+ };
65
+
66
+ function refusal(text: string, error: ProfilePeerRefusal['details']['error']): ProfilePeerRefusal {
67
+ return { isError: true, content: [{ type: 'text', text }], details: { error } };
68
+ }
69
+
70
+ const BLANKET_NATIVE = 'Active model profile requires native agents; peer execution is disabled. Use dispatch_agent or leave this profile.';
71
+
72
+ /** True when native routing has no allowlist: standing peers are banned outright. */
73
+ export function profileForcesNativePeers(active = readActiveProfile()): boolean {
74
+ return !!active && active.profile.routing === 'native' && !active.profile['allowed-models']?.length;
75
+ }
76
+
77
+ /** Exact allowlist hit, or a unique provider-less suffix match. Ambiguous suffixes fail. */
78
+ export function modelAllowedByProfile(model: string, allowed: readonly string[]): boolean {
79
+ const value = model.trim();
80
+ if (!value || value === 'unknown')
81
+ return false;
82
+ if (allowed.includes(value))
83
+ return true;
84
+ if (value.includes('/'))
85
+ return false;
86
+ return allowed.filter(entry => entry.split('/').pop() === value).length === 1;
87
+ }
88
+
89
+ export function profilePeerGate(opts?: { peerModel?: string; targetResolved?: boolean }, active = readActiveProfile()): ProfilePeerRefusal | null {
90
+ if (!active || active.profile.routing !== 'native')
91
+ return null;
92
+ const allowed = active.profile['allowed-models'];
93
+ if (!allowed?.length)
94
+ return refusal(BLANKET_NATIVE, 'model-profile-native');
95
+ if (opts?.targetResolved === false)
62
96
  return null;
63
- return { isError: true, content: [{ type: 'text' as const, text: 'Active model profile requires native agents; peer execution is disabled. Use dispatch_agent or leave this profile.' }], details: { error: 'model-profile-native' } };
97
+ const model = opts?.peerModel?.trim();
98
+ if (!model || model === 'unknown')
99
+ return refusal(`Active model profile "${active.name}" refuses unverified peers; advertised model is missing or unknown. Use a peer on allowed-models: ${allowed.join(', ')}, dispatch_agent native, or leave this profile.`, 'model-profile-allowlist');
100
+ if (modelAllowedByProfile(model, allowed))
101
+ return null;
102
+ return refusal(`Active model profile "${active.name}" refuses peer model "${model}"; allowed-models: ${allowed.join(', ')}. Use a peer on an allowed model, dispatch_agent native, or leave this profile.`, 'model-profile-allowlist');
103
+ }
104
+
105
+ export function profileSpawnPeerRefusal(plan: { runner: string; model?: string; persona?: string; name: string }, active = readActiveProfile()): ProfilePeerRefusal | null {
106
+ const early = profilePeerGate({ targetResolved: false }, active);
107
+ if (early)
108
+ return early;
109
+ if (!active || active.profile.routing !== 'native' || !active.profile['allowed-models']?.length)
110
+ return null;
111
+ if (plan.runner === 'claude-code')
112
+ return refusal(`Active model profile "${active.name}" refuses claude-code peers; allowed-models: ${active.profile['allowed-models'].join(', ')}. Spawn a pi peer on an allowed model or leave this profile.`, 'model-profile-allowlist');
113
+ const planned = plan.model ?? profileAgent(plan.persona ?? plan.name, active)?.model;
114
+ return profilePeerGate({ peerModel: planned, targetResolved: true }, active);
115
+ }
116
+
117
+ /** @deprecated Prefer profilePeerGate with the resolved peer model. */
118
+ export function profilePeerRefusal() {
119
+ return profilePeerGate();
64
120
  }
@@ -40,6 +40,7 @@ export interface ResearchState<TDef extends ResearchAgentDef = ResearchAgentDef>
40
40
  status: "idle" | "running" | "done" | "error";
41
41
  task: string;
42
42
  toolCount: number;
43
+ messageCount: number;
43
44
  elapsed: number;
44
45
  lastWork: string;
45
46
  contextPct: number;
@@ -99,6 +100,7 @@ export interface ResearchRuntimeDeps<TDef extends ResearchAgentDef> extends Rese
99
100
  appendTimelineText(state: ResearchState<TDef>, kind: "text" | "thinking", content: string): void;
100
101
  appendTimelineEvent(state: ResearchState<TDef>, event: TimelineEntry): void;
101
102
  createTranscriptStore(path: string): FleetTranscriptStore;
103
+ onElapsed?(): void;
102
104
  }
103
105
 
104
106
  export interface ResearchRuntime<TDef extends ResearchAgentDef = ResearchAgentDef> {
@@ -161,7 +163,7 @@ export function createResearchRuntime<TDef extends ResearchAgentDef>(deps: Resea
161
163
  const id = deps.getNextResearchId();
162
164
  deps.setNextResearchId(id + 1);
163
165
  const state: ResearchState<TDef> = {
164
- id, def, persona, model, status: "running", task: "", toolCount: 0,
166
+ id, def, persona, model, status: "running", task: "", toolCount: 0, messageCount: 0,
165
167
  elapsed: 0, lastWork: "", contextPct: 0, contextTokens: 0, timeline: [],
166
168
  };
167
169
  deps.getResearchStates().set(id, state);
@@ -5,6 +5,7 @@ import { isReadOnlyToolList, safePathWithin } from "../helpers.ts";
5
5
  import { researchTerminationOutcome, researchWatchdogSpawnOptions } from "../research-watchdog.ts";
6
6
  import type { InputArtifactPreview } from "../context/assertions-artifacts.ts";
7
7
  import type { ResearchAgentDef, ResearchFinalizeOutcome, ResearchResult, ResearchRuntimeDeps, ResearchState } from "./runtime.ts";
8
+ import { bumpMessageCount } from "../ui/activity-dots.ts";
8
9
 
9
10
  export interface ResearchSpawnPorts<TDef extends ResearchAgentDef> extends ResearchRuntimeDeps<TDef> {
10
11
  researchTools: string;
@@ -48,6 +49,7 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
48
49
  state.status = "running";
49
50
  state.task = prompt;
50
51
  state.toolCount = 0;
52
+ state.messageCount = 0;
51
53
  state.elapsed = 0;
52
54
  state.lastWork = "";
53
55
  state.killedByOperator = false;
@@ -57,6 +59,7 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
57
59
 
58
60
  state.timer = setInterval(() => {
59
61
  state.elapsed = Date.now() - startTime;
62
+ deps.onElapsed?.();
60
63
  }, 1000);
61
64
  const thinkingLevel = deps.resolveThinkingLevel(deps.resolvedThinking(state.def));
62
65
  const wantThinking = thinkingLevel !== "off";
@@ -87,6 +90,7 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
87
90
  onTextDelta: delta => {
88
91
  fullText += delta;
89
92
  state.lastWork = fullText.split("\n").filter(line => line.trim()).pop() || "";
93
+ bumpMessageCount(state, "text");
90
94
  deps.appendTimelineText(state, "text", delta);
91
95
  state.zoomRender?.();
92
96
  },
@@ -1,4 +1,4 @@
1
- import { profilePeerRefusal } from '../policy/profile-runtime.ts';
1
+ import { profilePeerGate } from '../policy/profile-runtime.ts';
2
2
  import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
3
3
  import { DEFAULT_TASK_TIER, applyTierChange } from "../run-budget.js";
4
4
  import { validateAssertionBatch } from "../assertion-ledger.js";
@@ -35,7 +35,7 @@ export interface ActionExecutorDeps {
35
35
  rosterDrop(agent: string): { ok: boolean; message: string };
36
36
  getIdentity(): unknown | null;
37
37
  getComs(): any;
38
- resolveTarget(target: string): { name: string } | null;
38
+ resolveTarget(target: string): { name: string; model?: string } | null;
39
39
  appendMachineHandoffSections(brief: string): string;
40
40
  markPeerAddressed(name: string): void;
41
41
  }
@@ -125,9 +125,10 @@ export function createActionExecutors(d: ActionExecutorDeps): ActionExecutors {
125
125
  return { content: [{ type: "text", text: `${result.agents.length} peer(s) in pool (project ${result.project}):\n${lines}${notice}` }], details: result };
126
126
  };
127
127
  const executeComsSend: ToolExecutor<ComsSendParams> = async (_id, params) => {
128
- const profileRefusal=profilePeerRefusal();if(profileRefusal) return profileRefusal;
128
+ const target = d.resolveTarget(params.target);
129
+ const profileRefusal = profilePeerGate({ peerModel: target?.model, targetResolved: !!target }); if (profileRefusal) return profileRefusal;
129
130
  const refusal = d.provisionalCapabilityRefusal("peer"); if (refusal) return refusal;
130
- const target = d.resolveTarget(params.target); const pending = d.hubState.getPendingHandoff();
131
+ const pending = d.hubState.getPendingHandoff();
131
132
  const authorized = !!(target && pending && pending.target === target.name && params.handoff_token === pending.token);
132
133
  const prompt = authorized ? d.appendMachineHandoffSections(String(params.prompt || "")) : String(params.prompt || "");
133
134
  const sent = await d.getComs().send({ target: params.target, prompt, conversation_id: params.conversation_id ?? null, response_schema: (params.response_schema as object | undefined) ?? null, reply_timeout_ms: params.reply_timeout_ms ?? null });
@@ -70,9 +70,42 @@ function refusal(d: DispatchExecutorDeps, agent: string, task: string, status: s
70
70
  return { content: [{ type: "text", text: message }], details: { agent, task, status, reason: reason ?? status, elapsed: 0, exitCode: 1, fullOutput: "" } };
71
71
  }
72
72
 
73
- function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentParams, ctx: ExtensionContext): PreparedDispatch | ToolExecutionResult {
73
+ const RESEARCH_DISPATCH_NAMES = new Set(["researcher", "deep-researcher"]);
74
+
75
+ function rosterNames(d: DispatchExecutorDeps): string[] {
76
+ return Array.from(d.state.getAgentStates().values()).map(s => s.def.name);
77
+ }
78
+
79
+ function isResearchDispatchName(d: DispatchExecutorDeps, agent: string): boolean {
80
+ if (RESEARCH_DISPATCH_NAMES.has(agent)) return true;
81
+ return d.state.getResearchPersonas().some(p => normalizeAgentInput(p.name) === agent);
82
+ }
83
+
84
+ function unknownAgentMessage(agent: string, available: string[], researchHint: boolean): string {
85
+ const roster = available.length ? available.join(", ") : "(none)";
86
+ const research = researchHint
87
+ ? `\n\n"${agent}" is a research persona. Call spawn_research with persona "${agent}" instead of dispatch_agent. Do not invent a substitute dispatch.`
88
+ : "";
89
+ return `Unknown agent "${agent}". dispatch_agent only accepts the active roster. Available agents: ${roster}.${research}\n\nDo not invent a substitute dispatch. Use an available agent, or spawn_research for a research persona.`;
90
+ }
91
+
92
+ export function validateDispatchAgent(d: DispatchExecutorDeps, agent: string, task: string): ToolExecutionResult | null {
93
+ const available = rosterNames(d);
94
+ const onRoster = d.state.getAgentStates().has(agent) || available.some(name => normalizeAgentInput(name) === agent);
95
+ if (isResearchDispatchName(d, agent)) {
96
+ return refusal(d, agent, task, "research_persona_via_dispatch", unknownAgentMessage(agent, available, true), "research_persona_via_dispatch");
97
+ }
98
+ if (!onRoster) {
99
+ return refusal(d, agent, task, "unknown_agent", unknownAgentMessage(agent, available, false), "unknown_agent");
100
+ }
101
+ return null;
102
+ }
103
+
104
+ export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentParams, ctx: ExtensionContext): PreparedDispatch | ToolExecutionResult {
74
105
  const s = d.state; const { task, artifacts, scope, review_reason } = params; const agent = normalizeAgentInput(params.agent);
75
106
  d.budget.ensureTaskTier();
107
+ const rosterRefusal = validateDispatchAgent(d, agent, task);
108
+ if (rosterRefusal) return rosterRefusal;
76
109
  const preflight = preflightGate(d, agent) ?? checkReviewRoundCap(s.getTaskTier(), agent, s.getTaskReviewRounds()) ?? checkDocsLane(agent, scope || [], review_reason);
77
110
  if (preflight) return refusal(d, agent, task, preflight.reason, preflight.message, preflight.reason);
78
111
  const taskRefusal = checkTaskBudget("dispatch", d.budget.taskCounters(), d.budget.currentTaskBudget(), d.budget.taskActiveElapsedMs(), s.getTaskTier());
@@ -1,4 +1,4 @@
1
- import { profilePeerRefusal } from '../policy/profile-runtime.ts';
1
+ import { PROFILE_ENV, profilePeerGate, profileSpawnPeerRefusal, readActiveProfile } from '../policy/profile-runtime.ts';
2
2
  import { PANE_PROMPT_TIMEOUT_MS, launchPeerInPane } from "../../lib/spawned-peers.js";
3
3
  import { herdrPaneId } from "../../lib/herdr-presence.ts";
4
4
  import { buildHubPeerSpawnPlan, launchHubPeerInPane } from "../peer-spawn-plan.ts";
@@ -28,7 +28,7 @@ const noPane = (): ToolExecutionResult => ({ content: [{ type: "text", text: "no
28
28
 
29
29
  export function createHerdrExecutors(d: HerdrExecutorDeps): Pick<import("./context.ts").ToolContext, "executeHerdrSpawnPeer" | "executeHerdrSpawnPane" | "executeHerdrReadPane" | "executeHerdrClosePane" | "executeHerdrNotify"> {
30
30
  const executeHerdrSpawnPeer: ToolExecutor<HerdrSpawnPeerParams> = async (_id, params) => {
31
- const profileRefusal=profilePeerRefusal();if(profileRefusal) return profileRefusal;
31
+ const earlyProfile = profilePeerGate({ targetResolved: false }); if (earlyProfile) return earlyProfile;
32
32
  const refusal = d.provisionalCapabilityRefusal("workspace"); if (refusal) return refusal;
33
33
  if (!d.isFleetReady()) return unavailable();
34
34
  const ownPane = herdrPaneId(); if (!ownPane) return noPane();
@@ -37,9 +37,11 @@ export function createHerdrExecutors(d: HerdrExecutorDeps): Pick<import("./conte
37
37
  try {
38
38
  const cwd = d.getCurrentContext()?.cwd ?? process.cwd();
39
39
  const plan = buildHubPeerSpawnPlan(params, { project: identity.project, peersYaml: peerManifest(cwd), personaExists: persona => peerPersonaExists(cwd, persona), worktreeTag: worktreeTag(cwd) });
40
+ const profileRefusal = profileSpawnPeerRefusal(plan); if (profileRefusal) return profileRefusal;
40
41
  if (d.peersInScope().some(peer => peer.name.toLowerCase() === plan.name.toLowerCase())) throw new Error(`Peer "${plan.name}" is already visible in project "${identity.project}"; use coms_send instead of spawning a duplicate.`);
41
42
  const env: Record<string, string> = {};
42
43
  if (plan.envFile) { const envPath = resolveEnvFilePath(plan.envFile, cwd); if (!d.envFileExists(envPath)) throw new Error(`env_file not found: ${plan.envFile} (resolved: ${envPath})`); Object.assign(env, parseEnvFile(d.readEnvFile(envPath), plan.envFile)); }
44
+ const active = readActiveProfile(); if (active) env[PROFILE_ENV] = JSON.stringify(active);
43
45
  const delay = plan.runner === "pi" ? spawnDelaySeconds(d.getLastPiSpawnAt()) : 0; if (delay > 0) env[STAGGER_ENV_VAR] = String(delay);
44
46
  const launched = await launchHubPeerInPane(plan, {
45
47
  client: d.herdr, targetPaneId: ownPane, cwd, env,
@@ -34,6 +34,7 @@ export interface AgentState {
34
34
  status: "idle" | "running" | "done" | "error";
35
35
  task: string;
36
36
  toolCount: number;
37
+ messageCount: number;
37
38
  elapsed: number;
38
39
  lastWork: string;
39
40
  contextPct: number;
@@ -0,0 +1,16 @@
1
+ /** Cycle 1–5 ASCII periods from a 1-based event count. Zero events → empty. */
2
+ export function activityDots(eventCount: number): string {
3
+ if (eventCount <= 0) return "";
4
+ return ".".repeat(((eventCount - 1) % 5) + 1);
5
+ }
6
+
7
+ export function eventCount(toolCount: number, messageCount: number): number {
8
+ return Math.max(0, toolCount) + Math.max(0, messageCount);
9
+ }
10
+
11
+ /** Call before appending a text timeline delta so each assistant message counts once. */
12
+ export function bumpMessageCount(target: { timeline: Array<{ kind: string }>; messageCount: number }, kind: "text" | "thinking"): void {
13
+ if (kind !== "text") return;
14
+ const last = target.timeline[target.timeline.length - 1];
15
+ if (!last || last.kind !== "text") target.messageCount++;
16
+ }
@@ -50,11 +50,13 @@ export interface FleetDashboardDeps<TDef extends DetailAgentDef, TAgent extends
50
50
  modelPolicy: ModelPolicy<TDef>;
51
51
  loadAvailableModels(ctx: DetailUiContext, current?: string): Promise<FleetModelChoice[] | null>;
52
52
  openDetail(row: FleetRow, ctx: DetailUiContext, verbose?: boolean): Promise<boolean>;
53
+ openHistory(ctx: DetailUiContext): Promise<void>;
53
54
  modelWorkBlocked(ctx: DetailUiContext): boolean;
54
55
  restartSpecialist(state: TAgent, ctx: DetailUiContext): Promise<void>;
55
56
  removeResearch(state: TResearch, ctx: DetailUiContext): void;
56
57
  killSpecialistProcess(state: TAgent): void;
57
58
  abortComs(state: TAgent): void;
59
+ getComsLines(width: number, theme: { fg(color: string, text: string): string }): string[];
58
60
  }
59
61
 
60
62
  type SubstitutionPicker = { stage: "source" | "target"; source?: string; choices: FleetModelChoice[]; index: number; scrollOffset: number };
@@ -110,11 +112,11 @@ export function createFleetDashboard<TDef extends DetailAgentDef, TAgent extends
110
112
  const toInput = (data: string) => matchesKey(data, Key.up) ? "\u001b[A" : matchesKey(data, Key.down) ? "\u001b[B" : matchesKey(data, Key.pageUp) ? "\u001b[5~" : matchesKey(data, Key.pageDown) ? "\u001b[6~" : matchesKey(data, Key.enter) ? "\r" : matchesKey(data, Key.escape) ? "\u001b" : data;
111
113
  try { await ctx.ui.custom((tui: any, theme: any, _kb: any, done: () => void) => {
112
114
  attachFleetDashboardTicker(resources, () => tui.requestRender());
113
- return { render: (w: number) => { const rows = fleetRows(); reconcileSelection(selection, rows); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS); if (picker) return renderFleetSubstitutionPicker(picker.stage, picker.source, picker.choices, picker, w, body, theme); scrollOffset = clampScroll(scrollOffset, rows.length, body); const summary = summarise(rows); return renderFleetDashboard({ rows, selection, scrollOffset, filterQuery: deps.getFilter(), showFinished: deps.getShowFinished(), confirmation: confirm && confirm.until > Date.now() ? `press ${confirm.action === "kill" ? "x" : "r"} again to ${confirm.action} ${rows.find(row => row.key === confirm!.key)?.name ?? "agent"}` : undefined, summary: { ...summary, wallMs: unionMs(summary.intervals) } }, w, body, theme); },
115
+ return { render: (w: number) => { const rows = fleetRows(); reconcileSelection(selection, rows); const comsLines = deps.getComsLines(w, theme); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS + comsLines.length); if (picker) return renderFleetSubstitutionPicker(picker.stage, picker.source, picker.choices, picker, w, body, theme); scrollOffset = clampScroll(scrollOffset, rows.length, body); const summary = summarise(rows); return renderFleetDashboard({ rows, selection, scrollOffset, filterQuery: deps.getFilter(), showFinished: deps.getShowFinished(), confirmation: confirm && confirm.until > Date.now() ? `press ${confirm.action === "kill" ? "x" : "r"} again to ${confirm.action} ${rows.find(row => row.key === confirm!.key)?.name ?? "agent"}` : undefined, summary: { ...summary, wallMs: unionMs(summary.intervals) }, comsLines }, w, body, theme); },
114
116
  handleInput: async (data: string) => { const rows = fleetRows(); reconcileSelection(selection, rows); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS), input = toInput(data);
115
117
  if (picker) { const action = modelPickerTransition(input, picker, picker.choices.length, body); if (action === "cancel") { if (picker.stage === "target") { const source = picker.source, choices = substitutionSourceChoices(), index = Math.max(0, choices.findIndex(choice => choice.spec === source)); picker = { stage: "source", choices, index, scrollOffset: index }; } else picker = null; } else if (action === "select") { const picked = picker.choices[picker.index]?.spec; if (picked && picker.stage === "source") { const targets = await deps.loadAvailableModels(ctx, deps.modelPolicy.getSubstitution(picked)); if (targets) { const current = deps.modelPolicy.getSubstitution(picked), index = Math.max(0, targets.findIndex(choice => choice.spec === current)); picker = { stage: "target", source: picked, choices: targets, index, scrollOffset: index }; } } else if (picked && picker.source) { await deps.modelPolicy.applySessionSubstitution(picker.source, picked, { loadAvailable: current => deps.loadAvailableModels(ctx, current), notify: (message, level) => ctx.ui.notify(message, level) }); picker = null; } } tui.requestRender(); return; }
116
118
  const state = { selection, scrollOffset, filtering, filterQuery: deps.getFilter(), showFinished: deps.getShowFinished(), confirm }, intent = dashboardTransition(input, state, rows, body); ({ scrollOffset, filtering, confirm } = state); deps.setFilter(state.filterQuery); deps.setShowFinished(state.showFinished);
117
- if (intent === "close") done(); else if (intent === "substitute") { const choices = substitutionSourceChoices(); if (!choices.length) ctx.ui.notify("No configured persona or sub-role models are available as substitution sources.", "warning"); else picker = { stage: "source", choices, index: 0, scrollOffset: 0 }; } else if (intent && typeof intent === "object" && "open" in intent) { const selected = rows.find(row => row.key === intent.open) ?? rows[selection.index]; if (selected) detailVerbose = await deps.openDetail(selected, ctx, detailVerbose); } else if (intent && typeof intent === "object" && "kill" in intent) { const selected = rows.find(row => row.key === intent.kill); if (selected) killRow(selected, ctx); else ctx.ui.notify("Selected fleet row no longer exists.", "warning"); } else if (intent && typeof intent === "object" && "restart" in intent) { const selected = rows.find(row => row.key === intent.restart); if (selected) await restartRow(selected, ctx); } tui.requestRender(); },
119
+ if (intent === "close") done(); else if (intent === "history") { await deps.openHistory(ctx); } else if (intent === "substitute") { const choices = substitutionSourceChoices(); if (!choices.length) ctx.ui.notify("No configured persona or sub-role models are available as substitution sources.", "warning"); else picker = { stage: "source", choices, index: 0, scrollOffset: 0 }; } else if (intent && typeof intent === "object" && "open" in intent) { const selected = rows.find(row => row.key === intent.open) ?? rows[selection.index]; if (selected) detailVerbose = await deps.openDetail(selected, ctx, detailVerbose); } else if (intent && typeof intent === "object" && "kill" in intent) { const selected = rows.find(row => row.key === intent.kill); if (selected) killRow(selected, ctx); else ctx.ui.notify("Selected fleet row no longer exists.", "warning"); } else if (intent && typeof intent === "object" && "restart" in intent) { const selected = rows.find(row => row.key === intent.restart); if (selected) await restartRow(selected, ctx); } tui.requestRender(); },
118
120
  invalidate() {}, dispose: () => resources.dispose() };
119
121
  }, FULLSCREEN_OVERLAY); } finally { resources.dispose(); }
120
122
  }
@@ -1,89 +1,35 @@
1
- import { Text, truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
2
- import { compactWidgetsEnabled } from "../../lib/fleet-dashboard-ops.ts";
1
+ import { Text } from "@mariozechner/pi-tui";
2
+ import { renderRunningStrip, type RunningStripItem } from "./running-strip.ts";
3
3
 
4
- type RunStatus = "idle" | "running" | "done" | "error";
5
- export interface GridAgentDef { name: string; description: string; thinking?: string; }
6
- export interface GridAgentState { def: GridAgentDef; status: RunStatus; elapsed: number; contextPct: number; lastBackend?: "native" | "coms"; comsPeerModel?: string; }
7
4
  export interface GridWidgetContext { ui: { setWidget(name: string, widget: unknown, options?: unknown): void } }
8
5
 
9
6
  export interface GridUIContext {
10
7
  getWidgetContext(): GridWidgetContext | null | undefined;
11
- getViewMode(): "compact" | "off";
12
- getAgentStates(): Map<string, GridAgentState>;
13
- getMarkedAgent(): string | null;
14
- setMarkedAgent(value: string | null): void;
15
- isRunningWidgetInstalled(): boolean;
16
- markRunningWidgetInstalled(): void;
17
- displayName(name: string): string;
18
- shortModel(model: string | undefined): string;
19
- modelWithThinking(def: GridAgentDef): string;
20
- contextWarnThreshold: number;
8
+ getRunningItems(): RunningStripItem[];
21
9
  }
22
10
 
23
- function contextPressure(contextPct: number, deps: GridUIContext): boolean {
24
- return contextPct >= deps.contextWarnThreshold;
25
- }
26
-
27
- function contextLabel(contextPct: number, warn = false): string {
28
- return `${warn ? "⚠" : ""}${Math.ceil(contextPct)}%`;
29
- }
30
-
31
- function cardStatus(status: "idle" | "running" | "done" | "error", elapsed: number): { color: string; text: string } {
32
- const color = status === "idle" ? "dim"
33
- : status === "running" ? "accent"
34
- : status === "done" ? "success" : "error";
35
- const icon = status === "idle" ? "○"
36
- : status === "running" ? "●"
37
- : status === "done" ? "✓" : "✗";
38
- const time = status !== "idle" ? ` ${Math.round(elapsed / 1000)}s` : "";
39
- return { color, text: `${icon} ${status}${time}` };
40
- }
11
+ export function createGridUI(deps: GridUIContext) {
12
+ let runningWidgetInstalled = false;
41
13
 
42
- // One-line agent summary for compact view: " Name 42% gpt-5.5 (xh) ● running 12s".
43
- // nameWidth aligns the name column across the running set; the styled line is
44
- // truncated to the widget width so ANSI runs never overflow. `model` already
45
- // carries the thinking badge (modelWithThinking); pass "" to omit it.
46
- function renderCompactLine(
47
- nameRaw: string,
48
- contextPct: number,
49
- model: string,
50
- status: { color: string; text: string },
51
- nameWidth: number,
52
- width: number,
53
- theme: any,
54
- marked = false,
55
- warnContext = false,
56
- ): string {
57
- const vis = visibleWidth(nameRaw);
58
- const name = vis >= nameWidth ? nameRaw : nameRaw + " ".repeat(nameWidth - vis);
59
- const ctx = contextLabel(contextPct, warnContext).padStart(4);
60
- // The marked row (compact-view switcher) gets a `›` lead + a full-width
61
- // selectedBg highlight, mirroring ZoomUI's selected-row treatment.
62
- const lead = marked ? theme.fg("accent", "›") : " ";
63
- const line = lead
64
- + theme.fg("accent", theme.bold(name))
65
- + " " + theme.fg(warnContext ? "warning" : "dim", ctx)
66
- + (model ? " " + theme.fg("dim", model) : "")
67
- + " " + theme.fg(status.color, status.text);
68
- const truncated = truncateToWidth(line, width);
69
- if (!marked) return truncated;
70
- const pad = " ".repeat(Math.max(0, width - visibleWidth(truncated)));
71
- return theme.bg("selectedBg", truncated + pad);
72
- }
14
+ function installRunningWidget() {
15
+ if (!deps.getWidgetContext() || runningWidgetInstalled) return;
16
+ runningWidgetInstalled = true;
17
+ deps.getWidgetContext()!.ui.setWidget("agent-running", (_tui: any, theme: any) => ({
18
+ invalidate() {},
19
+ render(width: number): string[] {
20
+ return renderRunningStrip(deps.getRunningItems(), width, theme);
21
+ },
22
+ }), { placement: "belowEditor" });
23
+ }
73
24
 
74
- export function createGridUI(deps: GridUIContext) {
75
25
  function updateWidget() {
76
26
  if (!deps.getWidgetContext()) return;
77
27
  installRunningWidget();
78
-
79
28
  deps.getWidgetContext()!.ui.setWidget("agent-team", (_tui: any, theme: any) => {
80
29
  const text = new Text("", 0, 1);
81
-
82
30
  return {
83
31
  render(_width: number): string[] {
84
- // The full fleet list is now a separate overlay; this legacy widget is retired.
85
32
  return [];
86
-
87
33
  },
88
34
  invalidate() {
89
35
  text.invalidate();
@@ -92,53 +38,5 @@ export function createGridUI(deps: GridUIContext) {
92
38
  });
93
39
  }
94
40
 
95
- // The compact running-agents widget, rendered BELOW the editor (between the
96
- // input box and the footer). Registered once; it re-renders on every frame
97
- // driven by updateWidget, reading live state + viewMode each time. In
98
- // dashboard mode it renders nothing. In compact mode it lists only *running*
99
- // team specialists, one line each — idle/done agents and research helpers are
100
- // omitted. Research helpers appear only in the Fleet Dashboard (Alt+A).
101
- // Ordered list of switchable subagents for the compact-view marker: running
102
- // team specialists. main is the session under the input box, so it is never
103
- // listed. Each entry's `key` matches /af-zoom resolution (lowercase persona
104
- // name), so Alt+\ can resolve it.
105
- function switchableAgents(): { key: string; name: string; ctx: number; ctxWarn: boolean; model: string; status: { color: string; text: string } }[] {
106
- return Array.from(deps.getAgentStates().values())
107
- .filter(a => a.status === "running")
108
- .map(a => ({
109
- key: a.def.name.toLowerCase(),
110
- name: deps.displayName(a.def.name),
111
- ctx: a.contextPct,
112
- ctxWarn: contextPressure(a.contextPct, deps),
113
- model: a.lastBackend === "coms" ? `⇄coms ${deps.shortModel(a.comsPeerModel)}` : deps.modelWithThinking(a.def),
114
- status: cardStatus(a.status, a.elapsed),
115
- }));
116
- }
117
-
118
- // Keep markedAgent pointing at a still-running entry: if the marked one is gone
119
- // (finished/killed), clamp to the nearest surviving entry, or null when empty.
120
- // Called from the cycle shortcuts and before a zoom.
121
- function clampMarker() {
122
- const keys = switchableAgents().map(a => a.key);
123
- if (keys.length === 0) { deps.setMarkedAgent(null); return; }
124
- if (deps.getMarkedAgent() && keys.includes(deps.getMarkedAgent()!)) return;
125
- deps.setMarkedAgent(keys[0]);
126
- }
127
-
128
- function installRunningWidget() {
129
- if (!deps.getWidgetContext() || deps.isRunningWidgetInstalled()) return;
130
- deps.markRunningWidgetInstalled();
131
- deps.getWidgetContext()!.ui.setWidget("agent-running", (_tui: any, theme: any) => ({
132
- invalidate() {},
133
- render(width: number): string[] {
134
- if (!compactWidgetsEnabled(deps.getViewMode())) return [];
135
- const running = switchableAgents();
136
- if (running.length === 0) return [];
137
- const nameWidth = Math.min(24, Math.max(...running.map(r => visibleWidth(r.name))));
138
- return running.map(r => renderCompactLine(r.name, r.ctx, r.model, r.status, nameWidth, width, theme, r.key === deps.getMarkedAgent(), r.ctxWarn));
139
- },
140
- }), { placement: "belowEditor" });
141
- }
142
-
143
- return { updateWidget, switchableAgents, clampMarker };
41
+ return { updateWidget };
144
42
  }
@@ -10,7 +10,6 @@ export interface PoolPresentationDeps {
10
10
  getPeerCards(): ReadonlyMap<string, { name: string; model: string; purpose: string; color: string; staleCount?: number }>;
11
11
  readProjectEntries(project: string): ComsRegistryEntry[];
12
12
  readAllEntries(): ComsRegistryEntry[];
13
- isCompact(): boolean;
14
13
  truncate(text: string, width: number): string;
15
14
  }
16
15
 
@@ -53,7 +52,6 @@ export function createPoolPresentation(deps: PoolPresentationDeps): PoolPresenta
53
52
  };
54
53
 
55
54
  const render = (width: number, theme: { fg(color: string, text: string): string }): string[] => {
56
- if (!deps.isCompact()) return [];
57
55
  const rows = buildFleetRows({ specialists: [], research: [], peers: peerInputs() }, { showFinished: true });
58
56
  const safeWidth = Math.max(0, width);
59
57
  const identity = deps.getIdentity();
@@ -95,9 +93,6 @@ export function createPoolPresentation(deps: PoolPresentationDeps): PoolPresenta
95
93
 
96
94
  return {
97
95
  peerInputs, render,
98
- install(ctx) {
99
- if (!ctx.hasUI) return;
100
- try { ctx.ui.setWidget("coms-pool", (_tui, theme) => ({ invalidate() {}, render: width => render(width, theme) }), { placement: "belowEditor" }); } catch {}
101
- },
96
+ install(_ctx) {},
102
97
  };
103
98
  }
@@ -0,0 +1,139 @@
1
+ import { activityDots, eventCount } from "./activity-dots.ts";
2
+
3
+ function visibleWidth(text: string): number {
4
+ return text.replace(/\x1b\[[0-9;]*m/g, "").length;
5
+ }
6
+
7
+ function truncateToWidth(text: string, width: number): string {
8
+ if (width <= 0) return "";
9
+ if (visibleWidth(text) <= width) return text;
10
+ let out = text;
11
+ while (out && visibleWidth(out) > width) out = out.slice(0, -1);
12
+ return out;
13
+ }
14
+
15
+ export interface RunningStripItem {
16
+ name: string;
17
+ model: string;
18
+ elapsedMs: number;
19
+ eventCount: number;
20
+ }
21
+
22
+ export interface StripSpecialistInput {
23
+ name: string;
24
+ status: string;
25
+ model: string;
26
+ elapsed: number;
27
+ toolCount: number;
28
+ messageCount: number;
29
+ delegations?: readonly StripDelegateInput[];
30
+ }
31
+
32
+ export interface StripDelegateInput {
33
+ role: string;
34
+ id: string;
35
+ status: string;
36
+ model: string;
37
+ elapsed: number;
38
+ startedAt: number;
39
+ toolCount: number;
40
+ messageCount: number;
41
+ }
42
+
43
+ export interface StripResearchInput {
44
+ id: number;
45
+ persona: boolean;
46
+ displayName: string;
47
+ status: string;
48
+ model: string;
49
+ elapsed: number;
50
+ toolCount: number;
51
+ messageCount: number;
52
+ }
53
+
54
+ export interface StripComsInput {
55
+ name: string;
56
+ model: string;
57
+ elapsed: number;
58
+ eventCount: number;
59
+ running: boolean;
60
+ }
61
+
62
+ const NAME_CAP = 24;
63
+
64
+ export function collectRunningStripItems(input: {
65
+ specialists: readonly StripSpecialistInput[];
66
+ research: readonly StripResearchInput[];
67
+ coms: readonly StripComsInput[];
68
+ }, now = Date.now()): RunningStripItem[] {
69
+ const items: RunningStripItem[] = [];
70
+ for (const spec of input.specialists) {
71
+ if (spec.status === "running") {
72
+ items.push({
73
+ name: spec.name,
74
+ model: spec.model,
75
+ elapsedMs: spec.elapsed,
76
+ eventCount: eventCount(spec.toolCount, spec.messageCount),
77
+ });
78
+ }
79
+ for (const child of spec.delegations ?? []) {
80
+ if (child.status !== "running") continue;
81
+ items.push({
82
+ name: `${spec.name}/${child.role || child.id}`,
83
+ model: child.model,
84
+ elapsedMs: child.status === "running" ? Math.max(0, now - child.startedAt) : child.elapsed,
85
+ eventCount: eventCount(child.toolCount, child.messageCount),
86
+ });
87
+ }
88
+ }
89
+ for (const research of input.research) {
90
+ if (research.status !== "running") continue;
91
+ items.push({
92
+ name: `r${research.id} ${research.persona ? research.displayName : "research"}`,
93
+ model: research.model,
94
+ elapsedMs: research.elapsed,
95
+ eventCount: eventCount(research.toolCount, research.messageCount),
96
+ });
97
+ }
98
+ for (const peer of input.coms) {
99
+ if (!peer.running) continue;
100
+ items.push({
101
+ name: `${peer.name} (coms)`,
102
+ model: peer.model,
103
+ elapsedMs: peer.elapsed,
104
+ eventCount: peer.eventCount,
105
+ });
106
+ }
107
+ return items;
108
+ }
109
+
110
+ export function renderRunningStripLine(
111
+ item: RunningStripItem,
112
+ nameWidth: number,
113
+ width: number,
114
+ theme: { fg(color: string, text: string): string; bold?(text: string): string },
115
+ ): string {
116
+ const vis = visibleWidth(item.name);
117
+ const name = vis >= nameWidth ? item.name : item.name + " ".repeat(nameWidth - vis);
118
+ const boldName = theme.bold ? theme.bold(name) : name;
119
+ const secs = `${Math.round(item.elapsedMs / 1000)}s`;
120
+ const dots = activityDots(item.eventCount);
121
+ const line = " "
122
+ + theme.fg("accent", boldName)
123
+ + " "
124
+ + theme.fg("dim", item.model)
125
+ + " "
126
+ + theme.fg("accent", secs)
127
+ + (dots ? " " + theme.fg("dim", dots) : "");
128
+ return truncateToWidth(line, width);
129
+ }
130
+
131
+ export function renderRunningStrip(
132
+ items: readonly RunningStripItem[],
133
+ width: number,
134
+ theme: { fg(color: string, text: string): string; bold?(text: string): string },
135
+ ): string[] {
136
+ if (items.length === 0) return [];
137
+ const nameWidth = Math.min(NAME_CAP, Math.max(...items.map(item => visibleWidth(item.name))));
138
+ return items.map(item => renderRunningStripLine(item, nameWidth, width, theme));
139
+ }
@@ -3,5 +3,5 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "version": "2.0.4"
6
+ "version": "2.0.5"
7
7
  }
@@ -3,5 +3,5 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "version": "2.0.4"
6
+ "version": "2.0.5"
7
7
  }
@@ -132,11 +132,6 @@ export function renderCardGrid<T>(
132
132
  return lines;
133
133
  }
134
134
 
135
- /** Compact below-editor specialist widgets render only in compact mode. */
136
- export function compactWidgetsEnabled(viewMode: "compact" | "off"): boolean {
137
- return viewMode === "compact";
138
- }
139
-
140
135
  /** Freeze an already-open Fleet detail row when its live target leaves "running". */
141
136
  export function snapshotFleetDetailRow<
142
137
  T extends { status: string; startedAt?: number; elapsed: number; lastWork: string },