poe-code 14.0.37 → 14.0.38
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/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safe-bash/dist/browser.js +97 -54
- package/packages/safe-bash/dist/browser.js.map +4 -4
- package/packages/safe-bash/dist/commands/internal.d.ts +1 -1
- package/packages/safe-bash/dist/commands/internal.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/internal.js +18 -25
- package/packages/safe-bash/dist/commands/internal.js.map +1 -1
- package/packages/safe-bash/dist/commands/record-buffer.d.ts +11 -0
- package/packages/safe-bash/dist/commands/record-buffer.d.ts.map +1 -0
- package/packages/safe-bash/dist/commands/record-buffer.js +61 -0
- package/packages/safe-bash/dist/commands/record-buffer.js.map +1 -0
- package/packages/safe-bash/dist/commands/text.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/text.js +23 -37
- package/packages/safe-bash/dist/commands/text.js.map +1 -1
- package/packages/safe-js/dist/browser/chunks/{chunk-BB4KTS26.js → chunk-CQ4URS56.js} +34 -5
- package/packages/safe-js/dist/browser/chunks/{chunk-BB4KTS26.js.map → chunk-CQ4URS56.js.map} +2 -2
- package/packages/safe-js/dist/browser/safe-fs-core.js +1 -1
- package/packages/safe-js/dist/browser/safe-fs.js +1 -1
- package/packages/safe-js/dist/chunks/{chunk-LRWPYBOU.js → chunk-5DYEOCT5.js} +34 -5
- package/packages/safe-js/dist/chunks/{chunk-LRWPYBOU.js.map → chunk-5DYEOCT5.js.map} +2 -2
- package/packages/safe-js/dist/chunks/{chunk-FOWKJRPH.js → chunk-QXSG4XRW.js} +3 -3
- package/packages/safe-js/dist/chunks/{chunk-OXQ2XP74.js → chunk-UXMKEUH3.js} +2 -2
- 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 +1 -1
- package/packages/safe-js/dist/safe-fs-node.js +2 -2
- package/packages/safe-js/dist/safe-fs.js +2 -2
- /package/packages/safe-js/dist/chunks/{chunk-FOWKJRPH.js.map → chunk-QXSG4XRW.js.map} +0 -0
- /package/packages/safe-js/dist/chunks/{chunk-OXQ2XP74.js.map → chunk-UXMKEUH3.js.map} +0 -0
|
@@ -3980,17 +3980,38 @@ var FileSystemQuotaError = class extends Error {
|
|
|
3980
3980
|
}
|
|
3981
3981
|
maxBytes;
|
|
3982
3982
|
};
|
|
3983
|
-
async function usedBytes(fs, options) {
|
|
3983
|
+
async function usedBytes(fs, options, change) {
|
|
3984
3984
|
let total = 0;
|
|
3985
|
+
let possibleAliases = 0;
|
|
3985
3986
|
const pending = ["/"];
|
|
3986
3987
|
while (pending.length) {
|
|
3988
|
+
options?.signal?.throwIfAborted();
|
|
3987
3989
|
const directory = pending.pop();
|
|
3988
3990
|
for (const entry of await fs.readdir(directory, options)) {
|
|
3991
|
+
options?.signal?.throwIfAborted();
|
|
3989
3992
|
const path = `${directory === "/" ? "" : directory}/${entry.name}`;
|
|
3990
3993
|
if (entry.type === "directory") pending.push(path);
|
|
3991
|
-
else
|
|
3994
|
+
else {
|
|
3995
|
+
const stat = await fs.lstat(path, options);
|
|
3996
|
+
total += stat.size;
|
|
3997
|
+
if (!change || stat.type !== "file") continue;
|
|
3998
|
+
const scope = change.stat.identityScope;
|
|
3999
|
+
const comparable = [scope, stat.identityScope].every((value) => typeof value === "symbol" || typeof value === "object" && value !== null) && [change.stat.dev, change.stat.ino, stat.dev, stat.ino].every((value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0);
|
|
4000
|
+
const compare = comparable ? void 0 : fs.compareEntry;
|
|
4001
|
+
const comparison = comparable ? scope === stat.identityScope && change.stat.dev === stat.dev && change.stat.ino === stat.ino ? "same" : "distinct" : compare === void 0 ? "unknown" : await compare.call(fs, change.path, fs, path, options);
|
|
4002
|
+
options?.signal?.throwIfAborted();
|
|
4003
|
+
if (comparison !== "same" && comparison !== "distinct" && comparison !== "unknown") throw new FsError("EIO", { syscall: "compareEntry", path: change.path, dest: path, message: "invalid entry comparison" });
|
|
4004
|
+
if (comparison === "same") {
|
|
4005
|
+
total += change.delta;
|
|
4006
|
+
possibleAliases++;
|
|
4007
|
+
} else if (comparison !== "distinct") {
|
|
4008
|
+
total += Math.max(0, change.delta);
|
|
4009
|
+
possibleAliases++;
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
3992
4012
|
}
|
|
3993
4013
|
}
|
|
4014
|
+
if (change && possibleAliases === 0) total += Math.max(0, change.delta);
|
|
3994
4015
|
return total;
|
|
3995
4016
|
}
|
|
3996
4017
|
async function existingBytes(fs, path, options) {
|
|
@@ -4011,8 +4032,16 @@ function withFileSystemQuota(fs, options) {
|
|
|
4011
4032
|
return result;
|
|
4012
4033
|
};
|
|
4013
4034
|
const assertDelta = async (path, nextBytes, fsOptions) => {
|
|
4014
|
-
|
|
4015
|
-
|
|
4035
|
+
fsOptions?.signal?.throwIfAborted();
|
|
4036
|
+
let current;
|
|
4037
|
+
try {
|
|
4038
|
+
current = await fs.stat(path, fsOptions);
|
|
4039
|
+
} catch (error) {
|
|
4040
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
|
|
4041
|
+
}
|
|
4042
|
+
const projected = current?.type === "file" && nextBytes > current.size ? await usedBytes(fs, fsOptions, { path, stat: current, delta: nextBytes - current.size }) : await usedBytes(fs, fsOptions) - (current?.type === "directory" ? 0 : current?.size ?? 0) + nextBytes;
|
|
4043
|
+
fsOptions?.signal?.throwIfAborted();
|
|
4044
|
+
if (projected > options.maxBytes) throw new FileSystemQuotaError(options.maxBytes);
|
|
4016
4045
|
};
|
|
4017
4046
|
const mutations = {
|
|
4018
4047
|
writeFile(path, data, writeOptions) {
|
|
@@ -4704,4 +4733,4 @@ export {
|
|
|
4704
4733
|
withFileSystemQuota,
|
|
4705
4734
|
FileSystemBridge
|
|
4706
4735
|
};
|
|
4707
|
-
//# sourceMappingURL=chunk-
|
|
4736
|
+
//# sourceMappingURL=chunk-5DYEOCT5.js.map
|