@wrongstack/cli 0.313.1 → 0.316.2

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 (233) hide show
  1. package/dist/{acp-LQMSMV32.js → acp-CEQINXWB.js} +2 -2
  2. package/dist/acp-registry-cache.d.ts +0 -2
  3. package/dist/acp-server-agent.d.ts +2 -1
  4. package/dist/arg-parser.d.ts +2 -1
  5. package/dist/{auth-VQMSZGKE.js → auth-GZ5A5OF5.js} +3 -3
  6. package/dist/auth-menu/local.d.ts +3 -2
  7. package/dist/boot/boot-auto-thin.d.ts +44 -0
  8. package/dist/boot/brain-decision-log.d.ts +2 -1
  9. package/dist/boot/config-backup-recovery.d.ts +2 -6
  10. package/dist/boot/dispatch-singleshot.d.ts +2 -1
  11. package/dist/boot/dispatch-webui.d.ts +5 -1
  12. package/dist/boot/event-wiring.d.ts +1 -1
  13. package/dist/boot/execution-mode.d.ts +2 -1
  14. package/dist/boot/governance-shadow-bridge.d.ts +4 -3
  15. package/dist/boot/governance-trace-context.d.ts +4 -4
  16. package/dist/boot/launch-menu.d.ts +2 -2
  17. package/dist/boot/system-prompt-builder.d.ts +1 -1
  18. package/dist/boot/system-prompt-menu.d.ts +10 -58
  19. package/dist/boot/system-prompt.d.ts +3 -3
  20. package/dist/boot/tool-registry.d.ts +3 -1
  21. package/dist/boot/tui-coordinator-callbacks.d.ts +2 -1
  22. package/dist/boot/tui-coordinator-setup.d.ts +3 -2
  23. package/dist/boot/tui-goal-wiring.d.ts +2 -1
  24. package/dist/boot/tui-live-sessions.d.ts +3 -1
  25. package/dist/boot/tui-session-resume.d.ts +82 -10
  26. package/dist/boot/tui-session-stub-enrich.d.ts +7 -1
  27. package/dist/boot/tui-settings-adapter.d.ts +3 -2
  28. package/dist/boot/tui-theme-adapter.d.ts +3 -2
  29. package/dist/boot/webui-session-child.d.ts +2 -12
  30. package/dist/boot-auto-thin-BZ675EVT.js +102 -0
  31. package/dist/boot-config.d.ts +1 -1
  32. package/dist/brain-menu/panel-service.d.ts +2 -1
  33. package/dist/chimera-cascade-evidence.d.ts +4 -21
  34. package/dist/chimera-review-task.d.ts +0 -7
  35. package/dist/chimera-subagent-ladder.d.ts +2 -2
  36. package/dist/{chunk-USYOJIV2.js → chunk-32MTOI2I.js} +2 -2
  37. package/dist/{chunk-CNQZ4HG4.js → chunk-37SPPLUD.js} +57 -8
  38. package/dist/chunk-ALE5KHCA.js +1 -0
  39. package/dist/{chunk-GWVLRUVH.js → chunk-G3IMKQRH.js} +25 -6
  40. package/dist/{chunk-BZJ4MP32.js → chunk-GKHUHAIK.js} +8 -3
  41. package/dist/{chunk-3JPTNADJ.js → chunk-GPPRNAKW.js} +1 -1
  42. package/dist/{chunk-KE7E7DPX.js → chunk-HXJYHAR4.js} +1 -1
  43. package/dist/{chunk-X3N5TS2S.js → chunk-JACOMTIH.js} +2 -76
  44. package/dist/{chunk-DGXNL7OT.js → chunk-JHUJUIOH.js} +1 -18
  45. package/dist/{chunk-WOTGMHAH.js → chunk-KG4X5F7Z.js} +1 -1
  46. package/dist/{chunk-NUIHRGPY.js → chunk-NV3JDK4F.js} +1 -1
  47. package/dist/{chunk-E3X4KM7T.js → chunk-NZZOYLQ7.js} +5 -10
  48. package/dist/{chunk-H6C7SO5H.js → chunk-QC5I4VWZ.js} +1 -1
  49. package/dist/chunk-SXJTVNWF.js +78 -0
  50. package/dist/{chunk-AOAIPYFB.js → chunk-SYIBTG3X.js} +2 -2
  51. package/dist/{chunk-PKHGLWUJ.js → chunk-T642Q732.js} +5 -4
  52. package/dist/{chunk-BGFM3PD7.js → chunk-UZ2TMHNH.js} +1 -1
  53. package/dist/{chunk-4S52MIIM.js → chunk-VXCCBI2W.js} +2 -2
  54. package/dist/{chunk-FKWHSFX4.js → chunk-XYKYXFEE.js} +1 -1
  55. package/dist/cli-entry-point.d.ts +9 -0
  56. package/dist/cli-eternal-flag.d.ts +1 -1
  57. package/dist/{cli-main-UOQ2ICUO.js → cli-main-IEAM6SK7.js} +3578 -1626
  58. package/dist/cli-main-helpers.d.ts +3 -3
  59. package/dist/config-doctor.d.ts +34 -3
  60. package/dist/context-limit.d.ts +4 -3
  61. package/dist/{diag-doctor-OPTB2NWY.js → diag-doctor-LFCCBPMD.js} +3 -3
  62. package/dist/execute-deps.d.ts +36 -7
  63. package/dist/{execution-L4CXQEND.js → execution-TZUGCKFU.js} +459 -77
  64. package/dist/execution-chimera-cascade.d.ts +1 -1
  65. package/dist/execution-chimera-review.d.ts +1 -1
  66. package/dist/execution-cleanup.d.ts +2 -1
  67. package/dist/execution-kanban-dispatch.d.ts +2 -1
  68. package/dist/execution-repl-fleet-callbacks.d.ts +3 -2
  69. package/dist/fleet/budget-source.d.ts +2 -1
  70. package/dist/fleet/host-context.d.ts +8 -1
  71. package/dist/fleet/host-director-event-bridges.d.ts +28 -3
  72. package/dist/fleet/host-event-bridge.d.ts +6 -1
  73. package/dist/fleet/host-explore-companion-registry.d.ts +60 -0
  74. package/dist/fleet/host-explore-companion.d.ts +7 -3
  75. package/dist/fleet/host-provider.d.ts +2 -1
  76. package/dist/fleet/host-session-writer.d.ts +9 -1
  77. package/dist/fleet/host-shadow-manager.d.ts +82 -20
  78. package/dist/fleet/host-shadow-pass.d.ts +9 -1
  79. package/dist/fleet/host-spawn-types.d.ts +9 -0
  80. package/dist/fleet/host-status.d.ts +2 -1
  81. package/dist/fleet/host-subagent-factory.d.ts +2 -1
  82. package/dist/fleet/host-subagent-session-audit.d.ts +56 -0
  83. package/dist/fleet/host-supervisor.d.ts +11 -1
  84. package/dist/fleet/host-task-result-report.d.ts +2 -1
  85. package/dist/fleet/host.d.ts +38 -6
  86. package/dist/fleet/status-broadcast.d.ts +2 -1
  87. package/dist/fleet-statusline.d.ts +2 -1
  88. package/dist/goal-host.d.ts +3 -2
  89. package/dist/{governance-V2Z42RBE.js → governance-JSGHHA2R.js} +1 -1
  90. package/dist/governance-hq-telemetry.d.ts +2 -2
  91. package/dist/{hq-2XIXGAER.js → hq-NDTJRRX3.js} +3 -3
  92. package/dist/hq-publisher.d.ts +1 -1
  93. package/dist/hq-recovery-html.d.ts +1 -6
  94. package/dist/hq-server/auth-state.d.ts +2 -1
  95. package/dist/hq-server/auth.d.ts +3 -2
  96. package/dist/hq-server/login-attempt-store.d.ts +2 -1
  97. package/dist/hq-server/mailbox-gateway-manager.d.ts +2 -1
  98. package/dist/hq-server/preflight.d.ts +3 -2
  99. package/dist/hq-server/server-lifecycle.d.ts +2 -1
  100. package/dist/hq-server/snapshot.d.ts +0 -9
  101. package/dist/hq-server/startup.d.ts +2 -3
  102. package/dist/hq-server/types.d.ts +2 -2
  103. package/dist/hq-server/upgrade-handler.d.ts +2 -1
  104. package/dist/hq-server/ws-leader.d.ts +0 -6
  105. package/dist/{hq-server-DBT3OOYD.js → hq-server-OH3SPSE2.js} +3 -13
  106. package/dist/hq-server.d.ts +1 -6
  107. package/dist/hq-static-serve.d.ts +2 -1
  108. package/dist/{hq-ttl-U2FAYFAT.js → hq-ttl-KUO3AU7X.js} +2 -2
  109. package/dist/{hq-tunnel-RFKGC4HI.js → hq-tunnel-LO55RCZE.js} +1 -1
  110. package/dist/hq-tunnel.d.ts +2 -1
  111. package/dist/index.js +113 -109
  112. package/dist/input-reader.d.ts +2 -1
  113. package/dist/kanban-dispatch-route.d.ts +27 -2
  114. package/dist/kanban-hq-sync.d.ts +2 -1
  115. package/dist/launch-hints.d.ts +2 -1
  116. package/dist/mailbox-bridge-bootstrap.d.ts +2 -3
  117. package/dist/{mailbox-serve-5S3PHG5D.js → mailbox-serve-VKQIRCCB.js} +47 -28
  118. package/dist/{mcp-RRPKNRSN.js → mcp-AQKSASHD.js} +1 -1
  119. package/dist/mcp-serve.d.ts +2 -1
  120. package/dist/{modeldiag-H6DKWJ2N.js → modeldiag-4NYBRSFP.js} +1 -1
  121. package/dist/next-task-predictor.d.ts +3 -2
  122. package/dist/permission-prompt.d.ts +2 -1
  123. package/dist/picker.d.ts +0 -18
  124. package/dist/plugin-management.d.ts +3 -14
  125. package/dist/{plugin-usage-GCTYOZPH.js → plugin-usage-AP7SJCDA.js} +2 -2
  126. package/dist/{plugins-EEKHCMBE.js → plugins-HQ5FU2AM.js} +3 -5
  127. package/dist/preflight.d.ts +2 -1
  128. package/dist/{proxy-wiring-G26YGP7S.js → proxy-wiring-EQB5X5YH.js} +3 -3
  129. package/dist/renderer.d.ts +18 -1
  130. package/dist/repl-client-registration.d.ts +2 -1
  131. package/dist/repl.d.ts +1 -1
  132. package/dist/{replay-XU6ZD7GM.js → replay-FJ2JBXUA.js} +1 -1
  133. package/dist/{sdd-runtime-GFZ3NJKS.js → sdd-runtime-FLKCSTYV.js} +3 -5
  134. package/dist/services/commit-message.d.ts +2 -1
  135. package/dist/services/sdd/state.d.ts +0 -2
  136. package/dist/services/sdd-runtime.d.ts +1 -1
  137. package/dist/services/statusline-config.d.ts +27 -4
  138. package/dist/session-event-wiring.d.ts +3 -5
  139. package/dist/{sessions-config-7Q7QJBKJ.js → sessions-config-P2LK2L32.js} +5 -1
  140. package/dist/sessions-doctor-EXHAZSSE.js +146 -0
  141. package/dist/settings-menu.d.ts +2 -1
  142. package/dist/shutdown-cleanup.d.ts +3 -2
  143. package/dist/{simpleui-dist-33VO3QHF.js → simpleui-dist-JKNRCRRK.js} +1 -1
  144. package/dist/simpleui-dist.d.ts +3 -2
  145. package/dist/slash-commands/brain-council.d.ts +0 -4
  146. package/dist/slash-commands/brain-status.d.ts +0 -1
  147. package/dist/slash-commands/command-context.d.ts +16 -2
  148. package/dist/slash-commands/fix-classifier.d.ts +2 -1
  149. package/dist/slash-commands/kanban-agent-helpers.d.ts +2 -1
  150. package/dist/slash-commands/kanban-board-handlers.d.ts +2 -1
  151. package/dist/slash-commands/kanban-lifecycle-diagnostics.d.ts +2 -1
  152. package/dist/slash-commands/kanban-task-subcommands.d.ts +0 -1
  153. package/dist/slash-commands/memory-audience.d.ts +1 -10
  154. package/dist/slash-commands/memory-flags.d.ts +2 -1
  155. package/dist/slash-commands/sdd-command-helpers.d.ts +3 -2
  156. package/dist/slash-commands/sdd.d.ts +2 -2
  157. package/dist/slash-commands/settings-mutations.d.ts +0 -1
  158. package/dist/slash-commands/statusline.d.ts +4 -4
  159. package/dist/slash-commands/telegram-pairing.d.ts +2 -2
  160. package/dist/slash-commands/telegram-setup.d.ts +2 -1
  161. package/dist/slash-commands/tier.d.ts +13 -0
  162. package/dist/subcommands/handlers/acp-connection-gate.d.ts +4 -3
  163. package/dist/subcommands/handlers/bench-run-help.d.ts +3 -8
  164. package/dist/subcommands/handlers/daemon-inventory.d.ts +3 -2
  165. package/dist/subcommands/handlers/governance.d.ts +2 -1
  166. package/dist/subcommands/handlers/model-smoke-test.d.ts +3 -2
  167. package/dist/subcommands/handlers/modeldiag-eval.d.ts +0 -4
  168. package/dist/subcommands/handlers/modeldiag-profiles.d.ts +1 -1
  169. package/dist/subcommands/handlers/models-add-help.d.ts +3 -8
  170. package/dist/subcommands/handlers/sessions-doctor.d.ts +3 -0
  171. package/dist/subcommands/handlers/update.d.ts +1 -1
  172. package/dist/terminal-format.d.ts +3 -2
  173. package/dist/tui-resource-menus.d.ts +2 -1
  174. package/dist/tuneup.d.ts +5 -5
  175. package/dist/{update-ZXNC6I6G.js → update-XKARO3CY.js} +3 -3
  176. package/dist/{update-check-WARHSVZA.js → update-check-LICQNYFK.js} +2 -2
  177. package/dist/update-check.d.ts +1 -1
  178. package/dist/utils/hq-ttl.d.ts +2 -1
  179. package/dist/webui-server/connection-handler.d.ts +34 -2
  180. package/dist/webui-server/prefs-seeding.d.ts +11 -1
  181. package/dist/webui-server/route-contexts.d.ts +45 -5
  182. package/dist/webui-server/session-start-payload.d.ts +13 -0
  183. package/dist/webui-server/setup-events.d.ts +14 -1
  184. package/dist/{webui-server-I53IYBW4.js → webui-server-LZOEH7O6.js} +374 -169
  185. package/dist/webui-server-options.d.ts +30 -4
  186. package/dist/wiring/brain-and-orchestration.d.ts +3 -3
  187. package/dist/wiring/cli-execute-builder.d.ts +3 -0
  188. package/dist/wiring/cli-heap-watchdog.d.ts +2 -1
  189. package/dist/wiring/cli-prompt-and-tools-setup.d.ts +10 -8
  190. package/dist/wiring/codebase-index.d.ts +2 -1
  191. package/dist/wiring/command-host-state.d.ts +61 -5
  192. package/dist/wiring/controllers.d.ts +3 -4
  193. package/dist/wiring/dep-watcher-bridge.d.ts +3 -2
  194. package/dist/wiring/dep-watcher.d.ts +2 -1
  195. package/dist/wiring/design-studio.d.ts +2 -1
  196. package/dist/wiring/director-setup.d.ts +3 -2
  197. package/dist/wiring/domain-terms-mirror.d.ts +2 -1
  198. package/dist/wiring/external-plugins.d.ts +3 -2
  199. package/dist/wiring/fleet-command-handlers.d.ts +2 -2
  200. package/dist/wiring/heap-watchdog-setup.d.ts +2 -1
  201. package/dist/wiring/hq-telemetry.d.ts +3 -2
  202. package/dist/wiring/lifecycle-plugins.d.ts +2 -2
  203. package/dist/wiring/management-tools.d.ts +30 -2
  204. package/dist/wiring/metrics.d.ts +2 -2
  205. package/dist/wiring/plugins.d.ts +0 -1
  206. package/dist/wiring/prompt-journal-recorder.d.ts +1 -1
  207. package/dist/wiring/provider-runtime-setup.d.ts +9 -2
  208. package/dist/wiring/provider-runtime.d.ts +23 -3
  209. package/dist/wiring/provider-status.d.ts +2 -1
  210. package/dist/wiring/provider-utility-tools.d.ts +2 -1
  211. package/dist/wiring/provider.d.ts +2 -1
  212. package/dist/wiring/replay-governance-setup.d.ts +2 -1
  213. package/dist/wiring/replay.d.ts +2 -1
  214. package/dist/wiring/resume-candidate.d.ts +27 -0
  215. package/dist/wiring/runtime-controller-deps.d.ts +8 -1
  216. package/dist/wiring/runtime-dispatch-state.d.ts +2 -1
  217. package/dist/wiring/runtime-lifecycle-deps.d.ts +2 -1
  218. package/dist/wiring/runtime-picker-deps.d.ts +2 -1
  219. package/dist/wiring/session-command-handlers.d.ts +2 -2
  220. package/dist/wiring/session-establishment.d.ts +2 -1
  221. package/dist/wiring/session-registry.d.ts +3 -2
  222. package/dist/wiring/session-runtime.d.ts +1 -1
  223. package/dist/wiring/slash-commands.d.ts +5 -4
  224. package/dist/wiring/teardown-registrar.d.ts +3 -2
  225. package/dist/wiring/vector-memory-setup.d.ts +3 -2
  226. package/dist/wiring/wrongtrace-hooks.d.ts +1 -1
  227. package/dist/wiring/wrongtrace-telemetry.d.ts +2 -1
  228. package/dist/{wrongtrace-telemetry-6M2CCBX5.js → wrongtrace-telemetry-FNLANZ5I.js} +1 -1
  229. package/package.json +31 -31
  230. package/dist/auth-menu.d.ts +0 -7
  231. package/dist/chunk-WHOIR577.js +0 -1
  232. package/dist/webui-server/terminal-log-view.d.ts +0 -47
  233. package/dist/wiring/tools.d.ts +0 -29
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  makePromptDelegate,
7
7
  renderAgentsTemplate,
8
8
  renderDiff
9
- } from "./chunk-WOTGMHAH.js";
9
+ } from "./chunk-KG4X5F7Z.js";
10
10
  import {
11
11
  theme
12
12
  } from "./chunk-QD544J2B.js";
@@ -17,19 +17,19 @@ import {
17
17
  import {
18
18
  parseWebuiSessionChildOptions,
19
19
  writeWebuiSessionChildError
20
- } from "./chunk-3JPTNADJ.js";
20
+ } from "./chunk-GPPRNAKW.js";
21
21
  import {
22
22
  discoverAndMergeProviders
23
23
  } from "./chunk-52C7PD2H.js";
24
24
  import {
25
25
  runUpdateCommand
26
- } from "./chunk-4S52MIIM.js";
26
+ } from "./chunk-VXCCBI2W.js";
27
27
  import "./chunk-U3SS4NRH.js";
28
- import "./chunk-NUIHRGPY.js";
28
+ import "./chunk-NV3JDK4F.js";
29
29
  import {
30
30
  DEFAULT_PORT
31
- } from "./chunk-E3X4KM7T.js";
32
- import "./chunk-KE7E7DPX.js";
31
+ } from "./chunk-NZZOYLQ7.js";
32
+ import "./chunk-HXJYHAR4.js";
33
33
  import "./chunk-Q5GTM25S.js";
34
34
  import {
35
35
  helpCmd,
@@ -45,7 +45,7 @@ import {
45
45
  parseArgs,
46
46
  runPicker,
47
47
  saveToGlobalConfig
48
- } from "./chunk-PKHGLWUJ.js";
48
+ } from "./chunk-T642Q732.js";
49
49
  import "./chunk-B4JLSXZB.js";
50
50
  import {
51
51
  isKeylessLocalProvider,
@@ -1511,9 +1511,13 @@ var helpTable = {
1511
1511
  name: "sessions",
1512
1512
  title: "wstack sessions \u2014 list and resume recent sessions",
1513
1513
  description: "List recent sessions, show one session in detail, resume a session, or inspect a session's audit log. The audit log is stored as JSONL next to each session's recording.",
1514
- usage: "wstack sessions [list|show|resume|fork|config|fleet] [...]",
1514
+ usage: "wstack sessions [list|show|resume|fork|doctor|config|fleet] [...]",
1515
1515
  subcommands: [
1516
1516
  { name: "list", description: "List the most recent sessions." },
1517
+ {
1518
+ name: "doctor [--fix] [--json] [--limit N]",
1519
+ description: "Diagnose every journal in this project: unparsable lines, truncated tails, sessions that died mid-turn, missing or stale summary sidecars, and journals large enough to be slow to open. --fix rebuilds only derived artifacts (summary sidecars + the catalog index); journals are never edited."
1520
+ },
1517
1521
  { name: "show <id>", description: "Show one session in detail." },
1518
1522
  { name: "resume [<id>]", description: "Resume a session (latest if no id given)." },
1519
1523
  {
@@ -1861,12 +1865,12 @@ var subcommandsWithFocusedHelp = Object.keys(helpTable);
1861
1865
 
1862
1866
  // src/subcommands/index.ts
1863
1867
  var loaders = {
1864
- acp: async () => (await import("./acp-LQMSMV32.js")).acpCmd,
1868
+ acp: async () => (await import("./acp-CEQINXWB.js")).acpCmd,
1865
1869
  init: async () => (await import("./init-4JQSG66Q.js")).initCmd,
1866
- auth: async () => (await import("./auth-VQMSZGKE.js")).authCmd,
1867
- update: async () => (await import("./update-ZXNC6I6G.js")).updateCmd,
1868
- sessions: async () => (await import("./sessions-config-7Q7QJBKJ.js")).sessionsCmd,
1869
- config: async () => (await import("./sessions-config-7Q7QJBKJ.js")).configCmd,
1870
+ auth: async () => (await import("./auth-GZ5A5OF5.js")).authCmd,
1871
+ update: async () => (await import("./update-XKARO3CY.js")).updateCmd,
1872
+ sessions: async () => (await import("./sessions-config-P2LK2L32.js")).sessionsCmd,
1873
+ config: async () => (await import("./sessions-config-P2LK2L32.js")).configCmd,
1870
1874
  rewind: async () => (await import("./rewind-2FFNOOKS.js")).rewindCmd,
1871
1875
  replay: async () => (await import("./replay-RZXZKP2U.js")).replayCmd,
1872
1876
  audit: async () => (await import("./audit-ZPCLCC3C.js")).auditCmd,
@@ -1874,26 +1878,26 @@ var loaders = {
1874
1878
  skills: async () => (await import("./tools-skills-Q4P27URS.js")).skillsCmd,
1875
1879
  providers: async () => (await import("./providers-models-663NDPRQ.js")).providersCmd,
1876
1880
  models: async () => (await import("./providers-models-663NDPRQ.js")).modelsCmd,
1877
- mcp: async () => (await import("./mcp-RRPKNRSN.js")).mcpCmd,
1878
- plugin: async () => (await import("./plugin-usage-GCTYOZPH.js")).pluginCmd,
1879
- plugins: async () => (await import("./plugin-usage-GCTYOZPH.js")).pluginCmd,
1880
- diag: async () => (await import("./diag-doctor-OPTB2NWY.js")).diagCmd,
1881
- doctor: async () => (await import("./diag-doctor-OPTB2NWY.js")).doctorCmd,
1882
- "proxy-status": async () => (await import("./diag-doctor-OPTB2NWY.js")).proxyCmd,
1881
+ mcp: async () => (await import("./mcp-AQKSASHD.js")).mcpCmd,
1882
+ plugin: async () => (await import("./plugin-usage-AP7SJCDA.js")).pluginCmd,
1883
+ plugins: async () => (await import("./plugin-usage-AP7SJCDA.js")).pluginCmd,
1884
+ diag: async () => (await import("./diag-doctor-LFCCBPMD.js")).diagCmd,
1885
+ doctor: async () => (await import("./diag-doctor-LFCCBPMD.js")).doctorCmd,
1886
+ "proxy-status": async () => (await import("./diag-doctor-LFCCBPMD.js")).proxyCmd,
1883
1887
  export: async () => (await import("./export-ROG3DKTZ.js")).exportCmd,
1884
- usage: async () => (await import("./plugin-usage-GCTYOZPH.js")).usageCmd,
1888
+ usage: async () => (await import("./plugin-usage-AP7SJCDA.js")).usageCmd,
1885
1889
  version: async () => (await import("./version-help-WMPSEL4U.js")).versionCmd,
1886
1890
  help: async () => (await import("./version-help-WMPSEL4U.js")).helpCmd,
1887
1891
  projects: async () => (await import("./projects-5J727S4L.js")).projectsCmd,
1888
- modeldiag: async () => (await import("./modeldiag-H6DKWJ2N.js")).modeldiagCmd,
1892
+ modeldiag: async () => (await import("./modeldiag-4NYBRSFP.js")).modeldiagCmd,
1889
1893
  quick: async () => (await import("./quick-XLYLZX4B.js")).quickCmd,
1890
1894
  bench: async () => (await import("./bench-XYG56AMO.js")).benchCmd,
1891
1895
  chronicle: async () => (await import("./chronicle-6EPPMUC5.js")).chronicleCmd,
1892
- hq: async () => (await import("./hq-2XIXGAER.js")).hqCmd,
1893
- mailbox: async () => (await import("./mailbox-serve-5S3PHG5D.js")).mailboxServeCmd,
1896
+ hq: async () => (await import("./hq-NDTJRRX3.js")).hqCmd,
1897
+ mailbox: async () => (await import("./mailbox-serve-VKQIRCCB.js")).mailboxServeCmd,
1894
1898
  permissions: async () => (await import("./permissions-2PWBL4YU.js")).permissionsCmd,
1895
1899
  project: async () => (await import("./project-BLQ3ALVL.js")).projectCmd,
1896
- governance: async () => (await import("./governance-V2Z42RBE.js")).governanceCmd
1900
+ governance: async () => (await import("./governance-JSGHHA2R.js")).governanceCmd
1897
1901
  };
1898
1902
  var subcommands = Object.fromEntries(
1899
1903
  Object.entries(loaders).map(
@@ -1968,7 +1972,7 @@ async function isPortInUse(host, port) {
1968
1972
  }
1969
1973
  async function handleHqShortCircuit(flags) {
1970
1974
  if (flags["hq"] !== true) return null;
1971
- const { startHqServer } = await import("./hq-server-DBT3OOYD.js");
1975
+ const { startHqServer } = await import("./hq-server-OH3SPSE2.js");
1972
1976
  const tunnelRequested = flags["tunnel"] === true;
1973
1977
  const host = typeof flags["host"] === "string" ? flags["host"] : tunnelRequested ? "127.0.0.1" : HQ_CLI_DEFAULT_HOST2;
1974
1978
  if (tunnelRequested && !isLoopbackHost(host)) {
@@ -2016,7 +2020,7 @@ async function handleHqShortCircuit(flags) {
2016
2020
  let tokenTtlMs;
2017
2021
  const rawTtl = typeof flags["hq-token-ttl"] === "string" ? flags["hq-token-ttl"] : process.env.WRONGSTACK_HQ_TOKEN_TTL;
2018
2022
  if (rawTtl !== void 0 && rawTtl.length > 0) {
2019
- const { parseTokenTtlValue } = await import("./hq-ttl-U2FAYFAT.js");
2023
+ const { parseTokenTtlValue } = await import("./hq-ttl-KUO3AU7X.js");
2020
2024
  const parsed = parseTokenTtlValue(rawTtl);
2021
2025
  if (parsed.error) {
2022
2026
  process.stderr.write(`${color6.red("\u2717")} Invalid --hq-token-ttl: ${parsed.error}
@@ -2064,7 +2068,7 @@ async function handleHqShortCircuit(flags) {
2064
2068
  return 1;
2065
2069
  }
2066
2070
  try {
2067
- const { buildPublicHqUrl, startHqQuickTunnel } = await import("./hq-tunnel-RFKGC4HI.js");
2071
+ const { buildPublicHqUrl, startHqQuickTunnel } = await import("./hq-tunnel-LO55RCZE.js");
2068
2072
  const originHost = handle.host === "::1" ? "[::1]" : handle.host;
2069
2073
  tunnel = await startHqQuickTunnel(`http://${originHost}:${handle.port}`, {
2070
2074
  onUnexpectedExit: (message) => process.stderr.write(`${color6.yellow("!")} ${message}
@@ -2127,7 +2131,7 @@ ${color6.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
2127
2131
  }
2128
2132
 
2129
2133
  // src/boot.ts
2130
- import * as fs8 from "node:fs/promises";
2134
+ import * as fs7 from "node:fs/promises";
2131
2135
  import { createRequire as createRequire4 } from "node:module";
2132
2136
  import * as os from "node:os";
2133
2137
  import * as path8 from "node:path";
@@ -2256,12 +2260,14 @@ async function maybeRestoreDefaultProfileFromBackup(opts) {
2256
2260
  }
2257
2261
 
2258
2262
  // src/boot/system-prompt-menu.ts
2259
- import * as fs5 from "node:fs/promises";
2260
2263
  import {
2261
- buildIdentityLayer,
2262
- loadInstructionBundle
2264
+ countSystemPromptTokens,
2265
+ persistSystemPromptVariant,
2266
+ readSavedSystemPromptVariant,
2267
+ SYSTEM_PROMPT_VARIANT_OPTIONS,
2268
+ SYSTEM_PROMPT_VARIANTS
2263
2269
  } from "@wrongstack/core/agent";
2264
- import { atomicWrite as atomicWrite4, color as color10, estimateTextTokens } from "@wrongstack/core/utils";
2270
+ import { color as color10 } from "@wrongstack/core/utils";
2265
2271
 
2266
2272
  // src/pre-launch/launch-prompts.ts
2267
2273
  import * as fs3 from "node:fs/promises";
@@ -2541,12 +2547,7 @@ async function runProjectCheck(opts) {
2541
2547
  }
2542
2548
 
2543
2549
  // src/boot/system-prompt-menu.ts
2544
- var SYSTEM_PROMPT_OPTIONS = [
2545
- { variant: "lite", label: "Lite", hint: "leanest \u2014 best for small context windows" },
2546
- { variant: "default", label: "Standard", hint: "balanced \u2014 the default" },
2547
- { variant: "pro", label: "Pro", hint: "most detailed guidance \u2014 uses more tokens" }
2548
- ];
2549
- var SYSTEM_PROMPT_VARIANTS = SYSTEM_PROMPT_OPTIONS.map((o) => o.variant);
2550
+ var SYSTEM_PROMPT_OPTIONS = SYSTEM_PROMPT_VARIANT_OPTIONS;
2550
2551
  var SUMMARY_TIMEOUT_MS2 = 5e3;
2551
2552
  function flagOn(value) {
2552
2553
  if (value === true) return true;
@@ -2565,42 +2566,9 @@ function shouldSkipSystemPromptMenu(flags) {
2565
2566
  if (flags["webui"] === true) return true;
2566
2567
  return false;
2567
2568
  }
2568
- async function countSystemPromptTokens(paths) {
2569
- const counts = {};
2570
- for (const variant of SYSTEM_PROMPT_VARIANTS) {
2571
- const bundle = await loadInstructionBundle({
2572
- globalDir: paths.globalDir,
2573
- projectDir: paths.projectDir,
2574
- systemVariant: variant
2575
- });
2576
- const identity = buildIdentityLayer(
2577
- bundle.system?.identity,
2578
- bundle.system?.identitySource,
2579
- void 0
2580
- );
2581
- counts[variant] = estimateTextTokens(identity);
2582
- }
2583
- return counts;
2584
- }
2585
2569
  function labelFor(variant) {
2586
2570
  return SYSTEM_PROMPT_OPTIONS.find((o) => o.variant === variant)?.label ?? variant;
2587
2571
  }
2588
- var VALID_VARIANTS = new Set(SYSTEM_PROMPT_VARIANTS);
2589
- async function readSavedSystemPromptVariant(configPath) {
2590
- let raw;
2591
- try {
2592
- raw = await fs5.readFile(configPath, "utf8");
2593
- } catch {
2594
- return void 0;
2595
- }
2596
- try {
2597
- const parsed = JSON.parse(raw);
2598
- const variant = parsed.systemPrompt?.variant;
2599
- return typeof variant === "string" && VALID_VARIANTS.has(variant) ? variant : void 0;
2600
- } catch {
2601
- return void 0;
2602
- }
2603
- }
2604
2572
  async function runSystemPromptMenu(deps) {
2605
2573
  const { renderer, reader, paths, lastVariant } = deps;
2606
2574
  const tokens = await countSystemPromptTokens(paths);
@@ -2642,30 +2610,6 @@ async function runSystemPromptMenu(deps) {
2642
2610
  if (byName) return byName.variant;
2643
2611
  return defaultVariant;
2644
2612
  }
2645
- async function persistSystemPromptVariant(configPath, variant) {
2646
- let fileExists = false;
2647
- try {
2648
- await fs5.access(configPath);
2649
- fileExists = true;
2650
- } catch {
2651
- }
2652
- let existing = {};
2653
- try {
2654
- const raw = await fs5.readFile(configPath, "utf8");
2655
- existing = JSON.parse(raw);
2656
- } catch (err) {
2657
- if (fileExists) {
2658
- throw new Error(
2659
- `Refusing to overwrite corrupt config at ${configPath} (${err.message}). Fix or move the file aside before retrying.`,
2660
- { cause: err }
2661
- );
2662
- }
2663
- existing = {};
2664
- }
2665
- const systemPrompt = existing.systemPrompt ?? {};
2666
- existing.systemPrompt = { ...systemPrompt, variant };
2667
- await atomicWrite4(configPath, JSON.stringify(existing, null, 2), { mode: 384 });
2668
- }
2669
2613
  async function maybeRunSystemPromptMenu(opts) {
2670
2614
  if (!opts.isInteractiveTTY) return { aborted: false, changed: false };
2671
2615
  if (shouldSkipSystemPromptMenu(opts.flags)) return { aborted: false, changed: false };
@@ -2709,7 +2653,7 @@ async function bootConfig(flags) {
2709
2653
  }
2710
2654
 
2711
2655
  // src/input-reader.ts
2712
- import * as fs6 from "node:fs/promises";
2656
+ import * as fs5 from "node:fs/promises";
2713
2657
  import * as path6 from "node:path";
2714
2658
  import * as readline from "node:readline";
2715
2659
  import {
@@ -2729,7 +2673,7 @@ var ReadlineInputReader = class {
2729
2673
  }
2730
2674
  async loadHistory() {
2731
2675
  try {
2732
- const raw = await fs6.readFile(this.historyFile, "utf8");
2676
+ const raw = await fs5.readFile(this.historyFile, "utf8");
2733
2677
  this.history = raw.split("\n").filter(Boolean).slice(-1e3);
2734
2678
  } catch {
2735
2679
  this.history = [];
@@ -2737,8 +2681,8 @@ var ReadlineInputReader = class {
2737
2681
  }
2738
2682
  async saveHistory() {
2739
2683
  try {
2740
- await fs6.mkdir(path6.dirname(this.historyFile), { recursive: true });
2741
- await fs6.writeFile(this.historyFile, this.history.slice(-1e3).join("\n"));
2684
+ await fs5.mkdir(path6.dirname(this.historyFile), { recursive: true });
2685
+ await fs5.writeFile(this.historyFile, this.history.slice(-1e3).join("\n"));
2742
2686
  } catch {
2743
2687
  }
2744
2688
  }
@@ -2986,7 +2930,7 @@ function dim(s) {
2986
2930
  }
2987
2931
 
2988
2932
  // src/launch-hints.ts
2989
- import * as fs7 from "node:fs/promises";
2933
+ import * as fs6 from "node:fs/promises";
2990
2934
  import * as path7 from "node:path";
2991
2935
  import { color as color11 } from "@wrongstack/core/utils";
2992
2936
  var GROUPS = [
@@ -3197,13 +3141,13 @@ async function pickGroupIndex(opts) {
3197
3141
  try {
3198
3142
  let current = 0;
3199
3143
  try {
3200
- const raw = await fs7.readFile(opts.cursorFile, "utf8");
3144
+ const raw = await fs6.readFile(opts.cursorFile, "utf8");
3201
3145
  const parsed = Number.parseInt(raw.trim(), 10);
3202
3146
  if (Number.isFinite(parsed)) current = wrap(parsed);
3203
3147
  } catch {
3204
3148
  }
3205
- await fs7.mkdir(path7.dirname(opts.cursorFile), { recursive: true });
3206
- await fs7.writeFile(opts.cursorFile, String(wrap(current + 1)));
3149
+ await fs6.mkdir(path7.dirname(opts.cursorFile), { recursive: true });
3150
+ await fs6.writeFile(opts.cursorFile, String(wrap(current + 1)));
3207
3151
  return current;
3208
3152
  } catch {
3209
3153
  }
@@ -3426,6 +3370,25 @@ var TerminalRenderer = class _TerminalRenderer {
3426
3370
  this.err.write(`${theme.info("\u2139")} ${text}
3427
3371
  `);
3428
3372
  }
3373
+ /**
3374
+ * Write text to stderr verbatim: no glyph prefix, no markdown processing.
3375
+ *
3376
+ * Deliberately stricter than writeWarning/writeError/writeInfo, which emit
3377
+ * *diagnostics* and are suppressed only when a TUI owns the terminal (so
3378
+ * they survive silent mode). This method is for informational mirrors of
3379
+ * stdout output, where the stdout copy already carries the full content —
3380
+ * in silent mode the operator asked for machine-only output, so the mirror
3381
+ * is dropped rather than leaked onto a quieter stream. It therefore honors
3382
+ * the full {@link suppressStdout} gate.
3383
+ *
3384
+ * Used by `wstack mailbox serve` to route the human-readable startup banner
3385
+ * away from stdout, keeping the mailbox_serve_started JSON line cleanly
3386
+ * pipeable (`mailbox serve | jq`).
3387
+ */
3388
+ writeStderr(text) {
3389
+ if (this.suppressStdout()) return;
3390
+ this.err.write(text);
3391
+ }
3429
3392
  clear() {
3430
3393
  if (this.suppressStdout()) return;
3431
3394
  this.out.write("\x1B[2J\x1B[H");
@@ -4198,7 +4161,7 @@ async function checkGitInCwd(opts) {
4198
4161
  const cwdGit = path8.join(cwd, ".git");
4199
4162
  let hasCwdGit = false;
4200
4163
  try {
4201
- await fs8.access(cwdGit);
4164
+ await fs7.access(cwdGit);
4202
4165
  hasCwdGit = true;
4203
4166
  } catch {
4204
4167
  }
@@ -4236,7 +4199,7 @@ async function checkGitInCwd(opts) {
4236
4199
  const parentDir = path8.dirname(cwd);
4237
4200
  if (parentDir !== cwd) {
4238
4201
  try {
4239
- await fs8.access(path8.join(parentDir, ".git"));
4202
+ await fs7.access(path8.join(parentDir, ".git"));
4240
4203
  renderer.write(
4241
4204
  ` ${color13.dim("\u2139")} A ${color13.bold(".git")} repo exists in the parent directory: ${color13.dim(parentDir)}
4242
4205
  `
@@ -4261,7 +4224,7 @@ async function printUpdateNotice(initialUpdateInfo) {
4261
4224
  const ac = new AbortController();
4262
4225
  const timer = setTimeout(() => ac.abort(), 2e3);
4263
4226
  try {
4264
- const { checkForUpdate } = await import("./update-check-WARHSVZA.js");
4227
+ const { checkForUpdate } = await import("./update-check-LICQNYFK.js");
4265
4228
  info = await checkForUpdate(ac.signal);
4266
4229
  } catch {
4267
4230
  } finally {
@@ -4481,7 +4444,7 @@ async function initializeCli(argv) {
4481
4444
  async function main(argv) {
4482
4445
  const cliCtx = await initializeCli(argv);
4483
4446
  if (typeof cliCtx === "number") return cliCtx;
4484
- const { runInteractive } = await import("./cli-main-UOQ2ICUO.js");
4447
+ const { runInteractive } = await import("./cli-main-IEAM6SK7.js");
4485
4448
  return runInteractive(cliCtx);
4486
4449
  }
4487
4450
 
@@ -4531,6 +4494,47 @@ function installBrokenPipeHandlers(options = {}) {
4531
4494
  for (const stream of streams) stream.off("error", onError);
4532
4495
  };
4533
4496
  }
4497
+ var EXIT_GRACE_MS = 500;
4498
+ var EXIT_GRACE_MAX_MS = 5e3;
4499
+ var MAX_SOCKET_GRACE_EXTENSIONS = 1;
4500
+ function scheduleForcedExit(code, deps = {}) {
4501
+ const getActiveResources = deps.getActiveResources ?? (() => process.getActiveResourcesInfo?.() ?? []);
4502
+ const exit = deps.exit ?? ((exitCode) => process.exit(exitCode));
4503
+ const startedAt = Date.now();
4504
+ let extensions = 0;
4505
+ let socketExtensions = 0;
4506
+ const check = () => {
4507
+ const active = getActiveResources();
4508
+ const waitedMs = Date.now() - startedAt;
4509
+ const hasWriteStream = active.includes("WriteStream");
4510
+ const hasSocket = active.includes("TCPSocketWrap");
4511
+ const canFlush = waitedMs < EXIT_GRACE_MAX_MS && (hasWriteStream || hasSocket && socketExtensions < MAX_SOCKET_GRACE_EXTENSIONS);
4512
+ if (canFlush) {
4513
+ extensions += 1;
4514
+ if (!hasWriteStream) socketExtensions += 1;
4515
+ const timer = setTimeout(check, Math.min(EXIT_GRACE_MS, EXIT_GRACE_MAX_MS - waitedMs));
4516
+ timer.unref();
4517
+ return;
4518
+ }
4519
+ if (active.length > 0) {
4520
+ console.warn(
4521
+ JSON.stringify({
4522
+ level: "warn",
4523
+ event: "exit.forced",
4524
+ message: `Forcing exit after ${waitedMs}ms grace; ${active.length} active handle(s) remained`,
4525
+ exitCode: code,
4526
+ waitedMs,
4527
+ extensions,
4528
+ activeResources: active,
4529
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
4530
+ })
4531
+ );
4532
+ }
4533
+ exit(code);
4534
+ };
4535
+ const first = setTimeout(check, EXIT_GRACE_MS);
4536
+ first.unref();
4537
+ }
4534
4538
  function runAsMain(mainFn) {
4535
4539
  if (!isMain) return;
4536
4540
  installBrokenPipeHandlers();
@@ -4541,13 +4545,13 @@ function runAsMain(mainFn) {
4541
4545
  mainFn(process.argv.slice(2)).then(
4542
4546
  (c) => {
4543
4547
  process.exitCode = c;
4544
- setTimeout(() => process.exit(c), 500).unref();
4548
+ scheduleForcedExit(c);
4545
4549
  },
4546
4550
  (err) => {
4547
4551
  runFatalSalvageSync();
4548
4552
  writeErr4((err instanceof Error ? err.stack : String(err)) + "\n");
4549
4553
  process.exitCode = 1;
4550
- setTimeout(() => process.exit(1), 500).unref();
4554
+ scheduleForcedExit(1);
4551
4555
  }
4552
4556
  );
4553
4557
  }
@@ -1,5 +1,5 @@
1
1
  import type { InputReader, PromptOption } from '@wrongstack/core/types';
2
- export interface ReadlineInputReaderOptions {
2
+ interface ReadlineInputReaderOptions {
3
3
  historyFile?: string | undefined;
4
4
  prompt?: string | undefined;
5
5
  }
@@ -44,4 +44,5 @@ export declare class ReadlineInputReader implements InputReader {
44
44
  readSecret(prompt: string): Promise<string>;
45
45
  close(): Promise<void>;
46
46
  }
47
+ export {};
47
48
  //# sourceMappingURL=input-reader.d.ts.map
@@ -1,14 +1,39 @@
1
1
  import type { Config } from '@wrongstack/core/types';
2
- export interface KanbanDispatchRouteInput {
2
+ interface KanbanDispatchRouteInput {
3
3
  provider?: string | undefined;
4
4
  model?: string | undefined;
5
5
  fallbackModels?: string[] | undefined;
6
6
  fallbackProfile?: string | undefined;
7
+ /**
8
+ * Named cost level for this task. A board stores the INTENT ("run this
9
+ * cheaply") rather than a model id, so a task queued last week still routes
10
+ * correctly after the tier config changes.
11
+ */
12
+ tier?: string | undefined;
13
+ /** Roster role, used to route through the tier table when no tier is named. */
14
+ role?: string | undefined;
7
15
  }
8
- export interface KanbanDispatchRoute {
16
+ interface KanbanDispatchRoute {
9
17
  provider?: string | undefined;
10
18
  model?: string | undefined;
11
19
  fallbackModels?: string[] | undefined;
20
+ /** The tier that actually resolved, for the run record and the board UI. */
21
+ tier?: string | undefined;
12
22
  }
23
+ /**
24
+ * Resolve a Kanban task's execution route into a concrete provider/model plus
25
+ * failover chain.
26
+ *
27
+ * Precedence, most to least specific:
28
+ * 1. an explicit provider/model pinned on the task,
29
+ * 2. a named fallback profile (chain[0] becomes the primary),
30
+ * 3. a named tier (or the tier routing table, when a role is known),
31
+ * 4. the session leader's model (everything left undefined).
32
+ *
33
+ * The tier step sits BELOW an explicit profile on purpose: a board that already
34
+ * names a chain has made the more specific statement, and a tier must not
35
+ * quietly overrule it.
36
+ */
13
37
  export declare function resolveKanbanDispatchRoute(config: Config, spawnOpts?: KanbanDispatchRouteInput | undefined): KanbanDispatchRoute;
38
+ export {};
14
39
  //# sourceMappingURL=kanban-dispatch-route.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { HqKanbanSnapshotPayload, HqPublisher } from '@wrongstack/core/hq';
2
- export interface KanbanHqSync {
2
+ interface KanbanHqSync {
3
3
  attachPublisher(publisher: HqPublisher): Promise<void>;
4
4
  handleRemote(snapshot: HqKanbanSnapshotPayload): Promise<void>;
5
5
  /** Explicit refresh seam for hosts/tests; daemon events call the same path. */
@@ -19,4 +19,5 @@ export interface KanbanHqSyncStats {
19
19
  export declare function createKanbanHqSync(projectRoot: string, projectId?: string, testHooks?: {
20
20
  beforeLocalPublish?: (() => Promise<void>) | undefined;
21
21
  }): KanbanHqSync;
22
+ export {};
22
23
  //# sourceMappingURL=kanban-hq-sync.d.ts.map
@@ -25,7 +25,7 @@ export declare const HINT_COUNT: number;
25
25
  export declare const HINT_GROUP_COUNT: number;
26
26
  /** Category titles, in rotation order. Exported for tests. */
27
27
  export declare const HINT_GROUP_TITLES: readonly string[];
28
- export interface LaunchHintOptions {
28
+ interface LaunchHintOptions {
29
29
  /**
30
30
  * File holding the rotation cursor. When set, each call advances it so
31
31
  * consecutive launches show different categories (round-robin). Missing
@@ -45,4 +45,5 @@ export interface LaunchHintOptions {
45
45
  * suppressed via `--no-hints` or `WRONGSTACK_NO_HINTS=1`.
46
46
  */
47
47
  export declare function printLaunchHints(renderer: Pick<TerminalRenderer, 'write'>, flags: Record<string, string | boolean>, opts?: LaunchHintOptions): Promise<void>;
48
+ export {};
48
49
  //# sourceMappingURL=launch-hints.d.ts.map
@@ -23,7 +23,6 @@
23
23
  * can run `wstack mailbox serve` manually later.
24
24
  */
25
25
  import { type MailboxBridgeLock, readLiveLock } from '@wrongstack/core/coordination';
26
- export declare const MAILBOX_BRIDGE_BOOTSTRAP_TIMEOUT_MS = 5000;
27
26
  export declare const MAILBOX_BRIDGE_HEALTHZ_PROBE_MS = 500;
28
27
  export interface MailboxBridgeHandle {
29
28
  /** Bound URL — empty string if we couldn't bring the bridge up. */
@@ -46,7 +45,7 @@ export interface MailboxBridgeHandle {
46
45
  */
47
46
  source: 'joined' | 'spawned' | 'unhealthy' | 'failed';
48
47
  }
49
- export interface BootstrapOptions {
48
+ interface BootstrapOptions {
50
49
  /**
51
50
  * WrongStack's per-project STATE directory
52
51
  * (`~/.wrongstack/projects/<slug>`). Owns the lock file and is what we
@@ -88,7 +87,7 @@ export interface BootstrapOptions {
88
87
  timeoutMs?: number;
89
88
  }
90
89
  export type SpawnFn = (args: string[], cwd: string) => SpawnedChild;
91
- export interface SpawnedChild {
90
+ interface SpawnedChild {
92
91
  pid: number | undefined;
93
92
  unref(): void;
94
93
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startCliHqConnection
3
- } from "./chunk-FKWHSFX4.js";
3
+ } from "./chunk-XYKYXFEE.js";
4
4
  import "./chunk-7OCVIDC7.js";
5
5
 
6
6
  // src/subcommands/handlers/mailbox-serve.ts
@@ -219,7 +219,13 @@ This usually means no port is available (extremely rare). Retry or pick an expli
219
219
  void publisher.publishMailboxSnapshot(mailbox, { mailboxId: `${path.basename(projectDir)}:mailbox` }).catch(() => void 0);
220
220
  }
221
221
  });
222
- writeStartupInfo(deps, { host, port: boundPort, projectDir, tokenPath: acquireResult.tokenPath });
222
+ writeStartupInfo(deps, {
223
+ host,
224
+ port: boundPort,
225
+ projectDir,
226
+ projectId,
227
+ tokenPath: acquireResult.tokenPath
228
+ });
223
229
  const stopMemoryWatchdog = startSharedHeapWatchdog({
224
230
  collectStats: () => {
225
231
  const hqQueue = hqConnection?.getPublisher()?.getQueueStats();
@@ -287,39 +293,52 @@ function writeStartupInfo(deps, info) {
287
293
  host: info.host,
288
294
  port: info.port,
289
295
  projectDir: info.projectDir,
296
+ projectId: info.projectId,
290
297
  tokenFile: info.tokenPath
291
298
  })
292
299
  );
293
- deps.renderer.write(`WrongStack mailbox bridge listening on http://${info.host}:${info.port}
294
- `);
295
- deps.renderer.write(`Project dir: ${info.projectDir}
300
+ deps.renderer.writeStderr(
301
+ `WrongStack mailbox bridge listening on http://${info.host}:${info.port}
302
+ `
303
+ );
304
+ deps.renderer.writeStderr(`Project dir: ${info.projectDir}
296
305
  `);
297
- deps.renderer.write(`Token file: ${info.tokenPath} (mode 0600)
306
+ deps.renderer.writeStderr(
307
+ `Project id: ${info.projectId} (use this as projectId when issuing credentials)
308
+ `
309
+ );
310
+ deps.renderer.writeStderr(`Token file: ${info.tokenPath} (mode 0600)
298
311
  `);
299
- deps.renderer.write("\n");
300
- deps.renderer.write("Routes:\n");
301
- deps.renderer.write(" POST /mailbox/send send a message\n");
302
- deps.renderer.write(" POST /mailbox/query query messages\n");
303
- deps.renderer.write(
312
+ deps.renderer.writeStderr("\n");
313
+ deps.renderer.writeStderr("Routes:\n");
314
+ deps.renderer.writeStderr(" POST /mailbox/send send a message\n");
315
+ deps.renderer.writeStderr(" POST /mailbox/query query messages\n");
316
+ deps.renderer.writeStderr(
304
317
  " POST /mailbox/check check inbox and optionally mark read/completed\n"
305
318
  );
306
- deps.renderer.write(" POST /mailbox/ack acknowledge one message\n");
307
- deps.renderer.write(" POST /mailbox/ack-many acknowledge many in one batch\n");
308
- deps.renderer.write(" POST /mailbox/unread-count count unread messages for an agent\n");
309
- deps.renderer.write(" POST /mailbox/agents/register register an external agent\n");
310
- deps.renderer.write(" POST /mailbox/agents/heartbeat update agent heartbeat\n");
311
- deps.renderer.write(" POST /mailbox/register-client register an external client\n");
312
- deps.renderer.write(" POST /mailbox/heartbeat update client heartbeat\n");
313
- deps.renderer.write(" GET /mailbox/agents list all registered agents\n");
314
- deps.renderer.write(" GET /mailbox/agents/online list agents with a live heartbeat\n");
315
- deps.renderer.write(" GET /mailbox/events SSE stream \u2014 real-time mailbox push\n");
316
- deps.renderer.write(" GET /healthz health probe (no auth)\n");
317
- deps.renderer.write("\n");
318
- deps.renderer.write("Send the bearer token in: Authorization: Bearer <token>\n");
319
- deps.renderer.write("Cat the token from another shell:\n");
320
- deps.renderer.write(` cat ${info.tokenPath}
319
+ deps.renderer.writeStderr(" POST /mailbox/ack acknowledge one message\n");
320
+ deps.renderer.writeStderr(" POST /mailbox/ack-many acknowledge many in one batch\n");
321
+ deps.renderer.writeStderr(
322
+ " POST /mailbox/unread-count count unread messages for an agent\n"
323
+ );
324
+ deps.renderer.writeStderr(" POST /mailbox/agents/register register an external agent\n");
325
+ deps.renderer.writeStderr(" POST /mailbox/agents/heartbeat update agent heartbeat\n");
326
+ deps.renderer.writeStderr(" POST /mailbox/register-client register an external client\n");
327
+ deps.renderer.writeStderr(" POST /mailbox/heartbeat update client heartbeat\n");
328
+ deps.renderer.writeStderr(" GET /mailbox/agents list all registered agents\n");
329
+ deps.renderer.writeStderr(
330
+ " GET /mailbox/agents/online list agents with a live heartbeat\n"
331
+ );
332
+ deps.renderer.writeStderr(
333
+ " GET /mailbox/events SSE stream \u2014 real-time mailbox push\n"
334
+ );
335
+ deps.renderer.writeStderr(" GET /healthz health probe (no auth)\n");
336
+ deps.renderer.writeStderr("\n");
337
+ deps.renderer.writeStderr("Send the bearer token in: Authorization: Bearer <token>\n");
338
+ deps.renderer.writeStderr("Cat the token from another shell:\n");
339
+ deps.renderer.writeStderr(` cat ${info.tokenPath}
321
340
  `);
322
- deps.renderer.write("\nPress Ctrl+C to stop.\n");
341
+ deps.renderer.writeStderr("\nPress Ctrl+C to stop.\n");
323
342
  }
324
343
  function printHelp(deps) {
325
344
  deps.renderer.write(`Usage: wstack mailbox <serve>
@@ -341,4 +360,4 @@ function printHelp(deps) {
341
360
  export {
342
361
  mailboxServeCmd
343
362
  };
344
- //# sourceMappingURL=mailbox-serve-5S3PHG5D.js.map
363
+ //# sourceMappingURL=mailbox-serve-VKQIRCCB.js.map
@@ -441,4 +441,4 @@ function isRecord(value) {
441
441
  export {
442
442
  mcpCmd
443
443
  };
444
- //# sourceMappingURL=mcp-RRPKNRSN.js.map
444
+ //# sourceMappingURL=mcp-AQKSASHD.js.map