@wrongstack/cli 0.318.0 → 0.319.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 (56) hide show
  1. package/data/providers.json +1 -22
  2. package/dist/{acp-CEQINXWB.js → acp-5ANIAOZC.js} +4 -4
  3. package/dist/arg-parser.d.ts +4 -0
  4. package/dist/{auth-3OSF6BMU.js → auth-ND7J7DTD.js} +10 -10
  5. package/dist/{chunk-QC5I4VWZ.js → chunk-635WW3II.js} +8 -14
  6. package/dist/{chunk-7CECQDNH.js → chunk-D3K4NYQL.js} +1 -1
  7. package/dist/{chunk-QYIIOMLE.js → chunk-E4I2TF5S.js} +2 -2
  8. package/dist/{chunk-4JRIWVJ4.js → chunk-ERX4BLKP.js} +1 -1
  9. package/dist/{chunk-37SPPLUD.js → chunk-F5GA2QW2.js} +15 -2
  10. package/dist/chunk-GGGUZSAU.js +235 -0
  11. package/dist/{chunk-GKHUHAIK.js → chunk-HF5VQWIY.js} +5 -5
  12. package/dist/{chunk-YX6KUIDF.js → chunk-IMT6PNV5.js} +861 -29
  13. package/dist/{chunk-G7337TTK.js → chunk-IS2PPBQV.js} +1 -1
  14. package/dist/{chunk-G3IMKQRH.js → chunk-JHPXJRRI.js} +1 -1
  15. package/dist/chunk-KYDJJLJI.js +52 -0
  16. package/dist/chunk-LIWVIEZM.js +46 -0
  17. package/dist/chunk-P2OKBDCH.js +1166 -0
  18. package/dist/chunk-PCBJSXYV.js +65 -0
  19. package/dist/{chunk-7JBKXVMK.js → chunk-TALOKMIC.js} +14 -18
  20. package/dist/{chunk-KG4X5F7Z.js → chunk-VFCJOWJB.js} +10 -12
  21. package/dist/{chunk-SYIBTG3X.js → chunk-VOTTENR5.js} +3 -5
  22. package/dist/chunk-WHOIR577.js +1 -0
  23. package/dist/{chunk-2ZNBRZ4W.js → chunk-WQZW3RDP.js} +2 -2
  24. package/dist/{chunk-BXFYBQKR.js → chunk-XPX432BZ.js} +8 -1
  25. package/dist/cli-context-K73EIND5.js +3369 -0
  26. package/dist/{cli-main-ILRTNPDP.js → cli-main-QXSKKANW.js} +84 -93
  27. package/dist/{diag-doctor-LFCCBPMD.js → diag-doctor-QZVKUAE5.js} +4 -5
  28. package/dist/{execution-BN4QIFH6.js → execution-7ZFY4FJY.js} +499 -473
  29. package/dist/{hq-3GWBFLON.js → hq-4QQJO2GN.js} +2 -2
  30. package/dist/hq-server/routes.d.ts +1 -1
  31. package/dist/{hq-server-OARPUSQJ.js → hq-server-CVAYICIS.js} +2 -2
  32. package/dist/index.js +20 -4440
  33. package/dist/{modeldiag-4NYBRSFP.js → modeldiag-ZL4ROTQ5.js} +2 -2
  34. package/dist/per-subcommand-help-6VCIKDUW.js +23 -0
  35. package/dist/{plugin-usage-AP7SJCDA.js → plugin-usage-7WCZW4NP.js} +2 -2
  36. package/dist/{plugins-HQ5FU2AM.js → plugins-7N3TF2QF.js} +3 -3
  37. package/dist/pre-launch/first-run.d.ts +51 -0
  38. package/dist/pre-launch.d.ts +1 -0
  39. package/dist/{project-manifest-YFTJ3D5N.js → project-manifest-RV5FXGQI.js} +2 -2
  40. package/dist/{project-picker-R5TYAE3Q.js → project-picker-CCQR3W4I.js} +3 -3
  41. package/dist/{providers-models-663NDPRQ.js → providers-models-OKKQZIWU.js} +2 -2
  42. package/dist/{proxy-wiring-EQB5X5YH.js → proxy-wiring-QCI7EWQC.js} +3 -3
  43. package/dist/{sdd-runtime-FLKCSTYV.js → sdd-runtime-R6FAK2G2.js} +2 -2
  44. package/dist/services/sdd-runtime.d.ts +1 -1
  45. package/dist/{sessions-config-P2LK2L32.js → sessions-config-KAMEBVOX.js} +4 -4
  46. package/dist/short-circuit-flags-7YUCERBB.js +11 -0
  47. package/dist/slash-commands/sdd.d.ts +1 -1
  48. package/dist/subcommands-KE6MEQQP.js +10 -0
  49. package/dist/{webui-server-OJLLM6PE.js → webui-server-F7MSRHOF.js} +8 -6
  50. package/dist/wiring/wrongtrace-gate.d.ts +2 -2
  51. package/dist/wiring/wrongtrace-hooks.d.ts +1 -1
  52. package/dist/{wrongtrace-gate-counters-P5BCBXQN.js → wrongtrace-gate-counters-GSVY372D.js} +2 -2
  53. package/dist/{wrongtrace-telemetry-FNLANZ5I.js → wrongtrace-telemetry-KBBM5NLQ.js} +2 -2
  54. package/package.json +28 -28
  55. package/dist/chunk-ALE5KHCA.js +0 -1
  56. package/dist/chunk-L6ZNCTRJ.js +0 -1067
@@ -0,0 +1,65 @@
1
+
2
+ // src/preflight.ts
3
+ import { ensureSessionShell } from "@wrongstack/tools";
4
+
5
+ // src/cli-update-notice.ts
6
+ import { writeErr } from "@wrongstack/core/utils";
7
+ var NOTICE_FMT = `
8
+ \x1B[33m\u2191 Update available: v%s \u2192 v%s\x1B[0m Run \`wrongstack update\` to upgrade.
9
+
10
+ `;
11
+ async function printUpdateNotice(initialUpdateInfo) {
12
+ let info = initialUpdateInfo;
13
+ if (!info?.outdated) {
14
+ const ac = new AbortController();
15
+ const timer = setTimeout(() => ac.abort(), 2e3);
16
+ try {
17
+ const { checkForUpdate } = await import("./update-check-PKSMSMD6.js");
18
+ info = await checkForUpdate(ac.signal);
19
+ } catch {
20
+ } finally {
21
+ clearTimeout(timer);
22
+ }
23
+ }
24
+ if (info?.outdated) {
25
+ writeErr(NOTICE_FMT.replace("%s", info.current).replace("%s", info.latest));
26
+ }
27
+ return info;
28
+ }
29
+
30
+ // src/preflight.ts
31
+ function applyNodeEnvDefault() {
32
+ if (process.env["NODE_ENV"] === void 0) {
33
+ process.env["NODE_ENV"] = "production";
34
+ process.env["WRONGSTACK_NODE_ENV_DEFAULTED"] = "1";
35
+ }
36
+ }
37
+ function applySessionShellDefault() {
38
+ ensureSessionShell();
39
+ }
40
+ async function applyPrintUpdateNotice(initialUpdateInfo) {
41
+ return await printUpdateNotice(initialUpdateInfo);
42
+ }
43
+ async function applyDebugStreamSeed(config) {
44
+ const { setDebugStreamEnabled } = await import("@wrongstack/providers");
45
+ if (config.debugStream) {
46
+ setDebugStreamEnabled(true);
47
+ }
48
+ }
49
+ async function runPreflight(config, initialUpdateInfo) {
50
+ applyNodeEnvDefault();
51
+ applySessionShellDefault();
52
+ const updateInfo = await applyPrintUpdateNotice(initialUpdateInfo);
53
+ await applyDebugStreamSeed(config);
54
+ return {
55
+ updateInfo,
56
+ debugStreamEnabled: Boolean(config.debugStream)
57
+ };
58
+ }
59
+
60
+ export {
61
+ applyNodeEnvDefault,
62
+ applySessionShellDefault,
63
+ runPreflight
64
+ };
65
+ //# sourceMappingURL=chunk-PCBJSXYV.js.map
@@ -1775,10 +1775,7 @@ function handleApiAuthAudit(_req, res, dataDir) {
1775
1775
 
1776
1776
  // src/hq-server/routes/command-handlers.ts
1777
1777
  import { randomUUID as randomUUID4 } from "node:crypto";
1778
- import {
1779
- tokenHasCapability,
1780
- validateHqCommand
1781
- } from "@wrongstack/core/hq";
1778
+ import { tokenHasCapability, validateHqCommand } from "@wrongstack/core/hq";
1782
1779
 
1783
1780
  // src/hq-server/snapshot.ts
1784
1781
  import { WebSocket } from "ws";
@@ -2267,9 +2264,7 @@ async function authorizeHqCommand(input) {
2267
2264
 
2268
2265
  // src/hq-server/routes/mailbox-handlers.ts
2269
2266
  import * as path4 from "node:path";
2270
- import {
2271
- resolveProjectDir
2272
- } from "@wrongstack/core/coordination";
2267
+ import { resolveProjectDir } from "@wrongstack/core/coordination";
2273
2268
 
2274
2269
  // src/hq-server/project-root.ts
2275
2270
  import { deriveHqProjectId } from "@wrongstack/core/hq";
@@ -3316,7 +3311,12 @@ var MailboxGatewayManager = class {
3316
3311
  MAILBOX_GATEWAY_SWEEP_INTERVAL_MS = 6e4;
3317
3312
  authorizeMailboxGateway(req, projectDir) {
3318
3313
  const requestUrl = new URL(req.url ?? "/", `http://${this.deps.host}:${this.deps.port}`);
3319
- const auth = authenticateBrowserRequest2(req, requestUrl, this.deps.mutableAuth, this.deps.sessions);
3314
+ const auth = authenticateBrowserRequest2(
3315
+ req,
3316
+ requestUrl,
3317
+ this.deps.mutableAuth,
3318
+ this.deps.sessions
3319
+ );
3320
3320
  const tokenMode = this.deps.mutableAuth.browserTokens.size > 0;
3321
3321
  if (hqAuthRequired(this.deps.mutableAuth) && auth === void 0) {
3322
3322
  return {
@@ -3638,10 +3638,7 @@ function handleIncomingClientEvent(ws, incomingEvent, clients, browsers, auth, s
3638
3638
  const event = redactHqEvent(
3639
3639
  { ...incomingEvent, payload: parsedPayload.payload },
3640
3640
  {
3641
- policy: tightenHqRedactionPolicy(
3642
- client.declaredRedactionPolicy,
3643
- auth.getOperatorPolicy()
3644
- ),
3641
+ policy: tightenHqRedactionPolicy(client.declaredRedactionPolicy, auth.getOperatorPolicy()),
3645
3642
  projectRoot: client.project.projectRoot,
3646
3643
  // Chat-transcript events carry full turns — the generic 500-char
3647
3644
  // summary cap would truncate them a second time after the
@@ -3807,10 +3804,7 @@ function handleIncomingClientEvent(ws, incomingEvent, clients, browsers, auth, s
3807
3804
  }
3808
3805
 
3809
3806
  // src/hq-server/ws-leader.ts
3810
- import {
3811
- HQ_BROWSER_PEER_RESUME_CLIENT_ID,
3812
- HQ_PROTOCOL_VERSION
3813
- } from "@wrongstack/core/hq";
3807
+ import { HQ_BROWSER_PEER_RESUME_CLIENT_ID, HQ_PROTOCOL_VERSION } from "@wrongstack/core/hq";
3814
3808
  var MAX_EVENT_LOG = 5e3;
3815
3809
  var PEER_DEDUP_WINDOW_MS = 60 * 60 * 1e3;
3816
3810
  var peerDedupMap = /* @__PURE__ */ new Map();
@@ -4418,7 +4412,9 @@ function handleHqConnection(ws, req, pathname, deps) {
4418
4412
  if (pathname === "/ws/browser") {
4419
4413
  handleBrowser(ws, deps.snapshotBroadcaster, deps.browsers, deps.eventLog);
4420
4414
  } else {
4421
- const token = new URL(req.url ?? "/", `http://${deps.host}:${deps.port}`).searchParams.get("token");
4415
+ const token = new URL(req.url ?? "/", `http://${deps.host}:${deps.port}`).searchParams.get(
4416
+ "token"
4417
+ );
4422
4418
  const authToken = token ? deps.mutableAuth.clientTokenObjs.get(hqTokenVerifier2(token)) : void 0;
4423
4419
  deps.clientSocketTokens.set(ws, authToken);
4424
4420
  ws.once("close", () => deps.clientSocketTokens.delete(ws));
@@ -4914,4 +4910,4 @@ export {
4914
4910
  startHqServer,
4915
4911
  HqInsecureExposureError2 as HqInsecureExposureError
4916
4912
  };
4917
- //# sourceMappingURL=chunk-7JBKXVMK.js.map
4913
+ //# sourceMappingURL=chunk-TALOKMIC.js.map
@@ -2,17 +2,6 @@ import {
2
2
  theme
3
3
  } from "./chunk-QD544J2B.js";
4
4
 
5
- // src/permission-prompt.ts
6
- import { alwaysAllowUnavailableReason } from "@wrongstack/core/security";
7
- import {
8
- color as color2,
9
- sanitizeTerminalPreview,
10
- sanitizeTerminalText as sanitizeTerminalText2,
11
- truncate,
12
- unifiedDiff,
13
- writeOut
14
- } from "@wrongstack/core/utils";
15
-
16
5
  // src/diff-renderer.ts
17
6
  import { color, sanitizeTerminalText } from "@wrongstack/core/utils";
18
7
  function diffLineStyle(line) {
@@ -28,6 +17,15 @@ function renderDiff(diff) {
28
17
  }
29
18
 
30
19
  // src/permission-prompt.ts
20
+ import { alwaysAllowUnavailableReason } from "@wrongstack/core/security";
21
+ import {
22
+ color as color2,
23
+ sanitizeTerminalPreview,
24
+ sanitizeTerminalText as sanitizeTerminalText2,
25
+ truncate,
26
+ unifiedDiff,
27
+ writeOut
28
+ } from "@wrongstack/core/utils";
31
29
  function makePromptDelegate(reader) {
32
30
  return async (tool, input, suggestedPattern) => {
33
31
  writeOut("\x07");
@@ -483,4 +481,4 @@ export {
483
481
  detectProjectFacts,
484
482
  renderAgentsTemplate
485
483
  };
486
- //# sourceMappingURL=chunk-KG4X5F7Z.js.map
484
+ //# sourceMappingURL=chunk-VFCJOWJB.js.map
@@ -1,11 +1,9 @@
1
1
  import {
2
2
  startProxyProbe
3
- } from "./chunk-G3IMKQRH.js";
3
+ } from "./chunk-JHPXJRRI.js";
4
4
 
5
5
  // src/wiring/proxy-wiring.ts
6
- import {
7
- applyProxyConfig
8
- } from "@wrongstack/core/wiring/proxy-rewrite";
6
+ import { applyProxyConfig } from "@wrongstack/core/wiring/proxy-rewrite";
9
7
  var probeRunner;
10
8
  function applyWrongProxyPrefs(payload) {
11
9
  const patch = {};
@@ -55,4 +53,4 @@ export {
55
53
  bootstrapWrongProxy,
56
54
  shutdownWrongProxy
57
55
  };
58
- //# sourceMappingURL=chunk-SYIBTG3X.js.map
56
+ //# sourceMappingURL=chunk-VOTTENR5.js.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-WHOIR577.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadManifest
3
- } from "./chunk-G7337TTK.js";
3
+ } from "./chunk-IS2PPBQV.js";
4
4
 
5
5
  // src/project-picker.ts
6
6
  import { color } from "@wrongstack/core/utils";
@@ -415,4 +415,4 @@ export {
415
415
  skipDivider,
416
416
  runProjectPicker
417
417
  };
418
- //# sourceMappingURL=chunk-2ZNBRZ4W.js.map
418
+ //# sourceMappingURL=chunk-WQZW3RDP.js.map
@@ -5,6 +5,7 @@ import { expectDefined } from "@wrongstack/core/utils";
5
5
  import * as fs from "node:fs/promises";
6
6
  import { decryptConfigSecrets, encryptConfigSecrets } from "@wrongstack/core/security";
7
7
  import { atomicWrite, color } from "@wrongstack/core/utils";
8
+ import { isSetupProvider as isSetupProviderId } from "@wrongstack/providers";
8
9
  import { nowIso } from "@wrongstack/primitives";
9
10
  function normalizeKeys(cfg) {
10
11
  if (Array.isArray(cfg.apiKeys) && cfg.apiKeys.length > 0) {
@@ -56,6 +57,12 @@ function clearStaleProviderDefaults(config) {
56
57
  const providerId = typeof config["provider"] === "string" ? config["provider"] : void 0;
57
58
  if (!providerId) return;
58
59
  const providers = config["providers"];
60
+ if (isSetupProviderId(providerId)) {
61
+ delete config["provider"];
62
+ delete config["model"];
63
+ if (providers) delete providers[providerId];
64
+ return;
65
+ }
59
66
  const provider = providers?.[providerId];
60
67
  if (!provider || !hasUsableSavedProvider(provider)) {
61
68
  delete config["provider"];
@@ -153,4 +160,4 @@ export {
153
160
  mutateConfigProviders,
154
161
  nowIso
155
162
  };
156
- //# sourceMappingURL=chunk-BXFYBQKR.js.map
163
+ //# sourceMappingURL=chunk-XPX432BZ.js.map