@wrongstack/cli 0.308.7 → 0.309.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.
- package/dist/{acp-5ZLGFHWP.js → acp-7NWCC2GO.js} +3 -3
- package/dist/{auth-WOKC2RVG.js → auth-GZ2FK5KR.js} +3 -3
- package/dist/auth-menu/loopback-server.d.ts +0 -12
- package/dist/{chunk-JQURRYU4.js → chunk-UINEP3E7.js} +2 -2
- package/dist/{chunk-DOJLAULS.js → chunk-WOTGMHAH.js} +36 -26
- package/dist/{chunk-SSSJQVUY.js → chunk-XQ6FI2K6.js} +14 -1
- package/dist/{chunk-7JOMY3HO.js → chunk-ZRZ54GVL.js} +2 -2
- package/dist/{cli-main-L3T4KJKU.js → cli-main-XGDOIPN5.js} +952 -618
- package/dist/diff-renderer.d.ts +17 -0
- package/dist/{execution-6HIKTAUB.js → execution-TYUXABWI.js} +51 -2
- package/dist/index.js +6 -6
- package/dist/{providers-models-4FAKM2WO.js → providers-models-D23WUD74.js} +2 -2
- package/dist/slash-commands/dev.d.ts +50 -0
- package/dist/slash-commands/effort.d.ts +33 -0
- package/dist/wiring/cli-execute-builder.d.ts +110 -85
- package/dist/wiring/cli-slash-commands-setup.d.ts +102 -72
- package/package.json +25 -25
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
loadCachedAcpRegistry,
|
|
4
4
|
refreshAcpRegistry,
|
|
5
5
|
setupProvider
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-UINEP3E7.js";
|
|
7
|
+
import "./chunk-XQ6FI2K6.js";
|
|
8
8
|
import "./chunk-SZ42FYPT.js";
|
|
9
9
|
import "./chunk-7OCVIDC7.js";
|
|
10
10
|
|
|
@@ -911,4 +911,4 @@ ${renderAcpBenchText(result)}
|
|
|
911
911
|
export {
|
|
912
912
|
acpCmd
|
|
913
913
|
};
|
|
914
|
-
//# sourceMappingURL=acp-
|
|
914
|
+
//# sourceMappingURL=acp-7NWCC2GO.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
runOAuthLoginKind,
|
|
14
14
|
runOAuthLoginMenu,
|
|
15
15
|
validateFamily
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZRZ54GVL.js";
|
|
17
17
|
import {
|
|
18
18
|
restoreFlags
|
|
19
19
|
} from "./chunk-CSAPOCBP.js";
|
|
@@ -29,7 +29,7 @@ import "./chunk-VUVOMXWP.js";
|
|
|
29
29
|
import {
|
|
30
30
|
activeProfileConfigPath
|
|
31
31
|
} from "./chunk-YMXXOOFN.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-XQ6FI2K6.js";
|
|
33
33
|
import {
|
|
34
34
|
loadConfigProviders,
|
|
35
35
|
maskedKey,
|
|
@@ -596,4 +596,4 @@ async function runAuthRemove(deps, providerId) {
|
|
|
596
596
|
export {
|
|
597
597
|
authCmd
|
|
598
598
|
};
|
|
599
|
-
//# sourceMappingURL=auth-
|
|
599
|
+
//# sourceMappingURL=auth-GZ2FK5KR.js.map
|
|
@@ -31,18 +31,6 @@ export interface LoopbackCallback {
|
|
|
31
31
|
/** The OAuth state parameter from the callback (validated against expected). */
|
|
32
32
|
state: string;
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Open a URL in the user's default browser. Best-effort — never throws.
|
|
36
|
-
*
|
|
37
|
-
* - Windows: `cmd /c start "" <url>`
|
|
38
|
-
* - macOS: `open <url>`
|
|
39
|
-
* - Linux: `xdg-open <url>`
|
|
40
|
-
*
|
|
41
|
-
* Not `detached`: the CLI flows wait on the loopback callback in the
|
|
42
|
-
* foreground, so the opener is a short-lived handoff. (The WebUI server's
|
|
43
|
-
* `openBrowser` is deliberately different — it detaches and registers the pid
|
|
44
|
-
* as protected because it launches a browser the session must outlive.)
|
|
45
|
-
*/
|
|
46
34
|
export declare function openBrowser(url: string): void;
|
|
47
35
|
/**
|
|
48
36
|
* Start a loopback HTTP server for the OAuth authorization-code callback.
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
fallbackCodexProviderModels,
|
|
3
3
|
filterCurrentCodexModelIds,
|
|
4
4
|
isCodexCatalogModel
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XQ6FI2K6.js";
|
|
6
6
|
|
|
7
7
|
// src/acp-registry-cache.ts
|
|
8
8
|
import * as fs from "node:fs/promises";
|
|
@@ -214,4 +214,4 @@ export {
|
|
|
214
214
|
setupProvider,
|
|
215
215
|
createGracefulShutdown
|
|
216
216
|
};
|
|
217
|
-
//# sourceMappingURL=chunk-
|
|
217
|
+
//# sourceMappingURL=chunk-UINEP3E7.js.map
|
|
@@ -4,20 +4,27 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// src/permission-prompt.ts
|
|
6
6
|
import { alwaysAllowUnavailableReason } from "@wrongstack/core/security";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
color as color2,
|
|
9
|
+
sanitizeTerminalPreview,
|
|
10
|
+
sanitizeTerminalText as sanitizeTerminalText2,
|
|
11
|
+
truncate,
|
|
12
|
+
unifiedDiff,
|
|
13
|
+
writeOut
|
|
14
|
+
} from "@wrongstack/core/utils";
|
|
8
15
|
|
|
9
16
|
// src/diff-renderer.ts
|
|
10
|
-
import { color } from "@wrongstack/core/utils";
|
|
17
|
+
import { color, sanitizeTerminalText } from "@wrongstack/core/utils";
|
|
18
|
+
function diffLineStyle(line) {
|
|
19
|
+
if (line.startsWith("+++") || line.startsWith("---")) return color.bold(line);
|
|
20
|
+
if (line.startsWith("@@")) return color.cyan(line);
|
|
21
|
+
if (line.startsWith("+")) return color.green(line);
|
|
22
|
+
if (line.startsWith("-")) return color.red(line);
|
|
23
|
+
return color.dim(line);
|
|
24
|
+
}
|
|
11
25
|
function renderDiff(diff) {
|
|
12
26
|
if (!diff) return "";
|
|
13
|
-
|
|
14
|
-
return lines.map((line) => {
|
|
15
|
-
if (line.startsWith("+++") || line.startsWith("---")) return color.bold(line);
|
|
16
|
-
if (line.startsWith("@@")) return color.cyan(line);
|
|
17
|
-
if (line.startsWith("+")) return color.green(line);
|
|
18
|
-
if (line.startsWith("-")) return color.red(line);
|
|
19
|
-
return color.dim(line);
|
|
20
|
-
}).join("\n");
|
|
27
|
+
return sanitizeTerminalText(diff).split("\n").map(diffLineStyle).join("\n");
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
// src/permission-prompt.ts
|
|
@@ -46,7 +53,7 @@ ${theme.warn("\u26A0 APPROVAL REQUIRED")} ${theme.primary("\u2502")} ${theme.bol
|
|
|
46
53
|
...noAlwaysReason ? [] : [{ key: "a", label: "always", value: "always" }],
|
|
47
54
|
{ key: "d", label: "deny", value: "deny" }
|
|
48
55
|
];
|
|
49
|
-
const alwaysHint = noAlwaysReason ? "" : ` ${theme.bold("[a]")}lways allow (${suggestedPattern})`;
|
|
56
|
+
const alwaysHint = noAlwaysReason ? "" : ` ${theme.bold("[a]")}lways allow (${sanitizeTerminalText2(suggestedPattern)})`;
|
|
50
57
|
const answer = await reader.readKey(
|
|
51
58
|
`${theme.bold("[y]")}es ${theme.bold("[n]")}o${alwaysHint} ${theme.bold("[d]")}eny: `,
|
|
52
59
|
options
|
|
@@ -64,17 +71,22 @@ function makeConfirmAwaiter(reader) {
|
|
|
64
71
|
function stringifyInput(input) {
|
|
65
72
|
if (!input || typeof input !== "object") return "";
|
|
66
73
|
const obj = input;
|
|
67
|
-
return Object.entries(obj).filter(([k]) => k !== "content" && k !== "new_string").map(([k, v]) => `${k}: ${truncate(JSON.stringify(v), 80)}`).join(" ");
|
|
74
|
+
return Object.entries(obj).filter(([k]) => k !== "content" && k !== "new_string").map(([k, v]) => `${k}: ${truncate(sanitizeTerminalText2(JSON.stringify(v)), 80)}`).join(" ");
|
|
68
75
|
}
|
|
69
76
|
var PREVIEW_MAX_LINES = 40;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
)
|
|
77
|
+
var PREVIEW_MAX_CHARS = 8e3;
|
|
78
|
+
function clipPreview(body, decorate = (l) => l) {
|
|
79
|
+
const safe = sanitizeTerminalText2(body);
|
|
80
|
+
const { text, truncated } = sanitizeTerminalPreview(body, {
|
|
81
|
+
maxLines: PREVIEW_MAX_LINES,
|
|
82
|
+
maxChars: PREVIEW_MAX_CHARS
|
|
83
|
+
});
|
|
84
|
+
const rendered = text.split("\n").map(decorate).join("\n");
|
|
85
|
+
if (!truncated) return rendered;
|
|
86
|
+
const hiddenLines = safe.split("\n").length - text.split("\n").length;
|
|
87
|
+
const detail = hiddenLines > 0 ? `${hiddenLines} more line${hiddenLines === 1 ? "" : "s"} not shown` : `${safe.length - text.length} more characters not shown`;
|
|
88
|
+
return `${rendered}
|
|
89
|
+
${color2.dim(`\u2026 ${detail} \u2014 review the file before approving`)}`;
|
|
78
90
|
}
|
|
79
91
|
function renderPayloadPreview(input) {
|
|
80
92
|
if (!input || typeof input !== "object") return "";
|
|
@@ -87,17 +99,15 @@ function renderPayloadPreview(input) {
|
|
|
87
99
|
toFile: "after",
|
|
88
100
|
context: 2
|
|
89
101
|
});
|
|
90
|
-
return diff2 ? clipPreview(
|
|
102
|
+
return diff2 ? clipPreview(diff2, diffLineStyle) : color2.dim("(replacement is identical)");
|
|
91
103
|
}
|
|
92
104
|
const content = obj["content"];
|
|
93
105
|
if (typeof content === "string") {
|
|
94
106
|
if (content === "") return color2.dim("(writes an empty file)");
|
|
95
|
-
return clipPreview(
|
|
96
|
-
content.split("\n").map((line) => color2.dim("\u2502 ") + line).join("\n")
|
|
97
|
-
);
|
|
107
|
+
return clipPreview(content, (line) => color2.dim("\u2502 ") + line);
|
|
98
108
|
}
|
|
99
109
|
const diff = obj["diff"];
|
|
100
|
-
return typeof diff === "string" && diff ? clipPreview(
|
|
110
|
+
return typeof diff === "string" && diff ? clipPreview(diff, diffLineStyle) : "";
|
|
101
111
|
}
|
|
102
112
|
|
|
103
113
|
// src/boot/simpleui-full-auto.ts
|
|
@@ -473,4 +483,4 @@ export {
|
|
|
473
483
|
detectProjectFacts,
|
|
474
484
|
renderAgentsTemplate
|
|
475
485
|
};
|
|
476
|
-
//# sourceMappingURL=chunk-
|
|
486
|
+
//# sourceMappingURL=chunk-WOTGMHAH.js.map
|
|
@@ -32,7 +32,20 @@ import {
|
|
|
32
32
|
startLoopbackServer as startSharedLoopbackServer
|
|
33
33
|
} from "@wrongstack/providers/oauth";
|
|
34
34
|
import { callbackHtml } from "@wrongstack/providers/oauth";
|
|
35
|
+
var URL_METACHAR_REGEX = /[&|;<>(){}^"'`%\n\r\0]/;
|
|
36
|
+
function isSafeBrowserUrl(url) {
|
|
37
|
+
if (URL_METACHAR_REGEX.test(url)) return false;
|
|
38
|
+
try {
|
|
39
|
+
const parsed = new URL(url);
|
|
40
|
+
return parsed.protocol === "http:" || parsed.protocol === "https:";
|
|
41
|
+
} catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
35
45
|
function openBrowser(url) {
|
|
46
|
+
if (!isSafeBrowserUrl(url)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
36
49
|
try {
|
|
37
50
|
const platform = process.platform;
|
|
38
51
|
const { command, args } = platform === "win32" ? { command: "cmd", args: ["/c", "start", "", url] } : platform === "darwin" ? { command: "open", args: [url] } : { command: "xdg-open", args: [url] };
|
|
@@ -246,4 +259,4 @@ export {
|
|
|
246
259
|
filterCurrentCodexModelIds,
|
|
247
260
|
isCodexCatalogModel
|
|
248
261
|
};
|
|
249
|
-
//# sourceMappingURL=chunk-
|
|
262
|
+
//# sourceMappingURL=chunk-XQ6FI2K6.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
openBrowser,
|
|
7
7
|
runCodexOAuthLogin,
|
|
8
8
|
startLoopbackServer
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XQ6FI2K6.js";
|
|
10
10
|
import {
|
|
11
11
|
activeLabel,
|
|
12
12
|
loadConfigProviders,
|
|
@@ -1374,4 +1374,4 @@ export {
|
|
|
1374
1374
|
addCustomProvider,
|
|
1375
1375
|
addKeyForProvider
|
|
1376
1376
|
};
|
|
1377
|
-
//# sourceMappingURL=chunk-
|
|
1377
|
+
//# sourceMappingURL=chunk-ZRZ54GVL.js.map
|