@wirecat/drive-cli 0.67.0 → 0.69.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 +2 -2
- package/dist/bundle/{all-profiles-DVZUVAPQ.js → all-profiles-B4A737YW.js} +20 -30
- package/dist/bundle/{anthropic-Y45C45O2.js → anthropic-RZGPDESM.js} +3 -3
- package/dist/bundle/{app-server-GTXUOUGD.js → app-server-OWEW7DY5.js} +51 -63
- package/dist/bundle/{bun-QVJV76QJ.js → bun-V5QLYBZU.js} +2 -2
- package/dist/bundle/{bun-sqlite-CC7PIAMH.js → bun-sqlite-KHLHXXGH.js} +4 -4
- package/dist/bundle/{chunk-ETAFFY3J.js → chunk-22SH77TG.js} +65 -64
- package/dist/bundle/{chunk-2Y3YBDZX.js → chunk-25FT44S3.js} +1482 -464
- package/dist/bundle/{chunk-YVUAG7RF.js → chunk-2DS2TDGW.js} +29 -28
- package/dist/bundle/{chunk-JJHDV32D.js → chunk-2Q4CB4EI.js} +1 -1
- package/dist/bundle/{chunk-HJF2QGOX.js → chunk-2VFAXC6O.js} +30 -17
- package/dist/bundle/{chunk-ULH3TNUP.js → chunk-376ZGVUZ.js} +4 -4
- package/dist/bundle/{chunk-NWYVOHIX.js → chunk-3RLRJHAI.js} +1646 -976
- package/dist/bundle/{chunk-SXJDCRXE.js → chunk-3URYKAJP.js} +1 -1
- package/dist/bundle/{chunk-7AZCAUST.js → chunk-3YKAFLXY.js} +1 -1
- package/dist/bundle/{chunk-MF46W7PQ.js → chunk-4J5GJJ2I.js} +1 -1
- package/dist/bundle/{chunk-3RG6LL25.js → chunk-4YECZ6CN.js} +11 -11
- package/dist/bundle/{chunk-SJE7UGOW.js → chunk-4ZFO2CVH.js} +4 -4
- package/dist/bundle/{chunk-UFNE57VY.js → chunk-533XOW74.js} +2 -2
- package/dist/bundle/{chunk-6ERQE4FS.js → chunk-5B5NOAIA.js} +100 -55
- package/dist/bundle/{chunk-MW46BLWH.js → chunk-5SJZDEIO.js} +2 -0
- package/dist/bundle/{chunk-RC72RU66.js → chunk-6D44YQ5X.js} +5 -5
- package/dist/bundle/{chunk-2MEVCMBW.js → chunk-6EL5AVXX.js} +3 -5
- package/dist/bundle/{chunk-ZU5VQYNY.js → chunk-6XNTELM5.js} +1 -1
- package/dist/bundle/{chunk-7J2IP3WL.js → chunk-AD7VI3XU.js} +6 -6
- package/dist/bundle/{chunk-Y5WSRG3F.js → chunk-AMQGKMLZ.js} +2 -2
- package/dist/bundle/{chunk-UOAHZV3K.js → chunk-BBJVV4E2.js} +28 -29
- package/dist/bundle/{chunk-XZCF5XU7.js → chunk-BVVXYZSU.js} +5 -5
- package/dist/bundle/{chunk-E3XA56TS.js → chunk-CAQ5GW3A.js} +1 -1
- package/dist/bundle/{chunk-MEQNAZ6R.js → chunk-CDSB7WVG.js} +323 -12
- package/dist/bundle/{chunk-P6A77LMP.js → chunk-CU6RATZH.js} +5 -7
- package/dist/bundle/{chunk-MEY7URZZ.js → chunk-CZ4UEXCE.js} +4 -4
- package/dist/bundle/{chunk-JLUQZZ26.js → chunk-E7URRFBB.js} +7 -7
- package/dist/bundle/{chunk-JCNEPYQZ.js → chunk-EL2E3ABX.js} +12 -12
- package/dist/bundle/{chunk-BHSLMJF7.js → chunk-EWUQIUTB.js} +4 -4
- package/dist/bundle/{chunk-4VH7M2OD.js → chunk-F5UUJU6R.js} +2 -2
- package/dist/bundle/{chunk-CWDC6QJM.js → chunk-GHFBT2ZM.js} +4 -4
- package/dist/bundle/{chunk-2PIA45FC.js → chunk-GK6KXBL6.js} +1 -1
- package/dist/bundle/{chunk-T2VAEDJS.js → chunk-GTDCP5OG.js} +3 -3
- package/dist/bundle/{chunk-IRULPE5M.js → chunk-HEBZCKMU.js} +1695 -672
- package/dist/bundle/{chunk-EXWOOST5.js → chunk-I55XYREN.js} +667 -230
- package/dist/bundle/{chunk-5TSILGTO.js → chunk-IQ2QU2X6.js} +1613 -1101
- package/dist/bundle/{chunk-WKIQKGOF.js → chunk-KUQDBWPU.js} +42 -32
- package/dist/bundle/{chunk-AJ3DFPRT.js → chunk-L342KHIZ.js} +105 -1
- package/dist/bundle/{chunk-JY2GZDJL.js → chunk-LRCSDAYK.js} +3 -3
- package/dist/bundle/{chunk-U2ERT45N.js → chunk-LUZRVBQR.js} +4 -4
- package/dist/bundle/{chunk-AAZPDWRD.js → chunk-MHXZ62CU.js} +1 -1
- package/dist/bundle/{chunk-ZK46UHDP.js → chunk-N4ACIIQB.js} +2 -2
- package/dist/bundle/{chunk-FS2PG2PE.js → chunk-NVDR72GP.js} +19 -19
- package/dist/bundle/{chunk-VZ5KETIX.js → chunk-O6PD7RZY.js} +2 -2
- package/dist/bundle/{chunk-PDHN4GHU.js → chunk-OOIAJRKQ.js} +1 -1
- package/dist/bundle/{chunk-JEMBW6IO.js → chunk-OUM4ZO53.js} +1 -1
- package/dist/bundle/{chunk-QOKPRFHM.js → chunk-PB6NWKH3.js} +2 -2
- package/dist/bundle/{chunk-C72WYRXD.js → chunk-QJGFQRTL.js} +10 -10
- package/dist/bundle/chunk-RLGQMMYE.js +707 -0
- package/dist/bundle/{chunk-4G7WQNG7.js → chunk-RWQ7T4Y5.js} +2 -2
- package/dist/bundle/{chunk-ZH4H5XTA.js → chunk-SEJBS7SI.js} +1 -1
- package/dist/bundle/{chunk-OOBSSU2G.js → chunk-SY2HLH5R.js} +33 -19
- package/dist/bundle/{chunk-LSAIXPAX.js → chunk-SYUXKV2E.js} +1 -1
- package/dist/bundle/{chunk-FOMQ4MG3.js → chunk-T4FMXDDV.js} +2 -2
- package/dist/bundle/{chunk-5DMPGTNR.js → chunk-T6X6EZ5N.js} +3 -3
- package/dist/bundle/{chunk-RLH6BOEG.js → chunk-TZ75K6R7.js} +6 -6
- package/dist/bundle/{chunk-D4MVEOU2.js → chunk-U3RXH6RY.js} +1 -1
- package/dist/bundle/{chunk-ABJQ6IDU.js → chunk-V4FMN5A6.js} +16 -16
- package/dist/bundle/{chunk-WBKYZZQT.js → chunk-VUPWDCYV.js} +1 -1
- package/dist/bundle/{chunk-V7E25BUU.js → chunk-WNMPIRRF.js} +98 -6
- package/dist/bundle/{chunk-DAFKV6DJ.js → chunk-WOUIHZRI.js} +13 -15
- package/dist/bundle/{chunk-WWW7YTFG.js → chunk-WQOGHND4.js} +1 -1
- package/dist/bundle/{chunk-NFIR346J.js → chunk-XUHQ7DVT.js} +1 -1
- package/dist/bundle/{chunk-YI4DXASF.js → chunk-XVH3WZSZ.js} +49 -55
- package/dist/bundle/{chunk-ZEPDEFVT.js → chunk-ZBYKCVSV.js} +1 -1
- package/dist/bundle/{chunk-LXRBTXCZ.js → chunk-ZUG67442.js} +2 -2
- package/dist/bundle/{cli-U4LSBYDV.js → cli-BS4L3HAP.js} +100 -70
- package/dist/bundle/{command-contract-UU5T24ZZ.js → command-contract-HYURWSD6.js} +16 -17
- package/dist/bundle/{command-server-entry-PK6FBUPO.js → command-server-entry-CJ2CV7ZV.js} +23 -24
- package/dist/bundle/{decode-3ZE6NBKV.js → decode-E2NM5SSM.js} +3 -3
- package/dist/bundle/drive.js +4 -4
- package/dist/bundle/{echarts-6FWNCNXK.js → echarts-QIXLXS3G.js} +2 -2
- package/dist/bundle/{embed-DGYBBZUW.js → embed-YNZW5X6M.js} +4 -4
- package/dist/bundle/{embedder-O7A6VMWI.js → embedder-LRC2PKTS.js} +7 -7
- package/dist/bundle/{entry-CDJ2QSU2.js → entry-2IMSWRJU.js} +7 -7
- package/dist/bundle/{first-run-UOQW7DN5.js → first-run-7CPHQDM5.js} +7 -7
- package/dist/bundle/first-screen-OKZ7GMFR.js +38 -0
- package/dist/bundle/{google-HPX52KMC.js → google-WDKDBDD4.js} +15 -15
- package/dist/bundle/{google-api-HIMN4XL5.js → google-api-7JDZDCWE.js} +52 -53
- package/dist/bundle/{grants-RO42I6E4.js → grants-AU25GWKF.js} +57 -58
- package/dist/bundle/{identity-NFGHDPLL.js → identity-E43WKN5F.js} +1 -1
- package/dist/bundle/{instructions-6JAQYCM6.js → instructions-MD2RZT5Z.js} +1 -1
- package/dist/bundle/{login-RZOQN63N.js → login-RBDJPQAG.js} +57 -58
- package/dist/bundle/{node-KSIX3GIH.js → node-IEVT2FSJ.js} +2 -2
- package/dist/bundle/{node-sqlite-4FJ6WJXN.js → node-sqlite-IENH4TRX.js} +5 -5
- package/dist/bundle/{oauth-BKZAMFKK.js → oauth-3JGSN47Z.js} +5 -5
- package/dist/bundle/{open-4AQJGH42.js → open-TZ5H7NYM.js} +3 -3
- package/dist/bundle/{openai-24F2OX55.js → openai-XF2KB7W2.js} +14 -14
- package/dist/bundle/{process-7NOA2T7H.js → process-6Q23D3TO.js} +1 -1
- package/dist/bundle/{program-7JHMLDEX.js → program-D5XWOHV5.js} +88 -88
- package/dist/bundle/{prompt-NM66MAZ4.js → prompt-KUC5D4GX.js} +3 -3
- package/dist/bundle/{recognize-DBKV2JYZ.js → recognize-DPFW7HO3.js} +2 -2
- package/dist/bundle/{remote-ABWUTBVB.js → remote-MODTSUNH.js} +8 -8
- package/dist/bundle/{rerank-FQAU4ENY.js → rerank-JK7SERLE.js} +5 -5
- package/dist/bundle/{serve-QLJG4QZD.js → serve-BV2WHZLW.js} +7 -7
- package/dist/bundle/server-6YDI4Y36.js +72 -0
- package/dist/bundle/{server-VGZNK5XD.js → server-N3WPEU7Z.js} +47 -44
- package/dist/bundle/{services-5KARVUHK.js → services-SV6CFUCS.js} +42 -27
- package/dist/bundle/{sqlite-runtime-ILF6EFQJ.js → sqlite-runtime-RZ5PLZVQ.js} +4 -4
- package/dist/bundle/{state-R2M56GPU.js → state-RAZIREVG.js} +4 -4
- package/dist/bundle/{store-DA4K7HWW.js → store-2DLGLYS6.js} +18 -14
- package/dist/bundle/{store-2OBVMUQL.js → store-DQKJKX2G.js} +12 -12
- package/dist/bundle/store-maintenance-command-UJ5F5L4H.js +64 -0
- package/dist/bundle/tokens-LY3WML55.js +110 -0
- package/dist/policy.d.ts +2 -0
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +2 -1
- package/dist/policy.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +3 -2
- package/dist/program.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/chunk-AZKFZ7J7.js +0 -76
- package/dist/bundle/chunk-JO7BJYAP.js +0 -1235
- package/dist/bundle/chunk-MBLB4TQI.js +0 -1316
- package/dist/bundle/first-screen-SNDV4YKF.js +0 -39
- package/dist/bundle/server-NUBLY5SV.js +0 -74
- package/dist/bundle/store-maintenance-command-KSIPI5B5.js +0 -65
- package/dist/bundle/tokens-VQDGSHRB.js +0 -111
|
@@ -2,10 +2,11 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
storePath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RWQ7T4Y5.js";
|
|
6
6
|
import {
|
|
7
|
-
resolvePaths
|
|
8
|
-
|
|
7
|
+
resolvePaths,
|
|
8
|
+
writeSecurely
|
|
9
|
+
} from "./chunk-5SJZDEIO.js";
|
|
9
10
|
import {
|
|
10
11
|
singleLine
|
|
11
12
|
} from "./chunk-HCZYJMBP.js";
|
|
@@ -16,11 +17,295 @@ import {
|
|
|
16
17
|
__name
|
|
17
18
|
} from "./chunk-ZVVMGPBJ.js";
|
|
18
19
|
|
|
19
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20
|
-
import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
20
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
21
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
21
22
|
import { dirname, join, resolve } from "node:path";
|
|
22
23
|
|
|
23
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/config-repair.js
|
|
25
|
+
var REPAIR_WORDS = {
|
|
26
|
+
byte_order_mark: "an invisible byte-order mark at the start",
|
|
27
|
+
comment: "a comment, which JSON does not allow",
|
|
28
|
+
trailing_comma: "a comma before a closing bracket",
|
|
29
|
+
missing_comma: "a missing comma",
|
|
30
|
+
unquoted_key: "a key without double quotes",
|
|
31
|
+
single_quotes: "text in single quotes",
|
|
32
|
+
missing_closer: "the file stops before its closing brackets \u2014 whatever followed this line was already lost"
|
|
33
|
+
};
|
|
34
|
+
var GiveUp = class {
|
|
35
|
+
static {
|
|
36
|
+
__name(this, "GiveUp");
|
|
37
|
+
}
|
|
38
|
+
at;
|
|
39
|
+
why;
|
|
40
|
+
constructor(at, why) {
|
|
41
|
+
this.at = at;
|
|
42
|
+
this.why = why;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var NUMBER = /^-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/;
|
|
46
|
+
var LITERAL = /^(true|false|null)/;
|
|
47
|
+
var KEY = /^[A-Za-z_$][\w$.-]*/;
|
|
48
|
+
var ENDS_VALUE = /^[\s,\]}/]?$/;
|
|
49
|
+
var repairConfigText = /* @__PURE__ */ __name((text) => {
|
|
50
|
+
try {
|
|
51
|
+
JSON.parse(text);
|
|
52
|
+
return { state: "valid" };
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
55
|
+
const fixes = [];
|
|
56
|
+
const lineAt = /* @__PURE__ */ __name((offset) => text.slice(0, offset).split("\n").length, "lineAt");
|
|
57
|
+
const fix = /* @__PURE__ */ __name((kind, offset) => fixes.push({ kind, line: lineAt(offset) }), "fix");
|
|
58
|
+
const giveUp = /* @__PURE__ */ __name((why, offset = at) => {
|
|
59
|
+
throw new GiveUp(offset, why);
|
|
60
|
+
}, "giveUp");
|
|
61
|
+
let at = 0;
|
|
62
|
+
let truncated = false;
|
|
63
|
+
let last = "open";
|
|
64
|
+
let lastEnd = 0;
|
|
65
|
+
const previous = /* @__PURE__ */ __name(() => last, "previous");
|
|
66
|
+
const skip = /* @__PURE__ */ __name(() => {
|
|
67
|
+
for (; ; ) {
|
|
68
|
+
while (/\s/.test(text[at] ?? ""))
|
|
69
|
+
at++;
|
|
70
|
+
if (text.startsWith("//", at)) {
|
|
71
|
+
fix("comment", at);
|
|
72
|
+
while (at < text.length && text[at] !== "\n")
|
|
73
|
+
at++;
|
|
74
|
+
} else if (text.startsWith("/*", at)) {
|
|
75
|
+
const end = text.indexOf("*/", at + 2);
|
|
76
|
+
if (end < 0)
|
|
77
|
+
giveUp("a /* comment is never closed");
|
|
78
|
+
fix("comment", at);
|
|
79
|
+
at = end + 2;
|
|
80
|
+
} else
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
}, "skip");
|
|
84
|
+
const string = /* @__PURE__ */ __name(() => {
|
|
85
|
+
const quote = text[at];
|
|
86
|
+
const start = at;
|
|
87
|
+
if (quote === "'")
|
|
88
|
+
fix("single_quotes", at);
|
|
89
|
+
at++;
|
|
90
|
+
let body = "";
|
|
91
|
+
for (; ; ) {
|
|
92
|
+
if (at >= text.length)
|
|
93
|
+
giveUp("the file stops inside a quoted text", start);
|
|
94
|
+
const char = text[at];
|
|
95
|
+
if (char === quote)
|
|
96
|
+
break;
|
|
97
|
+
if (text.charCodeAt(at) < 32)
|
|
98
|
+
giveUp("a line break inside a quoted text");
|
|
99
|
+
if (char === "\\") {
|
|
100
|
+
const next = text[at + 1] ?? "";
|
|
101
|
+
if (quote === "'" && next === "'")
|
|
102
|
+
body += "'";
|
|
103
|
+
else if (/^["\\/bfnrt]$/.test(next))
|
|
104
|
+
body += `\\${next}`;
|
|
105
|
+
else if (next === "u" && /^[0-9a-fA-F]{4}$/.test(text.slice(at + 2, at + 6))) {
|
|
106
|
+
body += text.slice(at, at + 6);
|
|
107
|
+
at += 4;
|
|
108
|
+
} else
|
|
109
|
+
giveUp("an escape JSON has no meaning for");
|
|
110
|
+
at += 2;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
body += char === '"' ? '\\"' : char;
|
|
114
|
+
at++;
|
|
115
|
+
}
|
|
116
|
+
at++;
|
|
117
|
+
return JSON.parse(`"${body}"`);
|
|
118
|
+
}, "string");
|
|
119
|
+
const key = /* @__PURE__ */ __name(() => {
|
|
120
|
+
const char = text[at] ?? "";
|
|
121
|
+
if (char === '"' || char === "'")
|
|
122
|
+
return string();
|
|
123
|
+
const word = KEY.exec(text.slice(at))?.[0];
|
|
124
|
+
if (!word)
|
|
125
|
+
return giveUp("something other than a key where a key should be");
|
|
126
|
+
fix("unquoted_key", at);
|
|
127
|
+
at += word.length;
|
|
128
|
+
return word;
|
|
129
|
+
}, "key");
|
|
130
|
+
const scalar = /* @__PURE__ */ __name(() => {
|
|
131
|
+
const char = text[at] ?? "";
|
|
132
|
+
if (char === '"' || char === "'")
|
|
133
|
+
return { json: JSON.stringify(string()) };
|
|
134
|
+
const word = (NUMBER.exec(text.slice(at)) ?? LITERAL.exec(text.slice(at)))?.[0];
|
|
135
|
+
if (!word || !ENDS_VALUE.test(text[at + word.length] ?? ""))
|
|
136
|
+
return giveUp("a value that is not JSON \u2014 text needs quotes, and only true, false and null go without");
|
|
137
|
+
if (at + word.length === text.length && NUMBER.test(word))
|
|
138
|
+
giveUp("the file stops inside a number");
|
|
139
|
+
at += word.length;
|
|
140
|
+
return { json: word };
|
|
141
|
+
}, "scalar");
|
|
142
|
+
const members = /* @__PURE__ */ __name((close, one) => {
|
|
143
|
+
const out = [];
|
|
144
|
+
at++;
|
|
145
|
+
last = "open";
|
|
146
|
+
let comma = -1;
|
|
147
|
+
for (; ; ) {
|
|
148
|
+
skip();
|
|
149
|
+
if (truncated)
|
|
150
|
+
return out;
|
|
151
|
+
if (at >= text.length) {
|
|
152
|
+
if (previous() === "close")
|
|
153
|
+
giveUp("the file stops after a closing bracket, so which brackets are missing has two readings");
|
|
154
|
+
if (previous() === "comma")
|
|
155
|
+
fix("trailing_comma", comma);
|
|
156
|
+
fix("missing_closer", text.length);
|
|
157
|
+
truncated = true;
|
|
158
|
+
return out;
|
|
159
|
+
}
|
|
160
|
+
const char = text[at];
|
|
161
|
+
if (char === close) {
|
|
162
|
+
if (previous() === "comma")
|
|
163
|
+
fix("trailing_comma", comma);
|
|
164
|
+
at++;
|
|
165
|
+
last = "close";
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
if (char === "}" || char === "]")
|
|
169
|
+
giveUp(`a ${char} where ${close} should close`);
|
|
170
|
+
if (char === ",") {
|
|
171
|
+
if (previous() !== "value" && previous() !== "close")
|
|
172
|
+
giveUp("a comma with nothing before it");
|
|
173
|
+
comma = at;
|
|
174
|
+
at++;
|
|
175
|
+
last = "comma";
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (previous() === "value" || previous() === "close") {
|
|
179
|
+
if (lineAt(at) === lineAt(lastEnd))
|
|
180
|
+
giveUp("two entries on one line with no comma between them");
|
|
181
|
+
fix("missing_comma", lastEnd);
|
|
182
|
+
}
|
|
183
|
+
out.push(one());
|
|
184
|
+
}
|
|
185
|
+
}, "members");
|
|
186
|
+
const value = /* @__PURE__ */ __name(() => {
|
|
187
|
+
const char = text[at] ?? "";
|
|
188
|
+
let node;
|
|
189
|
+
if (char === "{") {
|
|
190
|
+
const seen = /* @__PURE__ */ new Set();
|
|
191
|
+
node = {
|
|
192
|
+
object: members("}", () => {
|
|
193
|
+
const start = at;
|
|
194
|
+
const name = key();
|
|
195
|
+
if (seen.has(name))
|
|
196
|
+
giveUp("a key appears twice in one object", start);
|
|
197
|
+
seen.add(name);
|
|
198
|
+
skip();
|
|
199
|
+
if (at >= text.length)
|
|
200
|
+
giveUp("the file stops after a key, before its value");
|
|
201
|
+
if (text[at] !== ":")
|
|
202
|
+
giveUp("a key with no colon after it");
|
|
203
|
+
at++;
|
|
204
|
+
skip();
|
|
205
|
+
if (at >= text.length)
|
|
206
|
+
giveUp("the file stops after a key, before its value");
|
|
207
|
+
return [name, value()];
|
|
208
|
+
})
|
|
209
|
+
};
|
|
210
|
+
} else if (char === "[") {
|
|
211
|
+
node = {
|
|
212
|
+
array: members("]", () => {
|
|
213
|
+
return value();
|
|
214
|
+
})
|
|
215
|
+
};
|
|
216
|
+
} else
|
|
217
|
+
node = scalar();
|
|
218
|
+
if (!truncated) {
|
|
219
|
+
last = "json" in node ? "value" : "close";
|
|
220
|
+
lastEnd = at;
|
|
221
|
+
}
|
|
222
|
+
return node;
|
|
223
|
+
}, "value");
|
|
224
|
+
try {
|
|
225
|
+
if (text.includes("\0") || text.includes(String.fromCharCode(65533)))
|
|
226
|
+
giveUp("the file is not text", 0);
|
|
227
|
+
if (text.charCodeAt(0) === 65279) {
|
|
228
|
+
fix("byte_order_mark", 0);
|
|
229
|
+
at = 1;
|
|
230
|
+
}
|
|
231
|
+
skip();
|
|
232
|
+
if (text[at] !== "{")
|
|
233
|
+
giveUp(at >= text.length ? "the file is empty" : "the file does not start with {");
|
|
234
|
+
const root = value();
|
|
235
|
+
skip();
|
|
236
|
+
if (at < text.length)
|
|
237
|
+
giveUp("more text after the closing }");
|
|
238
|
+
const repaired = `${serialise(root, "")}
|
|
239
|
+
`;
|
|
240
|
+
JSON.parse(repaired);
|
|
241
|
+
return { state: "repaired", text: repaired, fixes };
|
|
242
|
+
} catch (error) {
|
|
243
|
+
if (!(error instanceof GiveUp))
|
|
244
|
+
throw error;
|
|
245
|
+
const before = text.slice(0, error.at).split("\n");
|
|
246
|
+
return {
|
|
247
|
+
state: "refused",
|
|
248
|
+
line: before.length,
|
|
249
|
+
column: (before.at(-1)?.length ?? 0) + 1,
|
|
250
|
+
why: error.why
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}, "repairConfigText");
|
|
254
|
+
var serialise = /* @__PURE__ */ __name((node, indent) => {
|
|
255
|
+
if ("json" in node)
|
|
256
|
+
return node.json;
|
|
257
|
+
const inner = `${indent} `;
|
|
258
|
+
const parts = "object" in node ? node.object.map(([name, item]) => `${inner}${JSON.stringify(name)}: ${serialise(item, inner)}`) : node.array.map((item) => `${inner}${serialise(item, inner)}`);
|
|
259
|
+
const [open, close] = "object" in node ? ["{", "}"] : ["[", "]"];
|
|
260
|
+
return parts.length === 0 ? `${open}${close}` : `${open}
|
|
261
|
+
${parts.join(",\n")}
|
|
262
|
+
${indent}${close}`;
|
|
263
|
+
}, "serialise");
|
|
264
|
+
var SAFE_REPAIRS = /* @__PURE__ */ new Set([
|
|
265
|
+
"byte_order_mark",
|
|
266
|
+
"comment",
|
|
267
|
+
"trailing_comma",
|
|
268
|
+
"missing_comma"
|
|
269
|
+
]);
|
|
270
|
+
var FIX_FOR = {
|
|
271
|
+
unquoted_key: /* @__PURE__ */ __name((line) => `put the key on line ${line} in double quotes`, "unquoted_key"),
|
|
272
|
+
single_quotes: /* @__PURE__ */ __name((line) => `use double quotes for the text on line ${line}`, "single_quotes"),
|
|
273
|
+
missing_closer: /* @__PURE__ */ __name((line) => `add the closing } or ] the file lacks after line ${line}, and check that nothing after it was lost`, "missing_closer")
|
|
274
|
+
};
|
|
275
|
+
var FIX_FOR_REFUSAL = [
|
|
276
|
+
[/no comma between/, (line, before) => `add a comma after ${before} on line ${line}`],
|
|
277
|
+
[/no colon after/, (line) => `add a colon after the key on line ${line}`],
|
|
278
|
+
[/comma with nothing before/, (line) => `remove the extra comma on line ${line}`],
|
|
279
|
+
[/inside a quoted text/, (line) => `close the quotes on line ${line}`],
|
|
280
|
+
[/value that is not JSON/, (line) => `put the value on line ${line} in double quotes`],
|
|
281
|
+
[/key appears twice/, (line) => `keep one of the two keys named on line ${line}; the file holds both`]
|
|
282
|
+
];
|
|
283
|
+
var shown = /* @__PURE__ */ __name((line) => line.trim().replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^\s"',:{}[\]]+)(\s*:)?/g, (token, _value, key) => key || /^(true|false|null)$/.test(token) ? token : '"\u2026"'), "shown");
|
|
284
|
+
var explainBrokenJson = /* @__PURE__ */ __name((text, result) => {
|
|
285
|
+
const lines = text.replace(/^\uFEFF/u, "").split(/\r?\n/);
|
|
286
|
+
const around = /* @__PURE__ */ __name((line2) => {
|
|
287
|
+
const near = lines[line2 - 1]?.trim() ? lines[line2 - 1] : lines[line2 - 2];
|
|
288
|
+
return near ? ` \u2014 near \`${shown(near)}\`` : "";
|
|
289
|
+
}, "around");
|
|
290
|
+
if (result.state === "repaired") {
|
|
291
|
+
const asked = result.fixes.find((one) => !SAFE_REPAIRS.has(one.kind)) ?? result.fixes[0];
|
|
292
|
+
if (!asked)
|
|
293
|
+
return "it is not valid JSON";
|
|
294
|
+
const fix2 = FIX_FOR[asked.kind]?.(asked.line);
|
|
295
|
+
return `line ${asked.line} has ${REPAIR_WORDS[asked.kind]}${around(asked.line)}${fix2 ? `; likely fix: ${fix2}` : ""}`;
|
|
296
|
+
}
|
|
297
|
+
if (result.state === "valid")
|
|
298
|
+
return "it is valid JSON";
|
|
299
|
+
const { line, why } = result;
|
|
300
|
+
const column = line === 1 && text.charCodeAt(0) === 65279 ? result.column - 1 : result.column;
|
|
301
|
+
const head = (lines[line - 1] ?? "").slice(0, column - 1);
|
|
302
|
+
const entry = head.slice(Math.max(head.lastIndexOf(","), head.lastIndexOf("{"), head.lastIndexOf("[")) + 1);
|
|
303
|
+
const before = shown(entry) || shown(lines[line - 2] ?? "");
|
|
304
|
+
const fix = FIX_FOR_REFUSAL.find(([pattern]) => pattern.test(why))?.[1](line, `\`${before}\``);
|
|
305
|
+
return `line ${line}, column ${column}: ${why}${around(line)}; likely fix: ${fix ?? "correct that part by hand"}`;
|
|
306
|
+
}, "explainBrokenJson");
|
|
307
|
+
|
|
308
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
|
|
24
309
|
var DEFAULT_TASK_CATEGORIES = [
|
|
25
310
|
{
|
|
26
311
|
name: "taxes",
|
|
@@ -775,7 +1060,7 @@ var storedTaskCategories = /* @__PURE__ */ __name((json) => {
|
|
|
775
1060
|
}
|
|
776
1061
|
}, "storedTaskCategories");
|
|
777
1062
|
|
|
778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
779
1064
|
var SECTION = "task_categories";
|
|
780
1065
|
var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
|
|
781
1066
|
const paths = resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env });
|
|
@@ -783,10 +1068,33 @@ var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
|
|
|
783
1068
|
return join(paths.config, "config.json");
|
|
784
1069
|
return resolve(store) === resolve(storePath({ ...env, MESSAGING_STORE: void 0 })) ? join(paths.config, "config.json") : join(dirname(store), "config.json");
|
|
785
1070
|
}, "sharedConfigPath");
|
|
1071
|
+
var backupPathFor = /* @__PURE__ */ __name((file) => {
|
|
1072
|
+
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
1073
|
+
let path = `${file}.bak-${stamp}`;
|
|
1074
|
+
for (let n = 2; existsSync(path); n++)
|
|
1075
|
+
path = `${file}.bak-${stamp}-${n}`;
|
|
1076
|
+
return path;
|
|
1077
|
+
}, "backupPathFor");
|
|
1078
|
+
var mended = /* @__PURE__ */ __name((path, bytes) => {
|
|
1079
|
+
const text = bytes.toString("utf8");
|
|
1080
|
+
const result = repairConfigText(text);
|
|
1081
|
+
if (result.state === "repaired" && result.fixes.every((one) => SAFE_REPAIRS.has(one.kind))) {
|
|
1082
|
+
try {
|
|
1083
|
+
writeSecurely(backupPathFor(path), bytes, statSync(path).mode & 511);
|
|
1084
|
+
writeSecurely(path, result.text, 384);
|
|
1085
|
+
} catch {
|
|
1086
|
+
}
|
|
1087
|
+
return JSON.parse(result.text);
|
|
1088
|
+
}
|
|
1089
|
+
throw new CliError("configuration_error", `${path} is not valid JSON, ${explainBrokenJson(text, result)}`, {
|
|
1090
|
+
reason: "config.invalid_json",
|
|
1091
|
+
file: path
|
|
1092
|
+
});
|
|
1093
|
+
}, "mended");
|
|
786
1094
|
var readJson = /* @__PURE__ */ __name((path) => {
|
|
787
|
-
let
|
|
1095
|
+
let bytes;
|
|
788
1096
|
try {
|
|
789
|
-
|
|
1097
|
+
bytes = readFileSync(path);
|
|
790
1098
|
} catch (error) {
|
|
791
1099
|
if (error.code === "ENOENT")
|
|
792
1100
|
return void 0;
|
|
@@ -794,9 +1102,9 @@ var readJson = /* @__PURE__ */ __name((path) => {
|
|
|
794
1102
|
}
|
|
795
1103
|
let parsed;
|
|
796
1104
|
try {
|
|
797
|
-
parsed = JSON.parse(
|
|
798
|
-
} catch
|
|
799
|
-
|
|
1105
|
+
parsed = JSON.parse(bytes.toString("utf8"));
|
|
1106
|
+
} catch {
|
|
1107
|
+
parsed = mended(path, bytes);
|
|
800
1108
|
}
|
|
801
1109
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
802
1110
|
throw new CliError("configuration_error", `${path} must hold a JSON object`);
|
|
@@ -871,6 +1179,8 @@ var taskCategoriesReader = /* @__PURE__ */ __name((path) => {
|
|
|
871
1179
|
}, "taskCategoriesReader");
|
|
872
1180
|
|
|
873
1181
|
export {
|
|
1182
|
+
REPAIR_WORDS,
|
|
1183
|
+
repairConfigText,
|
|
874
1184
|
DEFAULT_TASK_CATEGORIES,
|
|
875
1185
|
FALLBACK_CATEGORY,
|
|
876
1186
|
unlistedNote,
|
|
@@ -878,6 +1188,7 @@ export {
|
|
|
878
1188
|
taskCategoryValue,
|
|
879
1189
|
storedTaskCategories,
|
|
880
1190
|
sharedConfigPath,
|
|
1191
|
+
backupPathFor,
|
|
881
1192
|
readTaskCategoryEdits,
|
|
882
1193
|
applyTaskCategoryEdits,
|
|
883
1194
|
editsFrom,
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
readSharedSection,
|
|
5
5
|
sharedConfigPath,
|
|
6
6
|
writeSharedSection
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CDSB7WVG.js";
|
|
8
8
|
import {
|
|
9
9
|
storePath
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RWQ7T4Y5.js";
|
|
11
11
|
import {
|
|
12
12
|
CliError
|
|
13
13
|
} from "./chunk-EA2OB75T.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
__name
|
|
16
16
|
} from "./chunk-ZVVMGPBJ.js";
|
|
17
17
|
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
|
|
19
19
|
var PERMISSION_ANSWERS = ["readonly", "allow"];
|
|
20
20
|
var QUESTIONS = ["languages", "tools", "permissions"];
|
|
21
21
|
var SECTION = "setup";
|
|
@@ -40,13 +40,11 @@ var writeSetupAnswers = /* @__PURE__ */ __name((path, answers) => {
|
|
|
40
40
|
writeSharedSection(path, SECTION, { ...kept, ...answers });
|
|
41
41
|
}, "writeSetupAnswers");
|
|
42
42
|
var permissionCeiling = /* @__PURE__ */ __name((path) => {
|
|
43
|
-
let answer;
|
|
44
43
|
try {
|
|
45
|
-
|
|
44
|
+
return readSetupAnswers(path).permissions === "readonly" ? "readonly" : void 0;
|
|
46
45
|
} catch {
|
|
47
|
-
return
|
|
46
|
+
return void 0;
|
|
48
47
|
}
|
|
49
|
-
return answer === "allow" ? void 0 : answer;
|
|
50
48
|
}, "permissionCeiling");
|
|
51
49
|
var setupPermissionCeiling = /* @__PURE__ */ __name((env = process.env) => permissionCeiling(sharedConfigPath(storePath(env), env)), "setupPermissionCeiling");
|
|
52
50
|
|
|
@@ -6,20 +6,20 @@ import {
|
|
|
6
6
|
XLSX,
|
|
7
7
|
supported,
|
|
8
8
|
tooManyEntries
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OOIAJRKQ.js";
|
|
10
10
|
import {
|
|
11
11
|
DOC,
|
|
12
12
|
SHEET
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NVDR72GP.js";
|
|
14
14
|
import {
|
|
15
15
|
googleError
|
|
16
16
|
} from "./chunk-Y2QVNVHK.js";
|
|
17
17
|
import {
|
|
18
18
|
extractText
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5B5NOAIA.js";
|
|
20
20
|
import {
|
|
21
21
|
MAX_TEXT_CHARS
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZUG67442.js";
|
|
23
23
|
import {
|
|
24
24
|
importFrom
|
|
25
25
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/languages.js
|
|
11
11
|
var LANGUAGES = [
|
|
12
12
|
{ name: "russian", code: "ru", label: "Russian", script: "cyrillic", dictionary: "dictionary-ru" },
|
|
13
13
|
{ name: "english", code: "en", label: "English", script: "latin", dictionary: "dictionary-en" },
|
|
@@ -15,12 +15,12 @@ var LANGUAGES = [
|
|
|
15
15
|
];
|
|
16
16
|
var languagesOf = /* @__PURE__ */ __name((script) => LANGUAGES.filter((one) => one.script === script).map(({ name }) => name), "languagesOf");
|
|
17
17
|
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/normalize.js
|
|
19
19
|
var NORMALIZER_VERSION = 1;
|
|
20
20
|
var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
|
|
21
21
|
var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
|
|
22
22
|
|
|
23
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/snowball/base-stemmer.js
|
|
24
24
|
var BaseStemmer = class {
|
|
25
25
|
static {
|
|
26
26
|
__name(this, "BaseStemmer");
|
|
@@ -395,7 +395,7 @@ var BaseStemmer = class {
|
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
397
|
|
|
398
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/snowball/english-stemmer.js
|
|
399
399
|
var a_0 = [
|
|
400
400
|
["arsen", -1],
|
|
401
401
|
["commun", -1],
|
|
@@ -1096,7 +1096,7 @@ var english_stemmer_default = class extends BaseStemmer {
|
|
|
1096
1096
|
stemWord = this.stem;
|
|
1097
1097
|
};
|
|
1098
1098
|
|
|
1099
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1099
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/snowball/russian-stemmer.js
|
|
1100
1100
|
var a_02 = [
|
|
1101
1101
|
["\u0432", 1],
|
|
1102
1102
|
["\u0438\u0432", 2, 1],
|
|
@@ -1519,7 +1519,7 @@ var russian_stemmer_default = class extends BaseStemmer {
|
|
|
1519
1519
|
stemWord = this.stem;
|
|
1520
1520
|
};
|
|
1521
1521
|
|
|
1522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/snowball/spanish-stemmer.js
|
|
1523
1523
|
var a_03 = [
|
|
1524
1524
|
["", 6],
|
|
1525
1525
|
["\xE1", 1, 1],
|
|
@@ -2195,7 +2195,7 @@ var spanish_stemmer_default = class extends BaseStemmer {
|
|
|
2195
2195
|
stemWord = this.stem;
|
|
2196
2196
|
};
|
|
2197
2197
|
|
|
2198
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2198
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/stem.js
|
|
2199
2199
|
var SNOWBALL_VERSION = "3.1.1";
|
|
2200
2200
|
var CYRILLIC_STEMMERS = [...languagesOf("cyrillic"), "none"];
|
|
2201
2201
|
var LATIN_STEMMERS = [...languagesOf("latin"), "none"];
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/atomic-write.js
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
12
|
import { constants } from "node:fs";
|
|
13
13
|
import { link, open, realpath, rename, unlink } from "node:fs/promises";
|
|
@@ -45,7 +45,7 @@ var writeFileAtomic = /* @__PURE__ */ __name(async (path, content, { mode = 384,
|
|
|
45
45
|
}
|
|
46
46
|
}, "writeFileAtomic");
|
|
47
47
|
|
|
48
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/ordinary-file.js
|
|
49
49
|
import { constants as constants2 } from "node:fs";
|
|
50
50
|
import { lstat, open as open2 } from "node:fs/promises";
|
|
51
51
|
var deviceOf = /* @__PURE__ */ __name((dev) => process.platform === "win32" ? BigInt.asUintN(32, dev) : dev, "deviceOf");
|
|
@@ -111,21 +111,21 @@ var syncDirectory = /* @__PURE__ */ __name(async (path) => {
|
|
|
111
111
|
}
|
|
112
112
|
}, "syncDirectory");
|
|
113
113
|
|
|
114
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/lock.js
|
|
115
115
|
import { mkdir as mkdir2 } from "node:fs/promises";
|
|
116
116
|
import { basename as basename2, dirname as dirname2 } from "node:path";
|
|
117
117
|
|
|
118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
|
|
119
119
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
120
120
|
import { lstat as lstat3, mkdir, open as open3, realpath as realpath3, rmdir as rmdir2, unlink as unlink4 } from "node:fs/promises";
|
|
121
121
|
import { hostname as hostname2 } from "node:os";
|
|
122
122
|
import { join as join3 } from "node:path";
|
|
123
123
|
|
|
124
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
124
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
|
|
125
125
|
import { lstat as lstat2, readdir, realpath as realpath2, unlink as unlink2 } from "node:fs/promises";
|
|
126
126
|
import { join as join2 } from "node:path";
|
|
127
127
|
|
|
128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
128
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/native-lease-owner.js
|
|
129
129
|
import { hostname } from "node:os";
|
|
130
130
|
var missingLeaseFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingLeaseFile");
|
|
131
131
|
var readLeaseOwner = /* @__PURE__ */ __name(async (path, name, signal) => {
|
|
@@ -170,7 +170,7 @@ var leaseOwnerStatus = /* @__PURE__ */ __name((owner) => {
|
|
|
170
170
|
}
|
|
171
171
|
}, "leaseOwnerStatus");
|
|
172
172
|
|
|
173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
173
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
|
|
174
174
|
var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
|
|
175
175
|
const inspect = /* @__PURE__ */ __name(async (destination, options = {}) => {
|
|
176
176
|
options.signal?.throwIfAborted();
|
|
@@ -229,7 +229,7 @@ var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
|
|
|
229
229
|
return { inspect, recover };
|
|
230
230
|
}, "leaseInspection");
|
|
231
231
|
|
|
232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/native-lease-release.js
|
|
233
233
|
import { rmdir, unlink as unlink3 } from "node:fs/promises";
|
|
234
234
|
var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identity) => {
|
|
235
235
|
let releasing;
|
|
@@ -254,7 +254,7 @@ var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identi
|
|
|
254
254
|
};
|
|
255
255
|
}, "ownedNativeLease");
|
|
256
256
|
|
|
257
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
257
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
|
|
258
258
|
var validName = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !/[\\/\0:]/.test(value), "validName");
|
|
259
259
|
var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
|
|
260
260
|
const { markerDirectory, legacyMarker } = layout;
|
|
@@ -325,7 +325,7 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
|
|
|
325
325
|
};
|
|
326
326
|
}, "nativeWriterLeaseStore");
|
|
327
327
|
|
|
328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/lock.js
|
|
329
329
|
var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
|
|
330
330
|
const folder = dirname2(path);
|
|
331
331
|
await mkdir2(folder, { recursive: true, mode: 448 });
|
|
@@ -340,7 +340,7 @@ var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
|
|
|
340
340
|
});
|
|
341
341
|
}, "acquireLock");
|
|
342
342
|
|
|
343
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
343
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/bounded-utf8.js
|
|
344
344
|
var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
|
|
345
345
|
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 16 * 1024 * 1024)
|
|
346
346
|
throw new CliError("validation_error", "file maxBytes takes 1\u201316777216 bytes");
|
|
@@ -369,7 +369,7 @@ var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
|
|
|
369
369
|
}
|
|
370
370
|
}, "readBoundedUtf8File");
|
|
371
371
|
|
|
372
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/files/safe-name.js
|
|
373
373
|
import { basename as basename3 } from "node:path";
|
|
374
374
|
var safeName = /* @__PURE__ */ __name((name, platform = process.platform) => {
|
|
375
375
|
let plain = name === void 0 ? "" : basename3(name.replaceAll("\\", "/")).replace(/[\p{Cc}---]/gu, "").replace(/^\.+/, "");
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
installFiles,
|
|
9
9
|
megabytes,
|
|
10
10
|
sharedModelsDirectory
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GTDCP5OG.js";
|
|
12
12
|
import {
|
|
13
13
|
importFrom
|
|
14
14
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -19,12 +19,12 @@ import {
|
|
|
19
19
|
__name
|
|
20
20
|
} from "./chunk-ZVVMGPBJ.js";
|
|
21
21
|
|
|
22
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
|
|
23
23
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
24
24
|
import { availableParallelism } from "node:os";
|
|
25
25
|
import { basename, join as join2 } from "node:path";
|
|
26
26
|
|
|
27
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
|
|
28
28
|
import { createHash } from "node:crypto";
|
|
29
29
|
import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
30
30
|
import { join } from "node:path";
|
|
@@ -207,7 +207,7 @@ var openSession = /* @__PURE__ */ __name(async (bytes, threads, options = {}) =>
|
|
|
207
207
|
return { ort, session: await ort.InferenceSession.create(bytes, options) };
|
|
208
208
|
}, "openSession");
|
|
209
209
|
|
|
210
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
|
|
211
211
|
var textModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("text", env), "textModelsDirectory");
|
|
212
212
|
var placedText = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedText");
|
|
213
213
|
var isTextModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedText(model, directory)), "isTextModelInstalled");
|