@wrongstack/cli 0.296.4 → 0.298.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 (523) hide show
  1. package/dist/{acp-A5OSIU2P.js → acp-S4LZQB66.js} +91 -23
  2. package/dist/{auth-CJWQJVRH.js → auth-NLLGEYQR.js} +3 -3
  3. package/dist/boot/dispatch-webui.d.ts +7 -0
  4. package/dist/boot/governance-evidence-candidate.d.ts +3 -0
  5. package/dist/boot/governance-shadow-bridge.d.ts +19 -0
  6. package/dist/boot/governance-trace-context.d.ts +64 -0
  7. package/dist/boot/launch-banner.d.ts +22 -0
  8. package/dist/boot/tui-session-resume.d.ts +10 -1
  9. package/dist/chimera-leader-wake.d.ts +57 -0
  10. package/dist/chimera-reviewer-policy.d.ts +89 -1
  11. package/dist/chimera-subagent-ladder.d.ts +72 -0
  12. package/dist/{chunk-AZESNNIC.js → chunk-4HH3YGG4.js} +3 -3
  13. package/dist/{chunk-IHBYBYGA.js → chunk-A6Q5KGLV.js} +51 -18
  14. package/dist/{chunk-ABXK4VVY.js → chunk-ARWGQUB3.js} +2 -1
  15. package/dist/{chunk-OI7GWJDS.js → chunk-C5GH4YBL.js} +1389 -184
  16. package/dist/{chunk-TADVX644.js → chunk-GO3TJICK.js} +11 -2
  17. package/dist/{chunk-JBTFWWKV.js → chunk-I2BM6FK6.js} +9 -4
  18. package/dist/{chunk-AXVZMEWG.js → chunk-I5MEUFDI.js} +2 -2
  19. package/dist/{chunk-WY7KKOUK.js → chunk-JW75HY4F.js} +31 -10
  20. package/dist/chunk-U3SS4NRH.js +10 -0
  21. package/dist/{chunk-Z7YGASQP.js → chunk-V3XH6XBJ.js} +30 -26
  22. package/dist/{chunk-BQCAJ7FI.js → chunk-XTIXVJXP.js} +16 -3
  23. package/dist/{cli-main-TOAWVJDY.js → cli-main-TJEU4OUY.js} +25912 -25134
  24. package/dist/cli-main-helpers.d.ts +42 -2
  25. package/dist/{execution-O7I5DYE6.js → execution-INOV5P7N.js} +1264 -650
  26. package/dist/execution-chimera-cascade.d.ts +7 -1
  27. package/dist/execution-chimera-review.d.ts +35 -0
  28. package/dist/fleet/host-types.d.ts +6 -1
  29. package/dist/fleet-statusline.d.ts +1 -0
  30. package/dist/goal-host.d.ts +1 -1
  31. package/dist/governance-V2Z42RBE.js +65 -0
  32. package/dist/governance-hq-telemetry.d.ts +17 -0
  33. package/dist/{hq-JUYKUNJX.js → hq-WO6CLUSI.js} +2 -2
  34. package/dist/hq-publisher.d.ts +3 -2
  35. package/dist/hq-server/auth.d.ts +33 -2
  36. package/dist/hq-server/login-attempt-store.d.ts +73 -0
  37. package/dist/hq-server/routes/auth-handlers.d.ts +73 -5
  38. package/dist/hq-server/routes.d.ts +5 -5
  39. package/dist/hq-server/types.d.ts +44 -2
  40. package/dist/hq-server/utils.d.ts +51 -6
  41. package/dist/hq-server/ws.d.ts +61 -2
  42. package/dist/{hq-server-6AQ3BXZA.js → hq-server-6TSAORAC.js} +2 -2
  43. package/dist/hq-server.d.ts +10 -0
  44. package/dist/index.js +337 -42
  45. package/dist/kanban-hq-sync.d.ts +13 -1
  46. package/dist/live-settings-input.d.ts +10 -1
  47. package/dist/{mailbox-serve-2UWHEN3M.js → mailbox-serve-DBOOOOWZ.js} +50 -8
  48. package/dist/{sdd-runtime-JG4EEKL6.js → sdd-runtime-AIJCJGWC.js} +2 -2
  49. package/dist/services/sdd/state.d.ts +3 -3
  50. package/dist/settings-menu.d.ts +1 -1
  51. package/dist/slash-commands/command-context.d.ts +2 -0
  52. package/dist/slash-commands/fallback.d.ts +2 -0
  53. package/dist/slash-commands/goal-refiner.d.ts +1 -1
  54. package/dist/slash-commands/goal.d.ts +1 -1
  55. package/dist/subcommands/handlers/acp-connection-gate.d.ts +20 -0
  56. package/dist/subcommands/handlers/governance.d.ts +8 -0
  57. package/dist/{update-YC4TYW2Y.js → update-MV6TUACD.js} +3 -3
  58. package/dist/utils/win32-cmd.d.ts +9 -6
  59. package/dist/{version-help-DROHZRW6.js → version-help-ASKQYXDJ.js} +2 -2
  60. package/dist/webui-server/kanban-host-adapter.d.ts +1 -1
  61. package/dist/webui-server/session-start-payload.d.ts +4 -0
  62. package/dist/{webui-server-ZF5KVGC5.js → webui-server-PCLSXX6L.js} +164 -134
  63. package/dist/webui-server-options.d.ts +7 -0
  64. package/dist/wiring/brain-and-orchestration.d.ts +2 -0
  65. package/dist/wiring/hq-telemetry.d.ts +4 -3
  66. package/dist/wiring/lifecycle-plugins.d.ts +5 -8
  67. package/dist/wiring/metrics.d.ts +1 -1
  68. package/dist/wiring/provider-runtime-setup.d.ts +2 -2
  69. package/package.json +23 -22
  70. package/dist/acp-A5OSIU2P.js.map +0 -7
  71. package/dist/acp-registry-cache.d.ts.map +0 -1
  72. package/dist/acp-server-agent.d.ts.map +0 -1
  73. package/dist/arg-parser.d.ts.map +0 -1
  74. package/dist/audit-2ZSFGNIF.js.map +0 -7
  75. package/dist/auth-CJWQJVRH.js.map +0 -7
  76. package/dist/auth-menu/add-provider.d.ts.map +0 -1
  77. package/dist/auth-menu/anthropic-oauth.d.ts.map +0 -1
  78. package/dist/auth-menu/auth-menu-audit.d.ts.map +0 -1
  79. package/dist/auth-menu/direct.d.ts.map +0 -1
  80. package/dist/auth-menu/github-copilot-oauth.d.ts.map +0 -1
  81. package/dist/auth-menu/helpers.d.ts.map +0 -1
  82. package/dist/auth-menu/index.d.ts.map +0 -1
  83. package/dist/auth-menu/local-presets.d.ts.map +0 -1
  84. package/dist/auth-menu/local.d.ts.map +0 -1
  85. package/dist/auth-menu/loopback-server.d.ts.map +0 -1
  86. package/dist/auth-menu/oauth-menu.d.ts.map +0 -1
  87. package/dist/auth-menu/openai-codex-oauth.d.ts.map +0 -1
  88. package/dist/auth-menu/panel-service.d.ts.map +0 -1
  89. package/dist/auth-menu/provider-menu.d.ts.map +0 -1
  90. package/dist/auth-menu/shared.d.ts.map +0 -1
  91. package/dist/auth-menu/top-menu.d.ts.map +0 -1
  92. package/dist/auth-menu/types.d.ts.map +0 -1
  93. package/dist/auth-menu.d.ts.map +0 -1
  94. package/dist/bench-7ZDWSNEF.js.map +0 -7
  95. package/dist/boot/auto-discover-providers.d.ts.map +0 -1
  96. package/dist/boot/brain-decision-log.d.ts.map +0 -1
  97. package/dist/boot/config-backup-recovery.d.ts.map +0 -1
  98. package/dist/boot/container-wiring.d.ts.map +0 -1
  99. package/dist/boot/dispatch-singleshot.d.ts.map +0 -1
  100. package/dist/boot/dispatch-tui.d.ts.map +0 -1
  101. package/dist/boot/dispatch-webui.d.ts.map +0 -1
  102. package/dist/boot/event-wiring.d.ts.map +0 -1
  103. package/dist/boot/execution-mode.d.ts.map +0 -1
  104. package/dist/boot/launch-menu.d.ts.map +0 -1
  105. package/dist/boot/short-circuit-desktop.d.ts.map +0 -1
  106. package/dist/boot/short-circuit-flags.d.ts.map +0 -1
  107. package/dist/boot/short-circuit-hq.d.ts.map +0 -1
  108. package/dist/boot/simpleui-full-auto.d.ts.map +0 -1
  109. package/dist/boot/system-prompt-builder.d.ts.map +0 -1
  110. package/dist/boot/system-prompt.d.ts.map +0 -1
  111. package/dist/boot/tool-registry.d.ts.map +0 -1
  112. package/dist/boot/tui-coordinator-callbacks.d.ts.map +0 -1
  113. package/dist/boot/tui-coordinator-setup.d.ts.map +0 -1
  114. package/dist/boot/tui-debug-stream.d.ts.map +0 -1
  115. package/dist/boot/tui-goal-wiring.d.ts.map +0 -1
  116. package/dist/boot/tui-live-sessions.d.ts.map +0 -1
  117. package/dist/boot/tui-project-picker-callback.d.ts.map +0 -1
  118. package/dist/boot/tui-project-spawn.d.ts.map +0 -1
  119. package/dist/boot/tui-project-switch.d.ts.map +0 -1
  120. package/dist/boot/tui-runtime-state.d.ts.map +0 -1
  121. package/dist/boot/tui-sdd-callback.d.ts.map +0 -1
  122. package/dist/boot/tui-session-resume.d.ts.map +0 -1
  123. package/dist/boot/tui-settings-adapter.d.ts.map +0 -1
  124. package/dist/boot-config.d.ts.map +0 -1
  125. package/dist/boot.d.ts.map +0 -1
  126. package/dist/brain-menu/panel-service.d.ts.map +0 -1
  127. package/dist/chimera-review-task.d.ts.map +0 -1
  128. package/dist/chimera-reviewer-policy.d.ts.map +0 -1
  129. package/dist/chronicle-QQEQFSSE.js.map +0 -7
  130. package/dist/chunk-5N34EWJR.js.map +0 -7
  131. package/dist/chunk-66T43Q4Y.js.map +0 -7
  132. package/dist/chunk-7OCVIDC7.js.map +0 -7
  133. package/dist/chunk-ABXK4VVY.js.map +0 -7
  134. package/dist/chunk-AXVZMEWG.js.map +0 -7
  135. package/dist/chunk-AZESNNIC.js.map +0 -7
  136. package/dist/chunk-BGFM3PD7.js.map +0 -7
  137. package/dist/chunk-BQCAJ7FI.js.map +0 -7
  138. package/dist/chunk-DPJZQCVP.js.map +0 -7
  139. package/dist/chunk-F4PEGAJZ.js.map +0 -7
  140. package/dist/chunk-IHBYBYGA.js.map +0 -7
  141. package/dist/chunk-JBSQ7ONN.js.map +0 -7
  142. package/dist/chunk-JBTFWWKV.js.map +0 -7
  143. package/dist/chunk-JUHRI6OV.js.map +0 -7
  144. package/dist/chunk-OI7GWJDS.js.map +0 -7
  145. package/dist/chunk-OP47B3IX.js.map +0 -7
  146. package/dist/chunk-PJHET45A.js.map +0 -7
  147. package/dist/chunk-Q5GTM25S.js.map +0 -7
  148. package/dist/chunk-QD544J2B.js.map +0 -7
  149. package/dist/chunk-QUNHS6O3.js.map +0 -7
  150. package/dist/chunk-TADVX644.js.map +0 -7
  151. package/dist/chunk-TGDHN4LM.js.map +0 -7
  152. package/dist/chunk-TYO2OVAD.js.map +0 -7
  153. package/dist/chunk-VCYZ3WZV.js.map +0 -7
  154. package/dist/chunk-VJUEZZYB.js +0 -29
  155. package/dist/chunk-VJUEZZYB.js.map +0 -7
  156. package/dist/chunk-WHOIR577.js.map +0 -7
  157. package/dist/chunk-WY7KKOUK.js.map +0 -7
  158. package/dist/chunk-XJXDOF63.js.map +0 -7
  159. package/dist/chunk-XWEGWYDU.js.map +0 -7
  160. package/dist/chunk-YWUPHRGB.js.map +0 -7
  161. package/dist/chunk-Z7YGASQP.js.map +0 -7
  162. package/dist/cli-bundled-prompts.d.ts.map +0 -1
  163. package/dist/cli-bundled-skills.d.ts.map +0 -1
  164. package/dist/cli-context.d.ts.map +0 -1
  165. package/dist/cli-entry-main.d.ts.map +0 -1
  166. package/dist/cli-entry-point.d.ts.map +0 -1
  167. package/dist/cli-eternal-flag.d.ts.map +0 -1
  168. package/dist/cli-main-TOAWVJDY.js.map +0 -7
  169. package/dist/cli-main-helpers.d.ts.map +0 -1
  170. package/dist/cli-main.d.ts.map +0 -1
  171. package/dist/cli-update-notice.d.ts.map +0 -1
  172. package/dist/config-doctor.d.ts.map +0 -1
  173. package/dist/config-history.d.ts.map +0 -1
  174. package/dist/context-limit.d.ts.map +0 -1
  175. package/dist/context-overflow-diagnostic.d.ts.map +0 -1
  176. package/dist/diag-doctor-OQ3AA63O.js.map +0 -7
  177. package/dist/diff-renderer.d.ts.map +0 -1
  178. package/dist/execute-deps.d.ts.map +0 -1
  179. package/dist/execution-O7I5DYE6.js.map +0 -7
  180. package/dist/execution-chimera-ask.d.ts.map +0 -1
  181. package/dist/execution-chimera-cascade.d.ts.map +0 -1
  182. package/dist/execution-cleanup.d.ts.map +0 -1
  183. package/dist/execution-kanban-dispatch.d.ts.map +0 -1
  184. package/dist/execution-repl-fleet-callbacks.d.ts.map +0 -1
  185. package/dist/execution-storage-observability.d.ts.map +0 -1
  186. package/dist/execution-tui-next-step-callbacks.d.ts.map +0 -1
  187. package/dist/execution.d.ts.map +0 -1
  188. package/dist/export-TPORYVRZ.js.map +0 -7
  189. package/dist/fleet/host-acp-runner-cache.d.ts.map +0 -1
  190. package/dist/fleet/host-acp.d.ts.map +0 -1
  191. package/dist/fleet/host-concurrency.d.ts.map +0 -1
  192. package/dist/fleet/host-context.d.ts.map +0 -1
  193. package/dist/fleet/host-director-builder.d.ts.map +0 -1
  194. package/dist/fleet/host-director-event-bridges.d.ts.map +0 -1
  195. package/dist/fleet/host-director-services.d.ts.map +0 -1
  196. package/dist/fleet/host-event-bridge.d.ts.map +0 -1
  197. package/dist/fleet/host-helpers.d.ts.map +0 -1
  198. package/dist/fleet/host-learning-tracker.d.ts.map +0 -1
  199. package/dist/fleet/host-learning.d.ts.map +0 -1
  200. package/dist/fleet/host-lifecycle-events.d.ts.map +0 -1
  201. package/dist/fleet/host-paths.d.ts.map +0 -1
  202. package/dist/fleet/host-provider.d.ts.map +0 -1
  203. package/dist/fleet/host-session-writer.d.ts.map +0 -1
  204. package/dist/fleet/host-shadow-pass.d.ts.map +0 -1
  205. package/dist/fleet/host-spawn-types.d.ts.map +0 -1
  206. package/dist/fleet/host-status.d.ts.map +0 -1
  207. package/dist/fleet/host-subagent-factory.d.ts.map +0 -1
  208. package/dist/fleet/host-supervisor.d.ts.map +0 -1
  209. package/dist/fleet/host-task-result-report.d.ts.map +0 -1
  210. package/dist/fleet/host-types.d.ts.map +0 -1
  211. package/dist/fleet/host.d.ts.map +0 -1
  212. package/dist/fleet/routing.d.ts.map +0 -1
  213. package/dist/fleet/status-broadcast.d.ts.map +0 -1
  214. package/dist/fleet/supervisor-registry.d.ts.map +0 -1
  215. package/dist/fleet-statusline.d.ts.map +0 -1
  216. package/dist/goal-host.d.ts.map +0 -1
  217. package/dist/hooks-wiring.d.ts.map +0 -1
  218. package/dist/hq-JUYKUNJX.js.map +0 -7
  219. package/dist/hq-command-controller.d.ts.map +0 -1
  220. package/dist/hq-publisher.d.ts.map +0 -1
  221. package/dist/hq-recovery-html.d.ts.map +0 -1
  222. package/dist/hq-server/audit-actor.d.ts.map +0 -1
  223. package/dist/hq-server/auth-state.d.ts.map +0 -1
  224. package/dist/hq-server/auth.d.ts.map +0 -1
  225. package/dist/hq-server/preflight.d.ts.map +0 -1
  226. package/dist/hq-server/project-root.d.ts.map +0 -1
  227. package/dist/hq-server/routes/auth-handlers.d.ts.map +0 -1
  228. package/dist/hq-server/routes/session-handlers.d.ts.map +0 -1
  229. package/dist/hq-server/routes/system-handlers.d.ts.map +0 -1
  230. package/dist/hq-server/routes.d.ts.map +0 -1
  231. package/dist/hq-server/snapshot.d.ts.map +0 -1
  232. package/dist/hq-server/startup.d.ts.map +0 -1
  233. package/dist/hq-server/trust-boundary.d.ts.map +0 -1
  234. package/dist/hq-server/types.d.ts.map +0 -1
  235. package/dist/hq-server/utils.d.ts.map +0 -1
  236. package/dist/hq-server/ws.d.ts.map +0 -1
  237. package/dist/hq-server-6AQ3BXZA.js.map +0 -7
  238. package/dist/hq-server.d.ts.map +0 -1
  239. package/dist/hq-static-serve.d.ts.map +0 -1
  240. package/dist/hq-ttl-U2FAYFAT.js.map +0 -7
  241. package/dist/hq-tunnel-RFKGC4HI.js.map +0 -7
  242. package/dist/hq-tunnel.d.ts.map +0 -1
  243. package/dist/index.d.ts.map +0 -1
  244. package/dist/index.js.map +0 -7
  245. package/dist/init-E2NDDOHI.js.map +0 -7
  246. package/dist/input-reader.d.ts.map +0 -1
  247. package/dist/kanban-dispatch-route.d.ts.map +0 -1
  248. package/dist/kanban-hq-sync.d.ts.map +0 -1
  249. package/dist/kanban-run-mirror-EKVNGXWW.js.map +0 -7
  250. package/dist/launch-hints.d.ts.map +0 -1
  251. package/dist/live-settings-input.d.ts.map +0 -1
  252. package/dist/mailbox-bridge-bootstrap.d.ts.map +0 -1
  253. package/dist/mailbox-serve-2UWHEN3M.js.map +0 -7
  254. package/dist/mcp-CYLPUEHC.js.map +0 -7
  255. package/dist/mcp-serve.d.ts.map +0 -1
  256. package/dist/modeldiag-HENYJ4N7.js.map +0 -7
  257. package/dist/multi-agent.d.ts.map +0 -1
  258. package/dist/next-task-predictor.d.ts.map +0 -1
  259. package/dist/permission-prompt.d.ts.map +0 -1
  260. package/dist/permissions-FNYLZIL4.js.map +0 -7
  261. package/dist/picker-key-state.d.ts.map +0 -1
  262. package/dist/picker-model-picker.d.ts.map +0 -1
  263. package/dist/picker-ui.d.ts.map +0 -1
  264. package/dist/picker.d.ts.map +0 -1
  265. package/dist/plugin-api-factory.d.ts.map +0 -1
  266. package/dist/plugin-management.d.ts.map +0 -1
  267. package/dist/plugin-usage-OU6X6LM3.js.map +0 -7
  268. package/dist/plugins-4LJ5IUBI.js.map +0 -7
  269. package/dist/pre-launch/launch-prompts.d.ts.map +0 -1
  270. package/dist/pre-launch/project-check.d.ts.map +0 -1
  271. package/dist/pre-launch.d.ts.map +0 -1
  272. package/dist/preflight.d.ts.map +0 -1
  273. package/dist/profile-config-path.d.ts.map +0 -1
  274. package/dist/project-BLQ3ALVL.js.map +0 -7
  275. package/dist/project-manifest-GE25PW4S.js.map +0 -7
  276. package/dist/project-picker-BOCWHBXP.js.map +0 -7
  277. package/dist/project-picker.d.ts.map +0 -1
  278. package/dist/projects-XE76NFNZ.js.map +0 -7
  279. package/dist/provider-config-utils.d.ts.map +0 -1
  280. package/dist/provider-helpers.d.ts.map +0 -1
  281. package/dist/provider-id.d.ts.map +0 -1
  282. package/dist/providers-models-GDELBHZK.js.map +0 -7
  283. package/dist/quick-VIO2BEHS.js.map +0 -7
  284. package/dist/renderer.d.ts.map +0 -1
  285. package/dist/repl-auto-proceed.d.ts.map +0 -1
  286. package/dist/repl-client-registration.d.ts.map +0 -1
  287. package/dist/repl-input.d.ts.map +0 -1
  288. package/dist/repl-options.d.ts.map +0 -1
  289. package/dist/repl-rendering.d.ts.map +0 -1
  290. package/dist/repl-suggestions.d.ts.map +0 -1
  291. package/dist/repl.d.ts.map +0 -1
  292. package/dist/replay-KCTXNMZQ.js.map +0 -7
  293. package/dist/rewind-EJMVFVLS.js.map +0 -7
  294. package/dist/sdd-runtime-JG4EEKL6.js.map +0 -7
  295. package/dist/services/autonomy-mode.d.ts.map +0 -1
  296. package/dist/services/commit-message.d.ts.map +0 -1
  297. package/dist/services/dispatch-classifier.d.ts.map +0 -1
  298. package/dist/services/mcp-management.d.ts.map +0 -1
  299. package/dist/services/project-facts.d.ts.map +0 -1
  300. package/dist/services/project-manifest.d.ts.map +0 -1
  301. package/dist/services/sdd/project-context.d.ts.map +0 -1
  302. package/dist/services/sdd/spec-detection.d.ts.map +0 -1
  303. package/dist/services/sdd/state.d.ts.map +0 -1
  304. package/dist/services/sdd/task-manager.d.ts.map +0 -1
  305. package/dist/services/sdd-runtime.d.ts.map +0 -1
  306. package/dist/services/statusline-config.d.ts.map +0 -1
  307. package/dist/services/suggestion-store.d.ts.map +0 -1
  308. package/dist/session-event-wiring.d.ts.map +0 -1
  309. package/dist/session-stats.d.ts.map +0 -1
  310. package/dist/sessions-config-NLCMK3BY.js.map +0 -7
  311. package/dist/settings-menu.d.ts.map +0 -1
  312. package/dist/shutdown-cleanup.d.ts.map +0 -1
  313. package/dist/simpleui-dist-JIFGUJO7.js.map +0 -7
  314. package/dist/simpleui-dist.d.ts.map +0 -1
  315. package/dist/slash-commands/acp.d.ts.map +0 -1
  316. package/dist/slash-commands/agent-improve.d.ts.map +0 -1
  317. package/dist/slash-commands/agents.d.ts.map +0 -1
  318. package/dist/slash-commands/audit.d.ts.map +0 -1
  319. package/dist/slash-commands/auth.d.ts.map +0 -1
  320. package/dist/slash-commands/autonomy.d.ts.map +0 -1
  321. package/dist/slash-commands/brain.d.ts.map +0 -1
  322. package/dist/slash-commands/btw.d.ts.map +0 -1
  323. package/dist/slash-commands/clear.d.ts.map +0 -1
  324. package/dist/slash-commands/codebase-reindex.d.ts.map +0 -1
  325. package/dist/slash-commands/collab.d.ts.map +0 -1
  326. package/dist/slash-commands/command-context.d.ts.map +0 -1
  327. package/dist/slash-commands/commit-llm.d.ts.map +0 -1
  328. package/dist/slash-commands/compact.d.ts.map +0 -1
  329. package/dist/slash-commands/context.d.ts.map +0 -1
  330. package/dist/slash-commands/coordinator.d.ts.map +0 -1
  331. package/dist/slash-commands/delegate.d.ts.map +0 -1
  332. package/dist/slash-commands/design.d.ts.map +0 -1
  333. package/dist/slash-commands/dev.d.ts.map +0 -1
  334. package/dist/slash-commands/diag-stats.d.ts.map +0 -1
  335. package/dist/slash-commands/dispatch-llm.d.ts.map +0 -1
  336. package/dist/slash-commands/doctor.d.ts.map +0 -1
  337. package/dist/slash-commands/enhance.d.ts.map +0 -1
  338. package/dist/slash-commands/ensemble.d.ts.map +0 -1
  339. package/dist/slash-commands/f-keys.d.ts.map +0 -1
  340. package/dist/slash-commands/fallback.d.ts.map +0 -1
  341. package/dist/slash-commands/fix-classifier.d.ts.map +0 -1
  342. package/dist/slash-commands/fix.d.ts.map +0 -1
  343. package/dist/slash-commands/fleet.d.ts.map +0 -1
  344. package/dist/slash-commands/git.d.ts.map +0 -1
  345. package/dist/slash-commands/gitid.d.ts.map +0 -1
  346. package/dist/slash-commands/goal-refiner.d.ts.map +0 -1
  347. package/dist/slash-commands/goal.d.ts.map +0 -1
  348. package/dist/slash-commands/health.d.ts.map +0 -1
  349. package/dist/slash-commands/help.d.ts.map +0 -1
  350. package/dist/slash-commands/helpers.d.ts.map +0 -1
  351. package/dist/slash-commands/hq.d.ts.map +0 -1
  352. package/dist/slash-commands/index.d.ts.map +0 -1
  353. package/dist/slash-commands/init.d.ts.map +0 -1
  354. package/dist/slash-commands/interrupt.d.ts.map +0 -1
  355. package/dist/slash-commands/kanban-agent-helpers.d.ts.map +0 -1
  356. package/dist/slash-commands/kanban-format.d.ts.map +0 -1
  357. package/dist/slash-commands/kanban-help.d.ts.map +0 -1
  358. package/dist/slash-commands/kanban.d.ts.map +0 -1
  359. package/dist/slash-commands/mailbox-demo.d.ts.map +0 -1
  360. package/dist/slash-commands/mailbox-serve.d.ts.map +0 -1
  361. package/dist/slash-commands/mailbox.d.ts.map +0 -1
  362. package/dist/slash-commands/mcp-utils.d.ts.map +0 -1
  363. package/dist/slash-commands/mcp.d.ts.map +0 -1
  364. package/dist/slash-commands/memory-compact.d.ts.map +0 -1
  365. package/dist/slash-commands/memory-flags.d.ts.map +0 -1
  366. package/dist/slash-commands/memory-formatters.d.ts.map +0 -1
  367. package/dist/slash-commands/memory.d.ts.map +0 -1
  368. package/dist/slash-commands/metrics.d.ts.map +0 -1
  369. package/dist/slash-commands/mode.d.ts.map +0 -1
  370. package/dist/slash-commands/modelcaps.d.ts.map +0 -1
  371. package/dist/slash-commands/models.d.ts.map +0 -1
  372. package/dist/slash-commands/mouse.d.ts.map +0 -1
  373. package/dist/slash-commands/next.d.ts.map +0 -1
  374. package/dist/slash-commands/plan.d.ts.map +0 -1
  375. package/dist/slash-commands/plugin.d.ts.map +0 -1
  376. package/dist/slash-commands/profile.d.ts.map +0 -1
  377. package/dist/slash-commands/project-utils.d.ts.map +0 -1
  378. package/dist/slash-commands/project.d.ts.map +0 -1
  379. package/dist/slash-commands/provider-status.d.ts.map +0 -1
  380. package/dist/slash-commands/prune.d.ts.map +0 -1
  381. package/dist/slash-commands/refiner.d.ts.map +0 -1
  382. package/dist/slash-commands/review.d.ts.map +0 -1
  383. package/dist/slash-commands/sdd/rendering.d.ts.map +0 -1
  384. package/dist/slash-commands/sdd-command-helpers.d.ts.map +0 -1
  385. package/dist/slash-commands/sdd-format.d.ts.map +0 -1
  386. package/dist/slash-commands/sdd.d.ts.map +0 -1
  387. package/dist/slash-commands/security.d.ts.map +0 -1
  388. package/dist/slash-commands/session.d.ts.map +0 -1
  389. package/dist/slash-commands/setmodel.d.ts.map +0 -1
  390. package/dist/slash-commands/settings.d.ts.map +0 -1
  391. package/dist/slash-commands/shadow.d.ts.map +0 -1
  392. package/dist/slash-commands/slash-deep-help.d.ts.map +0 -1
  393. package/dist/slash-commands/spawn-agents.d.ts.map +0 -1
  394. package/dist/slash-commands/statusline.d.ts.map +0 -1
  395. package/dist/slash-commands/suggest.d.ts.map +0 -1
  396. package/dist/slash-commands/suggestion-store.d.ts.map +0 -1
  397. package/dist/slash-commands/supervisor.d.ts.map +0 -1
  398. package/dist/slash-commands/surfaces.d.ts.map +0 -1
  399. package/dist/slash-commands/tasks.d.ts.map +0 -1
  400. package/dist/slash-commands/techstack.d.ts.map +0 -1
  401. package/dist/slash-commands/telegram-pairing.d.ts.map +0 -1
  402. package/dist/slash-commands/telegram-settings.d.ts.map +0 -1
  403. package/dist/slash-commands/telegram-setup.d.ts.map +0 -1
  404. package/dist/slash-commands/todos.d.ts.map +0 -1
  405. package/dist/slash-commands/tool.d.ts.map +0 -1
  406. package/dist/slash-commands/tools.d.ts.map +0 -1
  407. package/dist/slash-commands/tuneup.d.ts.map +0 -1
  408. package/dist/slash-commands/working-dir.d.ts.map +0 -1
  409. package/dist/slash-commands/worktree.d.ts.map +0 -1
  410. package/dist/slash-commands/yolo.d.ts.map +0 -1
  411. package/dist/spinner.d.ts.map +0 -1
  412. package/dist/subcommands/contracts.d.ts.map +0 -1
  413. package/dist/subcommands/handlers/acp.d.ts.map +0 -1
  414. package/dist/subcommands/handlers/audit.d.ts.map +0 -1
  415. package/dist/subcommands/handlers/auth-local-help.d.ts.map +0 -1
  416. package/dist/subcommands/handlers/auth.d.ts.map +0 -1
  417. package/dist/subcommands/handlers/bench-run-help.d.ts.map +0 -1
  418. package/dist/subcommands/handlers/bench.d.ts.map +0 -1
  419. package/dist/subcommands/handlers/chronicle.d.ts.map +0 -1
  420. package/dist/subcommands/handlers/config-history.d.ts.map +0 -1
  421. package/dist/subcommands/handlers/diag-doctor.d.ts.map +0 -1
  422. package/dist/subcommands/handlers/export.d.ts.map +0 -1
  423. package/dist/subcommands/handlers/helpers.d.ts.map +0 -1
  424. package/dist/subcommands/handlers/hq.d.ts.map +0 -1
  425. package/dist/subcommands/handlers/init.d.ts.map +0 -1
  426. package/dist/subcommands/handlers/mailbox-serve.d.ts.map +0 -1
  427. package/dist/subcommands/handlers/mcp.d.ts.map +0 -1
  428. package/dist/subcommands/handlers/model-smoke-test.d.ts.map +0 -1
  429. package/dist/subcommands/handlers/modeldiag-profiles.d.ts.map +0 -1
  430. package/dist/subcommands/handlers/modeldiag.d.ts.map +0 -1
  431. package/dist/subcommands/handlers/models-add-help.d.ts.map +0 -1
  432. package/dist/subcommands/handlers/per-subcommand-deep-help-table.d.ts.map +0 -1
  433. package/dist/subcommands/handlers/per-subcommand-help-data.d.ts.map +0 -1
  434. package/dist/subcommands/handlers/per-subcommand-help-table.d.ts.map +0 -1
  435. package/dist/subcommands/handlers/per-subcommand-help-types.d.ts.map +0 -1
  436. package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +0 -1
  437. package/dist/subcommands/handlers/permissions.d.ts.map +0 -1
  438. package/dist/subcommands/handlers/plugin-usage.d.ts.map +0 -1
  439. package/dist/subcommands/handlers/project.d.ts.map +0 -1
  440. package/dist/subcommands/handlers/projects.d.ts.map +0 -1
  441. package/dist/subcommands/handlers/providers-models.d.ts.map +0 -1
  442. package/dist/subcommands/handlers/quick.d.ts.map +0 -1
  443. package/dist/subcommands/handlers/replay.d.ts.map +0 -1
  444. package/dist/subcommands/handlers/rewind.d.ts.map +0 -1
  445. package/dist/subcommands/handlers/sessions-config.d.ts.map +0 -1
  446. package/dist/subcommands/handlers/sessions-fleet.d.ts.map +0 -1
  447. package/dist/subcommands/handlers/tools-skills.d.ts.map +0 -1
  448. package/dist/subcommands/handlers/update.d.ts.map +0 -1
  449. package/dist/subcommands/handlers/version-help.d.ts.map +0 -1
  450. package/dist/subcommands/index.d.ts.map +0 -1
  451. package/dist/theme.d.ts.map +0 -1
  452. package/dist/tools-skills-UNKLOB7M.js.map +0 -7
  453. package/dist/tui-thinking-word.d.ts.map +0 -1
  454. package/dist/tuneup.d.ts.map +0 -1
  455. package/dist/update-YC4TYW2Y.js.map +0 -7
  456. package/dist/update-check-UMYTOH7Z.js.map +0 -7
  457. package/dist/update-check.d.ts.map +0 -1
  458. package/dist/utils/delay-format.d.ts.map +0 -1
  459. package/dist/utils/hq-ttl.d.ts.map +0 -1
  460. package/dist/utils/win32-cmd.d.ts.map +0 -1
  461. package/dist/utils.d.ts.map +0 -1
  462. package/dist/version-help-DROHZRW6.js.map +0 -7
  463. package/dist/version.d.ts.map +0 -1
  464. package/dist/webui-server/client-registration.d.ts.map +0 -1
  465. package/dist/webui-server/connection-handler.d.ts.map +0 -1
  466. package/dist/webui-server/context-breakdown.d.ts.map +0 -1
  467. package/dist/webui-server/contracts.d.ts.map +0 -1
  468. package/dist/webui-server/cost-helpers.d.ts.map +0 -1
  469. package/dist/webui-server/kanban-host-adapter.d.ts.map +0 -1
  470. package/dist/webui-server/kanban-run-mirror.d.ts.map +0 -1
  471. package/dist/webui-server/kanban-supervisor.d.ts.map +0 -1
  472. package/dist/webui-server/lifecycle.d.ts.map +0 -1
  473. package/dist/webui-server/listen-helpers.d.ts.map +0 -1
  474. package/dist/webui-server/logger-shim.d.ts.map +0 -1
  475. package/dist/webui-server/node-pty-loader.d.ts.map +0 -1
  476. package/dist/webui-server/prefs-seeding.d.ts.map +0 -1
  477. package/dist/webui-server/privileged-actions.d.ts.map +0 -1
  478. package/dist/webui-server/provider-config.d.ts.map +0 -1
  479. package/dist/webui-server/session-start-payload.d.ts.map +0 -1
  480. package/dist/webui-server/setup-events.d.ts.map +0 -1
  481. package/dist/webui-server/static-serve.d.ts.map +0 -1
  482. package/dist/webui-server/stream-coalescer.d.ts.map +0 -1
  483. package/dist/webui-server/terminal-log-view.d.ts.map +0 -1
  484. package/dist/webui-server-ZF5KVGC5.js.map +0 -7
  485. package/dist/webui-server-options.d.ts.map +0 -1
  486. package/dist/webui-server.d.ts.map +0 -1
  487. package/dist/wiring/brain-and-orchestration.d.ts.map +0 -1
  488. package/dist/wiring/codebase-index.d.ts.map +0 -1
  489. package/dist/wiring/command-host-adapters.d.ts.map +0 -1
  490. package/dist/wiring/command-host-state.d.ts.map +0 -1
  491. package/dist/wiring/controllers.d.ts.map +0 -1
  492. package/dist/wiring/dep-watcher-bridge.d.ts.map +0 -1
  493. package/dist/wiring/dep-watcher.d.ts.map +0 -1
  494. package/dist/wiring/design-studio.d.ts.map +0 -1
  495. package/dist/wiring/director-setup.d.ts.map +0 -1
  496. package/dist/wiring/eternal-command-handlers.d.ts.map +0 -1
  497. package/dist/wiring/fleet-command-handlers.d.ts.map +0 -1
  498. package/dist/wiring/hq-telemetry.d.ts.map +0 -1
  499. package/dist/wiring/lifecycle-plugins.d.ts.map +0 -1
  500. package/dist/wiring/mailbox-bridge-bootstrap.d.ts.map +0 -1
  501. package/dist/wiring/management-tools.d.ts.map +0 -1
  502. package/dist/wiring/metrics.d.ts.map +0 -1
  503. package/dist/wiring/pipeline.d.ts.map +0 -1
  504. package/dist/wiring/plugins.d.ts.map +0 -1
  505. package/dist/wiring/provider-runtime-setup.d.ts.map +0 -1
  506. package/dist/wiring/provider-runtime.d.ts.map +0 -1
  507. package/dist/wiring/provider-status.d.ts.map +0 -1
  508. package/dist/wiring/provider-utility-tools.d.ts.map +0 -1
  509. package/dist/wiring/provider.d.ts.map +0 -1
  510. package/dist/wiring/replay.d.ts.map +0 -1
  511. package/dist/wiring/runtime-controller-deps.d.ts.map +0 -1
  512. package/dist/wiring/runtime-dispatch-state.d.ts.map +0 -1
  513. package/dist/wiring/runtime-lifecycle-deps.d.ts.map +0 -1
  514. package/dist/wiring/runtime-picker-deps.d.ts.map +0 -1
  515. package/dist/wiring/sage.d.ts.map +0 -1
  516. package/dist/wiring/sdd-handlers.d.ts.map +0 -1
  517. package/dist/wiring/security-command.d.ts.map +0 -1
  518. package/dist/wiring/session-command-handlers.d.ts.map +0 -1
  519. package/dist/wiring/session-registry.d.ts.map +0 -1
  520. package/dist/wiring/session.d.ts.map +0 -1
  521. package/dist/wiring/slash-commands.d.ts.map +0 -1
  522. package/dist/wiring/to-execute-deps.d.ts.map +0 -1
  523. package/dist/wiring/tools.d.ts.map +0 -1
@@ -1,3 +1,4 @@
1
+ import type { ReviewerAttempt } from './chimera-reviewer-policy.js';
1
2
  import type { ExecuteDeps } from './execute-deps.js';
2
3
  type Director = NonNullable<ExecuteDeps['fleet']['director']>;
3
4
  type Events = ExecuteDeps['core']['events'];
@@ -9,7 +10,12 @@ export type InstallChimeraCascadeHandlerOptions = {
9
10
  session: Session;
10
11
  getPendingWork: () => PendingChimeraWork;
11
12
  setPendingWork: (work: PendingChimeraWork) => void;
13
+ /**
14
+ * Model ladder for cascade spawns. Supplied by the caller because only it
15
+ * holds the live config. Omit to keep the single unpinned spawn.
16
+ */
17
+ buildLadder?: (() => ReviewerAttempt[]) | undefined;
12
18
  };
13
- export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, setPendingWork, }: InstallChimeraCascadeHandlerOptions): void;
19
+ export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, setPendingWork, buildLadder, }: InstallChimeraCascadeHandlerOptions): void;
14
20
  export {};
15
21
  //# sourceMappingURL=execution-chimera-cascade.d.ts.map
@@ -0,0 +1,35 @@
1
+ import { type ChimeraReviewCompletePayload } from '@wrongstack/core/plugin';
2
+ import type { ExecuteDeps } from './execute-deps.js';
3
+ type Director = NonNullable<ExecuteDeps['fleet']['director']>;
4
+ type Events = ExecuteDeps['core']['events'];
5
+ type Session = ExecuteDeps['session']['session'];
6
+ type Mailbox = ExecuteDeps['session']['mailbox'];
7
+ type Agent = ExecuteDeps['core']['agent'];
8
+ type Config = ExecuteDeps['core']['config'];
9
+ type PendingChimeraWork = Promise<void> | undefined;
10
+ /**
11
+ * Canonicalize a file path for citation gating. The reviewer can cite
12
+ * absolute Windows paths (`D:\Codebox\...`) or mix casing on a
13
+ * case-insensitive filesystem; without this normalization, every citation
14
+ * counts as "out of scope" and the auto-fix eligibility guard silently
15
+ * suppresses the fix while the mailbox directive still claims findings.
16
+ *
17
+ * Exported for unit testing — the citation-gating pipeline is otherwise
18
+ * locked inside an event-handler closure and is not reachable from a
19
+ * direct test.
20
+ */
21
+ export declare function normalizeFileKeyForCitation(raw: string, cwd: string): string;
22
+ export type InstallChimeraReviewHandlerOptions = {
23
+ events: Events;
24
+ director: Director | null | undefined;
25
+ session: Session;
26
+ mailbox: Mailbox;
27
+ agent: Agent;
28
+ config: Config;
29
+ projectDir: string;
30
+ persistReview?: ((payload: ChimeraReviewCompletePayload, projectDir: string) => Promise<void>) | undefined;
31
+ setPendingWork: (work: PendingChimeraWork) => void;
32
+ };
33
+ export declare function installChimeraReviewHandler({ events, director, session, mailbox, agent, config, projectDir, persistReview, setPendingWork, }: InstallChimeraReviewHandlerOptions): void;
34
+ export {};
35
+ //# sourceMappingURL=execution-chimera-review.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { FallbackProfileManager } from '@wrongstack/core/agent';
1
+ import type { AgentPipelines, FallbackProfileManager } from '@wrongstack/core/agent';
2
2
  import type { BrainArbiter, ProviderModelStatusTracker } from '@wrongstack/core/coordination';
3
3
  import type { Container, EventBus } from '@wrongstack/core/kernel';
4
4
  import type { ProviderRegistry, ToolRegistry } from '@wrongstack/core/registry';
@@ -27,6 +27,11 @@ export interface MultiAgentDeps {
27
27
  renderer?: Renderer | undefined;
28
28
  /** Shared live fallback profile manager from the runtime container. */
29
29
  fallbackProfileManager: FallbackProfileManager;
30
+ /**
31
+ * Optional trusted control-plane hook installed on every in-process
32
+ * subagent pipeline. This is host wiring, never a model-visible capability.
33
+ */
34
+ installToolBoundary?: ((pipelines: AgentPipelines) => void) | undefined;
30
35
  }
31
36
  /**
32
37
  * Per-session options for the multi-agent host. Director Mode is always
@@ -54,6 +54,7 @@ export declare class FleetStatusLine {
54
54
  private rows;
55
55
  private repaintTimer;
56
56
  private tickTimer;
57
+ private deactivateTimer;
57
58
  private resizeCleanup;
58
59
  private lastPaint;
59
60
  private readonly onResize;
@@ -41,7 +41,7 @@ export interface GoalHostDeps {
41
41
  events: EventBus;
42
42
  /** Current parent session id for worktree lifecycle events. */
43
43
  getSessionId?: (() => string | undefined) | undefined;
44
- /** Directory for per-project phase-graph JSON (wpaths.projectGoal). */
44
+ /** Directory for per-project phase-graph engine checkpoints. */
45
45
  storeDir: string;
46
46
  /** Project root — base for git-worktree isolation. */
47
47
  projectRoot: string;
@@ -0,0 +1,65 @@
1
+ import "./chunk-7OCVIDC7.js";
2
+
3
+ // src/subcommands/handlers/governance.ts
4
+ var DEFAULT_DEPENDENCIES = {
5
+ readStatus: async (projectRoot) => {
6
+ const runtime = await import("@wrongstack/runtime/governance-bootstrap");
7
+ return runtime.readGovernanceDaemonOperatorStatus(projectRoot);
8
+ }
9
+ };
10
+ function usage() {
11
+ return "Usage:\n wstack governance status [--json]\n\nReads the project daemon through its local read-only status capability.\nWarnings are advisory and do not stop active tasks or model execution.\n";
12
+ }
13
+ function jsonRequested(args, deps) {
14
+ return args.includes("--json") || deps.flags?.["json"] === true;
15
+ }
16
+ async function runGovernanceStatusCommand(args, deps, dependencies = DEFAULT_DEPENDENCIES) {
17
+ const json = jsonRequested(args, deps);
18
+ const result = await dependencies.readStatus(deps.projectRoot);
19
+ if (json) {
20
+ deps.renderer.write(`${JSON.stringify(result, null, 2)}
21
+ `);
22
+ return result.available ? 0 : 1;
23
+ }
24
+ if (!result.available) {
25
+ deps.renderer.writeError(`Governance status unavailable (${result.code}): ${result.message}
26
+ `);
27
+ return 1;
28
+ }
29
+ const { status } = result;
30
+ const broker = status.attachmentBroker;
31
+ const lines = [
32
+ `Governance daemon: running (pid ${status.pid}, instance ${status.instanceId})`,
33
+ `Attachment broker: ${broker?.health ?? "unavailable"}`,
34
+ `Operator signal: ${status.signal.level} (${status.signal.code})`,
35
+ `Operator action: ${status.signal.operatorAction}`,
36
+ "Execution: continue (advisory only; no automatic task or model stop)"
37
+ ];
38
+ if (broker) {
39
+ lines.push(`Consecutive failures: ${broker.consecutiveFailures}`);
40
+ lines.push(`Pending revocations: ${broker.pendingRevocations}`);
41
+ lines.push(`Audit persistence: ${broker.auditHealthy ? "healthy" : "unhealthy"}`);
42
+ }
43
+ deps.renderer.write(`${lines.join("\n")}
44
+ `);
45
+ return 0;
46
+ }
47
+ var governanceCmd = async (args, deps) => {
48
+ const subcommand = args[0];
49
+ if (!subcommand || subcommand === "status") {
50
+ return runGovernanceStatusCommand(subcommand ? args.slice(1) : args, deps);
51
+ }
52
+ if (subcommand === "help" || subcommand === "--help" || subcommand === "-h") {
53
+ deps.renderer.write(usage());
54
+ return 0;
55
+ }
56
+ deps.renderer.writeError(`Unknown governance subcommand: ${subcommand}
57
+ `);
58
+ deps.renderer.write(usage());
59
+ return 1;
60
+ };
61
+ export {
62
+ governanceCmd,
63
+ runGovernanceStatusCommand
64
+ };
65
+ //# sourceMappingURL=governance-V2Z42RBE.js.map
@@ -0,0 +1,17 @@
1
+ import type { HqGovernanceSnapshotPayload, HqPublisher } from '@wrongstack/core/hq';
2
+ import { type GovernanceDaemonOperatorStatusReadResult } from '@wrongstack/runtime/governance-bootstrap';
3
+ export declare const GOVERNANCE_HQ_SNAPSHOT_INTERVAL_MS = 15000;
4
+ export interface GovernanceHqTelemetryOptions {
5
+ readonly publisher: Pick<HqPublisher, 'project' | 'publishEvent'>;
6
+ readonly projectRoot: string;
7
+ readonly intervalMs?: number;
8
+ readonly now?: () => string;
9
+ readonly readStatus?: (projectRoot: string) => Promise<GovernanceDaemonOperatorStatusReadResult>;
10
+ }
11
+ export declare function projectGovernanceHqSnapshot(projectId: string, observedAt: string, result: GovernanceDaemonOperatorStatusReadResult): HqGovernanceSnapshotPayload;
12
+ /**
13
+ * Publish a compact project-owner governance observation to HQ. Failures are
14
+ * represented as advisory snapshots and never stop task or model execution.
15
+ */
16
+ export declare function startGovernanceHqTelemetry(options: GovernanceHqTelemetryOptions): () => void;
17
+ //# sourceMappingURL=governance-hq-telemetry.d.ts.map
@@ -36,7 +36,7 @@ var hqCmd = async (args, deps) => {
36
36
  return 1;
37
37
  };
38
38
  async function startServer(deps) {
39
- const { startHqServer } = await import("./hq-server-6AQ3BXZA.js");
39
+ const { startHqServer } = await import("./hq-server-6TSAORAC.js");
40
40
  const dataDir = resolveDataDir(deps);
41
41
  const flags = deps.flags ?? {};
42
42
  const host = typeof flags["host"] === "string" ? flags["host"] : HQ_CLI_DEFAULT_HOST;
@@ -544,4 +544,4 @@ export {
544
544
  hqCmd,
545
545
  resolveAuditActor
546
546
  };
547
- //# sourceMappingURL=hq-JUYKUNJX.js.map
547
+ //# sourceMappingURL=hq-WO6CLUSI.js.map
@@ -1,10 +1,11 @@
1
- import type { CreateHqPublisherOptions } from '@wrongstack/core/hq';
2
- import type { HqPublisher } from '@wrongstack/core/hq';
1
+ import type { CreateHqPublisherOptions, HqPublisher } from '@wrongstack/core/hq';
2
+ import { type KanbanHqSyncStats } from './kanban-hq-sync.js';
3
3
  type CliHqPublisherOptions = Omit<CreateHqPublisherOptions, 'socketFactory'> & {
4
4
  socketFactory?: CreateHqPublisherOptions['socketFactory'];
5
5
  };
6
6
  export interface CliHqConnection {
7
7
  getPublisher(): HqPublisher | undefined;
8
+ getKanbanSyncStats(): KanbanHqSyncStats | undefined;
8
9
  stop(): void;
9
10
  }
10
11
  export interface CliHqConnectionOptions extends CliHqPublisherOptions {
@@ -4,9 +4,11 @@
4
4
  * @module hq-server/auth
5
5
  */
6
6
  import type * as http from 'node:http';
7
- import type { HqSessionEntry } from './types.js';
7
+ import type { HqRouterMutableAuth, HqSessionEntry } from './types.js';
8
8
  export declare const HQ_SESSION_COOKIE = "hq.session";
9
9
  export declare const HQ_SESSION_MAX_AGE_MS: number;
10
+ /** Idle timeout: sessions unused for this long are rejected and evicted. */
11
+ export declare const HQ_SESSION_IDLE_TIMEOUT_MS: number;
10
12
  export interface HqBrowserAuthContext {
11
13
  kind: 'token';
12
14
  token: string;
@@ -28,9 +30,15 @@ export type HqBrowserAuthResult = HqBrowserAuthContext | HqCookieAuthContext | u
28
30
  /**
29
31
  * The only featureful frontend is the packaged, same-origin React SPA.
30
32
  * The missing-assets recovery document contains inline CSS but no script.
33
+ *
34
+ * WS-061: `script-src` carried `'unsafe-inline'` despite that sentence above
35
+ * already stating nothing here needs it — verified against the built HTML,
36
+ * which has zero inline `<script>` elements without `src`. `style-src` keeps
37
+ * `'unsafe-inline'` because the recovery document's inline CSS is real, and
38
+ * inline style is not script execution.
31
39
  */
32
40
  export declare function setHqSecurityHeaders(res: http.ServerResponse): void;
33
- export declare function hasTrustedBrowserOrigin(req: http.IncomingMessage, boundHost?: string, boundPort?: number, trustedPublicOrigins?: ReadonlySet<string>): boolean;
41
+ export declare function hasTrustedBrowserOrigin(req: http.IncomingMessage, boundHost?: string, boundPort?: number, trustedPublicOrigins?: ReadonlySet<string>, allowFileOrigin?: boolean): boolean;
34
42
  export declare function serializeHqSessionCookie(sessionId: string, secret: string): string;
35
43
  export declare function parseHqSessionCookie(value: string, secret: string): string | undefined;
36
44
  export declare function parseCookieHeader(cookieHeader: string | undefined): Record<string, string>;
@@ -38,6 +46,28 @@ export declare function setHqSessionCookie(res: http.ServerResponse, value: stri
38
46
  export declare function clearHqSessionCookie(res: http.ServerResponse, secure?: boolean): void;
39
47
  export declare function isTokenAuth(auth: HqBrowserAuthResult): auth is HqBrowserAuthContext;
40
48
  export declare function isCookieAuth(auth: HqBrowserAuthResult): auth is HqCookieAuthContext;
49
+ /**
50
+ * Single source of truth for "must this HQ surface see a credential?".
51
+ *
52
+ * WS-010 introduced `requireAuthFloor` so that revoking the last credential on
53
+ * a running, network-reachable `wstack hq` could not silently drop it into open
54
+ * mode. That latch was then honoured at only three of the seven decision
55
+ * points. The four that open-coded their own `browserTokens.size > 0 ||
56
+ * passwordHash` test stayed open: the main `/api/*` gate, the mailbox gateway,
57
+ * the WebSocket upgrade, and `callerCanEnqueue` — which backs `/api/mailbox-send`,
58
+ * i.e. message injection into live agents.
59
+ *
60
+ * Any new gate MUST call this rather than re-deriving the condition; the bug
61
+ * was not a wrong condition but seven independent copies of it (WS-077).
62
+ */
63
+ export declare function hqAuthRequired(mutableAuth: HqRouterMutableAuth, requireBrowserAuth?: boolean | undefined): boolean;
64
+ /**
65
+ * The `/ws/client` counterpart. Fleet clients authenticate with `clientTokens`,
66
+ * which are a separate set from the browser tokens, but the same fail-closed
67
+ * floor applies: an all-expired client-token file must not mean "no auth
68
+ * configured, let anyone register as a session".
69
+ */
70
+ export declare function hqClientAuthRequired(mutableAuth: HqRouterMutableAuth): boolean;
41
71
  /**
42
72
  * Constant-time membership test for a token set. Returns the matching stored
43
73
  * token (so callers can look up its metadata) or undefined. Iterates and
@@ -51,6 +81,7 @@ export declare function authenticateBrowserRequest(req: http.IncomingMessage, ur
51
81
  browserTokenObjs: Map<string, {
52
82
  id: string;
53
83
  capabilities?: string[];
84
+ expiresAt?: string;
54
85
  }>;
55
86
  passwordHash?: string | undefined;
56
87
  cookieSecret?: string | undefined;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Persistent login attempt tracker with debounced disk write-through.
3
+ *
4
+ * Replaces the in-memory `Map<string, { count, blockedUntil, lastAttempt }>`
5
+ * that reset on every server restart. Now an attacker who crashes or waits
6
+ * out the server cannot reset their lockout counter — the state survives
7
+ * across restarts.
8
+ *
9
+ * Storage: `~/.wrongstack/hq/login-attempts.json` (owner-only, 0o600 + icacls).
10
+ * The file is pruned on load (entries older than the retention window are
11
+ * dropped) and written back with a 500ms debounce so a burst of failed
12
+ * logins doesn't hammer the disk.
13
+ *
14
+ * @module hq-server/login-attempt-store
15
+ */
16
+ export interface LoginAttemptEntry {
17
+ count: number;
18
+ blockedUntil: number;
19
+ lastAttempt: number;
20
+ }
21
+ export declare class LoginAttemptStore {
22
+ private store;
23
+ private writeTimer;
24
+ private dirty;
25
+ private readonly filePath;
26
+ private readonly debounceMs;
27
+ private readonly retentionMs;
28
+ constructor(dataDir: string, opts?: {
29
+ debounceMs?: number;
30
+ retentionMs?: number;
31
+ });
32
+ /**
33
+ * Load persisted state from disk and prune stale entries.
34
+ * Safe to call once at startup; subsequent calls reload from disk.
35
+ */
36
+ load(): Promise<void>;
37
+ get(key: string): LoginAttemptEntry | undefined;
38
+ set(key: string, entry: LoginAttemptEntry): void;
39
+ delete(key: string): void;
40
+ /**
41
+ * Compound rate-limit key for public-relay mode: IP + SHA-256(password).
42
+ * Limits how often the SAME password can be tried from different IPs,
43
+ * so a rotating-IP attacker can't bypass per-IP backoff.
44
+ */
45
+ static credentialKey(ip: string, password: string): string;
46
+ /**
47
+ * Check both IP and credential keys; return the stricter (later blockedUntil).
48
+ */
49
+ checkBlocked(ip: string, password: string): {
50
+ blocked: boolean;
51
+ retryAfter: number;
52
+ };
53
+ /**
54
+ * Record a failed attempt on both IP and credential keys.
55
+ * Returns the updated IP entry (for the response Retry-After header).
56
+ */
57
+ recordFailure(ip: string, password: string, maxBackoffMs?: number): LoginAttemptEntry;
58
+ /**
59
+ * Clear both IP and credential entries on successful login.
60
+ */
61
+ clearOnSuccess(ip: string, password: string): void;
62
+ /** Number of tracked entries (for diagnostics). */
63
+ get size(): number;
64
+ /**
65
+ * Flush pending writes immediately. Called on server shutdown.
66
+ */
67
+ flush(): Promise<void>;
68
+ private scheduleWrite;
69
+ private writeToDisk;
70
+ /** Iterate entries (for cleanup timers). */
71
+ entries(): IterableIterator<[string, LoginAttemptEntry]>;
72
+ }
73
+ //# sourceMappingURL=login-attempt-store.d.ts.map
@@ -1,12 +1,9 @@
1
1
  import type * as http from 'node:http';
2
2
  import { type HqAlertRuleConfig, type HqRedactionPolicy, type HqToken } from '@wrongstack/core/hq';
3
+ import type { LoginAttemptStore } from '../login-attempt-store.js';
3
4
  import type { HqRouterMutableAuth, HqSessionEntry } from '../types.js';
4
5
  export declare function handleApiAuthStatus(req: http.IncomingMessage, res: http.ServerResponse, url: URL, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, requireBrowserAuth: boolean | undefined, trustedPublicOrigins: Set<string>, secureCookies: boolean | undefined): Promise<void>;
5
- export declare function handleApiLogin(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts: Map<string, {
6
- count: number;
7
- blockedUntil: number;
8
- lastAttempt: number;
9
- }>, secureCookies: boolean | undefined): Promise<void>;
6
+ export declare function handleApiLogin(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts: LoginAttemptStore, secureCookies: boolean | undefined): Promise<void>;
10
7
  export declare function handleApiLogout(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, secureCookies: boolean | undefined): Promise<void>;
11
8
  export declare function handleApiPassword(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, dataDir: string, secureCookies: boolean | undefined, requireBrowserAuth: boolean | undefined): Promise<void>;
12
9
  export declare function applyAuthFile(mutableAuth: HqRouterMutableAuth, next: {
@@ -14,12 +11,83 @@ export declare function applyAuthFile(mutableAuth: HqRouterMutableAuth, next: {
14
11
  token: string;
15
12
  id: string;
16
13
  capabilities?: string[];
14
+ expiresAt?: string;
17
15
  }>;
18
16
  clientTokens?: Array<HqToken>;
19
17
  redactionPolicy?: Partial<HqRedactionPolicy>;
20
18
  passwordHash?: string;
21
19
  cookieSecret?: string;
22
20
  alertRules?: HqAlertRuleConfig;
21
+ totpSecret?: string;
22
+ totpPendingSecret?: string;
23
+ totpRecoveryCodes?: string[];
23
24
  }): void;
24
25
  export declare function handleApiBootstrap(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, secureCookies: boolean | undefined, bootstrapStore: import('@wrongstack/core/hq').HqBootstrapCodeStore): Promise<void>;
26
+ /**
27
+ * WS-065 — exchange a live browser token for an HttpOnly session cookie.
28
+ *
29
+ * The bootstrap flow above already gives fresh startup URLs a cookie and never
30
+ * persists a client-side credential. What it does not cover is the *legacy*
31
+ * paths: an older `?token=` startup URL, and manual token entry in the token
32
+ * gate. Both leave the raw token in `sessionStorage`, where any script on the
33
+ * origin can read it. This endpoint lets the SPA complete that migration on
34
+ * its own — authenticate once with the token it already holds, receive a
35
+ * cookie, and delete the stored copy.
36
+ *
37
+ * The minted session is exactly the one `handleApiBootstrap` mints: `kind:
38
+ * 'token'` carrying the source token's id. That matters because
39
+ * `authenticateBrowserRequest` re-resolves a token-origin session's
40
+ * capabilities from the LIVE token record on every request, so upgrading
41
+ * grants nothing the token did not already grant and dies the moment the token
42
+ * is revoked. No privilege boundary is crossed: the caller proved possession
43
+ * of the token, and the cookie is strictly weaker (HttpOnly, same-origin,
44
+ * server-expiring).
45
+ */
46
+ export declare function handleApiTokenUpgrade(req: http.IncomingMessage, res: http.ServerResponse, url: URL, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, secureCookies: boolean | undefined): Promise<void>;
47
+ /**
48
+ * POST `/api/login/verify` — complete 2FA for a pending-2FA session.
49
+ * Accepts either a TOTP `code` or a `recoveryCode`. On success, the pending
50
+ * session is upgraded to a full session (pending2fa cleared). Recovery codes
51
+ * are single-use: the matched hash is removed from `auth.json` on success.
52
+ */
53
+ export declare function handleApiLoginVerify(req: http.IncomingMessage, res: http.ServerResponse, _url: URL, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts: LoginAttemptStore, dataDir: string, secureCookies: boolean | undefined): Promise<void>;
54
+ /**
55
+ * POST `/api/auth/totp/setup` — generate a new TOTP secret (not yet active).
56
+ * Returns the base32 secret + otpauth URI for QR display. The secret is
57
+ * persisted as `totpPendingSecret` — login does NOT check this field, so
58
+ * an unconfirmed setup cannot lock the operator out. 2FA becomes active
59
+ * only after `/api/auth/totp/enable` verifies a code.
60
+ *
61
+ * Requires existing auth (cookie or token) — only the operator can set up 2FA.
62
+ */
63
+ export declare function handleApiTotpSetup(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, dataDir: string): Promise<void>;
64
+ /**
65
+ * POST `/api/auth/totp/enable` — confirm 2FA enrollment by providing a valid
66
+ * TOTP code. Promotes `totpPendingSecret` → `totpSecret` (active), generates
67
+ * and returns recovery codes (shown once). After this, 2FA is required for
68
+ * password login.
69
+ */
70
+ export declare function handleApiTotpEnable(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, dataDir: string): Promise<void>;
71
+ /**
72
+ * POST `/api/auth/totp/disable` — remove TOTP 2FA entirely. Requires the
73
+ * current password (or a valid TOTP code) as confirmation.
74
+ */
75
+ export declare function handleApiTotpDisable(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts: LoginAttemptStore, dataDir: string): Promise<void>;
76
+ /**
77
+ * GET `/api/auth/sessions` — list all active browser sessions for the
78
+ * session-management UI. Returns each session's kind, creation time,
79
+ * last-seen time, and a truncated ID (never the full session ID — that
80
+ * would allow cookie forgery since the session ID IS the cookie value).
81
+ */
82
+ export declare function handleApiAuthSessions(_req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>): void;
83
+ /**
84
+ * DELETE `/api/auth/sessions/:id` — revoke a single session by ID.
85
+ * DELETE `/api/auth/sessions` — revoke ALL sessions (force logout everyone).
86
+ */
87
+ export declare function handleApiAuthSessionsRevoke(_req: http.IncomingMessage, res: http.ServerResponse, url: URL, sessions: Map<string, HqSessionEntry>): Promise<void>;
88
+ /**
89
+ * GET `/api/auth/audit` — recent auth events for the audit panel.
90
+ * Returns the last 50 entries from auth-audit.jsonl, newest first.
91
+ */
92
+ export declare function handleApiAuthAudit(_req: http.IncomingMessage, res: http.ServerResponse, dataDir: string): void;
25
93
  //# sourceMappingURL=auth-handlers.d.ts.map
@@ -21,6 +21,7 @@ export declare const hasTrustedBrowserOrigin: typeof HqServerAuth.hasTrustedBrow
21
21
  export declare const authenticateBrowserRequest: typeof HqServerAuth.authenticateBrowserRequest;
22
22
  export declare const isTokenAuth: typeof HqServerAuth.isTokenAuth;
23
23
  export declare const isCookieAuth: typeof HqServerAuth.isCookieAuth;
24
+ export declare const hqAuthRequired: typeof HqServerAuth.hqAuthRequired;
24
25
  export declare const setHqSessionCookie: typeof HqServerAuth.setHqSessionCookie;
25
26
  export declare const clearHqSessionCookie: typeof HqServerAuth.clearHqSessionCookie;
26
27
  export declare const serializeHqSessionCookie: typeof HqServerAuth.serializeHqSessionCookie;
@@ -40,6 +41,7 @@ export declare const readLocalSubagentTranscript: typeof HqServerUtils.readLocal
40
41
  export declare const lanIPv4Addresses: typeof HqServerUtils.lanIPv4Addresses;
41
42
  export declare const hqRuntimeMarkerPath: typeof HqServerUtils.hqRuntimeMarkerPath;
42
43
  import type { ConnectedClient, HqRouterMutableAuth, HqSessionEntry, HqSnapshotBroadcaster, ProjectDetail, TranscriptRing } from './types.js';
44
+ import type { LoginAttemptStore } from './login-attempt-store.js';
43
45
  export type { ConnectedClient, HqSnapshotBroadcaster, ProjectDetail, TranscriptRing, };
44
46
  export interface HqRouterMailboxGateway {
45
47
  mailbox: Mailbox;
@@ -50,13 +52,11 @@ export interface HqRouterDeps {
50
52
  host: string;
51
53
  listeningPort: number;
52
54
  trustedPublicOrigins: Set<string>;
55
+ /** Trust `Origin: file://`. Off by default — see StartHqServerOptions (WS-081). */
56
+ allowFileOrigin?: boolean | undefined;
53
57
  mutableAuth: HqRouterMutableAuth;
54
58
  sessions: Map<string, HqSessionEntry>;
55
- loginAttempts: Map<string, {
56
- count: number;
57
- blockedUntil: number;
58
- lastAttempt: number;
59
- }>;
59
+ loginAttempts: LoginAttemptStore;
60
60
  clients: Map<WebSocket, ConnectedClient>;
61
61
  browsers: Set<WebSocket>;
62
62
  eventLog: HqEventEnvelope[];
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * @module hq-server/types
5
5
  */
6
- import type { HqAlertRuleConfig, HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry } from '@wrongstack/core/hq';
6
+ import type { HqAlertRuleConfig, HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqGovernanceSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry } from '@wrongstack/core/hq';
7
7
  import type { WebSocket } from 'ws';
8
- export type { HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry, };
8
+ export type { HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqGovernanceSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry, };
9
9
  export interface TrackedSessionSnapshot {
10
10
  payload: HqSessionSnapshotPayload;
11
11
  /** Epoch ms of the last `session.snapshot` refresh — freshness authority for the cleanup timer. */
@@ -48,8 +48,21 @@ export interface ConnectedClient {
48
48
  servers: HqMcpServerHealth[];
49
49
  receivedAt: number;
50
50
  }>;
51
+ /** Latest read-only governance advisory accepted from this project's leader. */
52
+ governanceSnapshot?: {
53
+ payload: HqGovernanceSnapshotPayload;
54
+ receivedAt: number;
55
+ };
51
56
  /** Pending outbound commands (Phase 3 — control plane). */
52
57
  commandQueue: HqQueuedCommand[];
58
+ /**
59
+ * Whether this client is the project's leader (the client with
60
+ * `control.receive` capability that other clients coordinate with).
61
+ * Live tracking lives in `HqServer`; this field is the snapshot.
62
+ * Used by the leader-deposed detector in `peer.rehydrate` emission.
63
+ * Defaults to `false` for clients without `control.receive`.
64
+ */
65
+ isLeader: boolean;
53
66
  }
54
67
  export interface HqRouterMutableAuth {
55
68
  operatorPolicy: HqRedactionPolicy;
@@ -59,11 +72,27 @@ export interface HqRouterMutableAuth {
59
72
  browserTokenObjs: Map<string, {
60
73
  id: string;
61
74
  capabilities?: string[];
75
+ expiresAt?: string;
62
76
  }>;
63
77
  clientTokenObjs: Map<string, HqToken>;
64
78
  passwordHash?: string | undefined;
65
79
  cookieSecret?: string | undefined;
80
+ /** Base32-encoded TOTP secret for HQ 2FA (live-reloaded from auth.json). */
81
+ totpSecret?: string | undefined;
82
+ /** Pending TOTP secret (setup but not yet confirmed by enable). */
83
+ totpPendingSecret?: string | undefined;
84
+ /** SHA-256 hashes of single-use recovery codes (live-reloaded from auth.json). */
85
+ totpRecoveryCodes?: string[] | undefined;
66
86
  alertRules: HqAlertRuleConfig | undefined;
87
+ /**
88
+ * WS-010: set when the live bind would become unauthenticated and
89
+ * network-reachable. `assessHqExposure` runs at startup only, so revoking the
90
+ * last credential on a running `wstack hq` (default bind 0.0.0.0) silently
91
+ * dropped it into open mode — the kill switch acted as an unlock. When this
92
+ * is true, routes keep demanding auth even though no credential remains, so
93
+ * the surface fails closed instead of opening up.
94
+ */
95
+ requireAuthFloor?: boolean | undefined;
67
96
  }
68
97
  /**
69
98
  * Session record stored in the server-side `sessions` Map.
@@ -80,6 +109,19 @@ export interface HqSessionEntry {
80
109
  readonly tokenId?: string | undefined;
81
110
  /** For token sessions: capabilities inherited from the source token. */
82
111
  readonly capabilities?: string[] | undefined;
112
+ /**
113
+ * Set when a password login passed but 2FA verification is still pending.
114
+ * The session is valid but must NOT be treated as fully authenticated —
115
+ * only `/api/login/verify` may consume it. Other routes should reject it.
116
+ * Short-lived: `PENDING_2FA_TTL_MS` bounds it (5 min).
117
+ */
118
+ readonly pending2fa?: boolean | undefined;
119
+ /**
120
+ * Last time this session was used (epoch ms). Bumped on every authenticated
121
+ * request to implement idle-timeout (sliding expiration). Sessions idle for
122
+ * longer than `HQ_SESSION_IDLE_TIMEOUT_MS` are rejected and evicted.
123
+ */
124
+ lastSeenAt: number;
83
125
  }
84
126
  export interface TranscriptRing {
85
127
  entries: HqTranscriptEntry[];
@@ -35,8 +35,51 @@ export declare function agentMessageToEntry(p: Record<string, unknown>): HqTrans
35
35
  * or the file is absent (caller falls back to the ring).
36
36
  */
37
37
  export declare function readLocalSubagentTranscript(sessionId: string, subagentId: string): Promise<HqTranscriptEntry[] | null>;
38
- /** Safe URL-decoding — returns null on malformed input. */
38
+ /**
39
+ * Percent-decode ONE URL path segment and reject anything that is not a safe
40
+ * single path component.
41
+ *
42
+ * WS-019: this used to be `decodeURIComponent` and nothing else, and its
43
+ * output is joined straight onto a filesystem path in
44
+ * {@link readLocalSubagentTranscript}. `%2e%2e%2f` decodes to `../`, so a
45
+ * request could walk out of the session's transcript directory and read any
46
+ * `transcript.jsonl` on the machine — other projects' sessions included.
47
+ * Percent-decoding is the step that CREATES the traversal, so validating
48
+ * before decoding would have checked the wrong string.
49
+ *
50
+ * The rule is a whole path component or nothing: no separators, no `.`/`..`,
51
+ * no NUL, no drive-letter colon, non-empty, and length-bounded. Real ids are
52
+ * generated tokens, so nothing legitimate is excluded.
53
+ */
39
54
  export declare function decodePathSegment(value: string): string | null;
55
+ /**
56
+ * Percent-decode a session id that may contain a date-shard separator.
57
+ *
58
+ * Session ids are `YYYY-MM-DD/sess_<ULID>` (see `generateSessionId`), so a
59
+ * literal `/` is legitimate. This decoder allows that one shape while still
60
+ * blocking traversal (`..`, backslash, NUL, drive-relative forms). The
61
+ * resolved-path containment check in {@link readLocalSubagentTranscript}
62
+ * is the second lock.
63
+ */
64
+ export declare function decodeSessionId(value: string): string | null;
65
+ /**
66
+ * True when `value` is usable as exactly one filesystem path component.
67
+ *
68
+ * Exported so the traversal rule has one definition — a second copy is how a
69
+ * guard and its callers drift apart, which is the shape of several findings in
70
+ * this audit.
71
+ */
72
+ export declare function isSafePathSegment(value: string): boolean;
73
+ /**
74
+ * Session IDs are `YYYY-MM-DD/sess_<ULID>` — one forward slash is the
75
+ * date-shard separator. Legacy flat ids (no slash) remain readable too
76
+ * (`generateSessionId` in core/storage/session-id.ts), so accept one OR two
77
+ * components while blocking everything that {@link isSafePathSegment} blocks:
78
+ * no backslash, NUL, or drive-relative colon; no `.`/`..`; no empty component;
79
+ * no deeper nesting (three or more components). The resolved-path containment
80
+ * check in `sessionScopedPath` (core/utils) is the second lock.
81
+ */
82
+ export declare function isSafeSessionId(value: string): boolean;
40
83
  /** Normalize display host — "0.0.0.0" prints as "127.0.0.1" for user-facing URLs. */
41
84
  export declare function displayHost(host: string): string;
42
85
  /** Read the full body of an HTTP request as a UTF-8 string (capped at 1 MB). */
@@ -69,10 +112,12 @@ export declare function hqMachineKey(hostname: string | undefined, machineId: st
69
112
  */
70
113
  export declare function recordTimeseriesSignal(persistence: HqPersistence, event: HqEventEnvelope): void;
71
114
  /**
72
- * Coerce a thrown error into a safe, opaque message for HTTP/JSON API
73
- * responses. Raw error strings (file paths, environment details, stack
74
- * fragments) are never forwarded to the browser only a stable category.
75
- * The original error is logged server-side by the caller.
115
+ * Re-exported from `@wrongstack/core/security`.
116
+ *
117
+ * WS-066: this used to be an HQ-local implementation, which is why the WebUI
118
+ * and SimpleUI servers which have the same JSON-API surface never adopted
119
+ * it and forwarded `String(err)` verbatim instead. One implementation now
120
+ * serves every server surface.
76
121
  */
77
- export declare function sanitizeApiError(err: unknown): string;
122
+ export { sanitizeApiError, scrubErrorDetail } from '@wrongstack/core/security';
78
123
  //# sourceMappingURL=utils.d.ts.map