@wrongstack/cli 0.295.1 → 0.296.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 (398) hide show
  1. package/data/providers.json +0 -24
  2. package/dist/acp-A5OSIU2P.js +824 -0
  3. package/dist/acp-A5OSIU2P.js.map +7 -0
  4. package/dist/acp-server-agent.d.ts.map +1 -1
  5. package/dist/arg-parser.d.ts.map +1 -1
  6. package/dist/audit-2ZSFGNIF.js +102 -0
  7. package/dist/audit-2ZSFGNIF.js.map +7 -0
  8. package/dist/auth-CJWQJVRH.js +504 -0
  9. package/dist/auth-CJWQJVRH.js.map +7 -0
  10. package/dist/auth-menu/auth-menu-audit.d.ts +0 -4
  11. package/dist/auth-menu/auth-menu-audit.d.ts.map +1 -1
  12. package/dist/bench-7ZDWSNEF.js +278 -0
  13. package/dist/bench-7ZDWSNEF.js.map +7 -0
  14. package/dist/boot/brain-decision-log.d.ts +7 -5
  15. package/dist/boot/brain-decision-log.d.ts.map +1 -1
  16. package/dist/boot/dispatch-webui.d.ts +5 -8
  17. package/dist/boot/dispatch-webui.d.ts.map +1 -1
  18. package/dist/boot/system-prompt-builder.d.ts +3 -0
  19. package/dist/boot/system-prompt-builder.d.ts.map +1 -1
  20. package/dist/boot/tui-coordinator-callbacks.d.ts +45 -0
  21. package/dist/boot/tui-coordinator-callbacks.d.ts.map +1 -0
  22. package/dist/boot/tui-project-switch.d.ts +2 -3
  23. package/dist/boot/tui-project-switch.d.ts.map +1 -1
  24. package/dist/boot/tui-runtime-state.d.ts +5 -6
  25. package/dist/boot/tui-runtime-state.d.ts.map +1 -1
  26. package/dist/boot/tui-session-resume.d.ts.map +1 -1
  27. package/dist/boot/tui-settings-adapter.d.ts +2 -3
  28. package/dist/boot/tui-settings-adapter.d.ts.map +1 -1
  29. package/dist/boot.d.ts.map +1 -1
  30. package/dist/brain-menu/panel-service.d.ts.map +1 -1
  31. package/dist/chimera-review-task.d.ts +6 -0
  32. package/dist/chimera-review-task.d.ts.map +1 -0
  33. package/dist/chimera-reviewer-policy.d.ts +34 -0
  34. package/dist/chimera-reviewer-policy.d.ts.map +1 -0
  35. package/dist/chronicle-QQEQFSSE.js +256 -0
  36. package/dist/chronicle-QQEQFSSE.js.map +7 -0
  37. package/dist/chunk-5N34EWJR.js +418 -0
  38. package/dist/chunk-5N34EWJR.js.map +7 -0
  39. package/dist/chunk-66T43Q4Y.js +90 -0
  40. package/dist/chunk-66T43Q4Y.js.map +7 -0
  41. package/dist/chunk-7OCVIDC7.js +11 -0
  42. package/dist/chunk-7OCVIDC7.js.map +7 -0
  43. package/dist/chunk-ABXK4VVY.js +84 -0
  44. package/dist/chunk-ABXK4VVY.js.map +7 -0
  45. package/dist/chunk-AXVZMEWG.js +306 -0
  46. package/dist/chunk-AXVZMEWG.js.map +7 -0
  47. package/dist/chunk-AZESNNIC.js +216 -0
  48. package/dist/chunk-AZESNNIC.js.map +7 -0
  49. package/dist/chunk-BGFM3PD7.js +41 -0
  50. package/dist/chunk-BGFM3PD7.js.map +7 -0
  51. package/dist/chunk-BQCAJ7FI.js +425 -0
  52. package/dist/chunk-BQCAJ7FI.js.map +7 -0
  53. package/dist/chunk-DPJZQCVP.js +13 -0
  54. package/dist/chunk-DPJZQCVP.js.map +7 -0
  55. package/dist/chunk-F4PEGAJZ.js +176 -0
  56. package/dist/chunk-F4PEGAJZ.js.map +7 -0
  57. package/dist/chunk-IHBYBYGA.js +443 -0
  58. package/dist/chunk-IHBYBYGA.js.map +7 -0
  59. package/dist/chunk-JBSQ7ONN.js +1023 -0
  60. package/dist/chunk-JBSQ7ONN.js.map +7 -0
  61. package/dist/chunk-JBTFWWKV.js +1325 -0
  62. package/dist/chunk-JBTFWWKV.js.map +7 -0
  63. package/dist/chunk-JUHRI6OV.js +100 -0
  64. package/dist/chunk-JUHRI6OV.js.map +7 -0
  65. package/dist/chunk-OI7GWJDS.js +3303 -0
  66. package/dist/chunk-OI7GWJDS.js.map +7 -0
  67. package/dist/chunk-OP47B3IX.js +142 -0
  68. package/dist/chunk-OP47B3IX.js.map +7 -0
  69. package/dist/chunk-PJHET45A.js +158 -0
  70. package/dist/chunk-PJHET45A.js.map +7 -0
  71. package/dist/chunk-Q5GTM25S.js +17 -0
  72. package/dist/chunk-Q5GTM25S.js.map +7 -0
  73. package/dist/chunk-QD544J2B.js +19 -0
  74. package/dist/chunk-QD544J2B.js.map +7 -0
  75. package/dist/chunk-QUNHS6O3.js +258 -0
  76. package/dist/chunk-QUNHS6O3.js.map +7 -0
  77. package/dist/chunk-TADVX644.js +480 -0
  78. package/dist/chunk-TADVX644.js.map +7 -0
  79. package/dist/chunk-TGDHN4LM.js +81 -0
  80. package/dist/chunk-TGDHN4LM.js.map +7 -0
  81. package/dist/chunk-TYO2OVAD.js +50 -0
  82. package/dist/chunk-TYO2OVAD.js.map +7 -0
  83. package/dist/chunk-VCYZ3WZV.js +14 -0
  84. package/dist/chunk-VCYZ3WZV.js.map +7 -0
  85. package/dist/chunk-VJUEZZYB.js +29 -0
  86. package/dist/chunk-VJUEZZYB.js.map +7 -0
  87. package/dist/chunk-WHOIR577.js +1 -0
  88. package/dist/chunk-WHOIR577.js.map +7 -0
  89. package/dist/chunk-WY7KKOUK.js +460 -0
  90. package/dist/chunk-WY7KKOUK.js.map +7 -0
  91. package/dist/chunk-XJXDOF63.js +28 -0
  92. package/dist/chunk-XJXDOF63.js.map +7 -0
  93. package/dist/chunk-XWEGWYDU.js +560 -0
  94. package/dist/chunk-XWEGWYDU.js.map +7 -0
  95. package/dist/chunk-YWUPHRGB.js +346 -0
  96. package/dist/chunk-YWUPHRGB.js.map +7 -0
  97. package/dist/chunk-Z7YGASQP.js +313 -0
  98. package/dist/chunk-Z7YGASQP.js.map +7 -0
  99. package/dist/cli-entry-main.d.ts +2 -0
  100. package/dist/cli-entry-main.d.ts.map +1 -0
  101. package/dist/cli-entry-point.d.ts +3 -3
  102. package/dist/cli-entry-point.d.ts.map +1 -1
  103. package/dist/cli-main-RTY35OPD.js +29268 -0
  104. package/dist/cli-main-RTY35OPD.js.map +7 -0
  105. package/dist/cli-main-helpers.d.ts +21 -0
  106. package/dist/cli-main-helpers.d.ts.map +1 -0
  107. package/dist/cli-main.d.ts +25 -1
  108. package/dist/cli-main.d.ts.map +1 -1
  109. package/dist/context-limit.d.ts +48 -0
  110. package/dist/context-limit.d.ts.map +1 -1
  111. package/dist/diag-doctor-OQ3AA63O.js +170 -0
  112. package/dist/diag-doctor-OQ3AA63O.js.map +7 -0
  113. package/dist/execute-deps.d.ts +11 -12
  114. package/dist/execute-deps.d.ts.map +1 -1
  115. package/dist/execution-O7I5DYE6.js +4682 -0
  116. package/dist/execution-O7I5DYE6.js.map +7 -0
  117. package/dist/execution-chimera-ask.d.ts +10 -0
  118. package/dist/execution-chimera-ask.d.ts.map +1 -0
  119. package/dist/execution-chimera-cascade.d.ts +15 -0
  120. package/dist/execution-chimera-cascade.d.ts.map +1 -0
  121. package/dist/execution-cleanup.d.ts +23 -0
  122. package/dist/execution-cleanup.d.ts.map +1 -0
  123. package/dist/execution-kanban-dispatch.d.ts +10 -0
  124. package/dist/execution-kanban-dispatch.d.ts.map +1 -0
  125. package/dist/execution-repl-fleet-callbacks.d.ts +11 -0
  126. package/dist/execution-repl-fleet-callbacks.d.ts.map +1 -0
  127. package/dist/execution-storage-observability.d.ts +3 -0
  128. package/dist/execution-storage-observability.d.ts.map +1 -0
  129. package/dist/execution-tui-next-step-callbacks.d.ts +20 -0
  130. package/dist/execution-tui-next-step-callbacks.d.ts.map +1 -0
  131. package/dist/execution.d.ts +2 -139
  132. package/dist/execution.d.ts.map +1 -1
  133. package/dist/export-TPORYVRZ.js +64 -0
  134. package/dist/export-TPORYVRZ.js.map +7 -0
  135. package/dist/fleet/host-acp-runner-cache.d.ts +9 -0
  136. package/dist/fleet/host-acp-runner-cache.d.ts.map +1 -0
  137. package/dist/fleet/host-acp.d.ts +3 -0
  138. package/dist/fleet/host-acp.d.ts.map +1 -0
  139. package/dist/fleet/host-concurrency.d.ts +2 -0
  140. package/dist/fleet/host-concurrency.d.ts.map +1 -0
  141. package/dist/fleet/host-context.d.ts +5 -0
  142. package/dist/fleet/host-context.d.ts.map +1 -0
  143. package/dist/fleet/host-director-builder.d.ts +24 -0
  144. package/dist/fleet/host-director-builder.d.ts.map +1 -0
  145. package/dist/fleet/host-director-event-bridges.d.ts +37 -0
  146. package/dist/fleet/host-director-event-bridges.d.ts.map +1 -0
  147. package/dist/fleet/host-director-services.d.ts +20 -0
  148. package/dist/fleet/host-director-services.d.ts.map +1 -0
  149. package/dist/fleet/host-event-bridge.d.ts +17 -0
  150. package/dist/fleet/host-event-bridge.d.ts.map +1 -0
  151. package/dist/fleet/host-helpers.d.ts +22 -0
  152. package/dist/fleet/host-helpers.d.ts.map +1 -0
  153. package/dist/fleet/host-learning-tracker.d.ts +11 -0
  154. package/dist/fleet/host-learning-tracker.d.ts.map +1 -0
  155. package/dist/fleet/host-learning.d.ts +4 -0
  156. package/dist/fleet/host-learning.d.ts.map +1 -0
  157. package/dist/fleet/host-lifecycle-events.d.ts +4 -0
  158. package/dist/fleet/host-lifecycle-events.d.ts.map +1 -0
  159. package/dist/fleet/host-paths.d.ts +3 -0
  160. package/dist/fleet/host-paths.d.ts.map +1 -0
  161. package/dist/fleet/host-provider.d.ts +22 -0
  162. package/dist/fleet/host-provider.d.ts.map +1 -0
  163. package/dist/fleet/host-session-writer.d.ts +3 -0
  164. package/dist/fleet/host-session-writer.d.ts.map +1 -0
  165. package/dist/fleet/host-shadow-pass.d.ts +21 -0
  166. package/dist/fleet/host-shadow-pass.d.ts.map +1 -0
  167. package/dist/fleet/host-spawn-types.d.ts +25 -0
  168. package/dist/fleet/host-spawn-types.d.ts.map +1 -0
  169. package/dist/fleet/host-status.d.ts +48 -0
  170. package/dist/fleet/host-status.d.ts.map +1 -0
  171. package/dist/fleet/host-subagent-factory.d.ts +16 -0
  172. package/dist/fleet/host-subagent-factory.d.ts.map +1 -0
  173. package/dist/fleet/host-supervisor.d.ts +16 -0
  174. package/dist/fleet/host-supervisor.d.ts.map +1 -0
  175. package/dist/fleet/host-task-result-report.d.ts +11 -0
  176. package/dist/fleet/host-task-result-report.d.ts.map +1 -0
  177. package/dist/fleet/host-types.d.ts +89 -0
  178. package/dist/fleet/host-types.d.ts.map +1 -0
  179. package/dist/fleet/host.d.ts +10 -357
  180. package/dist/fleet/host.d.ts.map +1 -1
  181. package/dist/hq-JUYKUNJX.js +547 -0
  182. package/dist/hq-JUYKUNJX.js.map +7 -0
  183. package/dist/hq-command-controller.d.ts +2 -2
  184. package/dist/hq-command-controller.d.ts.map +1 -1
  185. package/dist/hq-server/auth.d.ts +15 -4
  186. package/dist/hq-server/auth.d.ts.map +1 -1
  187. package/dist/hq-server/project-root.d.ts +5 -0
  188. package/dist/hq-server/project-root.d.ts.map +1 -0
  189. package/dist/hq-server/routes/auth-handlers.d.ts +25 -0
  190. package/dist/hq-server/routes/auth-handlers.d.ts.map +1 -0
  191. package/dist/hq-server/routes/session-handlers.d.ts +8 -0
  192. package/dist/hq-server/routes/session-handlers.d.ts.map +1 -0
  193. package/dist/hq-server/routes.d.ts +8 -6
  194. package/dist/hq-server/routes.d.ts.map +1 -1
  195. package/dist/hq-server/snapshot.d.ts +44 -0
  196. package/dist/hq-server/snapshot.d.ts.map +1 -1
  197. package/dist/hq-server/types.d.ts +22 -4
  198. package/dist/hq-server/types.d.ts.map +1 -1
  199. package/dist/hq-server/utils.d.ts +8 -0
  200. package/dist/hq-server/utils.d.ts.map +1 -1
  201. package/dist/hq-server/ws.d.ts +1 -1
  202. package/dist/hq-server/ws.d.ts.map +1 -1
  203. package/dist/hq-server-6AQ3BXZA.js +39 -0
  204. package/dist/hq-server-6AQ3BXZA.js.map +7 -0
  205. package/dist/hq-server.d.ts +3 -3
  206. package/dist/hq-server.d.ts.map +1 -1
  207. package/dist/hq-ttl-U2FAYFAT.js +8 -0
  208. package/dist/hq-ttl-U2FAYFAT.js.map +7 -0
  209. package/dist/hq-tunnel-RFKGC4HI.js +114 -0
  210. package/dist/hq-tunnel-RFKGC4HI.js.map +7 -0
  211. package/dist/hq-tunnel.d.ts +1 -1
  212. package/dist/hq-tunnel.d.ts.map +1 -1
  213. package/dist/index.d.ts +2 -1
  214. package/dist/index.d.ts.map +1 -1
  215. package/dist/index.js +2503 -53026
  216. package/dist/index.js.map +4 -4
  217. package/dist/init-E2NDDOHI.js +27 -0
  218. package/dist/init-E2NDDOHI.js.map +7 -0
  219. package/dist/kanban-dispatch-route.d.ts +14 -0
  220. package/dist/kanban-dispatch-route.d.ts.map +1 -0
  221. package/dist/kanban-hq-sync.d.ts +2 -0
  222. package/dist/kanban-hq-sync.d.ts.map +1 -1
  223. package/dist/kanban-run-mirror-EKVNGXWW.js +12 -0
  224. package/dist/kanban-run-mirror-EKVNGXWW.js.map +7 -0
  225. package/dist/live-settings-input.d.ts +69 -0
  226. package/dist/live-settings-input.d.ts.map +1 -0
  227. package/dist/mailbox-serve-2UWHEN3M.js +302 -0
  228. package/dist/mailbox-serve-2UWHEN3M.js.map +7 -0
  229. package/dist/mcp-CYLPUEHC.js +413 -0
  230. package/dist/mcp-CYLPUEHC.js.map +7 -0
  231. package/dist/modeldiag-HENYJ4N7.js +1290 -0
  232. package/dist/modeldiag-HENYJ4N7.js.map +7 -0
  233. package/dist/permissions-FNYLZIL4.js +115 -0
  234. package/dist/permissions-FNYLZIL4.js.map +7 -0
  235. package/dist/picker-key-state.d.ts +7 -0
  236. package/dist/picker-key-state.d.ts.map +1 -0
  237. package/dist/picker-model-picker.d.ts +6 -0
  238. package/dist/picker-model-picker.d.ts.map +1 -0
  239. package/dist/picker-ui.d.ts +17 -0
  240. package/dist/picker-ui.d.ts.map +1 -0
  241. package/dist/picker.d.ts +4 -37
  242. package/dist/picker.d.ts.map +1 -1
  243. package/dist/plugin-usage-OU6X6LM3.js +40 -0
  244. package/dist/plugin-usage-OU6X6LM3.js.map +7 -0
  245. package/dist/plugins-4LJ5IUBI.js +24 -0
  246. package/dist/plugins-4LJ5IUBI.js.map +7 -0
  247. package/dist/pre-launch.d.ts +0 -1
  248. package/dist/pre-launch.d.ts.map +1 -1
  249. package/dist/project-BLQ3ALVL.js +76 -0
  250. package/dist/project-BLQ3ALVL.js.map +7 -0
  251. package/dist/project-manifest-GE25PW4S.js +18 -0
  252. package/dist/project-manifest-GE25PW4S.js.map +7 -0
  253. package/dist/project-picker-BOCWHBXP.js +17 -0
  254. package/dist/project-picker-BOCWHBXP.js.map +7 -0
  255. package/dist/projects-XE76NFNZ.js +38 -0
  256. package/dist/projects-XE76NFNZ.js.map +7 -0
  257. package/dist/provider-helpers.d.ts +22 -6
  258. package/dist/provider-helpers.d.ts.map +1 -1
  259. package/dist/providers-models-GDELBHZK.js +589 -0
  260. package/dist/providers-models-GDELBHZK.js.map +7 -0
  261. package/dist/quick-VIO2BEHS.js +10 -0
  262. package/dist/quick-VIO2BEHS.js.map +7 -0
  263. package/dist/repl-auto-proceed.d.ts +19 -0
  264. package/dist/repl-auto-proceed.d.ts.map +1 -0
  265. package/dist/repl-client-registration.d.ts +7 -0
  266. package/dist/repl-client-registration.d.ts.map +1 -0
  267. package/dist/repl-input.d.ts +11 -0
  268. package/dist/repl-input.d.ts.map +1 -0
  269. package/dist/repl-options.d.ts +54 -0
  270. package/dist/repl-options.d.ts.map +1 -0
  271. package/dist/repl-rendering.d.ts +4 -0
  272. package/dist/repl-rendering.d.ts.map +1 -0
  273. package/dist/repl-suggestions.d.ts +21 -0
  274. package/dist/repl-suggestions.d.ts.map +1 -0
  275. package/dist/repl.d.ts +3 -162
  276. package/dist/repl.d.ts.map +1 -1
  277. package/dist/replay-KCTXNMZQ.js +75 -0
  278. package/dist/replay-KCTXNMZQ.js.map +7 -0
  279. package/dist/rewind-EJMVFVLS.js +185 -0
  280. package/dist/rewind-EJMVFVLS.js.map +7 -0
  281. package/dist/sdd-runtime-JG4EEKL6.js +54 -0
  282. package/dist/sdd-runtime-JG4EEKL6.js.map +7 -0
  283. package/dist/services/sdd/project-context.d.ts +1 -1
  284. package/dist/services/sdd/project-context.d.ts.map +1 -1
  285. package/dist/services/sdd/task-manager.d.ts.map +1 -1
  286. package/dist/services/statusline-config.d.ts +1 -1
  287. package/dist/services/statusline-config.d.ts.map +1 -1
  288. package/dist/session-event-wiring.d.ts +2 -2
  289. package/dist/session-event-wiring.d.ts.map +1 -1
  290. package/dist/sessions-config-NLCMK3BY.js +409 -0
  291. package/dist/sessions-config-NLCMK3BY.js.map +7 -0
  292. package/dist/settings-menu.d.ts +3 -18
  293. package/dist/settings-menu.d.ts.map +1 -1
  294. package/dist/simpleui-dist-JIFGUJO7.js +93 -0
  295. package/dist/simpleui-dist-JIFGUJO7.js.map +7 -0
  296. package/dist/slash-commands/brain.d.ts.map +1 -1
  297. package/dist/slash-commands/clear.d.ts.map +1 -1
  298. package/dist/slash-commands/fallback.d.ts.map +1 -1
  299. package/dist/slash-commands/kanban-agent-helpers.d.ts +18 -0
  300. package/dist/slash-commands/kanban-agent-helpers.d.ts.map +1 -0
  301. package/dist/slash-commands/kanban-format.d.ts +16 -0
  302. package/dist/slash-commands/kanban-format.d.ts.map +1 -0
  303. package/dist/slash-commands/kanban-help.d.ts +2 -0
  304. package/dist/slash-commands/kanban-help.d.ts.map +1 -0
  305. package/dist/slash-commands/kanban.d.ts.map +1 -1
  306. package/dist/slash-commands/mailbox-demo.d.ts.map +1 -1
  307. package/dist/slash-commands/mailbox.d.ts +2 -1
  308. package/dist/slash-commands/mailbox.d.ts.map +1 -1
  309. package/dist/slash-commands/memory-compact.d.ts +5 -0
  310. package/dist/slash-commands/memory-compact.d.ts.map +1 -0
  311. package/dist/slash-commands/memory-flags.d.ts +36 -0
  312. package/dist/slash-commands/memory-flags.d.ts.map +1 -0
  313. package/dist/slash-commands/memory-formatters.d.ts +16 -0
  314. package/dist/slash-commands/memory-formatters.d.ts.map +1 -0
  315. package/dist/slash-commands/memory.d.ts.map +1 -1
  316. package/dist/slash-commands/mouse.d.ts +2 -2
  317. package/dist/slash-commands/review.d.ts.map +1 -1
  318. package/dist/slash-commands/sdd-command-helpers.d.ts +23 -0
  319. package/dist/slash-commands/sdd-command-helpers.d.ts.map +1 -0
  320. package/dist/slash-commands/sdd-format.d.ts +32 -0
  321. package/dist/slash-commands/sdd-format.d.ts.map +1 -0
  322. package/dist/slash-commands/sdd.d.ts.map +1 -1
  323. package/dist/slash-commands/settings.d.ts.map +1 -1
  324. package/dist/subcommands/handlers/chronicle.d.ts.map +1 -1
  325. package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -1
  326. package/dist/subcommands/handlers/model-smoke-test.d.ts +51 -0
  327. package/dist/subcommands/handlers/model-smoke-test.d.ts.map +1 -0
  328. package/dist/subcommands/handlers/modeldiag-profiles.d.ts +64 -0
  329. package/dist/subcommands/handlers/modeldiag-profiles.d.ts.map +1 -0
  330. package/dist/subcommands/handlers/modeldiag.d.ts.map +1 -1
  331. package/dist/subcommands/handlers/per-subcommand-deep-help-table.d.ts +3 -0
  332. package/dist/subcommands/handlers/per-subcommand-deep-help-table.d.ts.map +1 -0
  333. package/dist/subcommands/handlers/per-subcommand-help-data.d.ts +3 -0
  334. package/dist/subcommands/handlers/per-subcommand-help-data.d.ts.map +1 -0
  335. package/dist/subcommands/handlers/per-subcommand-help-table.d.ts +36 -0
  336. package/dist/subcommands/handlers/per-subcommand-help-table.d.ts.map +1 -0
  337. package/dist/subcommands/handlers/per-subcommand-help-types.d.ts +18 -0
  338. package/dist/subcommands/handlers/per-subcommand-help-types.d.ts.map +1 -0
  339. package/dist/subcommands/handlers/per-subcommand-help.d.ts +2 -80
  340. package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +1 -1
  341. package/dist/subcommands/handlers/rewind.d.ts.map +1 -1
  342. package/dist/subcommands/index.d.ts +7 -0
  343. package/dist/subcommands/index.d.ts.map +1 -1
  344. package/dist/tools-skills-UNKLOB7M.js +29 -0
  345. package/dist/tools-skills-UNKLOB7M.js.map +7 -0
  346. package/dist/update-YC4TYW2Y.js +16 -0
  347. package/dist/update-YC4TYW2Y.js.map +7 -0
  348. package/dist/update-check-UMYTOH7Z.js +18 -0
  349. package/dist/update-check-UMYTOH7Z.js.map +7 -0
  350. package/dist/version-help-DROHZRW6.js +11 -0
  351. package/dist/version-help-DROHZRW6.js.map +7 -0
  352. package/dist/webui-server/connection-handler.d.ts.map +1 -1
  353. package/dist/webui-server/kanban-host-adapter.d.ts +5 -1
  354. package/dist/webui-server/kanban-host-adapter.d.ts.map +1 -1
  355. package/dist/webui-server/listen-helpers.d.ts +18 -0
  356. package/dist/webui-server/listen-helpers.d.ts.map +1 -0
  357. package/dist/webui-server/node-pty-loader.d.ts +6 -0
  358. package/dist/webui-server/node-pty-loader.d.ts.map +1 -0
  359. package/dist/webui-server-ZF5KVGC5.js +1460 -0
  360. package/dist/webui-server-ZF5KVGC5.js.map +7 -0
  361. package/dist/webui-server-options.d.ts +191 -0
  362. package/dist/webui-server-options.d.ts.map +1 -0
  363. package/dist/webui-server.d.ts +2 -178
  364. package/dist/webui-server.d.ts.map +1 -1
  365. package/dist/wiring/brain-and-orchestration.d.ts.map +1 -1
  366. package/dist/wiring/codebase-index.d.ts.map +1 -1
  367. package/dist/wiring/command-host-state.d.ts +4 -4
  368. package/dist/wiring/dep-watcher-bridge.d.ts +23 -0
  369. package/dist/wiring/dep-watcher-bridge.d.ts.map +1 -0
  370. package/dist/wiring/dep-watcher.d.ts.map +1 -1
  371. package/dist/wiring/hq-telemetry.d.ts +2 -2
  372. package/dist/wiring/lifecycle-plugins.d.ts +4 -3
  373. package/dist/wiring/lifecycle-plugins.d.ts.map +1 -1
  374. package/dist/wiring/mailbox-bridge-bootstrap.d.ts +1 -1
  375. package/dist/wiring/management-tools.d.ts +15 -0
  376. package/dist/wiring/management-tools.d.ts.map +1 -0
  377. package/dist/wiring/pipeline.d.ts +2 -1
  378. package/dist/wiring/pipeline.d.ts.map +1 -1
  379. package/dist/wiring/plugins.d.ts +1 -1
  380. package/dist/wiring/plugins.d.ts.map +1 -1
  381. package/dist/wiring/provider-runtime-setup.d.ts +14 -1
  382. package/dist/wiring/provider-runtime-setup.d.ts.map +1 -1
  383. package/dist/wiring/provider.d.ts.map +1 -1
  384. package/dist/wiring/runtime-controller-deps.d.ts +1 -1
  385. package/dist/wiring/runtime-controller-deps.d.ts.map +1 -1
  386. package/dist/wiring/sage.d.ts.map +1 -1
  387. package/dist/wiring/session-registry.d.ts +38 -0
  388. package/dist/wiring/session-registry.d.ts.map +1 -0
  389. package/dist/wiring/session.d.ts +10 -6
  390. package/dist/wiring/session.d.ts.map +1 -1
  391. package/dist/wiring/tools.d.ts.map +1 -1
  392. package/package.json +22 -22
  393. package/dist/cli-recovery-prompt.d.ts +0 -19
  394. package/dist/cli-recovery-prompt.d.ts.map +0 -1
  395. package/dist/first-run-auth-gate.d.ts +0 -20
  396. package/dist/first-run-auth-gate.d.ts.map +0 -1
  397. package/dist/pre-launch/indexing-question.d.ts +0 -28
  398. package/dist/pre-launch/indexing-question.d.ts.map +0 -1
@@ -0,0 +1,824 @@
1
+ import {
2
+ createGracefulShutdown,
3
+ loadCachedAcpRegistry,
4
+ refreshAcpRegistry,
5
+ setupProvider
6
+ } from "./chunk-AZESNNIC.js";
7
+ import "./chunk-TADVX644.js";
8
+ import "./chunk-PJHET45A.js";
9
+ import "./chunk-7OCVIDC7.js";
10
+
11
+ // src/subcommands/handlers/acp.ts
12
+ import {
13
+ defaultPermissionPolicy,
14
+ EnsembleRegistry,
15
+ probeAcpAgents,
16
+ renderAcpBenchText,
17
+ resolveAcpAgentCommand,
18
+ runAcpBench,
19
+ runEnsemble,
20
+ runOneAcpTask
21
+ } from "@wrongstack/acp";
22
+ import {
23
+ ACPProtocolHandler,
24
+ ACPSessionStore,
25
+ makeACPServerAgentTurn,
26
+ WrongStackACPServer,
27
+ WsBridgeTransport
28
+ } from "@wrongstack/acp/agent";
29
+ import * as path from "node:path";
30
+ import { WebSocketServer } from "ws";
31
+
32
+ // src/acp-server-agent.ts
33
+ import { Agent, Context, createDefaultPipelines } from "@wrongstack/core/agent";
34
+ import { AutoApprovePermissionPolicy, ToolCapabilities } from "@wrongstack/core/security";
35
+ import { DefaultLogger } from "@wrongstack/core/infrastructure";
36
+ import { EventBus, TOKENS } from "@wrongstack/core/kernel";
37
+ import { ToolValidationError } from "@wrongstack/core/types";
38
+ import { ToolRegistry } from "@wrongstack/core/registry";
39
+ import { DefaultTokenCounter } from "@wrongstack/core/infrastructure";
40
+ import { ToolExecutor } from "@wrongstack/core/execution";
41
+ import { createDefaultContainer } from "@wrongstack/runtime";
42
+ var AcpServerConfigError = class extends Error {
43
+ constructor(message) {
44
+ super(message);
45
+ this.name = "AcpServerConfigError";
46
+ }
47
+ };
48
+ var SAFE_CAPS = /* @__PURE__ */ new Set([
49
+ ToolCapabilities.FS_READ,
50
+ ToolCapabilities.NET_OUTBOUND,
51
+ ToolCapabilities.COORDINATION_FLEET_READ
52
+ ]);
53
+ var ACPClientPermissionPolicy = class {
54
+ constructor(requestPermission) {
55
+ this.requestPermission = requestPermission;
56
+ }
57
+ requestPermission;
58
+ async evaluate(tool, input) {
59
+ const caps = tool.capabilities ?? [];
60
+ const isSafe = caps.length > 0 && caps.every((c) => SAFE_CAPS.has(c));
61
+ if (isSafe) {
62
+ return { permission: "auto", source: "default" };
63
+ }
64
+ const title = describeToolCall(tool.name, input);
65
+ try {
66
+ const outcome = await this.requestPermission({
67
+ toolCall: { toolCallId: `tc_${tool.name}_${Date.now()}`, title },
68
+ options: [
69
+ { optionId: "allow_once", name: "Allow", kind: "allow_once" },
70
+ { optionId: "allow_always", name: "Always allow", kind: "allow_always" },
71
+ { optionId: "reject_once", name: "Reject", kind: "reject_once" }
72
+ ]
73
+ });
74
+ const optionId = outcome.outcome === "selected" ? outcome.optionId : void 0;
75
+ const allowed = typeof optionId === "string" && optionId.startsWith("allow");
76
+ return allowed ? { permission: "auto", source: "user" } : { permission: "deny", source: "user", reason: "rejected by ACP client" };
77
+ } catch {
78
+ return { permission: "deny", source: "deny", reason: "no permission channel" };
79
+ }
80
+ }
81
+ async trust() {
82
+ }
83
+ async deny() {
84
+ }
85
+ denyOnce() {
86
+ }
87
+ allowOnce() {
88
+ }
89
+ async reload() {
90
+ }
91
+ };
92
+ function describeToolCall(name, input) {
93
+ if (input && typeof input === "object") {
94
+ const r = input;
95
+ const arg = r.path ?? r.file ?? r.command ?? r.pattern;
96
+ if (typeof arg === "string") return `${name}: ${arg}`;
97
+ }
98
+ return name;
99
+ }
100
+ function wireClientBackedTools(tools, api) {
101
+ const caps = api.clientCapabilities ?? {};
102
+ const swap = (name, make) => {
103
+ const base = tools.get(name);
104
+ if (!base) return;
105
+ tools.unregister(name);
106
+ tools.register(make(base));
107
+ };
108
+ if (caps.fs?.readTextFile) {
109
+ swap("read", (base) => makeAcpRead(base, api));
110
+ }
111
+ if (caps.fs?.writeTextFile) {
112
+ swap("write", (base) => makeAcpWrite(base, api));
113
+ swap("edit", (base) => makeAcpEdit(base, api));
114
+ }
115
+ if (caps.terminal) {
116
+ swap("bash", (base) => makeAcpBash(base, api));
117
+ }
118
+ }
119
+ function makeAcpRead(base, api) {
120
+ return {
121
+ ...base,
122
+ mutating: false,
123
+ execute: async (input) => {
124
+ const i = input ?? {};
125
+ if (!i.path) throw new ToolValidationError({ message: "read: path is required", field: "path" });
126
+ const content = await api.readTextFile({
127
+ path: i.path,
128
+ ...typeof i.offset === "number" ? { line: i.offset } : {},
129
+ ...typeof i.limit === "number" ? { limit: i.limit } : {}
130
+ });
131
+ const lines = content.split(/\r\n|\r|\n/);
132
+ const start = Math.max(1, i.offset ?? 1);
133
+ const width = String(start + lines.length - 1).length;
134
+ const text = lines.map((l, idx) => `${String(start + idx).padStart(width, " ")}\u2192${l}`).join("\n");
135
+ return { text, total_lines: lines.length, encoding: "utf8", truncated: false };
136
+ }
137
+ };
138
+ }
139
+ function makeAcpWrite(base, api) {
140
+ return {
141
+ ...base,
142
+ execute: async (input) => {
143
+ const i = input ?? {};
144
+ if (!i.path) throw new ToolValidationError({ message: "write: path is required", field: "path" });
145
+ await api.writeTextFile({ path: i.path, content: i.content ?? "" });
146
+ return { path: i.path, ok: true };
147
+ }
148
+ };
149
+ }
150
+ function makeAcpEdit(base, api) {
151
+ return {
152
+ ...base,
153
+ execute: async (input) => {
154
+ const i = input ?? {};
155
+ if (!i.path) throw new ToolValidationError({ message: "edit: path is required", field: "path" });
156
+ if (!i.old_string) throw new ToolValidationError({ message: "edit: old_string is required", field: "old_string" });
157
+ const before = await api.readTextFile({ path: i.path });
158
+ const occurrences = before.split(i.old_string).length - 1;
159
+ if (occurrences === 0) {
160
+ throw new ToolValidationError({
161
+ message: `edit: old_string not found in "${i.path}"`,
162
+ field: "old_string",
163
+ context: { path: i.path }
164
+ });
165
+ }
166
+ if (occurrences > 1 && !i.replace_all) {
167
+ throw new ToolValidationError({
168
+ message: `edit: old_string appears ${occurrences} times in "${i.path}"; pass replace_all or use a more specific string`,
169
+ field: "old_string",
170
+ context: { path: i.path, occurrences, replaceAll: false }
171
+ });
172
+ }
173
+ const after = i.replace_all ? before.split(i.old_string).join(i.new_string ?? "") : before.replace(i.old_string, i.new_string ?? "");
174
+ await api.writeTextFile({ path: i.path, content: after });
175
+ return { path: i.path, replacements: i.replace_all ? occurrences : 1 };
176
+ }
177
+ };
178
+ }
179
+ function makeAcpBash(base, api) {
180
+ return {
181
+ ...base,
182
+ execute: async (input) => {
183
+ const i = input ?? {};
184
+ if (!i.command) throw new ToolValidationError({ message: "bash: command is required", field: "command" });
185
+ const { output, exitCode } = await api.runTerminal({
186
+ command: "sh",
187
+ args: ["-c", i.command],
188
+ ...i.cwd ? { cwd: i.cwd } : {}
189
+ });
190
+ return { stdout: output, exit_code: exitCode, command: i.command };
191
+ }
192
+ };
193
+ }
194
+ function buildAcpServerAgentFactory(deps, options = {}) {
195
+ const config = deps.config;
196
+ if (!config.provider || !config.model) {
197
+ throw new AcpServerConfigError(
198
+ "No model provider is configured. Run `wstack auth` to add credentials, or start the server with `wstack acp --echo` for a no-op connectivity test."
199
+ );
200
+ }
201
+ const logger = options.logger ?? new DefaultLogger({ stderr: true });
202
+ const wpaths = deps.paths;
203
+ let providerBoot = null;
204
+ const bootProvider = () => {
205
+ if (!providerBoot) {
206
+ providerBoot = setupProvider({ config, modelsRegistry: deps.modelsRegistry, logger });
207
+ }
208
+ return providerBoot;
209
+ };
210
+ const container = createDefaultContainer({
211
+ config,
212
+ wpaths,
213
+ logger,
214
+ modelsRegistry: deps.modelsRegistry
215
+ });
216
+ return async function agentFor(_sessionId, cwd, api) {
217
+ await container.resolve(TOKENS.MemoryStore).initialize();
218
+ const { provider, providerRegistry } = await bootProvider();
219
+ const events = new EventBus();
220
+ const source = deps.toolRegistry ?? new ToolRegistry();
221
+ const tools = new ToolRegistry();
222
+ for (const t of source.list()) tools.register(t);
223
+ if (api) {
224
+ wireClientBackedTools(tools, api);
225
+ }
226
+ const permissionPolicy = api?.requestPermission ? new ACPClientPermissionPolicy(api.requestPermission) : new AutoApprovePermissionPolicy();
227
+ const tokenCounter = new DefaultTokenCounter({
228
+ registry: deps.modelsRegistry,
229
+ providerId: config.provider,
230
+ events
231
+ });
232
+ const session = { append: async () => {
233
+ } };
234
+ const context = new Context({
235
+ systemPrompt: [],
236
+ provider,
237
+ session,
238
+ signal: new AbortController().signal,
239
+ tokenCounter,
240
+ cwd,
241
+ projectRoot: cwd,
242
+ allowOutsideProjectRoot: config.features?.allowOutsideProjectRoot ?? false,
243
+ model: config.model,
244
+ tools: [...tools.list()],
245
+ agentId: "acp-server",
246
+ agentName: "wrongstack-acp"
247
+ });
248
+ const toolExecutor = new ToolExecutor(tools, {
249
+ permissionPolicy,
250
+ secretScrubber: container.resolve(TOKENS.SecretScrubber),
251
+ renderer: void 0,
252
+ events,
253
+ confirmAwaiter: void 0,
254
+ iterationTimeoutMs: config.tools?.iterationTimeoutMs ?? 12e4,
255
+ maxToolTimeoutMs: config.tools?.maxToolTimeoutMs ?? 3e5,
256
+ perIterationOutputCapBytes: config.tools?.perIterationOutputCapBytes ?? 1e5,
257
+ tracer: void 0
258
+ });
259
+ return new Agent({
260
+ container,
261
+ tools,
262
+ providers: providerRegistry,
263
+ events,
264
+ pipelines: createDefaultPipelines(),
265
+ context,
266
+ permissionPolicy,
267
+ toolExecutor,
268
+ loopDetection: config.tools?.loopDetection
269
+ });
270
+ };
271
+ }
272
+
273
+ // src/subcommands/handlers/acp.ts
274
+ function acpOverrides(deps) {
275
+ return deps.config.acp?.agents;
276
+ }
277
+ async function loadLive(deps) {
278
+ return deps.paths ? loadCachedAcpRegistry(deps.paths) : null;
279
+ }
280
+ var acpCmd = async (args, deps) => {
281
+ const sub = args[0];
282
+ if (!sub || sub === "server" || sub === "serve") {
283
+ return runACPServer(deps);
284
+ }
285
+ if (sub === "help") {
286
+ deps.renderer.write(`wstack acp \u2014 ACP (Agent Client Protocol) integration
287
+
288
+ Usage:
289
+ wstack acp Start WrongStack as an ACP server (blocks)
290
+ wstack acp server Same as above
291
+ wstack acp list List available ACP agents
292
+ wstack acp sync Pull the official agentclientprotocol/registry into cache
293
+ wstack acp spawn <id> <task>
294
+ Spawn an ACP agent as a subagent and wait for result
295
+ wstack acp parallel <agent-id-csv> <task>
296
+ Fan a task out to multiple ACP agents in parallel
297
+ and aggregate the results
298
+ wstack acp probe [agent-id-csv]
299
+ Handshake-test agents (bounded concurrency). Defaults
300
+ to all installed agents.
301
+ wstack acp bench [agent-id-csv] [--fs]
302
+ End-to-end verify each agent (handshake \u2192 prompt \u2192
303
+ marker, optional fs check) and print a graded report.
304
+ Defaults to all installed agents.
305
+ wstack acp help Show this help
306
+
307
+ ACP Mode:
308
+ When run as \`wstack acp\`. WrongStack acts as an ACP-compatible agent driven
309
+ by your configured model provider. ACP clients (Zed, JetBrains, VS Code)
310
+ spawn it as a subprocess and communicate over stdio JSON-RPC. Run
311
+ \`wstack auth\` first to configure a provider, or pass \`--echo\` for a no-op
312
+ connectivity test that needs no provider. Press Ctrl+C to stop.
313
+
314
+ Transports:
315
+ (default) stdio JSON-RPC (the usual editor-spawned-subprocess mode)
316
+ --ws[=port] serve over WebSocket on 127.0.0.1:<port> (default 8889) \u2014
317
+ full-duplex, so updates/permission prompts stream live.
318
+
319
+ spawn:
320
+ Spawns a named ACP agent (claude-code, gemini-cli, codex-cli, copilot,
321
+ cline, goose, openhands, qwen-code, kiro-cli, opencode, mistral-vibe,
322
+ cursor) with the given task and waits for its result.
323
+ Example: wstack acp spawn cline "fix the login bug"
324
+
325
+ parallel:
326
+ Runs the same task on a comma-separated list of ACP agents concurrently.
327
+ Example: wstack acp parallel claude-code,gemini-cli,codex-cli "review this diff"
328
+ Each agent's result is rendered under a clearly-marked header. Returns 0
329
+ if at least one agent succeeds, 1 if all fail. Agents that aren't
330
+ installed are skipped with a warning.
331
+ `);
332
+ return 0;
333
+ }
334
+ if (sub === "list") {
335
+ return listACPAgents(deps);
336
+ }
337
+ if (sub === "sync") {
338
+ return syncACPRegistry(deps);
339
+ }
340
+ if (sub === "spawn") {
341
+ return spawnACPAgent(args.slice(1), deps);
342
+ }
343
+ if (sub === "parallel") {
344
+ return parallelACPAgents(args.slice(1), deps);
345
+ }
346
+ if (sub === "probe") {
347
+ return probeACPAgents(args.slice(1), deps);
348
+ }
349
+ if (sub === "bench") {
350
+ return benchACPAgents(args.slice(1), deps);
351
+ }
352
+ deps.renderer.writeError(`Unknown acp subcommand: ${sub}
353
+ `);
354
+ deps.renderer.write("Run `wstack acp help` for usage.\n");
355
+ return 1;
356
+ };
357
+ function parseWsPort(flag) {
358
+ if (flag === void 0 || flag === false) return null;
359
+ if (flag === true || flag === "true") return 8889;
360
+ const n = Number(flag);
361
+ return Number.isInteger(n) && n > 0 && n < 65536 ? n : 8889;
362
+ }
363
+ async function runACPWebSocketServer(deps, port) {
364
+ const host = "127.0.0.1";
365
+ const echo = deps.flags?.echo === true || deps.flags?.echo === "true";
366
+ let turnFactory;
367
+ let echoTurn;
368
+ let store;
369
+ if (echo) {
370
+ echoTurn = async () => ({ stopReason: "end_turn" });
371
+ } else {
372
+ let agentFor;
373
+ try {
374
+ agentFor = buildAcpServerAgentFactory(deps);
375
+ } catch (err) {
376
+ if (err instanceof AcpServerConfigError) {
377
+ deps.renderer.writeError(`${err.message}
378
+ `);
379
+ return 1;
380
+ }
381
+ throw err;
382
+ }
383
+ turnFactory = () => makeACPServerAgentTurn({ agentFor });
384
+ store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
385
+ }
386
+ const wss = new WebSocketServer({ host, port, maxPayload: 20 * 1024 * 1024 });
387
+ wss.on("connection", (socket, req) => {
388
+ const origin = req.headers.origin;
389
+ if (origin && origin !== `http://${host}:${port}` && origin !== `ws://${host}:${port}`) {
390
+ socket.close(1008, "cross-origin forbidden");
391
+ return;
392
+ }
393
+ const connectionTurn = turnFactory?.();
394
+ const transport = new WsBridgeTransport((m) => {
395
+ const data = JSON.stringify(m);
396
+ if (socket.bufferedAmount + Buffer.byteLength(data, "utf8") > 32 * 1024 * 1024) {
397
+ socket.terminate();
398
+ return;
399
+ }
400
+ socket.send(data);
401
+ });
402
+ const handler = new ACPProtocolHandler({
403
+ transport,
404
+ defaultCwd: deps.cwd ?? process.cwd(),
405
+ runTurn: connectionTurn ?? echoTurn,
406
+ ...connectionTurn ? {
407
+ replayFor: connectionTurn.replay,
408
+ seedFor: connectionTurn.seed,
409
+ disposeFor: connectionTurn.dispose
410
+ } : {},
411
+ ...store ? { store } : {}
412
+ });
413
+ socket.on("message", (data) => {
414
+ let msg;
415
+ try {
416
+ msg = JSON.parse(data.toString());
417
+ } catch {
418
+ return;
419
+ }
420
+ transport.receive(msg);
421
+ void handler.handleMessage(msg);
422
+ });
423
+ const teardown = () => {
424
+ handler.close();
425
+ transport.close();
426
+ };
427
+ socket.on("close", teardown);
428
+ socket.on("error", teardown);
429
+ });
430
+ deps.renderer.writeInfo(
431
+ echo ? `ACP server (echo, no provider) listening on ws://${host}:${port}. Press Ctrl+C to stop.
432
+ ` : `WrongStack ACP server listening on ws://${host}:${port} (${deps.config.provider}/${deps.config.model}). Press Ctrl+C to stop.
433
+ `
434
+ );
435
+ await new Promise((resolve) => {
436
+ const shutdown = () => {
437
+ deps.renderer.writeWarning("\nShutting down ACP WebSocket server...");
438
+ wss.close();
439
+ resolve();
440
+ };
441
+ process.on("SIGINT", shutdown);
442
+ process.on("SIGTERM", shutdown);
443
+ });
444
+ return 0;
445
+ }
446
+ async function runACPServer(deps) {
447
+ const wsPort = parseWsPort(deps.flags?.ws);
448
+ if (wsPort !== null) {
449
+ return runACPWebSocketServer(deps, wsPort);
450
+ }
451
+ const echo = deps.flags?.echo === true || deps.flags?.echo === "true";
452
+ const server = new WrongStackACPServer(
453
+ echo ? {} : (() => {
454
+ let agentFor;
455
+ try {
456
+ agentFor = buildAcpServerAgentFactory(deps);
457
+ } catch (err) {
458
+ if (err instanceof AcpServerConfigError) {
459
+ deps.renderer.writeError(`${err.message}
460
+ `);
461
+ return {};
462
+ }
463
+ throw err;
464
+ }
465
+ const turn = makeACPServerAgentTurn({ agentFor });
466
+ const store = deps.paths?.projectDir ? new ACPSessionStore({ dir: path.join(deps.paths.projectDir, "acp-sessions") }) : void 0;
467
+ return {
468
+ runTurn: turn,
469
+ replayFor: turn.replay,
470
+ seedFor: turn.seed,
471
+ disposeFor: turn.dispose,
472
+ ...store ? { store } : {}
473
+ };
474
+ })()
475
+ );
476
+ if (echo) {
477
+ deps.renderer.writeInfo("ACP server starting in --echo mode (no-op turn; no provider needed).\n");
478
+ } else {
479
+ deps.renderer.writeInfo(
480
+ `Starting WrongStack ACP server (${deps.config.provider}/${deps.config.model})\u2026
481
+ `
482
+ );
483
+ deps.renderer.writeInfo("Waiting for an ACP client connection on stdin/stdout. Press Ctrl+C to stop.\n");
484
+ }
485
+ createGracefulShutdown({
486
+ run: async () => {
487
+ try {
488
+ server.stop();
489
+ } catch (err) {
490
+ deps.renderer.writeError(
491
+ `ACP stop failed: ${err instanceof Error ? err.message : String(err)}
492
+ `
493
+ );
494
+ }
495
+ }
496
+ }).install();
497
+ try {
498
+ await server.start();
499
+ } catch (err) {
500
+ deps.renderer.writeError(
501
+ `ACP server error: ${err instanceof Error ? err.message : String(err)}
502
+ `
503
+ );
504
+ return 1;
505
+ }
506
+ return 0;
507
+ }
508
+ async function listACPAgents(deps) {
509
+ const registry = new EnsembleRegistry();
510
+ const detected = await registry.list();
511
+ deps.renderer.write("Detected ACP agents:\n\n");
512
+ const installed = detected.filter((a) => a.installed);
513
+ const missing = detected.filter((a) => !a.installed);
514
+ for (const a of installed) {
515
+ const ver = a.version ? ` (${a.version.split("\n")[0]})` : "";
516
+ deps.renderer.write(` \u2713 ${a.id.padEnd(16)} ${a.displayName}${ver}
517
+ `);
518
+ }
519
+ for (const a of missing) {
520
+ deps.renderer.write(` \u2717 ${a.id.padEnd(16)} ${a.displayName} (${a.reason ?? "not installed"})
521
+ `);
522
+ }
523
+ deps.renderer.write(`
524
+ ${installed.length} of ${detected.length} agents available.
525
+ `);
526
+ const live = await loadLive(deps);
527
+ if (live && live.agents.length > 0) {
528
+ deps.renderer.write(
529
+ `Synced registry: ${live.agents.length} agents available (run \`wstack acp spawn <id> <task>\`).
530
+ `
531
+ );
532
+ } else {
533
+ deps.renderer.write("Run `wstack acp sync` to pull the full official registry (37+ agents).\n");
534
+ }
535
+ deps.renderer.write("Use `wstack acp spawn <agent-id> <task>` to delegate a task.\n");
536
+ return 0;
537
+ }
538
+ async function syncACPRegistry(deps) {
539
+ if (!deps.paths) {
540
+ deps.renderer.writeError("Cannot sync: no cache directory available.\n");
541
+ return 1;
542
+ }
543
+ deps.renderer.writeInfo("Fetching the official ACP registry\u2026\n");
544
+ try {
545
+ const { count, location } = await refreshAcpRegistry(deps.paths);
546
+ deps.renderer.write(`Synced ${count} agents from the official ACP registry.
547
+ `);
548
+ deps.renderer.writeInfo(`Cached at ${location}
549
+ `);
550
+ return 0;
551
+ } catch (err) {
552
+ deps.renderer.writeError(`ACP registry sync failed: ${err instanceof Error ? err.message : String(err)}
553
+ `);
554
+ deps.renderer.write("The bundled offline catalog is still available via `wstack acp list`.\n");
555
+ return 1;
556
+ }
557
+ }
558
+ async function spawnACPAgent(args, deps) {
559
+ const [subagentId, ...taskParts] = args;
560
+ if (!subagentId) {
561
+ deps.renderer.writeError("Usage: wstack acp spawn <agent-id> <task>\n");
562
+ deps.renderer.write("Run `wstack acp list` to see available agents.\n");
563
+ return 1;
564
+ }
565
+ const task = taskParts.join(" ");
566
+ if (!task) {
567
+ deps.renderer.writeError("Usage: wstack acp spawn <agent-id> <task>\n");
568
+ deps.renderer.write("Task description is required.\n");
569
+ return 1;
570
+ }
571
+ const live = await loadLive(deps);
572
+ const cmd = resolveAcpAgentCommand(subagentId, acpOverrides(deps), live?.byId);
573
+ if (!cmd) {
574
+ deps.renderer.writeError(`Unknown ACP agent: ${subagentId}
575
+ `);
576
+ deps.renderer.write("Run `wstack acp list` (or `wstack acp sync`) to see available agents.\n");
577
+ return 1;
578
+ }
579
+ deps.renderer.writeInfo(`Spawning ACP agent '${subagentId}'\u2026
580
+ `);
581
+ const ac = new AbortController();
582
+ const cleanup = () => ac.abort();
583
+ process.on("SIGINT", cleanup);
584
+ process.on("SIGTERM", cleanup);
585
+ try {
586
+ deps.renderer.writeInfo("Running task\u2026\n");
587
+ const result = await runOneAcpTask({
588
+ command: cmd.command,
589
+ ...cmd.args !== void 0 ? { args: cmd.args } : {},
590
+ ...cmd.env !== void 0 ? { env: cmd.env } : {},
591
+ role: subagentId,
592
+ task,
593
+ signal: ac.signal,
594
+ permissionPolicy: defaultPermissionPolicy,
595
+ onProgress: (event) => {
596
+ const line = formatProgress(event);
597
+ if (line) deps.renderer.writeInfo(` ${line}
598
+ `);
599
+ }
600
+ });
601
+ deps.renderer.write("\n--- Result ---\n");
602
+ deps.renderer.write(result.result.length > 0 ? result.result : "no result");
603
+ deps.renderer.write("\n---------------\n");
604
+ deps.renderer.writeInfo(
605
+ `Done. iterations=${result.iterations} toolCalls=${result.toolCalls}
606
+ `
607
+ );
608
+ return 0;
609
+ } catch (err) {
610
+ const e = err;
611
+ const detail = e.kind ? `[${e.kind}] ` : "";
612
+ const message = e.message ?? (err instanceof Error ? err.message : String(err));
613
+ deps.renderer.writeError(`ACP agent error: ${detail}${message}
614
+ `);
615
+ return 1;
616
+ } finally {
617
+ process.off("SIGINT", cleanup);
618
+ process.off("SIGTERM", cleanup);
619
+ }
620
+ }
621
+ function formatProgress(event) {
622
+ switch (event.type) {
623
+ case "tool_call":
624
+ return `\u25B8 ${event.toolCall.title} (${event.toolCall.status})`;
625
+ case "tool_call_update":
626
+ return event.toolCall.status === "completed" || event.toolCall.status === "failed" ? ` \u21B3 ${event.toolCall.title}: ${event.toolCall.status}` : "";
627
+ case "diff":
628
+ return `\u270E ${event.diff.path}${event.diff.oldText === null ? " (new)" : ""}`;
629
+ case "plan":
630
+ return `\u2630 plan: ${event.entries.length} step(s)`;
631
+ default:
632
+ return "";
633
+ }
634
+ }
635
+ async function parallelACPAgents(args, deps) {
636
+ const [csv, ...taskParts] = args;
637
+ if (!csv) {
638
+ deps.renderer.writeError("Usage: wstack acp parallel <agent-id-csv> <task>\n");
639
+ deps.renderer.write('Example: wstack acp parallel claude-code,gemini-cli "review this diff"\n');
640
+ return 1;
641
+ }
642
+ const task = taskParts.join(" ");
643
+ if (!task) {
644
+ deps.renderer.writeError("Usage: wstack acp parallel <agent-id-csv> <task>\n");
645
+ deps.renderer.writeError("Task description is required.\n");
646
+ return 1;
647
+ }
648
+ const ac = new AbortController();
649
+ const onSignal = () => ac.abort();
650
+ process.on("SIGINT", onSignal);
651
+ process.on("SIGTERM", onSignal);
652
+ try {
653
+ const overrides = acpOverrides(deps);
654
+ const live = await loadLive(deps);
655
+ const result = await runEnsemble({
656
+ agentIds: csv,
657
+ task,
658
+ resolveCmd: (id) => resolveAcpAgentCommand(id, overrides, live?.byId),
659
+ signal: ac.signal,
660
+ onProgress: (agentId, event) => {
661
+ const line = formatProgress(event);
662
+ if (line) deps.renderer.writeInfo(` [${agentId}] ${line}
663
+ `);
664
+ }
665
+ });
666
+ const skipped = result.results.filter((r) => r.status === "skipped");
667
+ if (skipped.length > 0) {
668
+ deps.renderer.writeWarning(
669
+ `Skipping ${skipped.length} agent(s) not installed: ${skipped.map((s) => `${s.agentId} (${s.reason ?? "not installed"})`).join(", ")}
670
+ `
671
+ );
672
+ }
673
+ if (result.summary.succeeded + result.summary.failed + result.summary.cancelled === 0) {
674
+ deps.renderer.writeError("No installed agents to run.\n");
675
+ deps.renderer.write("Run `wstack acp list` to see what is available.\n");
676
+ return 1;
677
+ }
678
+ const fannedOut = result.results.filter((r) => r.status !== "skipped").map((r) => r.agentId).join(", ");
679
+ deps.renderer.writeInfo(
680
+ `Fanning out to ${result.summary.succeeded + result.summary.failed + result.summary.cancelled} agent(s): ${fannedOut}
681
+ `
682
+ );
683
+ deps.renderer.writeInfo(`Task: ${result.task}
684
+
685
+ `);
686
+ for (const r of result.results) {
687
+ if (r.status === "skipped") continue;
688
+ deps.renderer.write(`
689
+ === ${r.agentId} ===
690
+ `);
691
+ if (r.status === "success") {
692
+ deps.renderer.write(r.result && r.result.length > 0 ? r.result : "(no result)");
693
+ deps.renderer.write(
694
+ `
695
+ [${r.agentId}] success ${r.durationMs}ms iterations=${r.iterations} toolCalls=${r.toolCalls}
696
+ `
697
+ );
698
+ } else if (r.status === "failed") {
699
+ deps.renderer.writeError(
700
+ `[${r.error?.kind ?? "unknown"}] ${r.error?.message ?? "failed"}
701
+ `
702
+ );
703
+ deps.renderer.write(
704
+ `[${r.agentId}] failed ${r.durationMs}ms
705
+ `
706
+ );
707
+ } else {
708
+ deps.renderer.writeError(
709
+ `[${r.error?.kind ?? "aborted"}] ${r.error?.message ?? "cancelled"}
710
+ `
711
+ );
712
+ deps.renderer.write(
713
+ `[${r.agentId}] cancelled ${r.durationMs}ms
714
+ `
715
+ );
716
+ }
717
+ }
718
+ const { succeeded, failed, cancelled, skipped: skip } = result.summary;
719
+ deps.renderer.write(
720
+ `
721
+ Parallel summary: ${succeeded} succeeded, ${failed} failed, ${cancelled} cancelled, ${skip} skipped.
722
+ `
723
+ );
724
+ return succeeded > 0 ? 0 : 1;
725
+ } finally {
726
+ process.off("SIGINT", onSignal);
727
+ process.off("SIGTERM", onSignal);
728
+ }
729
+ }
730
+ async function probeACPAgents(args, deps) {
731
+ const csv = args.join(" ");
732
+ let ids;
733
+ if (csv) {
734
+ ids = csv.split(",").flatMap((s) => s.split(/\s+/)).map((s) => s.trim()).filter(Boolean);
735
+ } else {
736
+ const detected = await new EnsembleRegistry().list();
737
+ ids = detected.filter((a) => a.installed).map((a) => a.id);
738
+ }
739
+ if (ids.length === 0) {
740
+ deps.renderer.writeError("No installed agents to probe.\n");
741
+ return 1;
742
+ }
743
+ const overrides = acpOverrides(deps);
744
+ const live = await loadLive(deps);
745
+ deps.renderer.writeInfo(
746
+ `Probing ${ids.length} agent(s)\u2026 (npx-based agents may download on first run)
747
+ `
748
+ );
749
+ const results = await probeAcpAgents({
750
+ agentIds: ids,
751
+ resolveCmd: (id) => resolveAcpAgentCommand(id, overrides, live?.byId),
752
+ projectRoot: deps.cwd ?? process.cwd(),
753
+ onProgress: (id, r) => deps.renderer.writeInfo(` ${r.ok ? "\u2713" : "\u2717"} ${id} (${r.ms}ms)
754
+ `)
755
+ });
756
+ deps.renderer.write("\nACP handshake probe:\n\n");
757
+ for (const r of results) {
758
+ if (r.ok) {
759
+ const info = r.agentInfo ? ` \u2014 ${r.agentInfo.name} ${r.agentInfo.version}` : "";
760
+ deps.renderer.write(` \u2713 ${r.id.padEnd(16)} ok ${r.ms}ms${info}
761
+ `);
762
+ } else {
763
+ deps.renderer.write(` \u2717 ${r.id.padEnd(16)} ${r.error ?? "failed"} (${r.ms}ms)
764
+ `);
765
+ }
766
+ }
767
+ const ok = results.filter((r) => r.ok).length;
768
+ deps.renderer.write(`
769
+ ${ok} of ${results.length} agents completed the ACP handshake.
770
+ `);
771
+ return ok > 0 ? 0 : 1;
772
+ }
773
+ async function benchACPAgents(args, deps) {
774
+ const checkFs = deps.flags?.fs === true || deps.flags?.fs === "true" || args.includes("--fs");
775
+ const csv = args.filter((a) => a !== "--fs").join(" ");
776
+ let ids;
777
+ if (csv) {
778
+ ids = csv.split(",").flatMap((s) => s.split(/\s+/)).map((s) => s.trim()).filter(Boolean);
779
+ } else {
780
+ const detected = await new EnsembleRegistry().list();
781
+ ids = detected.filter((a) => a.installed).map((a) => a.id);
782
+ }
783
+ if (ids.length === 0) {
784
+ deps.renderer.writeError("No installed agents to bench.\n");
785
+ deps.renderer.write("Pass ids explicitly: `wstack acp bench gemini-cli,codex-cli`.\n");
786
+ return 1;
787
+ }
788
+ const ac = new AbortController();
789
+ const onSignal = () => ac.abort();
790
+ process.on("SIGINT", onSignal);
791
+ process.on("SIGTERM", onSignal);
792
+ try {
793
+ const overrides = acpOverrides(deps);
794
+ const live = await loadLive(deps);
795
+ deps.renderer.writeInfo(
796
+ `Benching ${ids.length} agent(s)${checkFs ? " (with fs check)" : ""}: ${ids.join(", ")}\u2026
797
+ `
798
+ );
799
+ const result = await runAcpBench({
800
+ agentIds: ids,
801
+ resolveCmd: (id) => resolveAcpAgentCommand(id, overrides, live?.byId),
802
+ projectRoot: deps.cwd ?? process.cwd(),
803
+ checkFs,
804
+ signal: ac.signal,
805
+ onProgress: (agentId, phase, r) => {
806
+ if (phase === "start") deps.renderer.writeInfo(` \u25B8 ${agentId}\u2026
807
+ `);
808
+ else if (r) deps.renderer.writeInfo(` \u21B3 ${agentId}: ${r.status}
809
+ `);
810
+ }
811
+ });
812
+ deps.renderer.write(`
813
+ ${renderAcpBenchText(result)}
814
+ `);
815
+ return result.summary.pass > 0 ? 0 : 1;
816
+ } finally {
817
+ process.off("SIGINT", onSignal);
818
+ process.off("SIGTERM", onSignal);
819
+ }
820
+ }
821
+ export {
822
+ acpCmd
823
+ };
824
+ //# sourceMappingURL=acp-A5OSIU2P.js.map