@poe-platform/safe-js 0.1.799 → 0.1.801
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 +4 -2
- package/dist/safe-js/chunks/{chunk-KULEMOAE.js → chunk-4KMUWNZD.js} +5 -156
- package/dist/safe-js/chunks/{chunk-ULPZIHB5.js → chunk-5RLD4TVI.js} +174 -127
- package/dist/safe-js/chunks/{chunk-MCFRB5X3.js → chunk-6H5VC5W5.js} +84 -14
- package/dist/safe-js/chunks/{chunk-TBZILU4U.js → chunk-7THYP46K.js} +1 -1
- package/dist/safe-js/chunks/{chunk-UU4T2KIT.js → chunk-CK3YK2EC.js} +1 -1
- package/dist/safe-js/chunks/{chunk-3O7HA6WT.js → chunk-F6Y734YA.js} +2 -2
- package/dist/safe-js/chunks/{chunk-M6S3F3WM.js → chunk-HFRBLE6Y.js} +42 -36
- package/dist/safe-js/chunks/{chunk-OPYN6N5M.js → chunk-HPHCQNFV.js} +154 -1
- package/dist/safe-js/chunks/{chunk-W6C3Q6U4.js → chunk-IB6WAQAE.js} +2 -2
- package/dist/safe-js/chunks/{chunk-ZKLJW27N.js → chunk-PMOXSLM5.js} +1 -1
- package/dist/safe-js/chunks/chunk-QRWRR6IA.js +78 -0
- package/dist/safe-js/chunks/{chunk-MDJ7MJYI.js → chunk-XOMGWE37.js} +2 -2
- package/dist/safe-js/chunks/{chunk-QTCPJ7FN.js → chunk-XV5OYKND.js} +1 -1
- package/dist/safe-js/chunks/{chunk-OTVZWRYE.js → chunk-YCFOANSU.js} +23 -18
- package/dist/safe-js/chunks/{cli-runtime-DYXJZCGV.js → cli-runtime-L4IABN2W.js} +15 -15
- package/dist/safe-js/chunks/{dump-XDJEF2LG.js → dump-KUPBSXSL.js} +2 -2
- package/dist/safe-js/chunks/{harness-32OOFC5A.js → harness-3DDUS3RY.js} +2 -2
- package/dist/safe-js/chunks/{mcp-PTCA53MN.js → mcp-5TMFK3UE.js} +3 -3
- package/dist/safe-js/chunks/{migration-file-EEGIOHQB.js → migration-file-4CYSJ6LO.js} +3 -3
- package/dist/safe-js/chunks/{restore-U3CCH36B.js → restore-GDHBT5ZD.js} +3 -3
- package/dist/safe-js/chunks/{run-Q74MU3QQ.js → run-M6N5KCPF.js} +5 -5
- package/dist/safe-js/chunks/{runtime-modules-SL5D6LAJ.js → runtime-modules-MGSXY4BN.js} +2 -2
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.d.ts +6 -0
- package/dist/safe-js/core.js +33 -7
- package/dist/safe-js/index.js +24 -93
- package/dist/safe-js/interp/data-copy.d.ts +3 -2
- package/dist/safe-js/interp/host-bridge.d.ts +5 -4
- package/dist/safe-js/modules/fs-config.d.ts +1 -0
- package/dist/safe-js/modules/fs.d.ts +2 -0
- package/dist/safe-js/modules/fs.js +2 -2
- package/dist/safe-js/node-unavailable.d.ts +1 -0
- package/dist/safe-js/portable/chunks/chunk-2FNMGWDK.js +58703 -0
- package/dist/safe-js/portable/chunks/chunk-H5X3T5VP.js +909 -0
- package/dist/safe-js/portable/chunks/chunk-XCTU25SU.js +111 -0
- package/dist/safe-js/portable/chunks/source-files-CVU252FB.js +7 -0
- package/dist/safe-js/portable/core.js +14763 -0
- package/dist/safe-js/portable/modules/fs.js +9 -0
- package/dist/safe-js/snapshot/arguments.d.ts +2 -0
- package/dist/safe-js/snapshot/property-descriptors.d.ts +2 -0
- package/dist/safe-js/snapshot/regexp-properties.d.ts +2 -0
- package/dist/safe-js/snapshot/symbols.d.ts +2 -0
- package/dist/safe-js/workerd.d.ts +3 -0
- package/dist/safe-js/workerd.js +74436 -0
- package/package.json +30 -6
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSeededRandom
|
|
3
|
+
} from "./chunk-5RLD4TVI.js";
|
|
4
|
+
|
|
5
|
+
// packages/safe-js/src/modules/time.ts
|
|
6
|
+
function makeTimeModule(options = {}) {
|
|
7
|
+
const hasDeterministicRandom = options.random !== void 0 || options.seed !== void 0;
|
|
8
|
+
const random = options.random ?? (options.seed === void 0 ? () => Math.random() : createSeededRandom(options.seed).next);
|
|
9
|
+
const now = options.now ?? (() => Date.now());
|
|
10
|
+
const signal = options.signal;
|
|
11
|
+
async function sleep(ms) {
|
|
12
|
+
assertSleepDelay(ms);
|
|
13
|
+
return await new Promise((resolve, reject) => {
|
|
14
|
+
if (signal?.aborted === true) {
|
|
15
|
+
reject(createSleepAbortError());
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const start = performance.now();
|
|
19
|
+
let timeout = setTimeout(resolveSleep, ms);
|
|
20
|
+
function cleanup() {
|
|
21
|
+
clearTimeout(timeout);
|
|
22
|
+
signal?.removeEventListener("abort", rejectSleep);
|
|
23
|
+
}
|
|
24
|
+
function resolveSleep() {
|
|
25
|
+
const remainingMs = ms - (performance.now() - start);
|
|
26
|
+
if (remainingMs > 0) {
|
|
27
|
+
timeout = setTimeout(resolveSleep, remainingMs);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
cleanup();
|
|
31
|
+
resolve();
|
|
32
|
+
}
|
|
33
|
+
function rejectSleep() {
|
|
34
|
+
cleanup();
|
|
35
|
+
reject(createSleepAbortError());
|
|
36
|
+
}
|
|
37
|
+
signal?.addEventListener("abort", rejectSleep, { once: true });
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
random,
|
|
42
|
+
now,
|
|
43
|
+
sleep,
|
|
44
|
+
uuid: hasDeterministicRandom ? () => createRandomUuid(random) : () => globalThis.crypto.randomUUID()
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function createRandomUuid(random) {
|
|
48
|
+
const bytes = Array.from({ length: 16 }, () => Math.floor(readRandomUnit(random()) * 256));
|
|
49
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
50
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
51
|
+
const hex = bytes.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
52
|
+
return [
|
|
53
|
+
hex.slice(0, 8),
|
|
54
|
+
hex.slice(8, 12),
|
|
55
|
+
hex.slice(12, 16),
|
|
56
|
+
hex.slice(16, 20),
|
|
57
|
+
hex.slice(20)
|
|
58
|
+
].join("-");
|
|
59
|
+
}
|
|
60
|
+
function readRandomUnit(value) {
|
|
61
|
+
if (Number.isFinite(value) && value >= 0 && value < 1) {
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
throw new RangeError("time.uuid() random source must return a number in [0, 1).");
|
|
65
|
+
}
|
|
66
|
+
function assertSleepDelay(ms) {
|
|
67
|
+
if (Number.isFinite(ms) && ms >= 0) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
throw new RangeError("time.sleep(ms) requires a non-negative finite millisecond delay.");
|
|
71
|
+
}
|
|
72
|
+
function createSleepAbortError() {
|
|
73
|
+
return new Error("time.sleep aborted.");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
makeTimeModule
|
|
78
|
+
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
hashParsedAst,
|
|
3
3
|
hashSource,
|
|
4
4
|
validateSnapshotMigration
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PMOXSLM5.js";
|
|
6
6
|
import {
|
|
7
7
|
SnapshotValidationError,
|
|
8
8
|
assertSnapshotInactive,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
validateDumpEnvelope,
|
|
12
12
|
validateGuestHeapSource,
|
|
13
13
|
validateRuntimeSnapshotDescriptors
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5RLD4TVI.js";
|
|
15
15
|
import {
|
|
16
16
|
SandboxError,
|
|
17
17
|
parseExecutableModule,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
declareBudgetedHostOperation,
|
|
9
9
|
declareHostOperation
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5RLD4TVI.js";
|
|
11
11
|
import {
|
|
12
12
|
basename,
|
|
13
13
|
dirname,
|
|
@@ -34,11 +34,14 @@ import {
|
|
|
34
34
|
// packages/safe-js/src/modules/canonical-path.ts
|
|
35
35
|
var MISSING_PATH_CODES = ["ENOENT", "ENOTDIR"];
|
|
36
36
|
var NOT_A_SYMLINK_CODES = [...MISSING_PATH_CODES, "EINVAL"];
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
async function resolveCanonicalPath({ realpath, readlink }, path, maxSymlinkFollows = Infinity) {
|
|
38
|
+
if (maxSymlinkFollows !== Infinity && (!Number.isSafeInteger(maxSymlinkFollows) || maxSymlinkFollows < 0)) {
|
|
39
|
+
throw new RangeError("maxSymlinkFollows must be a nonnegative safe integer or Infinity");
|
|
40
|
+
}
|
|
39
41
|
const missingSegments = [];
|
|
40
42
|
let current = path;
|
|
41
43
|
let follows = 0;
|
|
44
|
+
const visited = /* @__PURE__ */ new Set();
|
|
42
45
|
while (true) {
|
|
43
46
|
try {
|
|
44
47
|
const canonicalCurrent = await realpath(current);
|
|
@@ -49,9 +52,10 @@ async function resolveCanonicalPath({ realpath, readlink }, path) {
|
|
|
49
52
|
}
|
|
50
53
|
const target = await readSymlinkTarget(readlink, current);
|
|
51
54
|
if (target !== void 0) {
|
|
52
|
-
if (++follows >
|
|
55
|
+
if (++follows > maxSymlinkFollows || visited.has(current)) {
|
|
53
56
|
throw createLoopError(path);
|
|
54
57
|
}
|
|
58
|
+
visited.add(current);
|
|
55
59
|
current = isAbsolutePath(target) ? target : `${dirname(current)}${sep}${target}`;
|
|
56
60
|
continue;
|
|
57
61
|
}
|
|
@@ -264,9 +268,10 @@ var NULL_BYTE = "\0";
|
|
|
264
268
|
var [ACCESS_DENIED_ERRNO, ACCESS_DENIED_MESSAGE] = accessDeniedSystemError;
|
|
265
269
|
function makeFsModule(options = {}) {
|
|
266
270
|
assertSupportedPlatform();
|
|
271
|
+
const maxSymlinkFollows = options.maxSymlinkFollows ?? Infinity;
|
|
267
272
|
const hostReadMemoryLimit = options.hostReadMemoryLimit ?? Infinity;
|
|
268
273
|
const readFileMaxBytes = options.readFileMaxBytes ?? Infinity;
|
|
269
|
-
for (const limit of [hostReadMemoryLimit, readFileMaxBytes]) {
|
|
274
|
+
for (const limit of [hostReadMemoryLimit, readFileMaxBytes, maxSymlinkFollows]) {
|
|
270
275
|
if (limit !== Infinity && (!Number.isSafeInteger(limit) || limit < 0))
|
|
271
276
|
throw new TypeError("Filesystem read limits must be non-negative safe integers or Infinity.");
|
|
272
277
|
}
|
|
@@ -288,7 +293,7 @@ function makeFsModule(options = {}) {
|
|
|
288
293
|
cwd: options.root === void 0 ? options.cwd : void 0,
|
|
289
294
|
signal: options.signal
|
|
290
295
|
});
|
|
291
|
-
const fs = options.root === void 0 ? implementation : makeRootedFs(implementation, options.root, options.adapter, options.cwd, options.signal);
|
|
296
|
+
const fs = options.root === void 0 ? implementation : makeRootedFs(implementation, options.root, options.adapter, options.cwd, options.signal, maxSymlinkFollows);
|
|
292
297
|
let readFile = bindStringResult(fs, "readFile");
|
|
293
298
|
if (options.adapter !== void 0) {
|
|
294
299
|
const boundedRead = async (args, budget) => {
|
|
@@ -316,7 +321,7 @@ function makeFsModule(options = {}) {
|
|
|
316
321
|
}
|
|
317
322
|
});
|
|
318
323
|
const portable = bridge;
|
|
319
|
-
const boundedFs = options.root === void 0 ? portable : makeRootedFs(portable, options.root, options.adapter, options.cwd, options.signal);
|
|
324
|
+
const boundedFs = options.root === void 0 ? portable : makeRootedFs(portable, options.root, options.adapter, options.cwd, options.signal, maxSymlinkFollows);
|
|
320
325
|
return await invoke(boundedFs, "readFile", args);
|
|
321
326
|
};
|
|
322
327
|
const directRead = declare("readFile", "re-issue", (...args) => boundedRead(args));
|
|
@@ -408,7 +413,7 @@ function invoke(fs, name, args) {
|
|
|
408
413
|
return Reflect.apply(fs[name], fs, args);
|
|
409
414
|
}
|
|
410
415
|
var rootedFsOperations = /* @__PURE__ */ new WeakMap();
|
|
411
|
-
function makeRootedFs(fs, root, adapter, cwd, signal) {
|
|
416
|
+
function makeRootedFs(fs, root, adapter, cwd, signal, maxSymlinkFollows = Infinity) {
|
|
412
417
|
if (root.trim().length === 0) {
|
|
413
418
|
throw new Error("fs module root must be a non-empty string.");
|
|
414
419
|
}
|
|
@@ -429,7 +434,7 @@ function makeRootedFs(fs, root, adapter, cwd, signal) {
|
|
|
429
434
|
return await invoke(
|
|
430
435
|
fs,
|
|
431
436
|
name,
|
|
432
|
-
await resolvePathArguments(fs, resolvedRoot, name, args, adapter, cwd, signal)
|
|
437
|
+
await resolvePathArguments(fs, resolvedRoot, name, args, adapter, cwd, signal, maxSymlinkFollows)
|
|
433
438
|
);
|
|
434
439
|
} finally {
|
|
435
440
|
release();
|
|
@@ -450,8 +455,8 @@ function assertRootCanConfineOptions(name, args) {
|
|
|
450
455
|
throw createUnsupportedOptionError("cp", "dereference", ROOT_REFUSED_DEREFERENCE_REASON);
|
|
451
456
|
}
|
|
452
457
|
}
|
|
453
|
-
async function resolvePathArguments(fs, root, name, args, adapter, cwd, signal) {
|
|
454
|
-
const canonicalRoot = await resolveCanonicalPath(readCanonicalPathFs(fs), resolve(root));
|
|
458
|
+
async function resolvePathArguments(fs, root, name, args, adapter, cwd, signal, maxSymlinkFollows = Infinity) {
|
|
459
|
+
const canonicalRoot = await resolveCanonicalPath(readCanonicalPathFs(fs), resolve(root), maxSymlinkFollows);
|
|
455
460
|
const base = cwd ?? canonicalRoot;
|
|
456
461
|
const resolved = [...args];
|
|
457
462
|
if (name === "symlink") {
|
|
@@ -475,7 +480,7 @@ async function resolvePathArguments(fs, root, name, args, adapter, cwd, signal)
|
|
|
475
480
|
await assertInsideRoot(fs, canonicalRoot, name, [checkedTarget, linkPath], adapter, signal, [
|
|
476
481
|
targetPath,
|
|
477
482
|
linkPath
|
|
478
|
-
]);
|
|
483
|
+
], maxSymlinkFollows);
|
|
479
484
|
return resolved;
|
|
480
485
|
}
|
|
481
486
|
const paths = FS_PATH_ARGUMENTS[name].map((_, index) => {
|
|
@@ -483,12 +488,12 @@ async function resolvePathArguments(fs, root, name, args, adapter, cwd, signal)
|
|
|
483
488
|
resolved[index] = path;
|
|
484
489
|
return path;
|
|
485
490
|
});
|
|
486
|
-
await assertInsideRoot(fs, canonicalRoot, name, paths, adapter, signal);
|
|
491
|
+
await assertInsideRoot(fs, canonicalRoot, name, paths, adapter, signal, paths, maxSymlinkFollows);
|
|
487
492
|
if (name === "mkdtemp") {
|
|
488
493
|
const prefix = args[0];
|
|
489
494
|
const absolutePrefix = isAbsolutePath(prefix) ? prefix : `${base}${sep}${prefix}`;
|
|
490
495
|
const parent = absolutePrefix.endsWith(sep) ? absolutePrefix : dirname(absolutePrefix);
|
|
491
|
-
await assertInsideRoot(fs, canonicalRoot, name, [parent], adapter, signal, paths);
|
|
496
|
+
await assertInsideRoot(fs, canonicalRoot, name, [parent], adapter, signal, paths, maxSymlinkFollows);
|
|
492
497
|
resolved[0] = absolutePrefix;
|
|
493
498
|
}
|
|
494
499
|
if (adapter !== void 0 && name === "mkdir") {
|
|
@@ -506,15 +511,15 @@ async function resolvePathArguments(fs, root, name, args, adapter, cwd, signal)
|
|
|
506
511
|
}
|
|
507
512
|
return resolved;
|
|
508
513
|
}
|
|
509
|
-
async function assertInsideRoot(fs, canonicalRoot, name, paths, adapter, signal, reportedPaths = paths) {
|
|
514
|
+
async function assertInsideRoot(fs, canonicalRoot, name, paths, adapter, signal, reportedPaths = paths, maxSymlinkFollows = Infinity) {
|
|
510
515
|
for (const path of paths) {
|
|
511
|
-
if (await escapesRoot(fs, canonicalRoot, path, adapter, signal)) {
|
|
516
|
+
if (await escapesRoot(fs, canonicalRoot, path, adapter, signal, maxSymlinkFollows)) {
|
|
512
517
|
throw createAccessDeniedError(name, reportedPaths[0], reportedPaths[1]);
|
|
513
518
|
}
|
|
514
519
|
}
|
|
515
520
|
}
|
|
516
|
-
async function escapesRoot(fs, canonicalRoot, path, adapter, signal) {
|
|
517
|
-
const canonicalPath = await resolveCanonicalPath(readCanonicalPathFs(fs), path);
|
|
521
|
+
async function escapesRoot(fs, canonicalRoot, path, adapter, signal, maxSymlinkFollows = Infinity) {
|
|
522
|
+
const canonicalPath = await resolveCanonicalPath(readCanonicalPathFs(fs), path, maxSymlinkFollows);
|
|
518
523
|
return !await (adapter === void 0 ? containsPath(readStat(fs), canonicalRoot, canonicalPath) : containsAdapterPath(adapter, canonicalRoot, canonicalPath, signal));
|
|
519
524
|
}
|
|
520
525
|
async function containsAdapterPath(adapter, canonicalRoot, canonicalPath, signal) {
|
|
@@ -3,22 +3,22 @@ import {
|
|
|
3
3
|
extractBlock,
|
|
4
4
|
formatInterpreterError,
|
|
5
5
|
makeAgentModule,
|
|
6
|
-
makeEnvModule,
|
|
7
|
-
makeFailModule,
|
|
8
6
|
makeLogModule,
|
|
9
|
-
makeMetricModule,
|
|
10
7
|
maskSource,
|
|
11
|
-
parseEnvConfig,
|
|
12
8
|
parseFsConfig,
|
|
13
9
|
resolveFsConfig,
|
|
14
10
|
splitFrontmatter
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4KMUWNZD.js";
|
|
16
12
|
import {
|
|
17
13
|
parseMcpConfig
|
|
18
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6H5VC5W5.js";
|
|
19
15
|
import {
|
|
20
|
-
lint
|
|
21
|
-
|
|
16
|
+
lint,
|
|
17
|
+
makeEnvModule,
|
|
18
|
+
makeFailModule,
|
|
19
|
+
makeMetricModule,
|
|
20
|
+
parseEnvConfig
|
|
21
|
+
} from "./chunk-HPHCQNFV.js";
|
|
22
22
|
import {
|
|
23
23
|
createBrokenPipeState,
|
|
24
24
|
createSafeOutputStream,
|
|
@@ -72,7 +72,7 @@ async function runCli(argv, options, usage) {
|
|
|
72
72
|
async () => {
|
|
73
73
|
try {
|
|
74
74
|
if (argv[0] === "migrate") {
|
|
75
|
-
const { migrateSnapshotFile } = await import("./migration-file-
|
|
75
|
+
const { migrateSnapshotFile } = await import("./migration-file-4CYSJ6LO.js");
|
|
76
76
|
const result = await migrateSnapshotFile({
|
|
77
77
|
...parseMigrationArgs(argv.slice(1)),
|
|
78
78
|
cwd: options.cwd ?? readCurrentWorkingDirectory(),
|
|
@@ -291,12 +291,12 @@ async function assertHarnessFile(input) {
|
|
|
291
291
|
}
|
|
292
292
|
async function runScriptFile(filepath, parsed, options) {
|
|
293
293
|
const [{ run }, { restore }, { dump, dumpCurrent }, { createLintModulesFromRuntimeRegistry }, { makeFsModule }, { makeMcpModule }] = await Promise.all([
|
|
294
|
-
import("./run-
|
|
295
|
-
import("./restore-
|
|
296
|
-
import("./dump-
|
|
297
|
-
import("./runtime-modules-
|
|
294
|
+
import("./run-M6N5KCPF.js"),
|
|
295
|
+
import("./restore-GDHBT5ZD.js"),
|
|
296
|
+
import("./dump-KUPBSXSL.js"),
|
|
297
|
+
import("./runtime-modules-MGSXY4BN.js"),
|
|
298
298
|
import("../modules/fs.js"),
|
|
299
|
-
import("./mcp-
|
|
299
|
+
import("./mcp-5TMFK3UE.js")
|
|
300
300
|
]);
|
|
301
301
|
const loaded = loadExecutableSource(filepath, await options.readFile(filepath, "utf8"));
|
|
302
302
|
const meta = {
|
|
@@ -534,7 +534,7 @@ async function createRuntime(frontmatter, meta, options) {
|
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
const [{ makeHarnessModule }, { makeFsModule }] = await Promise.all([
|
|
537
|
-
import("./harness-
|
|
537
|
+
import("./harness-3DDUS3RY.js"),
|
|
538
538
|
import("../modules/fs.js")
|
|
539
539
|
]);
|
|
540
540
|
const state = {
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
dump,
|
|
5
5
|
dumpCurrent,
|
|
6
6
|
serializeRunSnapshot
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-XV5OYKND.js";
|
|
8
|
+
import "./chunk-5RLD4TVI.js";
|
|
9
9
|
import "./chunk-A3LXCGMJ.js";
|
|
10
10
|
import "./chunk-JCHJGIQA.js";
|
|
11
11
|
import "./chunk-CQ52GEHY.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeMcpModule
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-IB6WAQAE.js";
|
|
4
|
+
import "./chunk-6H5VC5W5.js";
|
|
5
|
+
import "./chunk-5RLD4TVI.js";
|
|
6
6
|
import "./chunk-A3LXCGMJ.js";
|
|
7
7
|
import "./chunk-JCHJGIQA.js";
|
|
8
8
|
import "./chunk-CQ52GEHY.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
migrateSnapshotFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6Y734YA.js";
|
|
4
4
|
import "./chunk-DIG26TEI.js";
|
|
5
5
|
import "./chunk-ONWFPHUI.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-PMOXSLM5.js";
|
|
7
|
+
import "./chunk-5RLD4TVI.js";
|
|
8
8
|
import "./chunk-A3LXCGMJ.js";
|
|
9
9
|
import "./chunk-MMN3IESA.js";
|
|
10
10
|
import "./chunk-JCHJGIQA.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SnapshotMismatchError,
|
|
3
3
|
restore
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-XOMGWE37.js";
|
|
5
|
+
import "./chunk-PMOXSLM5.js";
|
|
6
|
+
import "./chunk-5RLD4TVI.js";
|
|
7
7
|
import "./chunk-A3LXCGMJ.js";
|
|
8
8
|
import "./chunk-JCHJGIQA.js";
|
|
9
9
|
import "./chunk-CQ52GEHY.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnhandledRejectionError,
|
|
3
3
|
run
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HFRBLE6Y.js";
|
|
5
5
|
import "./chunk-DHGJSEFX.js";
|
|
6
6
|
import "./chunk-DIG26TEI.js";
|
|
7
7
|
import "./chunk-ONWFPHUI.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-XOMGWE37.js";
|
|
9
|
+
import "./chunk-PMOXSLM5.js";
|
|
10
|
+
import "./chunk-XV5OYKND.js";
|
|
11
|
+
import "./chunk-5RLD4TVI.js";
|
|
12
12
|
import "./chunk-A3LXCGMJ.js";
|
|
13
13
|
import "./chunk-MMN3IESA.js";
|
|
14
14
|
import "./chunk-JCHJGIQA.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLintModulesFromRuntimeRegistry
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7THYP46K.js";
|
|
4
|
+
import "./chunk-5RLD4TVI.js";
|
|
5
5
|
import "./chunk-A3LXCGMJ.js";
|
|
6
6
|
import "./chunk-JCHJGIQA.js";
|
|
7
7
|
import "./chunk-CQ52GEHY.js";
|
package/dist/safe-js/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import path from "node:path";
|
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
14
|
async function runCli(argv, options = {}) {
|
|
15
15
|
if (!argv.includes("--help") && !argv.includes("-h")) {
|
|
16
|
-
const runtime = await import("./chunks/cli-runtime-
|
|
16
|
+
const runtime = await import("./chunks/cli-runtime-L4IABN2W.js");
|
|
17
17
|
return runtime.runCli(argv, options, createUsage());
|
|
18
18
|
}
|
|
19
19
|
const brokenPipe = createBrokenPipeState();
|
|
@@ -32,7 +32,7 @@ async function runCli(argv, options = {}) {
|
|
|
32
32
|
stderr.write(`${error instanceof Error ? error.message : String(error)}
|
|
33
33
|
`);
|
|
34
34
|
if (brokenPipe.closed) return 0;
|
|
35
|
-
const { exitCodeForError } = await import("./chunks/cli-runtime-
|
|
35
|
+
const { exitCodeForError } = await import("./chunks/cli-runtime-L4IABN2W.js");
|
|
36
36
|
return exitCodeForError(error);
|
|
37
37
|
}
|
|
38
38
|
}
|
package/dist/safe-js/core.d.ts
CHANGED
|
@@ -12,3 +12,9 @@ export { Budget } from "./interp/budget.js";
|
|
|
12
12
|
export type { SnapshotValidationCode } from "./snapshot/validation.js";
|
|
13
13
|
export type { SourceResolver, SourceModule } from "./modules/source-graph.js";
|
|
14
14
|
export { createRootedSourceResolver } from "./modules/source-files.js";
|
|
15
|
+
export * from "./modules/env.js";
|
|
16
|
+
export * from "./modules/fail.js";
|
|
17
|
+
export * from "./modules/fs.js";
|
|
18
|
+
export * from "./modules/harness.js";
|
|
19
|
+
export * from "./modules/metric.js";
|
|
20
|
+
export * from "./modules/time.js";
|
package/dist/safe-js/core.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunks/chunk-
|
|
2
|
+
makeTimeModule
|
|
3
|
+
} from "./chunks/chunk-QRWRR6IA.js";
|
|
4
|
+
import {
|
|
5
|
+
makeHarnessModule
|
|
6
|
+
} from "./chunks/chunk-CK3YK2EC.js";
|
|
7
|
+
import {
|
|
8
|
+
EnvAccessError,
|
|
9
|
+
HarnessFailure,
|
|
10
|
+
lint,
|
|
11
|
+
makeEnvModule,
|
|
12
|
+
makeFailModule,
|
|
13
|
+
makeMetricModule,
|
|
14
|
+
parseEnvConfig
|
|
15
|
+
} from "./chunks/chunk-HPHCQNFV.js";
|
|
16
|
+
import {
|
|
17
|
+
FS_OPTION_SURFACE,
|
|
18
|
+
makeFsModule
|
|
19
|
+
} from "./chunks/chunk-YCFOANSU.js";
|
|
4
20
|
import {
|
|
5
21
|
createRootedSourceResolver
|
|
6
22
|
} from "./chunks/chunk-3NFTBEZR.js";
|
|
@@ -8,17 +24,17 @@ import {
|
|
|
8
24
|
createRealm,
|
|
9
25
|
createReplayableRandom,
|
|
10
26
|
run
|
|
11
|
-
} from "./chunks/chunk-
|
|
27
|
+
} from "./chunks/chunk-HFRBLE6Y.js";
|
|
12
28
|
import "./chunks/chunk-DHGJSEFX.js";
|
|
13
29
|
import "./chunks/chunk-DIG26TEI.js";
|
|
14
30
|
import "./chunks/chunk-ONWFPHUI.js";
|
|
15
|
-
import "./chunks/chunk-
|
|
16
|
-
import "./chunks/chunk-
|
|
17
|
-
import "./chunks/chunk-
|
|
31
|
+
import "./chunks/chunk-XOMGWE37.js";
|
|
32
|
+
import "./chunks/chunk-PMOXSLM5.js";
|
|
33
|
+
import "./chunks/chunk-XV5OYKND.js";
|
|
18
34
|
import {
|
|
19
35
|
admitNativePromiseProperties,
|
|
20
36
|
defineExtension
|
|
21
|
-
} from "./chunks/chunk-
|
|
37
|
+
} from "./chunks/chunk-5RLD4TVI.js";
|
|
22
38
|
import {
|
|
23
39
|
Budget
|
|
24
40
|
} from "./chunks/chunk-A3LXCGMJ.js";
|
|
@@ -27,11 +43,21 @@ import "./chunks/chunk-JCHJGIQA.js";
|
|
|
27
43
|
import "./chunks/chunk-CQ52GEHY.js";
|
|
28
44
|
export {
|
|
29
45
|
Budget,
|
|
46
|
+
EnvAccessError,
|
|
47
|
+
FS_OPTION_SURFACE,
|
|
48
|
+
HarnessFailure,
|
|
30
49
|
admitNativePromiseProperties,
|
|
31
50
|
createRealm,
|
|
32
51
|
createReplayableRandom,
|
|
33
52
|
createRootedSourceResolver,
|
|
34
53
|
defineExtension,
|
|
35
54
|
lint,
|
|
55
|
+
makeEnvModule,
|
|
56
|
+
makeFailModule,
|
|
57
|
+
makeFsModule,
|
|
58
|
+
makeHarnessModule,
|
|
59
|
+
makeMetricModule,
|
|
60
|
+
makeTimeModule,
|
|
61
|
+
parseEnvConfig,
|
|
36
62
|
run
|
|
37
63
|
};
|