@wrongstack/cli 1.0.24 → 1.0.26

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 (124) hide show
  1. package/data/providers.json +44 -0
  2. package/dist/{acp-AJWSKWE5.js → acp-LI665LO2.js} +5 -5
  3. package/dist/ascii-mode-SG4PRNLP.js +7 -0
  4. package/dist/{auth-GRBZ7Y3D.js → auth-TE55JF4Z.js} +14 -14
  5. package/dist/{bench-N5K7Z5O3.js → bench-GTLPM22B.js} +2 -2
  6. package/dist/boot/append-system-prompt.d.ts +10 -0
  7. package/dist/boot/ascii-mode.d.ts +12 -0
  8. package/dist/boot/container-wiring.d.ts +4 -2
  9. package/dist/boot/dispatch-singleshot.d.ts +4 -1
  10. package/dist/boot/mcp-config-flag.d.ts +22 -0
  11. package/dist/boot/piped-stdin.d.ts +40 -0
  12. package/dist/boot/restricted-mode.d.ts +15 -0
  13. package/dist/boot/safe-mode.d.ts +30 -0
  14. package/dist/boot/single-shot-budget.d.ts +30 -0
  15. package/dist/boot/stream-json.d.ts +36 -0
  16. package/dist/boot/structured-output.d.ts +16 -0
  17. package/dist/boot/system-prompt-builder.d.ts +2 -0
  18. package/dist/boot/tool-restriction-flags.d.ts +36 -0
  19. package/dist/boot/worktree-sessions.d.ts +21 -0
  20. package/dist/boot-provider-selection.d.ts +67 -0
  21. package/dist/boot.d.ts +1 -38
  22. package/dist/{chunk-LFMVHT3R.js → chunk-2ERX3RPN.js} +11 -13
  23. package/dist/chunk-4TVYGG6G.js +62 -0
  24. package/dist/chunk-5JYDKG5B.js +154 -0
  25. package/dist/{chunk-3VXYY5JC.js → chunk-5UZBUV2H.js} +3 -19
  26. package/dist/chunk-BEHGRNOQ.js +58 -0
  27. package/dist/chunk-CZTXF6HY.js +140 -0
  28. package/dist/{chunk-SKPDE62W.js → chunk-EPR42SWM.js} +36 -6
  29. package/dist/{chunk-YBUCXXYZ.js → chunk-F5DCFAKI.js} +1 -1
  30. package/dist/chunk-HLSHFXTO.js +97 -0
  31. package/dist/{chunk-BLD5DSVA.js → chunk-KJS5543T.js} +2 -2
  32. package/dist/{chunk-QFPQXKCG.js → chunk-KOEO4CJG.js} +21 -6
  33. package/dist/chunk-LBPLTTZ6.js +105 -0
  34. package/dist/{chunk-3OCUS3VN.js → chunk-LDCGZJTC.js} +4 -4
  35. package/dist/chunk-LKPEBZBE.js +143 -0
  36. package/dist/{chunk-DRM7PSW7.js → chunk-OAVBM55Q.js} +3 -3
  37. package/dist/chunk-PZQBGUVZ.js +18 -0
  38. package/dist/{chunk-MHEBWVXL.js → chunk-Q4INH2DG.js} +46 -2
  39. package/dist/{chunk-ZZRSG7VK.js → chunk-RZ4ZDRYA.js} +3 -3
  40. package/dist/{chunk-U46QR4WR.js → chunk-TI7KLHYX.js} +132 -3
  41. package/dist/{chunk-PGKJ2OQP.js → chunk-WQV2NP57.js} +5 -5
  42. package/dist/chunk-X756ZS72.js +329 -0
  43. package/dist/{chunk-JF2MULWF.js → chunk-YHYINL47.js} +47 -15
  44. package/dist/{cli-context-34Q5IJRA.js → cli-context-UVGAN3NO.js} +407 -327
  45. package/dist/{cli-main-AELJDBGU.js → cli-main-TN3KZ2P6.js} +2652 -1978
  46. package/dist/cli-update-notice.d.ts +2 -1
  47. package/dist/config-doctor.d.ts +1 -1
  48. package/dist/{diag-doctor-WIFJH3XH.js → diag-doctor-BIZAFIAT.js} +2 -2
  49. package/dist/{execution-PYC5FCS4.js → execution-7QIP6GRY.js} +1948 -1666
  50. package/dist/fleet/host-types.d.ts +3 -1
  51. package/dist/goal-commands.d.ts +47 -0
  52. package/dist/goal-host.d.ts +1 -14
  53. package/dist/{hq-JTUTFI4L.js → hq-GLZ7QESM.js} +6 -6
  54. package/dist/{hq-server-PC7GZMPT.js → hq-server-YTKDVQPY.js} +2 -2
  55. package/dist/{hq-service-NW56MUP2.js → hq-service-BMMJAHRT.js} +4 -4
  56. package/dist/import-claude-code-32PCSIQI.js +236 -0
  57. package/dist/index.js +12 -8
  58. package/dist/{mailbox-serve-WDOCH6KR.js → mailbox-serve-NW5VZG7R.js} +3 -3
  59. package/dist/{modeldiag-36OGAL5C.js → modeldiag-36VODVIH.js} +8 -8
  60. package/dist/{per-subcommand-help-XE77MTGJ.js → per-subcommand-help-QDAQASPZ.js} +2 -2
  61. package/dist/permission-prompt.d.ts +14 -0
  62. package/dist/permission-rules-view.d.ts +18 -0
  63. package/dist/{permissions-CFDLXETM.js → permissions-PL27UHYD.js} +67 -45
  64. package/dist/{plugin-usage-S5LVGMBW.js → plugin-usage-CIGOOTX3.js} +2 -2
  65. package/dist/{plugins-RHBIVLI7.js → plugins-HQTXUD6A.js} +4 -2
  66. package/dist/preflight.d.ts +1 -1
  67. package/dist/{projects-LMNAGGEU.js → projects-T4CZCA25.js} +3 -6
  68. package/dist/provider-helpers.d.ts +7 -11
  69. package/dist/{providers-models-2CFG46RD.js → providers-models-5Z2PJTEW.js} +5 -5
  70. package/dist/release-asset-download.d.ts +10 -0
  71. package/dist/release-attestation.d.ts +28 -0
  72. package/dist/remote/remote-session.d.ts +64 -0
  73. package/dist/remote/remote-target.d.ts +69 -0
  74. package/dist/remote-O5WXHLWV.js +561 -0
  75. package/dist/{replay-Z3FTJEMM.js → replay-DEI566CW.js} +2 -2
  76. package/dist/services/commit-message.d.ts +2 -1
  77. package/dist/session-move-P2EC2COA.js +44 -0
  78. package/dist/session-move.d.ts +20 -0
  79. package/dist/session-stats.d.ts +10 -0
  80. package/dist/{sessions-config-IQUH2GXT.js → sessions-config-SXTTLNXA.js} +35 -5
  81. package/dist/short-circuit-flags-74Y5N6CF.js +10 -0
  82. package/dist/slash-commands/command-context.d.ts +15 -5
  83. package/dist/slash-commands/goal-refiner.d.ts +4 -49
  84. package/dist/slash-commands/mcp.d.ts +2 -1
  85. package/dist/slash-commands/permissions.d.ts +4 -0
  86. package/dist/slash-commands/settings-context-mutations.d.ts +5 -0
  87. package/dist/slash-commands/settings-limits-mutations.d.ts +12 -0
  88. package/dist/standalone-auto-update-TOTRGCSA.js +249 -0
  89. package/dist/standalone-auto-update.d.ts +65 -0
  90. package/dist/standalone-update-LZO3MNLH.js +24 -0
  91. package/dist/standalone-update.d.ts +37 -1
  92. package/dist/subcommands/handlers/import-claude-code.d.ts +42 -0
  93. package/dist/subcommands/handlers/permissions.d.ts +9 -3
  94. package/dist/subcommands/handlers/remote.d.ts +6 -0
  95. package/dist/subcommands/handlers/version-help.d.ts +5 -0
  96. package/dist/{subcommands-ZTSIN7LG.js → subcommands-Q6ORSB2E.js} +2 -2
  97. package/dist/tui-resume-callback.d.ts +18 -0
  98. package/dist/{typesafe-HVEVPA6R.js → typesafe-U7YB2RRV.js} +5 -5
  99. package/dist/{typesafe-topic-replay-4W73BOLV.js → typesafe-topic-replay-ZILIU3WS.js} +18 -2
  100. package/dist/{update-7XIOEXTD.js → update-TDZX4IL2.js} +4 -4
  101. package/dist/{update-check-2POMBHFB.js → update-check-J5ZVKS73.js} +3 -3
  102. package/dist/version-JB2UAV2A.js +11 -0
  103. package/dist/version-help-XJJQ7YSH.js +10 -0
  104. package/dist/webui-server/route-contexts.d.ts +1 -1
  105. package/dist/webui-server/session-start-payload.d.ts +5 -1
  106. package/dist/{webui-server-L2SICPTB.js → webui-server-YTHLRFD2.js} +509 -366
  107. package/dist/webui-server-lifecycle.d.ts +57 -0
  108. package/dist/webui-server.d.ts +0 -14
  109. package/dist/wiring/brain-and-orchestration.d.ts +3 -1
  110. package/dist/wiring/cli-prompt-and-tools-setup.d.ts +9 -0
  111. package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
  112. package/dist/wiring/lifecycle-plugins.d.ts +4 -2
  113. package/dist/wiring/metrics.d.ts +9 -1
  114. package/dist/wiring/pipeline.d.ts +2 -7
  115. package/dist/wiring/plugins.d.ts +3 -0
  116. package/dist/wiring/provider-status.d.ts +1 -0
  117. package/dist/wiring/provider-utility-tools.d.ts +3 -1
  118. package/package.json +28 -28
  119. package/dist/chunk-2BKFWIER.js +0 -98
  120. package/dist/chunk-424ORSE7.js +0 -56
  121. package/dist/chunk-QBBF7GIK.js +0 -65
  122. package/dist/short-circuit-flags-SDT53OML.js +0 -10
  123. package/dist/standalone-update-MW47J3AK.js +0 -164
  124. package/dist/version-help-WZ623NWM.js +0 -10
@@ -1,164 +0,0 @@
1
- import {
2
- STANDALONE_TARGET
3
- } from "./chunk-YBUCXXYZ.js";
4
-
5
- // src/standalone-update.ts
6
- import { createHash } from "node:crypto";
7
- import * as fs from "node:fs";
8
- import * as path from "node:path";
9
- import { FetchError } from "@wrongstack/core/types";
10
-
11
- // src/release-asset-download.ts
12
- async function downloadReleaseAsset(url, timeoutMs, maxBytes) {
13
- const res = await fetch(url, {
14
- signal: AbortSignal.timeout(timeoutMs),
15
- headers: { "User-Agent": "wrongstack-cli" },
16
- redirect: "follow"
17
- });
18
- if (!res.ok) throw new Error(`download ${url} responded ${res.status}`);
19
- const declared = Number(res.headers.get("content-length") ?? "0");
20
- if (declared > maxBytes) throw new Error(`download ${url} is too large`);
21
- if (!res.body) return Buffer.alloc(0);
22
- const chunks = [];
23
- let received = 0;
24
- const reader = res.body.getReader();
25
- try {
26
- while (true) {
27
- const { done, value } = await reader.read();
28
- if (done) break;
29
- received += value.byteLength;
30
- if (received > maxBytes) {
31
- await reader.cancel();
32
- throw new Error(`download ${url} is too large`);
33
- }
34
- chunks.push(Buffer.from(value.buffer, value.byteOffset, value.byteLength));
35
- }
36
- } finally {
37
- reader.releaseLock();
38
- }
39
- return Buffer.concat(chunks, received);
40
- }
41
-
42
- // src/standalone-update.ts
43
- var RELEASES_REPO = "WrongStack/WrongStack";
44
- var API_LATEST = `https://api.github.com/repos/${RELEASES_REPO}/releases/latest`;
45
- var MAX_BINARY_BYTES = 512 * 1024 * 1024;
46
- var MAX_CHECKSUM_BYTES = 1024 * 1024;
47
- function standaloneAssetName(target) {
48
- const name = `wstack-${target.replace(/^bun-/, "")}`;
49
- return target.startsWith("bun-windows") ? `${name}.exe` : name;
50
- }
51
- async function fetchLatestRelease(timeoutMs, signal) {
52
- const timeoutSignal = AbortSignal.timeout(timeoutMs);
53
- const res = await fetch(API_LATEST, {
54
- signal: signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal,
55
- headers: { Accept: "application/vnd.github+json", "User-Agent": "wrongstack-cli" }
56
- });
57
- if (!res.ok) {
58
- throw new FetchError({
59
- message: `GitHub releases responded ${res.status}`,
60
- status: res.status,
61
- context: { op: "checkForUpdate", registry: "github-releases", url: API_LATEST }
62
- });
63
- }
64
- const data = await res.json();
65
- if (typeof data.tag_name !== "string") throw new Error("Latest release has no tag");
66
- const assets = Array.isArray(data.assets) ? data.assets.filter(
67
- (a) => typeof a?.name === "string" && typeof a?.browser_download_url === "string"
68
- ) : [];
69
- return { version: data.tag_name.replace(/^v/, ""), assets };
70
- }
71
- async function fetchLatestStandaloneVersion(timeoutMs = 3e3, signal) {
72
- return (await fetchLatestRelease(timeoutMs, signal)).version;
73
- }
74
- function parseSha256Sums(text) {
75
- const sums = /* @__PURE__ */ new Map();
76
- for (const line of text.split(/\r?\n/)) {
77
- const match = line.trim().match(/^([0-9a-f]{64})\s+\*?(.+)$/i);
78
- if (match?.[1] && match[2]) {
79
- const name = match[2].trim();
80
- if (sums.has(name)) throw new Error(`Duplicate SHA256SUMS entry: ${name}`);
81
- sums.set(name, match[1].toLowerCase());
82
- }
83
- }
84
- return sums;
85
- }
86
- function replaceExecutable(target, bytes, platform = process.platform) {
87
- const staged = `${target}.new-${process.pid}`;
88
- fs.writeFileSync(staged, bytes, { mode: 493 });
89
- try {
90
- if (platform === "win32") {
91
- const aside = `${target}.old`;
92
- fs.rmSync(aside, { force: true });
93
- fs.renameSync(target, aside);
94
- try {
95
- fs.renameSync(staged, target);
96
- } catch (error) {
97
- fs.renameSync(aside, target);
98
- throw error;
99
- }
100
- } else {
101
- fs.renameSync(staged, target);
102
- }
103
- } finally {
104
- fs.rmSync(staged, { force: true });
105
- }
106
- }
107
- async function updateStandaloneBinary(options) {
108
- const { renderer } = options;
109
- if (!STANDALONE_TARGET) {
110
- renderer.write("Update failed: this executable does not record its build target.\n");
111
- return 1;
112
- }
113
- const assetName = standaloneAssetName(STANDALONE_TARGET);
114
- try {
115
- const release = await fetchLatestRelease(15e3);
116
- const asset = release.assets.find((a) => a.name === assetName);
117
- const sumsAsset = release.assets.find((a) => a.name === "SHA256SUMS");
118
- if (!asset || !sumsAsset) {
119
- renderer.write(`Update failed: release v${release.version} has no ${assetName} build.
120
- `);
121
- return 1;
122
- }
123
- renderer.write(`Updating wrongstack from v${options.current} to v${release.version}...
124
- `);
125
- renderer.write(`Downloading ${assetName}
126
- `);
127
- const [bytes, sumsText] = await Promise.all([
128
- downloadReleaseAsset(asset.browser_download_url, 6e5, MAX_BINARY_BYTES),
129
- downloadReleaseAsset(sumsAsset.browser_download_url, 3e4, MAX_CHECKSUM_BYTES).then(
130
- (b) => b.toString("utf8")
131
- )
132
- ]);
133
- const expected = parseSha256Sums(sumsText).get(assetName);
134
- const actual = createHash("sha256").update(bytes).digest("hex");
135
- if (!expected || expected !== actual) {
136
- renderer.write("Update failed: checksum does not match the release SHA256SUMS.\n");
137
- return 1;
138
- }
139
- const executable = fs.realpathSync(process.execPath);
140
- replaceExecutable(executable, bytes);
141
- renderer.write(
142
- `
143
- Updated ${path.basename(executable)} to v${release.version}. Restart wrongstack to use it.
144
- `
145
- );
146
- return 0;
147
- } catch (err) {
148
- const msg = err instanceof Error ? err.message : String(err);
149
- const permission = /EACCES|EPERM/.test(msg) ? "\nThe executable is not writable by this user; rerun with the permissions it was installed with." : "";
150
- renderer.write(`
151
- Update failed: ${msg}${permission}
152
- `);
153
- return 1;
154
- }
155
- }
156
- export {
157
- RELEASES_REPO,
158
- fetchLatestStandaloneVersion,
159
- parseSha256Sums,
160
- replaceExecutable,
161
- standaloneAssetName,
162
- updateStandaloneBinary
163
- };
164
- //# sourceMappingURL=standalone-update-MW47J3AK.js.map
@@ -1,10 +0,0 @@
1
- import {
2
- helpCmd,
3
- versionCmd
4
- } from "./chunk-2BKFWIER.js";
5
- import "./chunk-YBUCXXYZ.js";
6
- export {
7
- helpCmd,
8
- versionCmd
9
- };
10
- //# sourceMappingURL=version-help-WZ623NWM.js.map