@wrongstack/cli 0.284.1 → 0.285.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (546) hide show
  1. package/README.md +4 -4
  2. package/dist/acp-registry-cache.d.ts +33 -0
  3. package/dist/acp-registry-cache.d.ts.map +1 -0
  4. package/dist/acp-server-agent.d.ts +66 -0
  5. package/dist/acp-server-agent.d.ts.map +1 -0
  6. package/dist/arg-parser.d.ts +41 -0
  7. package/dist/arg-parser.d.ts.map +1 -0
  8. package/dist/auth-menu/add-provider.d.ts +15 -0
  9. package/dist/auth-menu/add-provider.d.ts.map +1 -0
  10. package/dist/auth-menu/anthropic-oauth.d.ts +43 -0
  11. package/dist/auth-menu/anthropic-oauth.d.ts.map +1 -0
  12. package/dist/auth-menu/auth-menu-audit.d.ts +175 -0
  13. package/dist/auth-menu/auth-menu-audit.d.ts.map +1 -0
  14. package/dist/auth-menu/direct.d.ts +15 -0
  15. package/dist/auth-menu/direct.d.ts.map +1 -0
  16. package/dist/auth-menu/github-copilot-oauth.d.ts +73 -0
  17. package/dist/auth-menu/github-copilot-oauth.d.ts.map +1 -0
  18. package/dist/auth-menu/helpers.d.ts +7 -0
  19. package/dist/auth-menu/helpers.d.ts.map +1 -0
  20. package/dist/auth-menu/index.d.ts +8 -0
  21. package/dist/auth-menu/index.d.ts.map +1 -0
  22. package/dist/auth-menu/local-presets.d.ts +36 -0
  23. package/dist/auth-menu/local-presets.d.ts.map +1 -0
  24. package/dist/auth-menu/local.d.ts +138 -0
  25. package/dist/auth-menu/local.d.ts.map +1 -0
  26. package/dist/auth-menu/oauth-menu.d.ts +10 -0
  27. package/dist/auth-menu/oauth-menu.d.ts.map +1 -0
  28. package/dist/auth-menu/openai-codex-oauth.d.ts +167 -0
  29. package/dist/auth-menu/openai-codex-oauth.d.ts.map +1 -0
  30. package/dist/auth-menu/panel-service.d.ts +32 -0
  31. package/dist/auth-menu/panel-service.d.ts.map +1 -0
  32. package/dist/auth-menu/provider-menu.d.ts +7 -0
  33. package/dist/auth-menu/provider-menu.d.ts.map +1 -0
  34. package/dist/auth-menu/shared.d.ts +32 -0
  35. package/dist/auth-menu/shared.d.ts.map +1 -0
  36. package/dist/auth-menu/top-menu.d.ts +11 -0
  37. package/dist/auth-menu/top-menu.d.ts.map +1 -0
  38. package/dist/auth-menu/types.d.ts +42 -0
  39. package/dist/auth-menu/types.d.ts.map +1 -0
  40. package/dist/auth-menu.d.ts +7 -0
  41. package/dist/auth-menu.d.ts.map +1 -0
  42. package/dist/autophase-host.d.ts +103 -0
  43. package/dist/autophase-host.d.ts.map +1 -0
  44. package/dist/boot/auto-discover-providers.d.ts +20 -0
  45. package/dist/boot/auto-discover-providers.d.ts.map +1 -0
  46. package/dist/boot/brain-decision-log.d.ts +38 -0
  47. package/dist/boot/brain-decision-log.d.ts.map +1 -0
  48. package/dist/boot/container-wiring.d.ts +34 -0
  49. package/dist/boot/container-wiring.d.ts.map +1 -0
  50. package/dist/boot/dispatch-singleshot.d.ts +35 -0
  51. package/dist/boot/dispatch-singleshot.d.ts.map +1 -0
  52. package/dist/boot/dispatch-webui.d.ts +82 -0
  53. package/dist/boot/dispatch-webui.d.ts.map +1 -0
  54. package/dist/boot/event-wiring.d.ts +22 -0
  55. package/dist/boot/event-wiring.d.ts.map +1 -0
  56. package/dist/boot/short-circuit-desktop.d.ts +3 -0
  57. package/dist/boot/short-circuit-desktop.d.ts.map +1 -0
  58. package/dist/boot/short-circuit-flags.d.ts +9 -0
  59. package/dist/boot/short-circuit-flags.d.ts.map +1 -0
  60. package/dist/boot/short-circuit-hq.d.ts +16 -0
  61. package/dist/boot/short-circuit-hq.d.ts.map +1 -0
  62. package/dist/boot/system-prompt-builder.d.ts +91 -0
  63. package/dist/boot/system-prompt-builder.d.ts.map +1 -0
  64. package/dist/boot/system-prompt.d.ts +66 -0
  65. package/dist/boot/system-prompt.d.ts.map +1 -0
  66. package/dist/boot/tool-registry.d.ts +42 -0
  67. package/dist/boot/tool-registry.d.ts.map +1 -0
  68. package/dist/boot/tui-autophase-wiring.d.ts +23 -0
  69. package/dist/boot/tui-autophase-wiring.d.ts.map +1 -0
  70. package/dist/boot/tui-coordinator-setup.d.ts +38 -0
  71. package/dist/boot/tui-coordinator-setup.d.ts.map +1 -0
  72. package/dist/boot/tui-debug-stream.d.ts +18 -0
  73. package/dist/boot/tui-debug-stream.d.ts.map +1 -0
  74. package/dist/boot/tui-live-sessions.d.ts +39 -0
  75. package/dist/boot/tui-live-sessions.d.ts.map +1 -0
  76. package/dist/boot/tui-project-picker-callback.d.ts +30 -0
  77. package/dist/boot/tui-project-picker-callback.d.ts.map +1 -0
  78. package/dist/boot/tui-project-spawn.d.ts +19 -0
  79. package/dist/boot/tui-project-spawn.d.ts.map +1 -0
  80. package/dist/boot/tui-project-switch.d.ts +26 -0
  81. package/dist/boot/tui-project-switch.d.ts.map +1 -0
  82. package/dist/boot/tui-runtime-state.d.ts +83 -0
  83. package/dist/boot/tui-runtime-state.d.ts.map +1 -0
  84. package/dist/boot/tui-sdd-callback.d.ts +20 -0
  85. package/dist/boot/tui-sdd-callback.d.ts.map +1 -0
  86. package/dist/boot/tui-session-resume.d.ts +21 -0
  87. package/dist/boot/tui-session-resume.d.ts.map +1 -0
  88. package/dist/boot/tui-settings-adapter.d.ts +23 -0
  89. package/dist/boot/tui-settings-adapter.d.ts.map +1 -0
  90. package/dist/boot-config.d.ts +26 -0
  91. package/dist/boot-config.d.ts.map +1 -0
  92. package/dist/boot.d.ts +30 -0
  93. package/dist/boot.d.ts.map +1 -0
  94. package/dist/cli-bundled-prompts.d.ts +12 -0
  95. package/dist/cli-bundled-prompts.d.ts.map +1 -0
  96. package/dist/cli-bundled-skills.d.ts +13 -0
  97. package/dist/cli-bundled-skills.d.ts.map +1 -0
  98. package/dist/cli-context.d.ts +30 -0
  99. package/dist/cli-context.d.ts.map +1 -0
  100. package/dist/cli-entry-point.d.ts +2 -0
  101. package/dist/cli-entry-point.d.ts.map +1 -0
  102. package/dist/cli-eternal-flag.d.ts +66 -0
  103. package/dist/cli-eternal-flag.d.ts.map +1 -0
  104. package/dist/cli-main.d.ts +13 -0
  105. package/dist/cli-main.d.ts.map +1 -0
  106. package/dist/cli-recovery-prompt.d.ts +19 -0
  107. package/dist/cli-recovery-prompt.d.ts.map +1 -0
  108. package/dist/cli-update-notice.d.ts +3 -0
  109. package/dist/cli-update-notice.d.ts.map +1 -0
  110. package/dist/config-doctor.d.ts +39 -0
  111. package/dist/config-doctor.d.ts.map +1 -0
  112. package/dist/config-history.d.ts +54 -0
  113. package/dist/config-history.d.ts.map +1 -0
  114. package/dist/context-limit.d.ts +51 -0
  115. package/dist/context-limit.d.ts.map +1 -0
  116. package/dist/context-overflow-diagnostic.d.ts +3 -0
  117. package/dist/context-overflow-diagnostic.d.ts.map +1 -0
  118. package/dist/diff-renderer.d.ts +2 -0
  119. package/dist/diff-renderer.d.ts.map +1 -0
  120. package/dist/execute-deps.d.ts +239 -0
  121. package/dist/execute-deps.d.ts.map +1 -0
  122. package/dist/execution.d.ts +99 -0
  123. package/dist/execution.d.ts.map +1 -0
  124. package/dist/first-run-auth-gate.d.ts +18 -0
  125. package/dist/first-run-auth-gate.d.ts.map +1 -0
  126. package/dist/fleet/host.d.ts +533 -0
  127. package/dist/fleet/host.d.ts.map +1 -0
  128. package/dist/fleet/routing.d.ts +8 -0
  129. package/dist/fleet/routing.d.ts.map +1 -0
  130. package/dist/fleet/status-broadcast.d.ts +42 -0
  131. package/dist/fleet/status-broadcast.d.ts.map +1 -0
  132. package/dist/fleet/supervisor-registry.d.ts +16 -0
  133. package/dist/fleet/supervisor-registry.d.ts.map +1 -0
  134. package/dist/fleet-statusline.d.ts +71 -0
  135. package/dist/fleet-statusline.d.ts.map +1 -0
  136. package/dist/hooks-wiring.d.ts +26 -0
  137. package/dist/hooks-wiring.d.ts.map +1 -0
  138. package/dist/hq-command-controller.d.ts +52 -0
  139. package/dist/hq-command-controller.d.ts.map +1 -0
  140. package/dist/hq-dashboard-html.d.ts +2 -0
  141. package/dist/hq-dashboard-html.d.ts.map +1 -0
  142. package/dist/hq-publisher.d.ts +16 -0
  143. package/dist/hq-publisher.d.ts.map +1 -0
  144. package/dist/hq-server.d.ts +56 -0
  145. package/dist/hq-server.d.ts.map +1 -0
  146. package/dist/hq-static-serve.d.ts +26 -0
  147. package/dist/hq-static-serve.d.ts.map +1 -0
  148. package/dist/index.d.ts +3 -5
  149. package/dist/index.d.ts.map +1 -0
  150. package/dist/index.js +6025 -3952
  151. package/dist/index.js.map +7 -1
  152. package/dist/input-reader.d.ts +45 -0
  153. package/dist/input-reader.d.ts.map +1 -0
  154. package/dist/launch-hints.d.ts +46 -0
  155. package/dist/launch-hints.d.ts.map +1 -0
  156. package/dist/mailbox-bridge-bootstrap.d.ts +85 -0
  157. package/dist/mailbox-bridge-bootstrap.d.ts.map +1 -0
  158. package/dist/mcp-serve.d.ts +23 -0
  159. package/dist/mcp-serve.d.ts.map +1 -0
  160. package/dist/multi-agent.d.ts +4 -0
  161. package/dist/multi-agent.d.ts.map +1 -0
  162. package/dist/next-task-predictor.d.ts +45 -0
  163. package/dist/next-task-predictor.d.ts.map +1 -0
  164. package/dist/permission-prompt.d.ts +11 -0
  165. package/dist/permission-prompt.d.ts.map +1 -0
  166. package/dist/picker.d.ts +86 -0
  167. package/dist/picker.d.ts.map +1 -0
  168. package/dist/plugin-api-factory.d.ts +3 -0
  169. package/dist/plugin-api-factory.d.ts.map +1 -0
  170. package/dist/plugin-management.d.ts +43 -0
  171. package/dist/plugin-management.d.ts.map +1 -0
  172. package/dist/pre-launch/indexing-question.d.ts +28 -0
  173. package/dist/pre-launch/indexing-question.d.ts.map +1 -0
  174. package/dist/pre-launch/launch-prompts.d.ts +52 -0
  175. package/dist/pre-launch/launch-prompts.d.ts.map +1 -0
  176. package/dist/pre-launch/project-check.d.ts +25 -0
  177. package/dist/pre-launch/project-check.d.ts.map +1 -0
  178. package/dist/pre-launch.d.ts +4 -0
  179. package/dist/pre-launch.d.ts.map +1 -0
  180. package/dist/preflight.d.ts +58 -0
  181. package/dist/preflight.d.ts.map +1 -0
  182. package/dist/project-picker.d.ts +56 -0
  183. package/dist/project-picker.d.ts.map +1 -0
  184. package/dist/provider-config-utils.d.ts +58 -0
  185. package/dist/provider-config-utils.d.ts.map +1 -0
  186. package/dist/provider-helpers.d.ts +53 -0
  187. package/dist/provider-helpers.d.ts.map +1 -0
  188. package/dist/renderer.d.ts +76 -0
  189. package/dist/renderer.d.ts.map +1 -0
  190. package/dist/repl.d.ts +162 -0
  191. package/dist/repl.d.ts.map +1 -0
  192. package/dist/services/project-facts.d.ts +17 -0
  193. package/dist/services/project-facts.d.ts.map +1 -0
  194. package/dist/session-event-wiring.d.ts +48 -0
  195. package/dist/session-event-wiring.d.ts.map +1 -0
  196. package/dist/session-stats.d.ts +38 -0
  197. package/dist/session-stats.d.ts.map +1 -0
  198. package/dist/settings-menu.d.ts +87 -0
  199. package/dist/settings-menu.d.ts.map +1 -0
  200. package/dist/shutdown-cleanup.d.ts +44 -0
  201. package/dist/shutdown-cleanup.d.ts.map +1 -0
  202. package/dist/slash-commands/acp.d.ts +23 -0
  203. package/dist/slash-commands/acp.d.ts.map +1 -0
  204. package/dist/slash-commands/agents.d.ts +16 -0
  205. package/dist/slash-commands/agents.d.ts.map +1 -0
  206. package/dist/slash-commands/audit.d.ts +11 -0
  207. package/dist/slash-commands/audit.d.ts.map +1 -0
  208. package/dist/slash-commands/auth.d.ts +20 -0
  209. package/dist/slash-commands/auth.d.ts.map +1 -0
  210. package/dist/slash-commands/autonomy.d.ts +5 -0
  211. package/dist/slash-commands/autonomy.d.ts.map +1 -0
  212. package/dist/slash-commands/autophase.d.ts +13 -0
  213. package/dist/slash-commands/autophase.d.ts.map +1 -0
  214. package/dist/slash-commands/brain.d.ts +4 -0
  215. package/dist/slash-commands/brain.d.ts.map +1 -0
  216. package/dist/slash-commands/btw.d.ts +13 -0
  217. package/dist/slash-commands/btw.d.ts.map +1 -0
  218. package/dist/slash-commands/clear.d.ts +4 -0
  219. package/dist/slash-commands/clear.d.ts.map +1 -0
  220. package/dist/slash-commands/codebase-reindex.d.ts +11 -0
  221. package/dist/slash-commands/codebase-reindex.d.ts.map +1 -0
  222. package/dist/slash-commands/collab.d.ts +26 -0
  223. package/dist/slash-commands/collab.d.ts.map +1 -0
  224. package/dist/slash-commands/commit-llm.d.ts +41 -0
  225. package/dist/slash-commands/commit-llm.d.ts.map +1 -0
  226. package/dist/slash-commands/compact.d.ts +4 -0
  227. package/dist/slash-commands/compact.d.ts.map +1 -0
  228. package/dist/slash-commands/context.d.ts +4 -0
  229. package/dist/slash-commands/context.d.ts.map +1 -0
  230. package/dist/slash-commands/coordinator.d.ts +4 -0
  231. package/dist/slash-commands/coordinator.d.ts.map +1 -0
  232. package/dist/slash-commands/delegate.d.ts +17 -0
  233. package/dist/slash-commands/delegate.d.ts.map +1 -0
  234. package/dist/slash-commands/design.d.ts +16 -0
  235. package/dist/slash-commands/design.d.ts.map +1 -0
  236. package/dist/slash-commands/dev.d.ts +9 -0
  237. package/dist/slash-commands/dev.d.ts.map +1 -0
  238. package/dist/slash-commands/diag-stats.d.ts +5 -0
  239. package/dist/slash-commands/diag-stats.d.ts.map +1 -0
  240. package/dist/slash-commands/dispatch-llm.d.ts +12 -0
  241. package/dist/slash-commands/dispatch-llm.d.ts.map +1 -0
  242. package/dist/slash-commands/doctor.d.ts +13 -0
  243. package/dist/slash-commands/doctor.d.ts.map +1 -0
  244. package/dist/slash-commands/enhance.d.ts +13 -0
  245. package/dist/slash-commands/enhance.d.ts.map +1 -0
  246. package/dist/slash-commands/ensemble.d.ts +17 -0
  247. package/dist/slash-commands/ensemble.d.ts.map +1 -0
  248. package/dist/slash-commands/f-keys.d.ts +18 -0
  249. package/dist/slash-commands/f-keys.d.ts.map +1 -0
  250. package/dist/slash-commands/fallback.d.ts +20 -0
  251. package/dist/slash-commands/fallback.d.ts.map +1 -0
  252. package/dist/slash-commands/fix-classifier.d.ts +28 -0
  253. package/dist/slash-commands/fix-classifier.d.ts.map +1 -0
  254. package/dist/slash-commands/fix.d.ts +4 -0
  255. package/dist/slash-commands/fix.d.ts.map +1 -0
  256. package/dist/slash-commands/fleet.d.ts +20 -0
  257. package/dist/slash-commands/fleet.d.ts.map +1 -0
  258. package/dist/slash-commands/gitid.d.ts +22 -0
  259. package/dist/slash-commands/gitid.d.ts.map +1 -0
  260. package/dist/slash-commands/goal-refiner.d.ts +22 -0
  261. package/dist/slash-commands/goal-refiner.d.ts.map +1 -0
  262. package/dist/slash-commands/goal.d.ts +4 -0
  263. package/dist/slash-commands/goal.d.ts.map +1 -0
  264. package/dist/slash-commands/help.d.ts +4 -0
  265. package/dist/slash-commands/help.d.ts.map +1 -0
  266. package/dist/slash-commands/helpers.d.ts +33 -0
  267. package/dist/slash-commands/helpers.d.ts.map +1 -0
  268. package/dist/slash-commands/hq.d.ts +4 -0
  269. package/dist/slash-commands/hq.d.ts.map +1 -0
  270. package/dist/slash-commands/index.d.ts +524 -0
  271. package/dist/slash-commands/index.d.ts.map +1 -0
  272. package/dist/slash-commands/init.d.ts +4 -0
  273. package/dist/slash-commands/init.d.ts.map +1 -0
  274. package/dist/slash-commands/interrupt.d.ts +15 -0
  275. package/dist/slash-commands/interrupt.d.ts.map +1 -0
  276. package/dist/slash-commands/kanban.d.ts +4 -0
  277. package/dist/slash-commands/kanban.d.ts.map +1 -0
  278. package/dist/slash-commands/mailbox-demo.d.ts +19 -0
  279. package/dist/slash-commands/mailbox-demo.d.ts.map +1 -0
  280. package/dist/slash-commands/mailbox-serve.d.ts +20 -0
  281. package/dist/slash-commands/mailbox-serve.d.ts.map +1 -0
  282. package/dist/slash-commands/mailbox.d.ts +28 -0
  283. package/dist/slash-commands/mailbox.d.ts.map +1 -0
  284. package/dist/slash-commands/mcp-utils.d.ts +24 -0
  285. package/dist/slash-commands/mcp-utils.d.ts.map +1 -0
  286. package/dist/slash-commands/mcp.d.ts +19 -0
  287. package/dist/slash-commands/mcp.d.ts.map +1 -0
  288. package/dist/slash-commands/memory.d.ts +4 -0
  289. package/dist/slash-commands/memory.d.ts.map +1 -0
  290. package/dist/slash-commands/mode.d.ts +6 -0
  291. package/dist/slash-commands/mode.d.ts.map +1 -0
  292. package/dist/slash-commands/modelcaps.d.ts +4 -0
  293. package/dist/slash-commands/modelcaps.d.ts.map +1 -0
  294. package/dist/slash-commands/models.d.ts +23 -0
  295. package/dist/slash-commands/models.d.ts.map +1 -0
  296. package/dist/slash-commands/mouse.d.ts +14 -0
  297. package/dist/slash-commands/mouse.d.ts.map +1 -0
  298. package/dist/slash-commands/next.d.ts +21 -0
  299. package/dist/slash-commands/next.d.ts.map +1 -0
  300. package/dist/slash-commands/plugin.d.ts +4 -0
  301. package/dist/slash-commands/plugin.d.ts.map +1 -0
  302. package/dist/slash-commands/project-utils.d.ts +51 -0
  303. package/dist/slash-commands/project-utils.d.ts.map +1 -0
  304. package/dist/slash-commands/project.d.ts +4 -0
  305. package/dist/slash-commands/project.d.ts.map +1 -0
  306. package/dist/slash-commands/prune.d.ts +4 -0
  307. package/dist/slash-commands/prune.d.ts.map +1 -0
  308. package/dist/slash-commands/review.d.ts +4 -0
  309. package/dist/slash-commands/review.d.ts.map +1 -0
  310. package/dist/slash-commands/sdd/project-context.d.ts +7 -0
  311. package/dist/slash-commands/sdd/project-context.d.ts.map +1 -0
  312. package/dist/slash-commands/sdd/rendering.d.ts +2 -0
  313. package/dist/slash-commands/sdd/rendering.d.ts.map +1 -0
  314. package/dist/slash-commands/sdd/spec-detection.d.ts +21 -0
  315. package/dist/slash-commands/sdd/spec-detection.d.ts.map +1 -0
  316. package/dist/slash-commands/sdd/state.d.ts +40 -0
  317. package/dist/slash-commands/sdd/state.d.ts.map +1 -0
  318. package/dist/slash-commands/sdd/task-manager.d.ts +37 -0
  319. package/dist/slash-commands/sdd/task-manager.d.ts.map +1 -0
  320. package/dist/slash-commands/sdd.d.ts +15 -0
  321. package/dist/slash-commands/sdd.d.ts.map +1 -0
  322. package/dist/slash-commands/security.d.ts +4 -0
  323. package/dist/slash-commands/security.d.ts.map +1 -0
  324. package/dist/slash-commands/session.d.ts +7 -0
  325. package/dist/slash-commands/session.d.ts.map +1 -0
  326. package/dist/slash-commands/setmodel.d.ts +20 -0
  327. package/dist/slash-commands/setmodel.d.ts.map +1 -0
  328. package/dist/slash-commands/settings.d.ts +12 -0
  329. package/dist/slash-commands/settings.d.ts.map +1 -0
  330. package/dist/slash-commands/shadow.d.ts +28 -0
  331. package/dist/slash-commands/shadow.d.ts.map +1 -0
  332. package/dist/slash-commands/slash-deep-help.d.ts +51 -0
  333. package/dist/slash-commands/slash-deep-help.d.ts.map +1 -0
  334. package/dist/slash-commands/spawn-agents.d.ts +6 -0
  335. package/dist/slash-commands/spawn-agents.d.ts.map +1 -0
  336. package/dist/slash-commands/statusline.d.ts +67 -0
  337. package/dist/slash-commands/statusline.d.ts.map +1 -0
  338. package/dist/slash-commands/suggest.d.ts +4 -0
  339. package/dist/slash-commands/suggest.d.ts.map +1 -0
  340. package/dist/slash-commands/suggestion-store.d.ts +29 -0
  341. package/dist/slash-commands/suggestion-store.d.ts.map +1 -0
  342. package/dist/slash-commands/supervisor.d.ts +18 -0
  343. package/dist/slash-commands/supervisor.d.ts.map +1 -0
  344. package/dist/slash-commands/surfaces.d.ts +4 -0
  345. package/dist/slash-commands/surfaces.d.ts.map +1 -0
  346. package/dist/slash-commands/tasks.d.ts +4 -0
  347. package/dist/slash-commands/tasks.d.ts.map +1 -0
  348. package/dist/slash-commands/techstack.d.ts +4 -0
  349. package/dist/slash-commands/techstack.d.ts.map +1 -0
  350. package/dist/slash-commands/telegram-settings.d.ts +4 -0
  351. package/dist/slash-commands/telegram-settings.d.ts.map +1 -0
  352. package/dist/slash-commands/telegram-setup.d.ts +11 -0
  353. package/dist/slash-commands/telegram-setup.d.ts.map +1 -0
  354. package/dist/slash-commands/todos.d.ts +4 -0
  355. package/dist/slash-commands/todos.d.ts.map +1 -0
  356. package/dist/slash-commands/tool.d.ts +4 -0
  357. package/dist/slash-commands/tool.d.ts.map +1 -0
  358. package/dist/slash-commands/tools.d.ts +4 -0
  359. package/dist/slash-commands/tools.d.ts.map +1 -0
  360. package/dist/slash-commands/tuneup.d.ts +15 -0
  361. package/dist/slash-commands/tuneup.d.ts.map +1 -0
  362. package/dist/slash-commands/working-dir.d.ts +14 -0
  363. package/dist/slash-commands/working-dir.d.ts.map +1 -0
  364. package/dist/slash-commands/worktree.d.ts +8 -0
  365. package/dist/slash-commands/worktree.d.ts.map +1 -0
  366. package/dist/slash-commands/yolo.d.ts +4 -0
  367. package/dist/slash-commands/yolo.d.ts.map +1 -0
  368. package/dist/spinner.d.ts +44 -0
  369. package/dist/spinner.d.ts.map +1 -0
  370. package/dist/subcommands/handlers/acp.d.ts +15 -0
  371. package/dist/subcommands/handlers/acp.d.ts.map +1 -0
  372. package/dist/subcommands/handlers/audit.d.ts +12 -0
  373. package/dist/subcommands/handlers/audit.d.ts.map +1 -0
  374. package/dist/subcommands/handlers/auth-local-help.d.ts +69 -0
  375. package/dist/subcommands/handlers/auth-local-help.d.ts.map +1 -0
  376. package/dist/subcommands/handlers/auth.d.ts +3 -0
  377. package/dist/subcommands/handlers/auth.d.ts.map +1 -0
  378. package/dist/subcommands/handlers/bench-run-help.d.ts +145 -0
  379. package/dist/subcommands/handlers/bench-run-help.d.ts.map +1 -0
  380. package/dist/subcommands/handlers/bench.d.ts +13 -0
  381. package/dist/subcommands/handlers/bench.d.ts.map +1 -0
  382. package/dist/subcommands/handlers/config-history.d.ts +10 -0
  383. package/dist/subcommands/handlers/config-history.d.ts.map +1 -0
  384. package/dist/subcommands/handlers/diag-doctor.d.ts +4 -0
  385. package/dist/subcommands/handlers/diag-doctor.d.ts.map +1 -0
  386. package/dist/subcommands/handlers/export.d.ts +3 -0
  387. package/dist/subcommands/handlers/export.d.ts.map +1 -0
  388. package/dist/subcommands/handlers/helpers.d.ts +2 -0
  389. package/dist/subcommands/handlers/helpers.d.ts.map +1 -0
  390. package/dist/subcommands/handlers/hq.d.ts +3 -0
  391. package/dist/subcommands/handlers/hq.d.ts.map +1 -0
  392. package/dist/subcommands/handlers/init.d.ts +7 -0
  393. package/dist/subcommands/handlers/init.d.ts.map +1 -0
  394. package/dist/subcommands/handlers/mailbox-serve.d.ts +3 -0
  395. package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -0
  396. package/dist/subcommands/handlers/mcp.d.ts +3 -0
  397. package/dist/subcommands/handlers/mcp.d.ts.map +1 -0
  398. package/dist/subcommands/handlers/modeldiag.d.ts +3 -0
  399. package/dist/subcommands/handlers/modeldiag.d.ts.map +1 -0
  400. package/dist/subcommands/handlers/models-add-help.d.ts +142 -0
  401. package/dist/subcommands/handlers/models-add-help.d.ts.map +1 -0
  402. package/dist/subcommands/handlers/per-subcommand-help.d.ts +136 -0
  403. package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +1 -0
  404. package/dist/subcommands/handlers/plugin-usage.d.ts +4 -0
  405. package/dist/subcommands/handlers/plugin-usage.d.ts.map +1 -0
  406. package/dist/subcommands/handlers/projects.d.ts +3 -0
  407. package/dist/subcommands/handlers/projects.d.ts.map +1 -0
  408. package/dist/subcommands/handlers/providers-models.d.ts +4 -0
  409. package/dist/subcommands/handlers/providers-models.d.ts.map +1 -0
  410. package/dist/subcommands/handlers/quick.d.ts +14 -0
  411. package/dist/subcommands/handlers/quick.d.ts.map +1 -0
  412. package/dist/subcommands/handlers/replay.d.ts +12 -0
  413. package/dist/subcommands/handlers/replay.d.ts.map +1 -0
  414. package/dist/subcommands/handlers/rewind.d.ts +3 -0
  415. package/dist/subcommands/handlers/rewind.d.ts.map +1 -0
  416. package/dist/subcommands/handlers/sessions-config.d.ts +4 -0
  417. package/dist/subcommands/handlers/sessions-config.d.ts.map +1 -0
  418. package/dist/subcommands/handlers/sessions-fleet.d.ts +15 -0
  419. package/dist/subcommands/handlers/sessions-fleet.d.ts.map +1 -0
  420. package/dist/subcommands/handlers/tools-skills.d.ts +4 -0
  421. package/dist/subcommands/handlers/tools-skills.d.ts.map +1 -0
  422. package/dist/subcommands/handlers/update.d.ts +7 -0
  423. package/dist/subcommands/handlers/update.d.ts.map +1 -0
  424. package/dist/subcommands/handlers/version-help.d.ts +4 -0
  425. package/dist/subcommands/handlers/version-help.d.ts.map +1 -0
  426. package/dist/subcommands/index.d.ts +26 -0
  427. package/dist/subcommands/index.d.ts.map +1 -0
  428. package/dist/theme.d.ts +12 -0
  429. package/dist/theme.d.ts.map +1 -0
  430. package/dist/tui-thinking-word.d.ts +5 -0
  431. package/dist/tui-thinking-word.d.ts.map +1 -0
  432. package/dist/tuneup.d.ts +162 -0
  433. package/dist/tuneup.d.ts.map +1 -0
  434. package/dist/update-check.d.ts +22 -0
  435. package/dist/update-check.d.ts.map +1 -0
  436. package/dist/utils/delay-format.d.ts +5 -0
  437. package/dist/utils/delay-format.d.ts.map +1 -0
  438. package/dist/utils/win32-cmd.d.ts +7 -0
  439. package/dist/utils/win32-cmd.d.ts.map +1 -0
  440. package/dist/utils.d.ts +58 -0
  441. package/dist/utils.d.ts.map +1 -0
  442. package/dist/version.d.ts +4 -0
  443. package/dist/version.d.ts.map +1 -0
  444. package/dist/webui-server/client-registration.d.ts +41 -0
  445. package/dist/webui-server/client-registration.d.ts.map +1 -0
  446. package/dist/webui-server/connection-handler.d.ts +59 -0
  447. package/dist/webui-server/connection-handler.d.ts.map +1 -0
  448. package/dist/webui-server/context-breakdown.d.ts +57 -0
  449. package/dist/webui-server/context-breakdown.d.ts.map +1 -0
  450. package/dist/webui-server/cost-helpers.d.ts +29 -0
  451. package/dist/webui-server/cost-helpers.d.ts.map +1 -0
  452. package/dist/webui-server/lifecycle.d.ts +108 -0
  453. package/dist/webui-server/lifecycle.d.ts.map +1 -0
  454. package/dist/webui-server/logger-shim.d.ts +10 -0
  455. package/dist/webui-server/logger-shim.d.ts.map +1 -0
  456. package/dist/webui-server/message-router.d.ts +39 -0
  457. package/dist/webui-server/message-router.d.ts.map +1 -0
  458. package/dist/webui-server/prefs-seeding.d.ts +57 -0
  459. package/dist/webui-server/prefs-seeding.d.ts.map +1 -0
  460. package/dist/webui-server/provider-config.d.ts +61 -0
  461. package/dist/webui-server/provider-config.d.ts.map +1 -0
  462. package/dist/webui-server/session-start-payload.d.ts +20 -0
  463. package/dist/webui-server/session-start-payload.d.ts.map +1 -0
  464. package/dist/webui-server/session-status-poll.d.ts +14 -0
  465. package/dist/webui-server/session-status-poll.d.ts.map +1 -0
  466. package/dist/webui-server/setup-events.d.ts +45 -0
  467. package/dist/webui-server/setup-events.d.ts.map +1 -0
  468. package/dist/webui-server/static-serve.d.ts +70 -0
  469. package/dist/webui-server/static-serve.d.ts.map +1 -0
  470. package/dist/webui-server/stream-coalescer.d.ts +41 -0
  471. package/dist/webui-server/stream-coalescer.d.ts.map +1 -0
  472. package/dist/webui-server/ws-handlers/agent-config.d.ts +47 -0
  473. package/dist/webui-server/ws-handlers/agent-config.d.ts.map +1 -0
  474. package/dist/webui-server/ws-handlers/brain.d.ts +36 -0
  475. package/dist/webui-server/ws-handlers/brain.d.ts.map +1 -0
  476. package/dist/webui-server/ws-handlers/connection.d.ts +50 -0
  477. package/dist/webui-server/ws-handlers/connection.d.ts.map +1 -0
  478. package/dist/webui-server/ws-handlers/context.d.ts +55 -0
  479. package/dist/webui-server/ws-handlers/context.d.ts.map +1 -0
  480. package/dist/webui-server/ws-handlers/index.d.ts +60 -0
  481. package/dist/webui-server/ws-handlers/index.d.ts.map +1 -0
  482. package/dist/webui-server/ws-handlers/introspection.d.ts +35 -0
  483. package/dist/webui-server/ws-handlers/introspection.d.ts.map +1 -0
  484. package/dist/webui-server/ws-handlers/kanban.d.ts +41 -0
  485. package/dist/webui-server/ws-handlers/kanban.d.ts.map +1 -0
  486. package/dist/webui-server/ws-handlers/mailbox.d.ts +51 -0
  487. package/dist/webui-server/ws-handlers/mailbox.d.ts.map +1 -0
  488. package/dist/webui-server/ws-handlers/oauth.d.ts +16 -0
  489. package/dist/webui-server/ws-handlers/oauth.d.ts.map +1 -0
  490. package/dist/webui-server/ws-handlers/prefs.d.ts +32 -0
  491. package/dist/webui-server/ws-handlers/prefs.d.ts.map +1 -0
  492. package/dist/webui-server/ws-handlers/process.d.ts +6 -0
  493. package/dist/webui-server/ws-handlers/process.d.ts.map +1 -0
  494. package/dist/webui-server/ws-handlers/projects.d.ts +44 -0
  495. package/dist/webui-server/ws-handlers/projects.d.ts.map +1 -0
  496. package/dist/webui-server/ws-handlers/providers.d.ts +36 -0
  497. package/dist/webui-server/ws-handlers/providers.d.ts.map +1 -0
  498. package/dist/webui-server/ws-handlers/sessions.d.ts +38 -0
  499. package/dist/webui-server/ws-handlers/sessions.d.ts.map +1 -0
  500. package/dist/webui-server/ws-handlers/worklist.d.ts +49 -0
  501. package/dist/webui-server/ws-handlers/worklist.d.ts.map +1 -0
  502. package/dist/webui-server.d.ts +160 -0
  503. package/dist/webui-server.d.ts.map +1 -0
  504. package/dist/wiring/brain-and-orchestration.d.ts +63 -0
  505. package/dist/wiring/brain-and-orchestration.d.ts.map +1 -0
  506. package/dist/wiring/codebase-index.d.ts +33 -0
  507. package/dist/wiring/codebase-index.d.ts.map +1 -0
  508. package/dist/wiring/controllers.d.ts +46 -0
  509. package/dist/wiring/controllers.d.ts.map +1 -0
  510. package/dist/wiring/dep-watcher.d.ts +23 -0
  511. package/dist/wiring/dep-watcher.d.ts.map +1 -0
  512. package/dist/wiring/design-studio.d.ts +17 -0
  513. package/dist/wiring/design-studio.d.ts.map +1 -0
  514. package/dist/wiring/director-setup.d.ts +51 -0
  515. package/dist/wiring/director-setup.d.ts.map +1 -0
  516. package/dist/wiring/hq-telemetry.d.ts +42 -0
  517. package/dist/wiring/hq-telemetry.d.ts.map +1 -0
  518. package/dist/wiring/lifecycle-plugins.d.ts +58 -0
  519. package/dist/wiring/lifecycle-plugins.d.ts.map +1 -0
  520. package/dist/wiring/mailbox-bridge-bootstrap.d.ts +53 -0
  521. package/dist/wiring/mailbox-bridge-bootstrap.d.ts.map +1 -0
  522. package/dist/wiring/metrics.d.ts +21 -0
  523. package/dist/wiring/metrics.d.ts.map +1 -0
  524. package/dist/wiring/pipeline.d.ts +96 -0
  525. package/dist/wiring/pipeline.d.ts.map +1 -0
  526. package/dist/wiring/plugins.d.ts +108 -0
  527. package/dist/wiring/plugins.d.ts.map +1 -0
  528. package/dist/wiring/provider-runtime-setup.d.ts +47 -0
  529. package/dist/wiring/provider-runtime-setup.d.ts.map +1 -0
  530. package/dist/wiring/provider-runtime.d.ts +57 -0
  531. package/dist/wiring/provider-runtime.d.ts.map +1 -0
  532. package/dist/wiring/provider.d.ts +13 -0
  533. package/dist/wiring/provider.d.ts.map +1 -0
  534. package/dist/wiring/replay.d.ts +32 -0
  535. package/dist/wiring/replay.d.ts.map +1 -0
  536. package/dist/wiring/session.d.ts +56 -0
  537. package/dist/wiring/session.d.ts.map +1 -0
  538. package/dist/wiring/slash-commands.d.ts +74 -0
  539. package/dist/wiring/slash-commands.d.ts.map +1 -0
  540. package/dist/wiring/super-memory.d.ts +9 -0
  541. package/dist/wiring/super-memory.d.ts.map +1 -0
  542. package/dist/wiring/to-execute-deps.d.ts +11 -0
  543. package/dist/wiring/to-execute-deps.d.ts.map +1 -0
  544. package/dist/wiring/tools.d.ts +41 -0
  545. package/dist/wiring/tools.d.ts.map +1 -0
  546. package/package.json +20 -20
@@ -0,0 +1,533 @@
1
+ import type { BrainArbiter, SubagentRunner } from '@wrongstack/core';
2
+ import { type AgentFactory, type Config, type ConfigStore, type Container, Director, EventBus, type ModelsRegistry, type ProviderRegistry, type SessionWriter, type SystemPromptBuilder, type TaskResult, type TokenCounter, ToolRegistry } from '@wrongstack/core';
3
+ export interface MultiAgentDeps {
4
+ container: Container;
5
+ toolRegistry: ToolRegistry;
6
+ providerRegistry: ProviderRegistry;
7
+ configStore: ConfigStore;
8
+ /**
9
+ * Models catalog used to resolve a subagent provider's real context
10
+ * window. Without it, an `openai-compatible` subagent (DeepSeek, Groq,
11
+ * …) falls back to the 32k family default and the fleet panel reports
12
+ * the wrong window per subagent. Optional so callers/tests that don't
13
+ * wire it still build providers (the family default applies).
14
+ */
15
+ modelsRegistry?: ModelsRegistry | undefined;
16
+ events: EventBus;
17
+ systemPromptBuilder: SystemPromptBuilder;
18
+ session: SessionWriter;
19
+ tokenCounter: TokenCounter;
20
+ projectRoot: string;
21
+ cwd: string;
22
+ secretScrubber: import('@wrongstack/core').SecretScrubber;
23
+ renderer?: import('@wrongstack/core').Renderer | undefined;
24
+ }
25
+ /**
26
+ * Per-session options that flip the orchestration mode. Director mode
27
+ * routes lifecycle through a `Director`, which unlocks manifest writing
28
+ * and FleetBus observability. When Director mode is off, public subagent
29
+ * spawn/delegate surfaces stay disabled until an explicit `/director`
30
+ * promotion flips the flag.
31
+ */
32
+ export interface MultiAgentHostOptions {
33
+ /**
34
+ * Enable Director-backed orchestration. The host still exposes the same
35
+ * `spawn` / `status` / `usage` / `kill` API; under the hood, calls flow
36
+ * through a `Director` so manifest writing works and the FleetBus is
37
+ * available for future observability hooks.
38
+ */
39
+ directorMode?: boolean | undefined;
40
+ /**
41
+ * Absolute file path the director writes its fleet manifest to on
42
+ * shutdown (and on-demand via `manifest()`). Only meaningful when
43
+ * `directorMode` is true; ignored otherwise.
44
+ */
45
+ manifestPath?: string | undefined;
46
+ /**
47
+ * Absolute path to the fleet's shared scratchpad directory. When set,
48
+ * subagent system prompts are augmented with a "Shared notes" block
49
+ * pointing here so agents can pass conclusions through the filesystem
50
+ * without going through the bridge. Directory is created on first
51
+ * spawn. Only meaningful in director mode.
52
+ */
53
+ sharedScratchpadPath?: string | undefined;
54
+ /**
55
+ * Absolute path to the directory under which per-subagent JSONL
56
+ * transcripts land — typically
57
+ * `<projectSessions>/<date>/sess_<ULID>/subagents/`.
58
+ * When set, the host builds a `DirectorSessionFactory` rooted there and
59
+ * each spawned subagent gets its own session writer (instead of sharing
60
+ * the parent session). Director mode only.
61
+ */
62
+ sessionsRoot?: string | undefined;
63
+ /**
64
+ * Director run id for namespacing per-subagent JSONLs. Defaults to the
65
+ * coordinator id when omitted. Pass an explicit id when resuming from a
66
+ * prior fleet manifest.
67
+ */
68
+ directorRunId?: string | undefined;
69
+ /**
70
+ * Base directory for fleet artifacts (manifest, shared scratchpad,
71
+ * subagent sessions). When set and director mode is promoted at runtime
72
+ * (via /director), paths are derived as:
73
+ * <fleetRoot>/fleet.json (manifest)
74
+ * <fleetRoot>/shared/ (scratchpad)
75
+ * <fleetRoot>/subagents/ (per-subagent JSONL)
76
+ */
77
+ fleetRoot?: string | undefined;
78
+ /**
79
+ * Absolute path the director writes its live state checkpoint to. Distinct
80
+ * from `manifestPath` (final record) — the checkpoint mirrors pending /
81
+ * running / completed tasks on every mutation so `wstack resume` can show
82
+ * a "you had N tasks in flight" banner after a crash. Only meaningful in
83
+ * director mode.
84
+ */
85
+ stateCheckpointPath?: string | undefined;
86
+ /**
87
+ * Fleet-wide cost ceiling for the director. When set, the director
88
+ * refuses any new spawn that would push total fleet spend above this
89
+ * limit. In-flight subagents complete normally; only new spawns are
90
+ * blocked. Only meaningful in director mode.
91
+ */
92
+ directorBudget?: {
93
+ maxCostUsd?: number | undefined;
94
+ maxTokens?: number | undefined;
95
+ };
96
+ /** Lifetime spawn cap for this Director. CLI default: 64. */
97
+ maxSpawns?: number | undefined;
98
+ /**
99
+ * Maximum auto-extensions per subagent per budget kind before the
100
+ * director denies further extensions. Default: 2. Only meaningful in
101
+ * director mode.
102
+ */
103
+ maxBudgetExtensions?: number | undefined;
104
+ /** Optional global Brain arbiter for director-level policy decisions. */
105
+ brain?: BrainArbiter | undefined;
106
+ /**
107
+ * Maximum number of subagent tasks that may run concurrently. Extra
108
+ * tasks queue in the coordinator's pending list and dispatch as slots
109
+ * free. Default: 4. Raising this lets more work proceed in parallel
110
+ * at the cost of provider rate-limit pressure (each subagent makes
111
+ * its own API calls).
112
+ */
113
+ maxConcurrent?: number | undefined;
114
+ /**
115
+ * Maximum time a spawned/between-task subagent may remain idle before it is
116
+ * removed from the Director and every live registry surface. Default: 30s.
117
+ */
118
+ subagentIdleTimeoutMs?: number | undefined;
119
+ /** Retire a completed one-shot subagent immediately when it stays idle. */
120
+ retireSubagentOnTaskComplete?: boolean | undefined;
121
+ /**
122
+ * Live max context window for the leader model. Director spawn guards read
123
+ * this lazily so runtime provider/model switches do not leave the fleet
124
+ * using the launch-time family default.
125
+ */
126
+ getLeaderMaxContext?: (() => number) | undefined;
127
+ /**
128
+ * Debounce window for state-checkpoint writes in milliseconds.
129
+ * Default: 250. Only meaningful in director mode.
130
+ */
131
+ checkpointDebounceMs?: number | undefined;
132
+ /**
133
+ * Session writer the director forwards task lifecycle events to
134
+ * (agent_spawned, task_created, task_completed, task_failed). The CLI
135
+ * passes the same writer the host Agent uses so all events land in one
136
+ * JSONL. Optional — when omitted, those events stay in-memory.
137
+ */
138
+ sessionWriter?: import('@wrongstack/core').SessionWriter | undefined;
139
+ /**
140
+ * Root session trace ID for correlating subagent storage events with
141
+ * the parent session's trace in observability pipelines.
142
+ */
143
+ traceId?: string | undefined;
144
+ /**
145
+ * Optional AgentMonitorService for tracking subagent conversations.
146
+ * When set, the host calls trackSubagent on spawn and completeSubagent
147
+ * on completion, and starts the monitor's FleetBus listener.
148
+ */
149
+ agentMonitor?: import('@wrongstack/core/coordination').AgentMonitorService | undefined;
150
+ /**
151
+ * Called when the host auto-starts the Shadow Agent. The CLI uses this to
152
+ * keep /shadow duplicate checks in sync with the background auto-start path.
153
+ */
154
+ onShadowAgentStarted?: ((subagentId: string) => void) | undefined;
155
+ /**
156
+ * Called when the tracked Shadow Agent stops, so command surfaces do not keep
157
+ * treating a stale subagent id as active.
158
+ */
159
+ onShadowAgentStopped?: ((subagentId: string) => void) | undefined;
160
+ /**
161
+ * Resolved shared-mailbox project directory (`~/.wrongstack/projects/<slug>`)
162
+ * — the SAME directory the leader's mailbox checker attaches to (see
163
+ * `resolveProjectDir` + `wstackGlobalRoot`). Used for the fire-and-forget
164
+ * task-result report-back and the subagent online-agents block. When
165
+ * omitted, both fall back to `resolveProjectDir(deps.projectRoot, ...)`
166
+ * computed here.
167
+ */
168
+ mailboxProjectDir?: string | undefined;
169
+ /**
170
+ * Mailbox id of THIS session's leader, for task-result report-back.
171
+ * Defaults to `leader@<sessionTag(session.id)>` — the exact identity the
172
+ * CLI leader registers under (wiring/session.ts pins agentId: 'leader').
173
+ * Override for embedders whose leader uses a custom base id.
174
+ */
175
+ getLeaderMailboxId?: (() => string | undefined) | undefined;
176
+ }
177
+ /**
178
+ * Lazy holder — created on first /spawn call, reused across the session
179
+ * so /agents can list everyone running.
180
+ */
181
+ export declare class MultiAgentHost {
182
+ private readonly deps;
183
+ private director?;
184
+ /** Own FleetManager — created in buildDirector(), used for pending task
185
+ * tracking so status() can show descriptions without host-side state. */
186
+ private fleetManager?;
187
+ /** Own FleetEmitTool — created in buildDirector() so subagents in director
188
+ * mode can publish structured events (bug.found, refactor.plan,
189
+ * critic.evaluation) onto the fleet bus without needing the tool registered
190
+ * in the host's ToolRegistry. */
191
+ private fleetEmitTool?;
192
+ /** Director-owned tools available to scoped subagents even when the leader
193
+ * ToolRegistry was not populated because director mode was promoted lazily. */
194
+ private directorToolsByName;
195
+ /** Lazily built alongside the director — produces per-subagent JSONL
196
+ * writers under `<sessionsRoot>/<runId>/`. Null without sessionsRoot. */
197
+ private sessionFactory?;
198
+ private readonly opts;
199
+ /**
200
+ * Populated by `promoteToDirector` when it refuses to promote. The delegate
201
+ * tool reads this through `getPromotionBlockReason` to render an
202
+ * actionable error instead of a generic "Director could not be activated".
203
+ */
204
+ private promotionBlockReason;
205
+ /** Guards `buildDirector` from overwriting a runner set by `spawnACP`. */
206
+ private directorRunnerSet;
207
+ /** Event-bus off-handles registered in `buildDirector` — cleaned up in `dispose()`. */
208
+ private readonly directorOffHandles;
209
+ /** Coordinator task.assigned listener — cleaned up in `dispose()`. */
210
+ private coordinatorOffHandle;
211
+ /** ACP runner cache — keyed by role/subagentId, reused across tasks to avoid
212
+ * creating a new transport process on every ACP task dispatch. Stores the
213
+ * pending promise so concurrent calls for the same subagentId share one spawn.
214
+ * Bounded to 20 entries with LRU eviction to prevent unbounded memory growth. */
215
+ private readonly acpRunnerCache;
216
+ private readonly acpRunnerAccessOrder;
217
+ private static readonly ACP_CACHE_MAX;
218
+ /** Adaptive concurrency controller — created in buildDirector() when config has
219
+ * adaptiveConcurrency.enabled = true. Monitors FleetBus for 429 errors and
220
+ * automatically adjusts maxConcurrent to prevent rate limiting. */
221
+ private adaptiveConcurrencyController?;
222
+ /** Active Shadow Agent spawned by the host or /shadow start. */
223
+ private shadowAgentId;
224
+ /** Assigned monitoring task for the active Shadow Agent. */
225
+ private shadowTaskId;
226
+ /** All internal Shadow Agent startup/heartbeat task ids, excluded from fleet summaries. */
227
+ private readonly shadowTaskIds;
228
+ /** Shadow task ids assigned but not yet completed. Prevents heartbeat backlog. */
229
+ private readonly shadowOutstandingTaskIds;
230
+ /** Shadow task ids whose subagent should stop immediately after the one-shot pass. */
231
+ private readonly shadowStopAfterTaskIds;
232
+ private shadowHeartbeatIntervalMs;
233
+ /** Suppresses buildDirector() auto-start while /shadow start is explicitly spawning one. */
234
+ private shadowAutoStartSuppressions;
235
+ private shadowObservedWorkDepth;
236
+ private shadowPassInFlight;
237
+ private shadowQueuedProblem;
238
+ private readonly shadowActivityOffHandles;
239
+ /** Peer-awareness status broadcaster (mailbox `status` mails on subagent
240
+ * transitions + rich registry heartbeats). Started in buildDirector(),
241
+ * stopped in dispose(). */
242
+ private statusBroadcaster;
243
+ /** Brain-gated FleetSupervisor over this director's fleet. Built in
244
+ * buildDirector() (when a BrainArbiter is available), stopped in
245
+ * dispose(). Also published to the supervisor registry for /supervisor. */
246
+ private fleetSupervisor;
247
+ constructor(deps: MultiAgentDeps, opts?: MultiAgentHostOptions);
248
+ /**
249
+ * Force the lazy build path to run *now* and return the live Director,
250
+ * or null when director mode is off. Used by the CLI to register the
251
+ * fleet's LLM-callable orchestration tools (spawn_subagent,
252
+ * assign_task, await_tasks, ask_subagent, roll_up, terminate_subagent,
253
+ * fleet, fleet) into the leader's ToolRegistry before the
254
+ * agent starts — without this, the leader literally cannot see the
255
+ * orchestration tools and `--director` becomes a no-op.
256
+ */
257
+ ensureDirector(): Promise<Director | null>;
258
+ /** Access the Director's internal coordinator. Returns the concrete
259
+ * `DefaultMultiAgentCoordinator` so callers can use class-only surface
260
+ * (`on`, `setRunner`) that isn't part of the `MultiAgentCoordinator`
261
+ * interface. */
262
+ private getCoordinator;
263
+ /** Public accessor for the Director — used by buildRoutingRunner. */
264
+ getDirector(): Director | undefined;
265
+ private ensureCoordinator;
266
+ private buildDirector;
267
+ /**
268
+ * Arm host-owned Shadow observation. Healthy work windows stay fully
269
+ * deterministic; a one-shot LLM Shadow pass runs only after problematic work
270
+ * finishes, or when the user explicitly invokes /shadow start.
271
+ */
272
+ private armShadowAgentIfNeeded;
273
+ private recordShadowAgent;
274
+ private clearShadowAgent;
275
+ private markShadowTask;
276
+ private isActiveSubagent;
277
+ private noteShadowWorkStarted;
278
+ private noteShadowWorkCompleted;
279
+ private requestShadowPass;
280
+ private runShadowPass;
281
+ private stopShadowAfterTask;
282
+ /**
283
+ * Returns the FleetEmitTool for director-mode subagents, if the director
284
+ * has been built. Used by makeSubagentFactory to inject the tool into
285
+ * the filtered tool registry so collab session agents can emit fleet events.
286
+ */
287
+ getFleetEmitTool(): import('@wrongstack/core').Tool | undefined;
288
+ /**
289
+ * Build a per-role subagent factory: given a SubagentConfig, construct a
290
+ * fresh, isolated Agent with the role's filtered tools and (when the config
291
+ * carries one) the role's persona as an appended system-prompt block. Public
292
+ * so the autonomy-parallel engine can reuse the exact same agent-construction
293
+ * path the director/spawn flow uses — each parallel slot then runs as a real,
294
+ * specialized, concurrency-safe agent instead of sharing the leader's Context.
295
+ */
296
+ makeSubagentFactory(config: Config): AgentFactory;
297
+ /**
298
+ * Build the per-subagent runner.
299
+ *
300
+ * ACP agents (provider: 'acp') get their own runner via
301
+ * makeACPSubagentRunner — they run external processes and don't go
302
+ * through the Agent factory. Regular agents use the standard
303
+ * makeAgentSubagentRunner path.
304
+ */
305
+ buildSubagentRunner(config: Config): Promise<SubagentRunner>;
306
+ buildACPRunner(subagentId: string): Promise<SubagentRunner>;
307
+ /**
308
+ * Build a Provider for a subagent. When `overrideId` is supplied (from
309
+ * `SubagentConfig.provider`), looks that provider up in
310
+ * `config.providers` and constructs it with its own apiKey/baseUrl.
311
+ * Falls back to the leader's provider when `overrideId` is absent or
312
+ * not configured (so a typo doesn't crash the whole run — we just
313
+ * use the leader and the calling code can decide to error later).
314
+ */
315
+ private buildSubagentProvider;
316
+ private resolveSubagentReasoningConfig;
317
+ spawnACP(subagentId: string, task: string, config: Config): Promise<string>;
318
+ /** Returns a tool slice for the subagent — full set unless restricted. */
319
+ private filterTools;
320
+ /**
321
+ * Resolve the capability allowlist for a subagent's auto-approve policy.
322
+ *
323
+ * Precedence:
324
+ * 1. Explicit `subCfg.allowedCapabilities` — the spawn site knows best
325
+ * (e.g. `/techstack` grants exactly `fs.write` on top of the safe set).
326
+ * 2. A scoped `subCfg.tools` slice — the granted tool slice IS the intended
327
+ * capability grant. The leader/roster deliberately chose these tools, so
328
+ * allow exactly the capabilities they declare (plus the read-only safe
329
+ * floor). Without this, a role given the `write`/`build` tool presets
330
+ * could *see* those tools but the policy would deny execution (`fs.write`
331
+ * and `shell.*` are not in the read-only default), silently crippling
332
+ * every code-writing / build role in the catalog.
333
+ * 3. No tool restriction (full registry) → the WIDE working set
334
+ * (`WIDE_SUBAGENT_CAPABILITIES`: read, write, net, shell, install,
335
+ * session todo, tool metadata, read-only memory). The user authorized full
336
+ * developer work when they invoked the leader, so a delegated agent runs
337
+ * the same toolchain end-to-end. The genuinely blast-radius-escaping
338
+ * capabilities (fs.write.outside-project, tool.mutate.any, memory writes,
339
+ * mcp.proxy, subagent.spawn, config.mutate) stay off and need an explicit
340
+ * (1) grant.
341
+ */
342
+ private resolveSubagentCapabilities;
343
+ /** Resolved shared-mailbox project dir — same as the leader's checker. */
344
+ private mailboxProjectDir;
345
+ /**
346
+ * Construct + start the brain-gated FleetSupervisor over this director's
347
+ * fleet. Requires a BrainArbiter (production always wires one); without
348
+ * it there is no safe decision path, so supervision stays off. All
349
+ * actions flow through Director APIs — the supervisor never touches
350
+ * coordinator internals or budget negotiation.
351
+ */
352
+ private buildFleetSupervisor;
353
+ /**
354
+ * Fire-and-forget report-back (wired as the Director's
355
+ * `taskResultNotifier`): posts a non-awaited task's outcome to THIS
356
+ * session's leader via the project mailbox. The leader's mailbox checker
357
+ * injects it inline before the next step, so `assign_task`-without-await
358
+ * results reach the conversation without polling. The body carries a
359
+ * short excerpt only — the full result stays in the director's completed
360
+ * cache, retrievable via `await_tasks`/`roll_up`.
361
+ */
362
+ private reportTaskResultToLeader;
363
+ private subagentToolRegistry;
364
+ /**
365
+ * Spawn a fresh subagent and assign a single task. Returns task id.
366
+ *
367
+ * Optional `opts` lets the caller (a `/spawn` slash command or the
368
+ * future director surface) override the subagent's provider, model,
369
+ * and tool slice on a per-spawn basis. Without options, the legacy
370
+ * behavior holds: the subagent uses the leader's provider/model and
371
+ * the full tool registry.
372
+ */
373
+ spawn(description: string, opts?: {
374
+ provider?: string | undefined;
375
+ model?: string | undefined;
376
+ fallbackModels?: string[] | undefined;
377
+ tools?: string[] | undefined;
378
+ name?: string | undefined;
379
+ allowedCapabilities?: readonly string[] | undefined;
380
+ shadowIntervalMs?: number | undefined;
381
+ }): Promise<{
382
+ subagentId: string;
383
+ taskId: string;
384
+ }>;
385
+ /**
386
+ * Spawn a fresh subagent, assign a task, and **await** its completion.
387
+ *
388
+ * Unlike `spawn()`, which returns immediately with spawn metadata, this
389
+ * method blocks until the subagent finishes (success, failure, or timeout)
390
+ * and returns the full `TaskResult`. Use this when the caller needs the
391
+ * subagent's actual output — e.g. `/techstack` displaying the generated report
392
+ * in chat, or `/spawn` showing the result inline.
393
+ *
394
+ * Optional `opts` lets the caller override the subagent's provider, model,
395
+ * and tool slice per spawn.
396
+ */
397
+ spawnAndWait(description: string, opts?: {
398
+ provider?: string | undefined;
399
+ model?: string | undefined;
400
+ fallbackModels?: string[] | undefined;
401
+ tools?: string[] | undefined;
402
+ name?: string | undefined;
403
+ allowedCapabilities?: readonly string[] | undefined;
404
+ }): Promise<TaskResult>;
405
+ /**
406
+ * Common spawn + assign logic shared by both director mode and raw
407
+ * coordinator mode. Extracts the identical body from the two branches
408
+ * in `spawn()` so future changes (e.g. adding a new field to both
409
+ * paths) are made in one place.
410
+ *
411
+ * Returns `{ subagentId, taskId }`. Caller holds `pending` tracking
412
+ * and event emission — the helper only talks to the coordinator.
413
+ */
414
+ private _spawnAndAssign;
415
+ /**
416
+ * Relay a `task.completed` notification (from either the Director or
417
+ * the raw coordinator) to the EventBus so non-director TUIs and any
418
+ * other observer can react. We forward the full result shape rather
419
+ * than mutating the existing `task.completed` schema — coordination
420
+ * code already binds to that event, and adding subscribers there
421
+ * would change ordering semantics for those listeners.
422
+ */
423
+ private emitLifecycleCompleted;
424
+ status(): {
425
+ pending: {
426
+ taskId: string;
427
+ description: string;
428
+ subagentId: string;
429
+ }[];
430
+ completed: TaskResult[];
431
+ live: {
432
+ subagentId: string;
433
+ status: string;
434
+ task?: string | undefined;
435
+ }[];
436
+ summary: string;
437
+ };
438
+ /**
439
+ * Roll up per-subagent runtime cost from completed TaskResults. We don't
440
+ * yet have FleetUsageAggregator wired into the simple MultiAgentHost
441
+ * path (that lives on `Director`), so this aggregates iterations / tool
442
+ * calls / duration which we *do* have — enough to spot a thrashing
443
+ * worker without paying for a heavier orchestrator on every /spawn.
444
+ *
445
+ * Returns rows sorted by total duration descending (slowest first) so
446
+ * the table renders the most interesting subagent at the top.
447
+ */
448
+ usage(): {
449
+ rows: Array<{
450
+ subagentId: string;
451
+ tasks: number;
452
+ iterations: number;
453
+ toolCalls: number;
454
+ durationMs: number;
455
+ status: string;
456
+ }>;
457
+ totals: {
458
+ tasks: number;
459
+ iterations: number;
460
+ toolCalls: number;
461
+ durationMs: number;
462
+ };
463
+ };
464
+ /**
465
+ * Force the director to write its manifest to disk and return the path,
466
+ * or `null` when director mode is off (the simple coordinator path has
467
+ * no manifest). Callers should fall back to a friendly user message
468
+ * when `null` is returned — e.g. `/fleet manifest` does this already.
469
+ *
470
+ * The returned string is the absolute path of the manifest file. The
471
+ * file contents are JSON; readers can `JSON.parse(fs.readFileSync(...))`
472
+ * to consume.
473
+ */
474
+ manifest(): Promise<string | null>;
475
+ /**
476
+ * Promote a non-director session to director mode at runtime. Only
477
+ * succeeds when no subagents have been spawned yet — once a coordinator
478
+ * is running, the state cannot be migrated. Returns the live Director
479
+ * so the caller can register orchestration tools into the ToolRegistry.
480
+ *
481
+ * Idempotent: calling promoteToDirector on an already-promoted host
482
+ * returns the existing director without side effects.
483
+ */
484
+ promoteToDirector(): Promise<Director | null>;
485
+ /**
486
+ * True when this host is running in director mode. Surfaces the mode
487
+ * to slash commands and tests without exposing the underlying Director
488
+ * (which would let callers bypass the host's coordination layer).
489
+ */
490
+ isDirectorMode(): boolean;
491
+ /**
492
+ * Why the most recent `promoteToDirector` call returned null. Cleared
493
+ * implicitly on the next successful promotion. The delegate tool reads
494
+ * this so the LLM sees the actual blocker (e.g. "3 running subagents,
495
+ * wait or /fleet kill") instead of a generic "Director could not be
496
+ * activated" message that gives no path forward.
497
+ */
498
+ getPromotionBlockReason(): string | null;
499
+ /**
500
+ * Terminate a single subagent. Returns true when the subagent existed
501
+ * (regardless of whether stop() succeeded or it was already idle),
502
+ * false when no coordinator has been created yet — meaning the user
503
+ * called /fleet kill before any /spawn, and there's nothing to do.
504
+ */
505
+ kill(subagentId: string): Promise<boolean>;
506
+ stopAll(): Promise<void>;
507
+ /**
508
+ * Current effective concurrent-subagent ceiling. Reads the live
509
+ * coordinator config when the director is built; otherwise falls back
510
+ * to the constructor option (or the default of 4 that buildDirector
511
+ * will apply on first /spawn).
512
+ */
513
+ getMaxConcurrent(): number;
514
+ /**
515
+ * Change the concurrent-subagent ceiling at runtime. Updates the
516
+ * constructor option (so lazy-built director picks it up) and, if the
517
+ * coordinator already exists, mutates its live config + triggers a
518
+ * dispatch pass so newly-allowed slots fill immediately.
519
+ *
520
+ * Throws on non-positive values; the caller is expected to validate
521
+ * user input first.
522
+ */
523
+ setMaxConcurrent(n: number): void;
524
+ /**
525
+ * Clean up all listeners and resources held by the host.
526
+ * Unregisters all EventBus/FleetBus listeners registered in `buildDirector`
527
+ * and stops the Director and its coordinator.
528
+ *
529
+ * Safe to call multiple times — subsequent calls are no-ops.
530
+ */
531
+ dispose(): Promise<void>;
532
+ }
533
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/fleet/host.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAIL,KAAK,YAAY,EAGjB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,SAAS,EAOd,QAAQ,EAER,QAAQ,EAQR,KAAK,cAAc,EAOnB,KAAK,gBAAgB,EAKrB,KAAK,aAAa,EAElB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAGf,KAAK,YAAY,EAEjB,YAAY,EAOb,MAAM,kBAAkB,CAAC;AA+E1B,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,MAAM,EAAE,QAAQ,CAAC;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC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YACnB,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC,CAAC;QACH,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACtF,CAiDA;IAED;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAOvC;IAED;;;;;;;;OAQG;IACG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAoBlD;IAED;;;;OAIG;IACH,cAAc,IAAI,OAAO,CAExB;IAED;;;;;;OAMG;IACH,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAEvC;IAED;;;;;OAKG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAK/C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7B;IAED;;;;;OAKG;IACH,gBAAgB,IAAI,MAAM,CAKzB;IAED;;;;;;;;OAQG;IACH,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAahC;IAED;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAqC7B;CACF"}
@@ -0,0 +1,8 @@
1
+ import type { SubagentRunner } from '@wrongstack/core';
2
+ import { type Config } from '@wrongstack/core';
3
+ import type { MultiAgentHost } from './host.js';
4
+ /**
5
+ * Routing runner — dispatches tasks to standard or ACP runner based on provider.
6
+ */
7
+ export declare function buildRoutingRunner(config: Config, host: MultiAgentHost): SubagentRunner;
8
+ //# sourceMappingURL=routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/fleet/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,cAAc,EAAY,MAAM,kBAAkB,CAAC;AACrF,OAAO,EACL,KAAK,MAAM,EAKZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,cAAc,CAevF"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * status-broadcast — mailbox broadcasts on meaningful subagent transitions.
3
+ *
4
+ * The third leg of peer awareness (with the fleet-pulse digest and the
5
+ * fleet_status tool): when a fleet subagent joins, completes a task, or
6
+ * hits budget pressure, a low-priority `type:'status'` broadcast lands in
7
+ * the project mailbox so every OTHER agent — including agents in other
8
+ * processes on the same project — sees it on its next iteration.
9
+ *
10
+ * It also keeps the mailbox registry heartbeat rich: task start/stop
11
+ * transitions push `currentTask`/`status` into the registry, which is what
12
+ * makes the fleet-pulse digest and `fleet_status` show WHAT each fleet
13
+ * worker is doing cross-process (the plain interval heartbeat only proves
14
+ * liveness).
15
+ *
16
+ * Spam control:
17
+ * - per-subagent min interval (terminal statuses coalesce: the newest
18
+ * replaces the pending one rather than being dropped)
19
+ * - global per-minute cap (excess dropped + counted; the next allowed
20
+ * broadcast reports how many were dropped)
21
+ * - one-shot events (spawned, budget_warning per kind) dedup themselves
22
+ *
23
+ * @module fleet/status-broadcast
24
+ */
25
+ import type { EventBus, Mailbox } from '@wrongstack/core';
26
+ import type { FleetConfig } from '@wrongstack/core';
27
+ export interface FleetStatusBroadcasterOptions {
28
+ /** Host EventBus carrying the re-emitted `subagent.*` lifecycle events. */
29
+ events: EventBus;
30
+ /** Lazily construct the project mailbox (created once, on first use). */
31
+ mailboxFactory: () => Mailbox;
32
+ /** Session tag provider for the `fleet@<tag>` sender identity. */
33
+ sessionTag: () => string;
34
+ /** Nickname lookup for a subagent id (falls back to the raw id). */
35
+ subagentName?: ((subagentId: string) => string | undefined) | undefined;
36
+ config?: FleetConfig['statusBroadcasts'] | undefined;
37
+ }
38
+ export declare function createFleetStatusBroadcaster(opts: FleetStatusBroadcasterOptions): {
39
+ start(): void;
40
+ stop(): void;
41
+ };
42
+ //# sourceMappingURL=status-broadcast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-broadcast.d.ts","sourceRoot":"","sources":["../../src/fleet/status-broadcast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,6BAA6B;IAC5C,2EAA2E;IAC3E,MAAM,EAAE,QAAQ,CAAC;IACjB,yEAAyE;IACzE,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,kEAAkE;IAClE,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,oEAAoE;IACpE,YAAY,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACxE,MAAM,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;CACtD;AAYD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,6BAA6B,GAAG;IACjF,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CACd,CA0JA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * supervisor-registry — process-wide handle to the active FleetSupervisor.
3
+ *
4
+ * The supervisor is built lazily inside `MultiAgentHost.buildDirector()`
5
+ * (the Director itself is lazy), long after the slash commands were
6
+ * registered — so `/supervisor` cannot receive it by constructor
7
+ * injection. This module is the same indirection `getSddRun` uses for the
8
+ * live SDD run: the host sets the handle when the supervisor starts,
9
+ * clears it on dispose, and the slash command reads it at execution time.
10
+ *
11
+ * @module fleet/supervisor-registry
12
+ */
13
+ import type { FleetSupervisor } from '@wrongstack/core';
14
+ export declare function setActiveFleetSupervisor(supervisor: FleetSupervisor | null): void;
15
+ export declare function getActiveFleetSupervisor(): FleetSupervisor | null;
16
+ //# sourceMappingURL=supervisor-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor-registry.d.ts","sourceRoot":"","sources":["../../src/fleet/supervisor-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIxD,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI,CAEjF;AAED,wBAAgB,wBAAwB,IAAI,eAAe,GAAG,IAAI,CAEjE"}