@wirecat/drive-cli 0.57.0 → 0.59.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.
- package/dist/bin/drive.js +6 -2
- package/dist/bin/drive.js.map +1 -1
- package/dist/bundle/{all-profiles-7LSZ3CC3.js → all-profiles-CVISDGMF.js} +14 -9
- package/dist/bundle/{anthropic-3QRM4QXB.js → anthropic-WLNQC23G.js} +11 -7
- package/dist/bundle/{app-server-WWNMUHID.js → app-server-P2VOONXF.js} +61 -53
- package/dist/bundle/{bun-NIIYUR5F.js → bun-CDFBNTKV.js} +2 -2
- package/dist/bundle/{bun-sqlite-GSLSN3OT.js → bun-sqlite-MNZICITP.js} +8 -4
- package/dist/bundle/chunk-2AXA5SKP.js +23 -0
- package/dist/bundle/{chunk-EFEI724Z.js → chunk-36B7AIGP.js} +1 -1
- package/dist/bundle/{chunk-Q3TMNETS.js → chunk-3KJTJDDT.js} +52 -39
- package/dist/bundle/{chunk-4F2VRJZE.js → chunk-3KNZADHJ.js} +5080 -626
- package/dist/bundle/{chunk-GIQFBXQN.js → chunk-3U22QTU6.js} +12 -125
- package/dist/bundle/chunk-3VSUT6BD.js +35 -0
- package/dist/bundle/{chunk-U2RSVKR5.js → chunk-5C7K6XIT.js} +1 -1
- package/dist/bundle/{chunk-6CFSDU56.js → chunk-6C6255U6.js} +16 -14
- package/dist/bundle/{chunk-EE7R457T.js → chunk-6CQO2FIN.js} +1569 -739
- package/dist/bundle/{chunk-KHNDZNQA.js → chunk-7QTVIZII.js} +5410 -3002
- package/dist/bundle/{chunk-HNUSPNUQ.js → chunk-A6EG7ZDS.js} +13 -13
- package/dist/bundle/{chunk-WBYCUBYM.js → chunk-A6SLYOP2.js} +49 -42
- package/dist/bundle/{chunk-TR5656OS.js → chunk-AD62XJKO.js} +162 -106
- package/dist/bundle/{chunk-TKVSJV5P.js → chunk-B5GBJ35N.js} +6 -4
- package/dist/bundle/{chunk-LSSIVBQI.js → chunk-BSGOM3BD.js} +1 -1
- package/dist/bundle/{chunk-XGNADVIA.js → chunk-CBM2XAEZ.js} +28 -229
- package/dist/bundle/{chunk-OYNSFQ7K.js → chunk-D72URWJE.js} +1 -39
- package/dist/bundle/{chunk-L4BBK7UX.js → chunk-DI5Z4SH5.js} +5 -3
- package/dist/bundle/chunk-EBLA7GXY.js +45 -0
- package/dist/bundle/{chunk-4UQLL6RJ.js → chunk-EHEZSV6I.js} +11 -88
- package/dist/bundle/{chunk-6ZA4NR5H.js → chunk-EORMZCVF.js} +3 -3
- package/dist/bundle/{chunk-W5FOPSJZ.js → chunk-EVETU3TF.js} +10 -8
- package/dist/bundle/{chunk-TZHCS5MG.js → chunk-F3FOL42A.js} +2 -2
- package/dist/bundle/{chunk-2QLLKDE5.js → chunk-FICVPYE4.js} +206 -73
- package/dist/bundle/{chunk-AKPFH3KC.js → chunk-FVQCM7IQ.js} +1 -1
- package/dist/bundle/{chunk-ADLS6FVG.js → chunk-FXBHOCJK.js} +1 -1
- package/dist/bundle/{chunk-WAVJWGUC.js → chunk-GI5JBGXH.js} +4611 -1530
- package/dist/bundle/{chunk-SRNXTXJN.js → chunk-GJ4ZCIOP.js} +3 -3
- package/dist/bundle/{chunk-GKHUHRSL.js → chunk-GT5KTGCN.js} +4 -4
- package/dist/bundle/{chunk-WJOKTIOJ.js → chunk-H2BKXPBL.js} +2 -2
- package/dist/bundle/chunk-HIOJRPCT.js +93 -0
- package/dist/bundle/chunk-HIP43OGZ.js +34 -0
- package/dist/bundle/{chunk-2ULJW5BA.js → chunk-HMZAMHKN.js} +2 -2
- package/dist/bundle/{chunk-64E6QXXQ.js → chunk-HWLLVLAB.js} +10 -10
- package/dist/bundle/{chunk-373WJIHE.js → chunk-IADOBOKB.js} +2 -2
- package/dist/bundle/{chunk-B3TPS7BW.js → chunk-IBZ3IBO4.js} +9 -7
- package/dist/bundle/{chunk-QAT6UXZZ.js → chunk-IGF6EXBR.js} +53 -48
- package/dist/bundle/{chunk-KYNTSA6K.js → chunk-II7LST64.js} +5 -5
- package/dist/bundle/{chunk-JLKNUFL2.js → chunk-IIP43FQJ.js} +2 -2
- package/dist/bundle/{chunk-ELIYJXIY.js → chunk-JSDVK3JA.js} +2 -2
- package/dist/bundle/{chunk-UKMFPBAO.js → chunk-JW2CVCUH.js} +4 -4
- package/dist/bundle/{chunk-O5KDIVGE.js → chunk-K4LXGZTE.js} +23 -21
- package/dist/bundle/{chunk-RB674T6L.js → chunk-KFZUODXB.js} +76 -20
- package/dist/bundle/chunk-KPRGTTJH.js +34 -0
- package/dist/bundle/{chunk-XJVK7ETL.js → chunk-L5SE2XZP.js} +23 -15
- package/dist/bundle/{chunk-OOR6PEHV.js → chunk-LJ7E4HLQ.js} +1 -1
- package/dist/bundle/{chunk-VTJF2L5E.js → chunk-LPHMAQJQ.js} +16 -16
- package/dist/bundle/{chunk-566W4Q6L.js → chunk-M6I2SQN7.js} +4 -4
- package/dist/bundle/{chunk-NLLWLCUZ.js → chunk-MEAPA4EZ.js} +2 -2
- package/dist/bundle/{chunk-J2HGHSLX.js → chunk-MKCNUI72.js} +4 -4
- package/dist/bundle/{chunk-CD736BG3.js → chunk-MUUHUHWC.js} +2 -1
- package/dist/bundle/{chunk-AHBUTDS7.js → chunk-OKXSTWKW.js} +8 -8
- package/dist/bundle/{chunk-W6FYYQ2J.js → chunk-OMMEQJOB.js} +3 -3
- package/dist/bundle/{chunk-EFX6FIDM.js → chunk-OZH4ALTI.js} +1 -1
- package/dist/bundle/{chunk-KM4Y55ZE.js → chunk-P3ZTW2ZM.js} +7 -7
- package/dist/bundle/{chunk-5KNIVHP6.js → chunk-P7WPYKSB.js} +7 -20
- package/dist/bundle/{chunk-RAEKC6TV.js → chunk-PAEVBAM3.js} +9 -42
- package/dist/bundle/{chunk-LBFFI6FE.js → chunk-PGKIOSN3.js} +9 -7
- package/dist/bundle/{chunk-WJPVGXKA.js → chunk-QTM7USFA.js} +8 -13
- package/dist/bundle/{chunk-EN7OZ5JH.js → chunk-TFH5X46A.js} +37 -22
- package/dist/bundle/{chunk-OZJMZSFB.js → chunk-TI55J3BA.js} +6 -4
- package/dist/bundle/{chunk-R5GJZPRF.js → chunk-TJXPJ3A5.js} +572 -366
- package/dist/bundle/chunk-UQPKAY6I.js +106 -0
- package/dist/bundle/{chunk-JUKVJ7M2.js → chunk-UWVNRPT7.js} +56 -40
- package/dist/bundle/chunk-V36RIXFA.js +201 -0
- package/dist/bundle/{chunk-JIGMCW4C.js → chunk-V42KAPU3.js} +6 -6
- package/dist/bundle/{chunk-7SNS443B.js → chunk-VT6GZAF4.js} +35 -35
- package/dist/bundle/{chunk-ISK4K7UE.js → chunk-VVCZS42A.js} +1 -1
- package/dist/bundle/chunk-W62CON5K.js +166 -0
- package/dist/bundle/{chunk-YZ6SYLDC.js → chunk-XCOCPXCM.js} +2 -2
- package/dist/bundle/{chunk-G34Y5RAC.js → chunk-YADXWQHV.js} +29 -29
- package/dist/bundle/{chunk-AL7MY7MW.js → chunk-YU3PTU3D.js} +1 -1
- package/dist/bundle/{chunk-IJ2S53WJ.js → chunk-YV4ABH6J.js} +7 -7
- package/dist/bundle/{chunk-B64EY2SC.js → chunk-ZSMCJKGP.js} +42 -41
- package/dist/bundle/chunk-ZYCLPJ7U.js +46 -0
- package/dist/bundle/command-contract-LQDNHZJU.js +39 -0
- package/dist/bundle/{decode-5MHMPYKE.js → decode-XTOMXMGN.js} +10 -6
- package/dist/bundle/dispatch-T6TW2JJB.js +412 -0
- package/dist/bundle/drive.js +40 -22
- package/dist/bundle/{echarts-CLB22SZS.js → echarts-RKKIOYVV.js} +2 -2
- package/dist/bundle/{embed-TF66ODAR.js → embed-STHKKA6G.js} +9 -5
- package/dist/bundle/{embedder-EDWOIAC2.js → embedder-3XZEWHRO.js} +14 -10
- package/dist/bundle/entry-CNOYSSSD.js +22 -0
- package/dist/bundle/failure-DNQYXP2T.js +26 -0
- package/dist/bundle/first-run-F2SI24PK.js +30 -0
- package/dist/bundle/first-screen-TYYF6VXY.js +37 -0
- package/dist/bundle/{google-A4F2WFO4.js → google-BYNSAIQI.js} +13 -9
- package/dist/bundle/{google-api-ZXGQOJUI.js → google-api-4VTZH7OP.js} +59 -52
- package/dist/bundle/grants-EUQXSICG.js +105 -0
- package/dist/bundle/{identity-4IO7WGG4.js → identity-ARDPFYV5.js} +6 -4
- package/dist/bundle/{instructions-BXZZNAMS.js → instructions-N3OH5X2Y.js} +1 -1
- package/dist/bundle/{login-A4QHJ5DA.js → login-4VQEC7VI.js} +65 -58
- package/dist/bundle/{mcp-VVMPUDSL.js → mcp-WBHKX5E3.js} +5 -3
- package/dist/bundle/{node-P4E63KXA.js → node-KM3CUABH.js} +9 -9
- package/dist/bundle/{node-R6ZNQ3NT.js → node-YU5JBNAA.js} +2 -2
- package/dist/bundle/{node-sqlite-AFQTE4XZ.js → node-sqlite-3C6PSBIW.js} +14 -4
- package/dist/bundle/oauth-D6NJFPYU.js +22 -0
- package/dist/bundle/{open-WJCRBIP7.js → open-M2V2VYXO.js} +8 -3
- package/dist/bundle/{openai-3TIBDWZA.js → openai-ST2IWNUX.js} +18 -14
- package/dist/bundle/{process-P36JP33R.js → process-PYNNBBTV.js} +1 -1
- package/dist/bundle/{program-AHZH65IT.js → program-Q4VWV2MR.js} +193 -147
- package/dist/bundle/prompt-MFIOJMAF.js +17 -0
- package/dist/bundle/{reasons-VHCVYH54.js → reasons-LOQ5J73F.js} +5 -3
- package/dist/bundle/{recognize-4EAKIMON.js → recognize-FBLMWXNE.js} +7 -3
- package/dist/bundle/{remote-HX3JP4EH.js → remote-XC3OXE4T.js} +10 -6
- package/dist/bundle/{rerank-BW3A4PUU.js → rerank-2XMKKF4S.js} +10 -6
- package/dist/bundle/{serve-YYOOLIBS.js → serve-Q2BQHNZB.js} +15 -10
- package/dist/bundle/{server-G6XTEEFI.js → server-42HPV3AH.js} +46 -39
- package/dist/bundle/server-EWZYN323.js +70 -0
- package/dist/bundle/{services-OAPILZOW.js → services-WU22S2MU.js} +100 -26
- package/dist/bundle/{sqlite-runtime-GTXDK4PE.js → sqlite-runtime-CSO6K6B2.js} +9 -4
- package/dist/bundle/start-TZWKM4AH.js +138 -0
- package/dist/bundle/{state-XG335LGZ.js → state-FLUT7U7R.js} +9 -5
- package/dist/bundle/{store-N53SJOPS.js → store-HDWMJ44E.js} +42 -17
- package/dist/bundle/{store-7KOXJNQP.js → store-TG6622NG.js} +20 -12
- package/dist/bundle/store-maintenance-command-RHWRUREJ.js +60 -0
- package/dist/bundle/tokens-TXYURU4S.js +103 -0
- package/dist/commands/documents.d.ts +1 -0
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +14 -1
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/knowledge.d.ts +4 -0
- package/dist/commands/knowledge.d.ts.map +1 -1
- package/dist/commands/knowledge.js +8 -7
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/contract-overrides.js +5 -5
- package/dist/contract-overrides.js.map +1 -1
- package/dist/knowledge-query.d.ts +2 -0
- package/dist/knowledge-query.d.ts.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +8 -3
- package/dist/program.js.map +1 -1
- package/dist/provider-json.d.ts +2 -0
- package/dist/provider-json.d.ts.map +1 -1
- package/dist/provider-json.js +13 -0
- package/dist/provider-json.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +1 -0
- package/dist/reasons.js.map +1 -1
- package/dist/store.d.ts +2 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +9 -0
- package/dist/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -4
- package/skills/drive-cli/SKILL.md +2 -1
- package/dist/bundle/chunk-3BXSLNWW.js +0 -3607
- package/dist/bundle/chunk-CGCQNYB3.js +0 -18
- package/dist/bundle/command-contract-XIACCAZL.js +0 -35
- package/dist/bundle/entry-CWYCQ53A.js +0 -17
- package/dist/bundle/first-run-YIH7EHJI.js +0 -24
- package/dist/bundle/first-screen-THH3XD5Y.js +0 -33
- package/dist/bundle/grants-3Z7DG3W3.js +0 -98
- package/dist/bundle/oauth-46XBJBML.js +0 -18
- package/dist/bundle/prompt-FFGBIT4A.js +0 -13
- package/dist/bundle/server-YKYEUIJT.js +0 -63
- package/dist/bundle/store-maintenance-command-W3TI52X2.js +0 -52
- package/dist/bundle/tokens-P7TEHKDD.js +0 -96
- /package/dist/bundle/{chunk-HPXYN7F3.js → chunk-LK2E2ELG.js} +0 -0
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
errorObjectOf
|
|
5
|
+
} from "./chunk-V36RIXFA.js";
|
|
6
|
+
import {
|
|
7
|
+
visibleControls
|
|
8
|
+
} from "./chunk-HIP43OGZ.js";
|
|
9
|
+
import {
|
|
9
10
|
LOG_ATTRIBUTE_KEYS,
|
|
10
|
-
|
|
11
|
+
isContentKey
|
|
12
|
+
} from "./chunk-UQPKAY6I.js";
|
|
13
|
+
import {
|
|
11
14
|
getDotPath,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./chunk-GIQFBXQN.js";
|
|
15
|
+
safeParse
|
|
16
|
+
} from "./chunk-3U22QTU6.js";
|
|
17
|
+
import {
|
|
18
|
+
CliError
|
|
19
|
+
} from "./chunk-EBLA7GXY.js";
|
|
18
20
|
import {
|
|
19
21
|
__commonJS,
|
|
20
22
|
__name,
|
|
@@ -1887,198 +1889,7 @@ var require_cli_table3 = __commonJS({
|
|
|
1887
1889
|
}
|
|
1888
1890
|
});
|
|
1889
1891
|
|
|
1890
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1891
|
-
var EXIT_CODES = {
|
|
1892
|
-
validation_error: 2,
|
|
1893
|
-
configuration_error: 3,
|
|
1894
|
-
authentication_error: 4,
|
|
1895
|
-
permission_error: 5,
|
|
1896
|
-
not_found: 6,
|
|
1897
|
-
confirmation_required: 7,
|
|
1898
|
-
rate_limited: 8,
|
|
1899
|
-
timeout: 9,
|
|
1900
|
-
network_error: 10,
|
|
1901
|
-
provider_error: 11,
|
|
1902
|
-
provider_unavailable: 12,
|
|
1903
|
-
invalid_response: 13,
|
|
1904
|
-
outcome_unknown: 14,
|
|
1905
|
-
cancelled: 130
|
|
1906
|
-
};
|
|
1907
|
-
var exitCodeFor = /* @__PURE__ */ __name((code) => EXIT_CODES[code], "exitCodeFor");
|
|
1908
|
-
var GENERIC_FAILURE = 1;
|
|
1909
|
-
|
|
1910
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
|
|
1911
|
-
var CONTROL = (
|
|
1912
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
|
|
1913
|
-
/[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
|
|
1914
|
-
);
|
|
1915
|
-
var SUBDIVISION_FLAG = /\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}/gu;
|
|
1916
|
-
var LINE_BREAKS = /[\t\n\u2028\u2029]/g;
|
|
1917
|
-
var escaped = /* @__PURE__ */ __name((c) => {
|
|
1918
|
-
const code = c.codePointAt(0) ?? 0;
|
|
1919
|
-
if (code > 65535)
|
|
1920
|
-
return `\\u{${code.toString(16)}}`;
|
|
1921
|
-
return code > 255 ? `\\u${code.toString(16).padStart(4, "0")}` : `\\x${code.toString(16).padStart(2, "0")}`;
|
|
1922
|
-
}, "escaped");
|
|
1923
|
-
var visibleControls = /* @__PURE__ */ __name((text) => {
|
|
1924
|
-
let at = 0;
|
|
1925
|
-
let result = "";
|
|
1926
|
-
for (const flag of text.matchAll(SUBDIVISION_FLAG)) {
|
|
1927
|
-
result += text.slice(at, flag.index).replace(CONTROL, escaped) + flag[0];
|
|
1928
|
-
at = flag.index + flag[0].length;
|
|
1929
|
-
}
|
|
1930
|
-
return result + text.slice(at).replace(CONTROL, escaped);
|
|
1931
|
-
}, "visibleControls");
|
|
1932
|
-
var singleLine = /* @__PURE__ */ __name((text) => visibleControls(text).replace(LINE_BREAKS, escaped), "singleLine");
|
|
1933
|
-
|
|
1934
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/failure.js
|
|
1935
|
-
var recognise = /* @__PURE__ */ __name((failure) => {
|
|
1936
|
-
if (isCliError(failure))
|
|
1937
|
-
return failure;
|
|
1938
|
-
if (!(failure instanceof Error) || failure.name !== "CliError")
|
|
1939
|
-
return void 0;
|
|
1940
|
-
const { code, details } = failure;
|
|
1941
|
-
if (!errorCodes.includes(code))
|
|
1942
|
-
return void 0;
|
|
1943
|
-
return {
|
|
1944
|
-
code,
|
|
1945
|
-
message: failure.message,
|
|
1946
|
-
details: typeof details === "object" && details !== null ? details : {}
|
|
1947
|
-
};
|
|
1948
|
-
}, "recognise");
|
|
1949
|
-
var reasonFor = /* @__PURE__ */ __name((code, named, reasons) => reasons.find((entry2) => entry2.reason === named && entry2.code === code) ?? BASE_REASONS.find((entry2) => entry2.reason === named && entry2.code === code) ?? // The first base reason for each code is its fallback.
|
|
1950
|
-
BASE_REASONS.find((entry2) => entry2.code === code), "reasonFor");
|
|
1951
|
-
var nextFor = /* @__PURE__ */ __name((reason, details, context) => {
|
|
1952
|
-
const definition = reason.step ? context.steps?.find((step) => step.id === reason.step) : void 0;
|
|
1953
|
-
if (!definition)
|
|
1954
|
-
return [];
|
|
1955
|
-
const known = new Set(definition.kind === "command" ? definition.args.map((arg) => arg.name) : []);
|
|
1956
|
-
const args = Object.fromEntries(Object.entries(details).filter(([key, value]) => known.has(key) && value !== void 0));
|
|
1957
|
-
try {
|
|
1958
|
-
return [stepOf(definition, { args, ...context.targets ? { targets: context.targets } : {} })];
|
|
1959
|
-
} catch {
|
|
1960
|
-
return [];
|
|
1961
|
-
}
|
|
1962
|
-
}, "nextFor");
|
|
1963
|
-
var TRANSIENT = [
|
|
1964
|
-
"rate_limited",
|
|
1965
|
-
"timeout",
|
|
1966
|
-
"network_error",
|
|
1967
|
-
"provider_unavailable"
|
|
1968
|
-
];
|
|
1969
|
-
var retryOf = /* @__PURE__ */ __name((code, details, effects) => {
|
|
1970
|
-
const transient = details.retryable !== false && (TRANSIENT.includes(code) || code === "provider_error" && details.retryable === true);
|
|
1971
|
-
const safe = code !== "outcome_unknown" && transient && (!writes(effects) || details.sent === false);
|
|
1972
|
-
const after = details.retry_after_ms;
|
|
1973
|
-
return safe && typeof after === "number" && Number.isInteger(after) && after >= 0 ? { safe, after_ms: after } : { safe };
|
|
1974
|
-
}, "retryOf");
|
|
1975
|
-
var errorObjectOf = /* @__PURE__ */ __name((failure, context = {}) => {
|
|
1976
|
-
const reasons = context.reasons ?? [];
|
|
1977
|
-
const recognised = recognise(failure);
|
|
1978
|
-
if (!recognised) {
|
|
1979
|
-
const reason2 = reasonFor(CRASH_CODE, CRASH_REASON, reasons);
|
|
1980
|
-
return {
|
|
1981
|
-
error: {
|
|
1982
|
-
code: CRASH_CODE,
|
|
1983
|
-
reason: reason2.reason,
|
|
1984
|
-
message: reason2.message,
|
|
1985
|
-
retry: { safe: false },
|
|
1986
|
-
...context.runId ? { run_id: context.runId } : {}
|
|
1987
|
-
}
|
|
1988
|
-
};
|
|
1989
|
-
}
|
|
1990
|
-
const { code, message, details } = recognised;
|
|
1991
|
-
const reason = reasonFor(code, details.reason, reasons);
|
|
1992
|
-
const allowed = /* @__PURE__ */ new Set([...COMMON_DETAILS, ...context.details ?? [], ...reason.details]);
|
|
1993
|
-
allowed.delete("cause");
|
|
1994
|
-
const kept = Object.fromEntries(Object.entries(details).filter(([key, value]) => allowed.has(key) && value !== void 0));
|
|
1995
|
-
const next = nextFor(reason, details, context);
|
|
1996
|
-
const runId = context.runId ?? (typeof details.run_id === "string" ? details.run_id : void 0);
|
|
1997
|
-
return {
|
|
1998
|
-
error: {
|
|
1999
|
-
code,
|
|
2000
|
-
reason: reason.reason,
|
|
2001
|
-
message,
|
|
2002
|
-
...typeof details.param === "string" ? { param: details.param } : {},
|
|
2003
|
-
...Object.keys(kept).length > 0 ? { details: kept } : {},
|
|
2004
|
-
...next.length > 0 ? { next } : {},
|
|
2005
|
-
retry: retryOf(code, details, context.effects),
|
|
2006
|
-
...runId ? { run_id: runId } : {}
|
|
2007
|
-
}
|
|
2008
|
-
};
|
|
2009
|
-
}, "errorObjectOf");
|
|
2010
|
-
var exitCodeOfError = /* @__PURE__ */ __name(({ error }) => error.code === CRASH_CODE ? GENERIC_FAILURE : EXIT_CODES[error.code], "exitCodeOfError");
|
|
2011
|
-
var exitCodeOfAnswer = /* @__PURE__ */ __name((meta, partial = false) => {
|
|
2012
|
-
if (meta.complete || partial)
|
|
2013
|
-
return 0;
|
|
2014
|
-
const code = meta.issues?.[0]?.code;
|
|
2015
|
-
return code === void 0 ? GENERIC_FAILURE : EXIT_CODES[code];
|
|
2016
|
-
}, "exitCodeOfAnswer");
|
|
2017
|
-
var kebab = /* @__PURE__ */ __name((name) => name.replaceAll("_", "-"), "kebab");
|
|
2018
|
-
var commandLine = /* @__PURE__ */ __name((cli, step) => [
|
|
2019
|
-
cli,
|
|
2020
|
-
step.command,
|
|
2021
|
-
...Object.entries(step.args).map(([name, value]) => value === true ? `--${kebab(name)}` : `--${kebab(name)} ${JSON.stringify(value)}`)
|
|
2022
|
-
].join(" "), "commandLine");
|
|
2023
|
-
var STACK_FRAMES = 10;
|
|
2024
|
-
var errorRecordOf = /* @__PURE__ */ __name((failure, object2, options) => {
|
|
2025
|
-
const thrown = failure instanceof Error ? failure : void 0;
|
|
2026
|
-
const { cause, ...details } = recognise(failure)?.details ?? {};
|
|
2027
|
-
const stack = thrown?.stack?.split("\n").slice(1, STACK_FRAMES + 1).map((line) => visibleControls(line.trim()));
|
|
2028
|
-
const reason = thrown?.cause ?? cause;
|
|
2029
|
-
return {
|
|
2030
|
-
time: (options.time ?? /* @__PURE__ */ new Date()).toISOString(),
|
|
2031
|
-
severity: "error",
|
|
2032
|
-
body: "command.failed",
|
|
2033
|
-
...object2.error.run_id ? { run_id: object2.error.run_id } : {},
|
|
2034
|
-
command: options.command,
|
|
2035
|
-
attributes: {
|
|
2036
|
-
code: object2.error.code,
|
|
2037
|
-
reason: object2.error.reason,
|
|
2038
|
-
message: object2.error.message,
|
|
2039
|
-
...Object.keys(details).length > 0 ? { details } : {},
|
|
2040
|
-
...thrown ? { name: thrown.name, thrown_message: visibleControls(thrown.message) } : { thrown: String(failure) },
|
|
2041
|
-
...reason === void 0 ? {} : { cause: visibleControls(reason instanceof Error ? reason.message : String(reason)) },
|
|
2042
|
-
...stack && stack.length > 0 ? { stack } : {}
|
|
2043
|
-
},
|
|
2044
|
-
resource: { service: options.service, version: options.version }
|
|
2045
|
-
};
|
|
2046
|
-
}, "errorRecordOf");
|
|
2047
|
-
var renderError = /* @__PURE__ */ __name((object2, options) => {
|
|
2048
|
-
if (!options.interactive)
|
|
2049
|
-
return [JSON.stringify(object2), ...options.record ? [JSON.stringify(options.record)] : []].join("\n");
|
|
2050
|
-
const { message, next, run_id: runId } = object2.error;
|
|
2051
|
-
const step = next?.[0];
|
|
2052
|
-
return [
|
|
2053
|
-
`\u2717 ${visibleControls(message)}`,
|
|
2054
|
-
...step?.kind === "command" ? [`\u2192 ${visibleControls(step.why)}: ${visibleControls(step.line ?? commandLine(options.cli, step))}`] : step ? [`\u2192 ${visibleControls(step.why)}`] : [],
|
|
2055
|
-
...options.record ? [JSON.stringify(options.record, null, 2)] : runId ? [`details: ${options.cli} runs show ${runId}`] : []
|
|
2056
|
-
].join("\n");
|
|
2057
|
-
}, "renderError");
|
|
2058
|
-
var mcpErrorResult = /* @__PURE__ */ __name((object2) => ({
|
|
2059
|
-
content: [{ type: "text", text: JSON.stringify(object2) }],
|
|
2060
|
-
structuredContent: object2,
|
|
2061
|
-
isError: true
|
|
2062
|
-
}), "mcpErrorResult");
|
|
2063
|
-
var catchCrashes = /* @__PURE__ */ __name((options) => {
|
|
2064
|
-
const target = options.target ?? process;
|
|
2065
|
-
const write = options.write ?? ((text) => process.stderr.write(`${text}
|
|
2066
|
-
`));
|
|
2067
|
-
const exit = options.exit ?? ((code) => process.exit(code));
|
|
2068
|
-
const crashed = /* @__PURE__ */ __name((failure) => {
|
|
2069
|
-
const object2 = errorObjectOf(failure, options);
|
|
2070
|
-
write(renderError(object2, { cli: options.cli, interactive: options.interactive }));
|
|
2071
|
-
exit(exitCodeOfError(object2));
|
|
2072
|
-
}, "crashed");
|
|
2073
|
-
target.on("uncaughtException", crashed);
|
|
2074
|
-
target.on("unhandledRejection", crashed);
|
|
2075
|
-
return () => {
|
|
2076
|
-
target.off("uncaughtException", crashed);
|
|
2077
|
-
target.off("unhandledRejection", crashed);
|
|
2078
|
-
};
|
|
2079
|
-
}, "catchCrashes");
|
|
2080
|
-
|
|
2081
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/keyring.js
|
|
1892
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/keyring.js
|
|
2082
1893
|
import { createRequire } from "node:module";
|
|
2083
1894
|
var ENTRY_OPTIONS = { linux: { store: "secret-service" } };
|
|
2084
1895
|
var require2 = createRequire(new URL("keyring.js", import.meta.resolve("@wirecat/cli-base")).href);
|
|
@@ -2098,7 +1909,7 @@ var systemKeyring = {
|
|
|
2098
1909
|
delete: /* @__PURE__ */ __name((service, account) => entry(service, account).deletePassword(), "delete")
|
|
2099
1910
|
};
|
|
2100
1911
|
|
|
2101
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1912
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/paths.js
|
|
2102
1913
|
import { homedir, userInfo } from "node:os";
|
|
2103
1914
|
import { join, posix, win32 } from "node:path";
|
|
2104
1915
|
var PATH_KINDS = ["config", "state", "cache"];
|
|
@@ -2150,11 +1961,11 @@ var homeIsMoved = /* @__PURE__ */ __name(({ env = process.env, platform = proces
|
|
|
2150
1961
|
var isMovedRun = /* @__PURE__ */ __name((options) => pathsAreOverridden(options) || homeIsMoved(options), "isMovedRun");
|
|
2151
1962
|
var configFilePath = /* @__PURE__ */ __name((configDir, fileName = "config.json") => join(configDir, fileName), "configFilePath");
|
|
2152
1963
|
|
|
2153
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1964
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
|
|
2154
1965
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
2155
1966
|
import { join as join3, resolve } from "node:path";
|
|
2156
1967
|
|
|
2157
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1968
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/config.js
|
|
2158
1969
|
import { randomBytes } from "node:crypto";
|
|
2159
1970
|
import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
2160
1971
|
import { dirname, join as join2 } from "node:path";
|
|
@@ -2198,7 +2009,7 @@ var saveConfigFile = /* @__PURE__ */ __name((path, config) => {
|
|
|
2198
2009
|
`, 384);
|
|
2199
2010
|
}, "saveConfigFile");
|
|
2200
2011
|
|
|
2201
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2012
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
|
|
2202
2013
|
var keyringService = /* @__PURE__ */ __name((service, _configDir, _isolated) => service, "keyringService");
|
|
2203
2014
|
var movedRunService = /* @__PURE__ */ __name((service, configDir) => `${service}:${resolve(configDir)}`, "movedRunService");
|
|
2204
2015
|
var warnedRuns = /* @__PURE__ */ new WeakSet();
|
|
@@ -2334,7 +2145,7 @@ var Credentials = class {
|
|
|
2334
2145
|
}
|
|
2335
2146
|
};
|
|
2336
2147
|
|
|
2337
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2148
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/drain.js
|
|
2338
2149
|
var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
|
|
2339
2150
|
if (signal?.aborted)
|
|
2340
2151
|
return Promise.reject(signal.reason);
|
|
@@ -2362,7 +2173,7 @@ var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
|
|
|
2362
2173
|
});
|
|
2363
2174
|
}, "waitForDrain");
|
|
2364
2175
|
|
|
2365
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2176
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/streams.js
|
|
2366
2177
|
var processStreams = {
|
|
2367
2178
|
drain: /* @__PURE__ */ __name(async (signal) => {
|
|
2368
2179
|
await Promise.all([waitForDrain(process.stdout, signal), waitForDrain(process.stderr, signal)]);
|
|
@@ -2391,7 +2202,7 @@ var captureStreams = /* @__PURE__ */ __name(() => {
|
|
|
2391
2202
|
};
|
|
2392
2203
|
}, "captureStreams");
|
|
2393
2204
|
|
|
2394
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2205
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/retry.js
|
|
2395
2206
|
var DEFAULT_RETRY = {
|
|
2396
2207
|
retries: 1,
|
|
2397
2208
|
baseDelayMs: 250,
|
|
@@ -2403,7 +2214,7 @@ var backoffMs = /* @__PURE__ */ __name((attempt, config, random) => {
|
|
|
2403
2214
|
return Math.round(random() * ceiling);
|
|
2404
2215
|
}, "backoffMs");
|
|
2405
2216
|
|
|
2406
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2217
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/result-fields.js
|
|
2407
2218
|
var forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
2408
2219
|
var validate = /* @__PURE__ */ __name((paths) => {
|
|
2409
2220
|
if (paths.length === 0 || paths.length > 128 || paths.some((path) => path.length > 256 || !/^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)*$/.test(path) || path.split(".").some((part) => forbidden.has(part))))
|
|
@@ -2468,7 +2279,7 @@ var projectFields = /* @__PURE__ */ __name((value, fields) => {
|
|
|
2468
2279
|
return project(value, fields);
|
|
2469
2280
|
}, "projectFields");
|
|
2470
2281
|
|
|
2471
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2282
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/batch.js
|
|
2472
2283
|
var BATCH_LIMITS = Object.freeze({
|
|
2473
2284
|
requests: 32,
|
|
2474
2285
|
input_bytes: 262144,
|
|
@@ -2595,7 +2406,7 @@ var runBatch = /* @__PURE__ */ __name(async (requests, options = {}) => {
|
|
|
2595
2406
|
};
|
|
2596
2407
|
}, "runBatch");
|
|
2597
2408
|
|
|
2598
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2409
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/time.js
|
|
2599
2410
|
var abortError = /* @__PURE__ */ __name(() => new DOMException("The operation was aborted.", "AbortError"), "abortError");
|
|
2600
2411
|
var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, reject) => {
|
|
2601
2412
|
if (signal?.aborted) {
|
|
@@ -2609,7 +2420,7 @@ var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, re
|
|
|
2609
2420
|
}, { once: true });
|
|
2610
2421
|
}), "realSleep");
|
|
2611
2422
|
|
|
2612
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2423
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/logging.js
|
|
2613
2424
|
import { appendFileSync } from "node:fs";
|
|
2614
2425
|
var REDACTED_FIELDS = [
|
|
2615
2426
|
"authorization",
|
|
@@ -2704,7 +2515,7 @@ var silent = {
|
|
|
2704
2515
|
}, "error")
|
|
2705
2516
|
};
|
|
2706
2517
|
|
|
2707
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2518
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/pretty.js
|
|
2708
2519
|
var import_cli_table3 = __toESM(require_cli_table3(), 1);
|
|
2709
2520
|
import { styleText } from "node:util";
|
|
2710
2521
|
var renderPretty = /* @__PURE__ */ __name((value, options) => {
|
|
@@ -2778,7 +2589,7 @@ var BORDERLESS = {
|
|
|
2778
2589
|
middle: ""
|
|
2779
2590
|
};
|
|
2780
2591
|
|
|
2781
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2592
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/renderer.js
|
|
2782
2593
|
var createRenderer = /* @__PURE__ */ __name(({ format, color, streams = processStreams, quiet = false }) => {
|
|
2783
2594
|
const mark = /* @__PURE__ */ __name((symbol, message) => format === "pretty" ? `${symbol} ${visibleControls(message)}` : visibleControls(message), "mark");
|
|
2784
2595
|
const say = /* @__PURE__ */ __name((symbol) => (message) => {
|
|
@@ -2816,18 +2627,6 @@ var createRenderer = /* @__PURE__ */ __name(({ format, color, streams = processS
|
|
|
2816
2627
|
}, "createRenderer");
|
|
2817
2628
|
|
|
2818
2629
|
export {
|
|
2819
|
-
EXIT_CODES,
|
|
2820
|
-
exitCodeFor,
|
|
2821
|
-
GENERIC_FAILURE,
|
|
2822
|
-
visibleControls,
|
|
2823
|
-
singleLine,
|
|
2824
|
-
errorObjectOf,
|
|
2825
|
-
exitCodeOfError,
|
|
2826
|
-
exitCodeOfAnswer,
|
|
2827
|
-
errorRecordOf,
|
|
2828
|
-
renderError,
|
|
2829
|
-
mcpErrorResult,
|
|
2830
|
-
catchCrashes,
|
|
2831
2630
|
fieldsOf,
|
|
2832
2631
|
projectFields,
|
|
2833
2632
|
BATCH_LIMITS,
|
|
@@ -527,44 +527,6 @@ var require_cross_spawn = __commonJS({
|
|
|
527
527
|
}
|
|
528
528
|
});
|
|
529
529
|
|
|
530
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
|
|
531
|
-
import { existsSync } from "node:fs";
|
|
532
|
-
import { win32 } from "node:path";
|
|
533
|
-
var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
|
|
534
|
-
var executableOnPath = /* @__PURE__ */ __name((command, env, platform = process.platform, exists = existsSync) => {
|
|
535
|
-
if (platform !== "win32" || win32.isAbsolute(command))
|
|
536
|
-
return command;
|
|
537
|
-
if (/[\\/]/.test(command))
|
|
538
|
-
return command;
|
|
539
|
-
const extensions = win32.extname(command) ? [""] : (variable(env, "PATHEXT") ?? ".EXE;.COM;.CMD;.BAT").split(";").filter((ext) => /^\.[a-z0-9]+$/i.test(ext));
|
|
540
|
-
for (const entry of (variable(env, "PATH") ?? "").split(";")) {
|
|
541
|
-
const directory = entry.replace(/^"(.*)"$/, "$1");
|
|
542
|
-
for (const extension of extensions) {
|
|
543
|
-
const candidate = win32.join(directory, command + extension);
|
|
544
|
-
if (exists(candidate))
|
|
545
|
-
return candidate;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
return command;
|
|
549
|
-
}, "executableOnPath");
|
|
550
|
-
var executableEnvironment = /* @__PURE__ */ __name((env, platform = process.platform) => {
|
|
551
|
-
if (platform !== "win32")
|
|
552
|
-
return env;
|
|
553
|
-
const configured = variable(env, "COMSPEC");
|
|
554
|
-
const system = variable(env, "SYSTEMROOT");
|
|
555
|
-
const shell = configured ? configured : system && win32.isAbsolute(system) ? win32.join(system, "System32", "cmd.exe") : void 0;
|
|
556
|
-
if (!shell)
|
|
557
|
-
return env;
|
|
558
|
-
const result = { ...env };
|
|
559
|
-
for (const key of Object.keys(result))
|
|
560
|
-
if (key.toUpperCase() === "COMSPEC")
|
|
561
|
-
delete result[key];
|
|
562
|
-
result.comspec = shell;
|
|
563
|
-
return result;
|
|
564
|
-
}, "executableEnvironment");
|
|
565
|
-
|
|
566
530
|
export {
|
|
567
|
-
require_cross_spawn
|
|
568
|
-
executableOnPath,
|
|
569
|
-
executableEnvironment
|
|
531
|
+
require_cross_spawn
|
|
570
532
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
CliError,
|
|
5
4
|
finite,
|
|
6
5
|
getDotPath,
|
|
7
6
|
maxValue,
|
|
@@ -10,12 +9,15 @@ import {
|
|
|
10
9
|
optional,
|
|
11
10
|
pipe,
|
|
12
11
|
safeParse
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3U22QTU6.js";
|
|
13
|
+
import {
|
|
14
|
+
CliError
|
|
15
|
+
} from "./chunk-EBLA7GXY.js";
|
|
14
16
|
import {
|
|
15
17
|
__name
|
|
16
18
|
} from "./chunk-ZVVMGPBJ.js";
|
|
17
19
|
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/models/options.js
|
|
19
21
|
var checkedOptions = /* @__PURE__ */ __name((provider, schema, options) => {
|
|
20
22
|
const parsed = safeParse(schema, options);
|
|
21
23
|
if (!parsed.success) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
__name
|
|
5
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/errors.js
|
|
8
|
+
var errorCodes = [
|
|
9
|
+
"validation_error",
|
|
10
|
+
"configuration_error",
|
|
11
|
+
"authentication_error",
|
|
12
|
+
"permission_error",
|
|
13
|
+
"not_found",
|
|
14
|
+
"confirmation_required",
|
|
15
|
+
"rate_limited",
|
|
16
|
+
"timeout",
|
|
17
|
+
"network_error",
|
|
18
|
+
"provider_error",
|
|
19
|
+
"provider_unavailable",
|
|
20
|
+
"invalid_response",
|
|
21
|
+
"outcome_unknown",
|
|
22
|
+
"cancelled"
|
|
23
|
+
];
|
|
24
|
+
var BRAND = /* @__PURE__ */ Symbol.for("@wirecat/cli-base/CliError");
|
|
25
|
+
var CliError = class extends Error {
|
|
26
|
+
static {
|
|
27
|
+
__name(this, "CliError");
|
|
28
|
+
}
|
|
29
|
+
code;
|
|
30
|
+
details;
|
|
31
|
+
constructor(code, message, details = {}) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = "CliError";
|
|
34
|
+
this.code = code;
|
|
35
|
+
this.details = details;
|
|
36
|
+
Object.defineProperty(this, BRAND, { value: true });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var isCliError = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && value[BRAND] === true, "isCliError");
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
errorCodes,
|
|
43
|
+
CliError,
|
|
44
|
+
isCliError
|
|
45
|
+
};
|
|
@@ -2,22 +2,26 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
isCliFailure
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HMZAMHKN.js";
|
|
6
|
+
import {
|
|
7
|
+
secretNamed,
|
|
8
|
+
withoutSecrets
|
|
9
|
+
} from "./chunk-HIOJRPCT.js";
|
|
6
10
|
import {
|
|
7
11
|
isContentKey
|
|
8
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UQPKAY6I.js";
|
|
9
13
|
import {
|
|
10
14
|
__name
|
|
11
15
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
16
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
14
18
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
19
|
import { createHash } from "node:crypto";
|
|
16
20
|
|
|
17
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
18
22
|
import { homedir } from "node:os";
|
|
19
23
|
|
|
20
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/runs/events.js
|
|
21
25
|
var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
|
|
22
26
|
var renderEvent = /* @__PURE__ */ __name((event) => {
|
|
23
27
|
if (event.event === "warning") {
|
|
@@ -65,88 +69,7 @@ var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!
|
|
|
65
69
|
var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
|
|
66
70
|
var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
|
|
67
71
|
|
|
68
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
69
|
-
var SECRET_WORDS = /* @__PURE__ */ new Set([
|
|
70
|
-
"authorization",
|
|
71
|
-
"cookie",
|
|
72
|
-
"credential",
|
|
73
|
-
"credentials",
|
|
74
|
-
"passphrase",
|
|
75
|
-
"password",
|
|
76
|
-
"passwd",
|
|
77
|
-
"pwd",
|
|
78
|
-
"pass",
|
|
79
|
-
"passcode",
|
|
80
|
-
"pin",
|
|
81
|
-
"otp",
|
|
82
|
-
"2fa",
|
|
83
|
-
"secret",
|
|
84
|
-
"token",
|
|
85
|
-
"contrase\xF1a",
|
|
86
|
-
"contrasena",
|
|
87
|
-
"clave",
|
|
88
|
-
"\u043F\u0430\u0440\u043E\u043B\u044C",
|
|
89
|
-
"\u043F\u0438\u043D",
|
|
90
|
-
"\u043A\u043E\u0434",
|
|
91
|
-
...["api", "auth", "service", "account", "db", "database", "priv", "private", "client"].map((word) => `${word}key`),
|
|
92
|
-
...["db", "database", "key"].map((word) => `${word}pass`)
|
|
93
|
-
]);
|
|
94
|
-
var secretNamed = /* @__PURE__ */ __name((name) => {
|
|
95
|
-
const words = name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).map((word) => word.toLowerCase());
|
|
96
|
-
return words.some((word, at) => SECRET_WORDS.has(word) || SECRET_WORDS.has(word + (words[at + 1] ?? "")));
|
|
97
|
-
}, "secretNamed");
|
|
98
|
-
var START = "(?<![A-Za-z0-9_-])";
|
|
99
|
-
var END = "(?![A-Za-z0-9_-])";
|
|
100
|
-
var KNOWN_TOKENS = new RegExp(`${[
|
|
101
|
-
"gh[pousr]_[A-Za-z0-9]{36,}",
|
|
102
|
-
"github_pat_[A-Za-z0-9_]{22,}",
|
|
103
|
-
"sk-[A-Za-z0-9_-]{20,}",
|
|
104
|
-
"xox[abprs]-[A-Za-z0-9-]{10,}",
|
|
105
|
-
"(?:AKIA|ASIA)[A-Z0-9]{16}",
|
|
106
|
-
"AIza[A-Za-z0-9_-]{35}",
|
|
107
|
-
"(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}",
|
|
108
|
-
"npm_[A-Za-z0-9]{36}",
|
|
109
|
-
"eyJ[A-Za-z0-9_-]{5,}\\.eyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*"
|
|
110
|
-
].map((pattern) => `${START}${pattern}${END}`).join("|")}|(?<!\\d)\\d{8,10}:[A-Za-z0-9_-]{35}${END}`, "g");
|
|
111
|
-
var PRIVATE_KEY = /-----BEGIN[A-Z ]* PRIVATE KEY-----[\s\S]*?(?:-----END[A-Z ]* PRIVATE KEY-----|$)/g;
|
|
112
|
-
var SCHEME = /(?<![A-Za-z])(Bearer|Basic)(\s+)(?![A-Z]?[a-z]+(?![A-Za-z0-9]))[A-Za-z0-9._~+/=-]{8,}/g;
|
|
113
|
-
var NAMED_PAIR = /(?<![\p{L}\p{N}])([\p{L}\p{N}_.-]*(?:token|pass|pwd|pin|otp|2fa|secret|credential|cookie|authorization|key|contrase|clave|пароль|пин|код)[\p{L}\p{N}_.-]*)(["']?\s*(?:=>|[:=])\s*["']?|\s+(?![\p{L}]+(?![\p{L}\p{N}])))((?:Bearer\s+|Basic\s+)?)([^\s"'&,;]+)/giu;
|
|
114
|
-
var looksRandom = /* @__PURE__ */ __name((run) => {
|
|
115
|
-
if (run.length < 20)
|
|
116
|
-
return false;
|
|
117
|
-
const classes = [/[a-z]/, /[A-Z]/, /\d/, /[^A-Za-z0-9]/].filter((kind) => kind.test(run)).length;
|
|
118
|
-
if (classes < 3)
|
|
119
|
-
return false;
|
|
120
|
-
let switches = 0;
|
|
121
|
-
for (let at = 1; at < run.length; at++) {
|
|
122
|
-
const [before, after] = [run[at - 1], run[at]];
|
|
123
|
-
if (/[a-z]/.test(before) && /[A-Z]/.test(after) || /[A-Z]/.test(before) && /[a-z]/.test(after))
|
|
124
|
-
switches += 1;
|
|
125
|
-
}
|
|
126
|
-
if (switches / run.length < 0.15)
|
|
127
|
-
return false;
|
|
128
|
-
const pieces = run.match(/[A-Z]?[a-z]+|[A-Z]+(?![a-z])|\d+/g) ?? [];
|
|
129
|
-
if (pieces.join("").length / Math.max(pieces.length, 1) >= 2.75)
|
|
130
|
-
return false;
|
|
131
|
-
return entropy(run) >= 3.5;
|
|
132
|
-
}, "looksRandom");
|
|
133
|
-
var entropy = /* @__PURE__ */ __name((text) => {
|
|
134
|
-
const counts = /* @__PURE__ */ new Map();
|
|
135
|
-
for (const char of text)
|
|
136
|
-
counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
137
|
-
let bits = 0;
|
|
138
|
-
for (const count of counts.values())
|
|
139
|
-
bits -= count / text.length * Math.log2(count / text.length);
|
|
140
|
-
return bits;
|
|
141
|
-
}, "entropy");
|
|
142
|
-
var withoutSecrets = /* @__PURE__ */ __name((text, mark = "[redacted]") => text.replace(PRIVATE_KEY, mark).replace(KNOWN_TOKENS, mark).replace(SCHEME, `$1$2${mark}`).replace(NAMED_PAIR, (whole, name, separator, scheme) => secretNamed(name) ? `${name}${separator}${scheme}${mark}` : whole).replace(/[!-~]{20,}/g, (token) => (
|
|
143
|
-
// A URL or a path is somebody's address, not a key; a credential in one is caught by the rules above.
|
|
144
|
-
token.includes("://") || /^(?:\/|~\/|\.\.?\/)/.test(token) ? token : token.replace(RUN, (run) => looksRandom(run) ? mark : run.replace(HEX, (hex) => entropy(hex) >= 3 ? mark : hex))
|
|
145
|
-
)), "withoutSecrets");
|
|
146
|
-
var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
|
|
147
|
-
var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
|
|
148
|
-
|
|
149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
72
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
150
73
|
var MESSAGE_AT_MOST = 500;
|
|
151
74
|
var CAUSES_AT_MOST = 5;
|
|
152
75
|
var FRAMES_AT_MOST = 15;
|
|
@@ -255,7 +178,7 @@ var redactText = /* @__PURE__ */ __name((text) => {
|
|
|
255
178
|
return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
|
|
256
179
|
}, "redactText");
|
|
257
180
|
|
|
258
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
259
182
|
var REDACTED = "[redacted]";
|
|
260
183
|
var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
|
|
261
184
|
if (!record)
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
unit
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P3ZTW2ZM.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EBLA7GXY.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
|
|
14
14
|
import { setTimeout } from "node:timers/promises";
|
|
15
15
|
var OPENAI_URL = "https://api.openai.com/v1";
|
|
16
16
|
var OPENAI_MODELS = {
|