@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,57 @@
1
+ import type { Agent } from '@wrongstack/core';
2
+ import { type IncomingImagePayload } from '@wrongstack/core/utils';
3
+ import type { WebSocket } from 'ws';
4
+ import type { WsCommon } from './index.js';
5
+ /**
6
+ * PR 5k of Issue #30: the connection-level WebSocket handlers —
7
+ * `user_message` (the agent-run entry), `abort`, `ping`, and
8
+ * `tool.confirm_result`.
9
+ *
10
+ * These are the last cases that lived inline in `runWebUI`'s
11
+ * `handleMessage` switch. Unlike the topic groups, they own per-socket
12
+ * run-loop state: `abortControllers` (one in-flight `AbortController`
13
+ * per socket) and `pendingConfirms` (tool-permission resolvers keyed by
14
+ * confirm id). Both maps are *owned* by `runWebUI` and shared with the
15
+ * connection/close handlers, so they're passed by reference on the
16
+ * context rather than copied — the close handler still aborts/clears the
17
+ * same maps these handlers mutate.
18
+ *
19
+ * `opts` is threaded by reference (read-only here) so `handleUserMessage`
20
+ * calls the live `opts.agent` — after a project switch reassigns it, the
21
+ * next `user_message` runs the new agent.
22
+ */
23
+ /** The tool-confirmation decision the client can send back. */
24
+ export type ConfirmDecision = 'yes' | 'no' | 'always' | 'deny';
25
+ export interface PendingConfirm {
26
+ resolve: (decision: ConfirmDecision) => void;
27
+ decisionSource?: string | undefined;
28
+ riskTier?: 'safe' | 'standard' | 'destructive' | undefined;
29
+ /** The exact `tool.confirm_needed` broadcast payload, kept so the prompt
30
+ * can be replayed to clients that connect while the confirm is pending
31
+ * (e.g. a browser refresh mid-prompt). */
32
+ payload?: Record<string, unknown> | undefined;
33
+ }
34
+ export declare function isDestructivePendingConfirm(confirm: PendingConfirm): boolean;
35
+ export declare function resolveYoloEligiblePendingConfirms(pendingConfirms: Map<string, PendingConfirm>): void;
36
+ export declare function resolveAllPendingConfirms(pendingConfirms: Map<string, PendingConfirm>, decision: ConfirmDecision): void;
37
+ export interface ConnectionOptions {
38
+ agent: Agent;
39
+ }
40
+ export interface ConnectionContext extends WsCommon {
41
+ opts: ConnectionOptions;
42
+ /** One in-flight run controller per socket; owned by runWebUI. */
43
+ abortControllers: Map<WebSocket, AbortController>;
44
+ /** Pending tool-permission resolvers keyed by confirm id; owned by runWebUI. */
45
+ pendingConfirms: Map<string, PendingConfirm>;
46
+ }
47
+ export interface UserMessageAttachments {
48
+ /** Images attached in the WebUI composer (paste / drop / file picker). */
49
+ images?: IncomingImagePayload[] | undefined;
50
+ /** Legacy single-image field older clients sent as a data-URL. */
51
+ imageBase64?: string | undefined;
52
+ }
53
+ export declare function handleUserMessage(ctx: ConnectionContext, ws: WebSocket, content: string, requestedSessionId?: string | undefined, attachments?: UserMessageAttachments | undefined): Promise<void>;
54
+ export declare function handleAbort(ctx: ConnectionContext, ws: WebSocket, requestedSessionId?: string | undefined): void;
55
+ export declare function handlePing(ctx: ConnectionContext, ws: WebSocket): void;
56
+ export declare function handleToolConfirmResult(ctx: ConnectionContext, id: string, decision: ConfirmDecision, requestedSessionId?: string | undefined): void;
57
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAgB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,wBAAwB,CAAC;AAOhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IA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AAS,CAAC;CAClC;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,iBAAiB,EACtB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,MAAM,EACf,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,EACvC,WAAW,CAAC,EAAE,sBAAsB,GAAG,SAAS,GAC/C,OAAO,CAAC,IAAI,CAAC,CAyGf;AAED,wBAAgB,WAAW,CACzB,GAAG,EAAE,iBAAiB,EACtB,EAAE,EAAE,SAAS,EACb,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,GACtC,IAAI,CA0BN;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAEtE;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,iBAAiB,EACtB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,eAAe,EACzB,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,GACtC,IAAI,CAQN"}
@@ -0,0 +1,55 @@
1
+ import { type Agent } from '@wrongstack/core';
2
+ import type { CustomModeStore } from '@wrongstack/webui/server';
3
+ import type { WebSocket } from 'ws';
4
+ import type { WsCommon } from './index.js';
5
+ /**
6
+ * PR 5h of Issue #30: context-window WebSocket handlers — the live
7
+ * context (`context.clear`/`debug`/`compact`/`repair`) and the
8
+ * custom-context-mode CRUD (`context.modes.list`, `context.mode.switch`/
9
+ * `create`/`update`/`delete`).
10
+ *
11
+ * Former closure captures (`opts.agent`, `buildSessionStartPayload`, and
12
+ * the lazily-loaded `getCustomModeStore`) are `ContextHandlerContext`
13
+ * fields. The compactor is resolved off the agent container at call time,
14
+ * exactly as the inline cases did.
15
+ */
16
+ export interface ContextHandlerContext extends WsCommon {
17
+ /** The running agent — context state/meta and the compactor container live on it. */
18
+ agent: Agent;
19
+ /** Build the reset session.start payload (runWebUI closure). */
20
+ buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
21
+ /** Lazily-loaded custom-context-mode store (runWebUI closure). */
22
+ getCustomModeStore: () => Promise<CustomModeStore>;
23
+ }
24
+ export declare function handleContextClear(ctx: ContextHandlerContext, ws: WebSocket): Promise<void>;
25
+ export declare function handleContextDebug(ctx: ContextHandlerContext, ws: WebSocket): void;
26
+ export declare function handleContextCompact(ctx: ContextHandlerContext, ws: WebSocket, aggressive: boolean): Promise<void>;
27
+ export declare function handleContextRepair(ctx: ContextHandlerContext, ws: WebSocket): void;
28
+ export declare function handleContextModesList(ctx: ContextHandlerContext, ws: WebSocket): Promise<void>;
29
+ export declare function handleContextModeSwitch(ctx: ContextHandlerContext, ws: WebSocket, id: string): Promise<void>;
30
+ export declare function handleContextModeCreate(ctx: ContextHandlerContext, ws: WebSocket, payload: {
31
+ id: string;
32
+ name: string;
33
+ description: string;
34
+ thresholds: {
35
+ warn: number;
36
+ soft: number;
37
+ hard: number;
38
+ };
39
+ preserveK: number;
40
+ eliseThreshold: number;
41
+ }): Promise<void>;
42
+ export declare function handleContextModeUpdate(ctx: ContextHandlerContext, ws: WebSocket, payload: {
43
+ id: string;
44
+ name?: string | undefined;
45
+ description?: string | undefined;
46
+ thresholds?: {
47
+ warn?: number | undefined;
48
+ soft?: number | undefined;
49
+ hard?: number | undefined;
50
+ } | undefined;
51
+ preserveK?: number | undefined;
52
+ eliseThreshold?: number | undefined;
53
+ }): Promise<void>;
54
+ export declare function handleContextModeDelete(ctx: ContextHandlerContext, ws: WebSocket, id: string): Promise<void>;
55
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAKX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAOpC,OAAO,KAAK,EAAE,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I,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,GACA,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,qBAAqB,EAC1B,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IACP,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EACP;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GACnF,SAAS,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC,GACA,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,qBAAqB,EAC1B,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -0,0 +1,60 @@
1
+ import type { ModelsRegistry } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { ProviderConfigStore } from '../provider-config.js';
4
+ /**
5
+ * PR 5 of Issue #30 (webui-server 8-PR refactor): ws-handlers/.
6
+ *
7
+ * The WebSocket message handlers used to live as closures inside
8
+ * `runWebUI`, capturing `opts`, `send`, `broadcast`, etc. directly.
9
+ * To move them into their own topic files we replace every closure
10
+ * capture with a field on `WsHandlerContext`, built once in
11
+ * `runWebUI` and threaded explicitly into each handler — no hidden
12
+ * captures.
13
+ */
14
+ /**
15
+ * Server→client message shape. Mirrors `WSServerMessage` in
16
+ * webui-server.ts; duplicated here (rather than imported) so the
17
+ * ws-handlers modules never import back from webui-server.ts and
18
+ * create a cycle.
19
+ */
20
+ export interface WsServerMessage {
21
+ type: string;
22
+ payload: unknown;
23
+ }
24
+ /**
25
+ * The messaging surface every ws-handler group needs. Each group's
26
+ * context extends this with its own dependencies, so the per-group
27
+ * contexts stay focused instead of one shared god-object growing a
28
+ * field for every concern in the file.
29
+ */
30
+ export interface WsCommon {
31
+ /** Send one message to a single socket (no-op if the socket isn't OPEN). */
32
+ send: (ws: WebSocket, msg: WsServerMessage) => void;
33
+ /** Broadcast a message to every connected socket. */
34
+ broadcast: (msg: WsServerMessage) => void;
35
+ /** console.log adapter, so handlers don't reach for the global directly. */
36
+ log: (msg: string) => void;
37
+ }
38
+ /**
39
+ * Context for the provider / model / API-key handlers.
40
+ */
41
+ export interface WsHandlerContext extends WsCommon {
42
+ /** Provider-config store (load/save the saved-providers map), bound to the global config path. */
43
+ providerStore: ProviderConfigStore;
44
+ /** Models registry backing the provider/model catalog (optional). */
45
+ modelsRegistry: ModelsRegistry | undefined;
46
+ }
47
+ export { type AgentConfigContext, handleModelRefine, handleModelSwitch, handleModeSwitch, handleModesList, } from './agent-config.js';
48
+ export { type BrainHandlerContext, handleBrainAsk, handleBrainConfigGet, handleBrainConfigSet, handleBrainRisk, handleBrainStatus, } from './brain.js';
49
+ export { type ConfirmDecision, type ConnectionContext, type ConnectionOptions, type PendingConfirm, handleAbort, handlePing, handleToolConfirmResult, handleUserMessage, resolveAllPendingConfirms, resolveYoloEligiblePendingConfirms, } from './connection.js';
50
+ export { type ContextHandlerContext, handleContextClear, handleContextCompact, handleContextDebug, handleContextModeCreate, handleContextModeDelete, handleContextModeSwitch, handleContextModesList, handleContextModeUpdate, handleContextRepair, } from './context.js';
51
+ export { handleDiagGet, handleToolDisable, handleToolEnable, handleSkillsList, handleStatsGet, handleToolsList, type IntrospectionContext, } from './introspection.js';
52
+ export { handleAutonomySwitch, handlePrefsGet, handlePrefsUpdate, type PrefsContext, } from './prefs.js';
53
+ export { handleProcessKill, handleProcessKillAll, handleProcessList } from './process.js';
54
+ export { handleProjectsAdd, handleProjectsList, handleProjectsSelect, handleWorkingDirSet, type ProjectsContext, type ProjectsOptions, } from './projects.js';
55
+ export { handleKeyDelete, handleKeySetActive, handleKeyUpsert, handleProviderAdd, handleProviderModels, handleProviderRemove, handleProviderClearModels, handleProviderUndoClear, handleProviderUpdate, handleProviderProbe, handleProvidersList, handleProvidersSaved, broadcastSaved, } from './providers.js';
56
+ export { handleOAuthStart, handleOAuthCode, handleOAuthCancel } from './oauth.js';
57
+ export { handleGoalGet, handleSessionCheckpoints, handleSessionDelete, handleSessionNew, handleSessionRename, handleSessionResume, handleSessionRewind, handleSessionSave, handleSessionsList, type SessionsContext, type SessionsOptions, } from './sessions.js';
58
+ export { handlePlanGet, handlePlanItemUpdate, handlePlanTemplateUse, handleTasksGet, handleTaskUpdate, handleTodosClear, handleTodosGet, handleTodosRemove, handleTodoUpdate, type WorklistContext, } from './worklist.js';
59
+ export { type MailboxContext, getMailbox, handleMailboxMessages, handleMailboxAgents, handleMailboxClear, handleMailboxCompact, handleMailboxPurge, } from './mailbox.js';
60
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,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B,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,cAAc,EACnB,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { Agent, ConfigStore, ModelsRegistry, SkillLoader } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsCommon } from './index.js';
4
+ /**
5
+ * PR 5c of Issue #30: introspection WebSocket handlers
6
+ * (`skills.list`, `tools.list`, `tool.enable`, `tool.disable`, `diag.get`, `stats.get`).
7
+ *
8
+ * Most cases snapshot live run state (the agent context, the tool registry,
9
+ * the skill loader, token usage) and send it to the browser. Tool enable/disable
10
+ * is included here because it mutates the registry/config that tools.list
11
+ * introspects.
12
+ */
13
+ export interface IntrospectionContext extends WsCommon {
14
+ /** The running agent — read for ctx (provider/model/usage/messages/…) and tools. */
15
+ agent: Agent;
16
+ /** Skill loader backing skills.list (optional — absent ⇒ feature disabled). */
17
+ skillLoader: SkillLoader | undefined;
18
+ /** Models registry, used by stats.get to price token usage (optional). */
19
+ modelsRegistry: ModelsRegistry | undefined;
20
+ /** Project root reported by diag.get (falls back to ctx.projectRoot). */
21
+ projectRoot: string | undefined;
22
+ /** Active session id. */
23
+ sessionId: string;
24
+ /** Epoch ms when the run started — stats.get reports elapsed time. */
25
+ sessionStartedAt: number;
26
+ /** Config store used to persist tool enable/disable changes when available. */
27
+ configStore?: ConfigStore | undefined;
28
+ }
29
+ export declare function handleSkillsList(ctx: IntrospectionContext, ws: WebSocket): Promise<void>;
30
+ export declare function handleToolsList(ctx: IntrospectionContext, ws: WebSocket): void;
31
+ export declare function handleToolDisable(ctx: IntrospectionContext, ws: WebSocket, payload: unknown): void;
32
+ export declare function handleToolEnable(ctx: IntrospectionContext, ws: WebSocket, payload: unknown): void;
33
+ export declare function handleDiagGet(ctx: IntrospectionContext, ws: WebSocket): void;
34
+ export declare function handleStatsGet(ctx: IntrospectionContext, ws: WebSocket): Promise<void>;
35
+ //# sourceMappingURL=introspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/introspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;;;;GAQG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,QAAQ;IACpD,oFAAoF;IACpF,KAAK,EAAE,KAAK,CAAC;IACb,+EAA+E;IAC/E,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,0EAA0E;IAC1E,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,yEAAyE;IACzE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,gBAAgB,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACvC;AAiDD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC9F;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,oBAAoB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAiB9E;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,oBAAoB,EACzB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,OAAO,GACf,IAAI,CASN;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,oBAAoB,EACzB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,OAAO,GACf,IAAI,CASN;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,oBAAoB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAuB5E;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,oBAAoB,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAoC5F"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * WebSocket handler for kanban board operations.
3
+ *
4
+ * Message types:
5
+ * kanban.list → list all boards
6
+ * kanban.get → get a board by ID (full detail)
7
+ * kanban.create → create a new board
8
+ * kanban.update → update board metadata
9
+ * kanban.delete → delete a board
10
+ * kanban.task.add → add a task
11
+ * kanban.task.update → update a task
12
+ * kanban.task.move → move a task to a different column
13
+ * kanban.task.remove → delete a task
14
+ * kanban.task.get → get a single task
15
+ * kanban.column.add → add a column
16
+ * kanban.column.remove→ remove a column
17
+ * kanban.generate → auto-generate a board
18
+ */
19
+ import type { WebSocket } from 'ws';
20
+ import type { WsCommon } from './index.js';
21
+ export interface KanbanContext extends WsCommon {
22
+ projectRoot: string;
23
+ dispatchTask?: (description: string, opts?: {
24
+ provider?: string | undefined;
25
+ model?: string | undefined;
26
+ fallbackModels?: string[] | undefined;
27
+ tools?: string[] | undefined;
28
+ name?: string | undefined;
29
+ allowedCapabilities?: readonly string[] | undefined;
30
+ onDone?: ((result: {
31
+ status: 'completed' | 'failed';
32
+ result?: string | undefined;
33
+ error?: string | undefined;
34
+ }) => void | Promise<void>) | undefined;
35
+ }) => Promise<string>;
36
+ }
37
+ export declare function handleKanbanMessage(ctx: KanbanContext, ws: WebSocket, msg: {
38
+ type: string;
39
+ payload?: unknown;
40
+ }): Promise<void>;
41
+ //# sourceMappingURL=kanban.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kanban.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/kanban.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA4CH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,CACb,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACtC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;QACpD,MAAM,CAAC,EACH,CAAC,CAAC,MAAM,EAAE;YACR,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;YAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SAC5B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAC3B,SAAS,CAAC;KACf,KACE,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAgBD,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,SAAS,EACb,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACvC,OAAO,CAAC,IAAI,CAAC,CAuyBf"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Mailbox WebSocket handlers (PR 8 of #30).
3
+ *
4
+ * Handles project-level inter-agent messaging for the WebUI:
5
+ * - mailbox.messages — query mailbox messages
6
+ * - mailbox.agents — query online/stored agent statuses
7
+ * - mailbox.clear — clear all mailbox messages
8
+ * - mailbox.purge — purge stale messages by age
9
+ * - mailbox.compact — remove expired, read-by-all, and stale messages
10
+ */
11
+ import type { WebSocket } from 'ws';
12
+ import { GlobalMailbox, type EventBus } from '@wrongstack/core';
13
+ export interface MailboxContext {
14
+ /** Live agent reference for project-root access. */
15
+ agent: {
16
+ ctx: {
17
+ projectRoot?: string;
18
+ session?: {
19
+ id: string;
20
+ };
21
+ };
22
+ };
23
+ /** Resolved path to global config (used to derive the mailbox root). */
24
+ globalConfigPath: string;
25
+ /** Event bus for broadcasting mailbox events to all clients. */
26
+ events: EventBus;
27
+ send(ws: WebSocket, msg: Record<string, unknown>): void;
28
+ broadcast(msg: Record<string, unknown>): void;
29
+ log(msg: string): void;
30
+ }
31
+ export declare function getMailbox(ctx: MailboxContext): GlobalMailbox | null;
32
+ export declare function handleMailboxMessages(ctx: MailboxContext, msg: {
33
+ payload?: {
34
+ limit?: number;
35
+ agentId?: string;
36
+ unreadOnly?: boolean;
37
+ incompleteOnly?: boolean;
38
+ };
39
+ }, ws: WebSocket): Promise<void>;
40
+ export declare function handleMailboxAgents(ctx: MailboxContext, msg: {
41
+ payload?: {
42
+ onlineOnly?: boolean;
43
+ };
44
+ }, ws: WebSocket): Promise<void>;
45
+ export declare function handleMailboxClear(ctx: MailboxContext, ws: WebSocket): Promise<void>;
46
+ export declare function handleMailboxPurge(ctx: MailboxContext, msg: {
47
+ payload?: {
48
+ completedMaxAgeMs?: number;
49
+ incompleteMaxAgeMs?: number;
50
+ };
51
+ }, ws: WebSocket): Promise<void>;
52
+ export declare function handleMailboxCompact(ctx: MailboxContext, msg: {
53
+ payload?: {
54
+ readMaxAgeMs?: number;
55
+ defaultTtlMs?: number;
56
+ completedMaxAgeMs?: number;
57
+ incompleteMaxAgeMs?: number;
58
+ };
59
+ }, ws: WebSocket): Promise<void>;
60
+ //# sourceMappingURL=mailbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/mailbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAqB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEnF,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,KAAK,EAAE;QAAE,GAAG,EAAE;YAAE,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAA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AAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAC9E,EAAE,EAAE,SAAS,GACZ,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE;IACH,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH,EACD,EAAE,EAAE,SAAS,GACZ,OAAO,CAAC,IAAI,CAAC,CAef"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Subscription OAuth login (ChatGPT / Claude / Copilot) for the embedded
3
+ * WebUI server. Mirrors the standalone server's `oauth-handlers`, but persists
4
+ * through the `ProviderConfigStore` on `WsHandlerContext`.
5
+ *
6
+ * The flow engine (`@wrongstack/providers/oauth`) is IO-free — it drives the
7
+ * loopback / device-code protocol and returns a persistence-agnostic outcome
8
+ * that we upsert here. Progress is surfaced to the client as `auth.oauth.status`.
9
+ */
10
+ import { type OAuthKind } from '@wrongstack/providers/oauth';
11
+ import type { WebSocket } from 'ws';
12
+ import type { WsHandlerContext } from './index.js';
13
+ export declare function handleOAuthStart(ctx: WsHandlerContext, ws: WebSocket, kind: OAuthKind): Promise<void>;
14
+ export declare function handleOAuthCode(ctx: WsHandlerContext, ws: WebSocket, kind: OAuthKind, input: string): Promise<void>;
15
+ export declare function handleOAuthCancel(ctx: WsHandlerContext, ws: WebSocket, kind: OAuthKind): void;
16
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/oauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAEL,KAAK,SAAS,EAGf,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AA0DnD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,gBAAgB,EACrB,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,IAAI,CAAC,CAuCf;AAED,wBAAsB,eAAe,CACnC,GAAG,EAAE,gBAAgB,EACrB,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAI7F"}
@@ -0,0 +1,32 @@
1
+ import type { Agent } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsCommon } from './index.js';
4
+ import { type PendingConfirm } from './connection.js';
5
+ /**
6
+ * PR 5f of Issue #30: preference WebSocket handlers — `prefs.get`,
7
+ * `prefs.update`, and `autonomy.switch`.
8
+ *
9
+ * The durable logic (which keys are persisted, the config.json key
10
+ * mapping, and the live pref snapshot off `ctx.meta`) lives in runWebUI's
11
+ * `prefSnapshot` / `persistPrefsToConfig` closures and the host's real
12
+ * autonomy setter; they're threaded in here as callbacks. The handlers
13
+ * themselves just write `ctx.meta`, fan the snapshot out, and persist.
14
+ */
15
+ export interface PrefsContext extends WsCommon {
16
+ /** The running agent — preferences live on `agent.ctx.meta`. */
17
+ agent: Agent;
18
+ /** Snapshot the durable prefs off ctx.meta (runWebUI closure). */
19
+ prefSnapshot: () => Record<string, unknown>;
20
+ /** Persist the durable keys to config.json, fire-and-forget (runWebUI closure). */
21
+ persistPrefs: (payload: Record<string, unknown>) => Promise<void>;
22
+ /** Flip the host's live YOLO permission policy, if wired. */
23
+ onYoloSwitch: ((enabled: boolean) => void) | undefined;
24
+ /** Flip the CLI's real autonomy state (same setter the TUI uses), if wired. */
25
+ onAutonomySwitch: ((mode: string) => void) | undefined;
26
+ /** Pending tool confirmations — drained to yes when YOLO is enabled. */
27
+ pendingConfirms: Map<string, PendingConfirm>;
28
+ }
29
+ export declare function handlePrefsGet(ctx: PrefsContext, ws: WebSocket): void;
30
+ export declare function handlePrefsUpdate(ctx: PrefsContext, _ws: WebSocket, payload: Record<string, unknown>): void;
31
+ export declare function handleAutonomySwitch(ctx: PrefsContext, ws: WebSocket, mode: string): void;
32
+ //# sourceMappingURL=prefs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefs.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/prefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE1F;;;;;;;;;GASG;AAEH,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,gEAAgE;IAChE,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,YAAY,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,mFAAmF;IACnF,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,6DAA6D;IAC7D,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACvD,+EAA+E;IAC/E,gBAAgB,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACvD,wEAAwE;IACxE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC9C;AAMD,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAIrE;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,YAAY,EACjB,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAiCN;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQzF"}
@@ -0,0 +1,6 @@
1
+ import type { WebSocket } from 'ws';
2
+ import type { WsCommon } from './index.js';
3
+ export declare function handleProcessList(ctx: WsCommon, ws: WebSocket): void;
4
+ export declare function handleProcessKill(ctx: WsCommon, ws: WebSocket, pid: number): void;
5
+ export declare function handleProcessKillAll(ctx: WsCommon, ws: WebSocket): void;
6
+ //# sourceMappingURL=process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/process.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgB3C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAmBpE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAYjF;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAOvE"}
@@ -0,0 +1,44 @@
1
+ import { type Agent, type MemoryStore, type ModeStore, type SessionStore, type SessionWriter, type SkillLoader } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsCommon } from './index.js';
4
+ /**
5
+ * CLI-embedded WebUI project handlers.
6
+ *
7
+ * The standalone WebUI/desktop launcher owns project selection for that
8
+ * surface, but the CLI-embedded WebUI still supports in-process registration
9
+ * and project switching so the browser stays attached to the same live agent.
10
+ */
11
+ /** The subset of CliWebUIOptions the project handlers read/mutate. Passed by reference. */
12
+ export interface ProjectsOptions {
13
+ projectRoot?: string | undefined;
14
+ globalConfigPath?: string | undefined;
15
+ agent: Agent;
16
+ modeId?: string | undefined;
17
+ modeStore?: ModeStore | undefined;
18
+ memoryStore?: MemoryStore | undefined;
19
+ skillLoader?: SkillLoader | undefined;
20
+ sessionStore?: SessionStore | undefined;
21
+ session: SessionWriter;
22
+ onSessionSwapped?: ((newSessionId: string) => void) | undefined;
23
+ }
24
+ export interface ProjectsContext extends WsCommon {
25
+ /** The live options object used by projects.list and working_dir.set. */
26
+ opts: ProjectsOptions;
27
+ /** Kept for compatibility with the embedded WebUI context wiring. */
28
+ abortControllers: Map<WebSocket, AbortController>;
29
+ /** Kept for compatibility with the embedded WebUI context wiring. */
30
+ abortLegacyRun: () => void;
31
+ /** Kept for compatibility with the embedded WebUI context wiring. */
32
+ buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
33
+ }
34
+ export declare function handleProjectsList(ctx: ProjectsContext, ws: WebSocket): Promise<void>;
35
+ export declare function handleProjectsSelect(ctx: ProjectsContext, ws: WebSocket, payload: {
36
+ root: string;
37
+ name?: string | undefined;
38
+ }): Promise<void>;
39
+ export declare function handleProjectsAdd(ctx: ProjectsContext, ws: WebSocket, payload: {
40
+ root: string;
41
+ name?: string | undefined;
42
+ }): Promise<void>;
43
+ export declare function handleWorkingDirSet(ctx: ProjectsContext, ws: WebSocket, newPath: string): Promise<void>;
44
+ //# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.ts","sourceRoot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kBAAkB,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAe3F;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACnD,OAAO,CAAC,IAAI,CAAC,CAoFf;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACnD,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAmBf"}
@@ -0,0 +1,36 @@
1
+ import type { ProviderConfig } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsHandlerContext } from './index.js';
4
+ export declare function broadcastSaved(ctx: WsHandlerContext, providers: Record<string, ProviderConfig>): void;
5
+ export declare function handleProvidersList(ctx: WsHandlerContext, ws: WebSocket): Promise<void>;
6
+ export declare function handleProviderModels(ctx: WsHandlerContext, ws: WebSocket, providerId: string): Promise<void>;
7
+ export declare function handleProvidersSaved(ctx: WsHandlerContext, ws: WebSocket): Promise<void>;
8
+ export declare function handleKeyUpsert(ctx: WsHandlerContext, ws: WebSocket, providerId: string, label: string, apiKey: string): Promise<void>;
9
+ export declare function handleKeyDelete(ctx: WsHandlerContext, ws: WebSocket, providerId: string, label: string): Promise<void>;
10
+ export declare function handleKeySetActive(ctx: WsHandlerContext, ws: WebSocket, providerId: string, label: string): Promise<void>;
11
+ export declare function handleProviderAdd(ctx: WsHandlerContext, ws: WebSocket, payload: {
12
+ id: string;
13
+ family: string;
14
+ baseUrl?: string | undefined;
15
+ apiKey?: string | undefined;
16
+ }): Promise<void>;
17
+ export declare function handleProviderRemove(ctx: WsHandlerContext, ws: WebSocket, providerId: string): Promise<void>;
18
+ /** Drop a provider's model allowlist (so the full catalog is offered again). */
19
+ export declare function handleProviderClearModels(ctx: WsHandlerContext, ws: WebSocket, providerId: string): Promise<void>;
20
+ /** Restore a previously-cleared model allowlist (pairs with clear). */
21
+ export declare function handleProviderUndoClear(ctx: WsHandlerContext, ws: WebSocket, providerId: string, previousModels: string[]): Promise<void>;
22
+ /** Update a saved provider's wire config (family / baseUrl / envVars / models). */
23
+ export declare function handleProviderUpdate(ctx: WsHandlerContext, ws: WebSocket, payload: {
24
+ id: string;
25
+ family?: string | undefined;
26
+ baseUrl?: string | undefined;
27
+ envVars?: string[] | undefined;
28
+ models?: string[] | undefined;
29
+ }): Promise<void>;
30
+ /**
31
+ * Run a health probe against a saved provider's `/v1/models` and reply with a
32
+ * `provider.probe` message. Never throws — the probe result carries the
33
+ * failure mode in its `status`.
34
+ */
35
+ export declare function handleProviderProbe(ctx: WsHandlerContext, ws: WebSocket, providerId: string, timeoutMs?: number): Promise<void>;
36
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AASpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAiDnD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACxC,IAAI,CAKN;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,E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AsB,yBAAyB,CAC7C,GAAG,EAAE,gBAAgB,EACrB,EAAE,EAAE,SAAS,EACb,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAef;AAED,uEAAuE;AACvE,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,gBAAgB,EACrB,EAAE,EAAE,SAAS,EACb,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EAAE,GACvB,OAAO,CAAC,IAAI,CAAC,CAef;AAED,mFAAmF;AACnF,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,gBAAgB,EACrB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IACP,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CAC/B,GACA,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,gBAAgB,EACrB,EAAE,EAAE,SAAS,EACb,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
@@ -0,0 +1,38 @@
1
+ import { type Agent, type SessionStore, type SessionWriter } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsCommon } from './index.js';
4
+ /**
5
+ * PR 5j of Issue #30: session-management WebSocket handlers — `goal.get`,
6
+ * `sessions.list`, `session.new`/`delete`/`save`, `session.checkpoints`/
7
+ * `rewind`/`resume`.
8
+ *
9
+ * The session-swapping handlers (new/resume) and the rewinder mutate the
10
+ * LIVE session writer on `agent.ctx.session` and reset the token counter,
11
+ * exactly as the inline cases did. `opts` is read-only here (no field is
12
+ * reassigned), so `SessionsOptions` is just the
13
+ * subset these handlers read, passed by reference so they see live
14
+ * `agent.ctx.session` / `opts.sessionStore` at call time.
15
+ */
16
+ export interface SessionsOptions {
17
+ projectRoot?: string | undefined;
18
+ agent: Agent;
19
+ session: SessionWriter;
20
+ sessionStore?: SessionStore | undefined;
21
+ sessionsDir?: string | undefined;
22
+ onSessionSwapped?: ((newSessionId: string) => void) | undefined;
23
+ }
24
+ export interface SessionsContext extends WsCommon {
25
+ opts: SessionsOptions;
26
+ /** Build the reset session.start payload (runWebUI closure). */
27
+ buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
28
+ }
29
+ export declare function handleGoalGet(ctx: SessionsContext, _ws: WebSocket): Promise<void>;
30
+ export declare function handleSessionsList(ctx: SessionsContext, ws: WebSocket, limit: number): Promise<void>;
31
+ export declare function handleSessionNew(ctx: SessionsContext, _ws: WebSocket): Promise<void>;
32
+ export declare function handleSessionCheckpoints(ctx: SessionsContext, ws: WebSocket): Promise<void>;
33
+ export declare function handleSessionRewind(ctx: SessionsContext, ws: WebSocket, checkpointIndex: number): Promise<void>;
34
+ export declare function handleSessionDelete(ctx: SessionsContext, ws: WebSocket, id: string): Promise<void>;
35
+ export declare function handleSessionRename(ctx: SessionsContext, ws: WebSocket, id: string, name: string): Promise<void>;
36
+ export declare function handleSessionSave(ctx: SessionsContext, ws: WebSocket): void;
37
+ export declare function handleSessionResume(ctx: SessionsContext, ws: WebSocket, id: string): Promise<void>;
38
+ //# sourceMappingURL=sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/sessions.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,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AE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAG3E;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CA6Cf"}
@@ -0,0 +1,49 @@
1
+ import { type Agent, type TodoItem } from '@wrongstack/core';
2
+ import type { WebSocket } from 'ws';
3
+ import type { WsCommon } from './index.js';
4
+ /**
5
+ * PR 5d of Issue #30: work-list WebSocket handlers — the agent's todos
6
+ * (`todos.get`/`clear`/`remove`, `todo.update`), the persisted task file
7
+ * (`tasks.get`, `task.update`), and the persisted plan (`plan.get`,
8
+ * `plan.template_use`, `plan.item.update`).
9
+ *
10
+ * Todos are kept inline because the CLI embedded server must update live
11
+ * agent state (`ctx.agent.ctx.state.replaceTodos`) and uses a different
12
+ * result message format (`key.operation_result`) than the shared handlers
13
+ * (`ok`/`error`). Tasks and plan are also kept inline for the same reason:
14
+ * CLI sends `key.operation_result` for task/plan operations while the shared
15
+ * module uses `ok`/`error` — structural unification awaits a decision on
16
+ * which format is canonical.
17
+ *
18
+ * The shared handlers live at `@wrongstack/webui/server/handlers` and are
19
+ * used by the standalone WebUI server (`startWebUI`).
20
+ */
21
+ export interface WorklistContext extends WsCommon {
22
+ /** The running agent — todos live on its ctx; plan/task paths in ctx.meta. */
23
+ agent: Agent;
24
+ /** Active session id — used to stamp fresh plans/tasks. */
25
+ sessionId: string;
26
+ }
27
+ export declare function handleTodosGet(ctx: WorklistContext, ws: WebSocket): void;
28
+ export declare function handleTodosClear(ctx: WorklistContext, ws: WebSocket): void;
29
+ export declare function handleTodosRemove(ctx: WorklistContext, ws: WebSocket, payload: {
30
+ id?: string | undefined;
31
+ index?: number | undefined;
32
+ } | undefined): void;
33
+ export declare function handleTodoUpdate(ctx: WorklistContext, ws: WebSocket, payload: {
34
+ id: string;
35
+ status?: TodoItem['status'] | undefined;
36
+ activeForm?: string | undefined;
37
+ }): void;
38
+ export declare function handleTasksGet(ctx: WorklistContext, ws: WebSocket): Promise<void>;
39
+ export declare function handleTaskUpdate(ctx: WorklistContext, ws: WebSocket, payload: {
40
+ id: string;
41
+ status: 'pending' | 'in_progress' | 'blocked' | 'failed' | 'review' | 'completed';
42
+ }): Promise<void>;
43
+ export declare function handlePlanGet(ctx: WorklistContext, ws: WebSocket): Promise<void>;
44
+ export declare function handlePlanTemplateUse(ctx: WorklistContext, ws: WebSocket, template: string): Promise<void>;
45
+ export declare function handlePlanItemUpdate(ctx: WorklistContext, ws: WebSocket, payload: {
46
+ target: string;
47
+ status: 'open' | 'in_progress' | 'done';
48
+ }): Promise<void>;
49
+ //# sourceMappingURL=worklist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worklist.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/worklist.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAUV,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,8EAA8E;IAC9E,KAAK,EAAE,KAAK,CAAC;IACb,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AA+BD,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAExE;AA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