@wrongstack/cli 1.0.35 → 1.0.36

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 (48) hide show
  1. package/dist/{acp-T77EAEDB.js → acp-QLU7T5WX.js} +3 -3
  2. package/dist/{auth-M6LXZTDA.js → auth-AED7RW7D.js} +5 -5
  3. package/dist/{automation-MCDFCIMV.js → automation-3E3AUPBF.js} +19 -4
  4. package/dist/{boot-auto-thin-YMAZI3QL.js → boot-auto-thin-AGJ6TAWY.js} +3 -3
  5. package/dist/{chunk-4BX2YDTQ.js → chunk-4JMAWKLA.js} +45 -4
  6. package/dist/{chunk-TWSQTQKR.js → chunk-4R6TVMYA.js} +2 -2
  7. package/dist/{chunk-HHRYIDOW.js → chunk-ACW64W4M.js} +34 -7
  8. package/dist/{chunk-LKFKO4JW.js → chunk-B6EHK772.js} +2 -2
  9. package/dist/{chunk-4UWCMBPG.js → chunk-BJH44J7G.js} +3 -3
  10. package/dist/{chunk-6Z6C6ZHH.js → chunk-GF7LUWQS.js} +4 -10
  11. package/dist/{chunk-TXAFIERF.js → chunk-L5NWFP5R.js} +2 -2
  12. package/dist/{chunk-LDXXMPMS.js → chunk-LPGZ3NUF.js} +20 -20
  13. package/dist/{chunk-GZSKLXYG.js → chunk-NEWXDNF2.js} +8 -8
  14. package/dist/{chunk-6SIUTX75.js → chunk-NOZJIN46.js} +1 -2
  15. package/dist/{chunk-KMU7GF7X.js → chunk-RE73FP2X.js} +2 -2
  16. package/dist/{chunk-LDV4ERNV.js → chunk-RYTSPBNM.js} +2 -2
  17. package/dist/{chunk-WTJDSTYD.js → chunk-T5KR6SNO.js} +2 -2
  18. package/dist/{chunk-ZYACRPLN.js → chunk-ULYAI7CP.js} +6 -3
  19. package/dist/{chunk-HLSHFXTO.js → chunk-WY74MMDB.js} +2 -2
  20. package/dist/{chunk-RWNI5OWT.js → chunk-ZWBI7ORM.js} +2 -2
  21. package/dist/{cli-context-II57EHD2.js → cli-context-I6HJCVCV.js} +76 -68
  22. package/dist/{cli-main-YR2WJCPL.js → cli-main-X7KD7IOC.js} +213 -153
  23. package/dist/{config-transfer-VOIFY7U4.js → config-transfer-YPD7HYXH.js} +6 -4
  24. package/dist/{execution-IBAZ2EIU.js → execution-M7D4KNBB.js} +37 -12
  25. package/dist/{hq-5OIEKB4V.js → hq-BBLGEEUH.js} +3 -3
  26. package/dist/{hq-server-DU3ZH3X7.js → hq-server-5TR6NBGS.js} +2 -2
  27. package/dist/{hq-service-LYZV7EK7.js → hq-service-4Q64WFNT.js} +2 -2
  28. package/dist/{import-claude-code-AYG24RG2.js → import-claude-code-GHIS2F7Y.js} +3 -3
  29. package/dist/index.js +4 -4
  30. package/dist/{mailbox-serve-S536N66F.js → mailbox-serve-DRWJVMYU.js} +2 -2
  31. package/dist/{modeldiag-NEPTLFZW.js → modeldiag-F3LUF4VJ.js} +3 -3
  32. package/dist/plugin-config.d.ts +6 -0
  33. package/dist/{plugin-usage-3TZGROK7.js → plugin-usage-EM752WHG.js} +3 -3
  34. package/dist/{plugins-ITH4SLO6.js → plugins-U6HQFJ7N.js} +4 -4
  35. package/dist/{providers-models-37DUV2GW.js → providers-models-S3S6VXME.js} +3 -3
  36. package/dist/{sage-FFKUOCQL.js → sage-BMRDJCDI.js} +9 -5
  37. package/dist/{sage-sync-ZMTHB477.js → sage-sync-PCWCNEUK.js} +2 -2
  38. package/dist/{sessions-config-VE26SB56.js → sessions-config-RQRQDW5Q.js} +2 -2
  39. package/dist/{short-circuit-flags-EXJBJ5GT.js → short-circuit-flags-IEV3FEOT.js} +2 -2
  40. package/dist/slash-commands/doctor.d.ts +0 -9
  41. package/dist/{standalone-auto-update-VQC4GYCM.js → standalone-auto-update-QUXOZ4B5.js} +13 -2
  42. package/dist/{subcommands-DTKBXLPU.js → subcommands-75IB23LS.js} +2 -2
  43. package/dist/{typesafe-NHC322W5.js → typesafe-KW2XHOG3.js} +2 -2
  44. package/dist/{update-6OEPAEUV.js → update-LHCWAWEZ.js} +2 -2
  45. package/dist/webui-server/credential-watcher.d.ts +3 -1
  46. package/dist/{webui-server-6IC3SLZG.js → webui-server-CUIFA25W.js} +5 -33
  47. package/dist/wiring/management-tools.d.ts +9 -1
  48. package/package.json +31 -31
@@ -81,7 +81,7 @@ async function runUpdateCommand(args, deps) {
81
81
  if (isStandaloneBinary()) {
82
82
  const [{ updateStandaloneBinary }, { standaloneUpdater }, { STANDALONE_TARGET }] = await Promise.all([
83
83
  import("./standalone-update-HZHDZZOR.js"),
84
- import("./standalone-auto-update-VQC4GYCM.js"),
84
+ import("./standalone-auto-update-QUXOZ4B5.js"),
85
85
  import("./version-JB2UAV2A.js")
86
86
  ]);
87
87
  const updater = standaloneUpdater({
@@ -406,4 +406,4 @@ export {
406
406
  detectUpdatePackageManager,
407
407
  detectUpdatePackageName
408
408
  };
409
- //# sourceMappingURL=chunk-RWNI5OWT.js.map
409
+ //# sourceMappingURL=chunk-ZWBI7ORM.js.map
@@ -27,20 +27,20 @@ import {
27
27
  } from "./chunk-EWKESL4L.js";
28
28
  import {
29
29
  resolveLaunchMcpServers
30
- } from "./chunk-HLSHFXTO.js";
30
+ } from "./chunk-WY74MMDB.js";
31
31
  import {
32
32
  subcommands
33
- } from "./chunk-LDXXMPMS.js";
33
+ } from "./chunk-LPGZ3NUF.js";
34
34
  import {
35
35
  renderDeepHelp,
36
36
  renderFocusedHelp
37
37
  } from "./chunk-2EZ2DHOW.js";
38
38
  import {
39
39
  handleHelpVersionShortCircuit
40
- } from "./chunk-LDV4ERNV.js";
40
+ } from "./chunk-RYTSPBNM.js";
41
41
  import {
42
42
  DEFAULT_PORT
43
- } from "./chunk-6Z6C6ZHH.js";
43
+ } from "./chunk-GF7LUWQS.js";
44
44
  import "./chunk-HXJYHAR4.js";
45
45
  import {
46
46
  resolveHqPasswordInput
@@ -53,7 +53,7 @@ import {
53
53
  } from "./chunk-Q7E3BPDU.js";
54
54
  import {
55
55
  installProviderPersisters
56
- } from "./chunk-TWSQTQKR.js";
56
+ } from "./chunk-4R6TVMYA.js";
57
57
  import {
58
58
  discoverAndMergeProviders
59
59
  } from "./chunk-PA4VBCXS.js";
@@ -69,7 +69,7 @@ import {
69
69
  runPicker,
70
70
  saveToGlobalConfig,
71
71
  theme
72
- } from "./chunk-GZSKLXYG.js";
72
+ } from "./chunk-NEWXDNF2.js";
73
73
  import "./chunk-YTEOAWOJ.js";
74
74
  import {
75
75
  isKeylessLocalProvider,
@@ -77,21 +77,21 @@ import {
77
77
  } from "./chunk-RKU66D2O.js";
78
78
  import {
79
79
  resolveActiveApiKey
80
- } from "./chunk-ZYACRPLN.js";
80
+ } from "./chunk-ULYAI7CP.js";
81
81
  import {
82
82
  activeProfileConfigPath
83
83
  } from "./chunk-YMXXOOFN.js";
84
- import "./chunk-4BX2YDTQ.js";
84
+ import "./chunk-4JMAWKLA.js";
85
85
  import {
86
86
  runUpdateCommand
87
- } from "./chunk-RWNI5OWT.js";
87
+ } from "./chunk-ZWBI7ORM.js";
88
88
  import "./chunk-BHXAKTBE.js";
89
89
  import "./chunk-DAKVBMD4.js";
90
90
  import {
91
91
  applyNodeEnvDefault,
92
92
  applySessionShellDefault,
93
93
  runPreflight
94
- } from "./chunk-WTJDSTYD.js";
94
+ } from "./chunk-T5KR6SNO.js";
95
95
  import {
96
96
  parseArgs
97
97
  } from "./chunk-CJSHS2K7.js";
@@ -234,7 +234,7 @@ function wireContainer(deps) {
234
234
  // src/boot/launch-menu.ts
235
235
  import * as fs from "node:fs/promises";
236
236
  import { HQ_CLI_DEFAULT_HOST } from "@wrongstack/core/hq";
237
- import { atomicWrite, color, isStdinTTY, setRawMode } from "@wrongstack/core/utils";
237
+ import { atomicWrite, color, isStdinTTY, setRawMode, withFileLock } from "@wrongstack/core/utils";
238
238
 
239
239
  // src/boot/launch-banner.ts
240
240
  var STACK_ORANGE = { r: 253, g: 159, b: 2 };
@@ -750,29 +750,31 @@ function toPersistedMenuChoice(result) {
750
750
  };
751
751
  }
752
752
  async function persistMenuChoice(globalConfigPath, choice) {
753
- let fileExists = false;
754
- try {
755
- await fs.access(globalConfigPath);
756
- fileExists = true;
757
- } catch {
758
- }
759
- let existing = {};
760
- try {
761
- const raw = await fs.readFile(globalConfigPath, "utf8");
762
- existing = JSON.parse(raw);
763
- } catch (err) {
764
- if (fileExists) {
765
- throw new Error(
766
- `Refusing to overwrite corrupt config at ${globalConfigPath} (${err.message}). Fix or move the file aside before retrying.`,
767
- { cause: err }
768
- );
753
+ await withFileLock(globalConfigPath, async () => {
754
+ let fileExists = false;
755
+ try {
756
+ await fs.access(globalConfigPath);
757
+ fileExists = true;
758
+ } catch {
769
759
  }
770
- existing = {};
771
- }
772
- const launch = existing.launch ?? {};
773
- existing.launch = { ...launch, menuChoice: choice };
774
- await atomicWrite(globalConfigPath, JSON.stringify(existing, null, 2), {
775
- mode: 384
760
+ let existing = {};
761
+ try {
762
+ const raw = await fs.readFile(globalConfigPath, "utf8");
763
+ existing = JSON.parse(raw.replace(/^\uFEFF/, ""));
764
+ } catch (err) {
765
+ if (fileExists) {
766
+ throw new Error(
767
+ `Refusing to overwrite corrupt config at ${globalConfigPath} (${err.message}). Fix or move the file aside before retrying.`,
768
+ { cause: err }
769
+ );
770
+ }
771
+ existing = {};
772
+ }
773
+ const launch = existing.launch ?? {};
774
+ existing.launch = { ...launch, menuChoice: choice };
775
+ await atomicWrite(globalConfigPath, JSON.stringify(existing, null, 2), {
776
+ mode: 384
777
+ });
776
778
  });
777
779
  }
778
780
 
@@ -929,7 +931,7 @@ async function isPortInUse(host, port) {
929
931
  }
930
932
  async function handleHqShortCircuit(flags) {
931
933
  if (flags["hq"] !== true) return null;
932
- const { startHqServer } = await import("./hq-server-DU3ZH3X7.js");
934
+ const { startHqServer } = await import("./hq-server-5TR6NBGS.js");
933
935
  const tunnelRequested = flags["tunnel"] === true;
934
936
  const rawPublicUrl = typeof flags["hq-public-url"] === "string" ? flags["hq-public-url"] : process.env.WRONGSTACK_HQ_PUBLIC_URL;
935
937
  let publicOrigin;
@@ -1486,7 +1488,7 @@ ${color5.amber("?")} Choose ${color5.dim("(1-4)")} ${color5.dim("[q to quit]")}:
1486
1488
 
1487
1489
  // src/pre-launch/launch-prompts.ts
1488
1490
  import * as fs4 from "node:fs/promises";
1489
- import { atomicWrite as atomicWrite3, color as color6 } from "@wrongstack/core/utils";
1491
+ import { atomicWrite as atomicWrite3, color as color6, withFileLock as withFileLock2 } from "@wrongstack/core/utils";
1490
1492
  var LaunchAbortedError = class extends Error {
1491
1493
  exitCode = 0;
1492
1494
  constructor() {
@@ -1602,31 +1604,33 @@ function buildBadges(chosen) {
1602
1604
  return badges;
1603
1605
  }
1604
1606
  async function persistLaunchChoices(configPath, choices) {
1605
- let fileExists = false;
1606
- try {
1607
- await fs4.access(configPath);
1608
- fileExists = true;
1609
- } catch {
1610
- }
1611
- let existing = {};
1612
- try {
1613
- const raw = await fs4.readFile(configPath, "utf8");
1614
- existing = JSON.parse(raw);
1615
- } catch (err) {
1616
- if (fileExists) {
1617
- throw new Error(
1618
- `Refusing to overwrite corrupt config at ${configPath} (${err.message}). Fix or move the file aside before retrying.`,
1619
- { cause: err }
1620
- );
1607
+ await withFileLock2(configPath, async () => {
1608
+ let fileExists = false;
1609
+ try {
1610
+ await fs4.access(configPath);
1611
+ fileExists = true;
1612
+ } catch {
1621
1613
  }
1622
- existing = {};
1623
- }
1624
- existing.yolo = choices.yolo;
1625
- existing.launch = {
1626
- mode: choices.mode,
1627
- autonomy: choices.autonomy
1628
- };
1629
- await atomicWrite3(configPath, JSON.stringify(existing, null, 2), { mode: 384 });
1614
+ let existing = {};
1615
+ try {
1616
+ const raw = await fs4.readFile(configPath, "utf8");
1617
+ existing = JSON.parse(raw.replace(/^\uFEFF/, ""));
1618
+ } catch (err) {
1619
+ if (fileExists) {
1620
+ throw new Error(
1621
+ `Refusing to overwrite corrupt config at ${configPath} (${err.message}). Fix or move the file aside before retrying.`,
1622
+ { cause: err }
1623
+ );
1624
+ }
1625
+ existing = {};
1626
+ }
1627
+ existing.yolo = choices.yolo;
1628
+ existing.launch = {
1629
+ mode: choices.mode,
1630
+ autonomy: choices.autonomy
1631
+ };
1632
+ await atomicWrite3(configPath, JSON.stringify(existing, null, 2), { mode: 384 });
1633
+ });
1630
1634
  }
1631
1635
 
1632
1636
  // src/pre-launch/project-check.ts
@@ -2666,7 +2670,7 @@ function dim(s) {
2666
2670
  }
2667
2671
 
2668
2672
  // src/renderer.ts
2669
- import { color as color12 } from "@wrongstack/core/utils";
2673
+ import { color as color12, sanitizeTerminalText } from "@wrongstack/core/utils";
2670
2674
  var TerminalRenderer = class _TerminalRenderer {
2671
2675
  out;
2672
2676
  err;
@@ -2778,9 +2782,11 @@ var TerminalRenderer = class _TerminalRenderer {
2778
2782
  if (this.suppressStdout()) return;
2779
2783
  if (!this.lineStart) this.out.write("\n");
2780
2784
  const arrow = theme2.primary("\u2192");
2781
- const display = formatInputSummary(input);
2782
- this.out.write(`${arrow} ${theme2.bold(name)}${display ? color12.dim(` ${display}`) : ""}
2783
- `);
2785
+ const display = sanitizeTerminalText(formatInputSummary(input));
2786
+ this.out.write(
2787
+ `${arrow} ${theme2.bold(sanitizeTerminalText(name))}${display ? color12.dim(` ${display}`) : ""}
2788
+ `
2789
+ );
2784
2790
  this.lineStart = true;
2785
2791
  }
2786
2792
  writeToolResult(name, content, isError) {
@@ -2788,11 +2794,13 @@ var TerminalRenderer = class _TerminalRenderer {
2788
2794
  this.clearRenderMode(name);
2789
2795
  return;
2790
2796
  }
2791
- const txt = typeof content === "string" ? content : safeStringify(content);
2797
+ const txt = sanitizeTerminalText(
2798
+ typeof content === "string" ? content : safeStringify(content)
2799
+ );
2792
2800
  const prefix = isError ? theme2.error("\u2718") : theme2.success("\u2713");
2793
2801
  const renderMode = this.getRenderMode(name);
2794
2802
  this.clearRenderMode(name);
2795
- const bodyText = extractBodyText(content, name);
2803
+ const bodyText = sanitizeTerminalText(extractBodyText(content, name));
2796
2804
  if (isError) {
2797
2805
  const firstLine = txt.split("\n")[0] ?? "";
2798
2806
  const truncated = firstLine.length > 200 ? `${firstLine.slice(0, 197)}\u2026` : firstLine;
@@ -2804,7 +2812,7 @@ var TerminalRenderer = class _TerminalRenderer {
2804
2812
  const isEditLike = name === "edit" || name === "write";
2805
2813
  const diff = extractDiff(content);
2806
2814
  if (isEditLike && diff) {
2807
- this.out.write(` ${prefix} ${color12.dim(summarize(content, name))}
2815
+ this.out.write(` ${prefix} ${color12.dim(sanitizeTerminalText(summarize(content, name)))}
2808
2816
  `);
2809
2817
  const rendered = renderDiff(diff).split("\n").map((l) => ` ${l}`).join("\n");
2810
2818
  this.out.write(`${rendered}
@@ -2812,7 +2820,7 @@ var TerminalRenderer = class _TerminalRenderer {
2812
2820
  this.lineStart = true;
2813
2821
  return;
2814
2822
  }
2815
- const summary = summarize(content, name);
2823
+ const summary = sanitizeTerminalText(summarize(content, name));
2816
2824
  const isReadLike = name === "read" || name === "grep" || name === "glob" || name === "bash" || name === "exec";
2817
2825
  if (renderMode === "simple") {
2818
2826
  this.out.write(` ${prefix} ${color12.dim(summary || compactSingleLine(bodyText))}
@@ -3553,4 +3561,4 @@ async function initializeCli(argv, options = {}) {
3553
3561
  export {
3554
3562
  initializeCli
3555
3563
  };
3556
- //# sourceMappingURL=cli-context-II57EHD2.js.map
3564
+ //# sourceMappingURL=cli-context-I6HJCVCV.js.map