@wrongstack/cli 0.317.2 → 0.319.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) 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-KF5TAD7V.js} +10 -10
  5. package/dist/{chunk-GKHUHAIK.js → chunk-42JD25KU.js} +5 -5
  6. package/dist/{chunk-QYIIOMLE.js → chunk-E4I2TF5S.js} +2 -2
  7. package/dist/{chunk-37SPPLUD.js → chunk-F5GA2QW2.js} +15 -2
  8. package/dist/chunk-GGGUZSAU.js +235 -0
  9. package/dist/{chunk-QC5I4VWZ.js → chunk-H7GABTGS.js} +6 -2
  10. package/dist/chunk-OZDE3OWD.js +52 -0
  11. package/dist/chunk-P2OKBDCH.js +1166 -0
  12. package/dist/chunk-PCBJSXYV.js +65 -0
  13. package/dist/{chunk-KG4X5F7Z.js → chunk-VFCJOWJB.js} +10 -12
  14. package/dist/chunk-VWCZL4OH.js +46 -0
  15. package/dist/{chunk-YX6KUIDF.js → chunk-XHIEA6LG.js} +861 -29
  16. package/dist/{chunk-BXFYBQKR.js → chunk-XPX432BZ.js} +8 -1
  17. package/dist/cli-context-LH4QP4W2.js +3369 -0
  18. package/dist/{cli-main-ILRTNPDP.js → cli-main-72XUFUCL.js} +50 -44
  19. package/dist/{execution-BN4QIFH6.js → execution-DKJDNPYF.js} +17 -17
  20. package/dist/index.js +20 -4440
  21. package/dist/{modeldiag-4NYBRSFP.js → modeldiag-5FRMT6FQ.js} +2 -2
  22. package/dist/per-subcommand-help-6VCIKDUW.js +23 -0
  23. package/dist/{plugin-usage-AP7SJCDA.js → plugin-usage-CYUORYM6.js} +2 -2
  24. package/dist/{plugins-HQ5FU2AM.js → plugins-RV3OBBND.js} +3 -3
  25. package/dist/pre-launch/first-run.d.ts +51 -0
  26. package/dist/pre-launch.d.ts +1 -0
  27. package/dist/{providers-models-663NDPRQ.js → providers-models-OKKQZIWU.js} +2 -2
  28. package/dist/{sessions-config-P2LK2L32.js → sessions-config-KAMEBVOX.js} +4 -4
  29. package/dist/short-circuit-flags-U6CJAF6J.js +11 -0
  30. package/dist/subcommands-J4JMWC5W.js +10 -0
  31. package/dist/{webui-server-OJLLM6PE.js → webui-server-SY4EQCKD.js} +5 -5
  32. package/package.json +28 -28
  33. 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
@@ -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
@@ -0,0 +1,46 @@
1
+ import {
2
+ helpCmd,
3
+ versionCmd
4
+ } from "./chunk-QAC263FZ.js";
5
+ import {
6
+ parseArgs
7
+ } from "./chunk-GGGUZSAU.js";
8
+
9
+ // src/boot/short-circuit-flags.ts
10
+ async function handleHelpVersionShortCircuit(argv) {
11
+ const { flags: earlyFlags, positional } = parseArgs(argv);
12
+ if (earlyFlags["help"] !== true && earlyFlags["version"] !== true) {
13
+ return null;
14
+ }
15
+ const stubRenderer = {
16
+ write: (line) => {
17
+ process.stdout.write(line);
18
+ }
19
+ };
20
+ if (earlyFlags["version"] === true) {
21
+ return await versionCmd([], { renderer: stubRenderer });
22
+ }
23
+ if (earlyFlags["help"] === true) {
24
+ if (positional.length > 0) {
25
+ const { subcommandNames } = await import("./subcommands-J4JMWC5W.js");
26
+ if (subcommandNames.includes(positional[0])) {
27
+ const first = positional[0];
28
+ const deep = positional[1];
29
+ const { renderDeepHelp, renderFocusedHelp } = await import("./per-subcommand-help-6VCIKDUW.js");
30
+ if (deep && renderDeepHelp(`${first}:${deep}`, stubRenderer)) {
31
+ return 0;
32
+ }
33
+ if (renderFocusedHelp(first, stubRenderer)) {
34
+ return 0;
35
+ }
36
+ }
37
+ }
38
+ return await helpCmd([], { renderer: stubRenderer });
39
+ }
40
+ return null;
41
+ }
42
+
43
+ export {
44
+ handleHelpVersionShortCircuit
45
+ };
46
+ //# sourceMappingURL=chunk-VWCZL4OH.js.map