@poe-platform/safe-bash 0.1.0 → 0.1.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 +5 -2
- package/package.json +2 -2
- package/dist/safe-bash/commands/git/arguments.d.ts +0 -17
- package/dist/safe-bash/commands/git/arguments.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/arguments.js +0 -150
- package/dist/safe-bash/commands/git/arguments.js.map +0 -1
- package/dist/safe-bash/commands/git/codec.d.ts +0 -8
- package/dist/safe-bash/commands/git/codec.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/codec.js +0 -225
- package/dist/safe-bash/commands/git/codec.js.map +0 -1
- package/dist/safe-bash/commands/git/config.d.ts +0 -8
- package/dist/safe-bash/commands/git/config.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/config.js +0 -100
- package/dist/safe-bash/commands/git/config.js.map +0 -1
- package/dist/safe-bash/commands/git/crc.d.ts +0 -3
- package/dist/safe-bash/commands/git/crc.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/crc.js +0 -14
- package/dist/safe-bash/commands/git/crc.js.map +0 -1
- package/dist/safe-bash/commands/git/delta.d.ts +0 -4
- package/dist/safe-bash/commands/git/delta.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/delta.js +0 -62
- package/dist/safe-bash/commands/git/delta.js.map +0 -1
- package/dist/safe-bash/commands/git/diff.d.ts +0 -9
- package/dist/safe-bash/commands/git/diff.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/diff.js +0 -131
- package/dist/safe-bash/commands/git/diff.js.map +0 -1
- package/dist/safe-bash/commands/git/ignore.d.ts +0 -22
- package/dist/safe-bash/commands/git/ignore.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/ignore.js +0 -153
- package/dist/safe-bash/commands/git/ignore.js.map +0 -1
- package/dist/safe-bash/commands/git/index.d.ts +0 -7
- package/dist/safe-bash/commands/git/index.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/index.js +0 -66
- package/dist/safe-bash/commands/git/index.js.map +0 -1
- package/dist/safe-bash/commands/git/io.d.ts +0 -46
- package/dist/safe-bash/commands/git/io.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/io.js +0 -388
- package/dist/safe-bash/commands/git/io.js.map +0 -1
- package/dist/safe-bash/commands/git/limits.d.ts +0 -39
- package/dist/safe-bash/commands/git/limits.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/limits.js +0 -43
- package/dist/safe-bash/commands/git/limits.js.map +0 -1
- package/dist/safe-bash/commands/git/pack.d.ts +0 -14
- package/dist/safe-bash/commands/git/pack.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/pack.js +0 -273
- package/dist/safe-bash/commands/git/pack.js.map +0 -1
- package/dist/safe-bash/commands/git/queries.d.ts +0 -6
- package/dist/safe-bash/commands/git/queries.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/queries.js +0 -292
- package/dist/safe-bash/commands/git/queries.js.map +0 -1
- package/dist/safe-bash/commands/git/repository.d.ts +0 -49
- package/dist/safe-bash/commands/git/repository.d.ts.map +0 -1
- package/dist/safe-bash/commands/git/repository.js +0 -473
- package/dist/safe-bash/commands/git/repository.js.map +0 -1
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { setImmediate } from "node:timers/promises";
|
|
3
|
-
import { FsError, createOutputOperation, dirname, resolvePath } from "../../contracts/index.js";
|
|
4
|
-
import { ConsumerClosed, GIT_LIMITS, GitFailure, demand } from "./limits.js";
|
|
5
|
-
export class Session {
|
|
6
|
-
context;
|
|
7
|
-
operation;
|
|
8
|
-
boundary;
|
|
9
|
-
owned = new WeakMap();
|
|
10
|
-
counts = new Map();
|
|
11
|
-
sinceYield = 0;
|
|
12
|
-
resident = 0;
|
|
13
|
-
observations = new Map();
|
|
14
|
-
extraObservations = [];
|
|
15
|
-
finalizers = [];
|
|
16
|
-
constructor(context, boundary) {
|
|
17
|
-
this.context = context;
|
|
18
|
-
this.boundary = resolvePath("/", boundary);
|
|
19
|
-
this.operation = createOutputOperation(context, context.stdout);
|
|
20
|
-
}
|
|
21
|
-
check() {
|
|
22
|
-
this.context.signal.throwIfAborted();
|
|
23
|
-
if (this.operation.signal.aborted) {
|
|
24
|
-
if (this.context.stdout.ownedOutput?.consumerClosed.aborted)
|
|
25
|
-
throw new ConsumerClosed("Git output consumer closed");
|
|
26
|
-
throw this.operation.signal.reason;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
charge(key, amount) {
|
|
30
|
-
this.check();
|
|
31
|
-
const total = (this.counts.get(key) ?? 0) + amount;
|
|
32
|
-
demand(Number.isSafeInteger(amount) && amount >= 0 && Number.isSafeInteger(total) && total <= GIT_LIMITS[key], `Git ${key} exceeded`);
|
|
33
|
-
this.counts.set(key, total);
|
|
34
|
-
}
|
|
35
|
-
async step(amount = 1) {
|
|
36
|
-
this.charge("maxSteps", amount);
|
|
37
|
-
this.sinceYield += amount;
|
|
38
|
-
while (this.sinceYield >= 4096) {
|
|
39
|
-
this.sinceYield -= 4096;
|
|
40
|
-
await setImmediate();
|
|
41
|
-
this.check();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
reserve(size) {
|
|
45
|
-
demand(Number.isSafeInteger(size) && size >= 0 && size <= GIT_LIMITS.maxResidentBytes - this.resident, "Git resident reservation exceeded");
|
|
46
|
-
this.resident += size;
|
|
47
|
-
}
|
|
48
|
-
unreserve(size) { this.resident -= size; }
|
|
49
|
-
allocate(size) {
|
|
50
|
-
this.reserve(size);
|
|
51
|
-
try {
|
|
52
|
-
const bytes = Buffer.alloc(size);
|
|
53
|
-
this.owned.set(bytes, size);
|
|
54
|
-
return bytes;
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
this.unreserve(size);
|
|
58
|
-
throw error;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
copy(bytes) {
|
|
62
|
-
const result = this.allocate(bytes.length);
|
|
63
|
-
result.set(bytes);
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
release(bytes) {
|
|
67
|
-
const amount = this.owned.get(bytes);
|
|
68
|
-
if (amount !== undefined) {
|
|
69
|
-
this.unreserve(amount);
|
|
70
|
-
this.owned.delete(bytes);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
text(bytes) {
|
|
74
|
-
this.reserve(bytes.length * 2);
|
|
75
|
-
try {
|
|
76
|
-
return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
|
|
77
|
-
}
|
|
78
|
-
catch {
|
|
79
|
-
throw new GitFailure("invalid UTF-8 in Git metadata/text");
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async hash(bytes, type) {
|
|
83
|
-
const hash = createHash("sha1");
|
|
84
|
-
if (type)
|
|
85
|
-
hash.update(`${type} ${bytes.length}\0`);
|
|
86
|
-
for (let offset = 0; offset < bytes.length; offset += 4096) {
|
|
87
|
-
const part = bytes.subarray(offset, offset + 4096);
|
|
88
|
-
await this.step(part.length);
|
|
89
|
-
hash.update(part);
|
|
90
|
-
}
|
|
91
|
-
return hash.digest("hex");
|
|
92
|
-
}
|
|
93
|
-
path(base, name) {
|
|
94
|
-
demand(!name.includes("\0") && Buffer.byteLength(name) <= GIT_LIMITS.maxPathBytes, "invalid Git path");
|
|
95
|
-
const path = resolvePath(base, name);
|
|
96
|
-
demand(path === this.boundary || path.startsWith(this.boundary === "/" ? "/" : this.boundary + "/"), "Git path outside discovery boundary");
|
|
97
|
-
demand(Buffer.byteLength(path) <= GIT_LIMITS.maxPathBytes, "Git path limit exceeded");
|
|
98
|
-
return path;
|
|
99
|
-
}
|
|
100
|
-
async call(start) {
|
|
101
|
-
this.check();
|
|
102
|
-
try {
|
|
103
|
-
const value = await start();
|
|
104
|
-
this.check();
|
|
105
|
-
return value;
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
this.context.signal.throwIfAborted();
|
|
109
|
-
if (error instanceof ConsumerClosed)
|
|
110
|
-
throw error;
|
|
111
|
-
if (error instanceof FsError && !this.operation.signal.aborted)
|
|
112
|
-
throw new GitFailure(`${error.code}: ${error.path ?? "VFS read"}`);
|
|
113
|
-
throw error;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
async stat(path) {
|
|
117
|
-
await this.step();
|
|
118
|
-
this.path("/", path);
|
|
119
|
-
try {
|
|
120
|
-
const stat = await this.context.fs.lstat(path, { signal: this.operation.signal });
|
|
121
|
-
this.check();
|
|
122
|
-
return stat;
|
|
123
|
-
}
|
|
124
|
-
catch (error) {
|
|
125
|
-
this.context.signal.throwIfAborted();
|
|
126
|
-
if (error instanceof FsError && error.code === "ENOENT" && !this.operation.signal.aborted)
|
|
127
|
-
return undefined;
|
|
128
|
-
if (error instanceof FsError && !this.operation.signal.aborted)
|
|
129
|
-
throw new GitFailure(`${error.code}: ${path}`);
|
|
130
|
-
throw error;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
async safe(path, leafLink = false) {
|
|
134
|
-
const relative = this.path("/", path).slice(this.boundary === "/" ? 1 : this.boundary.length + 1);
|
|
135
|
-
let current = this.boundary;
|
|
136
|
-
const root = await this.stat(current);
|
|
137
|
-
demand(root?.type === "directory", "Git boundary is not a real directory");
|
|
138
|
-
const parts = relative ? relative.split("/") : [];
|
|
139
|
-
demand(parts.length <= GIT_LIMITS.maxDepth, "Git path depth exceeded");
|
|
140
|
-
for (let index = 0; index < parts.length; index++) {
|
|
141
|
-
current = this.path(current, parts[index]);
|
|
142
|
-
const stat = await this.stat(current);
|
|
143
|
-
if (!stat)
|
|
144
|
-
return;
|
|
145
|
-
demand(stat.type !== "symlink" || leafLink && index === parts.length - 1, "Git metadata/path symlink refused");
|
|
146
|
-
if (index < parts.length - 1)
|
|
147
|
-
demand(stat.type === "directory", "Git path obstruction");
|
|
148
|
-
}
|
|
149
|
-
if (!(leafLink && (await this.stat(path))?.type === "symlink")) {
|
|
150
|
-
const actual = await this.call(() => this.context.fs.realpath(path, { signal: this.operation.signal }));
|
|
151
|
-
demand(actual === path, "Git namespace case/normalization/alias mismatch");
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
async list(path) {
|
|
155
|
-
await this.safe(path);
|
|
156
|
-
const entries = await this.call(() => this.context.fs.readdir(path, { signal: this.operation.signal }));
|
|
157
|
-
demand(Array.isArray(entries), "invalid Git directory listing");
|
|
158
|
-
this.charge("maxEntries", entries.length);
|
|
159
|
-
this.reserve(entries.length * 64);
|
|
160
|
-
const seen = new Set();
|
|
161
|
-
for (const entry of entries) {
|
|
162
|
-
await this.step(entry.name.length + 1);
|
|
163
|
-
component(entry.name);
|
|
164
|
-
this.reserve(Buffer.byteLength(entry.name) * 2);
|
|
165
|
-
demand(!seen.has(entry.name), "duplicate Git directory entry");
|
|
166
|
-
seen.add(entry.name);
|
|
167
|
-
}
|
|
168
|
-
return entries;
|
|
169
|
-
}
|
|
170
|
-
async read(path, maximum, optional = false, observe = false) {
|
|
171
|
-
await this.safe(path);
|
|
172
|
-
const before = await this.stat(path);
|
|
173
|
-
if (!before) {
|
|
174
|
-
if (optional)
|
|
175
|
-
return undefined;
|
|
176
|
-
throw new GitFailure(`missing Git file: ${path}`);
|
|
177
|
-
}
|
|
178
|
-
demand(before.type === "file", `Git input is not a regular file: ${path}`);
|
|
179
|
-
demand(Number.isSafeInteger(before.size) && before.size >= 0 && before.size <= maximum, "Git file admission size exceeded");
|
|
180
|
-
const pieces = [];
|
|
181
|
-
let total = 0;
|
|
182
|
-
let iterator;
|
|
183
|
-
let closing;
|
|
184
|
-
const close = () => closing ??= Promise.resolve().then(() => iterator?.return?.());
|
|
185
|
-
let failed = false;
|
|
186
|
-
try {
|
|
187
|
-
if (this.context.fs.readStream) {
|
|
188
|
-
await this.operation.acquire(() => iterator = this.context.fs.readStream(path, { signal: this.operation.signal, chunkSize: GIT_LIMITS.maxChunkBytes })[Symbol.asyncIterator](), async () => { await close(); });
|
|
189
|
-
for (;;) {
|
|
190
|
-
const row = await this.call(() => iterator.next());
|
|
191
|
-
if (row.done)
|
|
192
|
-
break;
|
|
193
|
-
demand(row.value instanceof Uint8Array, "Git source yielded nonbytes");
|
|
194
|
-
this.charge("maxChunks", 1);
|
|
195
|
-
demand(row.value.length <= GIT_LIMITS.maxChunkBytes && row.value.length <= maximum - total, "Git read chunk/size exceeded");
|
|
196
|
-
this.charge("maxReadBytes", row.value.length);
|
|
197
|
-
await this.step(Math.max(1, row.value.length));
|
|
198
|
-
pieces.push(this.copy(row.value));
|
|
199
|
-
total += row.value.length;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
const bytes = await this.call(() => this.context.fs.readFile(path, { signal: this.operation.signal, maxBytes: maximum }));
|
|
204
|
-
demand(bytes instanceof Uint8Array && bytes.length <= maximum, "Git bounded readFile exceeded");
|
|
205
|
-
this.charge("maxReadBytes", bytes.length);
|
|
206
|
-
await this.step(bytes.length);
|
|
207
|
-
pieces.push(this.copy(bytes));
|
|
208
|
-
total = bytes.length;
|
|
209
|
-
}
|
|
210
|
-
const after = await this.stat(path);
|
|
211
|
-
demand(after && snapshot(before) === snapshot(after) && total === before.size, "Git input changed during read");
|
|
212
|
-
const result = this.allocate(total);
|
|
213
|
-
let position = 0;
|
|
214
|
-
for (const piece of pieces) {
|
|
215
|
-
result.set(piece, position);
|
|
216
|
-
position += piece.length;
|
|
217
|
-
}
|
|
218
|
-
if (observe)
|
|
219
|
-
this.observations.set(path, await this.hash(result));
|
|
220
|
-
return result;
|
|
221
|
-
}
|
|
222
|
-
catch (error) {
|
|
223
|
-
failed = true;
|
|
224
|
-
throw error;
|
|
225
|
-
}
|
|
226
|
-
finally {
|
|
227
|
-
for (const piece of pieces)
|
|
228
|
-
this.release(piece);
|
|
229
|
-
if (failed)
|
|
230
|
-
await close().catch(() => { });
|
|
231
|
-
else
|
|
232
|
-
await close();
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
async unchanged() {
|
|
236
|
-
for (const observation of this.extraObservations)
|
|
237
|
-
await observation();
|
|
238
|
-
for (const [path, hash] of this.observations) {
|
|
239
|
-
const bytes = await this.read(path, GIT_LIMITS.maxIndexBytes);
|
|
240
|
-
try {
|
|
241
|
-
demand(await this.hash(bytes) === hash, "Git metadata changed before output");
|
|
242
|
-
}
|
|
243
|
-
finally {
|
|
244
|
-
this.release(bytes);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
observe(check) { this.reserve(64); this.extraObservations.push(check); }
|
|
249
|
-
onFinish(close) { this.reserve(64); this.finalizers.push(close); }
|
|
250
|
-
finish() { for (const close of this.finalizers.splice(0))
|
|
251
|
-
close(); }
|
|
252
|
-
async visitFile(path, maximum, consume) {
|
|
253
|
-
await this.safe(path);
|
|
254
|
-
const before = await this.stat(path);
|
|
255
|
-
demand(before?.type === "file" && Number.isSafeInteger(before.size) && before.size >= 0 && before.size <= maximum, "Git file admission size exceeded");
|
|
256
|
-
let total = 0;
|
|
257
|
-
let iterator;
|
|
258
|
-
let closing;
|
|
259
|
-
const close = () => closing ??= Promise.resolve().then(() => iterator?.return?.());
|
|
260
|
-
let failed = false;
|
|
261
|
-
try {
|
|
262
|
-
if (this.context.fs.readStream) {
|
|
263
|
-
await this.operation.acquire(() => iterator = this.context.fs.readStream(path, { signal: this.operation.signal, chunkSize: GIT_LIMITS.maxChunkBytes })[Symbol.asyncIterator](), async () => { await close(); });
|
|
264
|
-
for (;;) {
|
|
265
|
-
const row = await this.call(() => iterator.next());
|
|
266
|
-
if (row.done)
|
|
267
|
-
break;
|
|
268
|
-
this.charge("maxChunks", 1);
|
|
269
|
-
demand(row.value instanceof Uint8Array && row.value.length <= GIT_LIMITS.maxChunkBytes && row.value.length <= before.size - total, "Git exact read chunk/size exceeded");
|
|
270
|
-
this.charge("maxReadBytes", row.value.length);
|
|
271
|
-
await this.step();
|
|
272
|
-
await consume(row.value, total);
|
|
273
|
-
total += row.value.length;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
const bytes = await this.call(() => this.context.fs.readFile(path, { signal: this.operation.signal, maxBytes: maximum }));
|
|
278
|
-
demand(bytes instanceof Uint8Array && bytes.length === before.size, "Git exact readFile size mismatch");
|
|
279
|
-
this.charge("maxReadBytes", bytes.length);
|
|
280
|
-
await consume(bytes, 0);
|
|
281
|
-
total = bytes.length;
|
|
282
|
-
}
|
|
283
|
-
const after = await this.stat(path);
|
|
284
|
-
demand(after && snapshot(before) === snapshot(after) && total === before.size, "Git input changed during exact read");
|
|
285
|
-
}
|
|
286
|
-
catch (error) {
|
|
287
|
-
failed = true;
|
|
288
|
-
throw error;
|
|
289
|
-
}
|
|
290
|
-
finally {
|
|
291
|
-
if (failed)
|
|
292
|
-
await close().catch(() => { });
|
|
293
|
-
else
|
|
294
|
-
await close();
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
async copyInto(target, source, offset = 0) {
|
|
298
|
-
demand(Number.isSafeInteger(offset) && offset >= 0 && source.length <= target.length - offset, "Git copy extent exceeded");
|
|
299
|
-
for (let position = 0; position < source.length; position += 4096) {
|
|
300
|
-
const part = source.subarray(position, position + 4096);
|
|
301
|
-
await this.step(part.length);
|
|
302
|
-
target.set(part, offset + position);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
async readExact(path, maximum) {
|
|
306
|
-
await this.safe(path);
|
|
307
|
-
const stat = await this.stat(path);
|
|
308
|
-
demand(stat?.type === "file" && Number.isSafeInteger(stat.size) && stat.size >= 0 && stat.size <= maximum, "Git exact file admission exceeded");
|
|
309
|
-
const body = this.allocate(stat.size);
|
|
310
|
-
let success = false;
|
|
311
|
-
try {
|
|
312
|
-
await this.visitFile(path, maximum, (bytes, offset) => this.copyInto(body, bytes, offset));
|
|
313
|
-
const after = await this.stat(path);
|
|
314
|
-
demand(after && snapshot(stat) === snapshot(after), "Git exact file changed before fill");
|
|
315
|
-
success = true;
|
|
316
|
-
return body;
|
|
317
|
-
}
|
|
318
|
-
finally {
|
|
319
|
-
if (!success)
|
|
320
|
-
this.release(body);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
async observeExact(path, maximum, body) {
|
|
324
|
-
const expected = await this.hash(body);
|
|
325
|
-
this.observe(async () => {
|
|
326
|
-
const hash = createHash("sha1");
|
|
327
|
-
await this.visitFile(path, maximum, async (bytes) => {
|
|
328
|
-
for (let offset = 0; offset < bytes.length; offset += 4096) {
|
|
329
|
-
const part = bytes.subarray(offset, offset + 4096);
|
|
330
|
-
await this.step(part.length);
|
|
331
|
-
hash.update(part);
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
demand(hash.digest("hex") === expected, "Git packed input changed before output");
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
async output(bytes) {
|
|
338
|
-
const length = typeof bytes === "string" ? Buffer.byteLength(bytes) : bytes.length;
|
|
339
|
-
this.charge("maxOutputBytes", length);
|
|
340
|
-
if (typeof bytes === "string")
|
|
341
|
-
this.reserve(length);
|
|
342
|
-
const content = typeof bytes === "string" ? Buffer.from(bytes) : bytes;
|
|
343
|
-
try {
|
|
344
|
-
for (let offset = 0; offset < content.length; offset += GIT_LIMITS.maxChunkBytes) {
|
|
345
|
-
this.check();
|
|
346
|
-
await this.operation.output.write(content.subarray(offset, offset + GIT_LIMITS.maxChunkBytes));
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
finally {
|
|
350
|
-
if (typeof bytes === "string")
|
|
351
|
-
this.unreserve(length);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
async sorted(paths) {
|
|
355
|
-
const values = Array.from(paths);
|
|
356
|
-
this.reserve(values.length * 16);
|
|
357
|
-
for (let width = 1; width < values.length; width *= 2) {
|
|
358
|
-
for (let start = 0; start < values.length; start += width * 2) {
|
|
359
|
-
const middle = Math.min(start + width, values.length), end = Math.min(start + width * 2, values.length);
|
|
360
|
-
const merged = [];
|
|
361
|
-
let left = start, right = middle;
|
|
362
|
-
while (left < middle || right < end) {
|
|
363
|
-
if (left < middle && right < end)
|
|
364
|
-
await this.step(values[left].length + values[right].length + 1);
|
|
365
|
-
merged.push(right >= end || left < middle && compare(values[left], values[right]) <= 0 ? values[left++] : values[right++]);
|
|
366
|
-
}
|
|
367
|
-
for (let index = 0; index < merged.length; index++)
|
|
368
|
-
values[start + index] = merged[index];
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
return values;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
function snapshot(stat) { return `${stat.type}:${stat.size}:${stat.mode}:${stat.mtimeMs}:${stat.ctimeMs}`; }
|
|
375
|
-
export function component(name) {
|
|
376
|
-
demand(typeof name === "string" && name.length > 0 && name !== "." && name !== ".." && !name.includes("/") && !name.includes("\0") && Buffer.byteLength(name) <= GIT_LIMITS.maxPathBytes, "invalid Git path component");
|
|
377
|
-
demand(Buffer.from(name).toString("utf8") === name, "nonroundtrippable Git path");
|
|
378
|
-
}
|
|
379
|
-
export function objectPath(name) {
|
|
380
|
-
demand(name.length > 0 && !name.startsWith("/") && !name.endsWith("/"), "invalid repository path");
|
|
381
|
-
for (const part of name.split("/")) {
|
|
382
|
-
component(part);
|
|
383
|
-
demand(part.toLowerCase() !== ".git", "reserved Git path");
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
export function compare(left, right) { return Buffer.compare(Buffer.from(left), Buffer.from(right)); }
|
|
387
|
-
export function parent(path) { return dirname(path); }
|
|
388
|
-
//# sourceMappingURL=io.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../src/commands/git/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,WAAW,EAAiF,MAAM,0BAA0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EAAE,yBAAyB,CAAC,CAAC;IACnG,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAAC,CAAC;AACtH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,KAAa,IAAY,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9H,MAAM,UAAU,MAAM,CAAC,IAAY,IAAY,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export interface GitCommandsOptions {
|
|
2
|
-
readonly replace?: boolean;
|
|
3
|
-
readonly discoveryBoundary?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const GIT_LIMITS: Readonly<{
|
|
6
|
-
maxArgumentBytes: 65536;
|
|
7
|
-
maxPathBytes: 4096;
|
|
8
|
-
maxReadBytes: 67108864;
|
|
9
|
-
maxInflatedBytes: 134217728;
|
|
10
|
-
maxObjectBytes: 8388608;
|
|
11
|
-
maxWorkingFileBytes: 8388608;
|
|
12
|
-
maxIndexBytes: 16777216;
|
|
13
|
-
maxMetadataBytes: 1048576;
|
|
14
|
-
maxResidentBytes: 67108864;
|
|
15
|
-
maxEntries: 20000;
|
|
16
|
-
maxObjects: 32768;
|
|
17
|
-
maxCommits: 2000;
|
|
18
|
-
maxDepth: 128;
|
|
19
|
-
maxRefDepth: 16;
|
|
20
|
-
maxDeltaDepth: 32;
|
|
21
|
-
maxSteps: 32000000;
|
|
22
|
-
maxDiffCells: 1000000;
|
|
23
|
-
maxLines: 200000;
|
|
24
|
-
maxOutputBytes: 16777216;
|
|
25
|
-
maxDiagnosticBytes: 65536;
|
|
26
|
-
maxChunkBytes: 65536;
|
|
27
|
-
maxChunks: 32768;
|
|
28
|
-
maxPacks: 8;
|
|
29
|
-
maxPackBytes: 33554432;
|
|
30
|
-
}>;
|
|
31
|
-
export declare class GitFailure extends Error {
|
|
32
|
-
readonly status: number;
|
|
33
|
-
constructor(message: string, status?: number);
|
|
34
|
-
}
|
|
35
|
-
export declare class ConsumerClosed extends Error {
|
|
36
|
-
}
|
|
37
|
-
export declare function demand(condition: unknown, message: string): asserts condition;
|
|
38
|
-
export declare function settings(options: GitCommandsOptions): Required<GitCommandsOptions>;
|
|
39
|
-
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/commands/git/limits.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;EAQrB,CAAC;AAEH,qBAAa,UAAW,SAAQ,KAAK;IACN,QAAQ,CAAC,MAAM;gBAAhC,OAAO,EAAE,MAAM,EAAW,MAAM,SAAM;CACnD;AAED,qBAAa,cAAe,SAAQ,KAAK;CAAG;AAE5C,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAE7E;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAalF"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export const GIT_LIMITS = Object.freeze({
|
|
2
|
-
maxArgumentBytes: 65536, maxPathBytes: 4096, maxReadBytes: 67108864,
|
|
3
|
-
maxInflatedBytes: 134217728, maxObjectBytes: 8388608, maxWorkingFileBytes: 8388608,
|
|
4
|
-
maxIndexBytes: 16777216, maxMetadataBytes: 1048576, maxResidentBytes: 67108864,
|
|
5
|
-
maxEntries: 20000, maxObjects: 32768, maxCommits: 2000, maxDepth: 128,
|
|
6
|
-
maxRefDepth: 16, maxDeltaDepth: 32, maxSteps: 32000000, maxDiffCells: 1000000,
|
|
7
|
-
maxLines: 200000, maxOutputBytes: 16777216, maxDiagnosticBytes: 65536,
|
|
8
|
-
maxChunkBytes: 65536, maxChunks: 32768, maxPacks: 8, maxPackBytes: 33554432,
|
|
9
|
-
});
|
|
10
|
-
export class GitFailure extends Error {
|
|
11
|
-
status;
|
|
12
|
-
constructor(message, status = 128) {
|
|
13
|
-
super(message);
|
|
14
|
-
this.status = status;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export class ConsumerClosed extends Error {
|
|
18
|
-
}
|
|
19
|
-
export function demand(condition, message) {
|
|
20
|
-
if (!condition)
|
|
21
|
-
throw new GitFailure(message);
|
|
22
|
-
}
|
|
23
|
-
export function settings(options) {
|
|
24
|
-
if (!options || typeof options !== "object")
|
|
25
|
-
throw new TypeError("Invalid Git options");
|
|
26
|
-
let replace = false;
|
|
27
|
-
let discoveryBoundary = "/";
|
|
28
|
-
for (const key of Reflect.ownKeys(options)) {
|
|
29
|
-
const descriptor = Object.getOwnPropertyDescriptor(options, key);
|
|
30
|
-
if (!("value" in descriptor))
|
|
31
|
-
throw new TypeError("Git options require own data properties");
|
|
32
|
-
if (key === "replace" && typeof descriptor.value === "boolean")
|
|
33
|
-
replace = descriptor.value;
|
|
34
|
-
else if (key === "discoveryBoundary" && typeof descriptor.value === "string")
|
|
35
|
-
discoveryBoundary = descriptor.value;
|
|
36
|
-
else
|
|
37
|
-
throw new TypeError(`Invalid Git option: ${String(key)}`);
|
|
38
|
-
}
|
|
39
|
-
if (!discoveryBoundary.startsWith("/") || discoveryBoundary.includes("\0") || Buffer.byteLength(discoveryBoundary) > GIT_LIMITS.maxPathBytes)
|
|
40
|
-
throw new TypeError("Invalid Git discoveryBoundary");
|
|
41
|
-
return { replace, discoveryBoundary };
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=limits.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../src/commands/git/limits.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,gBAAgB,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ;IACnE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,mBAAmB,EAAE,OAAO;IAClF,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ;IAC9E,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG;IACrE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO;IAC7E,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK;IACrE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ;CAC5E,CAAC,CAAC;AAEH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACG;IAAtC,YAAY,OAAe,EAAW,SAAS,GAAG;QAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAA/B,WAAM,GAAN,MAAM,CAAM;IAAoB,CAAC;CACxE;AAED,MAAM,OAAO,cAAe,SAAQ,KAAK;CAAG;AAE5C,MAAM,UAAU,MAAM,CAAC,SAAkB,EAAE,OAAe;IACxD,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,UAAU,CAAC,OA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ogue {
|
|
4
|
-
private readonly session;
|
|
5
|
-
readonly objects: Map<string, GitObject>;
|
|
6
|
-
private readonly owners;
|
|
7
|
-
constructor(session: Session);
|
|
8
|
-
close(): void;
|
|
9
|
-
private retain;
|
|
10
|
-
admit(gitdir: string): Promise<void>;
|
|
11
|
-
private index;
|
|
12
|
-
private readPack;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=pack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../src/commands/git/pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAGhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAmBvC,qBAAa,aAAa;IAIZ,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,QAAQ,CAAC,OAAO,yBAAgC;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;gBAEf,OAAO,EAAE,OAAO;IAE7C,KAAK,IAAI,IAAI;YAMC,MAAM;IAkBd,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAoD5B,KAAK;YAiDL,QAAQ;CAiGvB"}
|