@chankov/agent-fleet 2.0.2 → 2.0.3

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 (438) hide show
  1. package/.pi/harnesses/agent-hub/README.md +26 -31
  2. package/.pi/harnesses/agent-hub/commands/agents-restart.ts +1 -1
  3. package/.pi/harnesses/agent-hub/config/overrides.ts +2 -7
  4. package/.pi/harnesses/agent-hub/index.ts +14 -25
  5. package/.pi/harnesses/agent-hub/input/completions.ts +2 -2
  6. package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +0 -2
  7. package/.pi/harnesses/agent-hub/package.json +1 -1
  8. package/.pi/harnesses/agent-hub/prompts/session-start.ts +1 -1
  9. package/.pi/harnesses/agent-hub/research/controls.ts +15 -16
  10. package/.pi/harnesses/agent-hub/research/runtime.ts +30 -39
  11. package/.pi/harnesses/agent-hub/research/spawn-run.ts +108 -111
  12. package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +2 -3
  13. package/.pi/harnesses/agent-hub/ui/detail-panel.ts +3 -3
  14. package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +0 -7
  15. package/.pi/harnesses/agent-hub/ui/grid.ts +21 -183
  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/fleet-dashboard-ops.ts +23 -12
  19. package/.versions/2.0.3/.pi/agents/dispatch-policy.yaml +32 -0
  20. package/.versions/2.0.3/.pi/agents/model-profiles.yaml +27 -0
  21. package/.versions/2.0.3/.pi/agents/peers.yaml +142 -0
  22. package/.versions/2.0.3/.pi/agents/teams.yaml +41 -0
  23. package/.versions/2.0.3/.pi/agents/voices.yaml +13 -0
  24. package/.versions/2.0.3/.pi/damage-control-rules.yaml +297 -0
  25. package/.versions/2.0.3/.pi/extensions/agent-fleet-update-check/README.md +57 -0
  26. package/.versions/2.0.3/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  27. package/.versions/2.0.3/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  28. package/.versions/2.0.3/.pi/extensions/btw/README.md +120 -0
  29. package/.versions/2.0.3/.pi/extensions/btw/index.ts +914 -0
  30. package/.versions/2.0.3/.pi/extensions/btw/package.json +6 -0
  31. package/.versions/2.0.3/.pi/extensions/btw/state.js +179 -0
  32. package/.versions/2.0.3/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  33. package/.versions/2.0.3/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  34. package/.versions/2.0.3/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  35. package/.versions/2.0.3/.pi/extensions/compact-and-continue/README.md +42 -0
  36. package/.versions/2.0.3/.pi/extensions/compact-and-continue/index.ts +120 -0
  37. package/.versions/2.0.3/.pi/extensions/compact-and-continue/package.json +6 -0
  38. package/.versions/2.0.3/.pi/extensions/mcp-bridge/README.md +46 -0
  39. package/.versions/2.0.3/.pi/extensions/mcp-bridge/index.ts +206 -0
  40. package/.versions/2.0.3/.pi/extensions/mcp-bridge/package.json +6 -0
  41. package/.versions/2.0.3/.pi/extensions/package-lock.json +1175 -0
  42. package/.versions/2.0.3/.pi/extensions/package.json +9 -0
  43. package/.versions/2.0.3/.pi/extensions/pi-voice-stt/README.md +205 -0
  44. package/.versions/2.0.3/.pi/extensions/pi-voice-stt/config.ts +198 -0
  45. package/.versions/2.0.3/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  46. package/.versions/2.0.3/.pi/extensions/pi-voice-stt/index.ts +248 -0
  47. package/.versions/2.0.3/.pi/extensions/pi-voice-stt/package.json +6 -0
  48. package/.versions/2.0.3/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  49. package/.versions/2.0.3/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  50. package/.versions/2.0.3/.pi/harnesses/agent-hub/README.md +1158 -0
  51. package/.versions/2.0.3/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  52. package/.versions/2.0.3/.pi/harnesses/agent-hub/artifacts.js +146 -0
  53. package/.versions/2.0.3/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  54. package/.versions/2.0.3/.pi/harnesses/agent-hub/backend-policy.js +174 -0
  55. package/.versions/2.0.3/.pi/harnesses/agent-hub/budget-continuation.ts +73 -0
  56. package/.versions/2.0.3/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
  57. package/.versions/2.0.3/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
  58. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
  59. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
  60. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
  61. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
  62. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
  63. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
  64. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
  65. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
  66. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
  67. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
  68. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
  69. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
  70. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
  71. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
  72. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/context.ts +41 -0
  73. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
  74. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
  75. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
  76. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
  77. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/models.ts +10 -0
  78. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
  79. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
  80. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
  81. package/.versions/2.0.3/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
  82. package/.versions/2.0.3/.pi/harnesses/agent-hub/config/agents.ts +180 -0
  83. package/.versions/2.0.3/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
  84. package/.versions/2.0.3/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
  85. package/.versions/2.0.3/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +211 -0
  86. package/.versions/2.0.3/.pi/harnesses/agent-hub/context/budgets.ts +208 -0
  87. package/.versions/2.0.3/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
  88. package/.versions/2.0.3/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
  89. package/.versions/2.0.3/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
  90. package/.versions/2.0.3/.pi/harnesses/agent-hub/context-window.js +106 -0
  91. package/.versions/2.0.3/.pi/harnesses/agent-hub/debate-command.ts +176 -0
  92. package/.versions/2.0.3/.pi/harnesses/agent-hub/delegate.ts +446 -0
  93. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-coms.ts +232 -0
  94. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
  95. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-native-complete.ts +135 -0
  96. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +153 -0
  97. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +191 -0
  98. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-native-types.ts +207 -0
  99. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-native.ts +184 -0
  100. package/.versions/2.0.3/.pi/harnesses/agent-hub/dispatch-observability.ts +220 -0
  101. package/.versions/2.0.3/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  102. package/.versions/2.0.3/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
  103. package/.versions/2.0.3/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  104. package/.versions/2.0.3/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  105. package/.versions/2.0.3/.pi/harnesses/agent-hub/fixtures/registration-surface.json +55 -0
  106. package/.versions/2.0.3/.pi/harnesses/agent-hub/footer.ts +30 -0
  107. package/.versions/2.0.3/.pi/harnesses/agent-hub/helpers.ts +266 -0
  108. package/.versions/2.0.3/.pi/harnesses/agent-hub/hub-state-audit.js +59 -0
  109. package/.versions/2.0.3/.pi/harnesses/agent-hub/index.ts +2036 -0
  110. package/.versions/2.0.3/.pi/harnesses/agent-hub/input/completions.ts +76 -0
  111. package/.versions/2.0.3/.pi/harnesses/agent-hub/input/shortcuts.ts +47 -0
  112. package/.versions/2.0.3/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
  113. package/.versions/2.0.3/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
  114. package/.versions/2.0.3/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +141 -0
  115. package/.versions/2.0.3/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +95 -0
  116. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  117. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  118. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  119. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  120. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  121. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  122. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  123. package/.versions/2.0.3/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
  124. package/.versions/2.0.3/.pi/harnesses/agent-hub/package.json +7 -0
  125. package/.versions/2.0.3/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
  126. package/.versions/2.0.3/.pi/harnesses/agent-hub/policy/models.ts +126 -0
  127. package/.versions/2.0.3/.pi/harnesses/agent-hub/policy/roster.ts +79 -0
  128. package/.versions/2.0.3/.pi/harnesses/agent-hub/policy/work-mode.ts +118 -0
  129. package/.versions/2.0.3/.pi/harnesses/agent-hub/poll-command.ts +176 -0
  130. package/.versions/2.0.3/.pi/harnesses/agent-hub/presentation.ts +48 -0
  131. package/.versions/2.0.3/.pi/harnesses/agent-hub/prompts/context.ts +46 -0
  132. package/.versions/2.0.3/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
  133. package/.versions/2.0.3/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
  134. package/.versions/2.0.3/.pi/harnesses/agent-hub/prompts/system-prompt.ts +110 -0
  135. package/.versions/2.0.3/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  136. package/.versions/2.0.3/.pi/harnesses/agent-hub/research/controls.ts +74 -0
  137. package/.versions/2.0.3/.pi/harnesses/agent-hub/research/runtime.ts +175 -0
  138. package/.versions/2.0.3/.pi/harnesses/agent-hub/research/spawn-run.ts +143 -0
  139. package/.versions/2.0.3/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  140. package/.versions/2.0.3/.pi/harnesses/agent-hub/return-contract.js +293 -0
  141. package/.versions/2.0.3/.pi/harnesses/agent-hub/return-extract.js +75 -0
  142. package/.versions/2.0.3/.pi/harnesses/agent-hub/review-findings.js +102 -0
  143. package/.versions/2.0.3/.pi/harnesses/agent-hub/run-budget.js +537 -0
  144. package/.versions/2.0.3/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  145. package/.versions/2.0.3/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  146. package/.versions/2.0.3/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  147. package/.versions/2.0.3/.pi/harnesses/agent-hub/session-health.js +110 -0
  148. package/.versions/2.0.3/.pi/harnesses/agent-hub/session-start.ts +42 -0
  149. package/.versions/2.0.3/.pi/harnesses/agent-hub/spawn.ts +388 -0
  150. package/.versions/2.0.3/.pi/harnesses/agent-hub/timeline.ts +54 -0
  151. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/action-executors.ts +146 -0
  152. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
  153. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/context.ts +132 -0
  154. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +79 -0
  155. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +199 -0
  156. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
  157. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/fleet-tools.ts +202 -0
  158. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/herdr-executors.ts +82 -0
  159. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
  160. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
  161. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
  162. package/.versions/2.0.3/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
  163. package/.versions/2.0.3/.pi/harnesses/agent-hub/types.ts +61 -0
  164. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
  165. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/detail-panel.ts +175 -0
  166. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +123 -0
  167. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/grid.ts +144 -0
  168. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
  169. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/history.ts +234 -0
  170. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
  171. package/.versions/2.0.3/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
  172. package/.versions/2.0.3/.pi/harnesses/agent-hub/version.ts +42 -0
  173. package/.versions/2.0.3/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
  174. package/.versions/2.0.3/.pi/harnesses/agent-hub/work-mode.ts +167 -0
  175. package/.versions/2.0.3/.pi/harnesses/ask-user-remote/README.md +53 -0
  176. package/.versions/2.0.3/.pi/harnesses/ask-user-remote/index.ts +532 -0
  177. package/.versions/2.0.3/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  178. package/.versions/2.0.3/.pi/harnesses/coms/README.md +100 -0
  179. package/.versions/2.0.3/.pi/harnesses/coms/index.ts +276 -0
  180. package/.versions/2.0.3/.pi/harnesses/coms/package.json +7 -0
  181. package/.versions/2.0.3/.pi/harnesses/coms/version.ts +42 -0
  182. package/.versions/2.0.3/.pi/harnesses/damage-control-continue/README.md +124 -0
  183. package/.versions/2.0.3/.pi/harnesses/damage-control-continue/index.ts +536 -0
  184. package/.versions/2.0.3/.pi/harnesses/damage-control-continue/package.json +7 -0
  185. package/.versions/2.0.3/.pi/harnesses/damage-control-continue/version.ts +42 -0
  186. package/.versions/2.0.3/.pi/harnesses/lib/coms-core-io.ts +385 -0
  187. package/.versions/2.0.3/.pi/harnesses/lib/coms-core.ts +577 -0
  188. package/.versions/2.0.3/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  189. package/.versions/2.0.3/.pi/harnesses/lib/context-budget-child-prompt.ts +179 -0
  190. package/.versions/2.0.3/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
  191. package/.versions/2.0.3/.pi/harnesses/lib/context-budget-view.ts +107 -0
  192. package/.versions/2.0.3/.pi/harnesses/lib/context-budget.ts +114 -0
  193. package/.versions/2.0.3/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  194. package/.versions/2.0.3/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
  195. package/.versions/2.0.3/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
  196. package/.versions/2.0.3/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
  197. package/.versions/2.0.3/.pi/harnesses/lib/fleet-dashboard-ops.ts +166 -0
  198. package/.versions/2.0.3/.pi/harnesses/lib/fleet-dashboard-view.ts +142 -0
  199. package/.versions/2.0.3/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
  200. package/.versions/2.0.3/.pi/harnesses/lib/fleet-overlay.ts +26 -0
  201. package/.versions/2.0.3/.pi/harnesses/lib/fleet-panel.ts +34 -0
  202. package/.versions/2.0.3/.pi/harnesses/lib/fleet-read-model.ts +131 -0
  203. package/.versions/2.0.3/.pi/harnesses/lib/fleet-selection.ts +24 -0
  204. package/.versions/2.0.3/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
  205. package/.versions/2.0.3/.pi/harnesses/lib/herdr-client.ts +472 -0
  206. package/.versions/2.0.3/.pi/harnesses/lib/herdr-presence.ts +399 -0
  207. package/.versions/2.0.3/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  208. package/.versions/2.0.3/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  209. package/.versions/2.0.3/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  210. package/.versions/2.0.3/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  211. package/.versions/2.0.3/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  212. package/.versions/2.0.3/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  213. package/.versions/2.0.3/.pi/harnesses/lib/spawned-peers.js +190 -0
  214. package/.versions/2.0.3/.pi/harnesses/package-lock.json +2039 -0
  215. package/.versions/2.0.3/.pi/harnesses/package.json +10 -0
  216. package/.versions/2.0.3/.pi/prompts/af-build.md +24 -0
  217. package/.versions/2.0.3/.pi/prompts/af-code-simplify.md +22 -0
  218. package/.versions/2.0.3/.pi/prompts/af-plan.md +17 -0
  219. package/.versions/2.0.3/.pi/prompts/af-review.md +16 -0
  220. package/.versions/2.0.3/.pi/prompts/af-set-hermes-telegram.md +15 -0
  221. package/.versions/2.0.3/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  222. package/.versions/2.0.3/.pi/prompts/af-ship.md +17 -0
  223. package/.versions/2.0.3/.pi/prompts/af-spec.md +15 -0
  224. package/.versions/2.0.3/.pi/prompts/af-test.md +19 -0
  225. package/.versions/2.0.3/.pi/skills/bowser/SKILL.md +145 -0
  226. package/.versions/2.0.3/.version +1 -0
  227. package/.versions/2.0.3/agents/architect.md +25 -0
  228. package/.versions/2.0.3/agents/bowser.md +28 -0
  229. package/.versions/2.0.3/agents/builder.md +56 -0
  230. package/.versions/2.0.3/agents/code-reviewer.md +210 -0
  231. package/.versions/2.0.3/agents/deep-researcher.md +33 -0
  232. package/.versions/2.0.3/agents/documenter.md +22 -0
  233. package/.versions/2.0.3/agents/orchestrator.md +23 -0
  234. package/.versions/2.0.3/agents/plan-reviewer.md +84 -0
  235. package/.versions/2.0.3/agents/planner.md +105 -0
  236. package/.versions/2.0.3/agents/releaser.md +25 -0
  237. package/.versions/2.0.3/agents/researcher.md +31 -0
  238. package/.versions/2.0.3/agents/security-auditor.md +168 -0
  239. package/.versions/2.0.3/agents/test-engineer.md +154 -0
  240. package/.versions/2.0.3/agents/web-debugger.md +44 -0
  241. package/.versions/2.0.3/agents/web-performance-auditor.md +194 -0
  242. package/.versions/2.0.3/bin/catalog/harness-runtime-closure.json +34 -0
  243. package/.versions/2.0.3/codex/CONDUCTOR.md +148 -0
  244. package/.versions/2.0.3/docs/ARCHITECTURE.md +407 -0
  245. package/.versions/2.0.3/docs/agent-fleet-setup.md +473 -0
  246. package/.versions/2.0.3/docs/claude-code-coms-bridge.md +128 -0
  247. package/.versions/2.0.3/docs/codex-remote-conductor.md +170 -0
  248. package/.versions/2.0.3/docs/coms-hermes-bridge.md +189 -0
  249. package/.versions/2.0.3/docs/getting-started.md +119 -0
  250. package/.versions/2.0.3/docs/npm-install.md +292 -0
  251. package/.versions/2.0.3/docs/pi-extensions.md +447 -0
  252. package/.versions/2.0.3/docs/pi-setup.md +74 -0
  253. package/.versions/2.0.3/docs/skill-anatomy.md +150 -0
  254. package/.versions/2.0.3/hermes/README.md +347 -0
  255. package/.versions/2.0.3/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  256. package/.versions/2.0.3/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  257. package/.versions/2.0.3/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  258. package/.versions/2.0.3/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  259. package/.versions/2.0.3/hermes/gates/gate-o-capability.md +8 -0
  260. package/.versions/2.0.3/hermes/gates/gate-o-validator-fixtures.json +1 -0
  261. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
  262. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  263. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  264. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  265. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  266. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  267. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  268. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  269. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  270. package/.versions/2.0.3/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  271. package/.versions/2.0.3/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  272. package/.versions/2.0.3/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  273. package/.versions/2.0.3/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  274. package/.versions/2.0.3/hermes/skills/hub-conductor/SKILL.md +84 -0
  275. package/.versions/2.0.3/hermes/skills/hub-liaison/SKILL.md +84 -0
  276. package/.versions/2.0.3/hermes/skills/hub-watchdog/SKILL.md +76 -0
  277. package/.versions/2.0.3/hermes/skills/hub-watchdog/manifest.json +1 -0
  278. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  279. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  280. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  281. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  282. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  283. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  284. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  285. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  286. package/.versions/2.0.3/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  287. package/.versions/2.0.3/hermes/watchdog-tests/__init__.py +0 -0
  288. package/.versions/2.0.3/hooks/coms-stop-hook.mjs +84 -0
  289. package/.versions/2.0.3/install-manifest.json +2940 -0
  290. package/.versions/2.0.3/justfile +289 -0
  291. package/.versions/2.0.3/manifest-meta.json +969 -0
  292. package/.versions/2.0.3/references/accessibility-checklist.md +160 -0
  293. package/.versions/2.0.3/references/communication-contract.md +26 -0
  294. package/.versions/2.0.3/references/definition-of-done.md +67 -0
  295. package/.versions/2.0.3/references/fleet-coordination-patterns.md +171 -0
  296. package/.versions/2.0.3/references/observability-checklist.md +91 -0
  297. package/.versions/2.0.3/references/orchestration-patterns.md +370 -0
  298. package/.versions/2.0.3/references/performance-checklist.md +153 -0
  299. package/.versions/2.0.3/references/prompting-patterns.md +380 -0
  300. package/.versions/2.0.3/references/security-checklist.md +179 -0
  301. package/.versions/2.0.3/references/testing-patterns.md +236 -0
  302. package/.versions/2.0.3/references/workflow-authoring.md +304 -0
  303. package/.versions/2.0.3/scripts/codex-conductor.ts +41 -0
  304. package/.versions/2.0.3/scripts/codex-remote-control.ts +167 -0
  305. package/.versions/2.0.3/scripts/coms-claude-bridge.ts +411 -0
  306. package/.versions/2.0.3/scripts/coms-cli.ts +484 -0
  307. package/.versions/2.0.3/scripts/coms-hermes-bridge.ts +413 -0
  308. package/.versions/2.0.3/scripts/fleet.ts +199 -0
  309. package/.versions/2.0.3/scripts/flow.ts +137 -0
  310. package/.versions/2.0.3/scripts/hermes-monitor-capability-runner.ts +25 -0
  311. package/.versions/2.0.3/scripts/hermes-monitor-scenario.ts +474 -0
  312. package/.versions/2.0.3/scripts/hermes-watchdog-capability-probe.ts +45 -0
  313. package/.versions/2.0.3/scripts/install-hermes-plugin.sh +180 -0
  314. package/.versions/2.0.3/scripts/lib/claude-bridge-core.ts +210 -0
  315. package/.versions/2.0.3/scripts/lib/codex-conductor.ts +88 -0
  316. package/.versions/2.0.3/scripts/lib/codex-remote-control.ts +482 -0
  317. package/.versions/2.0.3/scripts/lib/coms-envelope.ts +582 -0
  318. package/.versions/2.0.3/scripts/lib/fake-herdr-server.ts +88 -0
  319. package/.versions/2.0.3/scripts/lib/fleet-command.ts +270 -0
  320. package/.versions/2.0.3/scripts/lib/flow-command.ts +93 -0
  321. package/.versions/2.0.3/scripts/lib/flow-maintenance.ts +230 -0
  322. package/.versions/2.0.3/scripts/lib/herdr-layout.ts +281 -0
  323. package/.versions/2.0.3/scripts/lib/hermes-bridge-core.ts +241 -0
  324. package/.versions/2.0.3/scripts/lib/hermes-monitor-events.ts +1 -0
  325. package/.versions/2.0.3/scripts/lib/hermes-monitor-herdr.ts +2 -0
  326. package/.versions/2.0.3/scripts/lib/hermes-monitor-model.ts +3 -0
  327. package/.versions/2.0.3/scripts/lib/hermes-monitor-registry.ts +2 -0
  328. package/.versions/2.0.3/scripts/lib/hermes-monitor-socket.ts +2 -0
  329. package/.versions/2.0.3/scripts/lib/hermes-monitor-store.ts +2 -0
  330. package/.versions/2.0.3/scripts/lib/monitor-env.ts +146 -0
  331. package/.versions/2.0.3/scripts/lib/peer-launch.ts +318 -0
  332. package/.versions/2.0.3/scripts/lib/persona-banner.ts +62 -0
  333. package/.versions/2.0.3/scripts/lib/spawn-stagger.ts +101 -0
  334. package/.versions/2.0.3/scripts/lib/team-project.ts +213 -0
  335. package/.versions/2.0.3/scripts/lib/team-snapshot.ts +147 -0
  336. package/.versions/2.0.3/scripts/package-lock.json +35 -0
  337. package/.versions/2.0.3/scripts/package.json +9 -0
  338. package/.versions/2.0.3/scripts/peer-banner.ts +40 -0
  339. package/.versions/2.0.3/scripts/peer-launch.ts +259 -0
  340. package/.versions/2.0.3/scripts/team-snapshot.ts +237 -0
  341. package/.versions/2.0.3/scripts/team-up.ts +406 -0
  342. package/.versions/2.0.3/scripts/workflows/lib/agent-phase.ts +132 -0
  343. package/.versions/2.0.3/scripts/workflows/lib/changes.ts +61 -0
  344. package/.versions/2.0.3/scripts/workflows/lib/debate.ts +149 -0
  345. package/.versions/2.0.3/scripts/workflows/lib/env.ts +34 -0
  346. package/.versions/2.0.3/scripts/workflows/lib/envelopes.ts +169 -0
  347. package/.versions/2.0.3/scripts/workflows/lib/gates.ts +81 -0
  348. package/.versions/2.0.3/scripts/workflows/lib/git.ts +96 -0
  349. package/.versions/2.0.3/scripts/workflows/lib/merge.ts +95 -0
  350. package/.versions/2.0.3/scripts/workflows/lib/model-visibility.ts +92 -0
  351. package/.versions/2.0.3/scripts/workflows/lib/permissions.ts +130 -0
  352. package/.versions/2.0.3/scripts/workflows/lib/personas.ts +54 -0
  353. package/.versions/2.0.3/scripts/workflows/lib/poll.ts +86 -0
  354. package/.versions/2.0.3/scripts/workflows/lib/quality.ts +64 -0
  355. package/.versions/2.0.3/scripts/workflows/lib/run.ts +108 -0
  356. package/.versions/2.0.3/scripts/workflows/lib/trace.ts +34 -0
  357. package/.versions/2.0.3/scripts/workflows/lib/voices.ts +125 -0
  358. package/.versions/2.0.3/scripts/workflows/lib/writer-lease.ts +112 -0
  359. package/.versions/2.0.3/scripts/workflows/tsconfig.json +22 -0
  360. package/.versions/2.0.3/scripts/workflows/wf-build-test.ts +61 -0
  361. package/.versions/2.0.3/scripts/workflows/wf-debate.ts +87 -0
  362. package/.versions/2.0.3/scripts/workflows/wf-document.ts +50 -0
  363. package/.versions/2.0.3/scripts/workflows/wf-poll.ts +95 -0
  364. package/.versions/2.0.3/scripts/workflows/wf-quality.ts +20 -0
  365. package/.versions/2.0.3/scripts/workflows/wf-scout.ts +38 -0
  366. package/.versions/2.0.3/skills/_internal/grilling.md +59 -0
  367. package/.versions/2.0.3/skills/browser-testing-with-devtools/SKILL.md +351 -0
  368. package/.versions/2.0.3/skills/code-review-and-quality/SKILL.md +381 -0
  369. package/.versions/2.0.3/skills/compound-learning/SKILL.md +137 -0
  370. package/.versions/2.0.3/skills/context-engineering/SKILL.md +291 -0
  371. package/.versions/2.0.3/skills/deprecation-and-migration/SKILL.md +206 -0
  372. package/.versions/2.0.3/skills/designing-agents/SKILL.md +394 -0
  373. package/.versions/2.0.3/skills/designing-agents/pi-harness-authoring.md +222 -0
  374. package/.versions/2.0.3/skills/drafting-workflows/SKILL.md +143 -0
  375. package/.versions/2.0.3/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
  376. package/.versions/2.0.3/skills/frontend-ui-engineering/SKILL.md +328 -0
  377. package/.versions/2.0.3/skills/git-workflow-and-versioning/SKILL.md +316 -0
  378. package/.versions/2.0.3/skills/idea-refine/SKILL.md +182 -0
  379. package/.versions/2.0.3/skills/idea-refine/examples.md +238 -0
  380. package/.versions/2.0.3/skills/idea-refine/frameworks.md +99 -0
  381. package/.versions/2.0.3/skills/idea-refine/refinement-criteria.md +113 -0
  382. package/.versions/2.0.3/skills/idea-refine/scripts/idea-refine.sh +15 -0
  383. package/.versions/2.0.3/skills/incremental-implementation/SKILL.md +298 -0
  384. package/.versions/2.0.3/skills/interview-me/SKILL.md +226 -0
  385. package/.versions/2.0.3/skills/orchestration-verification/SKILL.md +181 -0
  386. package/.versions/2.0.3/skills/peer-coms/SKILL.md +90 -0
  387. package/.versions/2.0.3/skills/performance-optimization/SKILL.md +350 -0
  388. package/.versions/2.0.3/skills/planning-and-task-breakdown/SKILL.md +265 -0
  389. package/.versions/2.0.3/skills/security-and-hardening/SKILL.md +461 -0
  390. package/.versions/2.0.3/skills/spec-driven-development/SKILL.md +256 -0
  391. package/.versions/2.0.3/skills/using-agent-skills/SKILL.md +197 -0
  392. package/.versions/2.0.3/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  393. package/.versions/2.0.3/vendor/agent-skills-upstream/LICENSE +21 -0
  394. package/.versions/2.0.3/vendor/agent-skills-upstream/README.md +11 -0
  395. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  396. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  397. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  398. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  399. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  400. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  401. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  402. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  403. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  404. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  405. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  406. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  407. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  408. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  409. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  410. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  411. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  412. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  413. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  414. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  415. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  416. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  417. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  418. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  419. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  420. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  421. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  422. package/.versions/2.0.3/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  423. package/CHANGELOG.md +7 -0
  424. package/README.md +2 -2
  425. package/bin/lib/doctor.js +1 -1
  426. package/bin/lib/model-visibility.js +64 -0
  427. package/docs/agent-fleet-setup.md +1 -1
  428. package/docs/getting-started.md +2 -2
  429. package/docs/npm-install.md +1 -1
  430. package/docs/pi-extensions.md +13 -10
  431. package/install-manifest.json +36 -1
  432. package/justfile +1 -0
  433. package/manifest-meta.json +25 -1
  434. package/package.json +4 -2
  435. package/scripts/fleet.ts +1 -1
  436. package/scripts/package-lock.json +35 -0
  437. package/scripts/package.json +9 -0
  438. package/.pi/harnesses/agent-hub/research-retention.js +0 -34
@@ -155,12 +155,12 @@ Every borrowed idea from another harness passes one test before it lands: *does
155
155
  `kind: research` personas ship by default: `researcher` (`gpt-5.6-luna`, low thinking) for simple
156
156
  reads and `deep-researcher` (`grok-4.6`, medium thinking) for hard, cross-cutting investigation.
157
157
  The dispatcher routes by persona; each persona's model + thinking level is shown in its catalog.
158
- Finished helpers are **auto-pruned** so the research row doesn't grow without bound: auto-research
159
- pipe helpers disappear as soon as they finish (their findings persist as `findings/*.md` files),
160
- while durable helpers keep only the `research-keep` most recently finished (default 4) for
161
- dashboard inspection or a fresh `/af-agents-restart rN`; older cards and session files are dropped
162
- oldest-first. Set `research-keep: <n>|all` in the overrides file to change the cap. Running helpers
163
- are never pruned and `rN` handles are never reused.
158
+ Live helpers appear **only in the Fleet Dashboard (`Alt+A`)** while they are running — never as
159
+ cards or compact rows in the main dispatcher view. On every terminal outcome (success, error,
160
+ timeout, spawn/preflight failure, or operator kill) the live `rN` handle is removed immediately.
161
+ Session, transcript, and `findings/*.md` files remain on disk for the requester, and
162
+ `/af-agents-history` keeps the audit/timing record. Finished helpers cannot be restarted; a new
163
+ request always creates a fresh helper. `rN` handles are never reused during a Hub session.
164
164
  - **Human handoff path** — `ask_user` is exposed by the `ask-user-remote` wrapper (capturing stock
165
165
  `pi-ask-user` and optionally racing a `user-remote` bridge), so specialists can bubble decisions
166
166
  back through the dispatcher.
@@ -230,13 +230,12 @@ Every borrowed idea from another harness passes one test before it lands: *does
230
230
  - **Agent controls** — `/af-zoom` inspects a live agent timeline; `/af-agents-history` replays the run as a
231
231
  timeline (orchestrator turns, dispatches, research helpers) with per-agent durations, parallel-run
232
232
  markers, and a grand total; kill/restart controls manage running child agents; per-agent `model:`
233
- fields select models from team config. The retained `agents-*` commands address **both target kinds** —
234
- team specialists by persona name, research helpers by `rN` handle (mirroring `/af-zoom`):
235
- `/af-agents-kill <name|rN|all>` SIGTERMs a specialist (keeping its standing card), while on a
236
- research helper it kills **and removes** the card + session — helpers are disposable by design
237
- (`all` clears every helper); `/af-agents-restart <name|rN>` re-runs the last task fresh (a research
238
- helper must be finished first). Research spawning and follow-up reconnaissance are automated through
239
- `spawn_research` and `NEEDS_RESEARCH:`; there are no dedicated research lifecycle slash commands.
233
+ fields select models from team config. `/af-agents-kill <name|rN|all>` SIGTERMs a specialist (keeping
234
+ its standing card) or kills a currently running research helper (`all` clears every live helper).
235
+ `/af-agents-restart <name>` re-runs a specialist's last task fresh; research helpers cannot be
236
+ restarted. `/af-zoom <name|rN>` opens a running helper through the Fleet data model. Research spawning
237
+ and follow-up reconnaissance are automated through `spawn_research` and `NEEDS_RESEARCH:`; there are
238
+ no dedicated research lifecycle slash commands.
240
239
  Restartable team specialists at or above 70% context render
241
240
  their context percentage with a warning marker/color in dashboard and compact views, and their next
242
241
  `dispatch_agent` result adds a `/af-agents-restart <persona>` hint. Research helpers are not warned,
@@ -374,10 +373,11 @@ execution **tree**:
374
373
  Navigate with `↑/↓`, press `G` to jump back to the live tail, and `Q`/`Esc` to close. The log resets
375
374
  on each session start.
376
375
 
377
- The agent view starts with the **compact widget** enabled: one line per *running* agent —
376
+ The agent view starts with the **compact widget** enabled: one line per *running* specialist —
378
377
  `name · context% · state` — *below* the input box, just above pi's status bar. Idle and done agents
379
- are hidden, and the coms pool widget collapses too, so an idle session collapses to just the prompt
380
- and footer. **`Alt+Shift+A`** toggles that widget on or off; the footer reports
378
+ and all research helpers are hidden here (running helpers live in the Fleet Dashboard), and the coms
379
+ pool widget collapses too, so an idle session collapses to just the prompt and footer.
380
+ **`Alt+Shift+A`** toggles that widget on or off; the footer reports
381
381
  `Alt+A fleet · Alt+M Operator · Alt+Shift+A widget:compact|off`.
382
382
 
383
383
  ### Work Mode picker
@@ -391,7 +391,7 @@ terminal must send Option as Meta or Alt+M will not reach the Hub.
391
391
 
392
392
  Press **`Alt+A`** or run **`/af-agents-list`** to open the full-screen **Fleet Dashboard**. It is a
393
393
  separate, live overlay—not an alternate compact-widget mode—and lists specialists, nested delegates,
394
- research helpers, and coms peers. It shows status, hierarchy, model, context/tokens, elapsed time,
394
+ running research helpers, and coms peers. It shows status, hierarchy, model, context/tokens, elapsed time,
395
395
  tool count, and recent work; its summary counts running/done/failed rows, overlap-aware wall time,
396
396
  and visible token totals. Finished/idle/stale rows are hidden by default.
397
397
 
@@ -402,7 +402,9 @@ and visible token totals. Finished/idle/stale rows are hidden by default.
402
402
  - **`x`** requests a kill and **`r`** requests a restart; press the same key again within two seconds
403
403
  to confirm. Kill acts on a local running specialist, a coms-backed specialist, or a research helper.
404
404
  Confirmed restart terminates a running specialist when necessary, clears its session, and re-dispatches
405
- its previous task fresh; it is refused for peer/delegate rows, running research, and rows with no previous task.
405
+ its previous task fresh; it is refused for peer/delegate/research rows and rows with no previous task.
406
+ If a research detail view is already open when that helper finishes, it stays as a read-only terminal
407
+ snapshot until Esc; returning to the dashboard shows no completed research row.
406
408
  - **`q`** or **Esc** closes the dashboard.
407
409
 
408
410
  The detail view streams the selected local agent's assistant text, provider-emitted thinking, tool
@@ -426,7 +428,7 @@ unknown secret formats.
426
428
 
427
429
  “Thinking” means only text explicitly emitted by the provider/runtime; hidden model reasoning is not
428
430
  available, and personas with thinking disabled have no thinking rows. Model switching works for local
429
- specialists, retained research helpers, and nested delegate roles. It applies on the next dispatch or
431
+ specialists, a currently running research helper, and nested delegate roles. It applies on the next dispatch or
430
432
  continuation and never interrupts a running child. A coms-backed specialist stores the choice for native
431
433
  fallback runs; external coms peers control their own model, have no picker, and have no local transcript.
432
434
  **Esc**/**`q`** returns to the dashboard. **`/af-zoom <name|rN>`** opens this same detail view directly.
@@ -465,9 +467,9 @@ the single model line. Press **`Alt+S`** to start/stop dictation as in a normal
465
467
 
466
468
  ### Compact-view agent switcher
467
469
 
468
- With the **compact widget enabled**, the running-subagents list below the input doubles as a
470
+ With the **compact widget enabled**, the running-specialists list below the input doubles as a
469
471
  switcher. **`Alt+]`** and **`Alt+[`** move a marker (`›` + highlight) to the next/previous running
470
- subagent; **`Alt+\`** opens the full-screen detail view on the marked one (`q`/`Esc` to return).
472
+ specialist; **`Alt+\`** opens the full-screen detail view on the marked one (`q`/`Esc` to return).
471
473
  This only changes what you *view* — **the input box always prompts the main session**, and `main` is
472
474
  never a marker target (it is the session under the input, not a subagent). There is no transcript
473
475
  takeover: a subagent stream is shown in an overlay, never by replacing the main scrollback. These
@@ -522,16 +524,9 @@ task and follow their links instead of bulk-reading doc trees. The code-reviewer
522
524
  changes that alter documented behavior without a doc update; the documenter treats the entry
523
525
  points and the trees they link as the documentation it maintains.
524
526
 
525
- The same section also tunes research-helper retention:
526
-
527
- ```markdown
528
- ## agent-hub
529
- research-keep: 8
530
- ```
531
-
532
- `research-keep:` caps how many **finished** durable/persona research helpers remain available
533
- for dashboard inspection or fresh restart (LRU by finish time, default 4; `all` disables the cap).
534
- Auto-research pipe helpers are always pruned as soon as they finish, regardless of this key.
527
+ `research-keep:` is **removed**. An existing key warns at session start and has no effect; delete it.
528
+ Live research helpers disappear from the Fleet Dashboard when they finish. Session/transcript/findings
529
+ files and `/af-agents-history` records remain.
535
530
 
536
531
  ### Bounded local-disk searches
537
532
 
@@ -3,7 +3,7 @@ import type { CommandContext } from "./context.ts";
3
3
 
4
4
  export function registerAgentsRestart(pi: ExtensionAPI, commandCtx: CommandContext): void {
5
5
  pi.registerCommand("af-agents-restart", {
6
- description: "Kill and re-run a specialist's (or re-run a finished research helper's) last task fresh: /af-agents-restart <name|rN>",
6
+ description: "Kill and re-run a specialist's last task fresh: /af-agents-restart <name>",
7
7
  getArgumentCompletions: commandCtx.getSubagentTargetCompletions,
8
8
  handler: async (args, ctx) => commandCtx.handleAgentsRestart(args, ctx),
9
9
  });
@@ -3,8 +3,6 @@ import { join } from "node:path";
3
3
  import { clampDelegateDepth, MAX_DELEGATE_DEPTH } from "../helpers.ts";
4
4
  import { DEFAULT_RUN_HISTORY_KEEP, normalizeRunHistoryKeep } from "../run-namespace.js";
5
5
  import { DEFAULT_WATCHDOG_SETTING, WATCHDOG_SETTINGS, normalizeWatchdogSetting } from "../drift-watchdog.js";
6
- import { DEFAULT_RESEARCH_KEEP } from "../research/runtime.ts";
7
- import { parseResearchKeep } from "../research-retention.js";
8
6
  import type { SubagentRole } from "../types.ts";
9
7
 
10
8
  export const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;
@@ -26,7 +24,6 @@ export interface AgentTeamOverrides {
26
24
  personaDelegateDepth: Record<string, number>;
27
25
  rulesDirs: string[];
28
26
  docsPaths: string[];
29
- researchKeep: number;
30
27
  reconSearchTimeoutMs: number | null;
31
28
  budgetOverrides: { maxDispatches?: number | null; maxResearch?: number | null; wallMs?: number | null; agentTurnMs?: number | null; recycleRuns?: number | null };
32
29
  watchdogSetting: string;
@@ -38,7 +35,7 @@ export interface AgentTeamOverrides {
38
35
 
39
36
  export const DEFAULT_OVERRIDES: AgentTeamOverrides = {
40
37
  language: "English", personaModels: {}, personaModelLists: {}, personaThinking: {}, personaSubagents: {}, personaDelegateDepth: {},
41
- rulesDirs: [], docsPaths: [], researchKeep: DEFAULT_RESEARCH_KEEP, reconSearchTimeoutMs: 120_000, budgetOverrides: {},
38
+ rulesDirs: [], docsPaths: [], reconSearchTimeoutMs: 120_000, budgetOverrides: {},
42
39
  watchdogSetting: DEFAULT_WATCHDOG_SETTING, watchdogJudgeModel: null, runHistoryKeep: DEFAULT_RUN_HISTORY_KEEP, pollPanel: null, warnings: [],
43
40
  };
44
41
 
@@ -90,9 +87,7 @@ export function parseAgentTeamOverrides(cwd: string): AgentTeamOverrides {
90
87
  else result.runHistoryKeep = keep;
91
88
  }
92
89
  if (key === "research-keep" && value) {
93
- const keep = parseResearchKeep(value);
94
- if (keep != null) result.researchKeep = keep;
95
- else result.warnings.push(`research-keep "${value}" is not a non-negative integer or "all" — using the default (${DEFAULT_RESEARCH_KEEP})`);
90
+ result.warnings.push("research-keep is removed; live research helpers disappear when they finish. Delete this key.");
96
91
  }
97
92
  if (key === "recon-search-timeout-s" && value) {
98
93
  if (value.toLowerCase() === "off") result.reconSearchTimeoutMs = null;
@@ -87,7 +87,7 @@ import { confirmationOutcome, capabilityConfirmationPack, capabilityConfirmation
87
87
  import { budgetContinuationInstruction, budgetContinuationKind, budgetContinuationOutcome, turnBudgetActiveMs, type BudgetContinuationKind } from "./budget-continuation.ts";
88
88
  import { observeAskUserResults } from "../ask-user-remote/index.ts";
89
89
  import { buildHubPeerSpawnPlan, launchHubPeerInPane } from "./peer-spawn-plan.ts";
90
- import { DEFAULT_RESEARCH_KEEP, RESEARCH_TOOLS, createResearchRuntime, parseResearchHandle } from "./research/runtime.ts";
90
+ import { RESEARCH_TOOLS, createResearchRuntime, parseResearchHandle } from "./research/runtime.ts";
91
91
  import { requireSafetyHarness, resolveSafetyHarness } from "./safety-routing.ts";
92
92
  import { createAccessApprovalRouter } from "./access-approval.ts";
93
93
  import { readdirSync, readFileSync, existsSync, mkdirSync, unlinkSync, writeFileSync, rmSync } from "fs";
@@ -201,16 +201,13 @@ export default function (pi: ExtensionAPI) {
201
201
  });
202
202
 
203
203
  const agentStates: Map<string, AgentState> = new Map();
204
- // Read-only research helpers (Phase 4), keyed by numeric id (handle `rN`). Lives
205
- // alongside the standing team but renders in its own widget row.
204
+ // Live-only research helpers, keyed by numeric id (handle `rN`). Visible in the
205
+ // Fleet Dashboard (Alt+A) while running; evicted from this map on every terminal
206
+ // outcome. Session/transcript/findings files and /af-agents-history survive.
206
207
  let researchStates: Map<number, ResearchState> = new Map();
207
208
  // Metadata only: prompt text is never retained by this ledger.
208
209
  let lastHubLedger: ContextBudgetComponent[] = [];
209
210
  let nextResearchId = 1;
210
- // Retention cap for finished durable (manual/persona) helpers — set from the
211
- // overrides file's `research-keep:` key at session start (default 4, Infinity
212
- // for "all"). Ephemeral auto-pipe helpers ignore the cap: pruned on finish.
213
- let researchKeep = DEFAULT_RESEARCH_KEEP;
214
211
 
215
212
  // ── Execution history (/af-agents-history) ──────────
216
213
  // The typed store owns entries and turn/ask_user bookkeeping; index.ts owns
@@ -245,8 +242,8 @@ export default function (pi: ExtensionAPI) {
245
242
  // idle/done agents are hidden so an idle session shows only the prompt + footer.
246
243
  let viewMode: "compact" | "off" = "compact";
247
244
  // Compact-view agent switcher: the key of the marked subagent (lowercase persona
248
- // name for team specialists, `rN` for research helpers — matching /af-zoom
249
- // resolution), or null when nothing is marked. main is never listed (it is the
245
+ // name for team specialists — matching /af-zoom resolution), or null when nothing
246
+ // is marked. Research helpers are Fleet-Dashboard-only. main is never listed (it is the
250
247
  // session under the input box). Alt+]/Alt+[ move it; Alt+\ zooms it.
251
248
  let markedAgent: string | null = null;
252
249
  let runningWidgetInstalled = false;
@@ -547,17 +544,15 @@ APIs, commands, structure), say so in your final response so the docs can be upd
547
544
  const gridUI = createGridUI({
548
545
  getWidgetContext: () => widgetCtx,
549
546
  getViewMode: () => viewMode,
550
- getGridCols: () => gridCols,
551
547
  getAgentStates: () => agentStates,
552
- getResearchStates: () => researchStates,
553
548
  getMarkedAgent: () => markedAgent,
554
549
  setMarkedAgent: value => { markedAgent = value; },
555
550
  isRunningWidgetInstalled: () => runningWidgetInstalled,
556
551
  markRunningWidgetInstalled: () => { runningWidgetInstalled = true; },
557
- displayName, resolvedThinking, shortModel, thinkingSuffix, modelWithThinking,
552
+ displayName, shortModel, modelWithThinking,
558
553
  contextWarnThreshold: CONTEXT_WARN_THRESHOLD,
559
554
  });
560
- const { updateWidget, updateResearchWidget, switchableAgents, clampMarker } = gridUI;
555
+ const { updateWidget, switchableAgents, clampMarker } = gridUI;
561
556
 
562
557
  // ── Delegation observability ─────────────────
563
558
  const dispatchObservability = createDispatchObservability({
@@ -678,8 +673,6 @@ APIs, commands, structure), say so in your final response so the docs can be upd
678
673
  setResearchStates: value => { researchStates = value; },
679
674
  getNextResearchId: () => nextResearchId,
680
675
  setNextResearchId: value => { nextResearchId = value; },
681
- getResearchKeep: () => researchKeep,
682
- setResearchKeep: value => { researchKeep = value; },
683
676
  hubState: hubStateCtx, budget: budgetCtx, artifacts: assertionsArtifactsCtx,
684
677
  executionHistory, providerSemaphore,
685
678
  getSafetyHarnessPath: () => safetyHarnessPath,
@@ -689,10 +682,7 @@ APIs, commands, structure), say so in your final response so the docs can be upd
689
682
  modelWindowLookup, guardrailEnv, notifyProviderQueue, spawnPiAgentWithModelFallback,
690
683
  nativeResearchSystemPrompt, requireSafetyHarness, shortModel, displayName,
691
684
  flushTimelineStore, appendTimelineText, appendTimelineEvent,
692
- createTranscriptStore: createFleetTranscriptStore, updateResearchWidget,
693
- sendResearchMessage: message => {
694
- pi.sendMessage(message, { deliverAs: "followUp", triggerTurn: true });
695
- },
685
+ createTranscriptStore: createFleetTranscriptStore,
696
686
  });
697
687
 
698
688
  // ── Embedded coms: shared registry, transport, and pool core ──
@@ -781,7 +771,7 @@ APIs, commands, structure), say so in your final response so the docs can be upd
781
771
  },
782
772
  budget: budgetCtx, artifacts: assertionsArtifactsCtx, research: researchRuntime,
783
773
  provisionalCapabilityRefusal, dispatchAgent, runReturnExtraction,
784
- extractNeedsResearch, extractAskUserQuestions, contextPressure: percent => percent >= CONTEXT_WARN_THRESHOLD, displayName, updateResearchWidget,
774
+ extractNeedsResearch, extractAskUserQuestions, contextPressure: percent => percent >= CONTEXT_WARN_THRESHOLD, displayName,
785
775
  },
786
776
  actions: {
787
777
  budget: budgetCtx, artifacts: assertionsArtifactsCtx, hubState: hubStateCtx,
@@ -815,7 +805,7 @@ APIs, commands, structure), say so in your final response so the docs can be upd
815
805
 
816
806
  const researchControls = createResearchControls({
817
807
  runtime: researchRuntime,
818
- refresh: updateResearchWidget,
808
+ refresh: () => {},
819
809
  getAgents: () => agentStates, displayName, modelWorkBlocked: modelWorkBlockedByRosterRecovery,
820
810
  cancelWait: (state, kind) => cancelLocalWaitOnly({ abort: state.comsAbort, monitorBridge, monitorKey: monitorKeyForAgent(state.def.name, state.runCount), event: { kind } }),
821
811
  cancelOwned: state => cancelLocalOwnedProcess({ process: state.proc, monitorBridge, monitorKey: monitorKeyForAgent(state.def.name, state.runCount), treeKill: killPiTree }),
@@ -1604,7 +1594,6 @@ APIs, commands, structure), say so in your final response so the docs can be upd
1604
1594
  loadAvailableModels: loadAvailableModelChoices,
1605
1595
  openDetail: openFleetDetail,
1606
1596
  modelWorkBlocked: modelWorkBlockedByRosterRecovery,
1607
- restartResearch: researchControls.restart,
1608
1597
  restartSpecialist: researchControls.restartSpecialist,
1609
1598
  removeResearch: researchControls.remove,
1610
1599
  killSpecialistProcess: state => cancelLocalOwnedProcess({ process: state.proc, monitorBridge, monitorKey: monitorKeyForAgent(state.def.name, state.runCount), treeKill: killPiTree }),
@@ -1663,7 +1652,7 @@ APIs, commands, structure), say so in your final response so the docs can be upd
1663
1652
  workModeStatusText, openWorkModePicker,
1664
1653
  isCompact: () => compactWidgetsEnabled(viewMode),
1665
1654
  toggleCompact: () => { viewMode = viewMode === "compact" ? "off" : "compact"; return viewMode; },
1666
- refreshWidgets: () => { updateWidget(); updateResearchWidget(); },
1655
+ refreshWidgets: () => { updateWidget(); },
1667
1656
  getSwitchableKeys: () => switchableAgents().map(agent => agent.key),
1668
1657
  getMarkedAgent: () => markedAgent, setMarkedAgent: key => { markedAgent = key; }, clampMarker,
1669
1658
  openMarkedAgent: async (ctx, key) => {
@@ -1826,7 +1815,7 @@ APIs, commands, structure), say so in your final response so the docs can be upd
1826
1815
  terminateResearch: () => { for (const st of researchStates.values()) if (st.proc && st.status === "running") { st.killedByOperator = true; st.proc.kill("SIGTERM"); } },
1827
1816
  resetResearch: researchRuntime.reset, resetHistory: executionHistory.reset,
1828
1817
  resetBudgets: () => { taskClock = createTaskClock(); turnBudgetAskUserWaitMs = 0; turnContinuationCount = 0; taskContinuationCount = 0; pendingBudgetContinuation = null; budgetContinuationAsks.clear(); },
1829
- clearWidgets: ctx => { if (widgetCtx) { ctx.ui.setWidget("agent-team", undefined); ctx.ui.setWidget("agent-research", undefined); } },
1818
+ clearWidgets: ctx => { if (widgetCtx) { ctx.ui.setWidget("agent-team", undefined); } },
1830
1819
  closeDelegationWatchers: () => { for (const st of agentStates.values()) { st.delegationsWatcher?.close(); st.delegationsWatcher = undefined; } },
1831
1820
  resetSessionState: ctx => { delegatedTokens = 0; hubSpawnedPeers.clear(); widgetCtx = ctx; contextWindow = ctx.model?.contextWindow || 0; },
1832
1821
  resolveSafety: cwd => Boolean(safetyHarnessPath = resolveSafetyHarness(cwd)), resolveDelegate: cwd => { delegateExtPath = resolveDelegateExtension(cwd); },
@@ -1900,7 +1889,7 @@ APIs, commands, structure), say so in your final response so the docs can be upd
1900
1889
  applyOverrides: (_ctx) => {
1901
1890
  if (!sessionOverrides) throw new Error("session_start applyOverrides ran before loadAgents");
1902
1891
  applySessionOverrides(_ctx, sessionOverrides, {
1903
- setLanguage: value => { userLanguage = value; }, setResearchRetention: researchRuntime.setRetention,
1892
+ setLanguage: value => { userLanguage = value; },
1904
1893
  setReconTimeout: value => { reconSearchTimeoutMs = value; }, setBudgetOverrides: value => { budgetOverrides = value; },
1905
1894
  setWatchdog: (setting, judge) => { watchdogSetting = setting; watchdogJudgeModel = judge; },
1906
1895
  resetTurnCounts: () => { turnDispatchCount = 0; turnResearchCount = 0; }, resetTaskWindow: () => resetTaskWindow(null), updateModeStatus,
@@ -45,7 +45,7 @@ export function createCompletionPresentation<TDef extends CompletionDef>(deps: C
45
45
  const research = () => Array.from(deps.getResearch());
46
46
  const agentNames = (prefix: string) => filter(agents().map(state => ({ value: state.def.name, label: `${deps.displayName(state.def.name)} (${state.status})` })), prefix);
47
47
  const researchHandles = (prefix: string) => filter(research().map(state => ({ value: `r${state.id}`, label: `r${state.id} ${state.persona ? deps.displayName(state.def.name) : "research"} (${state.status})` })), prefix);
48
- const subagentTargets = (prefix: string) => filter([...(agentNames("") ?? []), ...(researchHandles("") ?? [])], prefix);
48
+ const subagentTargets = agentNames;
49
49
  return {
50
50
  agentNames,
51
51
  zoom: prefix => filter([
@@ -70,7 +70,7 @@ export function createCompletionPresentation<TDef extends CompletionDef>(deps: C
70
70
  substitutions: prefix => filter(deps.getSubstitutionSources().map(choice => ({ value: choice.spec, label: choice.label })), prefix),
71
71
  researchHandles,
72
72
  subagentTargets,
73
- agentsKill: prefix => filter(research().length > 0 ? [...(subagentTargets("") ?? []), { value: "all", label: "all — kill & remove every research helper" }] : subagentTargets("") ?? [], prefix),
73
+ agentsKill: prefix => filter(research().length > 0 ? [...(agentNames("") ?? []), ...(researchHandles("") ?? []), { value: "all", label: "all — kill & remove every live research helper" }] : agentNames("") ?? [], prefix),
74
74
  comsPeers: prefix => filter(deps.getPeers().map(peer => ({ value: peer.name, label: `${peer.name} — ${peer.purpose || peer.model}` })), prefix),
75
75
  };
76
76
  }
@@ -42,7 +42,6 @@ export function resetHubSession(ctx: ExtensionContext, ports: SessionResetPorts)
42
42
 
43
43
  export interface SessionOverridePorts<TDef extends AgentDef> {
44
44
  setLanguage(value: string): void;
45
- setResearchRetention(value: number): void;
46
45
  setReconTimeout(value: number | null): void;
47
46
  setBudgetOverrides(value: AgentTeamOverrides["budgetOverrides"]): void;
48
47
  setWatchdog(setting: string, judgeModel: string | null): void;
@@ -62,7 +61,6 @@ export interface SessionOverridePorts<TDef extends AgentDef> {
62
61
 
63
62
  export function applySessionOverrides<TDef extends AgentDef>(ctx: ExtensionContext, overrides: AgentTeamOverrides, ports: SessionOverridePorts<TDef>): void {
64
63
  ports.setLanguage(overrides.language);
65
- ports.setResearchRetention(overrides.researchKeep);
66
64
  ports.setReconTimeout(overrides.reconSearchTimeoutMs);
67
65
  ports.setBudgetOverrides(overrides.budgetOverrides);
68
66
  ports.setWatchdog(overrides.watchdogSetting, overrides.watchdogJudgeModel);
@@ -3,5 +3,5 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "version": "2.0.2"
6
+ "version": "2.0.3"
7
7
  }
@@ -12,7 +12,7 @@ export const SESSION_START_COMMANDS = [
12
12
  "/af-agent-models-substitute [src tgt] Pick/save a session-wide source → target model substitution",
13
13
  "/af-dispatch-policy Show which members route to coms peers (dispatch-policy.yaml)",
14
14
  "/af-agents-kill <name|rN|all> Kill a frozen specialist or remove research helper(s)",
15
- "/af-agents-restart <name|rN> Kill + re-run its last task fresh",
15
+ "/af-agents-restart <name> Kill + re-run a specialist's last task fresh",
16
16
  "/af-zoom <name|rN|child> Scrollable view of an agent / research / delegate-child stream",
17
17
  "/af-coms [--all|--project N] Refresh the coms peer pool",
18
18
  "/af-handoff <peer> Hand the session off to a coms peer",
@@ -1,5 +1,4 @@
1
1
  import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
2
- import { unlinkSync } from "node:fs";
3
2
  import type { ResearchAgentDef, ResearchRuntime, ResearchState } from "./runtime.ts";
4
3
 
5
4
  export interface ResearchControlPorts<TDef extends ResearchAgentDef> {
@@ -15,14 +14,15 @@ export interface ResearchControlPorts<TDef extends ResearchAgentDef> {
15
14
  export interface ResearchControls<TDef extends ResearchAgentDef> {
16
15
  remove(state: ResearchState<TDef>, ctx: ExtensionContext): void;
17
16
  clear(ctx: ExtensionContext): void;
18
- restart(state: ResearchState<TDef>, ctx: ExtensionContext): void;
19
17
  restartSpecialist(state: any, ctx: ExtensionContext): Promise<void>;
20
18
  handleKill(args: string | undefined, ctx: ExtensionContext): Promise<void>;
21
19
  handleRestart(args: string | undefined, ctx: ExtensionContext): Promise<void>;
22
20
  }
23
21
 
24
22
  const researchId = (name: string | undefined) => { const match = name?.match(/^#?r?(\d+)$/i); return match ? parseInt(match[1], 10) : null; };
25
- const knownTargets = <TDef extends ResearchAgentDef>(ports: ResearchControlPorts<TDef>) => [
23
+ const specialistTargets = <TDef extends ResearchAgentDef>(ports: ResearchControlPorts<TDef>) =>
24
+ Array.from(ports.getAgents().values()).map(state => ports.displayName(state.def.name)).join(", ");
25
+ const liveTargets = <TDef extends ResearchAgentDef>(ports: ResearchControlPorts<TDef>) => [
26
26
  ...Array.from(ports.getAgents().values()).map(state => ports.displayName(state.def.name)),
27
27
  ...Array.from(ports.runtime.states().values()).map(state => `r${state.id}`),
28
28
  ].join(", ");
@@ -31,18 +31,20 @@ export function createResearchControls<TDef extends ResearchAgentDef>(ports: Res
31
31
  const remove = (state: ResearchState<TDef>, ctx: ExtensionContext) => {
32
32
  if (state.proc && state.status === "running") { state.killedByOperator = true; state.proc.kill("SIGTERM"); ctx.ui.notify(`Research r${state.id} killed and removed.`, "warning"); }
33
33
  else ctx.ui.notify(`Research r${state.id} removed.`, "info");
34
- try { unlinkSync(ports.runtime.sessionPath(state.id)); } catch {}
35
- ports.runtime.states().delete(state.id); ports.refresh();
34
+ ports.runtime.finalize(state, { status: "idle", historyStatus: "idle", lastWork: "(killed by operator)" });
35
+ ports.refresh();
36
36
  };
37
37
  const controls: ResearchControls<TDef> = {
38
38
  remove,
39
39
  clear(ctx) {
40
- let killed = 0; const states = ports.runtime.states(); const total = states.size;
41
- for (const state of Array.from(states.values())) { if (state.proc && state.status === "running") { state.killedByOperator = true; state.proc.kill("SIGTERM"); killed++; } try { unlinkSync(ports.runtime.sessionPath(state.id)); } catch {} }
42
- ports.runtime.reset(); ports.refresh();
40
+ let killed = 0; const live = Array.from(ports.runtime.states().values()); const total = live.length;
41
+ for (const state of live) {
42
+ if (state.proc && state.status === "running") { state.killedByOperator = true; state.proc.kill("SIGTERM"); killed++; }
43
+ ports.runtime.finalize(state, { status: "idle", historyStatus: "idle", lastWork: "(killed by operator)" });
44
+ }
45
+ ports.refresh();
43
46
  ctx.ui.notify(total === 0 ? "No research helpers to clear." : `Cleared ${total} research helper${total !== 1 ? "s" : ""}${killed > 0 ? ` (${killed} killed)` : ""}.`, total === 0 ? "info" : "success");
44
47
  },
45
- restart(state, ctx) { state.sessionFile = null; state.turnCount = 1; ports.refresh(); ports.runtime.spawn(state, state.task, ctx).then(result => ports.runtime.deliverFollowUp(state, result)); },
46
48
  restartSpecialist: ports.restartSpecialist,
47
49
  async handleKill(args, ctx) {
48
50
  const name = args?.trim();
@@ -50,7 +52,7 @@ export function createResearchControls<TDef extends ResearchAgentDef>(ports: Res
50
52
  const id = researchId(name);
51
53
  if (id != null) { const research = ports.runtime.states().get(id); if (!research) ctx.ui.notify(`No research helper "${name}". Known: ${Array.from(ports.runtime.states().values()).map(item => `r${item.id}`).join(", ") || "none"}`, "error"); else controls.remove(research, ctx); return; }
52
54
  const state = name ? ports.getAgents().get(name.toLowerCase()) : undefined;
53
- if (!state) { ctx.ui.notify(`Usage: /af-agents-kill <name|rN|all>. Known: ${knownTargets(ports) || "none"}`, "error"); return; }
55
+ if (!state) { ctx.ui.notify(`Usage: /af-agents-kill <name|rN|all>. Known: ${liveTargets(ports) || "none"}`, "error"); return; }
54
56
  if (state.status !== "running" || (!state.proc && !state.comsAbort)) { ctx.ui.notify(`${ports.displayName(state.def.name)} is not running — nothing to kill.`, "warning"); return; }
55
57
  if (!state.proc) { void ports.cancelWait(state, "wait_only_cancelled"); ctx.ui.notify(`Abandoning ${ports.displayName(state.def.name)}'s coms dispatch (the peer pane keeps running)...`, "info"); return; }
56
58
  state.killedByOperator = true; ports.cancelOwned(state); ctx.ui.notify(`Killing ${ports.displayName(state.def.name)}...`, "info");
@@ -59,14 +61,11 @@ export function createResearchControls<TDef extends ResearchAgentDef>(ports: Res
59
61
  if (ports.modelWorkBlocked(ctx)) return;
60
62
  const name = args?.trim(); const id = researchId(name);
61
63
  if (id != null) {
62
- const research = ports.runtime.states().get(id);
63
- if (!research) { ctx.ui.notify(`No research helper "${name}". Known: ${Array.from(ports.runtime.states().values()).map(item => `r${item.id}`).join(", ") || "none"}`, "error"); return; }
64
- if (research.status === "running") { ctx.ui.notify(`Research r${research.id} is still running — wait for it to finish, or use /af-agents-kill r${research.id} to discard it; a new research request will spawn a fresh helper.`, "warning"); return; }
65
- if (!research.task) { ctx.ui.notify(`Research r${research.id} has no previous task to restart.`, "warning"); return; }
66
- ctx.ui.notify(`Restarting research r${research.id} (fresh)...`, "info"); controls.restart(research, ctx); return;
64
+ ctx.ui.notify(`Research helpers cannot be restarted — spawn a new helper instead.`, "warning");
65
+ return;
67
66
  }
68
67
  const state = name ? ports.getAgents().get(name.toLowerCase()) : undefined;
69
- if (!state) { ctx.ui.notify(`Usage: /af-agents-restart <name|rN>. Known: ${knownTargets(ports) || "none"}`, "error"); return; }
68
+ if (!state) { ctx.ui.notify(`Usage: /af-agents-restart <name>. Known: ${specialistTargets(ports) || "none"}`, "error"); return; }
70
69
  if (!state.task) { ctx.ui.notify(`${ports.displayName(state.def.name)} has no previous task to restart.`, "warning"); return; }
71
70
  ctx.ui.notify(`Restarting ${ports.displayName(state.def.name)} (fresh)...`, "info"); await ports.restartSpecialist(state, ctx);
72
71
  },
@@ -1,5 +1,4 @@
1
1
  import type { ChildProcess } from "child_process";
2
- import { unlinkSync } from "node:fs";
3
2
  import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
4
3
  import type { Termination, spawnPiAgentWithModelFallback } from "../spawn.ts";
5
4
  import type { TimelineEntry } from "../ui/zoom.ts";
@@ -9,7 +8,6 @@ import type { HubStateContext } from "../context/hub-state.ts";
9
8
  import type { BudgetContext } from "../context/budgets.ts";
10
9
  import type { InputArtifactPreview, AssertionsArtifactsContext } from "../context/assertions-artifacts.ts";
11
10
  import type { createProviderSemaphore } from "../provider-semaphore.js";
12
- import { DEFAULT_RESEARCH_KEEP, selectResearchPrunable } from "../research-retention.js";
13
11
  import { safePathWithin } from "../helpers.ts";
14
12
  import { runResearchSpawn, type ResearchSpawnPorts } from "./spawn-run.ts";
15
13
 
@@ -38,7 +36,6 @@ export interface ResearchState<TDef extends ResearchAgentDef = ResearchAgentDef>
38
36
  id: number;
39
37
  def: TDef;
40
38
  persona: boolean;
41
- ephemeral: boolean;
42
39
  model: string;
43
40
  status: "idle" | "running" | "done" | "error";
44
41
  task: string;
@@ -47,9 +44,6 @@ export interface ResearchState<TDef extends ResearchAgentDef = ResearchAgentDef>
47
44
  lastWork: string;
48
45
  contextPct: number;
49
46
  contextTokens: number;
50
- sessionFile: string | null;
51
- turnCount: number;
52
- finishedAt?: number;
53
47
  timer?: ReturnType<typeof setInterval>;
54
48
  proc?: ChildProcess;
55
49
  killedByOperator?: boolean;
@@ -66,13 +60,17 @@ export interface ResearchResult {
66
60
  termination?: Termination;
67
61
  }
68
62
 
63
+ export interface ResearchFinalizeOutcome {
64
+ status: "idle" | "done" | "error";
65
+ historyStatus: "idle" | "done" | "error";
66
+ lastWork: string;
67
+ }
68
+
69
69
  export interface ResearchRuntimeStatePorts<TDef extends ResearchAgentDef> {
70
70
  getResearchStates(): Map<number, ResearchState<TDef>>;
71
71
  setResearchStates(value: Map<number, ResearchState<TDef>>): void;
72
72
  getNextResearchId(): number;
73
73
  setNextResearchId(value: number): void;
74
- getResearchKeep(): number;
75
- setResearchKeep(value: number): void;
76
74
  }
77
75
 
78
76
  export interface ResearchRuntimeDeps<TDef extends ResearchAgentDef> extends ResearchRuntimeStatePorts<TDef> {
@@ -101,21 +99,17 @@ export interface ResearchRuntimeDeps<TDef extends ResearchAgentDef> extends Rese
101
99
  appendTimelineText(state: ResearchState<TDef>, kind: "text" | "thinking", content: string): void;
102
100
  appendTimelineEvent(state: ResearchState<TDef>, event: TimelineEntry): void;
103
101
  createTranscriptStore(path: string): FleetTranscriptStore;
104
- updateResearchWidget(): void;
105
- sendResearchMessage(message: { customType: string; content: string; display: true }): void;
106
102
  }
107
103
 
108
104
  export interface ResearchRuntime<TDef extends ResearchAgentDef = ResearchAgentDef> {
109
105
  states(): Map<number, ResearchState<TDef>>;
110
106
  reset(): void;
111
- setRetention(keep: number): void;
112
107
  sessionPath(id: number): string;
113
108
  anonymousDef(): TDef;
114
109
  resolveModel(def: TDef, explicit: string | undefined, ctx: ExtensionContext): string;
115
- createState(def: TDef, persona: boolean, model: string, ephemeral?: boolean): ResearchState<TDef>;
116
- prune(): void;
110
+ createState(def: TDef, persona: boolean, model: string): ResearchState<TDef>;
111
+ finalize(state: ResearchState<TDef>, outcome: ResearchFinalizeOutcome): void;
117
112
  spawn(state: ResearchState<TDef>, prompt: string, ctx: ExtensionContext, inputArtifacts?: InputArtifactPreview[], signal?: AbortSignal): Promise<ResearchResult>;
118
- deliverFollowUp(state: ResearchState<TDef>, result: ResearchResult): void;
119
113
  }
120
114
 
121
115
  export function parseResearchHandle(arg: string): number | null {
@@ -125,17 +119,26 @@ export function parseResearchHandle(arg: string): number | null {
125
119
 
126
120
  export function createResearchRuntime<TDef extends ResearchAgentDef>(deps: ResearchRuntimeDeps<TDef>): ResearchRuntime<TDef> {
127
121
  const sessionPath = (id: number) => safePathWithin(deps.hubState.getSessionDir(), `research-${id}.json`);
128
- const prune = () => {
129
- const states = deps.getResearchStates();
130
- const ids = selectResearchPrunable(Array.from(states.values()), deps.getResearchKeep());
131
- if (ids.length === 0) return;
132
- for (const id of ids) {
133
- try { unlinkSync(sessionPath(id)); } catch {}
134
- states.delete(id);
122
+ const finalized = new WeakSet<ResearchState<TDef>>();
123
+ const finalize = (state: ResearchState<TDef>, outcome: ResearchFinalizeOutcome) => {
124
+ if (finalized.has(state)) return;
125
+ finalized.add(state);
126
+ if (state.timer) {
127
+ clearInterval(state.timer);
128
+ state.timer = undefined;
135
129
  }
136
- deps.updateResearchWidget();
130
+ state.proc = undefined;
131
+ state.status = outcome.status;
132
+ state.lastWork = outcome.lastWork;
133
+ state.zoomRender?.(true);
134
+ if (state.histEntry) {
135
+ deps.executionHistory.end(state.histEntry, outcome.historyStatus);
136
+ state.histEntry = undefined;
137
+ }
138
+ const states = deps.getResearchStates();
139
+ if (states.get(state.id) === state) states.delete(state.id);
137
140
  };
138
- const spawnPorts: ResearchSpawnPorts<TDef> = { ...deps, researchTools: RESEARCH_TOOLS, sessionPath, prune };
141
+ const spawnPorts: ResearchSpawnPorts<TDef> = { ...deps, researchTools: RESEARCH_TOOLS, sessionPath, finalize };
139
142
 
140
143
  return {
141
144
  states: deps.getResearchStates,
@@ -143,7 +146,6 @@ export function createResearchRuntime<TDef extends ResearchAgentDef>(deps: Resea
143
146
  deps.setResearchStates(new Map());
144
147
  deps.setNextResearchId(1);
145
148
  },
146
- setRetention(keep) { deps.setResearchKeep(keep); },
147
149
  sessionPath,
148
150
  anonymousDef() {
149
151
  return {
@@ -155,30 +157,19 @@ export function createResearchRuntime<TDef extends ResearchAgentDef>(deps: Resea
155
157
  if (explicit) return explicit;
156
158
  return deps.resolvedModel(def) || (ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : "openrouter/google/gemini-3-flash-preview");
157
159
  },
158
- createState(def, persona, model, ephemeral = false) {
160
+ createState(def, persona, model) {
159
161
  const id = deps.getNextResearchId();
160
162
  deps.setNextResearchId(id + 1);
161
163
  const state: ResearchState<TDef> = {
162
- id, def, persona, ephemeral, model, status: "running", task: "", toolCount: 0,
163
- elapsed: 0, lastWork: "", contextPct: 0, contextTokens: 0, sessionFile: null,
164
- turnCount: 1, timeline: [],
164
+ id, def, persona, model, status: "running", task: "", toolCount: 0,
165
+ elapsed: 0, lastWork: "", contextPct: 0, contextTokens: 0, timeline: [],
165
166
  };
166
167
  deps.getResearchStates().set(id, state);
167
168
  return state;
168
169
  },
169
- prune,
170
+ finalize,
170
171
  spawn(state, prompt, ctx, inputArtifacts = [], signal) {
171
172
  return runResearchSpawn(spawnPorts, state, prompt, ctx, inputArtifacts, signal);
172
173
  },
173
- deliverFollowUp(state, result) {
174
- const truncated = result.output.length > 8000 ? `${result.output.slice(0, 8000)}\n\n... [truncated]` : result.output;
175
- const label = state.persona ? deps.displayName(state.def.name) : "research";
176
- deps.sendResearchMessage({
177
- customType: "research-result", display: true,
178
- content: `[research r${state.id} · ${label}${state.turnCount > 1 ? ` · Turn ${state.turnCount}` : ""}] ${result.exitCode === 0 ? "finished" : "failed"} in ${Math.round(result.elapsed / 1000)}s.\n\nFindings:\n${truncated}`,
179
- });
180
- },
181
174
  };
182
175
  }
183
-
184
- export { DEFAULT_RESEARCH_KEEP };