@wrongstack/cli 1.0.28 → 1.0.32

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 (135) hide show
  1. package/data/providers.json +8 -177
  2. package/dist/{acp-M4565YUW.js → acp-EDGUWU7N.js} +4 -7
  3. package/dist/{audit-46YK5DSC.js → audit-KCBTHUQI.js} +1 -1
  4. package/dist/{auth-TE55JF4Z.js → auth-SUHKFFO4.js} +136 -59
  5. package/dist/auth-menu/github-copilot-oauth.d.ts +1 -35
  6. package/dist/auth-menu/index-input.d.ts +3 -0
  7. package/dist/auth-menu/panel-flow-bridge.d.ts +29 -0
  8. package/dist/auth-menu/panel-service.d.ts +3 -34
  9. package/dist/auth-menu/provider-auth-login.d.ts +1 -1
  10. package/dist/auto-discover-providers-QIL34K3U.js +7 -0
  11. package/dist/automation-MCDFCIMV.js +369 -0
  12. package/dist/{bench-GTLPM22B.js → bench-MMZHFHDL.js} +152 -43
  13. package/dist/boot/brain-decision-log.d.ts +1 -1
  14. package/dist/boot/system-prompt-builder.d.ts +1 -1
  15. package/dist/boot/system-prompt-menu.d.ts +11 -2
  16. package/dist/boot/tui-coordinator-setup.d.ts +2 -0
  17. package/dist/boot/tui-startup-output.d.ts +11 -0
  18. package/dist/{boot-auto-thin-6Q56FY3F.js → boot-auto-thin-K2DHHYIW.js} +3 -3
  19. package/dist/{chronicle-UTFETHP6.js → chronicle-PBJS7BN6.js} +5 -3
  20. package/dist/{chunk-EPR42SWM.js → chunk-2EZ2DHOW.js} +60 -7
  21. package/dist/{chunk-7IQWQCBH.js → chunk-3LEFXLAW.js} +39 -39
  22. package/dist/{chunk-WSTVGC2C.js → chunk-4BX2YDTQ.js} +13 -6
  23. package/dist/{chunk-SFBFYIOW.js → chunk-4MDRHMX4.js} +3 -2
  24. package/dist/{chunk-RGFWGUAB.js → chunk-4UWCMBPG.js} +159 -3
  25. package/dist/{chunk-RDGGWMTI.js → chunk-65VNCAF6.js} +2 -22
  26. package/dist/{chunk-WQZW3RDP.js → chunk-7BNBD4PE.js} +2 -2
  27. package/dist/chunk-CFHWIFXL.js +123 -0
  28. package/dist/{chunk-RZ4ZDRYA.js → chunk-DIOODAYM.js} +2 -2
  29. package/dist/{chunk-L2RVEQWO.js → chunk-HHRYIDOW.js} +2 -2
  30. package/dist/chunk-LIZXJHZQ.js +61 -0
  31. package/dist/{chunk-YHYINL47.js → chunk-LKFKO4JW.js} +2 -2
  32. package/dist/{chunk-Q4INH2DG.js → chunk-MPQCHBDJ.js} +2 -1
  33. package/dist/{chunk-2ERX3RPN.js → chunk-P3GRLV47.js} +30 -17
  34. package/dist/{chunk-ZMX5HRLI.js → chunk-P3Q3KMFH.js} +6 -4
  35. package/dist/{chunk-KOEO4CJG.js → chunk-PGNERAZL.js} +4 -4
  36. package/dist/{chunk-ENRYW73H.js → chunk-RQ4UBKYH.js} +81 -10
  37. package/dist/{chunk-X756ZS72.js → chunk-SUDNPYWD.js} +2 -2
  38. package/dist/{chunk-LDCGZJTC.js → chunk-TWSQTQKR.js} +12 -4
  39. package/dist/chunk-TXAFIERF.js +37 -0
  40. package/dist/{chunk-UZ2TMHNH.js → chunk-UKP7H2U4.js} +10 -2
  41. package/dist/{chunk-5JYDKG5B.js → chunk-WHEYHDIE.js} +7 -2
  42. package/dist/{chunk-LBPLTTZ6.js → chunk-WTJDSTYD.js} +4 -4
  43. package/dist/{chunk-L5TD7UIG.js → chunk-WXJH4F6K.js} +7 -7
  44. package/dist/{chunk-IS2PPBQV.js → chunk-X4LW5CZM.js} +8 -4
  45. package/dist/{chunk-BBHWW6LR.js → chunk-YL4KCHZG.js} +18 -6
  46. package/dist/{chunk-LUMETJFO.js → chunk-ZYACRPLN.js} +2 -2
  47. package/dist/{cli-context-O2SHBDFH.js → cli-context-ITHGP2CE.js} +91 -84
  48. package/dist/cli-context.d.ts +3 -1
  49. package/dist/cli-infrastructure.d.ts +33 -0
  50. package/dist/{cli-main-BKG4ZVLN.js → cli-main-TQGLKB6D.js} +3783 -2753
  51. package/dist/config-doctor.d.ts +1 -1
  52. package/dist/{config-transfer-RUWLDCNK.js → config-transfer-UE37X4B5.js} +2 -2
  53. package/dist/{execution-THXWTHYT.js → execution-C2IECWF7.js} +5271 -5118
  54. package/dist/execution-chimera-handlers.d.ts +6 -0
  55. package/dist/execution-session-callbacks.d.ts +36 -0
  56. package/dist/execution-webui.d.ts +3 -0
  57. package/dist/execution.d.ts +1 -1
  58. package/dist/fleet/host-acp-runner.d.ts +15 -0
  59. package/dist/fleet/host-budget.d.ts +13 -0
  60. package/dist/fleet/host-context.d.ts +5 -0
  61. package/dist/fleet/host-explore-companion.d.ts +7 -16
  62. package/dist/fleet/host.d.ts +2 -0
  63. package/dist/fleet/status-broadcast.d.ts +1 -1
  64. package/dist/{hq-44F4OQH2.js → hq-KBFDKTDD.js} +13 -7
  65. package/dist/hq-publisher.d.ts +4 -1
  66. package/dist/hq-server/sage-sync-send.d.ts +5 -0
  67. package/dist/hq-server/server-lifecycle.d.ts +1 -1
  68. package/dist/hq-server/snapshot.d.ts +1 -1
  69. package/dist/{hq-server-UIB24LU6.js → hq-server-AVNKZ2PV.js} +2 -2
  70. package/dist/{hq-service-BMMJAHRT.js → hq-service-FGB7BY2D.js} +3 -3
  71. package/dist/hq-ttl-N4DAIAVX.js +7 -0
  72. package/dist/index.js +126 -10
  73. package/dist/{mailbox-serve-GNGXEQ2R.js → mailbox-serve-S536N66F.js} +4 -3
  74. package/dist/{modeldiag-W7XAE625.js → modeldiag-PQILD7TN.js} +26 -8
  75. package/dist/{per-subcommand-help-QDAQASPZ.js → per-subcommand-help-VKPV3OEY.js} +2 -2
  76. package/dist/{plugin-usage-CIGOOTX3.js → plugin-usage-3TZGROK7.js} +3 -3
  77. package/dist/{plugins-HQTXUD6A.js → plugins-ITH4SLO6.js} +4 -4
  78. package/dist/pre-launch/project-check.d.ts +2 -8
  79. package/dist/pre-launch.d.ts +1 -1
  80. package/dist/{project-manifest-7NSFVBM3.js → project-manifest-FTFDCCTZ.js} +2 -2
  81. package/dist/{project-picker-SVBXMPKX.js → project-picker-NZYJKQQC.js} +3 -3
  82. package/dist/provider-cloud-config.d.ts +4 -0
  83. package/dist/provider-config-utils.d.ts +1 -1
  84. package/dist/{providers-models-5Z2PJTEW.js → providers-models-W57I3QOA.js} +3 -3
  85. package/dist/{remote-GB5VXCCT.js → remote-C74BCNND.js} +5 -5
  86. package/dist/{rewind-JA3ZLCNM.js → rewind-7AULJS7F.js} +7 -5
  87. package/dist/sage-FFKUOCQL.js +475 -0
  88. package/dist/sage-connect.d.ts +62 -0
  89. package/dist/sage-hq-sync.d.ts +8 -0
  90. package/dist/sage-sync-ZMTHB477.js +69 -0
  91. package/dist/sandbox-TYGD6FI2.js +131 -0
  92. package/dist/services/sdd/project-context.d.ts +1 -1
  93. package/dist/{sessions-config-XHLXJ5C3.js → sessions-config-VE26SB56.js} +19 -8
  94. package/dist/short-circuit-flags-6LB3EGF7.js +10 -0
  95. package/dist/slash-commands/openai-quota.d.ts +12 -6
  96. package/dist/slash-commands/sandbox.d.ts +5 -0
  97. package/dist/slash-commands/scout-stats.d.ts +46 -0
  98. package/dist/slash-commands/sdd-inspect-commands.d.ts +9 -0
  99. package/dist/slash-commands/sdd-session-commands.d.ts +19 -0
  100. package/dist/slash-commands/sdd.d.ts +1 -1
  101. package/dist/slash-commands/zai-plan.d.ts +26 -0
  102. package/dist/{standalone-auto-update-TOTRGCSA.js → standalone-auto-update-VQC4GYCM.js} +3 -3
  103. package/dist/{standalone-update-LZO3MNLH.js → standalone-update-HZHDZZOR.js} +2 -2
  104. package/dist/subcommands/handlers/automation-credentials.d.ts +8 -0
  105. package/dist/subcommands/handlers/automation.d.ts +3 -0
  106. package/dist/subcommands/handlers/bench-experiments.d.ts +5 -0
  107. package/dist/subcommands/handlers/helpers.d.ts +1 -1
  108. package/dist/subcommands/handlers/sage-sync.d.ts +4 -0
  109. package/dist/subcommands/handlers/sage.d.ts +5 -0
  110. package/dist/subcommands/handlers/sandbox.d.ts +5 -0
  111. package/dist/{subcommands-SRRB3RAS.js → subcommands-QO7VYTSS.js} +2 -2
  112. package/dist/{tools-skills-GH24UCBY.js → tools-skills-33AI6K6S.js} +2 -2
  113. package/dist/tui-provider-quota-menu.d.ts +5 -0
  114. package/dist/{typesafe-WA5O3KVS.js → typesafe-NHC322W5.js} +27 -8
  115. package/dist/{typesafe-topic-replay-ZILIU3WS.js → typesafe-topic-replay-DB2AYL7V.js} +2 -2
  116. package/dist/{typesafe-triage-replay-FGAW7QM7.js → typesafe-triage-replay-27NDAZ3V.js} +2 -2
  117. package/dist/{update-TDZX4IL2.js → update-J5WHAFPE.js} +3 -3
  118. package/dist/{update-check-J5ZVKS73.js → update-check-VLVT4IV2.js} +2 -2
  119. package/dist/{version-help-XJJQ7YSH.js → version-help-ATOKGMTK.js} +2 -2
  120. package/dist/webui-server/prefs-seeding.d.ts +1 -0
  121. package/dist/webui-server/route-contexts.d.ts +1 -0
  122. package/dist/{webui-server-GCXIO3JY.js → webui-server-GQOVLQS3.js} +79 -40
  123. package/dist/webui-session-retirement.d.ts +10 -0
  124. package/dist/wiring/command-host-state.d.ts +2 -0
  125. package/dist/wiring/director-announcement.d.ts +3 -1
  126. package/dist/wiring/session-establishment.d.ts +10 -8
  127. package/dist/wiring/session-runtime.d.ts +1 -1
  128. package/dist/wiring/session.d.ts +3 -0
  129. package/package.json +30 -29
  130. package/dist/auto-discover-providers-DXR25GTG.js +0 -7
  131. package/dist/chunk-3ZTLPNEQ.js +0 -58
  132. package/dist/chunk-D5GB5MHA.js +0 -87
  133. package/dist/chunk-SIGUWXAA.js +0 -43
  134. package/dist/hq-ttl-VJR65OBJ.js +0 -7
  135. package/dist/short-circuit-flags-BSIPTAPD.js +0 -10
@@ -0,0 +1,69 @@
1
+ import {
2
+ startCliHqConnection
3
+ } from "./chunk-4UWCMBPG.js";
4
+ import "./chunk-F5DCFAKI.js";
5
+
6
+ // src/subcommands/handlers/sage-sync.ts
7
+ import { resolveHqConfig } from "@wrongstack/core/hq";
8
+ import { SageProjectServerConnection } from "@wrongstack/sage";
9
+ async function runSageHqSyncCommand(deps, restartService, signal) {
10
+ if (signal?.aborted) return 0;
11
+ if (!resolveHqConfig({ config: deps.config.hq })?.enabled) {
12
+ deps.renderer.writeError("HQ is disabled. Enable HQ before starting SAGE synchronization.\n");
13
+ return 1;
14
+ }
15
+ if (restartService) {
16
+ const control = new SageProjectServerConnection(
17
+ deps.projectRoot,
18
+ deps.config.Sage?.storage?.directory,
19
+ { spawnIfMissing: false }
20
+ );
21
+ try {
22
+ const result = await control.shutdown("operator-requested SAGE sync upgrade");
23
+ if (!result.stopped && result.reason !== "not-running") {
24
+ deps.renderer.writeError(`SAGE restart failed: ${result.reason ?? "unknown error"}
25
+ `);
26
+ return 1;
27
+ }
28
+ } finally {
29
+ control.close();
30
+ }
31
+ }
32
+ if (signal?.aborted) return 0;
33
+ const connection = startCliHqConnection({
34
+ clientKind: "cli",
35
+ projectRoot: deps.projectRoot,
36
+ appConfig: deps.config,
37
+ capabilities: ["telemetry.publish"],
38
+ ownKanbanSync: false,
39
+ ownSageSync: true
40
+ });
41
+ deps.renderer.write(
42
+ `SAGE HQ sync running for ${connection.getPublisher()?.project.projectId ?? deps.projectRoot}. Reconnect is automatic; Ctrl+C stops this bridge.
43
+ `
44
+ );
45
+ try {
46
+ await new Promise((resolve) => {
47
+ const keepAlive = setInterval(() => {
48
+ }, 6e4);
49
+ const stop = () => {
50
+ clearInterval(keepAlive);
51
+ process.removeListener("SIGINT", stop);
52
+ process.removeListener("SIGTERM", stop);
53
+ signal?.removeEventListener("abort", stop);
54
+ resolve();
55
+ };
56
+ process.once("SIGINT", stop);
57
+ process.once("SIGTERM", stop);
58
+ signal?.addEventListener("abort", stop, { once: true });
59
+ if (signal?.aborted) stop();
60
+ });
61
+ return 0;
62
+ } finally {
63
+ connection.stop();
64
+ }
65
+ }
66
+ export {
67
+ runSageHqSyncCommand
68
+ };
69
+ //# sourceMappingURL=sage-sync-ZMTHB477.js.map
@@ -0,0 +1,131 @@
1
+
2
+ // src/subcommands/handlers/sandbox.ts
3
+ import { mkdir } from "node:fs/promises";
4
+ import * as path from "node:path";
5
+ import { atomicWrite, toErrorMessage } from "@wrongstack/core/utils";
6
+ import { createHeadlessLaunchPlan, runDockerWorkspace } from "@wrongstack/runtime";
7
+ var sandboxCmd = (args, deps) => runSandboxCommand(args, deps.flags ?? {}, deps.renderer);
8
+ var USAGE = `Usage: wstack sandbox docker --image <trusted-image> --prompt <task> [options]
9
+
10
+ Runs the entire WrongStack agent in a copied Docker workspace. Your local project
11
+ and home are not mounted. Returns a patch against the imported snapshot; nothing
12
+ is automatically applied to your working tree.
13
+
14
+ Build the supplied runtime image from a published version:
15
+ docker build --build-arg WRONGSTACK_VERSION=<version> -t wrongstack-sandbox containers/sandbox
16
+
17
+ Options:
18
+ --image <image> Required image with wstack, git and sh installed
19
+ --prompt <task> Required task for the isolated agent
20
+ --provider <id> Provider to use inside the container
21
+ --model <id> Model to use inside the container
22
+ --env <NAME,...> Explicit host env names to forward (no values on argv)
23
+ --network <bridge|none> Docker networking (default bridge)
24
+ --timeout <seconds> Entire agent command limit (default 600)
25
+ --out <directory> Patch and run metadata directory
26
+ --yolo Enable YOLO inside this container only
27
+ --max-iterations <n> Agent iteration limit (default 40, maximum 1000)
28
+ --dry-run Validate and print a plan without starting Docker
29
+ --help Show this help
30
+
31
+ Binary/image previews and OAuth credential-file import are not part of this
32
+ launcher. Use API credentials forwarded explicitly, or a separately configured
33
+ trusted image. The default image and packages are never silently selected.
34
+ `;
35
+ async function runSandboxCommand(args, flags, renderer) {
36
+ if (flags["help"] || args[0] === "help") {
37
+ renderer.write(USAGE);
38
+ return 0;
39
+ }
40
+ const image = typeof flags["image"] === "string" ? flags["image"] : "";
41
+ const prompt = typeof flags["prompt"] === "string" ? flags["prompt"] : "";
42
+ if (args[0] !== "docker" || !image || !prompt) {
43
+ renderer.write(USAGE);
44
+ return 2;
45
+ }
46
+ const network = flags["network"] ?? "bridge";
47
+ if (network !== "bridge" && network !== "none") {
48
+ renderer.write("sandbox: network must be bridge or none\n");
49
+ return 2;
50
+ }
51
+ const timeoutMs = Number(flags["timeout"] ?? 600) * 1e3;
52
+ if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1e3 || timeoutMs > 864e5) {
53
+ renderer.write("sandbox: timeout must be 1 to 86400 seconds\n");
54
+ return 2;
55
+ }
56
+ const envNames = typeof flags["env"] === "string" ? flags["env"].split(",").map((name) => name.trim()).filter(Boolean) : [];
57
+ const abort = new AbortController();
58
+ const cancel = () => abort.abort();
59
+ process.once("SIGINT", cancel);
60
+ process.once("SIGTERM", cancel);
61
+ try {
62
+ const plan = createHeadlessLaunchPlan({
63
+ name: "sandbox",
64
+ projectRoot: process.cwd(),
65
+ image,
66
+ prompt,
67
+ provider: typeof flags["provider"] === "string" ? flags["provider"] : void 0,
68
+ model: typeof flags["model"] === "string" ? flags["model"] : void 0,
69
+ envNames,
70
+ yolo: flags["yolo"] === true,
71
+ enabled: true,
72
+ timeoutMs,
73
+ maxIterations: flags["max-iterations"] === void 0 ? 40 : Number(flags["max-iterations"])
74
+ });
75
+ if (flags["dry-run"] === true) {
76
+ renderer.write(
77
+ `${JSON.stringify({ ...plan, network, missingEnvironment: envNames.filter((name) => !process.env[name]) }, null, 2)}
78
+ `
79
+ );
80
+ return 0;
81
+ }
82
+ const result = await runDockerWorkspace({
83
+ projectRoot: process.cwd(),
84
+ image,
85
+ command: "wstack",
86
+ args: plan.args,
87
+ envNames,
88
+ network,
89
+ timeoutMs,
90
+ signal: abort.signal,
91
+ onOutput: (text) => renderer.write(text)
92
+ });
93
+ const out = path.resolve(
94
+ typeof flags["out"] === "string" ? flags["out"] : path.join(process.cwd(), ".wrongstack", "sandbox-runs", result.id)
95
+ );
96
+ await mkdir(out, { recursive: true });
97
+ if (result.patch !== null) await atomicWrite(path.join(out, "changes.patch"), result.patch);
98
+ const { patch: _patch, output: _output, ...metadata } = result;
99
+ await atomicWrite(
100
+ path.join(out, "run.json"),
101
+ `${JSON.stringify({ ...metadata, image, projectRoot: process.cwd(), network }, null, 2)}
102
+ `
103
+ );
104
+ renderer.write(
105
+ `
106
+ Sandbox exit: ${result.exitCode}
107
+ ${result.patch !== null ? `Patch: ${path.join(out, "changes.patch")}
108
+ ` : `Partial workspace: wrongstack-${result.id}
109
+ `}Metadata: ${path.join(out, "run.json")}
110
+ `
111
+ );
112
+ if (result.cleanup === "retained")
113
+ renderer.write("Stopped container retained for recovery; no patch was claimed.\n");
114
+ if (result.cleanup === "unverified")
115
+ renderer.write(`Container cleanup could not be verified: wrongstack-${result.id}
116
+ `);
117
+ return result.exitCode;
118
+ } catch (error) {
119
+ renderer.write(`sandbox: ${toErrorMessage(error)}
120
+ `);
121
+ return abort.signal.aborted ? 130 : 1;
122
+ } finally {
123
+ process.removeListener("SIGINT", cancel);
124
+ process.removeListener("SIGTERM", cancel);
125
+ }
126
+ }
127
+ export {
128
+ runSandboxCommand,
129
+ sandboxCmd
130
+ };
131
+ //# sourceMappingURL=sandbox-TYGD6FI2.js.map
@@ -3,5 +3,5 @@ export { gatherProjectContext } from '@wrongstack/sdd';
3
3
  export declare function getActiveBuilder(): AISpecBuilder | null;
4
4
  export declare function getActiveSDDContext(): string | null;
5
5
  export declare function getActiveSDDPhase(): AISpecPhase | null;
6
- export declare function findSpec(store: SpecStore, idOrTitle: string): Promise<import("@wrongstack/core").Specification | null>;
6
+ export declare function findSpec(store: SpecStore, idOrTitle: string): Promise<import("@wrongstack/core/types").Specification | null>;
7
7
  //# sourceMappingURL=project-context.d.ts.map
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  activeProfileConfigPath
3
3
  } from "./chunk-YMXXOOFN.js";
4
- import {
5
- restoreFlags
6
- } from "./chunk-CSAPOCBP.js";
7
4
  import {
8
5
  backupCurrent,
9
6
  getHistoryEntry,
10
7
  listHistory,
11
8
  restoreFromHistory,
12
9
  restoreLast
13
- } from "./chunk-WSTVGC2C.js";
10
+ } from "./chunk-4BX2YDTQ.js";
11
+ import {
12
+ restoreFlags
13
+ } from "./chunk-CSAPOCBP.js";
14
14
 
15
15
  // src/subcommands/handlers/sessions-config.ts
16
16
  import * as path2 from "node:path";
@@ -18,13 +18,24 @@ import { color as color2, expectDefined } from "@wrongstack/core/utils";
18
18
 
19
19
  // src/subcommands/handlers/helpers.ts
20
20
  import { isSecretField } from "@wrongstack/core/security";
21
- function redactKeys(obj) {
21
+ function redactKeys(obj, seen = /* @__PURE__ */ new WeakSet()) {
22
22
  if (!obj || typeof obj !== "object") return obj;
23
- if (Array.isArray(obj)) return obj.map(redactKeys);
23
+ if (seen.has(obj)) return "[Circular]";
24
+ seen.add(obj);
25
+ if (Array.isArray(obj)) return obj.map((item) => redactKeys(item, seen));
24
26
  const out = {};
25
27
  for (const [k, v] of Object.entries(obj)) {
28
+ if (k === "__proto__") {
29
+ Object.defineProperty(out, k, {
30
+ value: redactKeys(v, seen),
31
+ writable: true,
32
+ enumerable: true,
33
+ configurable: true
34
+ });
35
+ continue;
36
+ }
26
37
  if (isSecretField(k) && typeof v === "string" && v.length > 0) out[k] = "[REDACTED]";
27
- else out[k] = redactKeys(v);
38
+ else out[k] = redactKeys(v, seen);
28
39
  }
29
40
  return out;
30
41
  }
@@ -525,4 +536,4 @@ export {
525
536
  configCmd,
526
537
  sessionsCmd
527
538
  };
528
- //# sourceMappingURL=sessions-config-XHLXJ5C3.js.map
539
+ //# sourceMappingURL=sessions-config-VE26SB56.js.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ handleHelpVersionShortCircuit
3
+ } from "./chunk-WXJH4F6K.js";
4
+ import "./chunk-MPQCHBDJ.js";
5
+ import "./chunk-WHEYHDIE.js";
6
+ import "./chunk-F5DCFAKI.js";
7
+ export {
8
+ handleHelpVersionShortCircuit
9
+ };
10
+ //# sourceMappingURL=short-circuit-flags-6LB3EGF7.js.map
@@ -13,21 +13,27 @@
13
13
  * below reads only the neutral shape. A second metered provider needs a
14
14
  * reporter and a one-line command, not a second copy of this file.
15
15
  *
16
- * The reading is observational: it appears after the first request of the
17
- * session, not before, and it is never fetched on its own — spending a request
18
- * to ask "how much have I spent" is exactly the wrong trade on a metered plan.
16
+ * Two sources feed it. The headers keep it current as turns run; before any
17
+ * turn, the command asks the account usage endpoint (`/wham/usage`, the read
18
+ * behind the official client's `/status`) through the active ChatGPT
19
+ * transport. That read is a status call, not a model call — it spends none of
20
+ * the plan it reports.
19
21
  *
20
22
  * Usage:
21
23
  * /openai-quota Show the latest reading for every metered window
22
24
  */
23
25
  import { type ProviderQuotaSnapshot } from '@wrongstack/core/quota';
24
- import type { SlashCommand } from '@wrongstack/core/types';
26
+ import type { ProviderConfig, SlashCommand } from '@wrongstack/core/types';
27
+ /** Where the saved providers come from — the live config in a session. */
28
+ export interface QuotaCommandDeps {
29
+ providers?: () => Readonly<Record<string, ProviderConfig>> | undefined;
30
+ }
25
31
  /**
26
32
  * Render one meter. Provider-neutral by construction — everything it reads is
27
33
  * on the shared snapshot shape.
28
34
  */
29
35
  export declare function renderQuotaSnapshot(snapshot: ProviderQuotaSnapshot): string[];
30
- export declare function buildOpenAIQuotaCommand(): SlashCommand;
36
+ export declare function buildOpenAIQuotaCommand(deps?: QuotaCommandDeps): SlashCommand;
31
37
  /**
32
38
  * `/provider-quota` — every metered subscription this session has heard from.
33
39
  *
@@ -42,5 +48,5 @@ export declare function buildOpenAIQuotaCommand(): SlashCommand;
42
48
  * and would occupy the name if one is ever built. What this shows is exactly
43
49
  * the provider plane's readings, so that is what it is called.
44
50
  */
45
- export declare function buildProviderQuotaCommand(): SlashCommand;
51
+ export declare function buildProviderQuotaCommand(deps?: QuotaCommandDeps): SlashCommand;
46
52
  //# sourceMappingURL=openai-quota.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { SlashCommand } from '@wrongstack/core/types';
2
+ import type { SlashCommandContext } from './command-context.js';
3
+ /** CLI active-tier indicator (plan 28 T3; TUI/WebUI panels remain T9). */
4
+ export declare function buildSandboxCommand(_opts: SlashCommandContext): SlashCommand;
5
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1,46 @@
1
+ import type { SessionEvent, SlashCommand } from '@wrongstack/core/types';
2
+ import type { SlashCommandContext } from './command-context.js';
3
+ /**
4
+ * `/scout-stats` — does the Scout identity behave the way its prompt asks?
5
+ *
6
+ * Measured from session journals at read time (nothing is recorded for it):
7
+ * every `llm_request` carries the identity variant it ran under, and tool
8
+ * calls are journaled as `tool_call_start` events. Two behaviours are the
9
+ * point of Scout, so they lead the report next to the other variants:
10
+ *
11
+ * - discovery — how often `tool_search` comes back empty, and how often a tool
12
+ * it surfaced is then called through `tool_use`;
13
+ * - delegation — the share of runs that hand work to a subagent, against runs
14
+ * that did a lot of tool work alone.
15
+ */
16
+ /** Tool calls in one run, without a delegation, that count as "worked alone". */
17
+ export declare const SOLO_HEAVY_TOOL_CALLS = 8;
18
+ export interface VariantUsage {
19
+ variant: string;
20
+ sessions: number;
21
+ runs: number;
22
+ requests: number;
23
+ inputTokens: number;
24
+ outputTokens: number;
25
+ toolCalls: number;
26
+ /** Calls routed through the `tool_use` gateway (schema was not direct). */
27
+ lazyCalls: number;
28
+ searches: number;
29
+ emptySearches: number;
30
+ /** `tool_use` calls whose target an earlier search in the run returned. */
31
+ searchedThenUsed: number;
32
+ delegations: number;
33
+ runsWithDelegation: number;
34
+ /** Runs with at least {@link SOLO_HEAVY_TOOL_CALLS} tool calls and no delegation. */
35
+ soloHeavyRuns: number;
36
+ }
37
+ /**
38
+ * Aggregate journals per identity variant. A run starts at each `user_input`
39
+ * and belongs to the variant of its first `llm_request`; a journal written
40
+ * before requests recorded their variant is reported as `unrecorded`.
41
+ */
42
+ export declare function summarizeVariantUsage(sessions: readonly (readonly SessionEvent[])[]): VariantUsage[];
43
+ /** One block per variant; Scout first, since the command exists to judge it. */
44
+ export declare function formatVariantUsage(usage: readonly VariantUsage[], sessionCount: number): string;
45
+ export declare function buildScoutStatsCommand(opts: SlashCommandContext): SlashCommand;
46
+ //# sourceMappingURL=scout-stats.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { SlashCommand } from '@wrongstack/core/types';
2
+ export declare function runSddInspectCommand(inputs: {
3
+ cmd: string;
4
+ opts: import('./command-context.js').SlashCommandContext;
5
+ specStore: import('@wrongstack/sdd').SpecStore;
6
+ restJoined: string;
7
+ versioning: import('@wrongstack/sdd').SpecVersioning;
8
+ }): ReturnType<SlashCommand['run']>;
9
+ //# sourceMappingURL=sdd-inspect-commands.d.ts.map
@@ -0,0 +1,19 @@
1
+ import type { SlashCommand } from '@wrongstack/core/types';
2
+ export declare function runSddSessionCommand(inputs: {
3
+ cmd: string;
4
+ restArgs: string[];
5
+ sessionState: import('../services/sdd/state.js').SDDState;
6
+ projectRoot: string;
7
+ specStore: import('@wrongstack/sdd').SpecStore;
8
+ sessionPersistenceOptions: {
9
+ sessionPersistence: import('@wrongstack/sdd').AISpecSessionPersistence;
10
+ sessionPath?: never;
11
+ } | {
12
+ sessionPath: string;
13
+ sessionPersistence?: never;
14
+ };
15
+ opts: import('./command-context.js').SlashCommandContext;
16
+ versioning: import('@wrongstack/sdd').SpecVersioning;
17
+ sessionPersistence: import('@wrongstack/sdd').AISpecSessionPersistence | undefined;
18
+ }): ReturnType<SlashCommand['run']>;
19
+ //# sourceMappingURL=sdd-session-commands.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { SlashCommand } from '@wrongstack/core/types';
2
- import { renderProgress, TaskTracker } from '@wrongstack/sdd';
2
+ import { renderProgress, type TaskTracker } from '@wrongstack/sdd';
3
3
  import type { SlashCommandContext } from './command-context.js';
4
4
  export type { TaskProgress } from '@wrongstack/core/types';
5
5
  export { findSpec, gatherProjectContext, getActiveBuilder, getActiveSDDContext, getActiveSDDPhase, } from '../services/sdd/project-context.js';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `/zai-plan` — the Z.AI / BigModel GLM Coding Plan, the way the official
3
+ * ZCode client's usage panel shows it: the subscription in force, the 5-hour
4
+ * and weekly model windows, the monthly MCP tool-call pool, the last days'
5
+ * token usage per model with the cache-hit rate, and the platform's own
6
+ * service health.
7
+ *
8
+ * Unlike `/provider-quota`, which only replays what turns already observed,
9
+ * this asks: every section is an account read on the monitor API. None of
10
+ * them is a model call, so the plan it describes is not spent by looking.
11
+ *
12
+ * It reports on the Z.AI / BigModel providers built in this session (the key
13
+ * lives with the transport, not here). Team plans need organization/project
14
+ * scoping that only ZCode's OAuth login carries; this reads the personal plan
15
+ * the API key belongs to.
16
+ *
17
+ * Usage:
18
+ * /zai-plan Plan, quota and the last 7 days
19
+ * /zai-plan <days> Same, with a 1–30 day usage window
20
+ */
21
+ import type { SlashCommand } from '@wrongstack/core/types';
22
+ import { type ZaiAccountHandle } from '@wrongstack/providers';
23
+ export declare function buildZaiPlanCommand(deps?: {
24
+ accounts?: () => readonly ZaiAccountHandle[];
25
+ }): SlashCommand;
26
+ //# sourceMappingURL=zai-plan.d.ts.map
@@ -4,10 +4,10 @@ import {
4
4
  findStandaloneRelease,
5
5
  installExecutableFrom,
6
6
  verifyStandaloneDigest
7
- } from "./chunk-X756ZS72.js";
7
+ } from "./chunk-SUDNPYWD.js";
8
8
  import {
9
9
  isNewer
10
- } from "./chunk-RZ4ZDRYA.js";
10
+ } from "./chunk-DIOODAYM.js";
11
11
  import {
12
12
  CLI_VERSION,
13
13
  STANDALONE_TARGET
@@ -246,4 +246,4 @@ export {
246
246
  startStandaloneAutoUpdate,
247
247
  takeAppliedUpdate
248
248
  };
249
- //# sourceMappingURL=standalone-auto-update-TOTRGCSA.js.map
249
+ //# sourceMappingURL=standalone-auto-update-VQC4GYCM.js.map
@@ -8,7 +8,7 @@ import {
8
8
  standaloneAssetName,
9
9
  updateStandaloneBinary,
10
10
  verifyStandaloneDigest
11
- } from "./chunk-X756ZS72.js";
11
+ } from "./chunk-SUDNPYWD.js";
12
12
  import "./chunk-F5DCFAKI.js";
13
13
  export {
14
14
  MAX_BINARY_BYTES,
@@ -21,4 +21,4 @@ export {
21
21
  updateStandaloneBinary,
22
22
  verifyStandaloneDigest
23
23
  };
24
- //# sourceMappingURL=standalone-update-LZO3MNLH.js.map
24
+ //# sourceMappingURL=standalone-update-HZHDZZOR.js.map
@@ -0,0 +1,8 @@
1
+ import type { SecretVault } from '@wrongstack/core/types';
2
+ import type { WstackPaths } from '@wrongstack/core/utils';
3
+ import { type CredentialReference, type ResolvedCredentialBundle } from '@wrongstack/runtime';
4
+ /** Read the existing machine profile at use time, so ordinary key rotation is visible. */
5
+ export declare function resolveAutomationCredentials(refs: readonly CredentialReference[], paths: Pick<WstackPaths, 'profileConfig'>, vault: SecretVault): Promise<Readonly<Record<string, string>>>;
6
+ /** Endpoint and key are read from the same atomic profile snapshot. */
7
+ export declare function resolveAutomationCredentialBundle(refs: readonly CredentialReference[], paths: Pick<WstackPaths, 'profileConfig'>, vault: SecretVault): Promise<ResolvedCredentialBundle>;
8
+ //# sourceMappingURL=automation-credentials.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SubcommandHandler } from '../contracts.js';
2
+ export declare const automationCmd: SubcommandHandler;
3
+ //# sourceMappingURL=automation.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { type QualityReviewPolicy } from '@wrongstack/bench';
2
+ import type { SubcommandDeps } from '../contracts.js';
3
+ export declare function benchExperimentCommand(action: string, args: string[], deps: SubcommandDeps): Promise<number>;
4
+ export declare function readBenchReviewPolicy(file: string): Promise<QualityReviewPolicy>;
5
+ //# sourceMappingURL=bench-experiments.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare function redactKeys(obj: unknown): unknown;
1
+ export declare function redactKeys(obj: unknown, seen?: WeakSet<object>): unknown;
2
2
  //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { SubcommandDeps } from '../contracts.js';
2
+ /** A memory-only HQ connection for headless hosts and upgrading active sessions. */
3
+ export declare function runSageHqSyncCommand(deps: SubcommandDeps, restartService: boolean, signal?: AbortSignal): Promise<number>;
4
+ //# sourceMappingURL=sage-sync.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { SubcommandHandler } from '../contracts.js';
2
+ /** PATH lookup with PATHEXT on Windows; an explicit path is checked as written. */
3
+ export declare function findExecutableOnPath(cmd: string): string | null;
4
+ export declare const sageCmd: SubcommandHandler;
5
+ //# sourceMappingURL=sage.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { TerminalRenderer } from '../../renderer.js';
2
+ import type { SubcommandHandler } from '../contracts.js';
3
+ export declare const sandboxCmd: SubcommandHandler;
4
+ export declare function runSandboxCommand(args: string[], flags: Record<string, string | boolean>, renderer: TerminalRenderer): Promise<number>;
5
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  subcommandNames,
3
3
  subcommands
4
- } from "./chunk-3ZTLPNEQ.js";
4
+ } from "./chunk-LIZXJHZQ.js";
5
5
  export {
6
6
  subcommandNames,
7
7
  subcommands
8
8
  };
9
- //# sourceMappingURL=subcommands-SRRB3RAS.js.map
9
+ //# sourceMappingURL=subcommands-QO7VYTSS.js.map
@@ -6,7 +6,7 @@ var toolsCmd = async (_args, deps) => {
6
6
  if (!reg) return 0;
7
7
  for (const { tool, owner } of reg.listWithOwner())
8
8
  deps.renderer.write(
9
- ` ${tool.name.padEnd(28)} ${color.dim(`[${owner}]`)} ${tool.permission}
9
+ ` ${(tool.name === "tool_script" ? "tool_script / ToolFlow" : tool.name).padEnd(28)} ${color.dim(`[${owner}]`)} ${tool.permission}
10
10
  `
11
11
  );
12
12
  return 0;
@@ -25,4 +25,4 @@ export {
25
25
  skillsCmd,
26
26
  toolsCmd
27
27
  };
28
- //# sourceMappingURL=tools-skills-GH24UCBY.js.map
28
+ //# sourceMappingURL=tools-skills-33AI6K6S.js.map
@@ -0,0 +1,5 @@
1
+ import type { ProviderConfig } from '@wrongstack/core/types';
2
+ import type { ResourceMenuSnapshot } from '@wrongstack/tui';
3
+ /** One provider per row, with all its meters in the detail pane. */
4
+ export declare function providerQuotaMenu(providers: Readonly<Record<string, ProviderConfig>> | undefined): ResourceMenuSnapshot;
5
+ //# sourceMappingURL=tui-provider-quota-menu.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  maskedKey,
3
3
  mutateConfigProviders
4
- } from "./chunk-LUMETJFO.js";
4
+ } from "./chunk-ZYACRPLN.js";
5
5
  import {
6
6
  activeProfileConfigPath
7
7
  } from "./chunk-YMXXOOFN.js";
@@ -29,6 +29,7 @@ import { buildChildEnv, color } from "@wrongstack/core/utils";
29
29
  var USAGE = [
30
30
  "Usage:",
31
31
  " wstack typesafe [status] show account and feature configuration",
32
+ " wstack typesafe on|off enable/disable all Jev requests (keeps key)",
32
33
  " wstack typesafe login [--route <id>] store an API key in the active profile",
33
34
  " [--endpoint <url>] [--model <id>] configure a proxy or pin a model",
34
35
  " wstack typesafe test send one question and report the answer",
@@ -58,6 +59,18 @@ var typesafeCmd = async (args, deps) => {
58
59
  }
59
60
  const sub = (args[0] ?? "status").toLowerCase();
60
61
  switch (sub) {
62
+ case "on":
63
+ case "off": {
64
+ const configPath = activeProfileConfigPath(deps.paths, deps.config);
65
+ await mutateConfigProviders(configPath, deps.vault, (_providers, config) => {
66
+ config["typesafe"] = {
67
+ ...config["typesafe"],
68
+ enabled: sub === "on"
69
+ };
70
+ });
71
+ write(`Jev ${sub === "on" ? "enabled" : "disabled"}. Saved in ${configPath}.`);
72
+ return 0;
73
+ }
61
74
  case "status":
62
75
  return showStatus(deps, write);
63
76
  case "login":
@@ -67,9 +80,9 @@ var typesafeCmd = async (args, deps) => {
67
80
  case "lint-conventions":
68
81
  return await lintConventions(deps, write);
69
82
  case "replay-topic-shift":
70
- return await (await import("./typesafe-topic-replay-ZILIU3WS.js")).replayTopicShift(deps, write);
83
+ return await (await import("./typesafe-topic-replay-DB2AYL7V.js")).replayTopicShift(deps, write);
71
84
  case "replay-memory-triage":
72
- return await (await import("./typesafe-triage-replay-FGAW7QM7.js")).replayMemoryTriage(deps, write);
85
+ return await (await import("./typesafe-triage-replay-27NDAZ3V.js")).replayMemoryTriage(deps, write);
73
86
  case "replay-brain-ledger":
74
87
  return await (await import("./typesafe-brain-replay-C5276FVR.js")).replayBrainLedger(deps, write);
75
88
  case "check-judgments":
@@ -108,7 +121,9 @@ function showStatus(deps, write) {
108
121
  }
109
122
  write("");
110
123
  write(
111
- color.bold("Judgments") + color.dim(" (on with an account; typesafe.judgments.<id>: false turns one off)")
124
+ color.bold("Judgments") + color.dim(
125
+ " (requires typesafe.enabled: true; typesafe.judgments.<id>: false turns one off)"
126
+ )
112
127
  );
113
128
  for (const feature of TYPESAFE_JUDGMENT_FEATURES) {
114
129
  const on = isTypeSafeJudgmentEnabled(deps.config, feature);
@@ -127,7 +142,7 @@ function showStatus(deps, write) {
127
142
  );
128
143
  }
129
144
  }
130
- if (account.status !== "ready" && features.length > 0) {
145
+ if (account.status !== "ready" && account.status !== "disabled" && features.length > 0) {
131
146
  write("");
132
147
  write(` ${color.amber("Run `wstack typesafe login` \u2014 these switches do nothing today.")}`);
133
148
  return 1;
@@ -167,7 +182,10 @@ async function login(deps, write) {
167
182
  return next;
168
183
  };
169
184
  const settings = update(deps.config.typesafe ?? {});
170
- const preview = resolveTypeSafeAccount({ config: { typesafe: settings }, env: {} });
185
+ const preview = resolveTypeSafeAccount({
186
+ config: { typesafe: { ...settings, enabled: true } },
187
+ env: {}
188
+ });
171
189
  if (preview.status === "unusable") {
172
190
  write(`${preview.reason}. For a custom route, pass --endpoint <url>.`);
173
191
  return 1;
@@ -186,6 +204,7 @@ async function login(deps, write) {
186
204
  config["typesafe"] = { ...update(existing), apiKey: key.trim() };
187
205
  });
188
206
  write(`${color.green("\u2713")} Key stored in ${configPath}`);
207
+ write(" Storing a key does not enable Jev. Use `wstack typesafe on` when you want it.");
189
208
  if (route) write(` route set to ${route}`);
190
209
  write(` Verify it with ${color.bold("wstack typesafe test")}.`);
191
210
  return 0;
@@ -194,7 +213,7 @@ async function test(deps, write) {
194
213
  const account = resolveTypeSafeAccount({ config: deps.config, restGate: null });
195
214
  if (account.status !== "ready") {
196
215
  write(`${color.red("\u2717")} ${account.reason}`);
197
- write(" Run `wstack typesafe login`.");
216
+ if (account.status !== "disabled") write(" Run `wstack typesafe login`.");
198
217
  return 1;
199
218
  }
200
219
  write(`Asking ${account.endpoint} (${account.model})\u2026`);
@@ -321,4 +340,4 @@ async function lintConventions(deps, write) {
321
340
  export {
322
341
  typesafeCmd
323
342
  };
324
- //# sourceMappingURL=typesafe-WA5O3KVS.js.map
343
+ //# sourceMappingURL=typesafe-NHC322W5.js.map