@moldea.ai/cli 14.0.0 → 14.0.2
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/chunks/{composition-_3bygS_a.js → composition-BzwNJ346.js} +2 -2
- package/dist/chunks/{composition-_3bygS_a.js.map → composition-BzwNJ346.js.map} +1 -1
- package/dist/chunks/{composition-D1OYuZ5d.js → composition-aJXeA6un.js} +1 -1
- package/dist/chunks/{core-composition-BKcJ--NX.js → core-composition-CzdeqYS9.js} +2 -2
- package/dist/chunks/{core-composition-BKcJ--NX.js.map → core-composition-CzdeqYS9.js.map} +1 -1
- package/dist/moldea.js +3 -3
- package/dist/portable/SHA256SUMS +16 -16
- package/dist/portable/analysis-worker.mjs +110 -133
- package/dist/portable/chunk-1b3c5f05.mjs +1837 -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-8a1dadf9.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-a6007228.mjs +302 -0
- package/dist/portable/chunk-b1f86976.mjs +2 -0
- package/dist/portable/chunk-cea1378f.mjs +50 -0
- package/dist/portable/chunk-d372f5e0.mjs +3120 -0
- package/dist/portable/chunk-d6656fa6.mjs +14 -0
- package/dist/portable/moldea.mjs +1997 -2870
- package/dist/portable/node-runner.mjs +77 -106
- package/package.json +2 -2
- 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,422 @@
|
|
|
1
|
+
import { f as e, u as t } from "./chunk-2cc3bf5c.mjs";
|
|
2
|
+
//#region ../repository/dist/chunks/links-DPog2q0N.js
|
|
3
|
+
var n = {
|
|
4
|
+
ABORTED: "The repository operation was aborted.",
|
|
5
|
+
ACCESS_DENIED: "Access to the repository source was denied.",
|
|
6
|
+
ENTRY_NOT_DIRECTORY: "The requested repository entry is not a directory.",
|
|
7
|
+
ENTRY_NOT_FILE: "The requested repository entry is not a file.",
|
|
8
|
+
ENTRY_NOT_FOUND: "The requested repository entry was not found.",
|
|
9
|
+
ENTRY_NOT_LINK: "The requested repository entry is not a symlink.",
|
|
10
|
+
INVALID_PAGE_REQUEST: "The repository page request is invalid.",
|
|
11
|
+
INVALID_SOURCE_DATA: "The repository source returned invalid data.",
|
|
12
|
+
PROVIDER_INCOMPLETE: "The repository provider cannot expose a complete result.",
|
|
13
|
+
RESOURCE_LIMIT_EXCEEDED: "A named repository resource limit was exceeded.",
|
|
14
|
+
SNAPSHOT_CHANGED: "The repository snapshot changed during the operation.",
|
|
15
|
+
SOURCE_UNAVAILABLE: "The repository source is unavailable."
|
|
16
|
+
}, r = class extends e {
|
|
17
|
+
code;
|
|
18
|
+
constructor(e) {
|
|
19
|
+
super("The repository path is invalid.", {
|
|
20
|
+
code: "INVALID_REPOSITORY_PATH",
|
|
21
|
+
cause: e?.cause
|
|
22
|
+
}), this.code = "INVALID_REPOSITORY_PATH", this.name = "RepositoryPathException";
|
|
23
|
+
}
|
|
24
|
+
}, i = class extends e {
|
|
25
|
+
code;
|
|
26
|
+
operation;
|
|
27
|
+
path;
|
|
28
|
+
resource;
|
|
29
|
+
retryable;
|
|
30
|
+
constructor(e) {
|
|
31
|
+
super(n[e.code], {
|
|
32
|
+
code: e.code,
|
|
33
|
+
cause: e.cause
|
|
34
|
+
}), this.code = e.code, this.name = "RepositorySourceException", this.operation = e.operation, this.path = e.path, this.resource = e.resource ?? null, this.retryable = e.retryable;
|
|
35
|
+
}
|
|
36
|
+
}, a = [
|
|
37
|
+
1779033703,
|
|
38
|
+
3144134277,
|
|
39
|
+
1013904242,
|
|
40
|
+
2773480762,
|
|
41
|
+
1359893119,
|
|
42
|
+
2600822924,
|
|
43
|
+
528734635,
|
|
44
|
+
1541459225
|
|
45
|
+
], o = [
|
|
46
|
+
1116352408,
|
|
47
|
+
1899447441,
|
|
48
|
+
3049323471,
|
|
49
|
+
3921009573,
|
|
50
|
+
961987163,
|
|
51
|
+
1508970993,
|
|
52
|
+
2453635748,
|
|
53
|
+
2870763221,
|
|
54
|
+
3624381080,
|
|
55
|
+
310598401,
|
|
56
|
+
607225278,
|
|
57
|
+
1426881987,
|
|
58
|
+
1925078388,
|
|
59
|
+
2162078206,
|
|
60
|
+
2614888103,
|
|
61
|
+
3248222580,
|
|
62
|
+
3835390401,
|
|
63
|
+
4022224774,
|
|
64
|
+
264347078,
|
|
65
|
+
604807628,
|
|
66
|
+
770255983,
|
|
67
|
+
1249150122,
|
|
68
|
+
1555081692,
|
|
69
|
+
1996064986,
|
|
70
|
+
2554220882,
|
|
71
|
+
2821834349,
|
|
72
|
+
2952996808,
|
|
73
|
+
3210313671,
|
|
74
|
+
3336571891,
|
|
75
|
+
3584528711,
|
|
76
|
+
113926993,
|
|
77
|
+
338241895,
|
|
78
|
+
666307205,
|
|
79
|
+
773529912,
|
|
80
|
+
1294757372,
|
|
81
|
+
1396182291,
|
|
82
|
+
1695183700,
|
|
83
|
+
1986661051,
|
|
84
|
+
2177026350,
|
|
85
|
+
2456956037,
|
|
86
|
+
2730485921,
|
|
87
|
+
2820302411,
|
|
88
|
+
3259730800,
|
|
89
|
+
3345764771,
|
|
90
|
+
3516065817,
|
|
91
|
+
3600352804,
|
|
92
|
+
4094571909,
|
|
93
|
+
275423344,
|
|
94
|
+
430227734,
|
|
95
|
+
506948616,
|
|
96
|
+
659060556,
|
|
97
|
+
883997877,
|
|
98
|
+
958139571,
|
|
99
|
+
1322822218,
|
|
100
|
+
1537002063,
|
|
101
|
+
1747873779,
|
|
102
|
+
1955562222,
|
|
103
|
+
2024104815,
|
|
104
|
+
2227730452,
|
|
105
|
+
2361852424,
|
|
106
|
+
2428436474,
|
|
107
|
+
2756734187,
|
|
108
|
+
3204031479,
|
|
109
|
+
3329325298
|
|
110
|
+
], s = (e, t) => e >>> t | e << 32 - t, c = (e, t, n, r) => {
|
|
111
|
+
for (let e = 0; e < 16; e += 1) {
|
|
112
|
+
let i = n + e * 4;
|
|
113
|
+
r[e] = (t[i] ?? 0) << 24 | (t[i + 1] ?? 0) << 16 | (t[i + 2] ?? 0) << 8 | (t[i + 3] ?? 0);
|
|
114
|
+
}
|
|
115
|
+
for (let e = 16; e < 64; e += 1) {
|
|
116
|
+
let t = r[e - 15] ?? 0, n = r[e - 2] ?? 0, i = s(t, 7) ^ s(t, 18) ^ t >>> 3, a = s(n, 17) ^ s(n, 19) ^ n >>> 10;
|
|
117
|
+
r[e] = (r[e - 16] ?? 0) + i + (r[e - 7] ?? 0) + a >>> 0;
|
|
118
|
+
}
|
|
119
|
+
let i = e[0] ?? 0, a = e[1] ?? 0, c = e[2] ?? 0, l = e[3] ?? 0, u = e[4] ?? 0, d = e[5] ?? 0, f = e[6] ?? 0, p = e[7] ?? 0;
|
|
120
|
+
for (let e = 0; e < 64; e += 1) {
|
|
121
|
+
let t = s(u, 6) ^ s(u, 11) ^ s(u, 25), n = u & d ^ ~u & f, m = p + t + n + (o[e] ?? 0) + (r[e] ?? 0) >>> 0, h = (s(i, 2) ^ s(i, 13) ^ s(i, 22)) + (i & a ^ i & c ^ a & c) >>> 0;
|
|
122
|
+
p = f, f = d, d = u, u = l + m >>> 0, l = c, c = a, a = i, i = m + h >>> 0;
|
|
123
|
+
}
|
|
124
|
+
e[0] = (e[0] ?? 0) + i >>> 0, e[1] = (e[1] ?? 0) + a >>> 0, e[2] = (e[2] ?? 0) + c >>> 0, e[3] = (e[3] ?? 0) + l >>> 0, e[4] = (e[4] ?? 0) + u >>> 0, e[5] = (e[5] ?? 0) + d >>> 0, e[6] = (e[6] ?? 0) + f >>> 0, e[7] = (e[7] ?? 0) + p >>> 0;
|
|
125
|
+
}, l = (e) => {
|
|
126
|
+
let t = [...a], n = new Uint32Array(64), r = new Uint8Array(64), i = 0, o = 0n, s = (e) => {
|
|
127
|
+
o += BigInt(e.byteLength);
|
|
128
|
+
let a = 0;
|
|
129
|
+
if (i > 0) {
|
|
130
|
+
let o = Math.min(64 - i, e.byteLength);
|
|
131
|
+
r.set(e.subarray(0, o), i), i += o, a = o, i === 64 && (c(t, r, 0, n), i = 0);
|
|
132
|
+
}
|
|
133
|
+
for (; a + 64 <= e.byteLength;) c(t, e, a, n), a += 64;
|
|
134
|
+
a < e.byteLength && (r.set(e.subarray(a), 0), i = e.byteLength - a);
|
|
135
|
+
};
|
|
136
|
+
for (let t of e) {
|
|
137
|
+
let e = BigInt(t.byteLength), n = new Uint8Array(8), r = new DataView(n.buffer);
|
|
138
|
+
r.setUint32(0, Number(e >> 32n), !1), r.setUint32(4, Number(e & 4294967295n), !1), s(n), s(t);
|
|
139
|
+
}
|
|
140
|
+
let l = i < 56 ? 64 : 128, u = new Uint8Array(l);
|
|
141
|
+
u.set(r.subarray(0, i)), u[i] = 128;
|
|
142
|
+
let d = o * 8n, f = new DataView(u.buffer);
|
|
143
|
+
f.setUint32(l - 8, Number(d >> 32n), !1), f.setUint32(l - 4, Number(d & 4294967295n), !1);
|
|
144
|
+
for (let e = 0; e < l; e += 64) c(t, u, e, n);
|
|
145
|
+
let p = new Uint8Array(32), m = new DataView(p.buffer);
|
|
146
|
+
return t.forEach((e, t) => m.setUint32(t * 4, e, !1)), p;
|
|
147
|
+
}, u = (e) => {
|
|
148
|
+
let t = l(e);
|
|
149
|
+
return `sha256:${Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
150
|
+
}, d = new TextEncoder(), f = new Set([
|
|
151
|
+
"checksum",
|
|
152
|
+
"payload",
|
|
153
|
+
"version"
|
|
154
|
+
]), p = (e) => {
|
|
155
|
+
let t = JSON.stringify(e);
|
|
156
|
+
return JSON.stringify({
|
|
157
|
+
checksum: u([d.encode(t)]),
|
|
158
|
+
payload: t,
|
|
159
|
+
version: 1
|
|
160
|
+
});
|
|
161
|
+
}, m = (e) => {
|
|
162
|
+
let n = JSON.parse(e);
|
|
163
|
+
if (!t(n, !0) || Reflect.ownKeys(n).some((e) => typeof e != "string" || !f.has(e)) || n.version !== 1 || typeof n.payload != "string" || typeof n.checksum != "string" || n.checksum !== u([d.encode(n.payload)])) throw TypeError("The repository cursor is invalid.");
|
|
164
|
+
return JSON.parse(n.payload);
|
|
165
|
+
}, h = (e, t, n) => {
|
|
166
|
+
if (!Number.isSafeInteger(e) || e <= 0) throw new i({
|
|
167
|
+
code: "INVALID_PAGE_REQUEST",
|
|
168
|
+
operation: t,
|
|
169
|
+
path: n,
|
|
170
|
+
retryable: !1
|
|
171
|
+
});
|
|
172
|
+
return e;
|
|
173
|
+
}, g = /^\/[A-Za-z]:/u, _ = (e) => {
|
|
174
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
175
|
+
let n = e.charCodeAt(t);
|
|
176
|
+
if (n <= 31 || n === 127) return !0;
|
|
177
|
+
}
|
|
178
|
+
return !1;
|
|
179
|
+
}, v = (e) => typeof e != "string" || !e.isWellFormed() ? !1 : e === "/" ? !0 : !e.startsWith("/") || e.startsWith("//") || e.endsWith("/") || e.includes("\\") || _(e) || g.test(e) ? !1 : e.slice(1).split("/").every((e) => e !== "" && e !== "." && e !== ".."), y = (e) => {
|
|
180
|
+
if (!v(e)) throw new r();
|
|
181
|
+
return e;
|
|
182
|
+
}, b = (e, t) => {
|
|
183
|
+
let n = e.split("/"), r = t.split("/"), i = Math.min(n.length, r.length);
|
|
184
|
+
for (let e = 0; e < i; e += 1) {
|
|
185
|
+
let t = n[e] ?? "", i = r[e] ?? "";
|
|
186
|
+
if (t < i) return -1;
|
|
187
|
+
if (t > i) return 1;
|
|
188
|
+
}
|
|
189
|
+
return n.length - r.length;
|
|
190
|
+
}, x = y("/"), S = new Set([
|
|
191
|
+
"baseCursor",
|
|
192
|
+
"baseSnapshotId",
|
|
193
|
+
"candidateCursor",
|
|
194
|
+
"candidateSnapshotId",
|
|
195
|
+
"pendingFile"
|
|
196
|
+
]), C = new Set(["offset", "path"]), w = (e) => {
|
|
197
|
+
if (e?.aborted) throw new i({
|
|
198
|
+
cause: e.reason,
|
|
199
|
+
code: "ABORTED",
|
|
200
|
+
operation: "list-changes-page",
|
|
201
|
+
path: null,
|
|
202
|
+
retryable: !1
|
|
203
|
+
});
|
|
204
|
+
}, T = (e) => new i({
|
|
205
|
+
cause: e,
|
|
206
|
+
code: "INVALID_PAGE_REQUEST",
|
|
207
|
+
operation: "list-changes-page",
|
|
208
|
+
path: null,
|
|
209
|
+
retryable: !1
|
|
210
|
+
}), E = (e, t, n) => {
|
|
211
|
+
if (e === void 0) return {
|
|
212
|
+
baseCursor: null,
|
|
213
|
+
baseSnapshotId: t,
|
|
214
|
+
candidateCursor: null,
|
|
215
|
+
candidateSnapshotId: n,
|
|
216
|
+
pendingFile: null
|
|
217
|
+
};
|
|
218
|
+
try {
|
|
219
|
+
let r = m(e);
|
|
220
|
+
if (typeof r != "object" || !r || Reflect.ownKeys(r).some((e) => typeof e != "string" || !S.has(e)) || r.baseSnapshotId !== t || r.candidateSnapshotId !== n || typeof r.baseCursor != "string" && r.baseCursor !== null || typeof r.candidateCursor != "string" && r.candidateCursor !== null || r.pendingFile !== null && (typeof r.pendingFile != "object" || Reflect.ownKeys(r.pendingFile).some((e) => typeof e != "string" || !C.has(e)) || typeof r.pendingFile.path != "string" || !Number.isSafeInteger(r.pendingFile.offset) || r.pendingFile.offset < 0)) throw Error("invalid comparison cursor");
|
|
221
|
+
return r;
|
|
222
|
+
} catch (e) {
|
|
223
|
+
throw T(e);
|
|
224
|
+
}
|
|
225
|
+
}, D = (e, t) => {
|
|
226
|
+
throw new i({
|
|
227
|
+
cause: t,
|
|
228
|
+
code: "INVALID_SOURCE_DATA",
|
|
229
|
+
operation: "list-changes-page",
|
|
230
|
+
path: e,
|
|
231
|
+
retryable: !1
|
|
232
|
+
});
|
|
233
|
+
}, O = async (e, t, n) => {
|
|
234
|
+
if (t === "") return null;
|
|
235
|
+
let r = await e.listEntriesPage({
|
|
236
|
+
...t === null ? {} : { cursor: t },
|
|
237
|
+
maxEntries: 1,
|
|
238
|
+
prefix: x,
|
|
239
|
+
...n === void 0 ? {} : { signal: n }
|
|
240
|
+
});
|
|
241
|
+
if (r.snapshot.id !== e.snapshot.id || r.entries.length > 1) throw T();
|
|
242
|
+
let i = r.entries[0];
|
|
243
|
+
if (i === void 0) {
|
|
244
|
+
if (!r.isComplete || r.nextCursor !== null) throw T();
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
if (!r.isComplete && r.nextCursor === null) throw T();
|
|
248
|
+
return {
|
|
249
|
+
cursorAfter: r.nextCursor ?? "",
|
|
250
|
+
entry: i
|
|
251
|
+
};
|
|
252
|
+
}, k = (e, t, n) => {
|
|
253
|
+
if (e.type !== t.type) return {
|
|
254
|
+
baseEntry: e,
|
|
255
|
+
candidateEntry: t,
|
|
256
|
+
kind: "type-changed",
|
|
257
|
+
path: e.path
|
|
258
|
+
};
|
|
259
|
+
if (e.type !== "file") return null;
|
|
260
|
+
if (e.byteLength !== null && t.byteLength !== null && e.byteLength !== t.byteLength) return {
|
|
261
|
+
baseEntry: e,
|
|
262
|
+
candidateEntry: t,
|
|
263
|
+
kind: "modified",
|
|
264
|
+
path: e.path
|
|
265
|
+
};
|
|
266
|
+
if (n && e.contentIdentity !== null && t.contentIdentity !== null && e.contentIdentity === t.contentIdentity || e.byteLength === 0 && t.byteLength === 0) return null;
|
|
267
|
+
}, A = (e, t, n, r, i) => {
|
|
268
|
+
let a = r + e.bytes.byteLength;
|
|
269
|
+
(!(e.bytes instanceof Uint8Array) || e.bytes.byteLength > i || e.offset !== r || e.snapshot.id !== n || !Number.isSafeInteger(e.totalBytes) || e.totalBytes < r || a > e.totalBytes || t.byteLength !== null && e.totalBytes !== t.byteLength || e.isComplete !== (a === e.totalBytes) || e.nextOffset !== (e.isComplete ? null : a) || !e.isComplete && e.bytes.byteLength === 0) && D(t.path);
|
|
270
|
+
}, j = async (e, t, n, r, i, a, o) => {
|
|
271
|
+
let s = Math.floor(a / 2);
|
|
272
|
+
if (s < 1) return {
|
|
273
|
+
bytesRead: 0,
|
|
274
|
+
isComplete: !1,
|
|
275
|
+
isEqual: !0,
|
|
276
|
+
nextOffset: i
|
|
277
|
+
};
|
|
278
|
+
let c = await e.readFilePage(n.path, {
|
|
279
|
+
maxBytes: s,
|
|
280
|
+
offset: i,
|
|
281
|
+
...o === void 0 ? {} : { signal: o }
|
|
282
|
+
});
|
|
283
|
+
A(c, n, e.snapshot.id, i, s);
|
|
284
|
+
let l = c.bytes.byteLength, u = i, d = 0, f = null, p = Math.max(c.bytes.byteLength, 1);
|
|
285
|
+
for (; d < p;) {
|
|
286
|
+
let e = p - d, n = await t.readFilePage(r.path, {
|
|
287
|
+
maxBytes: e,
|
|
288
|
+
offset: u,
|
|
289
|
+
...o === void 0 ? {} : { signal: o }
|
|
290
|
+
});
|
|
291
|
+
if (A(n, r, t.snapshot.id, u, e), f = n.totalBytes, l += n.bytes.byteLength, c.totalBytes !== n.totalBytes) return {
|
|
292
|
+
bytesRead: l,
|
|
293
|
+
isComplete: !0,
|
|
294
|
+
isEqual: !1,
|
|
295
|
+
nextOffset: i
|
|
296
|
+
};
|
|
297
|
+
for (let e = 0; e < n.bytes.byteLength; e += 1) if (c.bytes[d + e] !== n.bytes[e]) return {
|
|
298
|
+
bytesRead: l,
|
|
299
|
+
isComplete: !0,
|
|
300
|
+
isEqual: !1,
|
|
301
|
+
nextOffset: i
|
|
302
|
+
};
|
|
303
|
+
if (d += n.bytes.byteLength, u += n.bytes.byteLength, n.isComplete) break;
|
|
304
|
+
}
|
|
305
|
+
f === null && D(r.path);
|
|
306
|
+
let m = i + c.bytes.byteLength, h = m === c.totalBytes && m === f;
|
|
307
|
+
return {
|
|
308
|
+
bytesRead: l,
|
|
309
|
+
isComplete: h,
|
|
310
|
+
isEqual: !0,
|
|
311
|
+
nextOffset: m
|
|
312
|
+
};
|
|
313
|
+
}, M = class {
|
|
314
|
+
baseSnapshot;
|
|
315
|
+
candidateSnapshot;
|
|
316
|
+
#e;
|
|
317
|
+
#t;
|
|
318
|
+
constructor(e, t) {
|
|
319
|
+
this.#e = e, this.#t = t, this.baseSnapshot = e.snapshot, this.candidateSnapshot = t.snapshot;
|
|
320
|
+
}
|
|
321
|
+
async listChangesPage(e) {
|
|
322
|
+
let t = h(e.maxChanges, "list-changes-page", null), n = h(e.maxEntriesVisited, "list-changes-page", null), r = h(e.maxBytesRead, "list-changes-page", null);
|
|
323
|
+
if (r < 2) throw T();
|
|
324
|
+
w(e.signal);
|
|
325
|
+
let i = E(e.cursor, this.baseSnapshot.id, this.candidateSnapshot.id), a = i.baseCursor, o = i.candidateCursor, s = i.pendingFile, c = [], l = 0, u = 0, d, f;
|
|
326
|
+
for (; u < n && c.length < t && (w(e.signal), [d, f] = await Promise.all([d === void 0 ? O(this.#e, a, e.signal) : Promise.resolve(d), f === void 0 ? O(this.#t, o, e.signal) : Promise.resolve(f)]), d === null && (a = ""), f === null && (o = ""), d !== null || f !== null);) {
|
|
327
|
+
let t = d?.entry, n = f?.entry;
|
|
328
|
+
if (s !== null && (t?.path !== s.path || n?.path !== s.path)) throw T();
|
|
329
|
+
if (n === void 0 || t !== void 0 && b(t.path, n.path) < 0) c.push({
|
|
330
|
+
baseEntry: t ?? null,
|
|
331
|
+
candidateEntry: null,
|
|
332
|
+
kind: "deleted",
|
|
333
|
+
path: t?.path ?? x
|
|
334
|
+
}), a = d?.cursorAfter ?? "", d = void 0;
|
|
335
|
+
else if (t === void 0 || b(n.path, t.path) < 0) c.push({
|
|
336
|
+
baseEntry: null,
|
|
337
|
+
candidateEntry: n,
|
|
338
|
+
kind: "added",
|
|
339
|
+
path: n.path
|
|
340
|
+
}), o = f?.cursorAfter ?? "", f = void 0;
|
|
341
|
+
else {
|
|
342
|
+
let i = k(t, n, this.baseSnapshot.sourceKind === this.candidateSnapshot.sourceKind);
|
|
343
|
+
if (i !== void 0) i !== null && c.push(i), a = d?.cursorAfter ?? "", o = f?.cursorAfter ?? "", d = void 0, f = void 0, s = null;
|
|
344
|
+
else if (r - l < 2) break;
|
|
345
|
+
else {
|
|
346
|
+
let i = await j(this.#e, this.#t, t, n, s?.offset ?? 0, r - l, e.signal);
|
|
347
|
+
l += i.bytesRead, i.isEqual || c.push({
|
|
348
|
+
baseEntry: t,
|
|
349
|
+
candidateEntry: n,
|
|
350
|
+
kind: "modified",
|
|
351
|
+
path: t.path
|
|
352
|
+
}), i.isComplete ? (a = d?.cursorAfter ?? "", o = f?.cursorAfter ?? "", d = void 0, f = void 0, s = null) : s = {
|
|
353
|
+
offset: i.nextOffset,
|
|
354
|
+
path: t.path
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (u += 1, s !== null) break;
|
|
359
|
+
}
|
|
360
|
+
let m = a === "" && o === "" && s === null, g = m ? null : p({
|
|
361
|
+
baseCursor: a,
|
|
362
|
+
baseSnapshotId: this.baseSnapshot.id,
|
|
363
|
+
candidateCursor: o,
|
|
364
|
+
candidateSnapshotId: this.candidateSnapshot.id,
|
|
365
|
+
pendingFile: s
|
|
366
|
+
});
|
|
367
|
+
return {
|
|
368
|
+
baseSnapshot: this.baseSnapshot,
|
|
369
|
+
bytesRead: l,
|
|
370
|
+
candidateSnapshot: this.candidateSnapshot,
|
|
371
|
+
changes: c,
|
|
372
|
+
entriesVisited: u,
|
|
373
|
+
isComplete: m,
|
|
374
|
+
nextCursor: g
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
}, N = async (e, t, n) => {
|
|
378
|
+
if (n?.signal?.aborted) throw new i({
|
|
379
|
+
cause: n.signal.reason,
|
|
380
|
+
code: "ABORTED",
|
|
381
|
+
operation: "create-comparison",
|
|
382
|
+
path: null,
|
|
383
|
+
retryable: !1
|
|
384
|
+
});
|
|
385
|
+
return await Promise.resolve(), new M(e, t);
|
|
386
|
+
}, P = 4096, F = /^[A-Za-z]:/u, I = (e, t) => {
|
|
387
|
+
if (t === null || t === "") return { kind: "unsupported" };
|
|
388
|
+
if (t.startsWith("/") || F.test(t)) return { kind: "outside" };
|
|
389
|
+
let n = t.split("/");
|
|
390
|
+
if (n.at(-1) === "") return { kind: "unsupported" };
|
|
391
|
+
let r = n.filter((e) => e !== "" && e !== "."), i = e.split("/").slice(1, -1), a = 0;
|
|
392
|
+
for (; r[a] === "..";) {
|
|
393
|
+
if (i.length === 0) return { kind: "outside" };
|
|
394
|
+
i.pop(), a += 1;
|
|
395
|
+
}
|
|
396
|
+
let o = r.slice(a);
|
|
397
|
+
if (o.includes("..")) return { kind: "unsupported" };
|
|
398
|
+
let s = `/${[...i, ...o].join("/")}`;
|
|
399
|
+
return v(s) ? {
|
|
400
|
+
kind: "path",
|
|
401
|
+
path: s
|
|
402
|
+
} : { kind: "unsupported" };
|
|
403
|
+
}, L = async (e, t, n) => {
|
|
404
|
+
let r = new Set(), i = y(t);
|
|
405
|
+
for (let t = 0;; t += 1) {
|
|
406
|
+
if (r.has(i)) return { state: "loop" };
|
|
407
|
+
r.add(i);
|
|
408
|
+
let a = await e.getEntry(i, n);
|
|
409
|
+
if (a === null) return { state: "missing" };
|
|
410
|
+
if (a.type === "file") return {
|
|
411
|
+
state: "file",
|
|
412
|
+
targetPath: i
|
|
413
|
+
};
|
|
414
|
+
if (a.type !== "symlink") return { state: "not-file" };
|
|
415
|
+
if (t === 32) return { state: "loop" };
|
|
416
|
+
let o = I(i, await e.readLinkText(i, n));
|
|
417
|
+
if (o.kind !== "path") return { state: o.kind };
|
|
418
|
+
i = o.path;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
//#endregion
|
|
422
|
+
export { b as a, v as c, i, y as l, x as n, N as o, r, u as s, P as t, L as u };
|