@wrongstack/cli 0.309.1 → 0.310.1

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 (86) hide show
  1. package/dist/{acp-7NWCC2GO.js → acp-GZIASCLH.js} +6 -4
  2. package/dist/acp-server-agent.d.ts +1 -1
  3. package/dist/{audit-BBR22QH3.js → audit-ZPCLCC3C.js} +1 -1
  4. package/dist/{auth-GZ2FK5KR.js → auth-VQMSZGKE.js} +4 -4
  5. package/dist/{bench-XNDUJOSZ.js → bench-XYG56AMO.js} +1 -1
  6. package/dist/boot/tui-session-stub-enrich.d.ts +20 -0
  7. package/dist/{chronicle-63MFCZN6.js → chronicle-6EPPMUC5.js} +1 -1
  8. package/dist/chunk-3FHFGIIN.js +58 -0
  9. package/dist/chunk-3MAUU765.js +120 -0
  10. package/dist/{chunk-53STH6CX.js → chunk-4S52MIIM.js} +4 -3
  11. package/dist/{chunk-SZ42FYPT.js → chunk-BXFYBQKR.js} +4 -6
  12. package/dist/{chunk-CB35UVXO.js → chunk-J3XBHGEO.js} +34 -9
  13. package/dist/{chunk-UINEP3E7.js → chunk-J4QSP6T2.js} +41 -10
  14. package/dist/{chunk-XSG33WHN.js → chunk-QAC263FZ.js} +4 -2
  15. package/dist/{chunk-XQ6FI2K6.js → chunk-QYIIOMLE.js} +2 -2
  16. package/dist/{chunk-ZRZ54GVL.js → chunk-USYOJIV2.js} +3 -3
  17. package/dist/{chunk-T6YAVFXA.js → chunk-X3N5TS2S.js} +2 -1
  18. package/dist/{cli-main-XGDOIPN5.js → cli-main-UDWMWX55.js} +3114 -2883
  19. package/dist/{diag-doctor-WTBHPOMB.js → diag-doctor-Z6JDXBVX.js} +48 -2
  20. package/dist/{execution-TYUXABWI.js → execution-ZEHK4II6.js} +217 -68
  21. package/dist/{export-CCUXRJOU.js → export-ROG3DKTZ.js} +1 -1
  22. package/dist/{hq-PA6RH2UW.js → hq-3BEUEXJQ.js} +18 -10
  23. package/dist/hq-server/handle-types.d.ts +32 -0
  24. package/dist/hq-server/login-attempt-store.d.ts +5 -0
  25. package/dist/{hq-server-PBRU275L.js → hq-server-4MIW3S4J.js} +2 -2
  26. package/dist/hq-server.d.ts +2 -20
  27. package/dist/index.js +107 -77
  28. package/dist/{init-E2NDDOHI.js → init-4JQSG66Q.js} +1 -1
  29. package/dist/live-settings-input.d.ts +14 -0
  30. package/dist/{mailbox-serve-V3QIJBDH.js → mailbox-serve-5S3PHG5D.js} +1 -1
  31. package/dist/{mcp-CMLFHRG2.js → mcp-RRPKNRSN.js} +3 -1
  32. package/dist/mcp-serve.d.ts +1 -1
  33. package/dist/{modeldiag-ICMPHT5L.js → modeldiag-H6DKWJ2N.js} +6 -12
  34. package/dist/{plugin-usage-26LIIW3P.js → plugin-usage-GCTYOZPH.js} +1 -1
  35. package/dist/{projects-XE76NFNZ.js → projects-5J727S4L.js} +1 -1
  36. package/dist/provider-config-utils.d.ts +1 -2
  37. package/dist/{providers-models-D23WUD74.js → providers-models-663NDPRQ.js} +2 -2
  38. package/dist/proxy-wiring-7RPGBHZP.js +15 -0
  39. package/dist/{quick-VIO2BEHS.js → quick-XLYLZX4B.js} +1 -1
  40. package/dist/{replay-WBRMEWQ5.js → replay-RZXZKP2U.js} +1 -1
  41. package/dist/{rewind-7RE6ONIC.js → rewind-2FFNOOKS.js} +1 -1
  42. package/dist/{sessions-config-YX2ZPAFM.js → sessions-config-7Q7QJBKJ.js} +1 -1
  43. package/dist/subcommands/handlers/acp.d.ts +1 -1
  44. package/dist/subcommands/handlers/audit.d.ts +1 -1
  45. package/dist/subcommands/handlers/auth.d.ts +1 -1
  46. package/dist/subcommands/handlers/bench.d.ts +1 -1
  47. package/dist/subcommands/handlers/chronicle.d.ts +1 -1
  48. package/dist/subcommands/handlers/config-history.d.ts +1 -1
  49. package/dist/subcommands/handlers/diag-doctor.d.ts +15 -1
  50. package/dist/subcommands/handlers/export.d.ts +1 -1
  51. package/dist/subcommands/handlers/hq.d.ts +1 -1
  52. package/dist/subcommands/handlers/init.d.ts +1 -1
  53. package/dist/subcommands/handlers/mailbox-serve.d.ts +1 -1
  54. package/dist/subcommands/handlers/mcp.d.ts +1 -1
  55. package/dist/subcommands/handlers/modeldiag-bench.d.ts +1 -1
  56. package/dist/subcommands/handlers/modeldiag-eval.d.ts +1 -1
  57. package/dist/subcommands/handlers/modeldiag-test.d.ts +1 -1
  58. package/dist/subcommands/handlers/modeldiag.d.ts +1 -1
  59. package/dist/subcommands/handlers/plugin-usage.d.ts +1 -1
  60. package/dist/subcommands/handlers/projects.d.ts +1 -1
  61. package/dist/subcommands/handlers/providers-models.d.ts +1 -1
  62. package/dist/subcommands/handlers/quick.d.ts +1 -1
  63. package/dist/subcommands/handlers/replay.d.ts +1 -1
  64. package/dist/subcommands/handlers/rewind.d.ts +1 -1
  65. package/dist/subcommands/handlers/sessions-config.d.ts +1 -1
  66. package/dist/subcommands/handlers/sessions-fleet.d.ts +1 -1
  67. package/dist/subcommands/handlers/tools-skills.d.ts +1 -1
  68. package/dist/subcommands/handlers/update.d.ts +1 -1
  69. package/dist/subcommands/handlers/version-help.d.ts +1 -1
  70. package/dist/subcommands/index.d.ts +2 -3
  71. package/dist/{tools-skills-UNKLOB7M.js → tools-skills-Q4P27URS.js} +1 -1
  72. package/dist/{update-VZSOZGYC.js → update-ZXNC6I6G.js} +2 -2
  73. package/dist/{version-help-TFD6VPF3.js → version-help-WMPSEL4U.js} +2 -2
  74. package/dist/webui-server/prefs-seeding.d.ts +4 -0
  75. package/dist/{webui-server-JXJ4CGIX.js → webui-server-UB75UHWX.js} +14 -10
  76. package/dist/webui-server-options.d.ts +8 -0
  77. package/dist/wiring/director-announcement.d.ts +31 -0
  78. package/dist/wiring/provider-runtime.d.ts +25 -0
  79. package/dist/wiring/proxy-probe.d.ts +62 -0
  80. package/dist/wiring/proxy-wiring.d.ts +59 -0
  81. package/dist/wiring/session-establishment.d.ts +45 -0
  82. package/dist/wiring/session-registry.d.ts +1 -1
  83. package/dist/wiring/session-runtime.d.ts +64 -0
  84. package/dist/wiring/teardown-registrar.d.ts +41 -0
  85. package/dist/wiring/vector-memory-setup.d.ts +30 -0
  86. package/package.json +27 -25
@@ -51,7 +51,7 @@ var hqCmd = async (args, deps) => {
51
51
  return 1;
52
52
  };
53
53
  async function startServer(deps) {
54
- const { startHqServer } = await import("./hq-server-PBRU275L.js");
54
+ const { startHqServer } = await import("./hq-server-4MIW3S4J.js");
55
55
  const dataDir = resolveDataDir(deps);
56
56
  const flags = deps.flags ?? {};
57
57
  const host = typeof flags["host"] === "string" ? flags["host"] : HQ_CLI_DEFAULT_HOST;
@@ -632,16 +632,22 @@ function printTokenHelp(deps) {
632
632
  ` wstack hq token create --client [label] [--ttl <dur>] Mint a client token (/ws/client).
633
633
  `
634
634
  );
635
- deps.renderer.write(` wstack hq token list List issued browser tokens (alias: ls).
636
- `);
637
- deps.renderer.write(` wstack hq token list --client List issued client tokens.
638
- `);
635
+ deps.renderer.write(
636
+ ` wstack hq token list List issued browser tokens (alias: ls).
637
+ `
638
+ );
639
+ deps.renderer.write(
640
+ ` wstack hq token list --client List issued client tokens.
641
+ `
642
+ );
639
643
  deps.renderer.write(
640
644
  ` wstack hq token revoke <id> Revoke a browser token (id prefix match).
641
645
  `
642
646
  );
643
- deps.renderer.write(` wstack hq token revoke --client <id> Revoke a client token.
644
- `);
647
+ deps.renderer.write(
648
+ ` wstack hq token revoke --client <id> Revoke a client token.
649
+ `
650
+ );
645
651
  deps.renderer.write("\n");
646
652
  deps.renderer.write(`The token secret is printed once at create time and cannot be recovered
647
653
  `);
@@ -656,8 +662,10 @@ function printTokenHelp(deps) {
656
662
  ` --data-dir <path> Override HQ data directory (default ~/.wrongstack/hq).
657
663
  `
658
664
  );
659
- deps.renderer.write(` --client, -c Operate on client tokens instead of browser tokens.
660
- `);
665
+ deps.renderer.write(
666
+ ` --client, -c Operate on client tokens instead of browser tokens.
667
+ `
668
+ );
661
669
  deps.renderer.write(
662
670
  ` --capabilities <csv> Comma-separated capability grants (browser: control.enqueue; client: telemetry.publish,control.execute).
663
671
  `
@@ -701,4 +709,4 @@ export {
701
709
  hqCmd,
702
710
  resolveAuditActor
703
711
  };
704
- //# sourceMappingURL=hq-PA6RH2UW.js.map
712
+ //# sourceMappingURL=hq-3BEUEXJQ.js.map
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Type-only leaf for the public HQ server handle.
3
+ *
4
+ * Lives separately from `hq-server.ts` so callers (notably
5
+ * `subcommands/handlers/hq.ts`) can depend on the public types without
6
+ * pulling in the HQ server implementation. Breaks a long-standing type-only
7
+ * import edge `handlers/hq.ts → hq-server.ts` that participated in the
8
+ * 33-member CLI SCC (see docs/reports/modularity-assessment-2026-08-22.md).
9
+ *
10
+ * This module MUST contain no runtime imports.
11
+ */
12
+ export interface HqStartupConnectionInfo {
13
+ dataDir: string;
14
+ browserUrl: string;
15
+ clientUrl: string;
16
+ clientEnv: {
17
+ WRONGSTACK_HQ_URL: string;
18
+ WRONGSTACK_HQ_TOKEN?: string;
19
+ };
20
+ createdAuth: boolean;
21
+ browserTokenMode: boolean;
22
+ passwordMode: boolean;
23
+ }
24
+ export type HqFirstRunSetup = HqStartupConnectionInfo;
25
+ export interface HqServerHandle {
26
+ host: string;
27
+ port: number;
28
+ firstRunSetup?: HqFirstRunSetup;
29
+ trustPublicOrigin(origin: string): void;
30
+ close(): Promise<void>;
31
+ }
32
+ //# sourceMappingURL=handle-types.d.ts.map
@@ -32,6 +32,11 @@ export declare class LoginAttemptStore {
32
32
  /**
33
33
  * Load persisted state from disk and prune stale entries.
34
34
  * Safe to call once at startup; subsequent calls reload from disk.
35
+ *
36
+ * SEC-001: legacy `cred:` entries (per-password hashes persisted by the
37
+ * pre-fix version) are skipped here, not just on write — re-seeding them
38
+ * would keep the hashes in memory and on disk. When any are found, a
39
+ * debounced rewrite scrubs them from the file.
35
40
  */
36
41
  load(): Promise<void>;
37
42
  get(key: string): LoginAttemptEntry | undefined;
@@ -15,7 +15,7 @@ import {
15
15
  readLocalSubagentTranscript,
16
16
  sanitizeApiError,
17
17
  startHqServer
18
- } from "./chunk-CB35UVXO.js";
18
+ } from "./chunk-J3XBHGEO.js";
19
19
  import "./chunk-KE7E7DPX.js";
20
20
  import "./chunk-Q5GTM25S.js";
21
21
  import "./chunk-7OCVIDC7.js";
@@ -37,4 +37,4 @@ export {
37
37
  sanitizeApiError,
38
38
  startHqServer
39
39
  };
40
- //# sourceMappingURL=hq-server-PBRU275L.js.map
40
+ //# sourceMappingURL=hq-server-4MIW3S4J.js.map
@@ -42,25 +42,7 @@ export interface HqServerOptions {
42
42
  tokenTtlMs?: number;
43
43
  trustedProxyHops?: number;
44
44
  }
45
- export interface HqStartupConnectionInfo {
46
- dataDir: string;
47
- browserUrl: string;
48
- clientUrl: string;
49
- clientEnv: {
50
- WRONGSTACK_HQ_URL: string;
51
- WRONGSTACK_HQ_TOKEN?: string;
52
- };
53
- createdAuth: boolean;
54
- browserTokenMode: boolean;
55
- passwordMode: boolean;
56
- }
57
- export type HqFirstRunSetup = HqStartupConnectionInfo;
58
- export interface HqServerHandle {
59
- host: string;
60
- port: number;
61
- firstRunSetup?: HqFirstRunSetup;
62
- trustPublicOrigin(origin: string): void;
63
- close(): Promise<void>;
64
- }
45
+ import type { HqServerHandle } from './hq-server/handle-types.js';
46
+ export type { HqFirstRunSetup, HqServerHandle, HqStartupConnectionInfo, } from './hq-server/handle-types.js';
65
47
  export declare function startHqServer(options?: HqServerOptions): Promise<HqServerHandle>;
66
48
  //# sourceMappingURL=hq-server.d.ts.map
package/dist/index.js CHANGED
@@ -23,18 +23,18 @@ import {
23
23
  } from "./chunk-52C7PD2H.js";
24
24
  import {
25
25
  runUpdateCommand
26
- } from "./chunk-53STH6CX.js";
26
+ } from "./chunk-4S52MIIM.js";
27
27
  import "./chunk-U3SS4NRH.js";
28
28
  import "./chunk-NUIHRGPY.js";
29
29
  import {
30
30
  DEFAULT_PORT
31
- } from "./chunk-CB35UVXO.js";
31
+ } from "./chunk-J3XBHGEO.js";
32
32
  import "./chunk-KE7E7DPX.js";
33
33
  import "./chunk-Q5GTM25S.js";
34
34
  import {
35
35
  helpCmd,
36
36
  versionCmd
37
- } from "./chunk-XSG33WHN.js";
37
+ } from "./chunk-QAC263FZ.js";
38
38
  import {
39
39
  CLI_VERSION
40
40
  } from "./chunk-XJXDOF63.js";
@@ -59,7 +59,7 @@ import {
59
59
  normalizeKeys,
60
60
  resolveActiveApiKey,
61
61
  writeKeysBack
62
- } from "./chunk-SZ42FYPT.js";
62
+ } from "./chunk-BXFYBQKR.js";
63
63
  import "./chunk-7OCVIDC7.js";
64
64
 
65
65
  // src/cli-context.ts
@@ -386,7 +386,7 @@ async function promptModeArrow(deps) {
386
386
  const { renderer } = deps;
387
387
  const stdin = process.stdin;
388
388
  const out = (s) => renderer.write(s);
389
- return await new Promise((resolve2) => {
389
+ return await new Promise((resolve3) => {
390
390
  let index = 0;
391
391
  let drawn = 0;
392
392
  let remaining = Math.round(MENU_TIMEOUT_MS / 1e3);
@@ -441,7 +441,7 @@ async function promptModeArrow(deps) {
441
441
  out("\x1B[0J");
442
442
  out(finalLine);
443
443
  out("\x1B[?25h");
444
- resolve2(result);
444
+ resolve3(result);
445
445
  };
446
446
  const pick = () => {
447
447
  const opt = MODE_OPTIONS[index];
@@ -500,7 +500,7 @@ async function promptModeArrow(deps) {
500
500
  setRawMode(stdin, true);
501
501
  stdin.resume();
502
502
  } catch {
503
- resolve2(null);
503
+ resolve3(null);
504
504
  return;
505
505
  }
506
506
  out("\x1B[?25l");
@@ -712,7 +712,7 @@ async function launchDesktop(args) {
712
712
  );
713
713
  return 1;
714
714
  }
715
- return await new Promise((resolve2) => {
715
+ return await new Promise((resolve3) => {
716
716
  const child = spawn(process.execPath, [launcherPath, ...args], {
717
717
  stdio: "inherit",
718
718
  env: process.env,
@@ -723,11 +723,11 @@ async function launchDesktop(args) {
723
723
  `${color2.red("\u2717 Failed to start WrongStack Desktop:")} ${err.message}
724
724
  `
725
725
  );
726
- resolve2(1);
726
+ resolve3(1);
727
727
  });
728
728
  child.once("exit", (code, signal) => {
729
- if (typeof code === "number") resolve2(code);
730
- else resolve2(signal ? 1 : 0);
729
+ if (typeof code === "number") resolve3(code);
730
+ else resolve3(signal ? 1 : 0);
731
731
  });
732
732
  });
733
733
  }
@@ -1645,8 +1645,8 @@ var helpTable = {
1645
1645
  update: {
1646
1646
  name: "update",
1647
1647
  title: "wstack update \u2014 self-update the CLI",
1648
- description: "Check the latest npm version and update the globally-installed `wrongstack` package. Use `--check-only` to just print the current/latest without installing. The update is global; run from any project root.",
1649
- usage: "wstack update [--check-only]",
1648
+ description: "Check the latest npm version and update the globally-installed `wrongstack` package. Use `--check-only` to just print the current/latest without installing. Pass `--pm <manager>` (or its shorthand `--npm`, `--pnpm`, `--yarn`, `--bun`) to force a specific package manager; pass `--allow-scripts` (alias `--lifecycle-scripts`) to opt into package lifecycle scripts during the update (off by default). The update is global; run from any project root.",
1649
+ usage: "wstack update [--check-only] [--pm <manager>] [--allow-scripts (alias: --lifecycle-scripts)]",
1650
1650
  seeAlso: "wstack version (read-only version info)"
1651
1651
  },
1652
1652
  // -- ACP (Agent Client Protocol) --------------------------------------
@@ -1660,7 +1660,10 @@ var helpTable = {
1660
1660
  { name: "list", description: "List available ACP agents from the cache." },
1661
1661
  { name: "sync", description: "Sync the official ACP agent registry into local cache." },
1662
1662
  { name: "spawn <id> <task>", description: "Spawn an ACP agent and wait for results." },
1663
- { name: "parallel <csv> <task>", description: "Fan a task out to multiple ACP agents in parallel." },
1663
+ {
1664
+ name: "parallel <csv> <task>",
1665
+ description: "Fan a task out to multiple ACP agents in parallel."
1666
+ },
1664
1667
  { name: "probe [csv]", description: "Handshake-test installed ACP agents." },
1665
1668
  { name: "bench [csv] [--fs]", description: "End-to-end benchmark and grade ACP agents." }
1666
1669
  ],
@@ -1732,7 +1735,10 @@ var helpTable = {
1732
1735
  usage: "wstack hq [serve] [--port <n>] [--password <secret>] [--tunnel] [--open] | wstack hq token [create|list|revoke]",
1733
1736
  subcommands: [
1734
1737
  { name: "serve", description: "Start the HQ dashboard server (default)." },
1735
- { name: "token create [label]", description: "Mint a browser or client authentication token." },
1738
+ {
1739
+ name: "token create [label]",
1740
+ description: "Mint a browser or client authentication token."
1741
+ },
1736
1742
  { name: "token list", description: "List active HQ authentication tokens." },
1737
1743
  { name: "token revoke <id>", description: "Revoke an issued HQ authentication token." }
1738
1744
  ],
@@ -1792,8 +1798,14 @@ var helpTable = {
1792
1798
  { name: "query [field=value ...]", description: "Query recorded provenance events." },
1793
1799
  { name: "status", description: "Check the Chronicle daemon and pipeline status." },
1794
1800
  { name: "facet <field>", description: "Group and count events across a facet." },
1795
- { name: "metrics [providers|tasks|files|summary]", description: "Query aggregated metrics from metrics.db." },
1796
- { name: "prune [--days N] [--dry-run]", description: "Purge journal entries older than N days." },
1801
+ {
1802
+ name: "metrics [providers|tasks|files|summary]",
1803
+ description: "Query aggregated metrics from metrics.db."
1804
+ },
1805
+ {
1806
+ name: "prune [--days N] [--dry-run]",
1807
+ description: "Purge journal entries older than N days."
1808
+ },
1797
1809
  { name: "compact", description: "Defragment and compact SQLite ledger." }
1798
1810
  ],
1799
1811
  seeAlso: "wstack audit (per-session audit log); wstack usage (cost summary)"
@@ -1849,44 +1861,47 @@ var subcommandsWithFocusedHelp = Object.keys(helpTable);
1849
1861
 
1850
1862
  // src/subcommands/index.ts
1851
1863
  var loaders = {
1852
- acp: async () => (await import("./acp-7NWCC2GO.js")).acpCmd,
1853
- init: async () => (await import("./init-E2NDDOHI.js")).initCmd,
1854
- auth: async () => (await import("./auth-GZ2FK5KR.js")).authCmd,
1855
- update: async () => (await import("./update-VZSOZGYC.js")).updateCmd,
1856
- sessions: async () => (await import("./sessions-config-YX2ZPAFM.js")).sessionsCmd,
1857
- config: async () => (await import("./sessions-config-YX2ZPAFM.js")).configCmd,
1858
- rewind: async () => (await import("./rewind-7RE6ONIC.js")).rewindCmd,
1859
- replay: async () => (await import("./replay-WBRMEWQ5.js")).replayCmd,
1860
- audit: async () => (await import("./audit-BBR22QH3.js")).auditCmd,
1861
- tools: async () => (await import("./tools-skills-UNKLOB7M.js")).toolsCmd,
1862
- skills: async () => (await import("./tools-skills-UNKLOB7M.js")).skillsCmd,
1863
- providers: async () => (await import("./providers-models-D23WUD74.js")).providersCmd,
1864
- models: async () => (await import("./providers-models-D23WUD74.js")).modelsCmd,
1865
- mcp: async () => (await import("./mcp-CMLFHRG2.js")).mcpCmd,
1866
- plugin: async () => (await import("./plugin-usage-26LIIW3P.js")).pluginCmd,
1867
- plugins: async () => (await import("./plugin-usage-26LIIW3P.js")).pluginCmd,
1868
- diag: async () => (await import("./diag-doctor-WTBHPOMB.js")).diagCmd,
1869
- doctor: async () => (await import("./diag-doctor-WTBHPOMB.js")).doctorCmd,
1870
- export: async () => (await import("./export-CCUXRJOU.js")).exportCmd,
1871
- usage: async () => (await import("./plugin-usage-26LIIW3P.js")).usageCmd,
1872
- version: async () => (await import("./version-help-TFD6VPF3.js")).versionCmd,
1873
- help: async () => (await import("./version-help-TFD6VPF3.js")).helpCmd,
1874
- projects: async () => (await import("./projects-XE76NFNZ.js")).projectsCmd,
1875
- modeldiag: async () => (await import("./modeldiag-ICMPHT5L.js")).modeldiagCmd,
1876
- quick: async () => (await import("./quick-VIO2BEHS.js")).quickCmd,
1877
- bench: async () => (await import("./bench-XNDUJOSZ.js")).benchCmd,
1878
- chronicle: async () => (await import("./chronicle-63MFCZN6.js")).chronicleCmd,
1879
- hq: async () => (await import("./hq-PA6RH2UW.js")).hqCmd,
1880
- mailbox: async () => (await import("./mailbox-serve-V3QIJBDH.js")).mailboxServeCmd,
1864
+ acp: async () => (await import("./acp-GZIASCLH.js")).acpCmd,
1865
+ 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
+ rewind: async () => (await import("./rewind-2FFNOOKS.js")).rewindCmd,
1871
+ replay: async () => (await import("./replay-RZXZKP2U.js")).replayCmd,
1872
+ audit: async () => (await import("./audit-ZPCLCC3C.js")).auditCmd,
1873
+ tools: async () => (await import("./tools-skills-Q4P27URS.js")).toolsCmd,
1874
+ skills: async () => (await import("./tools-skills-Q4P27URS.js")).skillsCmd,
1875
+ providers: async () => (await import("./providers-models-663NDPRQ.js")).providersCmd,
1876
+ 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-Z6JDXBVX.js")).diagCmd,
1881
+ doctor: async () => (await import("./diag-doctor-Z6JDXBVX.js")).doctorCmd,
1882
+ "proxy-status": async () => (await import("./diag-doctor-Z6JDXBVX.js")).proxyCmd,
1883
+ export: async () => (await import("./export-ROG3DKTZ.js")).exportCmd,
1884
+ usage: async () => (await import("./plugin-usage-GCTYOZPH.js")).usageCmd,
1885
+ version: async () => (await import("./version-help-WMPSEL4U.js")).versionCmd,
1886
+ help: async () => (await import("./version-help-WMPSEL4U.js")).helpCmd,
1887
+ projects: async () => (await import("./projects-5J727S4L.js")).projectsCmd,
1888
+ modeldiag: async () => (await import("./modeldiag-H6DKWJ2N.js")).modeldiagCmd,
1889
+ quick: async () => (await import("./quick-XLYLZX4B.js")).quickCmd,
1890
+ bench: async () => (await import("./bench-XYG56AMO.js")).benchCmd,
1891
+ chronicle: async () => (await import("./chronicle-6EPPMUC5.js")).chronicleCmd,
1892
+ hq: async () => (await import("./hq-3BEUEXJQ.js")).hqCmd,
1893
+ mailbox: async () => (await import("./mailbox-serve-5S3PHG5D.js")).mailboxServeCmd,
1881
1894
  permissions: async () => (await import("./permissions-2PWBL4YU.js")).permissionsCmd,
1882
1895
  project: async () => (await import("./project-BLQ3ALVL.js")).projectCmd,
1883
1896
  governance: async () => (await import("./governance-V2Z42RBE.js")).governanceCmd
1884
1897
  };
1885
1898
  var subcommands = Object.fromEntries(
1886
- Object.entries(loaders).map(([name, load]) => [
1887
- name,
1888
- async (args, deps) => (await load())(args, deps)
1889
- ])
1899
+ Object.entries(loaders).map(
1900
+ ([name, load]) => [
1901
+ name,
1902
+ async (args, deps) => (await load())(args, deps)
1903
+ ]
1904
+ )
1890
1905
  );
1891
1906
  var subcommandNames = Object.keys(loaders);
1892
1907
 
@@ -1936,24 +1951,24 @@ async function isHqAlreadyRunning(dataDir) {
1936
1951
  return null;
1937
1952
  }
1938
1953
  async function isPortInUse(host, port) {
1939
- return new Promise((resolve2) => {
1954
+ return new Promise((resolve3) => {
1940
1955
  const server = net.createServer();
1941
1956
  server.once("error", (err) => {
1942
1957
  if (err.code === "EADDRINUSE") {
1943
- resolve2(true);
1958
+ resolve3(true);
1944
1959
  } else {
1945
- resolve2(false);
1960
+ resolve3(false);
1946
1961
  }
1947
1962
  });
1948
1963
  server.once("listening", () => {
1949
- server.close(() => resolve2(false));
1964
+ server.close(() => resolve3(false));
1950
1965
  });
1951
1966
  server.listen(port, host);
1952
1967
  });
1953
1968
  }
1954
1969
  async function handleHqShortCircuit(flags) {
1955
1970
  if (flags["hq"] !== true) return null;
1956
- const { startHqServer } = await import("./hq-server-PBRU275L.js");
1971
+ const { startHqServer } = await import("./hq-server-4MIW3S4J.js");
1957
1972
  const tunnelRequested = flags["tunnel"] === true;
1958
1973
  const host = typeof flags["host"] === "string" ? flags["host"] : tunnelRequested ? "127.0.0.1" : HQ_CLI_DEFAULT_HOST2;
1959
1974
  if (tunnelRequested && !isLoopbackHost(host)) {
@@ -2084,7 +2099,7 @@ ${color6.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
2084
2099
  } catch {
2085
2100
  }
2086
2101
  }
2087
- await new Promise((resolve2) => {
2102
+ await new Promise((resolve3) => {
2088
2103
  const shutdown = async () => {
2089
2104
  const results = await Promise.allSettled([
2090
2105
  ...tunnel ? [tunnel.close()] : [],
@@ -2103,7 +2118,7 @@ ${color6.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
2103
2118
  })
2104
2119
  );
2105
2120
  }
2106
- resolve2();
2121
+ resolve3();
2107
2122
  };
2108
2123
  process.on("SIGINT", shutdown);
2109
2124
  process.on("SIGTERM", shutdown);
@@ -2491,7 +2506,7 @@ async function runProjectCheck(opts) {
2491
2506
  if (answer2 === "y" || answer2 === "yes") {
2492
2507
  try {
2493
2508
  const { spawn: spawn2 } = await import("node:child_process");
2494
- await new Promise((resolve2, reject) => {
2509
+ await new Promise((resolve3, reject) => {
2495
2510
  const child = spawn2("git", ["init"], {
2496
2511
  cwd,
2497
2512
  signal: AbortSignal.timeout(1e4),
@@ -2500,7 +2515,7 @@ async function runProjectCheck(opts) {
2500
2515
  child.on("error", reject);
2501
2516
  child.on(
2502
2517
  "close",
2503
- (code) => code === 0 ? resolve2() : reject(new Error(`git init failed with ${code}`))
2518
+ (code) => code === 0 ? resolve3() : reject(new Error(`git init failed with ${code}`))
2504
2519
  );
2505
2520
  });
2506
2521
  renderer.write(` ${color9.green("\u2713")} Git repository initialized
@@ -2744,25 +2759,25 @@ var ReadlineInputReader = class {
2744
2759
  async readLine(prompt, timeoutOpts) {
2745
2760
  if (this.history.length === 0) await this.loadHistory();
2746
2761
  while (this.pending) {
2747
- await new Promise((resolve2) => setTimeout(resolve2, 50));
2762
+ await new Promise((resolve3) => setTimeout(resolve3, 50));
2748
2763
  }
2749
2764
  this.pending = true;
2750
2765
  try {
2751
2766
  if (this.rl) {
2752
2767
  const old = this.rl;
2753
2768
  this.rl = void 0;
2754
- await new Promise((resolve2) => {
2769
+ await new Promise((resolve3) => {
2755
2770
  if (old.closed) {
2756
- resolve2();
2771
+ resolve3();
2757
2772
  } else {
2758
- old.once("close", resolve2);
2773
+ old.once("close", resolve3);
2759
2774
  old.close();
2760
2775
  }
2761
2776
  });
2762
2777
  }
2763
2778
  const fresh = this.ensure();
2764
2779
  this.installPromptGuard(fresh);
2765
- const line = await new Promise((resolve2) => {
2780
+ const line = await new Promise((resolve3) => {
2766
2781
  let settled = false;
2767
2782
  let timeoutHandle;
2768
2783
  const settle = (line2) => {
@@ -2770,7 +2785,7 @@ var ReadlineInputReader = class {
2770
2785
  settled = true;
2771
2786
  if (timeoutHandle) clearTimeout(timeoutHandle);
2772
2787
  setOutputLineGuard(null);
2773
- resolve2(line2);
2788
+ resolve3(line2);
2774
2789
  };
2775
2790
  if (timeoutOpts) {
2776
2791
  timeoutHandle = setTimeout(() => {
@@ -2835,7 +2850,7 @@ var ReadlineInputReader = class {
2835
2850
  async readKey(prompt, options) {
2836
2851
  setOutputLineGuard(null);
2837
2852
  writeOut(prompt);
2838
- return new Promise((resolve2) => {
2853
+ return new Promise((resolve3) => {
2839
2854
  const stdin = process.stdin;
2840
2855
  const wasRaw = stdin.isRaw;
2841
2856
  const wasPaused = stdin.isPaused();
@@ -2846,7 +2861,7 @@ var ReadlineInputReader = class {
2846
2861
  if (key === "") {
2847
2862
  cleanup();
2848
2863
  writeOut("\n");
2849
- resolve2("");
2864
+ resolve3("");
2850
2865
  return;
2851
2866
  }
2852
2867
  const opt = options.find(
@@ -2856,12 +2871,12 @@ var ReadlineInputReader = class {
2856
2871
  cleanup();
2857
2872
  writeOut(`${opt.key}
2858
2873
  `);
2859
- resolve2(opt.value);
2874
+ resolve3(opt.value);
2860
2875
  }
2861
2876
  };
2862
2877
  const onClose = () => {
2863
2878
  cleanup();
2864
- resolve2("");
2879
+ resolve3("");
2865
2880
  };
2866
2881
  const cleanup = () => {
2867
2882
  stdin.off("data", onData);
@@ -2893,7 +2908,7 @@ var ReadlineInputReader = class {
2893
2908
  this.rl?.close();
2894
2909
  this.rl = void 0;
2895
2910
  writeOut(prompt);
2896
- return new Promise((resolve2) => {
2911
+ return new Promise((resolve3) => {
2897
2912
  let buf = "";
2898
2913
  const wasRaw = stdin.isRaw;
2899
2914
  const cleanup = () => {
@@ -2922,13 +2937,13 @@ var ReadlineInputReader = class {
2922
2937
  cleanup();
2923
2938
  writeOut(` ${dim(`[${buf.length} chars]`)}
2924
2939
  `);
2925
- resolve2(buf);
2940
+ resolve3(buf);
2926
2941
  return;
2927
2942
  }
2928
2943
  if (ch === "") {
2929
2944
  cleanup();
2930
2945
  writeOut("\n");
2931
- resolve2("");
2946
+ resolve3("");
2932
2947
  return;
2933
2948
  }
2934
2949
  if (ch === "") {
@@ -4197,7 +4212,7 @@ async function checkGitInCwd(opts) {
4197
4212
  if (answer === "y" || answer === "yes") {
4198
4213
  try {
4199
4214
  const { spawn: spawn2 } = await import("node:child_process");
4200
- await new Promise((resolve2, reject) => {
4215
+ await new Promise((resolve3, reject) => {
4201
4216
  const child = spawn2("git", ["init"], {
4202
4217
  cwd,
4203
4218
  signal: AbortSignal.timeout(1e4),
@@ -4206,7 +4221,7 @@ async function checkGitInCwd(opts) {
4206
4221
  child.on("error", reject);
4207
4222
  child.on(
4208
4223
  "close",
4209
- (code) => code === 0 ? resolve2() : reject(new Error(`git init failed with ${code}`))
4224
+ (code) => code === 0 ? resolve3() : reject(new Error(`git init failed with ${code}`))
4210
4225
  );
4211
4226
  });
4212
4227
  renderer.write(` ${color13.green("\u2713")} Git repository initialized
@@ -4466,12 +4481,14 @@ async function initializeCli(argv) {
4466
4481
  async function main(argv) {
4467
4482
  const cliCtx = await initializeCli(argv);
4468
4483
  if (typeof cliCtx === "number") return cliCtx;
4469
- const { runInteractive } = await import("./cli-main-XGDOIPN5.js");
4484
+ const { runInteractive } = await import("./cli-main-UDWMWX55.js");
4470
4485
  return runInteractive(cliCtx);
4471
4486
  }
4472
4487
 
4473
4488
  // src/cli-entry-point.ts
4474
- import { installCrashShield, writeErr as writeErr4 } from "@wrongstack/core/utils";
4489
+ import { resolve as resolve2 } from "node:path";
4490
+ import { pathToFileURL } from "node:url";
4491
+ import { installCrashShield, runFatalSalvageSync, writeErr as writeErr4 } from "@wrongstack/core/utils";
4475
4492
  var SQLITE_WARNING_RE = /sqlite is an experimental feature/i;
4476
4493
  function installSqliteWarningFilter() {
4477
4494
  const originalEmit = process.emitWarning.bind(process);
@@ -4485,7 +4502,15 @@ function installSqliteWarningFilter() {
4485
4502
  });
4486
4503
  }
4487
4504
  installSqliteWarningFilter();
4488
- var isMain = import.meta.url === `file://${process.argv[1]?.replace(/\\/g, "/")}` || process.argv[1]?.endsWith("/cli/dist/index.js") || process.argv[1]?.endsWith("\\cli\\dist\\index.js");
4505
+ function isCliMain(moduleUrl, argvEntry = process.argv[1]) {
4506
+ if (!argvEntry) return false;
4507
+ try {
4508
+ if (moduleUrl === pathToFileURL(resolve2(argvEntry)).href) return true;
4509
+ } catch {
4510
+ }
4511
+ return argvEntry.endsWith("/cli/dist/index.js") || argvEntry.endsWith("\\cli\\dist\\index.js");
4512
+ }
4513
+ var isMain = isCliMain(import.meta.url);
4489
4514
  function isBrokenOutputConsumer(error) {
4490
4515
  if (typeof error !== "object" || error === null || !("code" in error)) return false;
4491
4516
  return error.code === "EPIPE" || error.code === "ECONNRESET" || error.code === "ECONNABORTED";
@@ -4498,6 +4523,7 @@ function installBrokenPipeHandlers(options = {}) {
4498
4523
  if (!isBrokenOutputConsumer(error)) throw error;
4499
4524
  if (handled) return;
4500
4525
  handled = true;
4526
+ runFatalSalvageSync();
4501
4527
  exit(0);
4502
4528
  };
4503
4529
  for (const stream of streams) stream.on("error", onError);
@@ -4509,12 +4535,16 @@ function runAsMain(mainFn) {
4509
4535
  if (!isMain) return;
4510
4536
  installBrokenPipeHandlers();
4511
4537
  installCrashShield();
4538
+ process.on("exit", () => {
4539
+ runFatalSalvageSync();
4540
+ });
4512
4541
  mainFn(process.argv.slice(2)).then(
4513
4542
  (c) => {
4514
4543
  process.exitCode = c;
4515
4544
  setTimeout(() => process.exit(c), 500).unref();
4516
4545
  },
4517
4546
  (err) => {
4547
+ runFatalSalvageSync();
4518
4548
  writeErr4((err instanceof Error ? err.stack : String(err)) + "\n");
4519
4549
  process.exitCode = 1;
4520
4550
  setTimeout(() => process.exit(1), 500).unref();
@@ -24,4 +24,4 @@ var initCmd = async (_args, deps) => {
24
24
  export {
25
25
  initCmd
26
26
  };
27
- //# sourceMappingURL=init-E2NDDOHI.js.map
27
+ //# sourceMappingURL=init-4JQSG66Q.js.map
@@ -88,5 +88,19 @@ export interface LiveSettingsInput {
88
88
  nextStepsTool?: boolean | undefined;
89
89
  /** Minimum relation strength for SAGE memory injection. Default: 0.85. */
90
90
  sageMemoryInjectThreshold?: number | undefined;
91
+ /**
92
+ * WrongProxy / WrongTrace: master switch. When true AND the daemon at
93
+ * `wrongProxyUrl` is reachable, every provider's base URL is rewritten
94
+ * through `${wrongProxyUrl}/proxy/<host><path>`. openai-codex is
95
+ * excluded by spec. Persisted to `tools.wrongProxy.enabled` (read at
96
+ * boot, applied mid-session by `applyLiveSettings`).
97
+ */
98
+ wrongProxyEnabled?: boolean | undefined;
99
+ /**
100
+ * WrongProxy / WrongTrace URL. Default `http://localhost:8000`. The
101
+ * CLI's periodic probe targets `<wrongProxyUrl>/api/health`; a 2xx
102
+ * response flips the runtime's `active` flag.
103
+ */
104
+ wrongProxyUrl?: string | undefined;
91
105
  }
92
106
  //# sourceMappingURL=live-settings-input.d.ts.map
@@ -341,4 +341,4 @@ function printHelp(deps) {
341
341
  export {
342
342
  mailboxServeCmd
343
343
  };
344
- //# sourceMappingURL=mailbox-serve-V3QIJBDH.js.map
344
+ //# sourceMappingURL=mailbox-serve-5S3PHG5D.js.map
@@ -33,6 +33,7 @@ import {
33
33
  serveStdio
34
34
  } from "@wrongstack/mcp";
35
35
  import { registerBuiltinToolTier } from "@wrongstack/tools/tool-tier";
36
+ import { wireKanbanPorts } from "@wrongstack/runtime";
36
37
  var AllowAllPermissionPolicy = class extends AutoApprovePermissionPolicy {
37
38
  async evaluate() {
38
39
  return { permission: "auto", source: "default" };
@@ -210,6 +211,7 @@ async function serveMcpStdio(deps, positional) {
210
211
  log(`wrongstack MCP server: ${err instanceof Error ? err.message : String(err)}`);
211
212
  return 1;
212
213
  }
214
+ wireKanbanPorts();
213
215
  let registry = deps.toolRegistry;
214
216
  if (!registry) {
215
217
  registry = new ToolRegistry();
@@ -439,4 +441,4 @@ function isRecord(value) {
439
441
  export {
440
442
  mcpCmd
441
443
  };
442
- //# sourceMappingURL=mcp-CMLFHRG2.js.map
444
+ //# sourceMappingURL=mcp-RRPKNRSN.js.map
@@ -2,7 +2,7 @@ import { Context } from '@wrongstack/core/agent';
2
2
  import { ToolRegistry } from '@wrongstack/core/registry';
3
3
  import type { PermissionPolicy, Tool } from '@wrongstack/core/types';
4
4
  import { type MCPServerPrompt, type MCPServerResource } from '@wrongstack/mcp';
5
- import type { SubcommandDeps } from './subcommands/index.js';
5
+ import type { SubcommandDeps } from './subcommands/contracts.js';
6
6
  /**
7
7
  * Resolve the `--tools` whitelist for `mcp serve`.
8
8
  *