@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,71 @@
1
+ /**
2
+ * Live fleet status line for the plain (non-TUI) REPL and single-shot modes.
3
+ *
4
+ * The TUI already renders a rich per-agent 4th line; the plain terminal had
5
+ * nothing live while subagents ran. This reserves the bottom terminal row via
6
+ * a DECSTBM scroll region (`\x1b[1;{rows-1}r`) so normal streamed output keeps
7
+ * scrolling in the region above while a continuously-updated status line stays
8
+ * pinned to the bottom. It activates only when ≥1 subagent is running on a TTY,
9
+ * and fully restores the scroll region when the fleet goes idle or on dispose.
10
+ *
11
+ * State is fed entirely by host EventBus events (the coordinator + the
12
+ * multi-agent factory bridge both emit onto the host bus):
13
+ * subagent.spawned / task_started / tool_executed / iteration_summary /
14
+ * task_completed.
15
+ */
16
+ import type { EventBus } from '@wrongstack/core';
17
+ export interface FleetAgentState {
18
+ id: string;
19
+ name: string;
20
+ status: 'running' | 'done' | 'failed';
21
+ iterations: number;
22
+ toolCalls: number;
23
+ lastTool?: string | undefined;
24
+ startedAt: number;
25
+ endedAt?: number | undefined;
26
+ /** Cumulative budget auto-extensions — rendered as a "⚡N" suffix. */
27
+ extensions?: number | undefined;
28
+ }
29
+ export interface FleetStatusLineOptions {
30
+ events: EventBus;
31
+ out?: NodeJS.WriteStream | undefined;
32
+ /** Minimum ms between repaints. Default 150. */
33
+ throttleMs?: number | undefined;
34
+ /** Inject a clock for tests. */
35
+ now?: (() => number) | undefined;
36
+ /** App version (e.g. "0.7.0") prefixed as a `WS v…` chip on the pinned line. */
37
+ version?: string | undefined;
38
+ }
39
+ /**
40
+ * Pure formatter — turns the agent map into a single status string. Exposed
41
+ * for testing; contains no ANSI cursor movement, only color codes + the width
42
+ * cap. Returns '' when there is nothing worth showing.
43
+ */
44
+ export declare function renderFleetLine(states: Map<string, FleetAgentState>, now: number, columns: number, version?: string | undefined): string;
45
+ export declare class FleetStatusLine {
46
+ private readonly events;
47
+ private readonly out;
48
+ private readonly throttleMs;
49
+ private readonly now;
50
+ private readonly version?;
51
+ private readonly states;
52
+ private readonly unsubs;
53
+ private active;
54
+ private rows;
55
+ private repaintTimer;
56
+ private tickTimer;
57
+ private resizeCleanup;
58
+ private lastPaint;
59
+ private readonly onResize;
60
+ constructor(opts: FleetStatusLineOptions);
61
+ /** Subscribe to host fleet events. No terminal output until a subagent spawns. */
62
+ start(): void;
63
+ /** Unsubscribe and restore the terminal. Idempotent. */
64
+ stop(): void;
65
+ private isTty;
66
+ private activate;
67
+ private deactivate;
68
+ private schedulePaint;
69
+ private paint;
70
+ }
71
+ //# sourceMappingURL=fleet-statusline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fleet-statusline.d.ts","sourceRoot":"","sources":["../src/fleet-statusline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,QAAQ,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC;IACrC,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,gCAAgC;IAChC,GAAG,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;IACjC,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAYD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,EACpC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,CA+DR;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAW;IAClC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAqB;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,SAAS,CAA+C;IAChE,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAMvB;IAEF,YAAY,IAAI,EAAE,sBAAsB,EAMvC;IAED,kFAAkF;IAClF,KAAK,IAAI,IAAI,CAqEZ;IAED,wDAAwD;IACxD,IAAI,IAAI,IAAI,CAGX;IAED,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,KAAK;CAWd"}
@@ -0,0 +1,26 @@
1
+ import type { AgentExtension, HookRunner, UserInputPayload } from '@wrongstack/core';
2
+ /** Raised by the UserPromptSubmit middleware to block a turn before it runs. */
3
+ export declare class HookBlockedError extends Error {
4
+ constructor(reason: string);
5
+ }
6
+ interface UserInputMiddleware {
7
+ name: string;
8
+ handler: (payload: UserInputPayload, next: (v: UserInputPayload) => Promise<UserInputPayload>) => Promise<UserInputPayload>;
9
+ }
10
+ /**
11
+ * `userInput` pipeline middleware for `UserPromptSubmit` hooks. A `block`
12
+ * outcome throws `HookBlockedError`, which the userInput pipeline's
13
+ * (core-owned) error boundary rethrows — propagating to `Agent.run` so the
14
+ * turn ends without a model call. `additionalContext` is appended to the user
15
+ * message. Owner is left unset so the boundary treats it as core (rethrow).
16
+ */
17
+ export declare function createUserPromptSubmitMiddleware(hookRunner: HookRunner): UserInputMiddleware;
18
+ /**
19
+ * Agent extension for the `SessionStart` and `Stop` lifecycle hooks.
20
+ * `SessionStart` fires once on the first run of the session; its
21
+ * `additionalContext` is appended to `ctx.systemPrompt` as a one-time text
22
+ * block (persists for the session). `Stop` fires at the end of every turn.
23
+ */
24
+ export declare function createLifecycleHooksExtension(hookRunner: HookRunner): AgentExtension;
25
+ export {};
26
+ //# sourceMappingURL=hooks-wiring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks-wiring.d.ts","sourceRoot":"","sources":["../src/hooks-wiring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAa,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEhG,gFAAgF;AAChF,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,MAAM,EAAE,MAAM,EAGzB;CACF;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CACP,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,gBAAgB,CAAC,KACrD,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,UAAU,GAAG,mBAAmB,CAiB5F;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,CAiBpF"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * HQ command controller — the client-side dispatch surface for Phase 4 of the
3
+ * HQ command center. A mutable holder (mirroring the established
4
+ * `interruptController` pattern in cli-main.ts) that the `onCommand` handler
5
+ * on the HQ publisher reads lazily, because several of its targets
6
+ * (`director`, the rebound `interruptLeader`) are not yet defined at HQ-connect
7
+ * time.
8
+ *
9
+ * The five command types route through the agent's own decision loop or the
10
+ * project mailbox, so they inherit existing guardrails. `run-command` (raw
11
+ * shell) is deliberately NOT wired here — it requires a separately-audited
12
+ * escalation policy (operator flag + per-token `control.execute` + allowlist)
13
+ * and is left as a stub that rejects until that policy exists.
14
+ *
15
+ * @module hq-command-controller
16
+ */
17
+ import type { HqPublisherCommandResult } from '@wrongstack/core';
18
+ import type { GlobalMailbox } from '@wrongstack/core';
19
+ /**
20
+ * Mutable holder for the command dispatch targets. Each field is populated
21
+ * lazily as the corresponding subsystem comes online (director on
22
+ * `onDirectorReady`, interruptLeader rebound by the REPL/TUI, …). The
23
+ * `onCommand` handler reads these at dispatch time, not at construction.
24
+ */
25
+ export interface HqCommandController {
26
+ /** Project mailbox used to deliver steer/broadcast messages. */
27
+ steerMailbox?: GlobalMailbox;
28
+ /** Abort the session leader's running Agent.run(). Returns true if a run was aborted. */
29
+ interruptLeader: () => boolean;
30
+ /** Terminate a specific subagent by id. Returns true if terminated. */
31
+ terminateAgent?: (subagentId: string) => boolean | Promise<boolean>;
32
+ /** Stop the entire fleet (all running/idle subagents). Returns kill count. */
33
+ killFleet?: () => number | Promise<number>;
34
+ /** Spawn a subagent of the given role. Returns the new subagentId. */
35
+ spawnAgent?: (role: string, task?: string, maxIterations?: number) => Promise<string>;
36
+ /** Derive the session-unique mailbox tag for addressing (e.g. `leader@<tag>`). */
37
+ sessionTag: () => string;
38
+ /** Whether raw shell execution is explicitly opted-in by the operator. */
39
+ allowRunCommand: () => boolean;
40
+ }
41
+ /**
42
+ * Build the `onCommand` handler for an HQ publisher. The handler validates
43
+ * the command, dispatches through the controller, and returns an ack result
44
+ * (or throws to produce a `failed` ack — the publisher's `handleCommandBatch`
45
+ * wraps it). Best-effort: a dispatch failure never breaks the host.
46
+ */
47
+ export declare function createHqCommandDispatcher(controller: HqCommandController): (command: {
48
+ commandId: string;
49
+ type: string;
50
+ payload: unknown;
51
+ }) => Promise<HqPublisherCommandResult>;
52
+ //# sourceMappingURL=hq-command-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hq-command-controller.d.ts","sourceRoot":"","sources":["../src/hq-command-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,yFAAyF;IACzF,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,uEAAuE;IACvE,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpE,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,sEAAsE;IACtE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtF,kFAAkF;IAClF,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,0EAA0E;IAC1E,eAAe,EAAE,MAAM,OAAO,CAAC;CAChC;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,mBAAmB,GAC9B,CAAC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAcvG"}
@@ -0,0 +1,2 @@
1
+ export declare const HQ_HTML: string;
2
+ //# sourceMappingURL=hq-dashboard-html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hq-dashboard-html.d.ts","sourceRoot":"","sources":["../src/hq-dashboard-html.ts"],"names":[],"mappings":"AA4vEA,eAAO,MAAM,OAAO,EAAE,MAGyC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type CreateHqPublisherOptions, type HqPublisher } from '@wrongstack/core';
2
+ type CliHqPublisherOptions = Omit<CreateHqPublisherOptions, 'socketFactory'> & {
3
+ socketFactory?: CreateHqPublisherOptions['socketFactory'];
4
+ };
5
+ export interface CliHqConnection {
6
+ getPublisher(): HqPublisher | undefined;
7
+ stop(): void;
8
+ }
9
+ export interface CliHqConnectionOptions extends CliHqPublisherOptions {
10
+ onConnect?: ((publisher: HqPublisher) => void) | undefined;
11
+ retryIntervalMs?: number | undefined;
12
+ }
13
+ export declare function createCliHqPublisher(options: CliHqPublisherOptions): HqPublisher | undefined;
14
+ export declare function startCliHqConnection(options: CliHqConnectionOptions): CliHqConnection;
15
+ export {};
16
+ //# sourceMappingURL=hq-publisher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hq-publisher.d.ts","sourceRoot":"","sources":["../src/hq-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAEjB,MAAM,kBAAkB,CAAC;AAG1B,KAAK,qBAAqB,GAAG,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,GAAG;IAC7E,aAAa,CAAC,EAAE,wBAAwB,CAAC,eAAe,CAAC,CAAC;CAC3D,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,YAAY,IAAI,WAAW,GAAG,SAAS,CAAC;IACxC,IAAI,IAAI,IAAI,CAAC;CACd;AAED,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAMD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,GAAG,SAAS,CAK5F;AAmBD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAwCrF"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * HQ server — authentication, cookie management, and security headers.
3
+ *
4
+ * @module hq-server/auth
5
+ */
6
+ import type * as http from 'node:http';
7
+ export declare const HQ_SESSION_COOKIE = "hq.session";
8
+ export declare const HQ_SESSION_MAX_AGE_MS: number;
9
+ export interface HqBrowserAuthContext {
10
+ kind: 'token';
11
+ token: string;
12
+ id: string;
13
+ capabilities?: string[];
14
+ }
15
+ export type HqBrowserAuthResult = HqBrowserAuthContext | 'cookie' | undefined;
16
+ export declare function setHqSecurityHeaders(res: http.ServerResponse): void;
17
+ export declare function hasTrustedBrowserOrigin(req: http.IncomingMessage): boolean;
18
+ export declare function signHqSession(sessionId: string, secret: string): string;
19
+ export declare function serializeHqSessionCookie(sessionId: string, secret: string): string;
20
+ export declare function parseHqSessionCookie(value: string, secret: string): string | undefined;
21
+ export declare function parseCookieHeader(cookieHeader: string | undefined): Record<string, string>;
22
+ export declare function setHqSessionCookie(res: http.ServerResponse, value: string): void;
23
+ export declare function clearHqSessionCookie(res: http.ServerResponse): void;
24
+ export declare function isTokenAuth(auth: HqBrowserAuthResult): auth is HqBrowserAuthContext;
25
+ export declare function extractBrowserToken(req: http.IncomingMessage, url: URL): string | undefined;
26
+ export declare function authenticateBrowserRequest(req: http.IncomingMessage, url: URL, mutableAuth: {
27
+ browserTokens: Set<string>;
28
+ browserTokenObjs: Map<string, {
29
+ id: string;
30
+ capabilities?: string[];
31
+ }>;
32
+ passwordHash?: string | undefined;
33
+ cookieSecret?: string | undefined;
34
+ }, sessions: Map<string, {
35
+ createdAt: number;
36
+ }>): HqBrowserAuthResult;
37
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/hq-server/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAIvC,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,qBAAqB,QAA0B,CAAC;AAI7D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAI9E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CASnE;AAID,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,OAAO,CAe1E;AAID,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAElF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAatF;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAW1F;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAGhF;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAGnE;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,IAAI,oBAAoB,CAEnF;AAID,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAU3F;AAED,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,GAAG,EACR,WAAW,EAAE;IACX,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACvE,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,EACD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAC3C,mBAAmB,CAiBrB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * HQ server — snapshot builders for browser push and HTTP API responses.
3
+ *
4
+ * @module hq-server/snapshot
5
+ */
6
+ import { WebSocket } from 'ws';
7
+ import type { HqEventEnvelope, HqPersistence, HqSnapshot } from '@wrongstack/core';
8
+ import type { ConnectedClient, HqSnapshotBroadcaster, ProjectDetail } from './types.js';
9
+ export declare const HQ_SNAPSHOT_BROADCAST_DEBOUNCE_MS = 250;
10
+ export declare function buildSnapshot(clients: Map<WebSocket, ConnectedClient>): HqSnapshot;
11
+ export declare function createSnapshotBroadcaster(clients: Map<WebSocket, ConnectedClient>, browsers: Set<WebSocket>, persistence?: HqPersistence): HqSnapshotBroadcaster;
12
+ export declare function buildProjectDetail(clients: Map<WebSocket, ConnectedClient>, projectId: string): ProjectDetail | null;
13
+ export declare function broadcastEvent(event: HqEventEnvelope, browsers: Set<WebSocket>): void;
14
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/hq-server/snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAIV,eAAe,EAOf,aAAa,EAIb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKxF,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAIrD,wBAAgB,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG,UAAU,CAoSlF;AAID,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,EACxC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,EACxB,WAAW,CAAC,EAAE,aAAa,GAC1B,qBAAqB,CA0CvB;AAID,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,EACxC,SAAS,EAAE,MAAM,GAChB,aAAa,GAAG,IAAI,CAqDtB;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI,CAMrF"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Shared types for the HQ server modules.
3
+ *
4
+ * @module hq-server/types
5
+ */
6
+ import type { WebSocket } from 'ws';
7
+ import type { HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry } from '@wrongstack/core';
8
+ import type { HqBrowserMessage } from '@wrongstack/core';
9
+ export type { HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry, HqBrowserMessage, };
10
+ export interface TrackedSessionSnapshot {
11
+ payload: HqSessionSnapshotPayload;
12
+ /** Epoch ms of the last `session.snapshot` refresh — freshness authority for the cleanup timer. */
13
+ receivedAt: number;
14
+ }
15
+ export interface TrackedFleetSnapshot {
16
+ payload: HqFleetSnapshotPayload;
17
+ /** Owning session, when the publisher supplied one. */
18
+ sessionId?: string;
19
+ receivedAt: number;
20
+ }
21
+ export interface ConnectedClient {
22
+ ws: WebSocket;
23
+ clientId: string;
24
+ projectId: string;
25
+ project: HqProjectIdentity;
26
+ kind: string;
27
+ connectedAt: string;
28
+ lastSeenAt: string;
29
+ hostname?: string;
30
+ pid?: number;
31
+ version?: string;
32
+ capabilities: readonly string[];
33
+ /** Auth token used for this socket; absent only in explicit open mode. */
34
+ authToken?: HqToken;
35
+ /** Client-declared privacy policy; operator overrides are clamped dynamically. */
36
+ declaredRedactionPolicy: HqRedactionPolicy;
37
+ /** Highest accepted event sequence for replay/duplicate protection. */
38
+ lastEventSeq: number;
39
+ /** Per-client mailbox snapshots, keyed by projectId:mailboxId. */
40
+ mailboxes: Map<string, HqMailboxSnapshotPayload>;
41
+ /** Stable machine identifier — used for machine-level aggregation. */
42
+ machineId?: string;
43
+ /** Per-client session snapshots (the spine of the fleet tree). */
44
+ sessions: Map<string, TrackedSessionSnapshot>;
45
+ /** Per-client coordinator fleet snapshots, keyed by runId and owned by a session when known. */
46
+ fleets: Map<string, TrackedFleetSnapshot>;
47
+ /** Per-session MCP health snapshots, keyed by sessionId. */
48
+ mcpSnapshots: Map<string, HqMcpServerHealth[]>;
49
+ /** Pending outbound commands (Phase 3 — control plane). */
50
+ commandQueue: HqQueuedCommand[];
51
+ }
52
+ export interface TranscriptRing {
53
+ entries: HqTranscriptEntry[];
54
+ machineId?: string;
55
+ }
56
+ export interface HqSnapshotBroadcaster {
57
+ currentSerialized(): string;
58
+ broadcast(): void;
59
+ close(): void;
60
+ }
61
+ export interface ProjectDetail {
62
+ generatedAt: string;
63
+ project: HqProjectRecord;
64
+ clients: readonly HqClientRecord[];
65
+ mailboxes: readonly HqMailboxSnapshotPayload[];
66
+ }
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/hq-server/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,OAAO,EACP,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,OAAO,EACP,iBAAiB,EACjB,gBAAgB,GACjB,CAAC;AAIF,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,wBAAwB,CAAC;IAClC,mGAAmG;IACnG,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,sBAAsB,CAAC;IAChC,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,SAAS,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kFAAkF;IAClF,uBAAuB,EAAE,iBAAiB,CAAC;IAC3C,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACjD,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC9C,gGAAgG;IAChG,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC1C,4DAA4D;IAC5D,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC/C,2DAA2D;IAC3D,YAAY,EAAE,eAAe,EAAE,CAAC;CACjC;AAID,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,IAAI,MAAM,CAAC;IAC5B,SAAS,IAAI,IAAI,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;CACf;AAID,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,SAAS,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAChD"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * HQ server — general utility functions.
3
+ *
4
+ * @module hq-server/utils
5
+ */
6
+ import type * as http from 'node:http';
7
+ import type { HqEventEnvelope, HqPersistence, HqTranscriptEntry } from '@wrongstack/core';
8
+ export declare const TRANSCRIPT_RING_MAX = 4000;
9
+ export declare const MAX_TRANSCRIPT_SESSIONS = 400;
10
+ export declare const MAX_AGENT_RINGS = 800;
11
+ /**
12
+ * Evict oldest entries from a Map until its size ≤ max.
13
+ * Maps are insertion-ordered, so iterating keys() gives the oldest first.
14
+ */
15
+ export declare function evictOldest(map: Map<string, unknown>, max: number): void;
16
+ /**
17
+ * Ring key for one subagent's transcript. Scoped by session so same-named
18
+ * agents in different sessions (every leader is id 'leader') stay separate.
19
+ * Falls back to the bare subId when no session id is known (legacy clients).
20
+ */
21
+ export declare function agentRingKey(sessionId: string | undefined, subId: string): string;
22
+ /**
23
+ * Convert an `agent.message` payload record into a `HqTranscriptEntry` that
24
+ * is compact and viewable in the HQ session timeline. Mirrors the mapping the
25
+ * TUI-side buffered-transcript writer applies so the HQ stream looks
26
+ * identically to the live stream (thinking→thinking, system/status→system).
27
+ */
28
+ export declare function agentMessageToEntry(p: Record<string, unknown>): HqTranscriptEntry;
29
+ /**
30
+ * Read one local subagent's FULL conversation from disk. The agent monitor
31
+ * writes every timeline entry to
32
+ * <projectSessions>/<sessionId>/subagents/transcripts/<subId>/transcript.jsonl
33
+ * so for sessions on THIS machine we can serve the complete history — not
34
+ * just the ≤4000-entry live ring. Returns null when the session isn't local
35
+ * or the file is absent (caller falls back to the ring).
36
+ */
37
+ export declare function readLocalSubagentTranscript(sessionId: string, subagentId: string): Promise<HqTranscriptEntry[] | null>;
38
+ /** Safe URL-decoding — returns null on malformed input. */
39
+ export declare function decodePathSegment(value: string): string | null;
40
+ /** Normalize display host — "0.0.0.0" prints as "127.0.0.1" for user-facing URLs. */
41
+ export declare function displayHost(host: string): string;
42
+ /** Read the full body of an HTTP request as a UTF-8 string (capped at 1 MB). */
43
+ export declare function readRequestBody(req: http.IncomingMessage, maxBytes?: number): Promise<string>;
44
+ export declare function writeInvalidBody(res: http.ServerResponse, error: unknown): void;
45
+ export declare function buildHttpUrl(host: string, port: number, token?: string): string;
46
+ export declare function buildClientWsUrl(host: string, port: number, token?: string): string;
47
+ export declare function hqRuntimeMarkerPath(dataDir: string): string;
48
+ /** Non-internal IPv4 addresses, so we can print URLs reachable from other machines. */
49
+ export declare function lanIPv4Addresses(): string[];
50
+ export declare function truncateHqSummary(value: unknown, maxLength: number): string | undefined;
51
+ /**
52
+ * Stable per-machine key. Prefers hostname so the same physical computer maps
53
+ * to one machine even when clients report different per-process machineIds
54
+ * (older builds hashed `hostname:pid`). Falls back to machineId.
55
+ */
56
+ export declare function hqMachineKey(hostname: string | undefined, machineId: string | undefined): string;
57
+ /**
58
+ * Fold a cost/tool signal from an event envelope into the timeseries store.
59
+ * Recognizes `session.usage` (cost/tokens) and `tool.completed` (tool call).
60
+ * Best-effort, never throws.
61
+ */
62
+ export declare function recordTimeseriesSignal(persistence: HqPersistence, event: HqEventEnvelope): void;
63
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/hq-server/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAGvC,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAK1F,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,eAAe,MAAM,CAAC;AAInC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAMxE;AAID;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAmBjF;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,CA4BrC;AAID,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM9D;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAMD,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,SAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBhG;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAI/E;AAID,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAI/E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAInF;AAID,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAID,uFAAuF;AACvF,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAa3C;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIvF;AAID;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGhG;AAID;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAmB/F"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * HQ server — WebSocket handlers for browser and client connections.
3
+ *
4
+ * @module hq-server/ws
5
+ */
6
+ import { WebSocket } from 'ws';
7
+ import { type HqCommandAuditLog, type HqEventEnvelope, type HqPersistence, type HqRedactionPolicy, type HqToken, type HqTranscriptEntry } from '@wrongstack/core';
8
+ import type { ConnectedClient, HqSnapshotBroadcaster, TranscriptRing } from './types.js';
9
+ export declare function handleBrowser(ws: WebSocket, snapshotBroadcaster: HqSnapshotBroadcaster, browsers: Set<WebSocket>): void;
10
+ export declare function handleClient(ws: WebSocket, clients: Map<WebSocket, ConnectedClient>, browsers: Set<WebSocket>, eventLog: HqEventEnvelope[], auth: {
11
+ token?: HqToken | undefined;
12
+ getOperatorPolicy: () => Partial<HqRedactionPolicy> | undefined;
13
+ }, snapshotBroadcaster: HqSnapshotBroadcaster, transcripts: Map<string, TranscriptRing>, agentMessages: Map<string, HqTranscriptEntry[]>, persistence?: HqPersistence, auditLog?: HqCommandAuditLog): void;
14
+ //# sourceMappingURL=ws.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src/hq-server/ws.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EASL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAKpB,KAAK,aAAa,EAElB,KAAK,iBAAiB,EAGtB,KAAK,OAAO,EAEZ,KAAK,iBAAiB,EAEvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAmBzF,wBAAgB,aAAa,CAC3B,EAAE,EAAE,SAAS,EACb,mBAAmB,EAAE,qBAAqB,EAC1C,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,GACvB,IAAI,CAsBN;AAID,wBAAgB,YAAY,CAC1B,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,EACxC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,EACxB,QAAQ,EAAE,eAAe,EAAE,EAC3B,IAAI,EAAE;IACJ,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,iBAAiB,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC;CACjE,EACD,mBAAmB,EAAE,qBAAqB,EAC1C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EACxC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAC/C,WAAW,CAAC,EAAE,aAAa,EAC3B,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,IAAI,CAiaN"}
@@ -0,0 +1,60 @@
1
+ import { type HqTranscriptEntry } from '@wrongstack/core';
2
+ import { HQ_HTML } from './hq-dashboard-html.js';
3
+ export interface HqServerOptions {
4
+ host?: string;
5
+ port?: number;
6
+ strictPort?: boolean;
7
+ /**
8
+ * When true, the server binds exactly to `port` and fails with an error
9
+ * if that port is already in use — no port scanning. Use this when the
10
+ * user explicitly selected a port and we should not silently pick another.
11
+ */
12
+ exactPort?: boolean;
13
+ /**
14
+ * HQ data directory. When omitted, the server resolves one via
15
+ * `resolveHqDataDir()` (honoring `WRONGSTACK_HQ_DATA_DIR` then falling
16
+ * back to `~/.wrongstack/hq`). The directory holds `auth.json` and, in
17
+ * later phases, the persistent event log and snapshot cache.
18
+ */
19
+ dataDir?: string;
20
+ /** Browser liveness frame interval. Primarily exposed for deterministic integration tests. */
21
+ browserHeartbeatIntervalMs?: number;
22
+ /** Connected-client inactivity timeout. Primarily exposed for deterministic integration tests. */
23
+ clientTtlMs?: number;
24
+ /** Stale-client scan interval. Primarily exposed for deterministic integration tests. */
25
+ clientCleanupIntervalMs?: number;
26
+ /** Session-snapshot freshness timeout. Primarily exposed for deterministic integration tests. */
27
+ sessionSnapshotTtlMs?: number;
28
+ /** Optional browser password login. When provided on first-run, the auth file stores a scrypt hash. */
29
+ password?: string;
30
+ }
31
+ export interface HqStartupConnectionInfo {
32
+ dataDir: string;
33
+ browserUrl: string;
34
+ clientUrl: string;
35
+ clientEnv: {
36
+ WRONGSTACK_HQ_URL: string;
37
+ WRONGSTACK_HQ_TOKEN?: string;
38
+ };
39
+ createdAuth: boolean;
40
+ }
41
+ export type HqFirstRunSetup = HqStartupConnectionInfo;
42
+ export interface HqServerHandle {
43
+ host: string;
44
+ port: number;
45
+ firstRunSetup?: HqFirstRunSetup;
46
+ close(): Promise<void>;
47
+ }
48
+ /**
49
+ * Read one local subagent's FULL conversation from disk. The agent monitor
50
+ * writes every timeline entry to
51
+ * <projectSessions>/<sessionId>/subagents/transcripts/<subId>/transcript.jsonl
52
+ * so for sessions on THIS machine we can serve the complete history — not
53
+ * just the ≤4000-entry live ring. Returns null when the session isn't local
54
+ * or the file is absent (caller falls back to the ring).
55
+ */
56
+ export declare function readLocalSubagentTranscript(sessionId: string, subagentId: string): Promise<HqTranscriptEntry[] | null>;
57
+ export declare const DEFAULT_PORT = 3499;
58
+ export { HQ_HTML };
59
+ export declare function startHqServer(options?: HqServerOptions): Promise<HqServerHandle>;
60
+ //# sourceMappingURL=hq-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hq-server.d.ts","sourceRoot":"","sources":["../src/hq-server.ts"],"names":[],"mappings":"AAsBA,OAAO,EAYL,KAAK,iBAAiB,EAevB,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,kGAAkG;IAClG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,iGAAiG;IACjG,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uGAAuG;IACvG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE;QACT,iBAAiB,EAAE,MAAM,CAAC;QAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IACF,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAoHD;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,CA4BrC;AAGD,eAAO,MAAM,YAAY,OAAO,CAAC;AAsHjC,OAAO,EAAE,OAAO,EAAE,CAAC;AAsJnB,wBAAsB,aAAa,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAa1F"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * HQ static-serve — resolve and serve the built `@wrongstack/webui-hq/dist`
3
+ * dashboard. Mirrors the pattern in `webui-server/static-serve.ts` but for
4
+ * the HQ app. Falls back to the inline `HQ_HTML` when the dist is unbuilt so
5
+ * HQ is always functional.
6
+ *
7
+ * @module hq-static-serve
8
+ */
9
+ import type * as http from 'node:http';
10
+ /**
11
+ * Resolve the HQ dashboard dist directory. Returns the absolute path to
12
+ * `@wrongstack/webui-hq/dist`, or `null` when the package/dist is not
13
+ * present (e.g. unbuilt). Result is cached for the process lifetime.
14
+ */
15
+ export declare function resolveHqDistDir(): string | null;
16
+ export interface ServeStaticResult {
17
+ handled: boolean;
18
+ }
19
+ /**
20
+ * Serve a static file from the HQ dist for an HTTP request. Handles the SPA
21
+ * fallback (unknown routes → index.html). Returns `{handled:false}` when the
22
+ * dist is not available (caller should serve the inline fallback) or the
23
+ * path doesn't match a static asset.
24
+ */
25
+ export declare function serveHqStatic(_req: http.IncomingMessage, res: http.ServerResponse, urlPath: string, distDir: string): ServeStaticResult;
26
+ //# sourceMappingURL=hq-static-serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hq-static-serve.d.ts","sourceRoot":"","sources":["../src/hq-static-serve.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAsBvC;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAyChD;AAQD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,eAAe,EAC1B,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,iBAAiB,CA2BnB"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- declare const CLI_VERSION: string;
2
-
3
- declare function main(argv: string[]): Promise<number>;
4
-
5
- export { CLI_VERSION, main };
1
+ export { main } from './cli-main.js';
2
+ export { CLI_VERSION } from './version.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}