@wrongstack/cli 0.284.1 → 0.286.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 (568) 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 +87 -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 +24 -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/brain-menu/panel-service.d.ts +15 -0
  95. package/dist/brain-menu/panel-service.d.ts.map +1 -0
  96. package/dist/cli-bundled-prompts.d.ts +12 -0
  97. package/dist/cli-bundled-prompts.d.ts.map +1 -0
  98. package/dist/cli-bundled-skills.d.ts +13 -0
  99. package/dist/cli-bundled-skills.d.ts.map +1 -0
  100. package/dist/cli-context.d.ts +30 -0
  101. package/dist/cli-context.d.ts.map +1 -0
  102. package/dist/cli-entry-point.d.ts +2 -0
  103. package/dist/cli-entry-point.d.ts.map +1 -0
  104. package/dist/cli-eternal-flag.d.ts +68 -0
  105. package/dist/cli-eternal-flag.d.ts.map +1 -0
  106. package/dist/cli-main.d.ts +13 -0
  107. package/dist/cli-main.d.ts.map +1 -0
  108. package/dist/cli-recovery-prompt.d.ts +19 -0
  109. package/dist/cli-recovery-prompt.d.ts.map +1 -0
  110. package/dist/cli-update-notice.d.ts +3 -0
  111. package/dist/cli-update-notice.d.ts.map +1 -0
  112. package/dist/config-doctor.d.ts +39 -0
  113. package/dist/config-doctor.d.ts.map +1 -0
  114. package/dist/config-history.d.ts +54 -0
  115. package/dist/config-history.d.ts.map +1 -0
  116. package/dist/context-limit.d.ts +51 -0
  117. package/dist/context-limit.d.ts.map +1 -0
  118. package/dist/context-overflow-diagnostic.d.ts +3 -0
  119. package/dist/context-overflow-diagnostic.d.ts.map +1 -0
  120. package/dist/diff-renderer.d.ts +2 -0
  121. package/dist/diff-renderer.d.ts.map +1 -0
  122. package/dist/execute-deps.d.ts +254 -0
  123. package/dist/execute-deps.d.ts.map +1 -0
  124. package/dist/execution.d.ts +102 -0
  125. package/dist/execution.d.ts.map +1 -0
  126. package/dist/first-run-auth-gate.d.ts +18 -0
  127. package/dist/first-run-auth-gate.d.ts.map +1 -0
  128. package/dist/fleet/host.d.ts +533 -0
  129. package/dist/fleet/host.d.ts.map +1 -0
  130. package/dist/fleet/routing.d.ts +8 -0
  131. package/dist/fleet/routing.d.ts.map +1 -0
  132. package/dist/fleet/status-broadcast.d.ts +42 -0
  133. package/dist/fleet/status-broadcast.d.ts.map +1 -0
  134. package/dist/fleet/supervisor-registry.d.ts +16 -0
  135. package/dist/fleet/supervisor-registry.d.ts.map +1 -0
  136. package/dist/fleet-statusline.d.ts +71 -0
  137. package/dist/fleet-statusline.d.ts.map +1 -0
  138. package/dist/hooks-wiring.d.ts +26 -0
  139. package/dist/hooks-wiring.d.ts.map +1 -0
  140. package/dist/hq-command-controller.d.ts +52 -0
  141. package/dist/hq-command-controller.d.ts.map +1 -0
  142. package/dist/hq-dashboard-html.d.ts +2 -0
  143. package/dist/hq-dashboard-html.d.ts.map +1 -0
  144. package/dist/hq-publisher.d.ts +16 -0
  145. package/dist/hq-publisher.d.ts.map +1 -0
  146. package/dist/hq-server/auth.d.ts +37 -0
  147. package/dist/hq-server/auth.d.ts.map +1 -0
  148. package/dist/hq-server/snapshot.d.ts +14 -0
  149. package/dist/hq-server/snapshot.d.ts.map +1 -0
  150. package/dist/hq-server/types.d.ts +67 -0
  151. package/dist/hq-server/types.d.ts.map +1 -0
  152. package/dist/hq-server/utils.d.ts +63 -0
  153. package/dist/hq-server/utils.d.ts.map +1 -0
  154. package/dist/hq-server/ws.d.ts +14 -0
  155. package/dist/hq-server/ws.d.ts.map +1 -0
  156. package/dist/hq-server.d.ts +60 -0
  157. package/dist/hq-server.d.ts.map +1 -0
  158. package/dist/hq-static-serve.d.ts +26 -0
  159. package/dist/hq-static-serve.d.ts.map +1 -0
  160. package/dist/index.d.ts +3 -5
  161. package/dist/index.d.ts.map +1 -0
  162. package/dist/index.js +10474 -5429
  163. package/dist/index.js.map +7 -1
  164. package/dist/input-reader.d.ts +45 -0
  165. package/dist/input-reader.d.ts.map +1 -0
  166. package/dist/launch-hints.d.ts +46 -0
  167. package/dist/launch-hints.d.ts.map +1 -0
  168. package/dist/mailbox-bridge-bootstrap.d.ts +85 -0
  169. package/dist/mailbox-bridge-bootstrap.d.ts.map +1 -0
  170. package/dist/mcp-serve.d.ts +21 -0
  171. package/dist/mcp-serve.d.ts.map +1 -0
  172. package/dist/multi-agent.d.ts +4 -0
  173. package/dist/multi-agent.d.ts.map +1 -0
  174. package/dist/next-task-predictor.d.ts +45 -0
  175. package/dist/next-task-predictor.d.ts.map +1 -0
  176. package/dist/permission-prompt.d.ts +11 -0
  177. package/dist/permission-prompt.d.ts.map +1 -0
  178. package/dist/picker.d.ts +86 -0
  179. package/dist/picker.d.ts.map +1 -0
  180. package/dist/plugin-api-factory.d.ts +3 -0
  181. package/dist/plugin-api-factory.d.ts.map +1 -0
  182. package/dist/plugin-management.d.ts +43 -0
  183. package/dist/plugin-management.d.ts.map +1 -0
  184. package/dist/pre-launch/indexing-question.d.ts +28 -0
  185. package/dist/pre-launch/indexing-question.d.ts.map +1 -0
  186. package/dist/pre-launch/launch-prompts.d.ts +52 -0
  187. package/dist/pre-launch/launch-prompts.d.ts.map +1 -0
  188. package/dist/pre-launch/project-check.d.ts +25 -0
  189. package/dist/pre-launch/project-check.d.ts.map +1 -0
  190. package/dist/pre-launch.d.ts +4 -0
  191. package/dist/pre-launch.d.ts.map +1 -0
  192. package/dist/preflight.d.ts +58 -0
  193. package/dist/preflight.d.ts.map +1 -0
  194. package/dist/project-picker.d.ts +56 -0
  195. package/dist/project-picker.d.ts.map +1 -0
  196. package/dist/provider-config-utils.d.ts +58 -0
  197. package/dist/provider-config-utils.d.ts.map +1 -0
  198. package/dist/provider-helpers.d.ts +53 -0
  199. package/dist/provider-helpers.d.ts.map +1 -0
  200. package/dist/renderer.d.ts +76 -0
  201. package/dist/renderer.d.ts.map +1 -0
  202. package/dist/repl.d.ts +164 -0
  203. package/dist/repl.d.ts.map +1 -0
  204. package/dist/services/project-facts.d.ts +17 -0
  205. package/dist/services/project-facts.d.ts.map +1 -0
  206. package/dist/session-event-wiring.d.ts +48 -0
  207. package/dist/session-event-wiring.d.ts.map +1 -0
  208. package/dist/session-stats.d.ts +38 -0
  209. package/dist/session-stats.d.ts.map +1 -0
  210. package/dist/settings-menu.d.ts +87 -0
  211. package/dist/settings-menu.d.ts.map +1 -0
  212. package/dist/shutdown-cleanup.d.ts +44 -0
  213. package/dist/shutdown-cleanup.d.ts.map +1 -0
  214. package/dist/slash-commands/acp.d.ts +23 -0
  215. package/dist/slash-commands/acp.d.ts.map +1 -0
  216. package/dist/slash-commands/agents.d.ts +18 -0
  217. package/dist/slash-commands/agents.d.ts.map +1 -0
  218. package/dist/slash-commands/audit.d.ts +11 -0
  219. package/dist/slash-commands/audit.d.ts.map +1 -0
  220. package/dist/slash-commands/auth.d.ts +20 -0
  221. package/dist/slash-commands/auth.d.ts.map +1 -0
  222. package/dist/slash-commands/autonomy.d.ts +5 -0
  223. package/dist/slash-commands/autonomy.d.ts.map +1 -0
  224. package/dist/slash-commands/autophase.d.ts +13 -0
  225. package/dist/slash-commands/autophase.d.ts.map +1 -0
  226. package/dist/slash-commands/brain.d.ts +4 -0
  227. package/dist/slash-commands/brain.d.ts.map +1 -0
  228. package/dist/slash-commands/btw.d.ts +13 -0
  229. package/dist/slash-commands/btw.d.ts.map +1 -0
  230. package/dist/slash-commands/clear.d.ts +4 -0
  231. package/dist/slash-commands/clear.d.ts.map +1 -0
  232. package/dist/slash-commands/codebase-reindex.d.ts +11 -0
  233. package/dist/slash-commands/codebase-reindex.d.ts.map +1 -0
  234. package/dist/slash-commands/collab.d.ts +26 -0
  235. package/dist/slash-commands/collab.d.ts.map +1 -0
  236. package/dist/slash-commands/commit-llm.d.ts +41 -0
  237. package/dist/slash-commands/commit-llm.d.ts.map +1 -0
  238. package/dist/slash-commands/compact.d.ts +4 -0
  239. package/dist/slash-commands/compact.d.ts.map +1 -0
  240. package/dist/slash-commands/context.d.ts +4 -0
  241. package/dist/slash-commands/context.d.ts.map +1 -0
  242. package/dist/slash-commands/coordinator.d.ts +4 -0
  243. package/dist/slash-commands/coordinator.d.ts.map +1 -0
  244. package/dist/slash-commands/delegate.d.ts +17 -0
  245. package/dist/slash-commands/delegate.d.ts.map +1 -0
  246. package/dist/slash-commands/design.d.ts +16 -0
  247. package/dist/slash-commands/design.d.ts.map +1 -0
  248. package/dist/slash-commands/dev.d.ts +9 -0
  249. package/dist/slash-commands/dev.d.ts.map +1 -0
  250. package/dist/slash-commands/diag-stats.d.ts +5 -0
  251. package/dist/slash-commands/diag-stats.d.ts.map +1 -0
  252. package/dist/slash-commands/dispatch-llm.d.ts +12 -0
  253. package/dist/slash-commands/dispatch-llm.d.ts.map +1 -0
  254. package/dist/slash-commands/doctor.d.ts +13 -0
  255. package/dist/slash-commands/doctor.d.ts.map +1 -0
  256. package/dist/slash-commands/enhance.d.ts +13 -0
  257. package/dist/slash-commands/enhance.d.ts.map +1 -0
  258. package/dist/slash-commands/ensemble.d.ts +17 -0
  259. package/dist/slash-commands/ensemble.d.ts.map +1 -0
  260. package/dist/slash-commands/f-keys.d.ts +18 -0
  261. package/dist/slash-commands/f-keys.d.ts.map +1 -0
  262. package/dist/slash-commands/fallback.d.ts +20 -0
  263. package/dist/slash-commands/fallback.d.ts.map +1 -0
  264. package/dist/slash-commands/fix-classifier.d.ts +28 -0
  265. package/dist/slash-commands/fix-classifier.d.ts.map +1 -0
  266. package/dist/slash-commands/fix.d.ts +4 -0
  267. package/dist/slash-commands/fix.d.ts.map +1 -0
  268. package/dist/slash-commands/fleet.d.ts +20 -0
  269. package/dist/slash-commands/fleet.d.ts.map +1 -0
  270. package/dist/slash-commands/git.d.ts +16 -0
  271. package/dist/slash-commands/git.d.ts.map +1 -0
  272. package/dist/slash-commands/gitid.d.ts +22 -0
  273. package/dist/slash-commands/gitid.d.ts.map +1 -0
  274. package/dist/slash-commands/goal-refiner.d.ts +80 -0
  275. package/dist/slash-commands/goal-refiner.d.ts.map +1 -0
  276. package/dist/slash-commands/goal.d.ts +4 -0
  277. package/dist/slash-commands/goal.d.ts.map +1 -0
  278. package/dist/slash-commands/health.d.ts +4 -0
  279. package/dist/slash-commands/health.d.ts.map +1 -0
  280. package/dist/slash-commands/help.d.ts +4 -0
  281. package/dist/slash-commands/help.d.ts.map +1 -0
  282. package/dist/slash-commands/helpers.d.ts +33 -0
  283. package/dist/slash-commands/helpers.d.ts.map +1 -0
  284. package/dist/slash-commands/hq.d.ts +4 -0
  285. package/dist/slash-commands/hq.d.ts.map +1 -0
  286. package/dist/slash-commands/index.d.ts +543 -0
  287. package/dist/slash-commands/index.d.ts.map +1 -0
  288. package/dist/slash-commands/init.d.ts +4 -0
  289. package/dist/slash-commands/init.d.ts.map +1 -0
  290. package/dist/slash-commands/interrupt.d.ts +15 -0
  291. package/dist/slash-commands/interrupt.d.ts.map +1 -0
  292. package/dist/slash-commands/kanban.d.ts +4 -0
  293. package/dist/slash-commands/kanban.d.ts.map +1 -0
  294. package/dist/slash-commands/mailbox-demo.d.ts +19 -0
  295. package/dist/slash-commands/mailbox-demo.d.ts.map +1 -0
  296. package/dist/slash-commands/mailbox-serve.d.ts +20 -0
  297. package/dist/slash-commands/mailbox-serve.d.ts.map +1 -0
  298. package/dist/slash-commands/mailbox.d.ts +28 -0
  299. package/dist/slash-commands/mailbox.d.ts.map +1 -0
  300. package/dist/slash-commands/mcp-utils.d.ts +24 -0
  301. package/dist/slash-commands/mcp-utils.d.ts.map +1 -0
  302. package/dist/slash-commands/mcp.d.ts +27 -0
  303. package/dist/slash-commands/mcp.d.ts.map +1 -0
  304. package/dist/slash-commands/memory.d.ts +4 -0
  305. package/dist/slash-commands/memory.d.ts.map +1 -0
  306. package/dist/slash-commands/metrics.d.ts +4 -0
  307. package/dist/slash-commands/metrics.d.ts.map +1 -0
  308. package/dist/slash-commands/mode.d.ts +6 -0
  309. package/dist/slash-commands/mode.d.ts.map +1 -0
  310. package/dist/slash-commands/modelcaps.d.ts +4 -0
  311. package/dist/slash-commands/modelcaps.d.ts.map +1 -0
  312. package/dist/slash-commands/models.d.ts +23 -0
  313. package/dist/slash-commands/models.d.ts.map +1 -0
  314. package/dist/slash-commands/mouse.d.ts +14 -0
  315. package/dist/slash-commands/mouse.d.ts.map +1 -0
  316. package/dist/slash-commands/next.d.ts +21 -0
  317. package/dist/slash-commands/next.d.ts.map +1 -0
  318. package/dist/slash-commands/plan.d.ts +4 -0
  319. package/dist/slash-commands/plan.d.ts.map +1 -0
  320. package/dist/slash-commands/plugin.d.ts +4 -0
  321. package/dist/slash-commands/plugin.d.ts.map +1 -0
  322. package/dist/slash-commands/project-utils.d.ts +51 -0
  323. package/dist/slash-commands/project-utils.d.ts.map +1 -0
  324. package/dist/slash-commands/project.d.ts +4 -0
  325. package/dist/slash-commands/project.d.ts.map +1 -0
  326. package/dist/slash-commands/prune.d.ts +4 -0
  327. package/dist/slash-commands/prune.d.ts.map +1 -0
  328. package/dist/slash-commands/refiner.d.ts +15 -0
  329. package/dist/slash-commands/refiner.d.ts.map +1 -0
  330. package/dist/slash-commands/review.d.ts +4 -0
  331. package/dist/slash-commands/review.d.ts.map +1 -0
  332. package/dist/slash-commands/sdd/project-context.d.ts +7 -0
  333. package/dist/slash-commands/sdd/project-context.d.ts.map +1 -0
  334. package/dist/slash-commands/sdd/rendering.d.ts +2 -0
  335. package/dist/slash-commands/sdd/rendering.d.ts.map +1 -0
  336. package/dist/slash-commands/sdd/spec-detection.d.ts +21 -0
  337. package/dist/slash-commands/sdd/spec-detection.d.ts.map +1 -0
  338. package/dist/slash-commands/sdd/state.d.ts +40 -0
  339. package/dist/slash-commands/sdd/state.d.ts.map +1 -0
  340. package/dist/slash-commands/sdd/task-manager.d.ts +37 -0
  341. package/dist/slash-commands/sdd/task-manager.d.ts.map +1 -0
  342. package/dist/slash-commands/sdd.d.ts +15 -0
  343. package/dist/slash-commands/sdd.d.ts.map +1 -0
  344. package/dist/slash-commands/security.d.ts +4 -0
  345. package/dist/slash-commands/security.d.ts.map +1 -0
  346. package/dist/slash-commands/session.d.ts +7 -0
  347. package/dist/slash-commands/session.d.ts.map +1 -0
  348. package/dist/slash-commands/setmodel.d.ts +20 -0
  349. package/dist/slash-commands/setmodel.d.ts.map +1 -0
  350. package/dist/slash-commands/settings.d.ts +12 -0
  351. package/dist/slash-commands/settings.d.ts.map +1 -0
  352. package/dist/slash-commands/shadow.d.ts +28 -0
  353. package/dist/slash-commands/shadow.d.ts.map +1 -0
  354. package/dist/slash-commands/slash-deep-help.d.ts +51 -0
  355. package/dist/slash-commands/slash-deep-help.d.ts.map +1 -0
  356. package/dist/slash-commands/spawn-agents.d.ts +6 -0
  357. package/dist/slash-commands/spawn-agents.d.ts.map +1 -0
  358. package/dist/slash-commands/statusline.d.ts +67 -0
  359. package/dist/slash-commands/statusline.d.ts.map +1 -0
  360. package/dist/slash-commands/suggest.d.ts +4 -0
  361. package/dist/slash-commands/suggest.d.ts.map +1 -0
  362. package/dist/slash-commands/suggestion-store.d.ts +29 -0
  363. package/dist/slash-commands/suggestion-store.d.ts.map +1 -0
  364. package/dist/slash-commands/supervisor.d.ts +18 -0
  365. package/dist/slash-commands/supervisor.d.ts.map +1 -0
  366. package/dist/slash-commands/surfaces.d.ts +4 -0
  367. package/dist/slash-commands/surfaces.d.ts.map +1 -0
  368. package/dist/slash-commands/tasks.d.ts +4 -0
  369. package/dist/slash-commands/tasks.d.ts.map +1 -0
  370. package/dist/slash-commands/techstack.d.ts +4 -0
  371. package/dist/slash-commands/techstack.d.ts.map +1 -0
  372. package/dist/slash-commands/telegram-settings.d.ts +4 -0
  373. package/dist/slash-commands/telegram-settings.d.ts.map +1 -0
  374. package/dist/slash-commands/telegram-setup.d.ts +11 -0
  375. package/dist/slash-commands/telegram-setup.d.ts.map +1 -0
  376. package/dist/slash-commands/todos.d.ts +4 -0
  377. package/dist/slash-commands/todos.d.ts.map +1 -0
  378. package/dist/slash-commands/tool.d.ts +4 -0
  379. package/dist/slash-commands/tool.d.ts.map +1 -0
  380. package/dist/slash-commands/tools.d.ts +4 -0
  381. package/dist/slash-commands/tools.d.ts.map +1 -0
  382. package/dist/slash-commands/tuneup.d.ts +15 -0
  383. package/dist/slash-commands/tuneup.d.ts.map +1 -0
  384. package/dist/slash-commands/working-dir.d.ts +14 -0
  385. package/dist/slash-commands/working-dir.d.ts.map +1 -0
  386. package/dist/slash-commands/worktree.d.ts +8 -0
  387. package/dist/slash-commands/worktree.d.ts.map +1 -0
  388. package/dist/slash-commands/yolo.d.ts +4 -0
  389. package/dist/slash-commands/yolo.d.ts.map +1 -0
  390. package/dist/spinner.d.ts +44 -0
  391. package/dist/spinner.d.ts.map +1 -0
  392. package/dist/subcommands/handlers/acp.d.ts +15 -0
  393. package/dist/subcommands/handlers/acp.d.ts.map +1 -0
  394. package/dist/subcommands/handlers/audit.d.ts +12 -0
  395. package/dist/subcommands/handlers/audit.d.ts.map +1 -0
  396. package/dist/subcommands/handlers/auth-local-help.d.ts +69 -0
  397. package/dist/subcommands/handlers/auth-local-help.d.ts.map +1 -0
  398. package/dist/subcommands/handlers/auth.d.ts +3 -0
  399. package/dist/subcommands/handlers/auth.d.ts.map +1 -0
  400. package/dist/subcommands/handlers/bench-run-help.d.ts +145 -0
  401. package/dist/subcommands/handlers/bench-run-help.d.ts.map +1 -0
  402. package/dist/subcommands/handlers/bench.d.ts +13 -0
  403. package/dist/subcommands/handlers/bench.d.ts.map +1 -0
  404. package/dist/subcommands/handlers/config-history.d.ts +10 -0
  405. package/dist/subcommands/handlers/config-history.d.ts.map +1 -0
  406. package/dist/subcommands/handlers/diag-doctor.d.ts +4 -0
  407. package/dist/subcommands/handlers/diag-doctor.d.ts.map +1 -0
  408. package/dist/subcommands/handlers/export.d.ts +3 -0
  409. package/dist/subcommands/handlers/export.d.ts.map +1 -0
  410. package/dist/subcommands/handlers/helpers.d.ts +2 -0
  411. package/dist/subcommands/handlers/helpers.d.ts.map +1 -0
  412. package/dist/subcommands/handlers/hq.d.ts +3 -0
  413. package/dist/subcommands/handlers/hq.d.ts.map +1 -0
  414. package/dist/subcommands/handlers/init.d.ts +7 -0
  415. package/dist/subcommands/handlers/init.d.ts.map +1 -0
  416. package/dist/subcommands/handlers/mailbox-serve.d.ts +3 -0
  417. package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -0
  418. package/dist/subcommands/handlers/mcp.d.ts +3 -0
  419. package/dist/subcommands/handlers/mcp.d.ts.map +1 -0
  420. package/dist/subcommands/handlers/modeldiag.d.ts +3 -0
  421. package/dist/subcommands/handlers/modeldiag.d.ts.map +1 -0
  422. package/dist/subcommands/handlers/models-add-help.d.ts +142 -0
  423. package/dist/subcommands/handlers/models-add-help.d.ts.map +1 -0
  424. package/dist/subcommands/handlers/per-subcommand-help.d.ts +136 -0
  425. package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +1 -0
  426. package/dist/subcommands/handlers/plugin-usage.d.ts +4 -0
  427. package/dist/subcommands/handlers/plugin-usage.d.ts.map +1 -0
  428. package/dist/subcommands/handlers/projects.d.ts +3 -0
  429. package/dist/subcommands/handlers/projects.d.ts.map +1 -0
  430. package/dist/subcommands/handlers/providers-models.d.ts +4 -0
  431. package/dist/subcommands/handlers/providers-models.d.ts.map +1 -0
  432. package/dist/subcommands/handlers/quick.d.ts +14 -0
  433. package/dist/subcommands/handlers/quick.d.ts.map +1 -0
  434. package/dist/subcommands/handlers/replay.d.ts +12 -0
  435. package/dist/subcommands/handlers/replay.d.ts.map +1 -0
  436. package/dist/subcommands/handlers/rewind.d.ts +3 -0
  437. package/dist/subcommands/handlers/rewind.d.ts.map +1 -0
  438. package/dist/subcommands/handlers/sessions-config.d.ts +4 -0
  439. package/dist/subcommands/handlers/sessions-config.d.ts.map +1 -0
  440. package/dist/subcommands/handlers/sessions-fleet.d.ts +15 -0
  441. package/dist/subcommands/handlers/sessions-fleet.d.ts.map +1 -0
  442. package/dist/subcommands/handlers/tools-skills.d.ts +4 -0
  443. package/dist/subcommands/handlers/tools-skills.d.ts.map +1 -0
  444. package/dist/subcommands/handlers/update.d.ts +7 -0
  445. package/dist/subcommands/handlers/update.d.ts.map +1 -0
  446. package/dist/subcommands/handlers/version-help.d.ts +4 -0
  447. package/dist/subcommands/handlers/version-help.d.ts.map +1 -0
  448. package/dist/subcommands/index.d.ts +26 -0
  449. package/dist/subcommands/index.d.ts.map +1 -0
  450. package/dist/theme.d.ts +12 -0
  451. package/dist/theme.d.ts.map +1 -0
  452. package/dist/tui-thinking-word.d.ts +5 -0
  453. package/dist/tui-thinking-word.d.ts.map +1 -0
  454. package/dist/tuneup.d.ts +162 -0
  455. package/dist/tuneup.d.ts.map +1 -0
  456. package/dist/update-check.d.ts +22 -0
  457. package/dist/update-check.d.ts.map +1 -0
  458. package/dist/utils/delay-format.d.ts +5 -0
  459. package/dist/utils/delay-format.d.ts.map +1 -0
  460. package/dist/utils/win32-cmd.d.ts +7 -0
  461. package/dist/utils/win32-cmd.d.ts.map +1 -0
  462. package/dist/utils.d.ts +58 -0
  463. package/dist/utils.d.ts.map +1 -0
  464. package/dist/version.d.ts +4 -0
  465. package/dist/version.d.ts.map +1 -0
  466. package/dist/webui-server/client-registration.d.ts +41 -0
  467. package/dist/webui-server/client-registration.d.ts.map +1 -0
  468. package/dist/webui-server/connection-handler.d.ts +59 -0
  469. package/dist/webui-server/connection-handler.d.ts.map +1 -0
  470. package/dist/webui-server/context-breakdown.d.ts +57 -0
  471. package/dist/webui-server/context-breakdown.d.ts.map +1 -0
  472. package/dist/webui-server/cost-helpers.d.ts +29 -0
  473. package/dist/webui-server/cost-helpers.d.ts.map +1 -0
  474. package/dist/webui-server/lifecycle.d.ts +108 -0
  475. package/dist/webui-server/lifecycle.d.ts.map +1 -0
  476. package/dist/webui-server/logger-shim.d.ts +10 -0
  477. package/dist/webui-server/logger-shim.d.ts.map +1 -0
  478. package/dist/webui-server/message-router.d.ts +39 -0
  479. package/dist/webui-server/message-router.d.ts.map +1 -0
  480. package/dist/webui-server/prefs-seeding.d.ts +57 -0
  481. package/dist/webui-server/prefs-seeding.d.ts.map +1 -0
  482. package/dist/webui-server/provider-config.d.ts +61 -0
  483. package/dist/webui-server/provider-config.d.ts.map +1 -0
  484. package/dist/webui-server/session-start-payload.d.ts +20 -0
  485. package/dist/webui-server/session-start-payload.d.ts.map +1 -0
  486. package/dist/webui-server/session-status-poll.d.ts +14 -0
  487. package/dist/webui-server/session-status-poll.d.ts.map +1 -0
  488. package/dist/webui-server/setup-events.d.ts +45 -0
  489. package/dist/webui-server/setup-events.d.ts.map +1 -0
  490. package/dist/webui-server/static-serve.d.ts +70 -0
  491. package/dist/webui-server/static-serve.d.ts.map +1 -0
  492. package/dist/webui-server/stream-coalescer.d.ts +41 -0
  493. package/dist/webui-server/stream-coalescer.d.ts.map +1 -0
  494. package/dist/webui-server/ws-handlers/agent-config.d.ts +47 -0
  495. package/dist/webui-server/ws-handlers/agent-config.d.ts.map +1 -0
  496. package/dist/webui-server/ws-handlers/brain.d.ts +43 -0
  497. package/dist/webui-server/ws-handlers/brain.d.ts.map +1 -0
  498. package/dist/webui-server/ws-handlers/connection.d.ts +57 -0
  499. package/dist/webui-server/ws-handlers/connection.d.ts.map +1 -0
  500. package/dist/webui-server/ws-handlers/context.d.ts +55 -0
  501. package/dist/webui-server/ws-handlers/context.d.ts.map +1 -0
  502. package/dist/webui-server/ws-handlers/index.d.ts +60 -0
  503. package/dist/webui-server/ws-handlers/index.d.ts.map +1 -0
  504. package/dist/webui-server/ws-handlers/introspection.d.ts +35 -0
  505. package/dist/webui-server/ws-handlers/introspection.d.ts.map +1 -0
  506. package/dist/webui-server/ws-handlers/kanban.d.ts +41 -0
  507. package/dist/webui-server/ws-handlers/kanban.d.ts.map +1 -0
  508. package/dist/webui-server/ws-handlers/mailbox.d.ts +60 -0
  509. package/dist/webui-server/ws-handlers/mailbox.d.ts.map +1 -0
  510. package/dist/webui-server/ws-handlers/oauth.d.ts +16 -0
  511. package/dist/webui-server/ws-handlers/oauth.d.ts.map +1 -0
  512. package/dist/webui-server/ws-handlers/prefs.d.ts +32 -0
  513. package/dist/webui-server/ws-handlers/prefs.d.ts.map +1 -0
  514. package/dist/webui-server/ws-handlers/process.d.ts +6 -0
  515. package/dist/webui-server/ws-handlers/process.d.ts.map +1 -0
  516. package/dist/webui-server/ws-handlers/projects.d.ts +44 -0
  517. package/dist/webui-server/ws-handlers/projects.d.ts.map +1 -0
  518. package/dist/webui-server/ws-handlers/providers.d.ts +36 -0
  519. package/dist/webui-server/ws-handlers/providers.d.ts.map +1 -0
  520. package/dist/webui-server/ws-handlers/sessions.d.ts +38 -0
  521. package/dist/webui-server/ws-handlers/sessions.d.ts.map +1 -0
  522. package/dist/webui-server/ws-handlers/worklist.d.ts +49 -0
  523. package/dist/webui-server/ws-handlers/worklist.d.ts.map +1 -0
  524. package/dist/webui-server.d.ts +165 -0
  525. package/dist/webui-server.d.ts.map +1 -0
  526. package/dist/wiring/brain-and-orchestration.d.ts +81 -0
  527. package/dist/wiring/brain-and-orchestration.d.ts.map +1 -0
  528. package/dist/wiring/codebase-index.d.ts +33 -0
  529. package/dist/wiring/codebase-index.d.ts.map +1 -0
  530. package/dist/wiring/controllers.d.ts +51 -0
  531. package/dist/wiring/controllers.d.ts.map +1 -0
  532. package/dist/wiring/dep-watcher.d.ts +23 -0
  533. package/dist/wiring/dep-watcher.d.ts.map +1 -0
  534. package/dist/wiring/design-studio.d.ts +17 -0
  535. package/dist/wiring/design-studio.d.ts.map +1 -0
  536. package/dist/wiring/director-setup.d.ts +51 -0
  537. package/dist/wiring/director-setup.d.ts.map +1 -0
  538. package/dist/wiring/hq-telemetry.d.ts +44 -0
  539. package/dist/wiring/hq-telemetry.d.ts.map +1 -0
  540. package/dist/wiring/lifecycle-plugins.d.ts +61 -0
  541. package/dist/wiring/lifecycle-plugins.d.ts.map +1 -0
  542. package/dist/wiring/mailbox-bridge-bootstrap.d.ts +53 -0
  543. package/dist/wiring/mailbox-bridge-bootstrap.d.ts.map +1 -0
  544. package/dist/wiring/metrics.d.ts +40 -0
  545. package/dist/wiring/metrics.d.ts.map +1 -0
  546. package/dist/wiring/pipeline.d.ts +96 -0
  547. package/dist/wiring/pipeline.d.ts.map +1 -0
  548. package/dist/wiring/plugins.d.ts +109 -0
  549. package/dist/wiring/plugins.d.ts.map +1 -0
  550. package/dist/wiring/provider-runtime-setup.d.ts +47 -0
  551. package/dist/wiring/provider-runtime-setup.d.ts.map +1 -0
  552. package/dist/wiring/provider-runtime.d.ts +57 -0
  553. package/dist/wiring/provider-runtime.d.ts.map +1 -0
  554. package/dist/wiring/provider.d.ts +13 -0
  555. package/dist/wiring/provider.d.ts.map +1 -0
  556. package/dist/wiring/replay.d.ts +32 -0
  557. package/dist/wiring/replay.d.ts.map +1 -0
  558. package/dist/wiring/session.d.ts +58 -0
  559. package/dist/wiring/session.d.ts.map +1 -0
  560. package/dist/wiring/slash-commands.d.ts +76 -0
  561. package/dist/wiring/slash-commands.d.ts.map +1 -0
  562. package/dist/wiring/super-memory.d.ts +9 -0
  563. package/dist/wiring/super-memory.d.ts.map +1 -0
  564. package/dist/wiring/to-execute-deps.d.ts +11 -0
  565. package/dist/wiring/to-execute-deps.d.ts.map +1 -0
  566. package/dist/wiring/tools.d.ts +41 -0
  567. package/dist/wiring/tools.d.ts.map +1 -0
  568. package/package.json +20 -20
@@ -0,0 +1,108 @@
1
+ import { type WebUIInstanceRecord } from '@wrongstack/webui/server';
2
+ /**
3
+ * PR 7 of Issue #30 (webui-server 8-PR refactor): process lifecycle.
4
+ *
5
+ * Three concerns pulled out of the ~3000-line `runWebUI` body:
6
+ *
7
+ * - `registerWebuiInstance` — record this embedded WebUI in the shared
8
+ * running-instance registry (so `wstackui --list` sees it).
9
+ * - `announceWebuiReady` — log the ready banner and pop the browser
10
+ * once the HTTP server is listening.
11
+ * - `createWebuiShutdown` + `registerWebuiSignalHandlers` — the
12
+ * SIGINT/SIGTERM teardown sequence.
13
+ *
14
+ * Each external dependency (registry IO, browser launch) is an
15
+ * injectable seam so the orchestration can be unit-tested without
16
+ * touching disk or spawning a browser. Run-loop state (abort
17
+ * controllers, client map, the run promise's `resolve`) stays in
18
+ * `webui-server.ts` and is threaded in as callbacks — the module never
19
+ * captures it.
20
+ */
21
+ export interface RegisterWebuiInstanceParams {
22
+ pid: number;
23
+ host: string;
24
+ httpPort: number;
25
+ wsPort: number;
26
+ /** Browser-facing public URL when served through a tunnel/proxy. */
27
+ publicUrl?: string | undefined;
28
+ projectRoot: string;
29
+ /** ISO timestamp when the instance registered. */
30
+ startedAt: string;
31
+ /** Registry base dir (dirname of globalConfigPath); undefined ⇒ registry default. */
32
+ registryBaseDir: string | undefined;
33
+ }
34
+ export interface RegisterWebuiInstanceDeps {
35
+ registerFn?: (record: WebUIInstanceRecord, baseDir?: string) => Promise<void>;
36
+ }
37
+ /**
38
+ * Fire-and-forget registration of this WebUI in the running-instance
39
+ * registry. Best-effort: a registry write error never blocks startup and
40
+ * is swallowed (the registry is a convenience index, not a source of
41
+ * truth). Caller guards on `projectRoot` being known.
42
+ */
43
+ export declare function registerWebuiInstance(p: RegisterWebuiInstanceParams, deps?: RegisterWebuiInstanceDeps): void;
44
+ export interface AnnounceWebuiReadyParams {
45
+ /** The HTTP server (StaticServeHandle.server). */
46
+ server: {
47
+ on: (event: 'listening', cb: () => void) => void;
48
+ };
49
+ host: string;
50
+ httpPort: number;
51
+ wsPort: number;
52
+ open: boolean;
53
+ /** Auth token for WS connections. Included in the URL so the frontend can exchange it for an HttpOnly cookie via /ws-auth. */
54
+ wsToken?: string;
55
+ /** Browser-facing public URL when served through a tunnel/proxy. */
56
+ publicUrl?: string | undefined;
57
+ log?: (msg: string) => void;
58
+ openBrowserFn?: (url: string) => void;
59
+ }
60
+ /**
61
+ * Once the HTTP server is listening, print the ready banner and (if
62
+ * `open`) launch the browser at the served URL.
63
+ */
64
+ export declare function announceWebuiReady(p: AnnounceWebuiReadyParams): void;
65
+ export interface WebuiShutdownResources {
66
+ /** Abort every in-flight run (legacy single slot + per-socket controllers) and clear them. */
67
+ abortInFlight: () => void;
68
+ /** Run and drop every event-bus unsubscriber. */
69
+ unsubscribeEvents: () => void;
70
+ /** Close every connected socket and clear the client map. */
71
+ closeClients: () => void;
72
+ /** Close the static HTTP server (no-op when WS-only). */
73
+ closeHttpServer: () => void;
74
+ /** The WebSocket server to stop (its close callback resolves the run promise). */
75
+ wss: {
76
+ close: (cb?: () => void) => void;
77
+ };
78
+ /** This process's pid — the registry liveness key. */
79
+ pid: number;
80
+ /** Registry base dir (undefined ⇒ registry default). */
81
+ registryBaseDir: string | undefined;
82
+ /** Called once teardown settles — wired to the run promise's `resolve`. */
83
+ onStopped: () => void;
84
+ log?: (msg: string) => void;
85
+ debug?: (msg: string) => void;
86
+ /** Injectable for tests; defaults to the real registry unregister. */
87
+ unregisterFn?: (pid: number, baseDir?: string) => Promise<void>;
88
+ }
89
+ /**
90
+ * Build the SIGINT/SIGTERM teardown handler. The returned function is
91
+ * idempotent: the first call runs the teardown, later calls (e.g. a
92
+ * second Ctrl+C, or a signal after another server in the same process
93
+ * already stopped) return immediately.
94
+ *
95
+ * Order matches the original inline handler: abort runs → unsubscribe
96
+ * events → close clients → unregister from the instance registry (async,
97
+ * awaited inside the wss.close callback) → close HTTP → close WS → on
98
+ * close, once the unregister settles, `onStopped()`.
99
+ */
100
+ export declare function createWebuiShutdown(res: WebuiShutdownResources): () => void;
101
+ /**
102
+ * Register `shutdown` on SIGINT and SIGTERM. The wrapper self-detaches
103
+ * both listeners on first fire (so a server that has already shut down
104
+ * can't re-trigger teardown). Returns an unregister function for tests
105
+ * and clean restarts.
106
+ */
107
+ export declare function registerWebuiSignalHandlers(shutdown: () => void): () => void;
108
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/webui-server/lifecycle.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;;;;;;;;;;GAkBG;AAIH,MAAM,WAAW,2BAA2B;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,EAAE,2BAA2B,EAC9B,IAAI,GAAE,yBAA8B,GACnC,IAAI,CAmBN;AAID,MAAM,WAAW,wBAAwB;IACvC,kDAAkD;IAClD,MAAM,EAAE;QAAE,EAAE,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAA;KAAE,CAAC;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,8HAA8H;IAC9H,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAmBpE;AAID,MAAM,WAAW,sBAAsB;IACrC,8FAA8F;IAC9F,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,iDAAiD;IACjD,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,6DAA6D;IAC7D,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,yDAAyD;IACzD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,kFAAkF;IAClF,GAAG,EAAE;QAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAA;KAAE,CAAC;IAC1C,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,2EAA2E;IAC3E,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,sEAAsE;IACtE,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,sBAAsB,GAAG,MAAM,IAAI,CA2B3E;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAY5E"}
@@ -0,0 +1,10 @@
1
+ import type { Logger } from '@wrongstack/core';
2
+ /**
3
+ * Console-backed `Logger` adapter for the CLI. Routes each
4
+ * level to the matching `console.*` method and wraps the
5
+ * message in a structured JSON line. The `child()` method
6
+ * returns the same logger — the CLI shim does not maintain
7
+ * a binding chain.
8
+ */
9
+ export declare const consoleLogger: Logger;
10
+ //# sourceMappingURL=logger-shim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger-shim.d.ts","sourceRoot":"","sources":["../../src/webui-server/logger-shim.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAiB/C;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,MAoB3B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { AutoPhaseWebSocketHandler, DesignContext, PromptsContext, SddBoardWebSocketHandler, SddWizardWebSocketHandler, SkillsContext, SpecsWebSocketHandler, TerminalWebSocketHandler, WorktreeWebSocketHandler } from '@wrongstack/webui/server';
2
+ import type { WebSocket } from 'ws';
3
+ import type { CliWebUIOptions, WSClientMessage, WSServerMessage } from '../webui-server.js';
4
+ import type { ConnectedClient } from './connection-handler.js';
5
+ import type { AgentConfigContext, BrainHandlerContext, ConnectionContext, ContextHandlerContext, IntrospectionContext, MailboxContext, PrefsContext, ProjectsContext, SessionsContext, WorklistContext, WsCommon, WsHandlerContext } from './ws-handlers/index.js';
6
+ export interface MessageRouterDeps {
7
+ opts: CliWebUIOptions;
8
+ send: (ws: WebSocket, msg: WSServerMessage) => void;
9
+ sendResult: (ws: WebSocket, success: boolean, message: string) => void;
10
+ sessionPayload: <T extends Record<string, unknown>>(payload: T) => T & {
11
+ sessionId: string;
12
+ };
13
+ currentSessionId: () => string;
14
+ shutdown: () => void;
15
+ wsHandlerCtx: WsHandlerContext;
16
+ brainCtx: BrainHandlerContext;
17
+ introspectionCtx: IntrospectionContext;
18
+ skillsCtx: SkillsContext;
19
+ promptsCtx: PromptsContext;
20
+ designCtx: DesignContext;
21
+ worklistCtx: WorklistContext;
22
+ agentConfigCtx: AgentConfigContext;
23
+ prefsCtx: PrefsContext;
24
+ projectsCtx: ProjectsContext;
25
+ contextHandlerCtx: ContextHandlerContext;
26
+ wsCommon: WsCommon;
27
+ mailboxCtx: MailboxContext;
28
+ sessionsCtx: SessionsContext;
29
+ connectionCtx: ConnectionContext;
30
+ autoPhaseHandler: AutoPhaseWebSocketHandler;
31
+ specsHandler: SpecsWebSocketHandler;
32
+ sddBoardHandler: SddBoardWebSocketHandler;
33
+ sddWizardHandler: SddWizardWebSocketHandler | null;
34
+ worktreeHandler: WorktreeWebSocketHandler;
35
+ terminalHandler: TerminalWebSocketHandler;
36
+ }
37
+ export type MessageRouter = (ws: WebSocket, client: ConnectedClient, msg: WSClientMessage) => Promise<void>;
38
+ export declare function createMessageRouter(deps: MessageRouterDeps): MessageRouter;
39
+ //# sourceMappingURL=message-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-router.d.ts","sourceRoot":"","sources":["../../src/webui-server/message-router.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAkDlC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,QAAQ,EACR,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAkFhC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,UAAU,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvE,cAAc,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7F,gBAAgB,EAAE,MAAM,MAAM,CAAC;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,eAAe,CAAC;IAC7B,cAAc,EAAE,kBAAkB,CAAC;IACnC,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,eAAe,CAAC;IAC7B,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,cAAc,CAAC;IAC3B,WAAW,EAAE,eAAe,CAAC;IAC7B,aAAa,EAAE,iBAAiB,CAAC;IAEjC,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,YAAY,EAAE,qBAAqB,CAAC;IACpC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,gBAAgB,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACnD,eAAe,EAAE,wBAAwB,CAAC;IAC1C,eAAe,EAAE,wBAAwB,CAAC;CAC3C;AAED,MAAM,MAAM,aAAa,GAAG,CAC1B,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,eAAe,KACjB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAunB1E"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Preference key list, snapshot, persistence, and config-seeding.
3
+ *
4
+ * ## What lives here
5
+ *
6
+ * - `PREF_KEYS` – the canonical list of browser-setting ↔ config-file keys.
7
+ * - `createPrefsSeeding` – factory that returns `{ prefSnapshot, persistPrefs }`
8
+ * with file I/O captured in closure.
9
+ * - `seedConfigToMeta` – one-time call at startup: reads config.json and seeds
10
+ * `agent.ctx.meta` so the settings panel shows the real
11
+ * persisted values instead of localStorage defaults.
12
+ *
13
+ * ## Extraction history
14
+ *
15
+ * PR 9 of Issue #30 – extracted from webui-server.ts (was inline between the
16
+ * `PREF_KEYS` array and the `PrefsContext` construction).
17
+ */
18
+ import type { Config } from '@wrongstack/core';
19
+ interface CliWebUIOptions {
20
+ agent: {
21
+ ctx: {
22
+ meta: Record<string, unknown>;
23
+ };
24
+ };
25
+ globalConfigPath?: string | undefined;
26
+ appConfig?: {
27
+ fallbackModels?: string[] | undefined;
28
+ fallbackProfiles?: Record<string, string[]> | undefined;
29
+ favoriteModels?: string[] | undefined;
30
+ favoriteModelsOnly?: boolean | undefined;
31
+ fallbackAuto?: boolean | undefined;
32
+ modelMatrix?: Config['modelMatrix'] | undefined;
33
+ uiLocale?: string | undefined;
34
+ } | undefined;
35
+ }
36
+ /** Keys synced between `agent.ctx.meta` and `config.json`. */
37
+ export declare const PREF_KEYS: readonly ['autonomy', 'autonomyDelayMs', 'autoProceedMaxIterations', 'yolo', 'maxIterations', 'chime', 'confirmExit', 'streamFleet', 'nextPrediction', 'fallbackModels', 'fallbackProfiles', 'favoriteModels', 'favoriteModelsOnly', 'modelMatrix', 'fallbackAuto', 'uiLocale', 'enhanceEnabled', 'enhanceDelayMs', 'enhanceLanguage', 'featureMcp', 'featurePlugins', 'featureMemory', 'featureSkills', 'featureModelsRegistry', 'indexOnStart', 'contextAutoCompact', 'contextStrategy', 'contextMode', 'tokenSavingTier', 'maxConcurrent', 'titleAnimation', 'reasoningMode', 'reasoningEffort', 'reasoningPreserve', 'cacheTtl', 'logLevel', 'auditLevel', 'hqEnabled', 'hqUrl', 'hqToken', 'hqRawContent', 'refinerProvider', 'refinerModel', 'thinkingWord', 'statuslineMode', 'animationStyle', 'tgConfigured', 'tgSessionEnd', 'tgDelegate', 'tgLongToolMs', 'breakerEnabled', 'breakerAutoKillResetMs', 'fsAccess', 'debugStream'];
38
+ type PrefSnapshot = Record<string, unknown>;
39
+ /**
40
+ * One-time startup seed: reads `globalConfigPath` and copies recognised fields
41
+ * into `agent.ctx.meta` so the browser settings panel starts with the real
42
+ * persisted values instead of blank/undefined.
43
+ *
44
+ * Best-effort – missing or corrupt config leaves prefs unseeded.
45
+ */
46
+ export declare function seedConfigToMeta(opts: CliWebUIOptions): Promise<void>;
47
+ interface PrefsSeeding {
48
+ prefSnapshot: () => PrefSnapshot;
49
+ persistPrefs: (payload: PrefSnapshot) => Promise<void>;
50
+ }
51
+ /**
52
+ * Factory – returns `prefSnapshot` and `persistPrefs` with file I/O captured
53
+ * in closure. Call once per `runWebUI` instance.
54
+ */
55
+ export declare function createPrefsSeeding(opts: CliWebUIOptions): PrefsSeeding;
56
+ export {};
57
+ //# sourceMappingURL=prefs-seeding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefs-seeding.d.ts","sourceRoot":"","sources":["../../src/webui-server/prefs-seeding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK/C,UAAU,eAAe;IACvB,KAAK,EAAE;QAAE,GAAG,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;IAClD,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE;QACV,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;QACxD,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACtC,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACzC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACnC,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;QAChD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC/B,GAAG,SAAS,CAAC;CACf;AAWD,8DAA8D;AAC9D,eAAO,MAAM,SAAS,YACpB,UAAU,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,MAAM,EACN,eAAe,EACf,OAAO,EACP,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAIhB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,EACP,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAEhB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EAEd,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACV,aAAa,CACL,CAAC;AAIX,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAI5C;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsG3E;AAID,UAAU,YAAY;IACpB,YAAY,EAAE,MAAM,YAAY,CAAC;IACjC,YAAY,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,YAAY,CA2RtE"}
@@ -0,0 +1,61 @@
1
+ import { DefaultSecretVault } from '@wrongstack/core/security';
2
+ import type { ProviderConfig } from '@wrongstack/core/types';
3
+ export { expectDefined, maskedKey, normalizeKeys, nowIso, writeKeysBack, } from '../provider-config-utils.js';
4
+ /**
5
+ * PR 4 of Issue #30 (webui-server 8-PR refactor):
6
+ * provider-config IO.
7
+ *
8
+ * Before this PR, the two helpers below were inlined
9
+ * at the bottom of `webui-server.ts` as closure-captured
10
+ * helpers that read `opts.globalConfigPath` from the
11
+ * surrounding `runWebUI` scope. The helpers themselves
12
+ * are pure: given a config path and a vault, they
13
+ * load or save the providers map. The `globalConfigPath`
14
+ * closure capture is what made them untestable in
15
+ * isolation.
16
+ *
17
+ * After this PR, the helpers live in their own module
18
+ * with explicit parameters. `runWebUI` is the only
19
+ * caller; it now constructs the helpers at the call
20
+ * site or threads `globalConfigPath` through a thin
21
+ * adapter.
22
+ *
23
+ * Note: `writeKeysBack` and `normalizeKeys` (used by
24
+ * the per-handler key ops) are *already* imported from
25
+ * `@wrongstack/webui/server`. This PR does not move
26
+ * them — they were never inlined in `webui-server.ts`.
27
+ * Per the plan body's update after PR #51, they are
28
+ * not part of this extraction.
29
+ */
30
+ export declare function getVault(globalConfigPath: string | undefined): DefaultSecretVault;
31
+ export declare function loadSavedProviders(globalConfigPath: string | undefined): Promise<Record<string, ProviderConfig>>;
32
+ export declare function saveProviders(globalConfigPath: string | undefined, providers: Record<string, ProviderConfig>): Promise<void>;
33
+ /**
34
+ * A provider-config store bound to one `globalConfigPath`.
35
+ *
36
+ * PR 4 follow-up of Issue #30: the provider ws-handlers used to take a
37
+ * raw `globalConfigPath` and call `loadSavedProviders`/`saveProviders`
38
+ * with it on every operation. Binding the path once into a small
39
+ * `load`/`save` object (mirrors the standalone server's
40
+ * `createProviderConfigIO`) removes the repeated path threading and
41
+ * gives callers a single dependency to mock.
42
+ */
43
+ export interface ProviderConfigStore {
44
+ load(): Promise<Record<string, ProviderConfig>>;
45
+ save(providers: Record<string, ProviderConfig>): Promise<void>;
46
+ }
47
+ /**
48
+ * Build a {@link ProviderConfigStore} for `globalConfigPath`. When the
49
+ * path is undefined the store is a no-op (load ⇒ `{}`, save ⇒ nothing),
50
+ * matching the underlying helpers' behaviour.
51
+ *
52
+ * @param configProvidersRef Optional callback that returns the in-memory
53
+ * merged `config.providers` map (from the boot config loader which merges
54
+ * global + project-local configs). When provided, `load()` returns from
55
+ * this ref instead of re-reading the single global config file on disk.
56
+ * This prevents a mismatch where providers stored in the project-local
57
+ * config (`config.local.json`) are visible to the agent but invisible
58
+ * to the WebUI's saved-providers panel.
59
+ */
60
+ export declare function createProviderConfigStore(globalConfigPath: string | undefined, configProvidersRef?: () => Record<string, ProviderConfig>): ProviderConfigStore;
61
+ //# sourceMappingURL=provider-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-config.d.ts","sourceRoot":"","sources":["../../src/webui-server/provider-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAU7D,OAAO,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,EACN,aAAa,GACd,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,wBAAgB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAAG,kBAAkB,CAGjF;AAED,wBAAsB,kBAAkB,CACtC,gBAAgB,EAAE,MAAM,GAAG,SAAS,GACnC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAGzC;AAED,wBAAsB,aAAa,CACjC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,kBAAkB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACxD,mBAAmB,CAQrB"}
@@ -0,0 +1,20 @@
1
+ import type { Context, ModelsRegistry } from '@wrongstack/core';
2
+ /** The slice of `CliWebUIOptions` the payload builder actually reads. */
3
+ export interface SessionStartPayloadDeps {
4
+ agent: {
5
+ ctx: Context;
6
+ };
7
+ session: {
8
+ id: string;
9
+ };
10
+ modelsRegistry?: ModelsRegistry | undefined;
11
+ modeId?: string | undefined;
12
+ projectRoot?: string | undefined;
13
+ }
14
+ export type BuildSessionStartPayload = (overrides?: Record<string, unknown>, needsSetup?: boolean) => Promise<Record<string, unknown>>;
15
+ /**
16
+ * Callers pass optional overrides for fields that vary per context
17
+ * (reset, mode, replayMessages, etc.).
18
+ */
19
+ export declare function createSessionStartPayloadBuilder(deps: SessionStartPayloadDeps): BuildSessionStartPayload;
20
+ //# sourceMappingURL=session-start-payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-start-payload.d.ts","sourceRoot":"","sources":["../../src/webui-server/session-start-payload.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGhE,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE,CAAC;IACxB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,UAAU,CAAC,EAAE,OAAO,KACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtC;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,uBAAuB,GAC5B,wBAAwB,CAoD1B"}
@@ -0,0 +1,14 @@
1
+ export interface SessionStatusPollDeps {
2
+ /** Directory holding session-registry.json (the wstack global root). */
3
+ globalRoot: string;
4
+ broadcast: (msg: {
5
+ type: string;
6
+ payload: unknown;
7
+ }) => void;
8
+ /** Shared disposer list — poll interval + fs watcher land here. */
9
+ eventUnsubscribers: Array<() => void>;
10
+ /** Receives the broadcaster so `/api/fleet/ping` can push-on-write. */
11
+ onBroadcastReady: (fn: () => Promise<void>) => void;
12
+ }
13
+ export declare function startSessionStatusPoll(deps: SessionStatusPollDeps): void;
14
+ //# sourceMappingURL=session-status-poll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-status-poll.d.ts","sourceRoot":"","sources":["../../src/webui-server/session-status-poll.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,mEAAmE;IACnE,kBAAkB,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IACtC,uEAAuE;IACvE,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CA4ExE"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Event arming for the CLI WebUI bridge — every EventBus subscription that
3
+ * fans agent/fleet/tool/mailbox/brain activity out to connected browsers.
4
+ *
5
+ * `createSetupEvents(deps)` returns the `setupEvents()` function the server
6
+ * calls on `listening` (and again after a project switch): it clears the
7
+ * shared `eventUnsubscribers` list and re-arms every subscription, pushing
8
+ * each disposer back onto that list so teardown/re-arm stays centralized in
9
+ * the caller. Fleet-concurrency gauge state lives here too — it is only ever
10
+ * read and mutated by these subscriptions.
11
+ *
12
+ * PR 12 of Issue #30: extracted from `webui-server.ts`.
13
+ */
14
+ import type { Context, EventBus, JournalEntry, SecretScrubber } from '@wrongstack/core';
15
+ import { createEternalSubscription } from '@wrongstack/webui/server';
16
+ import type { StreamCoalescer } from './stream-coalescer.js';
17
+ import type { PendingConfirm } from './ws-handlers/index.js';
18
+ export interface SetupEventsDeps {
19
+ events: EventBus;
20
+ agent: {
21
+ ctx: Context;
22
+ };
23
+ subscribeEternalIteration?: ((fn: (entry: JournalEntry) => void) => () => void) | undefined;
24
+ broadcast: (msg: {
25
+ type: string;
26
+ payload: unknown;
27
+ }) => void;
28
+ sessionPayload: <T extends Record<string, unknown>>(payload: T) => T & {
29
+ sessionId: string;
30
+ };
31
+ currentSessionId: () => string;
32
+ queueTextDelta: StreamCoalescer['queueTextDelta'];
33
+ queueThinkingDelta: StreamCoalescer['queueThinkingDelta'];
34
+ queueToolProgress: StreamCoalescer['queueToolProgress'];
35
+ flushThinkingDelta: StreamCoalescer['flushThinkingDelta'];
36
+ flushAllStreamBuffers: StreamCoalescer['flushAllStreamBuffers'];
37
+ pendingConfirms: Map<string, PendingConfirm>;
38
+ secretScrubber: SecretScrubber;
39
+ /** Live clients getter for the shared eternal-iteration subscription. */
40
+ getClients: Parameters<typeof createEternalSubscription>[2];
41
+ /** Shared disposer list — the caller also pushes non-event disposers here. */
42
+ eventUnsubscribers: Array<() => void>;
43
+ }
44
+ export declare function createSetupEvents(deps: SetupEventsDeps): () => void;
45
+ //# sourceMappingURL=setup-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-events.d.ts","sourceRoot":"","sources":["../../src/webui-server/setup-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE,CAAC;IACxB,yBAAyB,CAAC,EACtB,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC,GACnD,SAAS,CAAC;IACd,SAAS,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,cAAc,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7F,gBAAgB,EAAE,MAAM,MAAM,CAAC;IAC/B,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAClD,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAC1D,iBAAiB,EAAE,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACxD,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAC1D,qBAAqB,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC;IAChE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7C,cAAc,EAAE,cAAc,CAAC;IAC/B,yEAAyE;IACzE,UAAU,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,8EAA8E;IAC9E,kBAAkB,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;CACvC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,IAAI,CA2rBnE"}
@@ -0,0 +1,70 @@
1
+ import type { Server } from 'node:http';
2
+ import { type CreateHttpServerOptions } from '@wrongstack/webui/server';
3
+ /**
4
+ * PR 6 of Issue #30 (webui-server 8-PR refactor):
5
+ * dist discovery + HTTP server bring-up.
6
+ *
7
+ * Before this PR, the `runWebUI` body inlined five lines
8
+ * that resolved the webui package's `dist` directory via
9
+ * `createRequire(import.meta.url)` and handed the path to
10
+ * `createHttpServer`. If the webui package wasn't built,
11
+ * the inline try/catch silently degraded to WS-only.
12
+ *
13
+ * After this PR, the dist-resolution lives in
14
+ * `webui-server/static-serve.ts` and the only thing
15
+ * `runWebUI` does is call `startStaticServe({ host,
16
+ * httpPort, wsPort, globalRoot })`. The function returns
17
+ * the listening `Server` and its real `port` (the OS
18
+ * may reassign if the requested port was in use), or
19
+ * `null` when the webui package is unbuilt.
20
+ *
21
+ * The try/catch around the require resolution stays
22
+ * inside this module so the runWebUI body does not have
23
+ * to think about webui's build state at all.
24
+ */
25
+ export interface StaticServeHandle {
26
+ server: Server;
27
+ port: number;
28
+ }
29
+ export interface StaticServeOptions {
30
+ host: string;
31
+ httpPort: number;
32
+ wsPort: number;
33
+ globalRoot: string;
34
+ /** Push-on-write hook for `POST /api/fleet/ping` (immediate fleet re-broadcast). */
35
+ onFleetPing?: (() => void) | undefined;
36
+ /** Public browser-facing WS URL injected into the React app. */
37
+ publicWsUrl?: string | undefined;
38
+ /**
39
+ * Shared auth token for `/ws-auth` and `/api/*` endpoints. Required for
40
+ * the cookie-based auth flow: the frontend extracts this from the URL,
41
+ * calls `/ws-auth?token=...` to get an HttpOnly cookie, then uses the
42
+ * cookie for subsequent WS upgrades (closing C-598 query-string exposure).
43
+ */
44
+ apiToken?: string | undefined;
45
+ /** Force token auth even when the server binds to loopback. */
46
+ requireToken?: boolean | undefined;
47
+ }
48
+ /**
49
+ * Resolve the webui package's built `dist` directory.
50
+ *
51
+ * Returns the absolute path, or `null` if the package's
52
+ * server entry can't be resolved (webui not built). This
53
+ * is the one piece of `startStaticServe` that touches the
54
+ * module tree, so it lives behind its own function: tests
55
+ * can exercise the resolution (and stub it) without
56
+ * binding a socket.
57
+ */
58
+ export declare function resolveDistDir(): string | null;
59
+ /**
60
+ * Injectable seams for `startStaticServe`. Both default to
61
+ * the real implementations; tests override them to assert
62
+ * the wiring without resolving the webui package or binding
63
+ * a real port.
64
+ */
65
+ export interface StaticServeDeps {
66
+ resolveDist?: () => string | null;
67
+ createServer?: (opts: CreateHttpServerOptions) => Server;
68
+ }
69
+ export declare function startStaticServe(opts: StaticServeOptions, deps?: StaticServeDeps): StaticServeHandle | null;
70
+ //# sourceMappingURL=static-serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-serve.d.ts","sourceRoot":"","sources":["../../src/webui-server/static-serve.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,0BAA0B,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,WAAW,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACvC,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAQ9C;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,MAAM,CAAC;CAC1D;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,EACxB,IAAI,GAAE,eAAoB,GACzB,iBAAiB,GAAG,IAAI,CA6B1B"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Server-side stream coalescing for the CLI WebUI bridge.
3
+ *
4
+ * Coalesces high-volume live events (provider text/thinking deltas, tool
5
+ * progress) before they hit every connected browser tab. The frontend also
6
+ * coalesces per animation frame, but without this layer long streams still
7
+ * create one WebSocket message per provider token/tool progress event.
8
+ *
9
+ * PR 9 of Issue #30: extracted from `webui-server.ts`.
10
+ */
11
+ export interface StreamCoalescerDeps {
12
+ /** Send a message to every connected client (webui-server's `broadcast`). */
13
+ broadcast: (msg: {
14
+ type: string;
15
+ payload: unknown;
16
+ }) => void;
17
+ /** Stamp a payload with the live session id (webui-server's `sessionPayload`). */
18
+ sessionPayload: <T extends Record<string, unknown>>(payload: T) => T & {
19
+ sessionId: string;
20
+ };
21
+ }
22
+ export interface ToolProgressPayload {
23
+ sessionId?: string | undefined;
24
+ id: string;
25
+ name: string;
26
+ event: {
27
+ type?: string | undefined;
28
+ text?: string | undefined;
29
+ };
30
+ }
31
+ export interface StreamCoalescer {
32
+ queueTextDelta(text: string, sessionId?: string | undefined): void;
33
+ queueThinkingDelta(text: string, sessionId?: string | undefined): void;
34
+ queueToolProgress(payload: ToolProgressPayload): void;
35
+ /** Flush a pending thinking buffer (text deltas interleave with thinking). */
36
+ flushThinkingDelta(): void;
37
+ /** Flush every pending buffer — call at iteration boundaries and shutdown. */
38
+ flushAllStreamBuffers(): void;
39
+ }
40
+ export declare function createStreamCoalescer(deps: StreamCoalescerDeps): StreamCoalescer;
41
+ //# sourceMappingURL=stream-coalescer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-coalescer.d.ts","sourceRoot":"","sources":["../../src/webui-server/stream-coalescer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,SAAS,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,kFAAkF;IAClF,cAAc,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9F;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;CACjE;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACnE,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACvE,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACtD,8EAA8E;IAC9E,kBAAkB,IAAI,IAAI,CAAC;IAC3B,8EAA8E;IAC9E,qBAAqB,IAAI,IAAI,CAAC;CAC/B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CA2JhF"}
@@ -0,0 +1,47 @@
1
+ import { type Agent, type ModelsRegistry, type ModeStore } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsCommon } from './index.js';
4
+ /**
5
+ * PR 5e of Issue #30: agent-configuration WebSocket handlers —
6
+ * `modes.list` / `mode.switch` (agent mode) and `model.switch` /
7
+ * `model.refine` (provider+model). The first three re-broadcast a fresh
8
+ * `session.start` so every browser tab reflects the change.
9
+ *
10
+ * The session.start payload is built by `runWebUI`'s closure
11
+ * (`buildSessionStartPayload`, which reads a large amount of run state);
12
+ * it's threaded in here as the `buildSessionStart` callback rather than
13
+ * reconstructed. The other former captures (`opts.modeStore`,
14
+ * `opts.agent`, `opts.globalConfigPath`) are `AgentConfigContext` fields.
15
+ */
16
+ export interface AgentConfigContext extends WsCommon {
17
+ /** The running agent — mode/model/provider live on its ctx. */
18
+ agent: Agent;
19
+ /** Mode store backing modes.list / mode.switch (optional). */
20
+ modeStore: ModeStore | undefined;
21
+ /** Global config path — model.switch reads saved provider configs from it. */
22
+ globalConfigPath: string | undefined;
23
+ /** Build the session.start payload (runWebUI's closure), broadcast on a config change. */
24
+ buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
25
+ /**
26
+ * Models registry, used to look up the active model's reasoning capabilities
27
+ * so the prompt refiner can send a gated low-effort hint. Optional — when
28
+ * absent the refiner sends no reasoning field (unchanged behavior).
29
+ */
30
+ modelsRegistry?: ModelsRegistry | undefined;
31
+ onMaxContextResolved?: ((providerId: string, modelId: string, maxContext: number) => void) | undefined;
32
+ /**
33
+ * Persist durable keys to config.json (runWebUI's createPrefsSeeding closure).
34
+ * Used by model.switch to write the new provider+model so the choice survives
35
+ * restart — parity with the standalone server. Optional: when absent the
36
+ * switch still applies live, it just doesn't persist.
37
+ */
38
+ persistPrefs?: ((payload: Record<string, unknown>) => Promise<void>) | undefined;
39
+ }
40
+ export declare function handleModesList(ctx: AgentConfigContext, ws: WebSocket): Promise<void>;
41
+ export declare function handleModeSwitch(ctx: AgentConfigContext, ws: WebSocket, id: string): Promise<void>;
42
+ export declare function handleModelSwitch(ctx: AgentConfigContext, ws: WebSocket, payload: {
43
+ provider: string;
44
+ model: string;
45
+ }): Promise<void>;
46
+ export declare function handleModelRefine(ctx: AgentConfigContext, ws: WebSocket, text: string): Promise<void>;
47
+ //# sourceMappingURL=agent-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/agent-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAGV,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ;IAClD,+DAA+D;IAC/D,KAAK,EAAE,KAAK,CAAC;IACb,8DAA8D;IAC9D,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,8EAA8E;IAC9E,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,0FAA0F;IAC1F,iBAAiB,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7E;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,oBAAoB,CAAC,EACjB,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC,GACnE,SAAS,CAAC;IACd;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;CAClF;AAMD,wBAAsB,eAAe,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC3F;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC3C,OAAO,CAAC,IAAI,CAAC,CAkDf;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CA0Df"}
@@ -0,0 +1,43 @@
1
+ import type { BrainArbiter, BrainAutoRisk, BrainRuntime } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsCommon } from './index.js';
4
+ /**
5
+ * PR 5b of Issue #30: Brain WebSocket handlers (`brain.status` /
6
+ * `brain.risk` / `brain.ask`).
7
+ *
8
+ * Extracted from the `runWebUI` switch. The former closure captures —
9
+ * `opts.brainSettings`, `opts.getBrainLog`, and the
10
+ * `opts.brain ?? container.resolve(TOKENS.BrainArbiter)` lookup — are now
11
+ * fields on `BrainHandlerContext`. The arbiter resolution is passed as a
12
+ * thunk so this module needn't know about the agent container or tokens.
13
+ */
14
+ /** A single Brain decision-log entry (newest last). */
15
+ export interface BrainLogEntry {
16
+ at: number;
17
+ kind: string;
18
+ question: string;
19
+ outcome: string;
20
+ }
21
+ export interface BrainHandlerContext extends WsCommon {
22
+ /** Shared autonomy ceiling — the SAME object `/brain` mutates. */
23
+ brainSettings: {
24
+ maxAutoRisk: BrainAutoRisk;
25
+ } | undefined;
26
+ /**
27
+ * Live-editable Brain config owner. Powers `brain.config.get/set` and
28
+ * enriches `brain.status`; risk-only hosts may leave it undefined.
29
+ */
30
+ brainRuntime?: BrainRuntime | undefined;
31
+ /** Read the host's rolling Brain decision log, or undefined when not wired. */
32
+ getBrainLog: (() => BrainLogEntry[]) | undefined;
33
+ /** Resolve the active Brain arbiter (host instance, else container-bound), or undefined. */
34
+ resolveArbiter: () => BrainArbiter | undefined;
35
+ /** Read the active session id for brain.ask requests. */
36
+ getSessionId?: (() => string | undefined) | undefined;
37
+ }
38
+ export declare function handleBrainStatus(ctx: BrainHandlerContext, ws: WebSocket): void;
39
+ export declare function handleBrainConfigGet(ctx: BrainHandlerContext, ws: WebSocket): void;
40
+ export declare function handleBrainConfigSet(ctx: BrainHandlerContext, ws: WebSocket, payload: unknown): Promise<void>;
41
+ export declare function handleBrainRisk(ctx: BrainHandlerContext, ws: WebSocket, level: string): void;
42
+ export declare function handleBrainAsk(ctx: BrainHandlerContext, ws: WebSocket, question: string | undefined): Promise<void>;
43
+ //# sourceMappingURL=brain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/brain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAoB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;;;;;GASG;AAEH,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,kEAAkE;IAClE,aAAa,EAAE;QAAE,WAAW,EAAE,aAAa,CAAA;KAAE,GAAG,SAAS,CAAC;IAC1D;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,+EAA+E;IAC/E,WAAW,EAAE,CAAC,MAAM,aAAa,EAAE,CAAC,GAAG,SAAS,CAAC;IACjD,4FAA4F;IAC5F,cAAc,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IAC/C,yDAAyD;IACzD,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACvD;AAMD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAkB/E;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CASlF;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,mBAAmB,EACxB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAe5F;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,mBAAmB,EACxB,EAAE,EAAE,SAAS,EACb,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CA6Bf"}