@moldea.ai/cli 14.0.0 → 14.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/portable/SHA256SUMS +16 -16
- package/dist/portable/analysis-worker.mjs +110 -133
- package/dist/portable/chunk-1306b995.mjs +2 -0
- package/dist/portable/chunk-24ea7c23.mjs +328 -0
- package/dist/portable/chunk-2cc3bf5c.mjs +399 -0
- package/dist/portable/chunk-2e9d4c63.mjs +95 -0
- package/dist/portable/chunk-43b8574a.mjs +1837 -0
- package/dist/portable/chunk-517c6bfb.mjs +2 -0
- package/dist/portable/chunk-8f198616.mjs +4414 -0
- package/dist/portable/chunk-936e5d09.mjs +112519 -0
- package/dist/portable/chunk-98d84174.mjs +422 -0
- package/dist/portable/chunk-9e42770a.mjs +3114 -0
- package/dist/portable/chunk-cea1378f.mjs +50 -0
- package/dist/portable/chunk-d6656fa6.mjs +14 -0
- package/dist/portable/chunk-d9e49acd.mjs +302 -0
- package/dist/portable/moldea.mjs +1995 -2868
- package/dist/portable/node-runner.mjs +77 -106
- package/package.json +1 -1
- package/dist/portable/chunk-131f8005.mjs +0 -115
- package/dist/portable/chunk-2ba7e89e.mjs +0 -26
- package/dist/portable/chunk-459da9cf.mjs +0 -4138
- package/dist/portable/chunk-728df961.mjs +0 -544
- package/dist/portable/chunk-8d6114d2.mjs +0 -588
- package/dist/portable/chunk-90403e67.mjs +0 -2
- package/dist/portable/chunk-94b5ac22.mjs +0 -59
- package/dist/portable/chunk-a5514957.mjs +0 -5870
- package/dist/portable/chunk-b98ca669.mjs +0 -2
- package/dist/portable/chunk-c13db66a.mjs +0 -380
- package/dist/portable/chunk-d5af3eda.mjs +0 -2926
- package/dist/portable/chunk-ec3f49d3.mjs +0 -367
- package/dist/portable/chunk-fcbcf4e3.mjs +0 -147458
|
@@ -0,0 +1,1837 @@
|
|
|
1
|
+
import { t as e } from "./chunk-d6656fa6.mjs";
|
|
2
|
+
import { f as t, p as n, s as r } from "./chunk-2cc3bf5c.mjs";
|
|
3
|
+
import { m as i, n as a, p as o } from "./chunk-8f198616.mjs";
|
|
4
|
+
import { execFile as s, spawn as c } from "node:child_process";
|
|
5
|
+
import { setTimeout as l } from "node:timers/promises";
|
|
6
|
+
import { createHash as u, timingSafeEqual as d } from "node:crypto";
|
|
7
|
+
import { stat as f } from "node:fs/promises";
|
|
8
|
+
//#region ../../node_modules/.pnpm/jg-process@1.6.2/node_modules/jg-process/dist/shared/constants.js
|
|
9
|
+
var p = 1048576, m = {
|
|
10
|
+
PROCESS_START_FAILED: "PROCESS_START_FAILED",
|
|
11
|
+
PROCESS_TIMED_OUT: "PROCESS_TIMED_OUT",
|
|
12
|
+
PROCESS_OUTPUT_TOO_LARGE: "PROCESS_OUTPUT_TOO_LARGE",
|
|
13
|
+
PROCESS_TREE_SURVIVED: "PROCESS_TREE_SURVIVED",
|
|
14
|
+
INVALID_PORT: "INVALID_PORT",
|
|
15
|
+
PORT_RESERVATION_FAILED: "PORT_RESERVATION_FAILED",
|
|
16
|
+
UNSUPPORTED_PACKAGE_MANAGER: "UNSUPPORTED_PACKAGE_MANAGER",
|
|
17
|
+
PACKAGE_MANAGER_NOT_FOUND: "PACKAGE_MANAGER_NOT_FOUND",
|
|
18
|
+
INVALID_READINESS_OPTIONS: "INVALID_READINESS_OPTIONS",
|
|
19
|
+
PROCESS_NOT_READY: "PROCESS_NOT_READY",
|
|
20
|
+
PROCESS_EXITED_BEFORE_READY: "PROCESS_EXITED_BEFORE_READY",
|
|
21
|
+
PROCESS_INTERRUPTED: "PROCESS_INTERRUPTED",
|
|
22
|
+
INVALID_SIGNAL: "INVALID_SIGNAL",
|
|
23
|
+
INVALID_PROCESS_OPTIONS: "INVALID_PROCESS_OPTIONS",
|
|
24
|
+
INVALID_PROCESS_ID: "INVALID_PROCESS_ID",
|
|
25
|
+
INVALID_ARGUMENTS: "INVALID_ARGUMENTS",
|
|
26
|
+
STDIN_TOO_LARGE: "STDIN_TOO_LARGE"
|
|
27
|
+
}, h = "Get-CimInstance -ClassName Win32_Process | ForEach-Object { '{0} {1} {2}' -f $_.ProcessId, $_.ParentProcessId, $(if ($_.CreationDate) { $_.CreationDate.ToFileTimeUtc() } else { 0 }) }", g = /^(\d+) (\d+) (\d+)$/u, _ = (e) => e.exitCode !== null || e.signalCode !== null, v = async (e, t) => {
|
|
28
|
+
let n = Date.now() + t;
|
|
29
|
+
for (; !e();) {
|
|
30
|
+
if (Date.now() >= n) return !1;
|
|
31
|
+
await l(50);
|
|
32
|
+
}
|
|
33
|
+
return !0;
|
|
34
|
+
}, y = (e) => new t(`The process tree of pid ${e} is still running after it was force-stopped.`, { code: m.PROCESS_TREE_SURVIVED }), b = (e) => e.split(/\r?\n/u).flatMap((e) => {
|
|
35
|
+
let t = g.exec(e.trim());
|
|
36
|
+
if (t === null) return [];
|
|
37
|
+
let [, n = "", r = "", i = ""] = t;
|
|
38
|
+
return [{
|
|
39
|
+
pid: Number(n),
|
|
40
|
+
parentPid: Number(r),
|
|
41
|
+
createdAt: BigInt(i)
|
|
42
|
+
}];
|
|
43
|
+
}), x = (e, t) => {
|
|
44
|
+
let n = new Map();
|
|
45
|
+
for (let t of e) {
|
|
46
|
+
let e = n.get(t.parentPid);
|
|
47
|
+
e === void 0 ? n.set(t.parentPid, [t]) : e.push(t);
|
|
48
|
+
}
|
|
49
|
+
let r = e.find((e) => e.pid === t);
|
|
50
|
+
if (r === void 0) return [];
|
|
51
|
+
let i = [r], a = new Set([t]);
|
|
52
|
+
for (let e of i) for (let t of n.get(e.pid) ?? []) !a.has(t.pid) && t.createdAt >= e.createdAt && (a.add(t.pid), i.push(t));
|
|
53
|
+
return i.slice(1).map((e) => e.pid);
|
|
54
|
+
}, ee = (e) => new Promise((t) => {
|
|
55
|
+
s("powershell.exe", [
|
|
56
|
+
"-NoProfile",
|
|
57
|
+
"-NonInteractive",
|
|
58
|
+
"-Command",
|
|
59
|
+
h
|
|
60
|
+
], {
|
|
61
|
+
timeout: 1e4,
|
|
62
|
+
windowsHide: !0
|
|
63
|
+
}, (n, r) => {
|
|
64
|
+
t(n === null ? x(b(r), e) : []);
|
|
65
|
+
});
|
|
66
|
+
}), te = (e) => {
|
|
67
|
+
try {
|
|
68
|
+
return process.kill(e, 0), !0;
|
|
69
|
+
} catch {
|
|
70
|
+
return !1;
|
|
71
|
+
}
|
|
72
|
+
}, ne = async (e, t) => {
|
|
73
|
+
if (_(e)) return;
|
|
74
|
+
let n = new Set(await ee(t));
|
|
75
|
+
if (!_(e) && (await new Promise((e) => {
|
|
76
|
+
s("taskkill", [
|
|
77
|
+
"/PID",
|
|
78
|
+
String(t),
|
|
79
|
+
"/T",
|
|
80
|
+
"/F"
|
|
81
|
+
], {
|
|
82
|
+
timeout: 1e4,
|
|
83
|
+
windowsHide: !0
|
|
84
|
+
}, () => e());
|
|
85
|
+
}), !await v(() => {
|
|
86
|
+
for (let e of n) te(e) || n.delete(e);
|
|
87
|
+
return _(e) && n.size === 0;
|
|
88
|
+
}, 1e4))) throw y(t);
|
|
89
|
+
}, re = process.platform === "win32", ie = (e) => {
|
|
90
|
+
try {
|
|
91
|
+
return process.kill(e, 0), !0;
|
|
92
|
+
} catch (e) {
|
|
93
|
+
return e.code === "EPERM";
|
|
94
|
+
}
|
|
95
|
+
}, ae = (e, t) => {
|
|
96
|
+
try {
|
|
97
|
+
return process.kill(e, t), !0;
|
|
98
|
+
} catch {
|
|
99
|
+
return !1;
|
|
100
|
+
}
|
|
101
|
+
}, oe = (e, t) => _(e) && !ie(-t), se = (e, t, n) => {
|
|
102
|
+
!ae(-t, n) && !_(e) && ae(t, n);
|
|
103
|
+
}, ce = async (e, t, n) => {
|
|
104
|
+
let r = () => oe(e, t);
|
|
105
|
+
if (!r() && (se(e, t, "SIGTERM"), !await v(r, n * 1e3) && (se(e, t, "SIGKILL"), !await v(r, 2e3)))) throw y(t);
|
|
106
|
+
}, le = async (e, t = 5) => {
|
|
107
|
+
let { pid: n } = e;
|
|
108
|
+
if (n !== void 0) {
|
|
109
|
+
if (re) {
|
|
110
|
+
await ne(e, n);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
await ce(e, n, t);
|
|
114
|
+
}
|
|
115
|
+
}, ue = [
|
|
116
|
+
"EPIPE",
|
|
117
|
+
"EOF",
|
|
118
|
+
"ERR_STREAM_DESTROYED"
|
|
119
|
+
], de = (e, n) => new t(`Unable to start '${e}'.`, {
|
|
120
|
+
code: m.PROCESS_START_FAILED,
|
|
121
|
+
cause: n
|
|
122
|
+
}), fe = (e, n) => new t(`The process '${e}' wrote more than ${n} bytes of output.`, { code: m.PROCESS_OUTPUT_TOO_LARGE }), pe = (e, n) => {
|
|
123
|
+
if (!(e === void 0 || typeof e == "number" && Number.isFinite(e) && e > 0 && e <= 2147483) || !Number.isSafeInteger(n) || n <= 0) throw new t("The timeout must be a positive number of at most 2,147,483 seconds, and the output limit a positive safe integer.", {
|
|
124
|
+
code: m.INVALID_PROCESS_OPTIONS,
|
|
125
|
+
data: {
|
|
126
|
+
timeoutSeconds: String(e),
|
|
127
|
+
maxOutputBytes: String(n)
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}, me = (e, t) => {
|
|
131
|
+
let n = Buffer.concat(e);
|
|
132
|
+
return t === "buffer" ? n : n.toString("utf-8");
|
|
133
|
+
}, he = (e) => {
|
|
134
|
+
e.stdin?.destroy(), e.stdout?.destroy(), e.stderr?.destroy();
|
|
135
|
+
}, ge = (e, t, n) => new Promise((r) => {
|
|
136
|
+
if (t()) {
|
|
137
|
+
r(!0);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
let i = () => {
|
|
141
|
+
clearTimeout(a), r(!0);
|
|
142
|
+
}, a = setTimeout(() => {
|
|
143
|
+
e.off("close", i), r(!1);
|
|
144
|
+
}, n);
|
|
145
|
+
e.once("close", i);
|
|
146
|
+
}), _e = async (e) => {
|
|
147
|
+
try {
|
|
148
|
+
await le(e);
|
|
149
|
+
} catch (t) {
|
|
150
|
+
throw he(e), t;
|
|
151
|
+
}
|
|
152
|
+
}, ve = async (e) => {
|
|
153
|
+
let { command: n, args: r, cwd: i, env: a, input: o, timeoutSeconds: s, maxOutputBytes: l = p, signal: u, encoding: d = "utf-8" } = e;
|
|
154
|
+
pe(s, l), u?.throwIfAborted();
|
|
155
|
+
let f = performance.now(), h = c(n, r, {
|
|
156
|
+
cwd: i,
|
|
157
|
+
env: a,
|
|
158
|
+
stdio: "pipe",
|
|
159
|
+
detached: process.platform !== "win32",
|
|
160
|
+
windowsHide: !0
|
|
161
|
+
}), g = [], _ = [], v = 0, y = !1;
|
|
162
|
+
h.once("close", () => {
|
|
163
|
+
y = !0;
|
|
164
|
+
});
|
|
165
|
+
let b = await new Promise((e) => {
|
|
166
|
+
let r, i = () => {
|
|
167
|
+
clearTimeout(r), e({
|
|
168
|
+
kind: "failed",
|
|
169
|
+
error: u?.reason
|
|
170
|
+
});
|
|
171
|
+
}, a = (t) => {
|
|
172
|
+
clearTimeout(r), u?.removeEventListener("abort", i), e(t);
|
|
173
|
+
}, c = (e) => (t) => {
|
|
174
|
+
if (v += t.length, v > l) {
|
|
175
|
+
a({
|
|
176
|
+
kind: "failed",
|
|
177
|
+
error: fe(n, l)
|
|
178
|
+
});
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
e.push(t);
|
|
182
|
+
};
|
|
183
|
+
h.stdout.on("data", c(g)), h.stderr.on("data", c(_)), h.stdout.on("error", () => void 0), h.stderr.on("error", () => void 0), h.on("error", (e) => a({
|
|
184
|
+
kind: "failed",
|
|
185
|
+
error: de(n, e)
|
|
186
|
+
})), h.once("exit", (e, t) => a({
|
|
187
|
+
kind: "exited",
|
|
188
|
+
exitCode: e,
|
|
189
|
+
signalCode: t
|
|
190
|
+
})), h.stdin.on("error", (e) => {
|
|
191
|
+
ue.includes(e.code ?? "") || a({
|
|
192
|
+
kind: "failed",
|
|
193
|
+
error: de(n, e)
|
|
194
|
+
});
|
|
195
|
+
}), s !== void 0 && (r = setTimeout(() => a({
|
|
196
|
+
kind: "failed",
|
|
197
|
+
error: new t(`The process '${n}' didn't finish within ${s} seconds.`, { code: m.PROCESS_TIMED_OUT })
|
|
198
|
+
}), s * 1e3)), u?.addEventListener("abort", i, { once: !0 }), h.stdin.end(o);
|
|
199
|
+
});
|
|
200
|
+
if (b.kind === "failed") throw await _e(h), he(h), b.error;
|
|
201
|
+
if (await _e(h), !await ge(h, () => y, 5e3)) throw he(h), new t(`A process started by '${n}' kept its output open after it exited.`, { code: m.PROCESS_TREE_SURVIVED });
|
|
202
|
+
if (v > l) throw fe(n, l);
|
|
203
|
+
return {
|
|
204
|
+
exitCode: b.exitCode,
|
|
205
|
+
signalCode: b.signalCode,
|
|
206
|
+
stdout: me(g, d),
|
|
207
|
+
stderr: me(_, d),
|
|
208
|
+
durationMs: Math.round(performance.now() - f)
|
|
209
|
+
};
|
|
210
|
+
}, S = {
|
|
211
|
+
Composition: "composition",
|
|
212
|
+
Content: "content",
|
|
213
|
+
Inspect: "inspect",
|
|
214
|
+
Scope: "scope",
|
|
215
|
+
Validate: "validate"
|
|
216
|
+
}, C = {
|
|
217
|
+
Help: "--help",
|
|
218
|
+
Json: "--json",
|
|
219
|
+
Cursor: "--cursor",
|
|
220
|
+
MaxDiagnostics: "--max-diagnostics",
|
|
221
|
+
MaxEntries: "--max-entries",
|
|
222
|
+
MaxCoverage: "--max-coverage",
|
|
223
|
+
MaxFileBytes: "--max-file-bytes",
|
|
224
|
+
MaxManifestBytes: "--max-manifest-bytes",
|
|
225
|
+
MaxOutputBytes: "--max-output-bytes",
|
|
226
|
+
MaxTotalBytes: "--max-total-bytes",
|
|
227
|
+
NoColor: "--no-color",
|
|
228
|
+
Path: "--path",
|
|
229
|
+
PathsStdin: "--paths-stdin",
|
|
230
|
+
Repository: "--repository",
|
|
231
|
+
Version: "--version"
|
|
232
|
+
}, ye = Object.freeze({
|
|
233
|
+
maxDiagnostics: 1e4,
|
|
234
|
+
maxEntries: 1e5,
|
|
235
|
+
maxCoverage: 1e4,
|
|
236
|
+
maxFileBytes: 8388608,
|
|
237
|
+
maxManifestBytes: 2097152,
|
|
238
|
+
maxTotalBytes: 134217728
|
|
239
|
+
}), be = 65536, w = class extends Error {
|
|
240
|
+
code;
|
|
241
|
+
constructor(e) {
|
|
242
|
+
super(e), this.code = e, this.name = "MoldeaCliOutputPageException";
|
|
243
|
+
}
|
|
244
|
+
}, xe = {
|
|
245
|
+
UNSUPPORTED_HASH_ALGORITHM: "UNSUPPORTED_HASH_ALGORITHM",
|
|
246
|
+
INVALID_BYTE_LENGTH: "INVALID_BYTE_LENGTH",
|
|
247
|
+
UNSUPPORTED_ENCODING: "UNSUPPORTED_ENCODING",
|
|
248
|
+
INVALID_DIGIT_COUNT: "INVALID_DIGIT_COUNT",
|
|
249
|
+
INVALID_HMAC_SECRET: "INVALID_HMAC_SECRET",
|
|
250
|
+
INVALID_HMAC_DOMAIN: "INVALID_HMAC_DOMAIN",
|
|
251
|
+
INVALID_TOTP_SECRET: "INVALID_TOTP_SECRET",
|
|
252
|
+
TOTP_INVALID: "TOTP_INVALID",
|
|
253
|
+
TOTP_ALREADY_USED: "TOTP_ALREADY_USED"
|
|
254
|
+
}, Se = [
|
|
255
|
+
"sha256",
|
|
256
|
+
"sha384",
|
|
257
|
+
"sha512"
|
|
258
|
+
], Ce = (e, n = "sha256") => {
|
|
259
|
+
if (!Se.includes(n)) throw new t("The hash algorithm must be sha256, sha384, or sha512.", {
|
|
260
|
+
code: xe.UNSUPPORTED_HASH_ALGORITHM,
|
|
261
|
+
data: { algorithm: String(n) }
|
|
262
|
+
});
|
|
263
|
+
return u(n).update(e).digest("hex");
|
|
264
|
+
}, we = /^sha256:[0-9a-f]{64}$/u, Te = /^[A-Za-z0-9_-]+$/u, Ee = Object.freeze([
|
|
265
|
+
"checksum",
|
|
266
|
+
"command",
|
|
267
|
+
"filtersDigest",
|
|
268
|
+
"lastKey",
|
|
269
|
+
"snapshotDigest",
|
|
270
|
+
"sourceCursor",
|
|
271
|
+
"version"
|
|
272
|
+
]), T = (e) => `sha256:${Ce(r(e, { strict: !0 }))}`, De = (e) => T(e), Oe = (e, t) => {
|
|
273
|
+
let n = Buffer.from(e, "utf8"), r = Buffer.from(t, "utf8");
|
|
274
|
+
return n.length === r.length && d(n, r);
|
|
275
|
+
}, ke = (e) => {
|
|
276
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
277
|
+
let t = e, n = Object.keys(t).sort();
|
|
278
|
+
return n.length === Ee.length && n.every((e, t) => e === Ee[t]) && t.version === 2 && (t.command === "content" || t.command === "inspect" || t.command === "scope" || t.command === "validate") && typeof t.filtersDigest == "string" && we.test(t.filtersDigest) && typeof t.lastKey == "string" && t.lastKey.length > 0 && (t.sourceCursor === null || typeof t.sourceCursor == "string") && typeof t.snapshotDigest == "string" && we.test(t.snapshotDigest) && typeof t.checksum == "string" && we.test(t.checksum);
|
|
279
|
+
}, Ae = (e, t, n, i, a = null) => {
|
|
280
|
+
let o = {
|
|
281
|
+
command: e,
|
|
282
|
+
filtersDigest: T(t),
|
|
283
|
+
lastKey: i,
|
|
284
|
+
sourceCursor: a,
|
|
285
|
+
snapshotDigest: n,
|
|
286
|
+
version: 2
|
|
287
|
+
}, s = {
|
|
288
|
+
...o,
|
|
289
|
+
checksum: De(o)
|
|
290
|
+
};
|
|
291
|
+
return Buffer.from(r(s, { strict: !0 }), "utf8").toString("base64url");
|
|
292
|
+
}, je = (e) => {
|
|
293
|
+
let t;
|
|
294
|
+
try {
|
|
295
|
+
if (!Te.test(e.cursor)) throw TypeError("The cursor is not canonical base64url.");
|
|
296
|
+
let n = Buffer.from(e.cursor, "base64url");
|
|
297
|
+
if (n.toString("base64url") !== e.cursor) throw TypeError("The cursor is not canonical base64url.");
|
|
298
|
+
let r = n.toString("utf8");
|
|
299
|
+
t = JSON.parse(r);
|
|
300
|
+
} catch {
|
|
301
|
+
throw new w("CURSOR_INVALID");
|
|
302
|
+
}
|
|
303
|
+
if (!ke(t)) throw new w("CURSOR_INVALID");
|
|
304
|
+
let { checksum: n, ...r } = t;
|
|
305
|
+
if (!Oe(n, De(r)) || t.command !== e.command || t.filtersDigest !== T(e.filters)) throw new w("CURSOR_INVALID");
|
|
306
|
+
if (e.snapshotDigest !== void 0 && t.snapshotDigest !== e.snapshotDigest) throw new w("CURSOR_SNAPSHOT_CHANGED");
|
|
307
|
+
return Object.freeze({
|
|
308
|
+
lastKey: t.lastKey,
|
|
309
|
+
snapshotDigest: t.snapshotDigest,
|
|
310
|
+
sourceCursor: t.sourceCursor
|
|
311
|
+
});
|
|
312
|
+
}, Me = (e) => {
|
|
313
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
314
|
+
let n = e[t]?.key, r = e[t - 1]?.key;
|
|
315
|
+
if (n === void 0 || n.length === 0 || r !== void 0 && n <= r) throw TypeError("Output records must have unique keys in ascending order.");
|
|
316
|
+
}
|
|
317
|
+
}, Ne = (e) => {
|
|
318
|
+
Me(e.records);
|
|
319
|
+
let t = e.cursor === null ? null : je({
|
|
320
|
+
command: e.command,
|
|
321
|
+
cursor: e.cursor,
|
|
322
|
+
filters: e.filters,
|
|
323
|
+
snapshotDigest: e.snapshotDigest
|
|
324
|
+
}), n = t === null ? 0 : t.sourceCursor === null ? e.records.findIndex(({ key: e }) => e === t.lastKey) + 1 : 0;
|
|
325
|
+
if (t !== null && t.sourceCursor === null && n === 0) throw new w("CURSOR_INVALID");
|
|
326
|
+
let r = Object.freeze([]), a = Object.freeze({
|
|
327
|
+
cursor: null,
|
|
328
|
+
records: r
|
|
329
|
+
});
|
|
330
|
+
if (n === e.records.length) {
|
|
331
|
+
if (e.measure(a, 2) > e.maxOutputBytes) throw new w("OUTPUT_BUDGET_TOO_SMALL");
|
|
332
|
+
return a;
|
|
333
|
+
}
|
|
334
|
+
let o = (t, n) => {
|
|
335
|
+
let r = e.sourceCursorForRecord?.(t) ?? null;
|
|
336
|
+
return (e.sourceCursorForRecord === void 0 ? n < e.records.length : r !== null) ? Ae(e.command, e.filters, e.snapshotDigest, t.key, r) : null;
|
|
337
|
+
}, s = i(e.records.slice(n), {
|
|
338
|
+
maxBytes: e.maxOutputBytes,
|
|
339
|
+
measurePage: (t, r) => e.measure(Object.freeze({
|
|
340
|
+
cursor: o(t[t.length - 1], n + t.length),
|
|
341
|
+
records: t
|
|
342
|
+
}), r)
|
|
343
|
+
}), c = s[s.length - 1];
|
|
344
|
+
if (c === void 0) throw new w("OUTPUT_BUDGET_TOO_SMALL");
|
|
345
|
+
return Object.freeze({
|
|
346
|
+
cursor: o(c, n + s.length),
|
|
347
|
+
records: Object.freeze(s)
|
|
348
|
+
});
|
|
349
|
+
}, Pe = /^\d+$/u, Fe = (e) => {
|
|
350
|
+
if (!Pe.test(e)) return null;
|
|
351
|
+
let t = Number(e);
|
|
352
|
+
return Number.isSafeInteger(t) && t > 0 ? t : null;
|
|
353
|
+
}, Ie = (e) => {
|
|
354
|
+
let t = Fe(e);
|
|
355
|
+
return t !== null && t >= 4096 && t <= 1048576 ? t : null;
|
|
356
|
+
}, Le = (e) => e.maxManifestBytes <= e.maxFileBytes && e.maxFileBytes <= e.maxTotalBytes, E = (e) => e.length > 0 && !e.includes("\0") && e.isWellFormed(), Re = (e) => e.length > 0 && e.length <= 16384 && !e.includes("\0") && e.isWellFormed(), ze = new Set(Object.values(S)), Be = {
|
|
357
|
+
[C.MaxDiagnostics]: "maxDiagnostics",
|
|
358
|
+
[C.MaxEntries]: "maxEntries",
|
|
359
|
+
[C.MaxCoverage]: "maxCoverage",
|
|
360
|
+
[C.MaxFileBytes]: "maxFileBytes",
|
|
361
|
+
[C.MaxManifestBytes]: "maxManifestBytes",
|
|
362
|
+
[C.MaxTotalBytes]: "maxTotalBytes"
|
|
363
|
+
}, D = (e, t, n) => ({
|
|
364
|
+
code: e,
|
|
365
|
+
command: t,
|
|
366
|
+
isJson: n,
|
|
367
|
+
kind: "error"
|
|
368
|
+
}), Ve = (e) => e !== void 0 && ze.has(e), He = (e) => {
|
|
369
|
+
let t = e.includes(C.Json);
|
|
370
|
+
if (e.length === 0) return {
|
|
371
|
+
command: null,
|
|
372
|
+
kind: "help"
|
|
373
|
+
};
|
|
374
|
+
let n = e[0];
|
|
375
|
+
if (n === C.Help) return e.length === 1 ? {
|
|
376
|
+
command: null,
|
|
377
|
+
kind: "help"
|
|
378
|
+
} : D("INVALID_ARGUMENT", null, t);
|
|
379
|
+
if (n === C.Version) return e.length === 1 ? { kind: "version" } : D("INVALID_ARGUMENT", null, t);
|
|
380
|
+
let r = Ve(n) ? n : null;
|
|
381
|
+
if (r === null) return D("INVALID_ARGUMENT", null, t);
|
|
382
|
+
if (e.length === 2 && e[1] === C.Help) return {
|
|
383
|
+
command: r,
|
|
384
|
+
kind: "help"
|
|
385
|
+
};
|
|
386
|
+
let i = new Set(), a = { ...ye }, o = !1, s = null, c = be, l = null, u = "none", d = null;
|
|
387
|
+
for (let n = 1; n < e.length; n += 1) {
|
|
388
|
+
let f = e[n];
|
|
389
|
+
if (f === void 0 || i.has(f)) return D("INVALID_ARGUMENT", r, t);
|
|
390
|
+
if (i.add(f), f === C.Json) continue;
|
|
391
|
+
if (f === C.NoColor) {
|
|
392
|
+
o = !0;
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
if (f === C.PathsStdin) {
|
|
396
|
+
u = "stdin";
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
if (f === C.Help || f === C.Version) return D("INVALID_ARGUMENT", r, t);
|
|
400
|
+
let p = Be[f], m = f === C.Repository, h = f === C.Cursor, g = f === C.MaxOutputBytes, _ = f === C.Path;
|
|
401
|
+
if (p === void 0 && !m && !h && !g && !_ || r === S.Composition) return D("INVALID_ARGUMENT", r, t);
|
|
402
|
+
let v = e[n + 1];
|
|
403
|
+
if (v === void 0 || v.startsWith("--")) return D("INVALID_ARGUMENT", r, t);
|
|
404
|
+
if (n += 1, h) {
|
|
405
|
+
if (!Re(v)) return D("INVALID_ARGUMENT", r, t);
|
|
406
|
+
s = v;
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (g) {
|
|
410
|
+
let e = Ie(v);
|
|
411
|
+
if (e === null) return D("RESOURCE_LIMIT_CONFIGURATION_INVALID", r, t);
|
|
412
|
+
c = e;
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (_) {
|
|
416
|
+
if (!E(v)) return D("INVALID_ARGUMENT", r, t);
|
|
417
|
+
l = v, u = "path";
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
if (m) {
|
|
421
|
+
if (!E(v)) return D("INVALID_ARGUMENT", r, t);
|
|
422
|
+
d = v;
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
let y = Fe(v);
|
|
426
|
+
if (y === null || p === void 0) return D("RESOURCE_LIMIT_CONFIGURATION_INVALID", r, t);
|
|
427
|
+
a[p] = y;
|
|
428
|
+
}
|
|
429
|
+
if (!Le(a)) return D("RESOURCE_LIMIT_CONFIGURATION_INVALID", r, t);
|
|
430
|
+
let f = r === S.Scope, p = r === S.Content, m = l !== null, h = i.has(C.PathsStdin);
|
|
431
|
+
if ((m || h) && !f && !p || f && m === h || p && (!m || h) || f && i.has(C.MaxCoverage) || p && [
|
|
432
|
+
C.MaxDiagnostics,
|
|
433
|
+
C.MaxCoverage,
|
|
434
|
+
C.MaxManifestBytes
|
|
435
|
+
].some((e) => i.has(e)) || !t && (s !== null || i.has(C.MaxOutputBytes))) return D("INVALID_ARGUMENT", r, t);
|
|
436
|
+
let g = {
|
|
437
|
+
cursor: s,
|
|
438
|
+
isColorDisabled: o,
|
|
439
|
+
isJson: t,
|
|
440
|
+
maxOutputBytes: c,
|
|
441
|
+
path: l,
|
|
442
|
+
pathsInput: u,
|
|
443
|
+
repositoryDirectory: d,
|
|
444
|
+
resourceLimits: Object.freeze({ ...a })
|
|
445
|
+
};
|
|
446
|
+
return {
|
|
447
|
+
invocation: Object.freeze({
|
|
448
|
+
command: r,
|
|
449
|
+
options: Object.freeze(g)
|
|
450
|
+
}),
|
|
451
|
+
kind: "command"
|
|
452
|
+
};
|
|
453
|
+
}, Ue = Object.freeze({
|
|
454
|
+
COMPOSITION_STATE_INVALID: Object.freeze({
|
|
455
|
+
message: "The installed composition state is invalid.",
|
|
456
|
+
retryable: !1,
|
|
457
|
+
source: "cli"
|
|
458
|
+
}),
|
|
459
|
+
CONTENT_INVALID: Object.freeze({
|
|
460
|
+
message: "The requested canonical asset is not valid moldea text.",
|
|
461
|
+
retryable: !1,
|
|
462
|
+
source: "cli"
|
|
463
|
+
}),
|
|
464
|
+
CONTENT_PATH_INVALID: Object.freeze({
|
|
465
|
+
message: "The content path must identify one canonical moldea text asset.",
|
|
466
|
+
retryable: !1,
|
|
467
|
+
source: "cli"
|
|
468
|
+
}),
|
|
469
|
+
CURSOR_INVALID: Object.freeze({
|
|
470
|
+
message: "The continuation cursor is invalid for this request.",
|
|
471
|
+
retryable: !1,
|
|
472
|
+
source: "cli"
|
|
473
|
+
}),
|
|
474
|
+
CURSOR_SNAPSHOT_CHANGED: Object.freeze({
|
|
475
|
+
message: "The continuation cursor belongs to a different repository snapshot.",
|
|
476
|
+
retryable: !0,
|
|
477
|
+
source: "cli"
|
|
478
|
+
}),
|
|
479
|
+
GIT_ACCESS_DENIED: Object.freeze({
|
|
480
|
+
message: "Git access was denied.",
|
|
481
|
+
retryable: !0,
|
|
482
|
+
source: "git"
|
|
483
|
+
}),
|
|
484
|
+
GIT_COMMAND_FAILED: Object.freeze({
|
|
485
|
+
message: "The Git command failed.",
|
|
486
|
+
retryable: !0,
|
|
487
|
+
source: "git"
|
|
488
|
+
}),
|
|
489
|
+
GIT_CONTENT_TRANSFORM_UNSUPPORTED: Object.freeze({
|
|
490
|
+
message: "The requested file uses an unsupported Git content transformation.",
|
|
491
|
+
retryable: !1,
|
|
492
|
+
source: "git"
|
|
493
|
+
}),
|
|
494
|
+
GIT_NOT_FOUND: Object.freeze({
|
|
495
|
+
message: "The Git executable is unavailable.",
|
|
496
|
+
retryable: !1,
|
|
497
|
+
source: "git"
|
|
498
|
+
}),
|
|
499
|
+
GIT_OPERATION_ABORTED: Object.freeze({
|
|
500
|
+
message: "The Git operation was aborted.",
|
|
501
|
+
retryable: !0,
|
|
502
|
+
source: "git"
|
|
503
|
+
}),
|
|
504
|
+
GIT_OUTPUT_INVALID: Object.freeze({
|
|
505
|
+
message: "Git returned invalid output.",
|
|
506
|
+
retryable: !1,
|
|
507
|
+
source: "git"
|
|
508
|
+
}),
|
|
509
|
+
GIT_REPOSITORY_NOT_FOUND: Object.freeze({
|
|
510
|
+
message: "The selected path is not inside a Git repository.",
|
|
511
|
+
retryable: !1,
|
|
512
|
+
source: "git"
|
|
513
|
+
}),
|
|
514
|
+
GIT_SPARSE_CHECKOUT_UNSUPPORTED: Object.freeze({
|
|
515
|
+
message: "Sparse Git checkouts are unsupported.",
|
|
516
|
+
retryable: !1,
|
|
517
|
+
source: "git"
|
|
518
|
+
}),
|
|
519
|
+
GIT_VERSION_INVALID: Object.freeze({
|
|
520
|
+
message: "The Git version output is invalid.",
|
|
521
|
+
retryable: !1,
|
|
522
|
+
source: "git"
|
|
523
|
+
}),
|
|
524
|
+
GIT_VERSION_UNSUPPORTED: Object.freeze({
|
|
525
|
+
message: "The installed Git version is unsupported.",
|
|
526
|
+
retryable: !1,
|
|
527
|
+
source: "git"
|
|
528
|
+
}),
|
|
529
|
+
GIT_WORK_TREE_REQUIRED: Object.freeze({
|
|
530
|
+
message: "A usable Git working tree is required.",
|
|
531
|
+
retryable: !1,
|
|
532
|
+
source: "git"
|
|
533
|
+
}),
|
|
534
|
+
INTERNAL_ERROR: Object.freeze({
|
|
535
|
+
message: "The command could not be completed.",
|
|
536
|
+
retryable: !1,
|
|
537
|
+
source: "cli"
|
|
538
|
+
}),
|
|
539
|
+
INVALID_ARGUMENT: Object.freeze({
|
|
540
|
+
message: "The command invocation is invalid.",
|
|
541
|
+
retryable: !1,
|
|
542
|
+
source: "cli"
|
|
543
|
+
}),
|
|
544
|
+
OUTPUT_BUDGET_TOO_SMALL: Object.freeze({
|
|
545
|
+
message: "The output byte budget cannot contain the next complete result.",
|
|
546
|
+
retryable: !1,
|
|
547
|
+
source: "cli"
|
|
548
|
+
}),
|
|
549
|
+
PATH_INPUT_INVALID: Object.freeze({
|
|
550
|
+
message: "The scope path input is invalid. Use leading-slash repository-logical paths and NUL-delimited UTF-8 on stdin.",
|
|
551
|
+
retryable: !1,
|
|
552
|
+
source: "cli"
|
|
553
|
+
}),
|
|
554
|
+
RESOURCE_LIMIT_CONFIGURATION_INVALID: Object.freeze({
|
|
555
|
+
message: "The resource-limit configuration is invalid.",
|
|
556
|
+
retryable: !1,
|
|
557
|
+
source: "cli"
|
|
558
|
+
}),
|
|
559
|
+
RESOURCE_LIMIT_EXCEEDED: Object.freeze({
|
|
560
|
+
message: "A resource limit was exceeded.",
|
|
561
|
+
retryable: !1,
|
|
562
|
+
source: "cli"
|
|
563
|
+
}),
|
|
564
|
+
WORKING_TREE_UNSTABLE: Object.freeze({
|
|
565
|
+
message: "The working tree did not remain stable.",
|
|
566
|
+
retryable: !0,
|
|
567
|
+
source: "cli"
|
|
568
|
+
})
|
|
569
|
+
}), O = Object.freeze({ kind: "git-working-tree" }), We = "Usage: moldea <command> [options]\n\nCommands:\n validate Validate the current moldea project.\n inspect Inspect content-free project metadata.\n scope Match changed paths to declared moldea relationships.\n content Read one canonical moldea asset explicitly.\n composition Report the installed CLI composition state.\n\nGlobal options:\n --help Show top-level help.\n --version Show the CLI version.\n\nRun \"moldea <command> --help\" for command-specific options.\n", k = " --repository <path> Select a Git working-tree directory.\n --json Emit one machine-readable JSON result.\n --no-color Disable ANSI styling in human output.\n", Ge = " --max-entries <integer> Override the repository entry limit.\n --max-file-bytes <integer> Override the per-file byte limit.\n --max-total-bytes <integer> Override the total cached-byte limit.\n", Ke = `${Ge} --max-manifest-bytes <integer> Override the manifest byte limit.
|
|
570
|
+
--max-diagnostics <integer> Override the diagnostic count limit.
|
|
571
|
+
`, A = " --max-output-bytes <integer> Bound JSON output from 4096 to 1048576 bytes.\n --cursor <opaque-cursor> Continue a prior JSON result page.\n", qe = `${k}${Ke} --max-coverage <integer> Override the binding coverage count limit.
|
|
572
|
+
${A}`, Je = `${k}${Ke}${A}`, Ye = `${k}${Ge}${A}`, Xe = {
|
|
573
|
+
[S.Composition]: "Usage: moldea composition [options]\n\nReport the installed CLI composition state.\n\nOptions:\n --json Emit one machine-readable JSON result.\n --no-color Disable ANSI styling in human output.\n --help Show this help.\n",
|
|
574
|
+
[S.Inspect]: `Usage: moldea inspect [options]
|
|
575
|
+
|
|
576
|
+
Inspect content-free metadata for the current moldea project.
|
|
577
|
+
|
|
578
|
+
Options:
|
|
579
|
+
${qe} --help Show this help.
|
|
580
|
+
`,
|
|
581
|
+
[S.Scope]: `Usage: moldea scope (--path <logical-path> | --paths-stdin) [options]
|
|
582
|
+
|
|
583
|
+
Match changed repository paths to declared moldea relationships. The stdin form accepts NUL-delimited UTF-8 logical paths.
|
|
584
|
+
|
|
585
|
+
Options:
|
|
586
|
+
${Je} --path <logical-path> Match one repository-logical path.
|
|
587
|
+
--paths-stdin Read NUL-delimited paths from stdin.
|
|
588
|
+
--help Show this help.
|
|
589
|
+
`,
|
|
590
|
+
[S.Content]: `Usage: moldea content --path <canonical-logical-path> [options]
|
|
591
|
+
|
|
592
|
+
Read one canonical moldea text asset in bounded Unicode-safe chunks.
|
|
593
|
+
|
|
594
|
+
Options:
|
|
595
|
+
${Ye} --path <canonical-logical-path> Select exactly one canonical moldea file.
|
|
596
|
+
--help Show this help.
|
|
597
|
+
`,
|
|
598
|
+
[S.Validate]: `Usage: moldea validate [options]
|
|
599
|
+
|
|
600
|
+
Validate the current moldea project.
|
|
601
|
+
|
|
602
|
+
Options:
|
|
603
|
+
${qe} --help Show this help.
|
|
604
|
+
`
|
|
605
|
+
}, Ze = Object.freeze({}), Qe = (e, t = Ze) => {
|
|
606
|
+
let n = Ue[e];
|
|
607
|
+
return Object.freeze({
|
|
608
|
+
code: e,
|
|
609
|
+
details: Object.freeze({ ...t }),
|
|
610
|
+
message: n.message,
|
|
611
|
+
path: null,
|
|
612
|
+
retryable: n.retryable,
|
|
613
|
+
source: n.source
|
|
614
|
+
});
|
|
615
|
+
}, $e = (e) => Object.freeze({
|
|
616
|
+
cliVersion: e.cliVersion,
|
|
617
|
+
command: e.command,
|
|
618
|
+
error: e.error,
|
|
619
|
+
result: e.result,
|
|
620
|
+
schemaVersion: 8,
|
|
621
|
+
status: e.status
|
|
622
|
+
}), et = (e) => `${r($e(e), { strict: !0 })}\n`, tt = [
|
|
623
|
+
"agentId",
|
|
624
|
+
"capabilityKind",
|
|
625
|
+
"capabilityId",
|
|
626
|
+
"decisionId",
|
|
627
|
+
"contextPath",
|
|
628
|
+
"integrationPath"
|
|
629
|
+
], nt = (e) => tt.flatMap((t) => {
|
|
630
|
+
let n = e[t];
|
|
631
|
+
return n === void 0 ? [] : [`${t}=${n}`];
|
|
632
|
+
}).join(", "), rt = (e) => {
|
|
633
|
+
let t = e.path === null ? "" : e.range === null ? ` ${e.path}` : ` ${e.path}:${e.range.start.line}:${e.range.start.column}`, n = [`${e.source}:${e.code}${t} ${e.message}`];
|
|
634
|
+
return e.pointer !== null && n.push(` pointer: ${e.pointer}`), e.entity !== null && n.push(` entity: ${nt(e.entity)}`), e.severity === "warning" && (n.push(` subject: ${e.subject}`), e.qualifier !== null && n.push(` qualifier: ${e.qualifier}`)), n.join("\n");
|
|
635
|
+
}, it = (e, t, n = 0) => {
|
|
636
|
+
let r = [`The moldea project is ${e ? n > 0 ? "valid with warnings" : "valid" : "invalid"}.`];
|
|
637
|
+
return t !== null && r.push(`Repository format: ${t}`), r;
|
|
638
|
+
}, j = (e, t, n) => `${e === 1 ? t : n}: ${e}`, at = (e) => e === null ? We : Xe[e], ot = (e) => `${e.source}:${e.code} ${e.message}\n`, M = (e, t, n, r, i) => et({
|
|
639
|
+
cliVersion: i,
|
|
640
|
+
command: e,
|
|
641
|
+
error: n,
|
|
642
|
+
result: t,
|
|
643
|
+
status: r
|
|
644
|
+
}), st = (e, t, n) => M(t, null, e, "error", n), ct = (e, t) => `${[
|
|
645
|
+
"The installed CLI composition state is valid.",
|
|
646
|
+
`CLI version: ${t}`,
|
|
647
|
+
`Supported Node.js: ${e.supportedNodeRange}`,
|
|
648
|
+
"JSON output schema: 8",
|
|
649
|
+
`Minimum Git: ${e.minimumGitVersion}`,
|
|
650
|
+
`Repository formats: ${e.repositoryFormatVersions.join(", ")}`,
|
|
651
|
+
"Packages:",
|
|
652
|
+
...e.packages.map(({ name: e, version: t }) => ` ${e}: ${t}`)
|
|
653
|
+
].join("\n")}\n`, lt = (e, t) => M(S.Composition, e, null, "valid", t), ut = (e) => `Coverage: ${e.bindings} bindings, ${e.exportsPassed} exports confirmed, ${e.exportsFailed} exports missing, ${e.exportsNotChecked} not checked`, dt = (e) => {
|
|
654
|
+
let t = it(e.valid, e.formatVersion, e.warningCount);
|
|
655
|
+
t.push(ut(e.coverageCounts));
|
|
656
|
+
for (let n of e.page.records) n.kind === "diagnostic" && !(n.severity === "warning" && n.accepted) && t.push(rt(n));
|
|
657
|
+
return t.push(j(e.diagnosticCount, "Diagnostic", "Diagnostics")), t.push(j(e.errorCount, "Error", "Errors")), t.push(j(e.warningCount, "Warning", "Warnings")), t.push(`${e.acceptedWarningCount} accepted ${e.acceptedWarningCount === 1 ? "warning" : "warnings"}`), e.page.cursor !== null && t.push("Additional records are available through JSON pagination."), `${t.join("\n")}\n`;
|
|
658
|
+
}, ft = (e, t) => M(S.Validate, e, null, e.valid ? "valid" : "invalid", t), pt = (e) => {
|
|
659
|
+
let t = it(e.valid, e.formatVersion, e.counts.warnings);
|
|
660
|
+
t.push(ut(e.coverageCounts)), t.push(`${e.counts.acceptedWarnings} accepted ${e.counts.acceptedWarnings === 1 ? "warning" : "warnings"}`);
|
|
661
|
+
for (let n of e.page.records) n.kind === "diagnostic" && !(n.severity === "warning" && n.accepted) && t.push(rt(n));
|
|
662
|
+
for (let [n, r] of Object.entries(e.counts)) t.push(`${n}: ${r}`);
|
|
663
|
+
return `${t.join("\n")}\n`;
|
|
664
|
+
}, mt = (e, t) => M(S.Inspect, e, null, e.valid ? "valid" : "invalid", t), ht = (e) => `${[
|
|
665
|
+
`The moldea scope result is ${e.valid ? "valid" : "invalid"}.`,
|
|
666
|
+
`Relevant: ${e.relevant ? "yes" : "no"}`,
|
|
667
|
+
...Object.entries(e.counts).map(([e, t]) => `${e}: ${t}`)
|
|
668
|
+
].join("\n")}\n`, gt = (e, t) => M(S.Scope, e, null, e.valid ? "valid" : "invalid", t), _t = (e) => `${[
|
|
669
|
+
`Path: ${e.asset.path}`,
|
|
670
|
+
`Content identity: ${e.asset.contentIdentity ?? "unavailable"}`,
|
|
671
|
+
`Bytes: ${e.chunk.byteStart}-${e.chunk.byteEnd} of ${e.asset.totalBytes}`,
|
|
672
|
+
e.cursor === null ? "Cursor: none" : `Cursor: ${e.cursor}`,
|
|
673
|
+
...e.cursor === null ? [] : ["Continue this asset by passing the cursor to a JSON content request."],
|
|
674
|
+
"",
|
|
675
|
+
e.chunk.content
|
|
676
|
+
].join("\n")}\n`, vt = (e, t) => M(S.Content, e, null, "valid", t), yt = (e) => {
|
|
677
|
+
let t = e.diagnostics.filter((e) => e.severity === "error").length;
|
|
678
|
+
if (!(Number.isSafeInteger(e.errorCount) && Number.isSafeInteger(e.warningCount) && e.errorCount === t && e.acceptedWarningCount === e.diagnostics.filter((e) => e.severity === "warning" && e.accepted === !0).length && e.warningCount === e.diagnostics.length - t - e.acceptedWarningCount && e.diagnosticCount === e.errorCount + e.warningCount + e.acceptedWarningCount && e.valid === (e.summary !== null && e.errorCount === 0) && (e.valid || e.errorCount > 0))) throw TypeError("The Core validation result is internally inconsistent.");
|
|
679
|
+
}, N = (e, ...t) => JSON.stringify([e, ...t]), P = (e, t = 0) => {
|
|
680
|
+
let n = {
|
|
681
|
+
code: e.code,
|
|
682
|
+
group: e.group,
|
|
683
|
+
entity: e.entity,
|
|
684
|
+
key: N("diagnostic", e.source, e.severity, e.code, e.path, e.pointer, e.severity === "warning" ? [
|
|
685
|
+
e.subject,
|
|
686
|
+
e.qualifier,
|
|
687
|
+
e.accepted === !0,
|
|
688
|
+
e.accepted === !0 ? e.reason : null
|
|
689
|
+
] : null, t),
|
|
690
|
+
kind: "diagnostic",
|
|
691
|
+
message: e.message,
|
|
692
|
+
path: e.path,
|
|
693
|
+
pointer: e.pointer,
|
|
694
|
+
range: e.range,
|
|
695
|
+
source: e.source
|
|
696
|
+
};
|
|
697
|
+
return e.severity === "warning" ? Object.freeze({
|
|
698
|
+
...n,
|
|
699
|
+
severity: "warning",
|
|
700
|
+
subject: e.subject,
|
|
701
|
+
qualifier: e.qualifier,
|
|
702
|
+
acceptable: e.acceptable,
|
|
703
|
+
accepted: e.accepted === !0,
|
|
704
|
+
reason: e.accepted === !0 ? e.reason : null
|
|
705
|
+
}) : Object.freeze({
|
|
706
|
+
...n,
|
|
707
|
+
severity: "error"
|
|
708
|
+
});
|
|
709
|
+
}, bt = (e, t, n = "coverage") => Object.freeze({
|
|
710
|
+
entity: e.entity,
|
|
711
|
+
relationship: e.relationship,
|
|
712
|
+
path: e.path,
|
|
713
|
+
symbol: e.symbol,
|
|
714
|
+
fileCheck: e.fileCheck,
|
|
715
|
+
...e.exportCheck === "not-checked" ? {
|
|
716
|
+
exportCheck: e.exportCheck,
|
|
717
|
+
exportNotCheckedReason: e.exportNotCheckedReason
|
|
718
|
+
} : { exportCheck: e.exportCheck },
|
|
719
|
+
key: N(n, "coverage", e.relationship, e.entity, e.path, e.symbol, t),
|
|
720
|
+
kind: "coverage"
|
|
721
|
+
}), xt = (e, t) => {
|
|
722
|
+
let n = t.toString().padStart(6, "0");
|
|
723
|
+
if (e.kind === "agent") {
|
|
724
|
+
let t = {
|
|
725
|
+
agentId: e.agent.agentId,
|
|
726
|
+
key: N(n, "agent", e.agent.agentId),
|
|
727
|
+
kind: "agent"
|
|
728
|
+
};
|
|
729
|
+
return Object.freeze(t);
|
|
730
|
+
}
|
|
731
|
+
if (e.kind === "diagnostic") return Object.freeze({
|
|
732
|
+
...P(e.diagnostic, t),
|
|
733
|
+
key: N(n, "diagnostic", e.diagnostic.source, e.diagnostic.severity, e.diagnostic.code, P(e.diagnostic, t).key)
|
|
734
|
+
});
|
|
735
|
+
if (e.kind === "coverage") return bt(e.coverage, t, n);
|
|
736
|
+
let r = e.metadata, i = {
|
|
737
|
+
agentId: r.agentId,
|
|
738
|
+
byteLength: r.byteLength,
|
|
739
|
+
canonicalDigest: r.canonicalDigest,
|
|
740
|
+
decisionId: r.decisionId,
|
|
741
|
+
digest: r.digest,
|
|
742
|
+
key: N(n, "metadata", r.path, r.kind, r.agentId),
|
|
743
|
+
kind: "metadata",
|
|
744
|
+
metadataKind: r.kind,
|
|
745
|
+
path: r.path,
|
|
746
|
+
scalarLength: r.scalarLength
|
|
747
|
+
};
|
|
748
|
+
return Object.freeze(i);
|
|
749
|
+
}, St = (e) => {
|
|
750
|
+
yt(e);
|
|
751
|
+
let t = e.diagnostics.map((e, t) => {
|
|
752
|
+
let n = P(e, t);
|
|
753
|
+
return Object.freeze({
|
|
754
|
+
...n,
|
|
755
|
+
key: N(t.toString().padStart(6, "0"), "diagnostic", n.key)
|
|
756
|
+
});
|
|
757
|
+
}), n = Object.freeze([...t, ...e.coverage.map((e, n) => bt(e, n, (t.length + n).toString().padStart(6, "0")))]), r = T({
|
|
758
|
+
records: n,
|
|
759
|
+
coverageCounts: e.coverageCounts,
|
|
760
|
+
acceptedWarningCount: e.acceptedWarningCount,
|
|
761
|
+
errorCount: e.errorCount,
|
|
762
|
+
formatVersion: e.formatVersion,
|
|
763
|
+
summary: e.summary,
|
|
764
|
+
valid: e.valid,
|
|
765
|
+
warningCount: e.warningCount
|
|
766
|
+
});
|
|
767
|
+
return Object.freeze({
|
|
768
|
+
records: n,
|
|
769
|
+
diagnosticCount: e.diagnosticCount,
|
|
770
|
+
acceptedWarningCount: e.acceptedWarningCount,
|
|
771
|
+
coverageCounts: e.coverageCounts,
|
|
772
|
+
errorCount: e.errorCount,
|
|
773
|
+
formatVersion: e.formatVersion,
|
|
774
|
+
snapshotDigest: r,
|
|
775
|
+
source: O,
|
|
776
|
+
valid: e.valid,
|
|
777
|
+
warningCount: e.warningCount
|
|
778
|
+
});
|
|
779
|
+
}, Ct = (e) => {
|
|
780
|
+
let t = e.summary === null ? null : Object.freeze({
|
|
781
|
+
manifest: Object.freeze({
|
|
782
|
+
digest: e.summary.manifestDigest,
|
|
783
|
+
path: e.summary.manifestPath
|
|
784
|
+
}),
|
|
785
|
+
project: Object.freeze({
|
|
786
|
+
digest: e.summary.projectDigest,
|
|
787
|
+
path: e.summary.projectPath
|
|
788
|
+
})
|
|
789
|
+
}), n = Object.freeze(e.page.records.map(({ item: e }, t) => xt(e, t))), r = new Map(e.page.records.map((e, t) => {
|
|
790
|
+
let r = n[t];
|
|
791
|
+
if (r === void 0) throw TypeError("A projected inspection record is missing.");
|
|
792
|
+
return [r.key, e.nextCursor];
|
|
793
|
+
})), i = e.inspectionDigest;
|
|
794
|
+
return Object.freeze({
|
|
795
|
+
counts: e.counts,
|
|
796
|
+
formatVersion: e.formatVersion,
|
|
797
|
+
getSourceCursor: (e) => r.get(e.key) ?? null,
|
|
798
|
+
project: t,
|
|
799
|
+
records: n,
|
|
800
|
+
snapshotDigest: i,
|
|
801
|
+
source: O,
|
|
802
|
+
coverageCounts: e.coverageCounts,
|
|
803
|
+
valid: e.valid,
|
|
804
|
+
view: e.view
|
|
805
|
+
});
|
|
806
|
+
}, wt = "/dev/null", F = {
|
|
807
|
+
GIT_NOT_FOUND: "GIT_NOT_FOUND",
|
|
808
|
+
GIT_COMMAND_FAILED: "GIT_COMMAND_FAILED",
|
|
809
|
+
GIT_INVALID_ARGUMENT: "GIT_INVALID_ARGUMENT",
|
|
810
|
+
GIT_OUTPUT_INVALID: "GIT_OUTPUT_INVALID",
|
|
811
|
+
GIT_REPOSITORY_NOT_FOUND: "GIT_REPOSITORY_NOT_FOUND",
|
|
812
|
+
GIT_ACCESS_DENIED: "GIT_ACCESS_DENIED"
|
|
813
|
+
}, I = (e) => new t("An argument isn't valid.", {
|
|
814
|
+
code: F.GIT_INVALID_ARGUMENT,
|
|
815
|
+
data: { argument: e }
|
|
816
|
+
}), L = (e) => new t("Git's output isn't in the expected format.", {
|
|
817
|
+
code: F.GIT_OUTPUT_INVALID,
|
|
818
|
+
data: { subcommand: e }
|
|
819
|
+
}), Tt = (e) => typeof e == "string" && e.length > 0 && !e.includes("\0"), Et = "ssh -o BatchMode=yes -o ConnectTimeout=10", Dt = {
|
|
820
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
821
|
+
GIT_ASKPASS: "",
|
|
822
|
+
GCM_INTERACTIVE: "never",
|
|
823
|
+
GIT_OPTIONAL_LOCKS: "0",
|
|
824
|
+
GIT_NO_REPLACE_OBJECTS: "1",
|
|
825
|
+
GIT_NO_LAZY_FETCH: "1",
|
|
826
|
+
GIT_LITERAL_PATHSPECS: "1",
|
|
827
|
+
GIT_ALLOW_PROTOCOL: "",
|
|
828
|
+
LC_ALL: "C",
|
|
829
|
+
LANG: "C",
|
|
830
|
+
LANGUAGE: "C"
|
|
831
|
+
}, Ot = new Set(Object.keys(Dt)), kt = (e) => {
|
|
832
|
+
let t = e.toUpperCase();
|
|
833
|
+
return !t.startsWith("GIT_") && !t.startsWith("SSH_ASKPASS") && !Ot.has(t);
|
|
834
|
+
}, At = ({ isolateConfig: e = !1, sshCommand: t = Et, baseEnv: n = process.env } = {}) => ({
|
|
835
|
+
...Object.fromEntries(Object.entries(n).filter(([e]) => kt(e))),
|
|
836
|
+
...Dt,
|
|
837
|
+
GIT_SSH_COMMAND: t,
|
|
838
|
+
...e ? {
|
|
839
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
840
|
+
GIT_CONFIG_GLOBAL: wt,
|
|
841
|
+
GIT_ATTR_NOSYSTEM: "1"
|
|
842
|
+
} : {}
|
|
843
|
+
}), jt = 1048576, Mt = [
|
|
844
|
+
"-c",
|
|
845
|
+
"core.fsmonitor=",
|
|
846
|
+
"-c",
|
|
847
|
+
"core.askPass=",
|
|
848
|
+
"-c",
|
|
849
|
+
"core.pager=cat",
|
|
850
|
+
"-c",
|
|
851
|
+
"color.ui=false",
|
|
852
|
+
"-c",
|
|
853
|
+
"submodule.recurse=false"
|
|
854
|
+
], Nt = ["-c", "credential.helper="], Pt = /^fatal: not a git repository/mu, Ft = /^fatal: (?:detected dubious ownership in repository at |.*: Permission denied\r?$)/mu, It = async (e) => {
|
|
855
|
+
try {
|
|
856
|
+
return (await f(e)).isDirectory();
|
|
857
|
+
} catch {
|
|
858
|
+
return !1;
|
|
859
|
+
}
|
|
860
|
+
}, Lt = (e) => Array.isArray(e) && e.every((e) => typeof e == "string" && !e.includes("\0")), Rt = (e) => {
|
|
861
|
+
let t = e.toUpperCase();
|
|
862
|
+
return t !== "GIT_ASKPASS" && t !== "GIT_TERMINAL_PROMPT" && t !== "GCM_INTERACTIVE" && !t.startsWith("SSH_ASKPASS");
|
|
863
|
+
}, R = async (e, { cwd: r, timeoutSeconds: i = 30, maxOutputBytes: a = jt, input: o, signal: s, isolateConfig: c = !1, useCredentialHelpers: l = !1, env: u, encoding: d }) => {
|
|
864
|
+
if (!Lt(e)) throw I("args");
|
|
865
|
+
if (!Tt(r) || !await It(r)) throw I("cwd");
|
|
866
|
+
let f = {
|
|
867
|
+
...At({ isolateConfig: c }),
|
|
868
|
+
...Object.fromEntries(Object.entries(u ?? {}).filter(([e]) => Rt(e)))
|
|
869
|
+
};
|
|
870
|
+
try {
|
|
871
|
+
return await ve({
|
|
872
|
+
command: "git",
|
|
873
|
+
args: [
|
|
874
|
+
...Mt,
|
|
875
|
+
...c ? ["-c", `core.attributesFile=${wt}`] : [],
|
|
876
|
+
...l ? [] : Nt,
|
|
877
|
+
"--no-pager",
|
|
878
|
+
...e
|
|
879
|
+
],
|
|
880
|
+
cwd: r,
|
|
881
|
+
env: f,
|
|
882
|
+
timeoutSeconds: i,
|
|
883
|
+
maxOutputBytes: a,
|
|
884
|
+
...o === void 0 ? {} : { input: o },
|
|
885
|
+
...s === void 0 ? {} : { signal: s },
|
|
886
|
+
...d === void 0 ? {} : { encoding: d }
|
|
887
|
+
});
|
|
888
|
+
} catch (e) {
|
|
889
|
+
let i = n(e) === m.PROCESS_START_FAILED && n(e.cause) === "ENOENT";
|
|
890
|
+
throw i && process.platform === "win32" && r.length >= 260 ? I("cwd") : i ? new t("Git isn't installed, or isn't on the PATH.", {
|
|
891
|
+
code: F.GIT_NOT_FOUND,
|
|
892
|
+
cause: e
|
|
893
|
+
}) : e;
|
|
894
|
+
}
|
|
895
|
+
}, zt = (e, n) => {
|
|
896
|
+
if (e.exitCode === 0) return;
|
|
897
|
+
let r = typeof e.stderr == "string" ? e.stderr : e.stderr.toString("utf8"), i = {
|
|
898
|
+
subcommand: n,
|
|
899
|
+
exitCode: e.exitCode
|
|
900
|
+
};
|
|
901
|
+
throw Pt.test(r) ? new t("The directory isn't in a Git repository.", {
|
|
902
|
+
code: F.GIT_REPOSITORY_NOT_FOUND,
|
|
903
|
+
data: i
|
|
904
|
+
}) : Ft.test(r) ? new t("Git can't access the repository.", {
|
|
905
|
+
code: F.GIT_ACCESS_DENIED,
|
|
906
|
+
data: i
|
|
907
|
+
}) : new t("The git command failed.", {
|
|
908
|
+
code: F.GIT_COMMAND_FAILED,
|
|
909
|
+
data: i
|
|
910
|
+
});
|
|
911
|
+
}, Bt = /^([0-7]{6}) [0-9a-f]{40,64} ([0-3])$/, z = (e, t) => (zt(e, t), e.stdout), Vt = (e, t) => {
|
|
912
|
+
let n = z(e, t);
|
|
913
|
+
if (e.stderr.length > 0) throw L(t);
|
|
914
|
+
return n;
|
|
915
|
+
}, Ht = (e, t) => {
|
|
916
|
+
try {
|
|
917
|
+
return new TextDecoder("utf-8", {
|
|
918
|
+
fatal: !0,
|
|
919
|
+
ignoreBOM: !0
|
|
920
|
+
}).decode(e);
|
|
921
|
+
} catch {
|
|
922
|
+
throw L(t);
|
|
923
|
+
}
|
|
924
|
+
}, Ut = (e, t) => {
|
|
925
|
+
let n = Ht(e, t);
|
|
926
|
+
if (n === "") return [];
|
|
927
|
+
let r = n.split("\0");
|
|
928
|
+
if (r.pop() !== "") throw L(t);
|
|
929
|
+
return r;
|
|
930
|
+
}, Wt = (e) => e.map((e) => {
|
|
931
|
+
let t = e.indexOf(" "), n = t === -1 ? null : Bt.exec(e.slice(0, t));
|
|
932
|
+
if (n === null || t === e.length - 1) throw L("ls-files");
|
|
933
|
+
return {
|
|
934
|
+
mode: n[1],
|
|
935
|
+
stage: Number(n[2]),
|
|
936
|
+
path: e.slice(t + 1)
|
|
937
|
+
};
|
|
938
|
+
}), Gt = /^git version (0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:[.-][0-9A-Za-z]+)*(?: \([0-9A-Za-z](?:[0-9A-Za-z ._+/-]*[0-9A-Za-z])?\))?\r?\n$/, Kt = (e) => {
|
|
939
|
+
if (e === void 0) return ["--"];
|
|
940
|
+
if (!Array.isArray(e) || !e.every(Tt)) throw I("paths");
|
|
941
|
+
return ["--", ...e];
|
|
942
|
+
}, qt = async (e, { paths: t, ...n } = {}) => Wt(Ut(Vt(await R([
|
|
943
|
+
"ls-files",
|
|
944
|
+
"--cached",
|
|
945
|
+
"--stage",
|
|
946
|
+
"--full-name",
|
|
947
|
+
"-z",
|
|
948
|
+
...Kt(t)
|
|
949
|
+
], {
|
|
950
|
+
...n,
|
|
951
|
+
cwd: e,
|
|
952
|
+
encoding: "buffer"
|
|
953
|
+
}), "ls-files"), "ls-files")), Jt = async (e, { paths: t, ...n } = {}) => Ut(Vt(await R([
|
|
954
|
+
"ls-files",
|
|
955
|
+
"--others",
|
|
956
|
+
"--exclude-standard",
|
|
957
|
+
"--full-name",
|
|
958
|
+
"-z",
|
|
959
|
+
...Kt(t)
|
|
960
|
+
], {
|
|
961
|
+
...n,
|
|
962
|
+
cwd: e,
|
|
963
|
+
encoding: "buffer"
|
|
964
|
+
}), "ls-files"), "ls-files"), Yt = async (e, t = {}) => {
|
|
965
|
+
let n = z(await R(["rev-parse", "--is-inside-work-tree"], {
|
|
966
|
+
...t,
|
|
967
|
+
cwd: e
|
|
968
|
+
}), "rev-parse").trim();
|
|
969
|
+
if (n === "false") return null;
|
|
970
|
+
if (n !== "true") throw L("rev-parse");
|
|
971
|
+
let r = Ht(z(await R(["rev-parse", "--show-toplevel"], {
|
|
972
|
+
...t,
|
|
973
|
+
cwd: e,
|
|
974
|
+
encoding: "buffer"
|
|
975
|
+
}), "rev-parse"), "rev-parse"), i = r.endsWith("\n") ? r.slice(0, -1) : "";
|
|
976
|
+
if (i === "" || i.includes("\n")) throw L("rev-parse");
|
|
977
|
+
return i;
|
|
978
|
+
}, Xt = async (e, t, n, r = {}) => {
|
|
979
|
+
if (!Tt(t) || t.startsWith("-") || /\s/.test(t)) throw I("key");
|
|
980
|
+
if (typeof n != "boolean") throw I("defaultValue");
|
|
981
|
+
let i = z(await R([
|
|
982
|
+
"config",
|
|
983
|
+
"--type=bool",
|
|
984
|
+
`--default=${String(n)}`,
|
|
985
|
+
"--get",
|
|
986
|
+
t
|
|
987
|
+
], {
|
|
988
|
+
...r,
|
|
989
|
+
cwd: e
|
|
990
|
+
}), "config");
|
|
991
|
+
if (i !== "true\n" && i !== "false\n") throw L("config");
|
|
992
|
+
return i === "true\n";
|
|
993
|
+
}, Zt = async (e, t = {}) => {
|
|
994
|
+
let n = z(await R(["version"], {
|
|
995
|
+
...t,
|
|
996
|
+
cwd: e
|
|
997
|
+
}), "version"), r = Gt.exec(n), i = {
|
|
998
|
+
major: Number(r?.[1]),
|
|
999
|
+
minor: Number(r?.[2]),
|
|
1000
|
+
patch: Number(r?.[3])
|
|
1001
|
+
};
|
|
1002
|
+
if (!Object.values(i).every(Number.isSafeInteger)) throw L("version");
|
|
1003
|
+
return i;
|
|
1004
|
+
}, Qt = (e, t) => Object.freeze({
|
|
1005
|
+
kind: "failed",
|
|
1006
|
+
reason: e,
|
|
1007
|
+
...t === void 0 ? {} : { subcommand: t }
|
|
1008
|
+
}), $t = (e, t) => {
|
|
1009
|
+
if (t?.aborted === !0) return "aborted";
|
|
1010
|
+
switch (n(e)) {
|
|
1011
|
+
case F.GIT_NOT_FOUND: return "not-found";
|
|
1012
|
+
case F.GIT_REPOSITORY_NOT_FOUND: return "repository-not-found";
|
|
1013
|
+
case F.GIT_ACCESS_DENIED: return "access-denied";
|
|
1014
|
+
case F.GIT_OUTPUT_INVALID: return "output-invalid";
|
|
1015
|
+
case m.PROCESS_OUTPUT_TOO_LARGE: return "output-limit-exceeded";
|
|
1016
|
+
case m.PROCESS_START_FAILED: {
|
|
1017
|
+
let t = n(e.cause);
|
|
1018
|
+
return t === "EACCES" || t === "EPERM" ? "access-denied" : "command-failed";
|
|
1019
|
+
}
|
|
1020
|
+
default: return "command-failed";
|
|
1021
|
+
}
|
|
1022
|
+
}, en = async (e, t, n) => {
|
|
1023
|
+
try {
|
|
1024
|
+
return Object.freeze({
|
|
1025
|
+
kind: "completed",
|
|
1026
|
+
value: await e()
|
|
1027
|
+
});
|
|
1028
|
+
} catch (e) {
|
|
1029
|
+
return Qt($t(e, t), n);
|
|
1030
|
+
}
|
|
1031
|
+
}, tn = (e, t) => {
|
|
1032
|
+
if (e.stderr.byteLength > 4096) return "output-invalid";
|
|
1033
|
+
try {
|
|
1034
|
+
zt(e, t);
|
|
1035
|
+
} catch (e) {
|
|
1036
|
+
return $t(e);
|
|
1037
|
+
}
|
|
1038
|
+
return e.stderr.byteLength === 0 ? null : "output-invalid";
|
|
1039
|
+
}, B = Object.freeze({
|
|
1040
|
+
major: 2,
|
|
1041
|
+
minor: 32,
|
|
1042
|
+
patch: 0
|
|
1043
|
+
}), nn = `${B.major}.${B.minor}.${B.patch}`, rn = 4096, an = (e) => {
|
|
1044
|
+
switch (e) {
|
|
1045
|
+
case "aborted": return "GIT_OPERATION_ABORTED";
|
|
1046
|
+
case "not-found": return "GIT_NOT_FOUND";
|
|
1047
|
+
case "access-denied": return "GIT_ACCESS_DENIED";
|
|
1048
|
+
case "output-limit-exceeded":
|
|
1049
|
+
case "output-invalid": return "GIT_VERSION_INVALID";
|
|
1050
|
+
case "repository-not-found":
|
|
1051
|
+
case "command-failed": return "GIT_COMMAND_FAILED";
|
|
1052
|
+
}
|
|
1053
|
+
}, on = (e) => e.major === B.major ? e.minor === B.minor ? e.patch >= B.patch : e.minor > B.minor : e.major > B.major, sn = (e = Zt) => async (t, n) => {
|
|
1054
|
+
let r = await en(() => e(t, {
|
|
1055
|
+
maxOutputBytes: rn,
|
|
1056
|
+
timeoutSeconds: 300,
|
|
1057
|
+
...n === void 0 ? {} : { signal: n }
|
|
1058
|
+
}), n);
|
|
1059
|
+
return r.kind === "failed" ? Object.freeze({
|
|
1060
|
+
errorCode: an(r.reason),
|
|
1061
|
+
kind: "failed"
|
|
1062
|
+
}) : on(r.value) ? Object.freeze({
|
|
1063
|
+
kind: "supported",
|
|
1064
|
+
version: Object.freeze({ ...r.value })
|
|
1065
|
+
}) : Object.freeze({
|
|
1066
|
+
errorCode: "GIT_VERSION_UNSUPPORTED",
|
|
1067
|
+
kind: "failed"
|
|
1068
|
+
});
|
|
1069
|
+
}, cn = class extends Error {
|
|
1070
|
+
code = "COMPOSITION_STATE_INVALID";
|
|
1071
|
+
constructor() {
|
|
1072
|
+
super(Qe("COMPOSITION_STATE_INVALID").message), this.name = "MoldeaCliCompositionException";
|
|
1073
|
+
}
|
|
1074
|
+
}, V = e(((e, t) => {
|
|
1075
|
+
t.exports = {
|
|
1076
|
+
MAX_LENGTH: 256,
|
|
1077
|
+
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
1078
|
+
MAX_SAFE_BUILD_LENGTH: 250,
|
|
1079
|
+
MAX_SAFE_INTEGER: 2 ** 53 - 1 || 9007199254740991,
|
|
1080
|
+
RELEASE_TYPES: [
|
|
1081
|
+
"major",
|
|
1082
|
+
"premajor",
|
|
1083
|
+
"minor",
|
|
1084
|
+
"preminor",
|
|
1085
|
+
"patch",
|
|
1086
|
+
"prepatch",
|
|
1087
|
+
"prerelease"
|
|
1088
|
+
],
|
|
1089
|
+
SEMVER_SPEC_VERSION: "2.0.0",
|
|
1090
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
1091
|
+
FLAG_LOOSE: 2
|
|
1092
|
+
};
|
|
1093
|
+
})), H = e(((e, t) => {
|
|
1094
|
+
t.exports = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {};
|
|
1095
|
+
})), U = e(((e, t) => {
|
|
1096
|
+
var { MAX_SAFE_COMPONENT_LENGTH: n, MAX_SAFE_BUILD_LENGTH: r, MAX_LENGTH: i } = V(), a = H();
|
|
1097
|
+
e = t.exports = {};
|
|
1098
|
+
var o = e.re = [], s = e.safeRe = [], c = e.src = [], l = e.safeSrc = [], u = e.t = {}, d = 0, f = "[a-zA-Z0-9-]", p = [
|
|
1099
|
+
["\\s", 1],
|
|
1100
|
+
["\\d", i],
|
|
1101
|
+
[f, r]
|
|
1102
|
+
], m = (e) => {
|
|
1103
|
+
for (let [t, n] of p) e = e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);
|
|
1104
|
+
return e;
|
|
1105
|
+
}, h = (e, t, n) => {
|
|
1106
|
+
let r = m(t), i = d++;
|
|
1107
|
+
a(e, i, t), u[e] = i, c[i] = t, l[i] = r, o[i] = new RegExp(t, n ? "g" : void 0), s[i] = new RegExp(r, n ? "g" : void 0);
|
|
1108
|
+
};
|
|
1109
|
+
h("NUMERICIDENTIFIER", "0|[1-9]\\d*"), h("NUMERICIDENTIFIERLOOSE", "\\d+"), h("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), h("MAINVERSION", `(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`), h("MAINVERSIONLOOSE", `(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASEIDENTIFIER", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`), h("PRERELEASEIDENTIFIERLOOSE", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASE", `(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`), h("PRERELEASELOOSE", `(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`), h("BUILDIDENTIFIER", `${f}+`), h("BUILD", `(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`), h("FULLPLAIN", `v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`), h("FULL", `^${c[u.FULLPLAIN]}$`), h("LOOSEPLAIN", `[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`), h("LOOSE", `^${c[u.LOOSEPLAIN]}$`), h("GTLT", "((?:<|>)?=?)"), h("XRANGEIDENTIFIERLOOSE", `${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), h("XRANGEIDENTIFIER", `${c[u.NUMERICIDENTIFIER]}|x|X|\\*`), h("XRANGEPLAIN", `[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`), h("XRANGEPLAINLOOSE", `[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`), h("XRANGE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`), h("XRANGELOOSE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`), h("COERCEPLAIN", `(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`), h("COERCE", `${c[u.COERCEPLAIN]}(?:$|[^\\d])`), h("COERCEFULL", c[u.COERCEPLAIN] + `(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`), h("COERCERTL", c[u.COERCE], !0), h("COERCERTLFULL", c[u.COERCEFULL], !0), h("LONETILDE", "(?:~>?)"), h("TILDETRIM", `(\\s*)${c[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", h("TILDE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`), h("TILDELOOSE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`), h("LONECARET", "(?:\\^)"), h("CARETTRIM", `(\\s*)${c[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", h("CARET", `^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`), h("CARETLOOSE", `^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`), h("COMPARATORLOOSE", `^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`), h("COMPARATOR", `^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`), h("COMPARATORTRIM", `(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", h("HYPHENRANGE", `^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`), h("HYPHENRANGELOOSE", `^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`), h("STAR", "(<|>)?=?\\s*\\*"), h("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), h("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
1110
|
+
})), ln = e(((e, t) => {
|
|
1111
|
+
var n = Object.freeze({ loose: !0 }), r = Object.freeze({});
|
|
1112
|
+
t.exports = (e) => e ? typeof e == "object" ? e : n : r;
|
|
1113
|
+
})), un = e(((e, t) => {
|
|
1114
|
+
var n = /^[0-9]+$/, r = (e, t) => {
|
|
1115
|
+
if (typeof e == "number" && typeof t == "number") return e === t ? 0 : e < t ? -1 : 1;
|
|
1116
|
+
let r = n.test(e), i = n.test(t);
|
|
1117
|
+
return r && i && (e = +e, t = +t), e === t ? 0 : r && !i ? -1 : i && !r ? 1 : e < t ? -1 : 1;
|
|
1118
|
+
};
|
|
1119
|
+
t.exports = {
|
|
1120
|
+
compareIdentifiers: r,
|
|
1121
|
+
rcompareIdentifiers: (e, t) => r(t, e)
|
|
1122
|
+
};
|
|
1123
|
+
})), W = e(((e, t) => {
|
|
1124
|
+
var n = H(), { MAX_LENGTH: r, MAX_SAFE_INTEGER: i } = V(), { safeRe: a, t: o } = U(), s = ln(), { compareIdentifiers: c } = un(), l = (e, t) => {
|
|
1125
|
+
let n = t.split(".");
|
|
1126
|
+
if (n.length > e.length) return !1;
|
|
1127
|
+
for (let t = 0; t < n.length; t++) if (c(e[t], n[t]) !== 0) return !1;
|
|
1128
|
+
return !0;
|
|
1129
|
+
};
|
|
1130
|
+
t.exports = class e {
|
|
1131
|
+
constructor(t, c) {
|
|
1132
|
+
if (c = s(c), t instanceof e) {
|
|
1133
|
+
if (t.loose === !!c.loose && t.includePrerelease === !!c.includePrerelease) return t;
|
|
1134
|
+
t = t.version;
|
|
1135
|
+
} else if (typeof t != "string") throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);
|
|
1136
|
+
if (t.length > r) throw TypeError(`version is longer than ${r} characters`);
|
|
1137
|
+
n("SemVer", t, c), this.options = c, this.loose = !!c.loose, this.includePrerelease = !!c.includePrerelease;
|
|
1138
|
+
let l = t.trim().match(c.loose ? a[o.LOOSE] : a[o.FULL]);
|
|
1139
|
+
if (!l) throw TypeError(`Invalid Version: ${t}`);
|
|
1140
|
+
if (this.raw = t, this.major = +l[1], this.minor = +l[2], this.patch = +l[3], this.major > i || this.major < 0) throw TypeError("Invalid major version");
|
|
1141
|
+
if (this.minor > i || this.minor < 0) throw TypeError("Invalid minor version");
|
|
1142
|
+
if (this.patch > i || this.patch < 0) throw TypeError("Invalid patch version");
|
|
1143
|
+
this.prerelease = l[4] ? l[4].split(".").map((e) => {
|
|
1144
|
+
if (/^[0-9]+$/.test(e)) {
|
|
1145
|
+
let t = +e;
|
|
1146
|
+
if (t >= 0 && t < i) return t;
|
|
1147
|
+
}
|
|
1148
|
+
return e;
|
|
1149
|
+
}) : [], this.build = l[5] ? l[5].split(".") : [], this.format();
|
|
1150
|
+
}
|
|
1151
|
+
format() {
|
|
1152
|
+
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
|
|
1153
|
+
}
|
|
1154
|
+
toString() {
|
|
1155
|
+
return this.version;
|
|
1156
|
+
}
|
|
1157
|
+
compare(t) {
|
|
1158
|
+
if (n("SemVer.compare", this.version, this.options, t), !(t instanceof e)) {
|
|
1159
|
+
if (typeof t == "string" && t === this.version) return 0;
|
|
1160
|
+
t = new e(t, this.options);
|
|
1161
|
+
}
|
|
1162
|
+
return t.version === this.version ? 0 : this.compareMain(t) || this.comparePre(t);
|
|
1163
|
+
}
|
|
1164
|
+
compareMain(t) {
|
|
1165
|
+
return t instanceof e || (t = new e(t, this.options)), this.major < t.major ? -1 : this.major > t.major ? 1 : this.minor < t.minor ? -1 : this.minor > t.minor ? 1 : this.patch < t.patch ? -1 : +(this.patch > t.patch);
|
|
1166
|
+
}
|
|
1167
|
+
comparePre(t) {
|
|
1168
|
+
if (t instanceof e || (t = new e(t, this.options)), this.prerelease.length && !t.prerelease.length) return -1;
|
|
1169
|
+
if (!this.prerelease.length && t.prerelease.length) return 1;
|
|
1170
|
+
if (!this.prerelease.length && !t.prerelease.length) return 0;
|
|
1171
|
+
let r = 0;
|
|
1172
|
+
do {
|
|
1173
|
+
let e = this.prerelease[r], i = t.prerelease[r];
|
|
1174
|
+
if (n("prerelease compare", r, e, i), e === void 0 && i === void 0) return 0;
|
|
1175
|
+
if (i === void 0) return 1;
|
|
1176
|
+
if (e === void 0) return -1;
|
|
1177
|
+
if (e !== i) return c(e, i);
|
|
1178
|
+
} while (++r);
|
|
1179
|
+
}
|
|
1180
|
+
compareBuild(t) {
|
|
1181
|
+
t instanceof e || (t = new e(t, this.options));
|
|
1182
|
+
let r = 0;
|
|
1183
|
+
do {
|
|
1184
|
+
let e = this.build[r], i = t.build[r];
|
|
1185
|
+
if (n("build compare", r, e, i), e === void 0 && i === void 0) return 0;
|
|
1186
|
+
if (i === void 0) return 1;
|
|
1187
|
+
if (e === void 0) return -1;
|
|
1188
|
+
if (e !== i) return c(e, i);
|
|
1189
|
+
} while (++r);
|
|
1190
|
+
}
|
|
1191
|
+
inc(e, t, n) {
|
|
1192
|
+
if (e.startsWith("pre")) {
|
|
1193
|
+
if (!t && n === !1) throw Error("invalid increment argument: identifier is empty");
|
|
1194
|
+
if (t) {
|
|
1195
|
+
let e = `-${t}`.match(this.options.loose ? a[o.PRERELEASELOOSE] : a[o.PRERELEASE]);
|
|
1196
|
+
if (!e || e[1] !== t) throw Error(`invalid identifier: ${t}`);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
switch (e) {
|
|
1200
|
+
case "premajor":
|
|
1201
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, n);
|
|
1202
|
+
break;
|
|
1203
|
+
case "preminor":
|
|
1204
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, n);
|
|
1205
|
+
break;
|
|
1206
|
+
case "prepatch":
|
|
1207
|
+
this.prerelease.length = 0, this.inc("patch", t, n), this.inc("pre", t, n);
|
|
1208
|
+
break;
|
|
1209
|
+
case "prerelease":
|
|
1210
|
+
this.prerelease.length === 0 && this.inc("patch", t, n), this.inc("pre", t, n);
|
|
1211
|
+
break;
|
|
1212
|
+
case "release":
|
|
1213
|
+
if (this.prerelease.length === 0) throw Error(`version ${this.raw} is not a prerelease`);
|
|
1214
|
+
this.prerelease.length = 0;
|
|
1215
|
+
break;
|
|
1216
|
+
case "major":
|
|
1217
|
+
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
1218
|
+
break;
|
|
1219
|
+
case "minor":
|
|
1220
|
+
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
|
|
1221
|
+
break;
|
|
1222
|
+
case "patch":
|
|
1223
|
+
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
|
|
1224
|
+
break;
|
|
1225
|
+
case "pre": {
|
|
1226
|
+
let e = +!!Number(n);
|
|
1227
|
+
if (this.prerelease.length === 0) this.prerelease = [e];
|
|
1228
|
+
else {
|
|
1229
|
+
let r = this.prerelease.length;
|
|
1230
|
+
for (; --r >= 0;) typeof this.prerelease[r] == "number" && (this.prerelease[r]++, r = -2);
|
|
1231
|
+
if (r === -1) {
|
|
1232
|
+
if (t === this.prerelease.join(".") && n === !1) throw Error("invalid increment argument: identifier already exists");
|
|
1233
|
+
this.prerelease.push(e);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
if (t) {
|
|
1237
|
+
let r = [t, e];
|
|
1238
|
+
if (n === !1 && (r = [t]), l(this.prerelease, t)) {
|
|
1239
|
+
let e = this.prerelease[t.split(".").length];
|
|
1240
|
+
isNaN(e) && (this.prerelease = r);
|
|
1241
|
+
} else this.prerelease = r;
|
|
1242
|
+
}
|
|
1243
|
+
break;
|
|
1244
|
+
}
|
|
1245
|
+
default: throw Error(`invalid increment argument: ${e}`);
|
|
1246
|
+
}
|
|
1247
|
+
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1250
|
+
})), G = e(((e, t) => {
|
|
1251
|
+
var n = W();
|
|
1252
|
+
t.exports = (e, t, r = !1) => {
|
|
1253
|
+
if (e instanceof n) return e;
|
|
1254
|
+
try {
|
|
1255
|
+
return new n(e, t);
|
|
1256
|
+
} catch (e) {
|
|
1257
|
+
if (!r) return null;
|
|
1258
|
+
throw e;
|
|
1259
|
+
}
|
|
1260
|
+
};
|
|
1261
|
+
})), dn = e(((e, t) => {
|
|
1262
|
+
var n = G();
|
|
1263
|
+
t.exports = (e, t) => {
|
|
1264
|
+
let r = n(e, t);
|
|
1265
|
+
return r ? r.version : null;
|
|
1266
|
+
};
|
|
1267
|
+
})), fn = e(((e, t) => {
|
|
1268
|
+
var n = G();
|
|
1269
|
+
t.exports = (e, t) => {
|
|
1270
|
+
let r = n(e.trim().replace(/^[=v]+/, ""), t);
|
|
1271
|
+
return r ? r.version : null;
|
|
1272
|
+
};
|
|
1273
|
+
})), pn = e(((e, t) => {
|
|
1274
|
+
var n = W();
|
|
1275
|
+
t.exports = (e, t, r, i, a) => {
|
|
1276
|
+
typeof r == "string" && (a = i, i = r, r = void 0);
|
|
1277
|
+
try {
|
|
1278
|
+
return new n(e instanceof n ? e.version : e, r).inc(t, i, a).version;
|
|
1279
|
+
} catch {
|
|
1280
|
+
return null;
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
|
+
})), mn = e(((e, t) => {
|
|
1284
|
+
var n = G();
|
|
1285
|
+
t.exports = (e, t) => {
|
|
1286
|
+
let r = n(e, null, !0), i = n(t, null, !0), a = r.compare(i);
|
|
1287
|
+
if (a === 0) return null;
|
|
1288
|
+
let o = a > 0, s = o ? r : i, c = o ? i : r, l = !!s.prerelease.length;
|
|
1289
|
+
if (c.prerelease.length && !l) {
|
|
1290
|
+
if (!c.patch && !c.minor) return "major";
|
|
1291
|
+
if (c.compareMain(s) === 0) return c.minor && !c.patch ? "minor" : "patch";
|
|
1292
|
+
}
|
|
1293
|
+
let u = l ? "pre" : "";
|
|
1294
|
+
return r.major === i.major ? r.minor === i.minor ? r.patch === i.patch ? "prerelease" : u + "patch" : u + "minor" : u + "major";
|
|
1295
|
+
};
|
|
1296
|
+
})), hn = e(((e, t) => {
|
|
1297
|
+
var n = W();
|
|
1298
|
+
t.exports = (e, t) => new n(e, t).major;
|
|
1299
|
+
})), gn = e(((e, t) => {
|
|
1300
|
+
var n = W();
|
|
1301
|
+
t.exports = (e, t) => new n(e, t).minor;
|
|
1302
|
+
})), _n = e(((e, t) => {
|
|
1303
|
+
var n = W();
|
|
1304
|
+
t.exports = (e, t) => new n(e, t).patch;
|
|
1305
|
+
})), vn = e(((e, t) => {
|
|
1306
|
+
var n = G();
|
|
1307
|
+
t.exports = (e, t) => {
|
|
1308
|
+
let r = n(e, t);
|
|
1309
|
+
return r && r.prerelease.length ? r.prerelease : null;
|
|
1310
|
+
};
|
|
1311
|
+
})), K = e(((e, t) => {
|
|
1312
|
+
var n = W();
|
|
1313
|
+
t.exports = (e, t, r) => new n(e, r).compare(new n(t, r));
|
|
1314
|
+
})), yn = e(((e, t) => {
|
|
1315
|
+
var n = K();
|
|
1316
|
+
t.exports = (e, t, r) => n(t, e, r);
|
|
1317
|
+
})), bn = e(((e, t) => {
|
|
1318
|
+
var n = K();
|
|
1319
|
+
t.exports = (e, t) => n(e, t, !0);
|
|
1320
|
+
})), xn = e(((e, t) => {
|
|
1321
|
+
var n = W();
|
|
1322
|
+
t.exports = (e, t, r) => {
|
|
1323
|
+
let i = new n(e, r), a = new n(t, r);
|
|
1324
|
+
return i.compare(a) || i.compareBuild(a);
|
|
1325
|
+
};
|
|
1326
|
+
})), Sn = e(((e, t) => {
|
|
1327
|
+
var n = xn();
|
|
1328
|
+
t.exports = (e, t) => e.sort((e, r) => n(e, r, t));
|
|
1329
|
+
})), Cn = e(((e, t) => {
|
|
1330
|
+
var n = xn();
|
|
1331
|
+
t.exports = (e, t) => e.sort((e, r) => n(r, e, t));
|
|
1332
|
+
})), q = e(((e, t) => {
|
|
1333
|
+
var n = K();
|
|
1334
|
+
t.exports = (e, t, r) => n(e, t, r) > 0;
|
|
1335
|
+
})), wn = e(((e, t) => {
|
|
1336
|
+
var n = K();
|
|
1337
|
+
t.exports = (e, t, r) => n(e, t, r) < 0;
|
|
1338
|
+
})), Tn = e(((e, t) => {
|
|
1339
|
+
var n = K();
|
|
1340
|
+
t.exports = (e, t, r) => n(e, t, r) === 0;
|
|
1341
|
+
})), En = e(((e, t) => {
|
|
1342
|
+
var n = K();
|
|
1343
|
+
t.exports = (e, t, r) => n(e, t, r) !== 0;
|
|
1344
|
+
})), J = e(((e, t) => {
|
|
1345
|
+
var n = K();
|
|
1346
|
+
t.exports = (e, t, r) => n(e, t, r) >= 0;
|
|
1347
|
+
})), Dn = e(((e, t) => {
|
|
1348
|
+
var n = K();
|
|
1349
|
+
t.exports = (e, t, r) => n(e, t, r) <= 0;
|
|
1350
|
+
})), On = e(((e, t) => {
|
|
1351
|
+
var n = Tn(), r = En(), i = q(), a = J(), o = wn(), s = Dn();
|
|
1352
|
+
t.exports = (e, t, c, l) => {
|
|
1353
|
+
switch (t) {
|
|
1354
|
+
case "===": return typeof e == "object" && (e = e.version), typeof c == "object" && (c = c.version), e === c;
|
|
1355
|
+
case "!==": return typeof e == "object" && (e = e.version), typeof c == "object" && (c = c.version), e !== c;
|
|
1356
|
+
case "":
|
|
1357
|
+
case "=":
|
|
1358
|
+
case "==": return n(e, c, l);
|
|
1359
|
+
case "!=": return r(e, c, l);
|
|
1360
|
+
case ">": return i(e, c, l);
|
|
1361
|
+
case ">=": return a(e, c, l);
|
|
1362
|
+
case "<": return o(e, c, l);
|
|
1363
|
+
case "<=": return s(e, c, l);
|
|
1364
|
+
default: throw TypeError(`Invalid operator: ${t}`);
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
})), kn = e(((e, t) => {
|
|
1368
|
+
var n = W(), r = G(), { safeRe: i, t: a } = U();
|
|
1369
|
+
t.exports = (e, t) => {
|
|
1370
|
+
if (e instanceof n) return e;
|
|
1371
|
+
if (typeof e == "number" && (e = String(e)), typeof e != "string") return null;
|
|
1372
|
+
t ||= {};
|
|
1373
|
+
let o = null;
|
|
1374
|
+
if (!t.rtl) o = e.match(t.includePrerelease ? i[a.COERCEFULL] : i[a.COERCE]);
|
|
1375
|
+
else {
|
|
1376
|
+
let n = t.includePrerelease ? i[a.COERCERTLFULL] : i[a.COERCERTL], r;
|
|
1377
|
+
for (; (r = n.exec(e)) && (!o || o.index + o[0].length !== e.length);) (!o || r.index + r[0].length !== o.index + o[0].length) && (o = r), n.lastIndex = r.index + r[1].length + r[2].length;
|
|
1378
|
+
n.lastIndex = -1;
|
|
1379
|
+
}
|
|
1380
|
+
if (o === null) return null;
|
|
1381
|
+
let s = o[2];
|
|
1382
|
+
return r(`${s}.${o[3] || "0"}.${o[4] || "0"}${t.includePrerelease && o[5] ? `-${o[5]}` : ""}${t.includePrerelease && o[6] ? `+${o[6]}` : ""}`, t);
|
|
1383
|
+
};
|
|
1384
|
+
})), An = e(((e, t) => {
|
|
1385
|
+
var n = G(), r = V(), i = W(), a = (e, t, n) => {
|
|
1386
|
+
if (!r.RELEASE_TYPES.includes(t)) return null;
|
|
1387
|
+
let i = o(e, n);
|
|
1388
|
+
return i && s(i, t);
|
|
1389
|
+
}, o = (e, t) => n(e instanceof i ? e.version : e, t), s = (e, t) => {
|
|
1390
|
+
if (c(t)) return e.version;
|
|
1391
|
+
switch (e.prerelease = [], t) {
|
|
1392
|
+
case "major":
|
|
1393
|
+
e.minor = 0, e.patch = 0;
|
|
1394
|
+
break;
|
|
1395
|
+
case "minor": e.patch = 0;
|
|
1396
|
+
}
|
|
1397
|
+
return e.format();
|
|
1398
|
+
}, c = (e) => e.startsWith("pre");
|
|
1399
|
+
t.exports = a;
|
|
1400
|
+
})), jn = e(((e, t) => {
|
|
1401
|
+
t.exports = class {
|
|
1402
|
+
constructor() {
|
|
1403
|
+
this.max = 1e3, this.map = new Map();
|
|
1404
|
+
}
|
|
1405
|
+
get(e) {
|
|
1406
|
+
let t = this.map.get(e);
|
|
1407
|
+
if (t !== void 0) return this.map.delete(e), this.map.set(e, t), t;
|
|
1408
|
+
}
|
|
1409
|
+
delete(e) {
|
|
1410
|
+
return this.map.delete(e);
|
|
1411
|
+
}
|
|
1412
|
+
set(e, t) {
|
|
1413
|
+
if (!this.delete(e) && t !== void 0) {
|
|
1414
|
+
if (this.map.size >= this.max) {
|
|
1415
|
+
let e = this.map.keys().next().value;
|
|
1416
|
+
this.delete(e);
|
|
1417
|
+
}
|
|
1418
|
+
this.map.set(e, t);
|
|
1419
|
+
}
|
|
1420
|
+
return this;
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
})), Y = e(((e, t) => {
|
|
1424
|
+
var n = /\s+/g;
|
|
1425
|
+
t.exports = class e {
|
|
1426
|
+
constructor(t, r) {
|
|
1427
|
+
if (r = i(r), t instanceof e) return t.loose === !!r.loose && t.includePrerelease === !!r.includePrerelease ? t : new e(t.raw, r);
|
|
1428
|
+
if (t instanceof a) return this.raw = t.value, this.set = [[t]], this.formatted = void 0, this;
|
|
1429
|
+
if (this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease, this.raw = t.trim().replace(n, " "), this.set = this.raw.split("||").map((e) => this.parseRange(e.trim())).filter((e) => e.length), !this.set.length) throw TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
1430
|
+
if (this.set.length > 1) {
|
|
1431
|
+
let e = this.set[0];
|
|
1432
|
+
if (this.set = this.set.filter((e) => !_(e[0])), this.set.length === 0) this.set = [e];
|
|
1433
|
+
else if (this.set.length > 1) {
|
|
1434
|
+
for (let e of this.set) if (e.length === 1 && v(e[0])) {
|
|
1435
|
+
this.set = [e];
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
this.formatted = void 0;
|
|
1441
|
+
}
|
|
1442
|
+
get range() {
|
|
1443
|
+
if (this.formatted === void 0) {
|
|
1444
|
+
this.formatted = "";
|
|
1445
|
+
for (let e = 0; e < this.set.length; e++) {
|
|
1446
|
+
e > 0 && (this.formatted += "||");
|
|
1447
|
+
let t = this.set[e];
|
|
1448
|
+
for (let e = 0; e < t.length; e++) e > 0 && (this.formatted += " "), this.formatted += t[e].toString().trim();
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
return this.formatted;
|
|
1452
|
+
}
|
|
1453
|
+
format() {
|
|
1454
|
+
return this.range;
|
|
1455
|
+
}
|
|
1456
|
+
toString() {
|
|
1457
|
+
return this.range;
|
|
1458
|
+
}
|
|
1459
|
+
parseRange(e) {
|
|
1460
|
+
e = e.replace(g, "");
|
|
1461
|
+
let t = ((this.options.includePrerelease && m) | (this.options.loose && h)) + ":" + e, n = r.get(t);
|
|
1462
|
+
if (n) return n;
|
|
1463
|
+
let i = this.options.loose, s = i ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
|
|
1464
|
+
e = e.replace(s, le(this.options.includePrerelease)), o("hyphen replace", e), e = e.replace(c[u.COMPARATORTRIM], d), o("comparator trim", e), e = e.replace(c[u.TILDETRIM], f), o("tilde trim", e), e = e.replace(c[u.CARETTRIM], p), o("caret trim", e);
|
|
1465
|
+
let l = e.split(" ").map((e) => b(e, this.options)).join(" ").split(/\s+/).map((e) => ce(e, this.options));
|
|
1466
|
+
i && (l = l.filter((e) => (o("loose invalid filter", e, this.options), !!e.match(c[u.COMPARATORLOOSE])))), o("range list", l);
|
|
1467
|
+
let v = new Map(), y = l.map((e) => new a(e, this.options));
|
|
1468
|
+
for (let e of y) {
|
|
1469
|
+
if (_(e)) return [e];
|
|
1470
|
+
v.set(e.value, e);
|
|
1471
|
+
}
|
|
1472
|
+
v.size > 1 && v.has("") && v.delete("");
|
|
1473
|
+
let x = [...v.values()];
|
|
1474
|
+
return r.set(t, x), x;
|
|
1475
|
+
}
|
|
1476
|
+
intersects(t, n) {
|
|
1477
|
+
if (!(t instanceof e)) throw TypeError("a Range is required");
|
|
1478
|
+
return this.set.some((e) => y(e, n) && t.set.some((t) => y(t, n) && e.every((e) => t.every((t) => e.intersects(t, n)))));
|
|
1479
|
+
}
|
|
1480
|
+
test(e) {
|
|
1481
|
+
if (!e) return !1;
|
|
1482
|
+
if (typeof e == "string") try {
|
|
1483
|
+
e = new s(e, this.options);
|
|
1484
|
+
} catch {
|
|
1485
|
+
return !1;
|
|
1486
|
+
}
|
|
1487
|
+
for (let t = 0; t < this.set.length; t++) if (ue(this.set[t], e, this.options)) return !0;
|
|
1488
|
+
return !1;
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
var r = new (jn())(), i = ln(), a = X(), o = H(), s = W(), { safeRe: c, src: l, t: u, comparatorTrimReplace: d, tildeTrimReplace: f, caretTrimReplace: p } = U(), { FLAG_INCLUDE_PRERELEASE: m, FLAG_LOOSE: h } = V(), g = new RegExp(l[u.BUILD], "g"), _ = (e) => e.value === "<0.0.0-0", v = (e) => e.value === "", y = (e, t) => {
|
|
1492
|
+
let n = !0, r = e.slice(), i = r.pop();
|
|
1493
|
+
for (; n && r.length;) n = r.every((e) => i.intersects(e, t)), i = r.pop();
|
|
1494
|
+
return n;
|
|
1495
|
+
}, b = (e, t) => (e = e.replace(c[u.BUILD], ""), o("comp", e, t), e = re(e, t), o("caret", e), e = te(e, t), o("tildes", e), e = ae(e, t), o("xrange", e), e = se(e, t), o("stars", e), e), x = (e) => !e || e.toLowerCase() === "x" || e === "*", ee = (e, t, n) => x(e) && !x(t) || x(t) && n && !x(n), te = (e, t) => e.trim().split(/\s+/).map((e) => ne(e, t)).join(" "), ne = (e, t) => {
|
|
1496
|
+
let n = t.loose ? c[u.TILDELOOSE] : c[u.TILDE], r = t.includePrerelease ? "-0" : "";
|
|
1497
|
+
return e.replace(n, (t, n, i, a, s) => {
|
|
1498
|
+
o("tilde", e, t, n, i, a, s);
|
|
1499
|
+
let c;
|
|
1500
|
+
return x(n) ? c = "" : x(i) ? c = `>=${n}.0.0${r} <${+n + 1}.0.0-0` : x(a) ? c = `>=${n}.${i}.0${r} <${n}.${+i + 1}.0-0` : s ? (o("replaceTilde pr", s), c = `>=${n}.${i}.${a}-${s} <${n}.${+i + 1}.0-0`) : c = `>=${n}.${i}.${a} <${n}.${+i + 1}.0-0`, o("tilde return", c), c;
|
|
1501
|
+
});
|
|
1502
|
+
}, re = (e, t) => e.trim().split(/\s+/).map((e) => ie(e, t)).join(" "), ie = (e, t) => {
|
|
1503
|
+
o("caret", e, t);
|
|
1504
|
+
let n = t.loose ? c[u.CARETLOOSE] : c[u.CARET], r = t.includePrerelease ? "-0" : "";
|
|
1505
|
+
return e.replace(n, (t, n, i, a, s) => {
|
|
1506
|
+
o("caret", e, t, n, i, a, s);
|
|
1507
|
+
let c;
|
|
1508
|
+
return x(n) ? c = "" : x(i) ? c = `>=${n}.0.0${r} <${+n + 1}.0.0-0` : x(a) ? c = n === "0" ? `>=${n}.${i}.0${r} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.0${r} <${+n + 1}.0.0-0` : s ? (o("replaceCaret pr", s), c = n === "0" ? i === "0" ? `>=${n}.${i}.${a}-${s} <${n}.${i}.${+a + 1}-0` : `>=${n}.${i}.${a}-${s} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.${a}-${s} <${+n + 1}.0.0-0`) : (o("no pr"), c = n === "0" ? i === "0" ? `>=${n}.${i}.${a} <${n}.${i}.${+a + 1}-0` : `>=${n}.${i}.${a} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.${a} <${+n + 1}.0.0-0`), o("caret return", c), c;
|
|
1509
|
+
});
|
|
1510
|
+
}, ae = (e, t) => (o("replaceXRanges", e, t), e.split(/\s+/).map((e) => oe(e, t)).join(" ")), oe = (e, t) => {
|
|
1511
|
+
e = e.trim();
|
|
1512
|
+
let n = t.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
|
|
1513
|
+
return e.replace(n, (n, r, i, a, s, c) => {
|
|
1514
|
+
if (o("xRange", e, n, r, i, a, s, c), ee(i, a, s)) return e;
|
|
1515
|
+
let l = x(i), u = l || x(a), d = u || x(s), f = d;
|
|
1516
|
+
return r === "=" && f && (r = ""), c = t.includePrerelease ? "-0" : "", l ? n = r === ">" || r === "<" ? "<0.0.0-0" : "*" : r && f ? (u && (a = 0), s = 0, r === ">" ? (r = ">=", u ? (i = +i + 1, a = 0, s = 0) : (a = +a + 1, s = 0)) : r === "<=" && (r = "<", u ? i = +i + 1 : a = +a + 1), r === "<" && (c = "-0"), n = `${r + i}.${a}.${s}${c}`) : u ? n = `>=${i}.0.0${c} <${+i + 1}.0.0-0` : d && (n = `>=${i}.${a}.0${c} <${i}.${+a + 1}.0-0`), o("xRange return", n), n;
|
|
1517
|
+
});
|
|
1518
|
+
}, se = (e, t) => (o("replaceStars", e, t), e.trim().replace(c[u.STAR], "")), ce = (e, t) => (o("replaceGTE0", e, t), e.trim().replace(c[t.includePrerelease ? u.GTE0PRE : u.GTE0], "")), le = (e) => (t, n, r, i, a, o, s, c, l, u, d, f) => (n = x(r) ? "" : x(i) ? `>=${r}.0.0${e ? "-0" : ""}` : x(a) ? `>=${r}.${i}.0${e ? "-0" : ""}` : o ? `>=${n}` : `>=${n}${e ? "-0" : ""}`, c = x(l) ? "" : x(u) ? `<${+l + 1}.0.0-0` : x(d) ? `<${l}.${+u + 1}.0-0` : f ? `<=${l}.${u}.${d}-${f}` : e ? `<${l}.${u}.${+d + 1}-0` : `<=${c}`, `${n} ${c}`.trim()), ue = (e, t, n) => {
|
|
1519
|
+
for (let n = 0; n < e.length; n++) if (!e[n].test(t)) return !1;
|
|
1520
|
+
if (t.prerelease.length && !n.includePrerelease) {
|
|
1521
|
+
for (let n = 0; n < e.length; n++) if (o(e[n].semver), e[n].semver !== a.ANY && e[n].semver.prerelease.length > 0) {
|
|
1522
|
+
let r = e[n].semver;
|
|
1523
|
+
if (r.major === t.major && r.minor === t.minor && r.patch === t.patch) return !0;
|
|
1524
|
+
}
|
|
1525
|
+
return !1;
|
|
1526
|
+
}
|
|
1527
|
+
return !0;
|
|
1528
|
+
};
|
|
1529
|
+
})), X = e(((e, t) => {
|
|
1530
|
+
var n = Symbol("SemVer ANY");
|
|
1531
|
+
t.exports = class e {
|
|
1532
|
+
static get ANY() {
|
|
1533
|
+
return n;
|
|
1534
|
+
}
|
|
1535
|
+
constructor(t, i) {
|
|
1536
|
+
if (i = r(i), t instanceof e) {
|
|
1537
|
+
if (t.loose === !!i.loose) return t;
|
|
1538
|
+
t = t.value;
|
|
1539
|
+
}
|
|
1540
|
+
t = t.trim().split(/\s+/).join(" "), s("comparator", t, i), this.options = i, this.loose = !!i.loose, this.parse(t), this.value = this.semver === n ? "" : this.operator + this.semver.version, s("comp", this);
|
|
1541
|
+
}
|
|
1542
|
+
parse(e) {
|
|
1543
|
+
let t = this.options.loose ? i[a.COMPARATORLOOSE] : i[a.COMPARATOR], r = e.match(t);
|
|
1544
|
+
if (!r) throw TypeError(`Invalid comparator: ${e}`);
|
|
1545
|
+
this.operator = r[1] === void 0 ? "" : r[1], this.operator === "=" && (this.operator = ""), this.semver = r[2] ? new c(r[2], this.options.loose) : n;
|
|
1546
|
+
}
|
|
1547
|
+
toString() {
|
|
1548
|
+
return this.value;
|
|
1549
|
+
}
|
|
1550
|
+
test(e) {
|
|
1551
|
+
if (s("Comparator.test", e, this.options.loose), this.semver === n || e === n) return !0;
|
|
1552
|
+
if (typeof e == "string") try {
|
|
1553
|
+
e = new c(e, this.options);
|
|
1554
|
+
} catch {
|
|
1555
|
+
return !1;
|
|
1556
|
+
}
|
|
1557
|
+
return o(e, this.operator, this.semver, this.options);
|
|
1558
|
+
}
|
|
1559
|
+
intersects(t, n) {
|
|
1560
|
+
if (!(t instanceof e)) throw TypeError("a Comparator is required");
|
|
1561
|
+
return this.operator === "" ? this.value === "" || new l(t.value, n).test(this.value) : t.operator === "" ? t.value === "" || new l(this.value, n).test(t.semver) : (n = r(n), n.includePrerelease && (this.value === "<0.0.0-0" || t.value === "<0.0.0-0") || !n.includePrerelease && (this.value.startsWith("<0.0.0") || t.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && t.operator.startsWith(">") || this.operator.startsWith("<") && t.operator.startsWith("<") || this.semver.version === t.semver.version && this.operator.includes("=") && t.operator.includes("=") || o(this.semver, "<", t.semver, n) && this.operator.startsWith(">") && t.operator.startsWith("<") || o(this.semver, ">", t.semver, n) && this.operator.startsWith("<") && t.operator.startsWith(">")));
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
var r = ln(), { safeRe: i, t: a } = U(), o = On(), s = H(), c = W(), l = Y();
|
|
1565
|
+
})), Z = e(((e, t) => {
|
|
1566
|
+
var n = Y();
|
|
1567
|
+
t.exports = (e, t, r) => {
|
|
1568
|
+
try {
|
|
1569
|
+
t = new n(t, r);
|
|
1570
|
+
} catch {
|
|
1571
|
+
return !1;
|
|
1572
|
+
}
|
|
1573
|
+
return t.test(e);
|
|
1574
|
+
};
|
|
1575
|
+
})), Mn = e(((e, t) => {
|
|
1576
|
+
var n = Y();
|
|
1577
|
+
t.exports = (e, t) => new n(e, t).set.map((e) => e.map((e) => e.value).join(" ").trim().split(" "));
|
|
1578
|
+
})), Nn = e(((e, t) => {
|
|
1579
|
+
var n = W(), r = Y();
|
|
1580
|
+
t.exports = (e, t, i) => {
|
|
1581
|
+
let a = null, o = null, s = null;
|
|
1582
|
+
try {
|
|
1583
|
+
s = new r(t, i);
|
|
1584
|
+
} catch {
|
|
1585
|
+
return null;
|
|
1586
|
+
}
|
|
1587
|
+
return e.forEach((e) => {
|
|
1588
|
+
s.test(e) && (!a || o.compare(e) === -1) && (a = e, o = new n(a, i));
|
|
1589
|
+
}), a;
|
|
1590
|
+
};
|
|
1591
|
+
})), Pn = e(((e, t) => {
|
|
1592
|
+
var n = W(), r = Y();
|
|
1593
|
+
t.exports = (e, t, i) => {
|
|
1594
|
+
let a = null, o = null, s = null;
|
|
1595
|
+
try {
|
|
1596
|
+
s = new r(t, i);
|
|
1597
|
+
} catch {
|
|
1598
|
+
return null;
|
|
1599
|
+
}
|
|
1600
|
+
return e.forEach((e) => {
|
|
1601
|
+
s.test(e) && (!a || o.compare(e) === 1) && (a = e, o = new n(a, i));
|
|
1602
|
+
}), a;
|
|
1603
|
+
};
|
|
1604
|
+
})), Fn = e(((e, t) => {
|
|
1605
|
+
var n = W(), r = Y(), i = q();
|
|
1606
|
+
t.exports = (e, t) => {
|
|
1607
|
+
e = new r(e, t);
|
|
1608
|
+
let a = new n("0.0.0");
|
|
1609
|
+
if (e.test(a) || (a = new n("0.0.0-0"), e.test(a))) return a;
|
|
1610
|
+
a = null;
|
|
1611
|
+
for (let t = 0; t < e.set.length; ++t) {
|
|
1612
|
+
let r = e.set[t], o = null;
|
|
1613
|
+
r.forEach((e) => {
|
|
1614
|
+
let t = new n(e.semver.version);
|
|
1615
|
+
switch (e.operator) {
|
|
1616
|
+
case ">": t.prerelease.length === 0 ? t.patch++ : t.prerelease.push(0), t.raw = t.format();
|
|
1617
|
+
case "":
|
|
1618
|
+
case ">=":
|
|
1619
|
+
(!o || i(t, o)) && (o = t);
|
|
1620
|
+
break;
|
|
1621
|
+
case "<":
|
|
1622
|
+
case "<=": break;
|
|
1623
|
+
default: throw Error(`Unexpected operation: ${e.operator}`);
|
|
1624
|
+
}
|
|
1625
|
+
}), o && (!a || i(a, o)) && (a = o);
|
|
1626
|
+
}
|
|
1627
|
+
return a && e.test(a) ? a : null;
|
|
1628
|
+
};
|
|
1629
|
+
})), In = e(((e, t) => {
|
|
1630
|
+
var n = Y();
|
|
1631
|
+
t.exports = (e, t) => {
|
|
1632
|
+
try {
|
|
1633
|
+
return new n(e, t).range || "*";
|
|
1634
|
+
} catch {
|
|
1635
|
+
return null;
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
})), Q = e(((e, t) => {
|
|
1639
|
+
var n = W(), r = X(), { ANY: i } = r, a = Y(), o = Z(), s = q(), c = wn(), l = Dn(), u = J();
|
|
1640
|
+
t.exports = (e, t, d, f) => {
|
|
1641
|
+
e = new n(e, f), t = new a(t, f);
|
|
1642
|
+
let p, m, h, g, _;
|
|
1643
|
+
switch (d) {
|
|
1644
|
+
case ">":
|
|
1645
|
+
p = s, m = l, h = c, g = ">", _ = ">=";
|
|
1646
|
+
break;
|
|
1647
|
+
case "<":
|
|
1648
|
+
p = c, m = u, h = s, g = "<", _ = "<=";
|
|
1649
|
+
break;
|
|
1650
|
+
default: throw TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1651
|
+
}
|
|
1652
|
+
if (o(e, t, f)) return !1;
|
|
1653
|
+
for (let n = 0; n < t.set.length; ++n) {
|
|
1654
|
+
let a = t.set[n], o = null, s = null;
|
|
1655
|
+
if (a.forEach((e) => {
|
|
1656
|
+
e.semver === i && (e = new r(">=0.0.0")), o ||= e, s ||= e, p(e.semver, o.semver, f) ? o = e : h(e.semver, s.semver, f) && (s = e);
|
|
1657
|
+
}), o.operator === g || o.operator === _ || (!s.operator || s.operator === g) && m(e, s.semver) || s.operator === _ && h(e, s.semver)) return !1;
|
|
1658
|
+
}
|
|
1659
|
+
return !0;
|
|
1660
|
+
};
|
|
1661
|
+
})), Ln = e(((e, t) => {
|
|
1662
|
+
var n = Q();
|
|
1663
|
+
t.exports = (e, t, r) => n(e, t, ">", r);
|
|
1664
|
+
})), Rn = e(((e, t) => {
|
|
1665
|
+
var n = Q();
|
|
1666
|
+
t.exports = (e, t, r) => n(e, t, "<", r);
|
|
1667
|
+
})), zn = e(((e, t) => {
|
|
1668
|
+
var n = Y();
|
|
1669
|
+
t.exports = (e, t, r) => (e = new n(e, r), t = new n(t, r), e.intersects(t, r));
|
|
1670
|
+
})), Bn = e(((e, t) => {
|
|
1671
|
+
var n = Z(), r = K();
|
|
1672
|
+
t.exports = (e, t, i) => {
|
|
1673
|
+
let a = [], o = null, s = null, c = e.sort((e, t) => r(e, t, i));
|
|
1674
|
+
for (let e of c) n(e, t, i) ? (s = e, o ||= e) : (s && a.push([o, s]), s = null, o = null);
|
|
1675
|
+
o && a.push([o, null]);
|
|
1676
|
+
let l = [];
|
|
1677
|
+
for (let [e, t] of a) e === t ? l.push(e) : !t && e === c[0] ? l.push("*") : t ? e === c[0] ? l.push(`<=${t}`) : l.push(`${e} - ${t}`) : l.push(`>=${e}`);
|
|
1678
|
+
let u = l.join(" || "), d = typeof t.raw == "string" ? t.raw : String(t);
|
|
1679
|
+
return u.length < d.length ? u : t;
|
|
1680
|
+
};
|
|
1681
|
+
})), Vn = e(((e, t) => {
|
|
1682
|
+
var n = Y(), r = X(), { ANY: i } = r, a = Z(), o = K(), s = (e, t, r = {}) => {
|
|
1683
|
+
if (e === t) return !0;
|
|
1684
|
+
e = new n(e, r), t = new n(t, r);
|
|
1685
|
+
let i = !1;
|
|
1686
|
+
OUTER: for (let n of e.set) {
|
|
1687
|
+
for (let e of t.set) {
|
|
1688
|
+
let t = u(n, e, r);
|
|
1689
|
+
if (i ||= t !== null, t) continue OUTER;
|
|
1690
|
+
}
|
|
1691
|
+
if (i) return !1;
|
|
1692
|
+
}
|
|
1693
|
+
return !0;
|
|
1694
|
+
}, c = [new r(">=0.0.0-0")], l = [new r(">=0.0.0")], u = (e, t, n) => {
|
|
1695
|
+
if (e === t) return !0;
|
|
1696
|
+
if (e.length === 1 && e[0].semver === i) {
|
|
1697
|
+
if (t.length === 1 && t[0].semver === i) return !0;
|
|
1698
|
+
e = n.includePrerelease ? c : l;
|
|
1699
|
+
}
|
|
1700
|
+
if (t.length === 1 && t[0].semver === i) {
|
|
1701
|
+
if (n.includePrerelease) return !0;
|
|
1702
|
+
t = l;
|
|
1703
|
+
}
|
|
1704
|
+
let r = new Set(), s, u;
|
|
1705
|
+
for (let t of e) t.operator === ">" || t.operator === ">=" ? s = d(s, t, n) : t.operator === "<" || t.operator === "<=" ? u = f(u, t, n) : r.add(t.semver);
|
|
1706
|
+
if (r.size > 1) return null;
|
|
1707
|
+
let p;
|
|
1708
|
+
if (s && u && (p = o(s.semver, u.semver, n), p > 0 || p === 0 && (s.operator !== ">=" || u.operator !== "<="))) return null;
|
|
1709
|
+
for (let e of r) {
|
|
1710
|
+
if (s && !a(e, String(s), n) || u && !a(e, String(u), n)) return null;
|
|
1711
|
+
for (let r of t) if (!a(e, String(r), n)) return !1;
|
|
1712
|
+
return !0;
|
|
1713
|
+
}
|
|
1714
|
+
let m, h, g, _, v = u && !n.includePrerelease && u.semver.prerelease.length ? u.semver : !1, y = s && !n.includePrerelease && s.semver.prerelease.length ? s.semver : !1;
|
|
1715
|
+
v && v.prerelease.length === 1 && u.operator === "<" && v.prerelease[0] === 0 && (v = !1);
|
|
1716
|
+
for (let e of t) {
|
|
1717
|
+
if (_ = _ || e.operator === ">" || e.operator === ">=", g = g || e.operator === "<" || e.operator === "<=", s) {
|
|
1718
|
+
if (y && e.semver.prerelease && e.semver.prerelease.length && e.semver.major === y.major && e.semver.minor === y.minor && e.semver.patch === y.patch && (y = !1), e.operator === ">" || e.operator === ">=") {
|
|
1719
|
+
if (m = d(s, e, n), m === e && m !== s) return !1;
|
|
1720
|
+
} else if (s.operator === ">=" && !e.test(s.semver)) return !1;
|
|
1721
|
+
}
|
|
1722
|
+
if (u) {
|
|
1723
|
+
if (v && e.semver.prerelease && e.semver.prerelease.length && e.semver.major === v.major && e.semver.minor === v.minor && e.semver.patch === v.patch && (v = !1), e.operator === "<" || e.operator === "<=") {
|
|
1724
|
+
if (h = f(u, e, n), h === e && h !== u) return !1;
|
|
1725
|
+
} else if (u.operator === "<=" && !e.test(u.semver)) return !1;
|
|
1726
|
+
}
|
|
1727
|
+
if (!e.operator && (u || s) && p !== 0) return !1;
|
|
1728
|
+
}
|
|
1729
|
+
return !(s && g && !u && p !== 0 || u && _ && !s && p !== 0 || y || v);
|
|
1730
|
+
}, d = (e, t, n) => {
|
|
1731
|
+
if (!e) return t;
|
|
1732
|
+
let r = o(e.semver, t.semver, n);
|
|
1733
|
+
return r > 0 ? e : r < 0 || t.operator === ">" && e.operator === ">=" ? t : e;
|
|
1734
|
+
}, f = (e, t, n) => {
|
|
1735
|
+
if (!e) return t;
|
|
1736
|
+
let r = o(e.semver, t.semver, n);
|
|
1737
|
+
return r < 0 ? e : r > 0 || t.operator === "<" && e.operator === "<=" ? t : e;
|
|
1738
|
+
};
|
|
1739
|
+
t.exports = s;
|
|
1740
|
+
})), Hn = e(((e, t) => {
|
|
1741
|
+
var n = U(), r = V(), i = W(), a = un();
|
|
1742
|
+
t.exports = {
|
|
1743
|
+
parse: G(),
|
|
1744
|
+
valid: dn(),
|
|
1745
|
+
clean: fn(),
|
|
1746
|
+
inc: pn(),
|
|
1747
|
+
diff: mn(),
|
|
1748
|
+
major: hn(),
|
|
1749
|
+
minor: gn(),
|
|
1750
|
+
patch: _n(),
|
|
1751
|
+
prerelease: vn(),
|
|
1752
|
+
compare: K(),
|
|
1753
|
+
rcompare: yn(),
|
|
1754
|
+
compareLoose: bn(),
|
|
1755
|
+
compareBuild: xn(),
|
|
1756
|
+
sort: Sn(),
|
|
1757
|
+
rsort: Cn(),
|
|
1758
|
+
gt: q(),
|
|
1759
|
+
lt: wn(),
|
|
1760
|
+
eq: Tn(),
|
|
1761
|
+
neq: En(),
|
|
1762
|
+
gte: J(),
|
|
1763
|
+
lte: Dn(),
|
|
1764
|
+
cmp: On(),
|
|
1765
|
+
coerce: kn(),
|
|
1766
|
+
truncate: An(),
|
|
1767
|
+
Comparator: X(),
|
|
1768
|
+
Range: Y(),
|
|
1769
|
+
satisfies: Z(),
|
|
1770
|
+
toComparators: Mn(),
|
|
1771
|
+
maxSatisfying: Nn(),
|
|
1772
|
+
minSatisfying: Pn(),
|
|
1773
|
+
minVersion: Fn(),
|
|
1774
|
+
validRange: In(),
|
|
1775
|
+
outside: Q(),
|
|
1776
|
+
gtr: Ln(),
|
|
1777
|
+
ltr: Rn(),
|
|
1778
|
+
intersects: zn(),
|
|
1779
|
+
simplifyRange: Bn(),
|
|
1780
|
+
subset: Vn(),
|
|
1781
|
+
SemVer: i,
|
|
1782
|
+
re: n.re,
|
|
1783
|
+
src: n.src,
|
|
1784
|
+
tokens: n.t,
|
|
1785
|
+
SEMVER_SPEC_VERSION: r.SEMVER_SPEC_VERSION,
|
|
1786
|
+
RELEASE_TYPES: r.RELEASE_TYPES,
|
|
1787
|
+
compareIdentifiers: a.compareIdentifiers,
|
|
1788
|
+
rcompareIdentifiers: a.rcompareIdentifiers
|
|
1789
|
+
};
|
|
1790
|
+
})), $ = Hn(), Un = Object.freeze([
|
|
1791
|
+
"@moldea.ai/core",
|
|
1792
|
+
"@moldea.ai/repository",
|
|
1793
|
+
"@moldea.ai/repository-fs"
|
|
1794
|
+
]), Wn = Object.freeze({
|
|
1795
|
+
"@moldea.ai/core": "^10.0.0",
|
|
1796
|
+
"@moldea.ai/repository": "^4.0.0",
|
|
1797
|
+
"@moldea.ai/repository-fs": "^4.0.0"
|
|
1798
|
+
}), Gn = (e, t) => {
|
|
1799
|
+
if (e.length !== t.length || new Set(e).size !== e.length || new Set(t).size !== t.length) return !1;
|
|
1800
|
+
let n = new Set(t);
|
|
1801
|
+
return e.every((e) => n.has(e));
|
|
1802
|
+
}, Kn = (e) => e.length > 0 && e.every((e) => Number.isSafeInteger(e) && e > 0) && new Set(e).size === e.length, qn = (e) => {
|
|
1803
|
+
let { dependencies: t, installedPackageVersions: n, supportedNodeRange: r, version: i } = e.packageMetadata;
|
|
1804
|
+
if ((0, $.valid)(i) === null || r === null || (0, $.validRange)(r) === null || (0, $.valid)(e.minimumGitVersion) === null || e.outputSchemaVersion !== 8 || t === null || n === null || !Kn(e.coreSupportedRepositoryFormatVersions)) return !1;
|
|
1805
|
+
let a = [...Un], o = Object.keys(t).filter((e) => e.startsWith("@moldea.ai/")), s = Object.keys(n);
|
|
1806
|
+
return !Gn(o, a) || !Gn(s, a) ? !1 : a.every((e) => {
|
|
1807
|
+
let r = n[e], i = t[e], a = Wn[e];
|
|
1808
|
+
return r !== void 0 && (0, $.valid)(r) !== null && a !== void 0 && (i === a || i === `workspace:${a}`) && (0, $.satisfies)(r, a);
|
|
1809
|
+
});
|
|
1810
|
+
}, Jn = (e, t) => e < t ? -1 : +(e > t), Yn = (e) => {
|
|
1811
|
+
let t = Object.entries(e.packageMetadata.installedPackageVersions ?? {}).map(([e, t]) => ({
|
|
1812
|
+
name: e,
|
|
1813
|
+
version: t
|
|
1814
|
+
})).sort((e, t) => Jn(e.name, t.name));
|
|
1815
|
+
return o({
|
|
1816
|
+
minimumGitVersion: e.minimumGitVersion,
|
|
1817
|
+
packages: t,
|
|
1818
|
+
repositoryFormatVersions: [...e.coreSupportedRepositoryFormatVersions].sort((e, t) => e - t),
|
|
1819
|
+
supportedNodeRange: e.packageMetadata.supportedNodeRange ?? ""
|
|
1820
|
+
});
|
|
1821
|
+
}, Xn = Object.freeze({ kind: "invalid" }), Zn = (e) => {
|
|
1822
|
+
try {
|
|
1823
|
+
return qn(e) ? Object.freeze({
|
|
1824
|
+
kind: "valid",
|
|
1825
|
+
result: Yn(e)
|
|
1826
|
+
}) : Xn;
|
|
1827
|
+
} catch {
|
|
1828
|
+
return Xn;
|
|
1829
|
+
}
|
|
1830
|
+
}, Qn = (e) => Zn({
|
|
1831
|
+
coreSupportedRepositoryFormatVersions: a,
|
|
1832
|
+
minimumGitVersion: nn,
|
|
1833
|
+
outputSchemaVersion: 8,
|
|
1834
|
+
packageMetadata: e.packageMetadata
|
|
1835
|
+
});
|
|
1836
|
+
//#endregion
|
|
1837
|
+
export { gt as A, xe as B, pt as C, vt as D, lt as E, E as F, S as H, Ne as I, T as L, Qe as M, O as N, st as O, He as P, je as R, ot as S, dt as T, m as U, w as V, Ct as _, Hn as a, ct as b, tn as c, Jt as d, Xt as f, P as g, R as h, qn as i, ft as j, mt as k, Qt as l, Yt as m, Zn as n, cn as o, qt as p, Yn as r, sn as s, Qn as t, en as u, St as v, ht as w, _t as x, at as y, Ae as z };
|