@wirecat/tg-cli 0.100.0 → 0.102.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/README.md +3 -3
- package/dist/bin/tg.js +1 -1
- package/dist/bot/transport.d.ts.map +1 -1
- package/dist/bot/transport.js +14 -17
- package/dist/bot/transport.js.map +1 -1
- package/dist/bundle/{adapter-2LVPMFKF.js → adapter-M2HRSFFL.js} +95 -33
- package/dist/bundle/{all-profiles-BLTK2AAB.js → all-profiles-GOD2QNTK.js} +42 -12
- package/dist/bundle/{anthropic-RJE4XEOO.js → anthropic-LKU7RWMA.js} +5 -5
- package/dist/bundle/{bot-api-4XM3NVWG.js → bot-api-X3MPFVPL.js} +49 -53
- package/dist/bundle/{bot-history-WVM5GEQN.js → bot-history-OUMVVG22.js} +15 -15
- package/dist/bundle/{bun-UZXO2LRQ.js → bun-LIZ6MKFS.js} +2 -2
- package/dist/bundle/{bun-sqlite-GJLGSQIT.js → bun-sqlite-2IFQYQ44.js} +4 -4
- package/dist/bundle/chunk-264DAFJV.js +161 -0
- package/dist/bundle/{chunk-ASDZHG5I.js → chunk-2SUTCDGO.js} +2 -2
- package/dist/bundle/{chunk-2IM4M7Q2.js → chunk-2XBSVRT2.js} +1 -1
- package/dist/bundle/{chunk-Q26JMPBP.js → chunk-334UBWOB.js} +11 -11
- package/dist/bundle/{chunk-MQNFEVAH.js → chunk-4PDEQL6T.js} +2 -2
- package/dist/bundle/chunk-4QB4WDLT.js +922 -0
- package/dist/bundle/{chunk-66E5QDLH.js → chunk-5D6OJREA.js} +1 -1
- package/dist/bundle/{chunk-RDQMV6EU.js → chunk-5DFGJPT6.js} +4 -4
- package/dist/bundle/{chunk-GTURDJJD.js → chunk-5KU4UQBM.js} +1 -1
- package/dist/bundle/{chunk-JSKT5UZX.js → chunk-5VSR5ENL.js} +8 -8
- package/dist/bundle/{chunk-DN4QUTWU.js → chunk-AUOXTGTU.js} +1 -1
- package/dist/bundle/{chunk-X4Y2ROJI.js → chunk-BBC546ZA.js} +91 -2
- package/dist/bundle/{chunk-RER6DAHP.js → chunk-BQYTIYGB.js} +171 -148
- package/dist/bundle/{chunk-3S5CL55R.js → chunk-CLWYQNSC.js} +6 -6
- package/dist/bundle/{chunk-I6WZJVRT.js → chunk-CRZPQQHE.js} +59 -46
- package/dist/bundle/chunk-DE7LFMY2.js +440 -0
- package/dist/bundle/{chunk-GYEOQS2D.js → chunk-DG62L57H.js} +17 -17
- package/dist/bundle/{chunk-QU2FJMFB.js → chunk-ENE5CSVY.js} +2903 -1490
- package/dist/bundle/{chunk-P26LWFNZ.js → chunk-ERQDBK5I.js} +1 -1
- package/dist/bundle/{chunk-UD4DOZCN.js → chunk-F2TG3BA2.js} +6 -6
- package/dist/bundle/{chunk-4U7QOFDA.js → chunk-FBWOQMPE.js} +1698 -816
- package/dist/bundle/{chunk-JFJVS5JC.js → chunk-FOUE7XLK.js} +2 -2
- package/dist/bundle/{chunk-3QDPV34J.js → chunk-GSKFAE3I.js} +1297 -518
- package/dist/bundle/{chunk-BAIZAZ6Q.js → chunk-HLAZ65AW.js} +2 -2
- package/dist/bundle/{chunk-LI7TXFLS.js → chunk-JFSVXMN6.js} +3 -3
- package/dist/bundle/{chunk-6VEOR6GD.js → chunk-M5UH5CF3.js} +6 -8
- package/dist/bundle/{chunk-HXTTDIL7.js → chunk-MGG7JSNO.js} +3 -3
- package/dist/bundle/{chunk-6YLT4YVJ.js → chunk-OCWARAFE.js} +2 -2
- package/dist/bundle/{chunk-WE3LBRMB.js → chunk-OEJ5DMCX.js} +7 -7
- package/dist/bundle/{chunk-SGJYU3SB.js → chunk-OHBHHBYL.js} +3 -3
- package/dist/bundle/{chunk-2MXQ2EUN.js → chunk-PSH7K6TL.js} +617 -57
- package/dist/bundle/{chunk-H3X5LS6U.js → chunk-PYTOIDSM.js} +4 -4
- package/dist/bundle/{chunk-ATZ44Z77.js → chunk-Q2NYEX4A.js} +150 -52
- package/dist/bundle/{chunk-KE6L2UEG.js → chunk-QEPZUFPL.js} +70 -61
- package/dist/bundle/{chunk-CV5ASHTW.js → chunk-QL7CQ6VZ.js} +255 -80
- package/dist/bundle/{chunk-THVNP6S6.js → chunk-SRU3OF4R.js} +2 -2
- package/dist/bundle/{chunk-OOOV3JBZ.js → chunk-TV5DGHBT.js} +953 -677
- package/dist/bundle/{chunk-A7OBVRJV.js → chunk-TXBUDJ3P.js} +3 -3
- package/dist/bundle/{chunk-OW3COBN5.js → chunk-U4RRZUNP.js} +9 -9
- package/dist/bundle/{chunk-WKOY3POD.js → chunk-UK3GAN7Q.js} +7 -7
- package/dist/bundle/{chunk-BL36RR34.js → chunk-UR6ASUSG.js} +10 -7
- package/dist/bundle/{chunk-4VBDVZNE.js → chunk-V52SBQYF.js} +242 -19
- package/dist/bundle/{chunk-4YCLWWZ3.js → chunk-VUJ34PEQ.js} +11 -11
- package/dist/bundle/{chunk-2XUGPE5W.js → chunk-W5EB4JLV.js} +3 -3
- package/dist/bundle/{chunk-3KHKYYCR.js → chunk-WMOEOVWZ.js} +1 -0
- package/dist/bundle/{chunk-UMLPXNJI.js → chunk-WVEHUKCZ.js} +1 -1
- package/dist/bundle/{chunk-SYPL4PHV.js → chunk-XXTJUZMB.js} +1 -1
- package/dist/bundle/{chunk-SMJTL5U7.js → chunk-Y4XSWI22.js} +6 -4
- package/dist/bundle/{chunk-HKT5EOT5.js → chunk-YHB57PFN.js} +1 -1
- package/dist/bundle/{chunk-BZANDKWT.js → chunk-ZJVZXJOG.js} +2 -2
- package/dist/bundle/{chunk-QY3YOOTP.js → chunk-ZRNRQFTF.js} +2 -2
- package/dist/bundle/command-contract-A6VZN3ZR.js +31 -0
- package/dist/bundle/{echarts-YHSYUWLY.js → echarts-27W2CIBD.js} +2 -2
- package/dist/bundle/{embed-3HGI2XIW.js → embed-FGJ273X2.js} +4 -4
- package/dist/bundle/{embedder-2CJMZETJ.js → embedder-7ELL3CQ3.js} +7 -7
- package/dist/bundle/{entry-UVE53OV3.js → entry-SEE5YWIX.js} +5 -5
- package/dist/bundle/{first-run-6GYC2QS3.js → first-run-BD7FEC3W.js} +9 -9
- package/dist/bundle/first-screen-ASZV6LSA.js +29 -0
- package/dist/bundle/{identity-HEV5E57G.js → identity-QR4F42T6.js} +3 -3
- package/dist/bundle/{instructions-5UVAXSQV.js → instructions-L74K64PV.js} +1 -1
- package/dist/bundle/{mcp-NWXBVNUA.js → mcp-4Y37G2UY.js} +2 -2
- package/dist/bundle/{node-YHYEGYVE.js → node-RSL3HANO.js} +2 -2
- package/dist/bundle/{node-sqlite-CQ33A3R2.js → node-sqlite-7R3PYQGJ.js} +4 -4
- package/dist/bundle/{oauth-OB3JFAD7.js → oauth-4ESGXF6U.js} +7 -7
- package/dist/bundle/{open-JHGZIXU2.js → open-DFYEUGTA.js} +3 -3
- package/dist/bundle/{process-PSKS3N5B.js → process-RMV3AKLB.js} +1 -1
- package/dist/bundle/{program-RPYVPNRX.js → program-PIUYQHBF.js} +62 -67
- package/dist/bundle/{prompt-7BXUMJGG.js → prompt-H7GYQQLL.js} +4 -4
- package/dist/bundle/{proxy-transport-3EEMW2HW.js → proxy-transport-G4MA6BGU.js} +4 -4
- package/dist/bundle/{recognize-YMZPL47R.js → recognize-3GMOLZF4.js} +5 -5
- package/dist/bundle/{remote-LQ3Q22NG.js → remote-IRWTCI2B.js} +5 -5
- package/dist/bundle/{rerank-SM7IYVXJ.js → rerank-W3OSXXBN.js} +5 -5
- package/dist/bundle/{serve-GHUEP5H5.js → serve-ZCPO44NO.js} +24 -9
- package/dist/bundle/{server-A45HVXQY.js → server-FXU4QFRB.js} +42 -39
- package/dist/bundle/{server-K2BQPPHN.js → server-YWL4HDOP.js} +77 -68
- package/dist/bundle/{state-WIOL52GZ.js → state-MJPTDIB5.js} +9 -5
- package/dist/bundle/{store-XE5AKUJZ.js → store-6VNQG56O.js} +10 -10
- package/dist/bundle/store-maintenance-command-62TQTMER.js +43 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +2 -0
- package/dist/commands/context.js.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/telegram/errors.js +1 -1
- package/dist/telegram/errors.js.map +1 -1
- package/dist/telegram/sending.d.ts.map +1 -1
- package/dist/telegram/sending.js +52 -3
- package/dist/telegram/sending.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/install/windows.ps1 +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +4 -4
- package/dist/bundle/chunk-3N6LXAPE.js +0 -724
- package/dist/bundle/chunk-DVOUKGFK.js +0 -1950
- package/dist/bundle/chunk-MUEXF4ME.js +0 -582
- package/dist/bundle/chunk-U7LXA4SO.js +0 -1007
- package/dist/bundle/chunk-V4JSVH4M.js +0 -190
- package/dist/bundle/chunk-YG7PNCSW.js +0 -230
- package/dist/bundle/chunk-Z2FHEIXN.js +0 -63
- package/dist/bundle/command-contract-AIVKJYIR.js +0 -31
- package/dist/bundle/first-screen-HRRLVLOG.js +0 -29
- package/dist/bundle/store-maintenance-command-YS5E7VUN.js +0 -46
- /package/dist/bundle/{chunk-3MVHRZWR.js → chunk-2SJOUK6J.js} +0 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { createRequire as __tgRequire } from "node:module";
|
|
2
|
+
const require = __tgRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
errorCodes,
|
|
5
|
+
isContentKey
|
|
6
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
7
|
+
import {
|
|
8
|
+
__name
|
|
9
|
+
} from "./chunk-AFV74GK3.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
12
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13
|
+
import { createHash } from "node:crypto";
|
|
14
|
+
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
16
|
+
import { homedir } from "node:os";
|
|
17
|
+
|
|
18
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/errors/failures.js
|
|
19
|
+
var isCliFailure = /* @__PURE__ */ __name((value) => value instanceof Error && value.name === "CliError" && errorCodes.includes(value.code), "isCliFailure");
|
|
20
|
+
var isCommanderFailure = /* @__PURE__ */ __name((value) => {
|
|
21
|
+
const { code, exitCode } = value ?? {};
|
|
22
|
+
return value instanceof Error && typeof code === "string" && code.startsWith("commander.") && typeof exitCode === "number";
|
|
23
|
+
}, "isCommanderFailure");
|
|
24
|
+
var failureKey = /* @__PURE__ */ __name((error) => isCliFailure(error) ? error.code : error instanceof Error ? error.name : "error", "failureKey");
|
|
25
|
+
|
|
26
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/runs/events.js
|
|
27
|
+
var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
|
|
28
|
+
var renderEvent = /* @__PURE__ */ __name((event) => {
|
|
29
|
+
if (event.event === "warning") {
|
|
30
|
+
const counts = Object.entries(event.counts ?? {}).map(([field, count]) => `${count} ${field}`);
|
|
31
|
+
return [`${MARK.warning} ${(event.operation ?? "").padEnd(16)} ${event.code}`, ...counts, event.detail].filter(Boolean).join(" ");
|
|
32
|
+
}
|
|
33
|
+
const parts = [];
|
|
34
|
+
if (event.event === "cache") {
|
|
35
|
+
parts.push(event.reason);
|
|
36
|
+
if (event.ageMs !== void 0)
|
|
37
|
+
parts.push(`cached ${age(event.ageMs)}`);
|
|
38
|
+
} else {
|
|
39
|
+
if (event.opcode !== void 0)
|
|
40
|
+
parts.push(`op ${event.opcode}`, `seq ${event.seq}`);
|
|
41
|
+
if (event.method !== void 0 || event.endpointTemplate !== void 0)
|
|
42
|
+
parts.push([event.method, event.endpointTemplate].filter(Boolean).join(" "));
|
|
43
|
+
if (event.status !== void 0)
|
|
44
|
+
parts.push(`${event.status}`);
|
|
45
|
+
if (event.attempt !== void 0 && event.attempt > 1)
|
|
46
|
+
parts.push(`attempt ${event.attempt}`);
|
|
47
|
+
if (event.waitMs !== void 0)
|
|
48
|
+
parts.push(`waited ${age(event.waitMs)}`);
|
|
49
|
+
}
|
|
50
|
+
if (event.ids)
|
|
51
|
+
for (const [name, value] of Object.entries(event.ids))
|
|
52
|
+
parts.push(`${name} ${value}`);
|
|
53
|
+
if (event.event !== "cache") {
|
|
54
|
+
if (event.durationMs !== void 0)
|
|
55
|
+
parts.push(`${event.durationMs}ms`);
|
|
56
|
+
if (event.bytes !== void 0)
|
|
57
|
+
parts.push(size(event.bytes));
|
|
58
|
+
}
|
|
59
|
+
if (event.counts)
|
|
60
|
+
for (const [field, count] of Object.entries(event.counts))
|
|
61
|
+
parts.push(`${count} ${field}`);
|
|
62
|
+
if (event.event !== "cache") {
|
|
63
|
+
if (event.errorCode)
|
|
64
|
+
parts.push(event.errorCode);
|
|
65
|
+
if (event.providerError)
|
|
66
|
+
parts.push(event.providerError);
|
|
67
|
+
}
|
|
68
|
+
return `${MARK[event.event]} ${event.operation.padEnd(16)} ${parts.join(" ")}`.trimEnd();
|
|
69
|
+
}, "renderEvent");
|
|
70
|
+
var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!" };
|
|
71
|
+
var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
|
|
72
|
+
var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
|
|
73
|
+
|
|
74
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/runs/secrets.js
|
|
75
|
+
var SECRET_WORDS = /* @__PURE__ */ new Set([
|
|
76
|
+
"authorization",
|
|
77
|
+
"cookie",
|
|
78
|
+
"credential",
|
|
79
|
+
"credentials",
|
|
80
|
+
"passphrase",
|
|
81
|
+
"password",
|
|
82
|
+
"passwd",
|
|
83
|
+
"pwd",
|
|
84
|
+
"pass",
|
|
85
|
+
"passcode",
|
|
86
|
+
"pin",
|
|
87
|
+
"otp",
|
|
88
|
+
"2fa",
|
|
89
|
+
"secret",
|
|
90
|
+
"token",
|
|
91
|
+
"contrase\xF1a",
|
|
92
|
+
"contrasena",
|
|
93
|
+
"clave",
|
|
94
|
+
"\u043F\u0430\u0440\u043E\u043B\u044C",
|
|
95
|
+
"\u043F\u0438\u043D",
|
|
96
|
+
"\u043A\u043E\u0434",
|
|
97
|
+
...["api", "auth", "service", "account", "db", "database", "priv", "private", "client"].map((word) => `${word}key`),
|
|
98
|
+
...["db", "database", "key"].map((word) => `${word}pass`)
|
|
99
|
+
]);
|
|
100
|
+
var secretNamed = /* @__PURE__ */ __name((name) => {
|
|
101
|
+
const words = name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).map((word) => word.toLowerCase());
|
|
102
|
+
return words.some((word, at) => SECRET_WORDS.has(word) || SECRET_WORDS.has(word + (words[at + 1] ?? "")));
|
|
103
|
+
}, "secretNamed");
|
|
104
|
+
var START = "(?<![A-Za-z0-9_-])";
|
|
105
|
+
var END = "(?![A-Za-z0-9_-])";
|
|
106
|
+
var KNOWN_TOKENS = new RegExp(`${[
|
|
107
|
+
"gh[pousr]_[A-Za-z0-9]{36,}",
|
|
108
|
+
"github_pat_[A-Za-z0-9_]{22,}",
|
|
109
|
+
"sk-[A-Za-z0-9_-]{20,}",
|
|
110
|
+
"xox[abprs]-[A-Za-z0-9-]{10,}",
|
|
111
|
+
"(?:AKIA|ASIA)[A-Z0-9]{16}",
|
|
112
|
+
"AIza[A-Za-z0-9_-]{35}",
|
|
113
|
+
"(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}",
|
|
114
|
+
"npm_[A-Za-z0-9]{36}",
|
|
115
|
+
"eyJ[A-Za-z0-9_-]{5,}\\.eyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*"
|
|
116
|
+
].map((pattern) => `${START}${pattern}${END}`).join("|")}|(?<!\\d)\\d{8,10}:[A-Za-z0-9_-]{35}${END}`, "g");
|
|
117
|
+
var PRIVATE_KEY = /-----BEGIN[A-Z ]* PRIVATE KEY-----[\s\S]*?(?:-----END[A-Z ]* PRIVATE KEY-----|$)/g;
|
|
118
|
+
var SCHEME = /(?<![A-Za-z])(Bearer|Basic)(\s+)(?![A-Z]?[a-z]+(?![A-Za-z0-9]))[A-Za-z0-9._~+/=-]{8,}/g;
|
|
119
|
+
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;
|
|
120
|
+
var looksRandom = /* @__PURE__ */ __name((run) => {
|
|
121
|
+
if (run.length < 20)
|
|
122
|
+
return false;
|
|
123
|
+
const classes = [/[a-z]/, /[A-Z]/, /\d/, /[^A-Za-z0-9]/].filter((kind) => kind.test(run)).length;
|
|
124
|
+
if (classes < 3)
|
|
125
|
+
return false;
|
|
126
|
+
let switches = 0;
|
|
127
|
+
for (let at = 1; at < run.length; at++) {
|
|
128
|
+
const [before, after] = [run[at - 1], run[at]];
|
|
129
|
+
if (/[a-z]/.test(before) && /[A-Z]/.test(after) || /[A-Z]/.test(before) && /[a-z]/.test(after))
|
|
130
|
+
switches += 1;
|
|
131
|
+
}
|
|
132
|
+
if (switches / run.length < 0.15)
|
|
133
|
+
return false;
|
|
134
|
+
const pieces = run.match(/[A-Z]?[a-z]+|[A-Z]+(?![a-z])|\d+/g) ?? [];
|
|
135
|
+
if (pieces.join("").length / Math.max(pieces.length, 1) >= 2.75)
|
|
136
|
+
return false;
|
|
137
|
+
return entropy(run) >= 3.5;
|
|
138
|
+
}, "looksRandom");
|
|
139
|
+
var entropy = /* @__PURE__ */ __name((text) => {
|
|
140
|
+
const counts = /* @__PURE__ */ new Map();
|
|
141
|
+
for (const char of text)
|
|
142
|
+
counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
143
|
+
let bits = 0;
|
|
144
|
+
for (const count of counts.values())
|
|
145
|
+
bits -= count / text.length * Math.log2(count / text.length);
|
|
146
|
+
return bits;
|
|
147
|
+
}, "entropy");
|
|
148
|
+
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) => (
|
|
149
|
+
// A URL or a path is somebody's address, not a key; a credential in one is caught by the rules above.
|
|
150
|
+
token.includes("://") || /^(?:\/|~\/|\.\.?\/)/.test(token) ? token : token.replace(RUN, (run) => looksRandom(run) ? mark : run.replace(HEX, (hex) => entropy(hex) >= 3 ? mark : hex))
|
|
151
|
+
)), "withoutSecrets");
|
|
152
|
+
var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
|
|
153
|
+
var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
|
|
154
|
+
|
|
155
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
156
|
+
var MESSAGE_AT_MOST = 500;
|
|
157
|
+
var CAUSES_AT_MOST = 5;
|
|
158
|
+
var FRAMES_AT_MOST = 15;
|
|
159
|
+
var errorDetailOf = /* @__PURE__ */ __name((error, response) => {
|
|
160
|
+
const details = isCliFailure(error) ? { ...error.details } : {};
|
|
161
|
+
const thrown = error instanceof Error ? error : void 0;
|
|
162
|
+
const code = isCliFailure(error) ? error.code : codeOf(error);
|
|
163
|
+
const reason = typeof details.reason === "string" ? details.reason : void 0;
|
|
164
|
+
const message = thrown ? redactText(thrown.message) : void 0;
|
|
165
|
+
const operation = stringOf(details.operation) ?? response?.operation;
|
|
166
|
+
const status = numberOf(details.status) ?? response?.status;
|
|
167
|
+
const method = stringOf(details.method) ?? response?.method;
|
|
168
|
+
const endpoint = stringOf(details.endpoint) ?? response?.endpointTemplate;
|
|
169
|
+
const key = providerErrorKey(details.provider_error) ?? providerErrorKey(response?.providerError);
|
|
170
|
+
const protocol = key !== void 0 && method === void 0 && endpoint === void 0;
|
|
171
|
+
const http = method !== void 0 || endpoint !== void 0 || status !== void 0 && !protocol ? {
|
|
172
|
+
...method === void 0 ? {} : { method: method.toUpperCase().slice(0, 16) },
|
|
173
|
+
...endpoint === void 0 ? {} : { endpoint_template: endpointTemplate(endpoint) },
|
|
174
|
+
...status === void 0 ? {} : { status }
|
|
175
|
+
} : void 0;
|
|
176
|
+
const causes = causesOf(thrown?.cause ?? details.cause);
|
|
177
|
+
const stack = framesOf(thrown);
|
|
178
|
+
return {
|
|
179
|
+
class: classOf(error),
|
|
180
|
+
...code === void 0 ? {} : { code },
|
|
181
|
+
...reason === void 0 ? {} : { reason },
|
|
182
|
+
...message ? { message } : {},
|
|
183
|
+
...operation === void 0 ? {} : { operation },
|
|
184
|
+
...http ? { http } : {},
|
|
185
|
+
...key === void 0 ? {} : { provider: { key, ...protocol && status !== void 0 ? { code: status } : {} } },
|
|
186
|
+
...causes.length > 0 ? { causes } : {},
|
|
187
|
+
...stack.length > 0 ? { stack } : {}
|
|
188
|
+
};
|
|
189
|
+
}, "errorDetailOf");
|
|
190
|
+
var stringOf = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value.trim() : void 0, "stringOf");
|
|
191
|
+
var numberOf = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isInteger(value) ? value : void 0, "numberOf");
|
|
192
|
+
var classOf = /* @__PURE__ */ __name((error) => {
|
|
193
|
+
if (!(error instanceof Error))
|
|
194
|
+
return error === null ? "null" : typeof error;
|
|
195
|
+
const constructed = error.constructor?.name;
|
|
196
|
+
return constructed && constructed !== "Error" && constructed !== error.name ? constructed : error.name;
|
|
197
|
+
}, "classOf");
|
|
198
|
+
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
199
|
+
const code = error?.code;
|
|
200
|
+
return typeof code === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(code) ? code : void 0;
|
|
201
|
+
}, "codeOf");
|
|
202
|
+
var causesOf = /* @__PURE__ */ __name((first) => {
|
|
203
|
+
const causes = [];
|
|
204
|
+
const seen = /* @__PURE__ */ new Set();
|
|
205
|
+
for (let cause = first; cause !== void 0 && cause !== null && causes.length < CAUSES_AT_MOST; ) {
|
|
206
|
+
if (seen.has(cause))
|
|
207
|
+
break;
|
|
208
|
+
seen.add(cause);
|
|
209
|
+
const message = cause instanceof Error ? redactText(cause.message) : void 0;
|
|
210
|
+
causes.push({ class: classOf(cause), ...message ? { message } : {} });
|
|
211
|
+
cause = cause instanceof Error ? cause.cause : void 0;
|
|
212
|
+
}
|
|
213
|
+
return causes;
|
|
214
|
+
}, "causesOf");
|
|
215
|
+
var framesOf = /* @__PURE__ */ __name((error, limit = FRAMES_AT_MOST) => {
|
|
216
|
+
const stack = error instanceof Error && typeof error.stack === "string" ? error.stack : "";
|
|
217
|
+
return stack.split("\n").filter((line) => line.trimStart().startsWith("at ")).flatMap((line) => {
|
|
218
|
+
const match = /^\s*at (?:async )?(?:(.+?) \()?(.+?):(\d+):\d+\)?$/.exec(line);
|
|
219
|
+
if (!match)
|
|
220
|
+
return [];
|
|
221
|
+
const [, fn, path = "", lineNumber] = match;
|
|
222
|
+
if (path.startsWith("node:"))
|
|
223
|
+
return [];
|
|
224
|
+
return [`${fn ?? "<anonymous>"} ${fileOf(path)}:${lineNumber}`];
|
|
225
|
+
}).slice(0, limit);
|
|
226
|
+
}, "framesOf");
|
|
227
|
+
var fileOf = /* @__PURE__ */ __name((path) => {
|
|
228
|
+
const plain = path.replace(/^file:\/\//, "");
|
|
229
|
+
const packaged = /\/node_modules\/((?:@[^/]+\/)?[^/]+\/.+)$/.exec(plain)?.[1];
|
|
230
|
+
if (packaged)
|
|
231
|
+
return packaged.replace(/\/(?:dist|src)\//, "/");
|
|
232
|
+
return /(?:^|\/)(?:dist|src)\/(.+)$/.exec(plain)?.[1] ?? plain.split("/").at(-1) ?? "?";
|
|
233
|
+
}, "fileOf");
|
|
234
|
+
var endpointTemplate = /* @__PURE__ */ __name((raw) => {
|
|
235
|
+
const trimmed = raw.trim().split(/[?#]/)[0] ?? "";
|
|
236
|
+
const origin = /^[a-z][a-z0-9+.-]*:\/\/(?:[^@/]*@)?([^/]*)/i.exec(trimmed);
|
|
237
|
+
const path = origin ? trimmed.slice(origin[0].length) : trimmed;
|
|
238
|
+
const scheme = origin ? `${trimmed.slice(0, trimmed.indexOf("://"))}://${origin[1]}` : "";
|
|
239
|
+
const segments = path.split("/").map((segment) => {
|
|
240
|
+
if (segment === "" || /^[:{].+/.test(segment))
|
|
241
|
+
return segment;
|
|
242
|
+
if (/^bot\d+:/.test(segment) || /^\d{6,}:[\w-]{20,}$/.test(segment))
|
|
243
|
+
return ":token";
|
|
244
|
+
if (/^-?\d+$/.test(segment) || /^[0-9a-f-]{16,}$/i.test(segment))
|
|
245
|
+
return ":id";
|
|
246
|
+
if (!/^[A-Za-z0-9._~-]{1,40}$/.test(segment))
|
|
247
|
+
return ":value";
|
|
248
|
+
return segment;
|
|
249
|
+
});
|
|
250
|
+
return `${scheme}${segments.join("/")}`.slice(0, 300);
|
|
251
|
+
}, "endpointTemplate");
|
|
252
|
+
var INTERNATIONAL_PHONE = /\+\d[\d\s()-]{6,}\d/.source;
|
|
253
|
+
var BARE_PHONE = /(^|[^\w-])\d{11,15}\b/.source;
|
|
254
|
+
var redactText = /* @__PURE__ */ __name((text) => {
|
|
255
|
+
const home = homedir();
|
|
256
|
+
let out = home && home !== "/" ? text.split(home).join("~") : text;
|
|
257
|
+
out = withoutSecrets(out.replace(/"[^"\n]*"|“[^”\n]*”|«[^»\n]*»/g, '"[redacted]"')).replace(/\b(bearer|basic|token|key|password|secret)(\s*[:=]\s*|\s+)[^\s'"]+/gi, "$1$2[redacted]").replace(/[\w.+-]+@[\w-]+\.[\w.-]+/g, "[email]").replace(new RegExp(INTERNATIONAL_PHONE, "g"), "[number]").replace(new RegExp(BARE_PHONE, "g"), "$1[number]").replace(/\bbot\d+:[\w-]+/g, "bot[token]").replace(/\b\d{6,}:[\w-]{20,}\b/g, "[token]").replace(/(\?|&)[^\s#]*/g, "$1[redacted]").replace(/\b[A-Za-z0-9_-]{40,}\b/g, "[redacted]");
|
|
258
|
+
return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
|
|
259
|
+
}, "redactText");
|
|
260
|
+
|
|
261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
262
|
+
var REDACTED = "[redacted]";
|
|
263
|
+
var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
|
|
264
|
+
if (!record)
|
|
265
|
+
return false;
|
|
266
|
+
if (fromFlag)
|
|
267
|
+
return true;
|
|
268
|
+
if (persistent)
|
|
269
|
+
return false;
|
|
270
|
+
return caller !== void 0 || viaOf(env) !== "desktop";
|
|
271
|
+
}, "keepsSuccess");
|
|
272
|
+
var calls = new AsyncLocalStorage();
|
|
273
|
+
var withCaller = /* @__PURE__ */ __name((caller, work) => calls.run(caller, work), "withCaller");
|
|
274
|
+
var currentCaller = /* @__PURE__ */ __name(() => calls.getStore(), "currentCaller");
|
|
275
|
+
var clientHash = /* @__PURE__ */ __name((id) => createHash("sha256").update(id).digest("hex").slice(0, 8), "clientHash");
|
|
276
|
+
var viaOf = /* @__PURE__ */ __name((env) => env.WIRECAT_CALLER?.trim() === "desktop" ? "desktop" : "cli", "viaOf");
|
|
277
|
+
var agentOf = /* @__PURE__ */ __name((env) => {
|
|
278
|
+
const named = env.AI_AGENT?.trim().split("_")[0];
|
|
279
|
+
const kind = (named && plainWord(named) ? named.toLowerCase() : void 0) ?? (env.CLAUDECODE ? "claude-code" : void 0) ?? (env.CODEX_THREAD_ID || env.CODEX_SESSION_ID || env.CODEX_SANDBOX ? "codex" : void 0) ?? (env.GEMINI_CLI ? "gemini-cli" : void 0) ?? (env.OPENCODE ? "opencode" : void 0) ?? (env.CURSOR_AGENT ? "cursor" : void 0) ?? // Only `exec` is the agent's own command: OpenClaw also sets `tui-local` for what the owner types in its TUI.
|
|
280
|
+
(env.OPENCLAW_SHELL?.trim() === "exec" ? "openclaw" : void 0);
|
|
281
|
+
if (!kind)
|
|
282
|
+
return void 0;
|
|
283
|
+
const session = sessionOf(kind, env);
|
|
284
|
+
return {
|
|
285
|
+
kind,
|
|
286
|
+
session_id: session && SESSION.test(session) ? session : null,
|
|
287
|
+
// OpenClaw passes the sender and chat ids of a chat-started run in this variable; only its presence is kept.
|
|
288
|
+
...kind === "openclaw" && env.OPENCLAW_CHANNEL_CONTEXT?.trim() ? { from_chat: true } : {}
|
|
289
|
+
};
|
|
290
|
+
}, "agentOf");
|
|
291
|
+
var SESSION = /^[A-Za-z0-9._:-]{1,128}$/;
|
|
292
|
+
var SESSION_VARIABLE = {
|
|
293
|
+
"claude-code": "CLAUDE_CODE_SESSION_ID",
|
|
294
|
+
codex: "CODEX_THREAD_ID",
|
|
295
|
+
opencode: "OPENCODE_SESSION_ID",
|
|
296
|
+
"hermes-agent": "HERMES_SESSION_ID"
|
|
297
|
+
};
|
|
298
|
+
var sessionOf = /* @__PURE__ */ __name((kind, env) => {
|
|
299
|
+
const variable = SESSION_VARIABLE[kind];
|
|
300
|
+
return (variable === void 0 ? void 0 : env[variable]?.trim()) || void 0;
|
|
301
|
+
}, "sessionOf");
|
|
302
|
+
var plainWord = /* @__PURE__ */ __name((word) => /^[A-Za-z][A-Za-z0-9.-]{0,39}$/.test(word), "plainWord");
|
|
303
|
+
var secretInputs = /* @__PURE__ */ new WeakSet();
|
|
304
|
+
var secretInput = /* @__PURE__ */ __name((input) => {
|
|
305
|
+
secretInputs.add(input);
|
|
306
|
+
return input;
|
|
307
|
+
}, "secretInput");
|
|
308
|
+
var secretShaped = /* @__PURE__ */ __name((word) => /:\/\/[^/@\s:]+:[^/@\s]+@/.test(word) || /(^|[^A-Za-z0-9_-])[A-Za-z0-9_-]{40,}($|[^A-Za-z0-9_-])/.test(word), "secretShaped");
|
|
309
|
+
var withoutPhones = /* @__PURE__ */ __name((word) => word.replace(new RegExp(INTERNATIONAL_PHONE, "g"), REDACTED).replace(new RegExp(BARE_PHONE, "g"), `$1${REDACTED}`), "withoutPhones");
|
|
310
|
+
var maskArgv = /* @__PURE__ */ __name((program, words, { keep = false } = {}) => {
|
|
311
|
+
const argv = [];
|
|
312
|
+
let unknownCommand;
|
|
313
|
+
let current = program;
|
|
314
|
+
let positional = 0;
|
|
315
|
+
let profileSeen = false;
|
|
316
|
+
let lost = false;
|
|
317
|
+
const raw = /* @__PURE__ */ __name((word) => keep && !secretShaped(word) ? withoutPhones(withoutSecrets(word, REDACTED)) : REDACTED, "raw");
|
|
318
|
+
const keptValue = /* @__PURE__ */ __name((name, value, input) => keep ? input && secretInputs.has(input) || secretNamed(name) ? REDACTED : raw(value) : maskedValue(name, value, input?.argChoices), "keptValue");
|
|
319
|
+
const optionFor = /* @__PURE__ */ __name((flag) => {
|
|
320
|
+
for (let at = current; at; at = at.parent) {
|
|
321
|
+
const found = at.options.find((option) => option.long === flag || option.short === flag);
|
|
322
|
+
if (found)
|
|
323
|
+
return found;
|
|
324
|
+
}
|
|
325
|
+
return void 0;
|
|
326
|
+
}, "optionFor");
|
|
327
|
+
for (let at = 0; at < words.length; at++) {
|
|
328
|
+
const word = words[at];
|
|
329
|
+
if (word === "--") {
|
|
330
|
+
argv.push("--");
|
|
331
|
+
for (let after = at + 1; after < words.length; after++)
|
|
332
|
+
argv.push(raw(words[after]));
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
if (word.startsWith("-") && word.length > 1 && !NUMBER.test(word)) {
|
|
336
|
+
const equals = word.indexOf("=");
|
|
337
|
+
const flag = equals > 0 ? word.slice(0, equals) : word;
|
|
338
|
+
if (!/^--?[A-Za-z0-9][A-Za-z0-9-]*$/.test(flag)) {
|
|
339
|
+
argv.push(raw(word));
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
const option = optionFor(flag);
|
|
343
|
+
const name = option?.attributeName() ?? flag.replace(/^-+/, "");
|
|
344
|
+
if (equals > 0) {
|
|
345
|
+
argv.push(`${flag}=${keptValue(name, word.slice(equals + 1), option)}`);
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
argv.push(flag);
|
|
349
|
+
if (!option && keep && secretNamed(name) && words[at + 1] !== void 0 && !words[at + 1]?.startsWith("-")) {
|
|
350
|
+
at += 1;
|
|
351
|
+
argv.push(REDACTED);
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
if (!option || !(option.required || option.optional))
|
|
355
|
+
continue;
|
|
356
|
+
const takes = /* @__PURE__ */ __name((next) => next !== void 0 && (option.required || !next.startsWith("-") || NUMBER.test(next)), "takes");
|
|
357
|
+
if (takes(words[at + 1])) {
|
|
358
|
+
at += 1;
|
|
359
|
+
argv.push(keptValue(name, words[at], option));
|
|
360
|
+
while (option.variadic && words[at + 1] !== void 0 && !words[at + 1].startsWith("-")) {
|
|
361
|
+
at += 1;
|
|
362
|
+
argv.push(keptValue(name, words[at], option));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (!lost && positional === 0) {
|
|
368
|
+
const sub = current.commands.find((one) => one.name() === word || one.aliases().includes(word));
|
|
369
|
+
if (sub) {
|
|
370
|
+
argv.push(word);
|
|
371
|
+
current = sub;
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
if (current === program && !profileSeen) {
|
|
375
|
+
profileSeen = true;
|
|
376
|
+
argv.push(keep ? raw(word) : PROFILE.test(word) && withoutPhones(withoutSecrets(word)) === word ? word : REDACTED);
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
if (current.commands.length > 0 && current.registeredArguments.length === 0) {
|
|
380
|
+
lost = true;
|
|
381
|
+
unknownCommand = commandLike(word);
|
|
382
|
+
argv.push(keep ? raw(word) : unknownCommand);
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
const declared = lost ? void 0 : current.registeredArguments;
|
|
387
|
+
const argument = declared?.[Math.min(positional, declared.length - 1)];
|
|
388
|
+
positional += 1;
|
|
389
|
+
argv.push(secretInputs.has(current) ? REDACTED : argument ? keptValue(argument.name(), word, argument) : raw(word));
|
|
390
|
+
}
|
|
391
|
+
return { argv, ...unknownCommand === void 0 ? {} : { unknownCommand } };
|
|
392
|
+
}, "maskArgv");
|
|
393
|
+
var NUMBER = /^-?\d+(\.\d+)?$/;
|
|
394
|
+
var PROFILE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
395
|
+
var commandLike = /* @__PURE__ */ __name((word) => /^[a-z][a-z0-9-]{0,31}$/i.test(word) && withoutSecrets(word) === word ? word : REDACTED, "commandLike");
|
|
396
|
+
var maskedValue = /* @__PURE__ */ __name((name, value, choices) => {
|
|
397
|
+
if (isContentKey(name))
|
|
398
|
+
return REDACTED;
|
|
399
|
+
if (name === "profile")
|
|
400
|
+
return PROFILE.test(value) ? value : REDACTED;
|
|
401
|
+
if (name === "json" || name === "fields")
|
|
402
|
+
return /^[a-z0-9_.,]{1,200}$/.test(value) ? value : REDACTED;
|
|
403
|
+
if (choices?.includes(value))
|
|
404
|
+
return value;
|
|
405
|
+
return safeShape(value) ? value : REDACTED;
|
|
406
|
+
}, "maskedValue");
|
|
407
|
+
var safeShape = /* @__PURE__ */ __name((value) => NUMBER.test(value) && !/^\d{11,}$/.test(value) || /^\d+(ms|s|m|h|d|w)$/.test(value) || /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/.test(value) || value === "true" || value === "false", "safeShape");
|
|
408
|
+
var runContextOf = /* @__PURE__ */ __name(({ bin, command, program, argv, env, recordInput = false, caller }) => {
|
|
409
|
+
const masked = program && argv ? maskArgv(program, argv, { keep: recordInput === true }) : void 0;
|
|
410
|
+
const ifFailed = program && argv && recordInput === "failed" ? maskArgv(program, argv, { keep: true }) : void 0;
|
|
411
|
+
const agent = caller ? caller.agent : agentOf(env);
|
|
412
|
+
return {
|
|
413
|
+
cliCommand: command ? `${bin} ${command}` : bin,
|
|
414
|
+
...masked ? { argv: masked.argv } : {},
|
|
415
|
+
...ifFailed ? { argvIfFailed: ifFailed.argv } : {},
|
|
416
|
+
...masked?.unknownCommand === void 0 ? {} : { unknownCommand: masked.unknownCommand },
|
|
417
|
+
...agent ? { agent } : {},
|
|
418
|
+
via: caller?.via ?? viaOf(env),
|
|
419
|
+
...caller?.mcp ? { mcp: caller.mcp } : {}
|
|
420
|
+
};
|
|
421
|
+
}, "runContextOf");
|
|
422
|
+
|
|
423
|
+
export {
|
|
424
|
+
isCliFailure,
|
|
425
|
+
isCommanderFailure,
|
|
426
|
+
failureKey,
|
|
427
|
+
providerErrorKey,
|
|
428
|
+
renderEvent,
|
|
429
|
+
errorDetailOf,
|
|
430
|
+
framesOf,
|
|
431
|
+
endpointTemplate,
|
|
432
|
+
keepsSuccess,
|
|
433
|
+
withCaller,
|
|
434
|
+
currentCaller,
|
|
435
|
+
clientHash,
|
|
436
|
+
agentOf,
|
|
437
|
+
secretInput,
|
|
438
|
+
maskArgv,
|
|
439
|
+
runContextOf
|
|
440
|
+
};
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
safeParse,
|
|
15
15
|
stepOf,
|
|
16
16
|
writes
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
18
18
|
import {
|
|
19
19
|
__commonJS,
|
|
20
20
|
__name,
|
|
@@ -1887,7 +1887,7 @@ var require_cli_table3 = __commonJS({
|
|
|
1887
1887
|
}
|
|
1888
1888
|
});
|
|
1889
1889
|
|
|
1890
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1890
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/exit-codes.js
|
|
1891
1891
|
var EXIT_CODES = {
|
|
1892
1892
|
validation_error: 2,
|
|
1893
1893
|
configuration_error: 3,
|
|
@@ -1907,7 +1907,7 @@ var EXIT_CODES = {
|
|
|
1907
1907
|
var exitCodeFor = /* @__PURE__ */ __name((code) => EXIT_CODES[code], "exitCodeFor");
|
|
1908
1908
|
var GENERIC_FAILURE = 1;
|
|
1909
1909
|
|
|
1910
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1910
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.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
1911
|
var CONTROL = (
|
|
1912
1912
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
|
|
1913
1913
|
/[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
|
|
@@ -1931,7 +1931,7 @@ var visibleControls = /* @__PURE__ */ __name((text) => {
|
|
|
1931
1931
|
}, "visibleControls");
|
|
1932
1932
|
var singleLine = /* @__PURE__ */ __name((text) => visibleControls(text).replace(LINE_BREAKS, escaped), "singleLine");
|
|
1933
1933
|
|
|
1934
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1934
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.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
1935
|
var recognise = /* @__PURE__ */ __name((failure) => {
|
|
1936
1936
|
if (isCliError(failure))
|
|
1937
1937
|
return failure;
|
|
@@ -2078,7 +2078,7 @@ var catchCrashes = /* @__PURE__ */ __name((options) => {
|
|
|
2078
2078
|
};
|
|
2079
2079
|
}, "catchCrashes");
|
|
2080
2080
|
|
|
2081
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2081
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/drain.js
|
|
2082
2082
|
var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
|
|
2083
2083
|
if (signal?.aborted)
|
|
2084
2084
|
return Promise.reject(signal.reason);
|
|
@@ -2106,7 +2106,7 @@ var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
|
|
|
2106
2106
|
});
|
|
2107
2107
|
}, "waitForDrain");
|
|
2108
2108
|
|
|
2109
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2109
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/streams.js
|
|
2110
2110
|
var processStreams = {
|
|
2111
2111
|
drain: /* @__PURE__ */ __name(async (signal) => {
|
|
2112
2112
|
await Promise.all([waitForDrain(process.stdout, signal), waitForDrain(process.stderr, signal)]);
|
|
@@ -2135,7 +2135,7 @@ var captureStreams = /* @__PURE__ */ __name(() => {
|
|
|
2135
2135
|
};
|
|
2136
2136
|
}, "captureStreams");
|
|
2137
2137
|
|
|
2138
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2138
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_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
|
|
2139
2139
|
var forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
2140
2140
|
var validate = /* @__PURE__ */ __name((paths) => {
|
|
2141
2141
|
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))))
|
|
@@ -2200,7 +2200,7 @@ var projectFields = /* @__PURE__ */ __name((value, fields) => {
|
|
|
2200
2200
|
return project(value, fields);
|
|
2201
2201
|
}, "projectFields");
|
|
2202
2202
|
|
|
2203
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2203
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/batch.js
|
|
2204
2204
|
var BATCH_LIMITS = Object.freeze({
|
|
2205
2205
|
requests: 32,
|
|
2206
2206
|
input_bytes: 262144,
|
|
@@ -2327,7 +2327,7 @@ var runBatch = /* @__PURE__ */ __name(async (requests, options = {}) => {
|
|
|
2327
2327
|
};
|
|
2328
2328
|
}, "runBatch");
|
|
2329
2329
|
|
|
2330
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2330
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/config.js
|
|
2331
2331
|
import { randomBytes } from "node:crypto";
|
|
2332
2332
|
import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
2333
2333
|
import { dirname, join } from "node:path";
|
|
@@ -2371,11 +2371,11 @@ var saveConfigFile = /* @__PURE__ */ __name((path, config) => {
|
|
|
2371
2371
|
`, 384);
|
|
2372
2372
|
}, "saveConfigFile");
|
|
2373
2373
|
|
|
2374
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2374
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
|
|
2375
2375
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
2376
2376
|
import { join as join2 } from "node:path";
|
|
2377
2377
|
|
|
2378
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2378
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.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
|
|
2379
2379
|
import { createRequire } from "node:module";
|
|
2380
2380
|
var ENTRY_OPTIONS = { linux: { store: "secret-service" } };
|
|
2381
2381
|
var require2 = createRequire(new URL("keyring.js", import.meta.resolve("@wirecat/cli-base")).href);
|
|
@@ -2395,7 +2395,7 @@ var systemKeyring = {
|
|
|
2395
2395
|
delete: /* @__PURE__ */ __name((service, account) => entry(service, account).deletePassword(), "delete")
|
|
2396
2396
|
};
|
|
2397
2397
|
|
|
2398
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2398
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
|
|
2399
2399
|
var keyringService = /* @__PURE__ */ __name((service, configDir, isolated = false) => isolated ? `${service}:${configDir}` : service, "keyringService");
|
|
2400
2400
|
var Credentials = class {
|
|
2401
2401
|
static {
|
|
@@ -2502,7 +2502,7 @@ var Credentials = class {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
};
|
|
2504
2504
|
|
|
2505
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2505
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/time.js
|
|
2506
2506
|
var abortError = /* @__PURE__ */ __name(() => new DOMException("The operation was aborted.", "AbortError"), "abortError");
|
|
2507
2507
|
var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve, reject) => {
|
|
2508
2508
|
if (signal?.aborted) {
|
|
@@ -2516,7 +2516,7 @@ var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve, rej
|
|
|
2516
2516
|
}, { once: true });
|
|
2517
2517
|
}), "realSleep");
|
|
2518
2518
|
|
|
2519
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2519
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/logging.js
|
|
2520
2520
|
import { appendFileSync } from "node:fs";
|
|
2521
2521
|
var REDACTED_FIELDS = [
|
|
2522
2522
|
"authorization",
|
|
@@ -2611,7 +2611,7 @@ var silent = {
|
|
|
2611
2611
|
}, "error")
|
|
2612
2612
|
};
|
|
2613
2613
|
|
|
2614
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2614
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/paths.js
|
|
2615
2615
|
import { homedir } from "node:os";
|
|
2616
2616
|
import { join as join3, posix, win32 } from "node:path";
|
|
2617
2617
|
var PATH_KINDS = ["config", "state", "cache"];
|
|
@@ -2647,7 +2647,7 @@ var resolvePaths = /* @__PURE__ */ __name((options) => {
|
|
|
2647
2647
|
var pathsAreOverridden = /* @__PURE__ */ __name(({ appName, prefix, env = process.env }) => PATH_KINDS.some((kind) => env[overrideName(appName, prefix, kind)] !== void 0), "pathsAreOverridden");
|
|
2648
2648
|
var configFilePath = /* @__PURE__ */ __name((configDir, fileName = "config.json") => join3(configDir, fileName), "configFilePath");
|
|
2649
2649
|
|
|
2650
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2650
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/pretty.js
|
|
2651
2651
|
var import_cli_table3 = __toESM(require_cli_table3(), 1);
|
|
2652
2652
|
import { styleText } from "node:util";
|
|
2653
2653
|
var renderPretty = /* @__PURE__ */ __name((value, options) => {
|
|
@@ -2722,7 +2722,7 @@ var BORDERLESS = {
|
|
|
2722
2722
|
middle: ""
|
|
2723
2723
|
};
|
|
2724
2724
|
|
|
2725
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2725
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/renderer.js
|
|
2726
2726
|
var createRenderer = /* @__PURE__ */ __name(({ format, color, streams = processStreams, quiet = false }) => {
|
|
2727
2727
|
const mark = /* @__PURE__ */ __name((symbol, message) => format === "pretty" ? `${symbol} ${visibleControls(message)}` : visibleControls(message), "mark");
|
|
2728
2728
|
const say = /* @__PURE__ */ __name((symbol) => (message) => {
|