poe-code 14.0.21 → 14.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safe-bash/dist/browser.d.ts +5 -0
- package/packages/safe-bash/dist/browser.d.ts.map +1 -1
- package/packages/safe-bash/dist/browser.js +981 -134
- package/packages/safe-bash/dist/browser.js.map +4 -4
- package/packages/safe-bash/dist/commands/apply-patch/shared.js +2 -2
- package/packages/safe-bash/dist/commands/apply-patch/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/archive/internal.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/archive/internal.js +3 -2
- package/packages/safe-bash/dist/commands/archive/internal.js.map +1 -1
- package/packages/safe-bash/dist/commands/bytes/checksums/index.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/bytes/checksums/index.js +3 -2
- package/packages/safe-bash/dist/commands/bytes/checksums/index.js.map +1 -1
- package/packages/safe-bash/dist/commands/bytes/compression/gunzip.js +2 -2
- package/packages/safe-bash/dist/commands/bytes/compression/gunzip.js.map +1 -1
- package/packages/safe-bash/dist/commands/bytes/compression/stream.js +2 -2
- package/packages/safe-bash/dist/commands/bytes/compression/stream.js.map +1 -1
- package/packages/safe-bash/dist/commands/bytes/encoding/shared.js +3 -3
- package/packages/safe-bash/dist/commands/bytes/encoding/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/column/internal.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/column/internal.js +2 -1
- package/packages/safe-bash/dist/commands/column/internal.js.map +1 -1
- package/packages/safe-bash/dist/commands/diff-patch/shared.js +2 -2
- package/packages/safe-bash/dist/commands/diff-patch/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/du/budget.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/du/budget.js +3 -2
- package/packages/safe-bash/dist/commands/du/budget.js.map +1 -1
- package/packages/safe-bash/dist/commands/env-split.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/env-split.js +2 -1
- package/packages/safe-bash/dist/commands/env-split.js.map +1 -1
- package/packages/safe-bash/dist/commands/expr/internal.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/expr/internal.js +2 -1
- package/packages/safe-bash/dist/commands/expr/internal.js.map +1 -1
- package/packages/safe-bash/dist/commands/file/shared.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/file/shared.js +3 -2
- package/packages/safe-bash/dist/commands/file/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/find.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/find.js +12 -31
- package/packages/safe-bash/dist/commands/find.js.map +1 -1
- package/packages/safe-bash/dist/commands/html-to-markdown/budget.js +2 -2
- package/packages/safe-bash/dist/commands/html-to-markdown/budget.js.map +1 -1
- package/packages/safe-bash/dist/commands/metadata/internal.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/metadata/internal.js +2 -1
- package/packages/safe-bash/dist/commands/metadata/internal.js.map +1 -1
- package/packages/safe-bash/dist/commands/move.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/move.js +2 -1
- package/packages/safe-bash/dist/commands/move.js.map +1 -1
- package/packages/safe-bash/dist/commands/network/authorizer.d.ts +7 -0
- package/packages/safe-bash/dist/commands/network/authorizer.d.ts.map +1 -0
- package/packages/safe-bash/dist/commands/network/authorizer.js +48 -0
- package/packages/safe-bash/dist/commands/network/authorizer.js.map +1 -0
- package/packages/safe-bash/dist/commands/network/body.js +2 -2
- package/packages/safe-bash/dist/commands/network/body.js.map +1 -1
- package/packages/safe-bash/dist/commands/network/curl.js +2 -2
- package/packages/safe-bash/dist/commands/network/curl.js.map +1 -1
- package/packages/safe-bash/dist/commands/network/fetch-transport.d.ts +6 -0
- package/packages/safe-bash/dist/commands/network/fetch-transport.d.ts.map +1 -0
- package/packages/safe-bash/dist/commands/network/fetch-transport.js +82 -0
- package/packages/safe-bash/dist/commands/network/fetch-transport.js.map +1 -0
- package/packages/safe-bash/dist/commands/network/index.d.ts +2 -0
- package/packages/safe-bash/dist/commands/network/index.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/network/index.js +2 -0
- package/packages/safe-bash/dist/commands/network/index.js.map +1 -1
- package/packages/safe-bash/dist/commands/network/types.d.ts +1 -0
- package/packages/safe-bash/dist/commands/network/types.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/network/types.js +10 -0
- package/packages/safe-bash/dist/commands/network/types.js.map +1 -1
- package/packages/safe-bash/dist/commands/regex-execution/ere/limits.js +2 -2
- package/packages/safe-bash/dist/commands/regex-execution/ere/limits.js.map +1 -1
- package/packages/safe-bash/dist/commands/safejs/io.js +2 -2
- package/packages/safe-bash/dist/commands/safejs/io.js.map +1 -1
- package/packages/safe-bash/dist/commands/search/shared.js +2 -2
- package/packages/safe-bash/dist/commands/search/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/split/io.js +2 -2
- package/packages/safe-bash/dist/commands/split/io.js.map +1 -1
- package/packages/safe-bash/dist/commands/stream-format/shared.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/stream-format/shared.js +2 -1
- package/packages/safe-bash/dist/commands/stream-format/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/stream-inspection/shared.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/stream-inspection/shared.js +2 -1
- package/packages/safe-bash/dist/commands/stream-inspection/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/streams.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/streams.js +114 -13
- package/packages/safe-bash/dist/commands/streams.js.map +1 -1
- package/packages/safe-bash/dist/commands/structured/limits.js +2 -2
- package/packages/safe-bash/dist/commands/structured/limits.js.map +1 -1
- package/packages/safe-bash/dist/commands/table-text/internal.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/table-text/internal.js +2 -1
- package/packages/safe-bash/dist/commands/table-text/internal.js.map +1 -1
- package/packages/safe-bash/dist/commands/text-programs/shared.js +2 -2
- package/packages/safe-bash/dist/commands/text-programs/shared.js.map +1 -1
- package/packages/safe-bash/dist/commands/tree/io.js +2 -2
- package/packages/safe-bash/dist/commands/tree/io.js.map +1 -1
- package/packages/safe-bash/dist/contracts/yield.d.ts +13 -0
- package/packages/safe-bash/dist/contracts/yield.d.ts.map +1 -0
- package/packages/safe-bash/dist/contracts/yield.js +41 -0
- package/packages/safe-bash/dist/contracts/yield.js.map +1 -0
- package/packages/safe-bash/dist/shell/arithmetic.js +1 -1
- package/packages/safe-bash/dist/shell/arithmetic.js.map +1 -1
- package/packages/safe-bash/dist/shell/arrays/ledger.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/arrays/ledger.js +2 -9
- package/packages/safe-bash/dist/shell/arrays/ledger.js.map +1 -1
- package/packages/safe-bash/dist/shell/conditional.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/conditional.js +2 -1
- package/packages/safe-bash/dist/shell/conditional.js.map +1 -1
- package/packages/safe-bash/dist/shell/env-warning.d.ts +2 -0
- package/packages/safe-bash/dist/shell/env-warning.d.ts.map +1 -0
- package/packages/safe-bash/dist/shell/env-warning.js +12 -0
- package/packages/safe-bash/dist/shell/env-warning.js.map +1 -0
- package/packages/safe-bash/dist/shell/index.d.ts +1 -0
- package/packages/safe-bash/dist/shell/index.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/index.js +1 -0
- package/packages/safe-bash/dist/shell/index.js.map +1 -1
- package/packages/safe-bash/dist/shell/input.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/input.js +4 -3
- package/packages/safe-bash/dist/shell/input.js.map +1 -1
- package/packages/safe-bash/dist/shell/parser.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/parser.js +15 -1
- package/packages/safe-bash/dist/shell/parser.js.map +1 -1
- package/packages/safe-bash/dist/shell/pattern.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/pattern.js +3 -2
- package/packages/safe-bash/dist/shell/pattern.js.map +1 -1
- package/packages/safe-bash/dist/shell/runtime.d.ts +3 -2
- package/packages/safe-bash/dist/shell/runtime.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/runtime.js +57 -55
- package/packages/safe-bash/dist/shell/runtime.js.map +1 -1
- package/packages/safe-bash/dist/shell/shell.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/shell.js +4 -1
- package/packages/safe-bash/dist/shell/shell.js.map +1 -1
- package/packages/safe-bash/dist/shell/types.d.ts +2 -0
- package/packages/safe-bash/dist/shell/types.d.ts.map +1 -1
- package/packages/safe-bash/dist/shell/types.js.map +1 -1
- package/packages/safe-bash/dist/shell/worker-limits.d.ts +3 -0
- package/packages/safe-bash/dist/shell/worker-limits.d.ts.map +1 -0
- package/packages/safe-bash/dist/shell/worker-limits.js +14 -0
- package/packages/safe-bash/dist/shell/worker-limits.js.map +1 -0
- package/packages/safe-fs/dist/contracts/filesystem.d.ts +1 -0
- package/packages/safe-fs/dist/core.d.ts +1 -0
- package/packages/safe-fs/dist/fs/quota/index.d.ts +9 -0
- package/packages/safe-fs/dist/index.d.ts +1 -0
- package/packages/safe-js/dist/browser/chunks/{chunk-QGN6DKT5.js → chunk-EMJUKJ6C.js} +111 -1
- package/packages/safe-js/dist/browser/chunks/chunk-EMJUKJ6C.js.map +7 -0
- package/packages/safe-js/dist/browser/safe-fs-core.js +7 -3
- package/packages/safe-js/dist/browser/safe-fs.js +7 -3
- package/packages/safe-js/dist/chunks/{chunk-7M2SJPSZ.js → chunk-AFVEPD3R.js} +2 -2
- package/packages/safe-js/dist/chunks/{chunk-5XRQ3GNN.js → chunk-WGUFH7HF.js} +3 -3
- package/packages/safe-js/dist/chunks/{chunk-2QRYPKQQ.js → chunk-WMZQYBLB.js} +111 -1
- package/packages/safe-js/dist/chunks/chunk-WMZQYBLB.js.map +7 -0
- package/packages/safe-js/dist/cli.js +3 -3
- package/packages/safe-js/dist/index.js +3 -3
- package/packages/safe-js/dist/safe-fs-core.js +7 -3
- package/packages/safe-js/dist/safe-fs-core.js.map +1 -1
- package/packages/safe-js/dist/safe-fs-node.js +8 -4
- package/packages/safe-js/dist/safe-fs.js +8 -4
- package/packages/safe-js/dist/browser/chunks/chunk-QGN6DKT5.js.map +0 -7
- package/packages/safe-js/dist/chunks/chunk-2QRYPKQQ.js.map +0 -7
- /package/packages/safe-js/dist/chunks/{chunk-7M2SJPSZ.js.map → chunk-AFVEPD3R.js.map} +0 -0
- /package/packages/safe-js/dist/chunks/{chunk-5XRQ3GNN.js.map → chunk-WGUFH7HF.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ACCESS_MODES,
|
|
3
|
+
FileSystemQuotaError,
|
|
3
4
|
FsError,
|
|
4
5
|
MemoryFileSystem,
|
|
5
6
|
MountFileSystem,
|
|
@@ -29,10 +30,12 @@ import {
|
|
|
29
30
|
resolvePath,
|
|
30
31
|
toByteSource,
|
|
31
32
|
toFsError,
|
|
32
|
-
validatePath
|
|
33
|
-
|
|
33
|
+
validatePath,
|
|
34
|
+
withFileSystemQuota
|
|
35
|
+
} from "./chunks/chunk-EMJUKJ6C.js";
|
|
34
36
|
export {
|
|
35
37
|
ACCESS_MODES,
|
|
38
|
+
FileSystemQuotaError,
|
|
36
39
|
FsError,
|
|
37
40
|
MemoryFileSystem,
|
|
38
41
|
MountFileSystem,
|
|
@@ -62,6 +65,7 @@ export {
|
|
|
62
65
|
resolvePath,
|
|
63
66
|
toByteSource,
|
|
64
67
|
toFsError,
|
|
65
|
-
validatePath
|
|
68
|
+
validatePath,
|
|
69
|
+
withFileSystemQuota
|
|
66
70
|
};
|
|
67
71
|
//# sourceMappingURL=safe-fs-core.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ACCESS_MODES,
|
|
3
|
+
FileSystemQuotaError,
|
|
3
4
|
FsError,
|
|
4
5
|
MemoryFileSystem,
|
|
5
6
|
MountFileSystem,
|
|
@@ -29,10 +30,12 @@ import {
|
|
|
29
30
|
resolvePath,
|
|
30
31
|
toByteSource,
|
|
31
32
|
toFsError,
|
|
32
|
-
validatePath
|
|
33
|
-
|
|
33
|
+
validatePath,
|
|
34
|
+
withFileSystemQuota
|
|
35
|
+
} from "./chunks/chunk-EMJUKJ6C.js";
|
|
34
36
|
export {
|
|
35
37
|
ACCESS_MODES,
|
|
38
|
+
FileSystemQuotaError,
|
|
36
39
|
FsError,
|
|
37
40
|
MemoryFileSystem,
|
|
38
41
|
MountFileSystem,
|
|
@@ -62,6 +65,7 @@ export {
|
|
|
62
65
|
resolvePath,
|
|
63
66
|
toByteSource,
|
|
64
67
|
toFsError,
|
|
65
|
-
validatePath
|
|
68
|
+
validatePath,
|
|
69
|
+
withFileSystemQuota
|
|
66
70
|
};
|
|
67
71
|
//# sourceMappingURL=safe-fs.js.map
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
toByteSource,
|
|
17
17
|
toFsError,
|
|
18
18
|
validatePath
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WMZQYBLB.js";
|
|
20
20
|
|
|
21
21
|
// packages/safe-fs/src/contracts/path.ts
|
|
22
22
|
import { posix } from "node:path";
|
|
@@ -2610,4 +2610,4 @@ export {
|
|
|
2610
2610
|
createFileSystem,
|
|
2611
2611
|
createNodeFileSystemAdapterRegistry
|
|
2612
2612
|
};
|
|
2613
|
-
//# sourceMappingURL=chunk-
|
|
2613
|
+
//# sourceMappingURL=chunk-AFVEPD3R.js.map
|
|
@@ -34,11 +34,11 @@ import {
|
|
|
34
34
|
createNodeFsBridge,
|
|
35
35
|
readConfigRecord,
|
|
36
36
|
validateFileSystemConfig
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-AFVEPD3R.js";
|
|
38
38
|
import {
|
|
39
39
|
FsError,
|
|
40
40
|
isPathWithin
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WMZQYBLB.js";
|
|
42
42
|
|
|
43
43
|
// packages/safe-js/src/migrate.ts
|
|
44
44
|
import { createHash } from "node:crypto";
|
|
@@ -8245,4 +8245,4 @@ export {
|
|
|
8245
8245
|
parseMcpConfig,
|
|
8246
8246
|
makeMcpModule
|
|
8247
8247
|
};
|
|
8248
|
-
//# sourceMappingURL=chunk-
|
|
8248
|
+
//# sourceMappingURL=chunk-WGUFH7HF.js.map
|
|
@@ -2329,6 +2329,7 @@ var ReadOnlyFileSystem = class {
|
|
|
2329
2329
|
const streamingRead = typeof filesystem.readStream === "function" ? filesystem.capabilities.streamingRead : false;
|
|
2330
2330
|
this.#capabilities = Object.freeze({
|
|
2331
2331
|
readOnly: true,
|
|
2332
|
+
append: false,
|
|
2332
2333
|
symlinks: filesystem.capabilities.symlinks === true && typeof filesystem.readlink === "function",
|
|
2333
2334
|
hardlinks: false,
|
|
2334
2335
|
permissions: false,
|
|
@@ -2507,11 +2508,13 @@ var MountFileSystem = class _MountFileSystem {
|
|
|
2507
2508
|
const streaming = (capability, method) => all(capability, [method]) ? true : mounts.some(({ backend }) => backend.capabilities[capability] !== false && typeof backend[method] === "function") ? void 0 : false;
|
|
2508
2509
|
const streamingRead = streaming("streamingRead", "readStream");
|
|
2509
2510
|
const streamingWrite = streaming("streamingWrite", "writeStream");
|
|
2511
|
+
const append = all("append") ? true : mounts.every(({ backend }) => backend.capabilities.append === false) ? false : void 0;
|
|
2510
2512
|
this.capabilities = Object.freeze({
|
|
2511
2513
|
get snapshotRmdir() {
|
|
2512
2514
|
return mounts.some(({ backend }) => backend.capabilities.snapshotRmdir === true);
|
|
2513
2515
|
},
|
|
2514
2516
|
readOnly: all("readOnly"),
|
|
2517
|
+
...append === void 0 ? {} : { append },
|
|
2515
2518
|
symlinks: all("symlinks", ["readlink", "symlink"]),
|
|
2516
2519
|
hardlinks: all("hardlinks", ["link"]),
|
|
2517
2520
|
permissions: all("permissions", ["chmod"]),
|
|
@@ -2996,8 +2999,10 @@ var OverlayFileSystem = class {
|
|
|
2996
2999
|
const readable = [this.#upper, this.#lower].map((backend) => typeof backend.readStream === "function" ? backend.capabilities.streamingRead : false);
|
|
2997
3000
|
const streamingRead = readable.every((capability) => capability === true) ? true : readable.every((capability) => capability === false) ? false : void 0;
|
|
2998
3001
|
const streamingWrite = writable && this.#upper.capabilities.streamingWrite === true && this.#upper.capabilities.streamingRead === true && typeof this.#upper.writeStream === "function" && typeof this.#upper.readStream === "function" ? readable.every((capability) => capability === true) ? true : void 0 : false;
|
|
3002
|
+
const append = !writable || this.#upper.capabilities.append === false ? false : this.#upper.capabilities.append === true ? true : void 0;
|
|
2999
3003
|
this.capabilities = Object.freeze({
|
|
3000
3004
|
readOnly: !writable,
|
|
3005
|
+
...append === void 0 ? {} : { append },
|
|
3001
3006
|
atomicRename: false,
|
|
3002
3007
|
hardlinks: false,
|
|
3003
3008
|
symlinks: writable && this.#upper.capabilities.symlinks === true && typeof this.#upper.symlink === "function" && typeof this.#upper.readlink === "function" && (this.#lower.capabilities.symlinks !== true || typeof this.#lower.readlink === "function"),
|
|
@@ -3688,6 +3693,109 @@ function createOverlayFileSystem(options) {
|
|
|
3688
3693
|
return new OverlayFileSystem(options);
|
|
3689
3694
|
}
|
|
3690
3695
|
|
|
3696
|
+
// packages/safe-fs/src/fs/quota/index.ts
|
|
3697
|
+
var FileSystemQuotaError = class extends Error {
|
|
3698
|
+
constructor(maxBytes) {
|
|
3699
|
+
super(`Filesystem quota exceeded (${maxBytes} bytes)`);
|
|
3700
|
+
this.maxBytes = maxBytes;
|
|
3701
|
+
this.name = "FileSystemQuotaError";
|
|
3702
|
+
}
|
|
3703
|
+
maxBytes;
|
|
3704
|
+
};
|
|
3705
|
+
async function usedBytes(fs, options) {
|
|
3706
|
+
let total = 0;
|
|
3707
|
+
const pending = ["/"];
|
|
3708
|
+
while (pending.length) {
|
|
3709
|
+
const directory = pending.pop();
|
|
3710
|
+
for (const entry of await fs.readdir(directory, options)) {
|
|
3711
|
+
const path = `${directory === "/" ? "" : directory}/${entry.name}`;
|
|
3712
|
+
if (entry.type === "directory") pending.push(path);
|
|
3713
|
+
else total += (await fs.lstat(path, options)).size;
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
return total;
|
|
3717
|
+
}
|
|
3718
|
+
async function existingBytes(fs, path, options) {
|
|
3719
|
+
try {
|
|
3720
|
+
const stat = await fs.lstat(path, options);
|
|
3721
|
+
return stat.type === "directory" ? 0 : stat.size;
|
|
3722
|
+
} catch (error) {
|
|
3723
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return 0;
|
|
3724
|
+
throw error;
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3727
|
+
function withFileSystemQuota(fs, options) {
|
|
3728
|
+
if (!Number.isSafeInteger(options.maxBytes) || options.maxBytes < 0) throw new RangeError("maxBytes must be a nonnegative safe integer");
|
|
3729
|
+
let queue = Promise.resolve();
|
|
3730
|
+
const mutate = (operation) => {
|
|
3731
|
+
const result = queue.then(operation);
|
|
3732
|
+
queue = result.catch(() => void 0);
|
|
3733
|
+
return result;
|
|
3734
|
+
};
|
|
3735
|
+
const assertDelta = async (path, nextBytes, fsOptions) => {
|
|
3736
|
+
const current = await existingBytes(fs, path, fsOptions);
|
|
3737
|
+
if (await usedBytes(fs, fsOptions) - current + nextBytes > options.maxBytes) throw new FileSystemQuotaError(options.maxBytes);
|
|
3738
|
+
};
|
|
3739
|
+
const mutations = {
|
|
3740
|
+
writeFile(path, data, writeOptions) {
|
|
3741
|
+
return mutate(async () => {
|
|
3742
|
+
const append = writeOptions?.flag === "a" || writeOptions?.flag === "ax";
|
|
3743
|
+
const current = append ? await existingBytes(fs, path, writeOptions) : 0;
|
|
3744
|
+
await assertDelta(path, current + data.length, writeOptions);
|
|
3745
|
+
await fs.writeFile(path, data, writeOptions);
|
|
3746
|
+
});
|
|
3747
|
+
},
|
|
3748
|
+
appendFile(path, data, appendOptions) {
|
|
3749
|
+
return mutate(async () => {
|
|
3750
|
+
await assertDelta(path, await existingBytes(fs, path, appendOptions) + data.length, appendOptions);
|
|
3751
|
+
await fs.appendFile(path, data, appendOptions);
|
|
3752
|
+
});
|
|
3753
|
+
},
|
|
3754
|
+
copyFile(source, destination, copyOptions) {
|
|
3755
|
+
return mutate(async () => {
|
|
3756
|
+
await assertDelta(destination, (await fs.stat(source, copyOptions)).size, copyOptions);
|
|
3757
|
+
await fs.copyFile(source, destination, copyOptions);
|
|
3758
|
+
});
|
|
3759
|
+
},
|
|
3760
|
+
truncate(path, length = 0, truncateOptions) {
|
|
3761
|
+
return mutate(async () => {
|
|
3762
|
+
await assertDelta(path, length, truncateOptions);
|
|
3763
|
+
await fs.truncate(path, length, truncateOptions);
|
|
3764
|
+
});
|
|
3765
|
+
},
|
|
3766
|
+
link(source, destination, linkOptions) {
|
|
3767
|
+
return mutate(async () => {
|
|
3768
|
+
await assertDelta(destination, (await fs.stat(source, linkOptions)).size, linkOptions);
|
|
3769
|
+
await fs.link(source, destination, linkOptions);
|
|
3770
|
+
});
|
|
3771
|
+
},
|
|
3772
|
+
symlink(target, path, linkOptions) {
|
|
3773
|
+
return mutate(async () => {
|
|
3774
|
+
await assertDelta(path, new TextEncoder().encode(target).length, linkOptions);
|
|
3775
|
+
await fs.symlink(target, path, linkOptions);
|
|
3776
|
+
});
|
|
3777
|
+
},
|
|
3778
|
+
writeStream(path, source, writeOptions) {
|
|
3779
|
+
return mutate(async () => {
|
|
3780
|
+
const append = writeOptions?.flag === "a" || writeOptions?.flag === "ax";
|
|
3781
|
+
if (!append) await fs.writeFile(path, new Uint8Array(), writeOptions);
|
|
3782
|
+
for await (const chunk of source) {
|
|
3783
|
+
await assertDelta(path, await existingBytes(fs, path, writeOptions) + chunk.length, writeOptions);
|
|
3784
|
+
await fs.appendFile(path, chunk, writeOptions);
|
|
3785
|
+
}
|
|
3786
|
+
});
|
|
3787
|
+
}
|
|
3788
|
+
};
|
|
3789
|
+
return new Proxy(fs, {
|
|
3790
|
+
get(target, property) {
|
|
3791
|
+
const replacement = Reflect.get(mutations, property);
|
|
3792
|
+
if (typeof replacement === "function") return replacement;
|
|
3793
|
+
const original = Reflect.get(target, property);
|
|
3794
|
+
return typeof original === "function" ? original.bind(target) : original;
|
|
3795
|
+
}
|
|
3796
|
+
});
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3691
3799
|
// packages/safe-fs/src/bridge/stats.ts
|
|
3692
3800
|
function predicates(type) {
|
|
3693
3801
|
return {
|
|
@@ -4310,6 +4418,8 @@ export {
|
|
|
4310
4418
|
createMountFileSystem,
|
|
4311
4419
|
OverlayFileSystem,
|
|
4312
4420
|
createOverlayFileSystem,
|
|
4421
|
+
FileSystemQuotaError,
|
|
4422
|
+
withFileSystemQuota,
|
|
4313
4423
|
FileSystemBridge
|
|
4314
4424
|
};
|
|
4315
|
-
//# sourceMappingURL=chunk-
|
|
4425
|
+
//# sourceMappingURL=chunk-WMZQYBLB.js.map
|