@poe-platform/safe-js 0.1.803 → 0.1.804
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 -4
- package/dist/safe-js/bundled-yaml/LICENSE +13 -0
- package/dist/safe-js/bundled-yaml/index.js +6601 -0
- package/dist/safe-js/chunks/{chunk-FUXGXSZC.js → chunk-36PBWSDR.js} +8 -8
- package/dist/safe-js/chunks/{chunk-SN4G557J.js → chunk-6AO2T2VZ.js} +1 -1
- package/dist/safe-js/chunks/{chunk-ZXDUALDQ.js → chunk-BKNQTNHP.js} +33 -23
- package/dist/safe-js/chunks/{chunk-WEPHHJMR.js → chunk-BYDDUKS3.js} +3 -3
- package/dist/safe-js/chunks/{chunk-6H5VC5W5.js → chunk-CKOGIOB3.js} +470 -464
- package/dist/safe-js/chunks/{chunk-D36FRVNN.js → chunk-CVPZFRCC.js} +3 -3
- package/dist/safe-js/chunks/{chunk-4KMUWNZD.js → chunk-ECMGBHAB.js} +13 -137
- package/dist/safe-js/chunks/{chunk-A3LXCGMJ.js → chunk-EQUBWQJN.js} +57 -34
- package/dist/safe-js/chunks/{chunk-ZAOSXSKI.js → chunk-JMDWLOJV.js} +26 -3
- package/dist/safe-js/chunks/{chunk-3NFTBEZR.js → chunk-JQ5QJV5Q.js} +2 -2
- package/dist/safe-js/chunks/{chunk-MMN3IESA.js → chunk-KMBCLXER.js} +1 -1
- package/dist/safe-js/chunks/{chunk-WRGATIKL.js → chunk-MJH73KJI.js} +2 -2
- package/dist/safe-js/chunks/{chunk-UQYM4GXB.js → chunk-P66QKVQC.js} +3 -3
- package/dist/safe-js/chunks/{chunk-HPHCQNFV.js → chunk-RPGCF4KE.js} +130 -3
- package/dist/safe-js/chunks/{chunk-J565YTXP.js → chunk-SIR35W6T.js} +5 -5
- package/dist/safe-js/chunks/{chunk-LVTYTUF5.js → chunk-SMGNJNDU.js} +1 -1
- package/dist/safe-js/chunks/{chunk-6NCYOKZQ.js → chunk-VLRTLEDI.js} +2 -2
- package/dist/safe-js/chunks/{chunk-JCHJGIQA.js → chunk-VVOPJZRG.js} +2 -0
- package/dist/safe-js/chunks/{cli-runtime-QIA3QMTP.js → cli-runtime-A353G7DR.js} +15 -15
- package/dist/safe-js/chunks/{dump-TGI6PZKL.js → dump-KQZFULX2.js} +4 -4
- package/dist/safe-js/chunks/harness-XT6K6X67.js +10 -0
- package/dist/safe-js/chunks/mcp-VWE444VD.js +11 -0
- package/dist/safe-js/chunks/migration-file-NSKXOMAO.js +14 -0
- package/dist/safe-js/chunks/restore-SHPORPY4.js +13 -0
- package/dist/safe-js/chunks/run-FQOSICOT.js +19 -0
- package/dist/safe-js/chunks/{runtime-modules-HWTUIY5J.js → runtime-modules-DBRXXRND.js} +4 -4
- package/dist/safe-js/chunks/{source-files-BSDM22Y2.js → source-files-A2WSOO6G.js} +3 -3
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.d.ts +19 -0
- package/dist/safe-js/core.js +39 -15
- package/dist/safe-js/error/format.d.ts +3 -0
- package/dist/safe-js/index.d.ts +1 -12
- package/dist/safe-js/index.js +30 -39
- package/dist/safe-js/interp/interpreter.d.ts +1 -3
- package/dist/safe-js/modules/fs.js +5 -5
- package/dist/safe-js/platform/node.d.ts +1 -0
- package/dist/safe-js/platform/node.js +1 -0
- package/dist/safe-js/platform/workerd.d.ts +1 -0
- package/dist/safe-js/platform/workerd.js +2 -0
- package/dist/safe-js/portable/chunks/{chunk-XCTU25SU.js → chunk-NLGXLZCK.js} +1 -1
- package/dist/safe-js/portable/chunks/{chunk-BIHLWVUU.js → chunk-SRMMDXD3.js} +124 -91
- package/dist/safe-js/portable/chunks/{chunk-H5X3T5VP.js → chunk-W6MZOTYR.js} +2 -0
- package/dist/safe-js/portable/chunks/{source-files-CVU252FB.js → source-files-AEDWESAJ.js} +2 -2
- package/dist/safe-js/portable/core.js +452 -246
- package/dist/safe-js/portable/modules/fs.js +2 -2
- package/dist/safe-js/workerd.js +57970 -57736
- package/package.json +6 -5
- package/dist/safe-js/chunks/harness-EE3ISLJP.js +0 -10
- package/dist/safe-js/chunks/mcp-F5MMOZNP.js +0 -11
- package/dist/safe-js/chunks/migration-file-W3HZOGXV.js +0 -14
- package/dist/safe-js/chunks/restore-MMM4A46M.js +0 -13
- package/dist/safe-js/chunks/run-TKX3IFNH.js +0 -19
- package/dist/safe-js/node-unavailable.d.ts +0 -1
|
@@ -3,22 +3,22 @@ import {
|
|
|
3
3
|
extractBlock,
|
|
4
4
|
formatInterpreterError,
|
|
5
5
|
makeAgentModule,
|
|
6
|
-
makeLogModule,
|
|
7
6
|
maskSource,
|
|
8
7
|
parseFsConfig,
|
|
9
8
|
resolveFsConfig,
|
|
10
9
|
splitFrontmatter
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ECMGBHAB.js";
|
|
12
11
|
import {
|
|
13
12
|
parseMcpConfig
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CKOGIOB3.js";
|
|
15
14
|
import {
|
|
16
15
|
lint,
|
|
17
16
|
makeEnvModule,
|
|
18
17
|
makeFailModule,
|
|
18
|
+
makeLogModule,
|
|
19
19
|
makeMetricModule,
|
|
20
20
|
parseEnvConfig
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RPGCF4KE.js";
|
|
22
22
|
import {
|
|
23
23
|
createBrokenPipeState,
|
|
24
24
|
createSafeOutputStream,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-X3YCE3ZH.js";
|
|
27
27
|
import {
|
|
28
28
|
createRootedSourceResolver
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JQ5QJV5Q.js";
|
|
30
30
|
import "./chunk-DHGJSEFX.js";
|
|
31
31
|
import {
|
|
32
32
|
fsCodec
|
|
@@ -40,16 +40,16 @@ import {
|
|
|
40
40
|
parseModule,
|
|
41
41
|
parseSourceModule,
|
|
42
42
|
replaceErrorStack
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-EQUBWQJN.js";
|
|
44
44
|
import {
|
|
45
45
|
dirname,
|
|
46
46
|
extname,
|
|
47
47
|
paths_default
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-KMBCLXER.js";
|
|
49
49
|
import {
|
|
50
50
|
formatWithOptions,
|
|
51
51
|
hostFs
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-VVOPJZRG.js";
|
|
53
53
|
import "./chunk-CQ52GEHY.js";
|
|
54
54
|
|
|
55
55
|
// packages/safe-js/src/cli-runtime.ts
|
|
@@ -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-NSKXOMAO.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-FQOSICOT.js"),
|
|
295
|
+
import("./restore-SHPORPY4.js"),
|
|
296
|
+
import("./dump-KQZFULX2.js"),
|
|
297
|
+
import("./runtime-modules-DBRXXRND.js"),
|
|
298
298
|
import("../modules/fs.js"),
|
|
299
|
-
import("./mcp-
|
|
299
|
+
import("./mcp-VWE444VD.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-XT6K6X67.js"),
|
|
538
538
|
import("../modules/fs.js")
|
|
539
539
|
]);
|
|
540
540
|
const state = {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
dump,
|
|
5
5
|
dumpCurrent,
|
|
6
6
|
serializeRunSnapshot
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-VLRTLEDI.js";
|
|
8
|
+
import "./chunk-BKNQTNHP.js";
|
|
9
|
+
import "./chunk-EQUBWQJN.js";
|
|
10
|
+
import "./chunk-VVOPJZRG.js";
|
|
11
11
|
import "./chunk-CQ52GEHY.js";
|
|
12
12
|
export {
|
|
13
13
|
attachDumpController,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
migrateSnapshotFile
|
|
3
|
+
} from "./chunk-SIR35W6T.js";
|
|
4
|
+
import "./chunk-DIG26TEI.js";
|
|
5
|
+
import "./chunk-ONWFPHUI.js";
|
|
6
|
+
import "./chunk-MJH73KJI.js";
|
|
7
|
+
import "./chunk-BKNQTNHP.js";
|
|
8
|
+
import "./chunk-EQUBWQJN.js";
|
|
9
|
+
import "./chunk-KMBCLXER.js";
|
|
10
|
+
import "./chunk-VVOPJZRG.js";
|
|
11
|
+
import "./chunk-CQ52GEHY.js";
|
|
12
|
+
export {
|
|
13
|
+
migrateSnapshotFile
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SnapshotMismatchError,
|
|
3
|
+
restore
|
|
4
|
+
} from "./chunk-CVPZFRCC.js";
|
|
5
|
+
import "./chunk-MJH73KJI.js";
|
|
6
|
+
import "./chunk-BKNQTNHP.js";
|
|
7
|
+
import "./chunk-EQUBWQJN.js";
|
|
8
|
+
import "./chunk-VVOPJZRG.js";
|
|
9
|
+
import "./chunk-CQ52GEHY.js";
|
|
10
|
+
export {
|
|
11
|
+
SnapshotMismatchError,
|
|
12
|
+
restore
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UnhandledRejectionError,
|
|
3
|
+
run
|
|
4
|
+
} from "./chunk-36PBWSDR.js";
|
|
5
|
+
import "./chunk-DHGJSEFX.js";
|
|
6
|
+
import "./chunk-DIG26TEI.js";
|
|
7
|
+
import "./chunk-ONWFPHUI.js";
|
|
8
|
+
import "./chunk-CVPZFRCC.js";
|
|
9
|
+
import "./chunk-MJH73KJI.js";
|
|
10
|
+
import "./chunk-VLRTLEDI.js";
|
|
11
|
+
import "./chunk-BKNQTNHP.js";
|
|
12
|
+
import "./chunk-EQUBWQJN.js";
|
|
13
|
+
import "./chunk-KMBCLXER.js";
|
|
14
|
+
import "./chunk-VVOPJZRG.js";
|
|
15
|
+
import "./chunk-CQ52GEHY.js";
|
|
16
|
+
export {
|
|
17
|
+
UnhandledRejectionError,
|
|
18
|
+
run
|
|
19
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLintModulesFromRuntimeRegistry
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-SMGNJNDU.js";
|
|
4
|
+
import "./chunk-BKNQTNHP.js";
|
|
5
|
+
import "./chunk-EQUBWQJN.js";
|
|
6
|
+
import "./chunk-VVOPJZRG.js";
|
|
7
7
|
import "./chunk-CQ52GEHY.js";
|
|
8
8
|
export {
|
|
9
9
|
createLintModulesFromRuntimeRegistry
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRootedSourceResolver
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JQ5QJV5Q.js";
|
|
4
|
+
import "./chunk-KMBCLXER.js";
|
|
5
|
+
import "./chunk-VVOPJZRG.js";
|
|
6
6
|
import "./chunk-CQ52GEHY.js";
|
|
7
7
|
export {
|
|
8
8
|
createRootedSourceResolver
|
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-A353G7DR.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-A353G7DR.js");
|
|
36
36
|
return exitCodeForError(error);
|
|
37
37
|
}
|
|
38
38
|
}
|
package/dist/safe-js/core.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import { type Module, type ParsedSourceModule } from "./parse/parser.js";
|
|
2
|
+
import { type SafeJSSnapshot, type RestoreOptions } from "./restore.js";
|
|
3
|
+
import { deepCopyFromSandbox as copyFromSandboxInternal, type SandboxPromise, type SandboxValue } from "./interp/values.js";
|
|
4
|
+
export { parse } from "./parse.js";
|
|
5
|
+
export declare const parseModule: (source: string, filename?: string) => Module;
|
|
6
|
+
export declare const parseSourceModule: (source: string, filename?: string) => ParsedSourceModule;
|
|
7
|
+
export type { ParsedSourceModule, SourceImport, SourceExport } from "./parse/module-syntax.js";
|
|
8
|
+
export declare const restore: <TSnapshot extends SafeJSSnapshot>(snapshot: TSnapshot, options: RestoreOptions) => TSnapshot;
|
|
9
|
+
type PublicCopyOptions = Omit<NonNullable<Parameters<typeof copyFromSandboxInternal>[1]>, "compilation" | "unwrapHostObject">;
|
|
10
|
+
export declare const deepCopyFromSandbox: {
|
|
11
|
+
(value: SandboxPromise, options?: PublicCopyOptions): Promise<unknown>;
|
|
12
|
+
(value: SandboxValue, options?: PublicCopyOptions): unknown;
|
|
13
|
+
};
|
|
1
14
|
export { admitNativePromiseProperties } from "./interp/native-promise-properties.js";
|
|
2
15
|
export { lint, type Diagnostic, type Fix, type LintFixResult, type LintOptions } from "./lint.js";
|
|
3
16
|
export { run } from "./run.js";
|
|
@@ -18,3 +31,9 @@ export * from "./modules/fs.js";
|
|
|
18
31
|
export * from "./modules/harness.js";
|
|
19
32
|
export * from "./modules/metric.js";
|
|
20
33
|
export * from "./modules/time.js";
|
|
34
|
+
export { makeLogModule, type LogModuleEntry, type LogModuleSink } from "./modules/log.js";
|
|
35
|
+
export { dump, type DumpOptions } from "./dump.js";
|
|
36
|
+
export { deepCopyToSandbox } from "./interp/values.js";
|
|
37
|
+
export { SandboxError } from "./interp/budget.js";
|
|
38
|
+
export { SnapshotValidationError } from "./snapshot/validation.js";
|
|
39
|
+
export { declareHostOperation } from "./interp/host-bridge.js";
|
package/dist/safe-js/core.js
CHANGED
|
@@ -1,63 +1,87 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
deepCopyFromSandbox,
|
|
3
|
+
makeTimeModule,
|
|
4
|
+
parse,
|
|
5
|
+
parseModule,
|
|
6
|
+
parseSourceModule,
|
|
7
|
+
restore
|
|
8
|
+
} from "./chunks/chunk-JMDWLOJV.js";
|
|
4
9
|
import {
|
|
5
10
|
makeHarnessModule
|
|
6
|
-
} from "./chunks/chunk-
|
|
11
|
+
} from "./chunks/chunk-6AO2T2VZ.js";
|
|
7
12
|
import {
|
|
8
13
|
EnvAccessError,
|
|
9
14
|
HarnessFailure,
|
|
10
15
|
lint,
|
|
11
16
|
makeEnvModule,
|
|
12
17
|
makeFailModule,
|
|
18
|
+
makeLogModule,
|
|
13
19
|
makeMetricModule,
|
|
14
20
|
parseEnvConfig
|
|
15
|
-
} from "./chunks/chunk-
|
|
21
|
+
} from "./chunks/chunk-RPGCF4KE.js";
|
|
22
|
+
import "./chunks/chunk-X3YCE3ZH.js";
|
|
16
23
|
import {
|
|
17
24
|
FS_OPTION_SURFACE,
|
|
18
25
|
makeFsModule
|
|
19
|
-
} from "./chunks/chunk-
|
|
26
|
+
} from "./chunks/chunk-BYDDUKS3.js";
|
|
20
27
|
import {
|
|
21
28
|
createRootedSourceResolver
|
|
22
|
-
} from "./chunks/chunk-
|
|
29
|
+
} from "./chunks/chunk-JQ5QJV5Q.js";
|
|
23
30
|
import {
|
|
24
31
|
createRealm,
|
|
25
32
|
createReplayableRandom,
|
|
26
33
|
run
|
|
27
|
-
} from "./chunks/chunk-
|
|
34
|
+
} from "./chunks/chunk-36PBWSDR.js";
|
|
28
35
|
import "./chunks/chunk-DHGJSEFX.js";
|
|
29
36
|
import "./chunks/chunk-DIG26TEI.js";
|
|
30
37
|
import "./chunks/chunk-ONWFPHUI.js";
|
|
31
|
-
import "./chunks/chunk-
|
|
32
|
-
import "./chunks/chunk-
|
|
33
|
-
import
|
|
38
|
+
import "./chunks/chunk-CVPZFRCC.js";
|
|
39
|
+
import "./chunks/chunk-MJH73KJI.js";
|
|
40
|
+
import {
|
|
41
|
+
dump
|
|
42
|
+
} from "./chunks/chunk-VLRTLEDI.js";
|
|
34
43
|
import {
|
|
44
|
+
SnapshotValidationError,
|
|
35
45
|
admitNativePromiseProperties,
|
|
46
|
+
declareHostOperation,
|
|
47
|
+
deepCopyToSandbox,
|
|
36
48
|
defineExtension
|
|
37
|
-
} from "./chunks/chunk-
|
|
49
|
+
} from "./chunks/chunk-BKNQTNHP.js";
|
|
38
50
|
import {
|
|
39
|
-
Budget
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
import "./chunks/chunk-
|
|
51
|
+
Budget,
|
|
52
|
+
SandboxError
|
|
53
|
+
} from "./chunks/chunk-EQUBWQJN.js";
|
|
54
|
+
import "./chunks/chunk-KMBCLXER.js";
|
|
55
|
+
import "./chunks/chunk-VVOPJZRG.js";
|
|
43
56
|
import "./chunks/chunk-CQ52GEHY.js";
|
|
44
57
|
export {
|
|
45
58
|
Budget,
|
|
46
59
|
EnvAccessError,
|
|
47
60
|
FS_OPTION_SURFACE,
|
|
48
61
|
HarnessFailure,
|
|
62
|
+
SandboxError,
|
|
63
|
+
SnapshotValidationError,
|
|
49
64
|
admitNativePromiseProperties,
|
|
50
65
|
createRealm,
|
|
51
66
|
createReplayableRandom,
|
|
52
67
|
createRootedSourceResolver,
|
|
68
|
+
declareHostOperation,
|
|
69
|
+
deepCopyFromSandbox,
|
|
70
|
+
deepCopyToSandbox,
|
|
53
71
|
defineExtension,
|
|
72
|
+
dump,
|
|
54
73
|
lint,
|
|
55
74
|
makeEnvModule,
|
|
56
75
|
makeFailModule,
|
|
57
76
|
makeFsModule,
|
|
58
77
|
makeHarnessModule,
|
|
78
|
+
makeLogModule,
|
|
59
79
|
makeMetricModule,
|
|
60
80
|
makeTimeModule,
|
|
81
|
+
parse,
|
|
61
82
|
parseEnvConfig,
|
|
83
|
+
parseModule,
|
|
84
|
+
parseSourceModule,
|
|
85
|
+
restore,
|
|
62
86
|
run
|
|
63
87
|
};
|
|
@@ -8,7 +8,10 @@ export type InterpreterDiagnostic = {
|
|
|
8
8
|
export type FormatErrorOptions = {
|
|
9
9
|
filename?: string;
|
|
10
10
|
hostCallName?: string;
|
|
11
|
+
/** Maximum message characters; omitted or Infinity preserves the full message. */
|
|
11
12
|
maxMessageLength?: number;
|
|
13
|
+
/** Maximum cause-chain entries; omitted or Infinity preserves every non-circular cause. */
|
|
14
|
+
maxCauseDepth?: number;
|
|
12
15
|
source?: string;
|
|
13
16
|
};
|
|
14
17
|
export declare function formatInterpreterError(source: string, error: InterpreterDiagnostic): string;
|
package/dist/safe-js/index.d.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
export { admitNativePromiseProperties } from "./interp/native-promise-properties.js";
|
|
2
|
-
|
|
3
|
-
import { type SafeJSSnapshot, type RestoreOptions } from "./restore.js";
|
|
4
|
-
import { deepCopyFromSandbox as copyFromSandboxInternal, type SandboxPromise, type SandboxValue } from "./interp/values.js";
|
|
5
|
-
export { parse } from "./parse.js";
|
|
6
|
-
export declare const parseModule: (source: string, filename?: string) => Module;
|
|
7
|
-
export declare const parseSourceModule: (source: string, filename?: string) => ParsedSourceModule;
|
|
2
|
+
export { parse, parseModule, parseSourceModule, restore, deepCopyFromSandbox } from "./core.js";
|
|
8
3
|
export type { ParsedSourceModule, SourceImport, SourceExport } from "./parse/module-syntax.js";
|
|
9
|
-
export declare const restore: <TSnapshot extends SafeJSSnapshot>(snapshot: TSnapshot, options: RestoreOptions) => TSnapshot;
|
|
10
|
-
type PublicCopyOptions = Omit<NonNullable<Parameters<typeof copyFromSandboxInternal>[1]>, "compilation" | "unwrapHostObject">;
|
|
11
|
-
export declare const deepCopyFromSandbox: {
|
|
12
|
-
(value: SandboxPromise, options?: PublicCopyOptions): Promise<unknown>;
|
|
13
|
-
(value: SandboxValue, options?: PublicCopyOptions): unknown;
|
|
14
|
-
};
|
|
15
4
|
export { lint, type Diagnostic, type Fix, type LintFixResult, type LintOptions } from "./lint.js";
|
|
16
5
|
export { run } from "./run.js";
|
|
17
6
|
export type { RunPromise } from "./run.js";
|
package/dist/safe-js/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
inspectSnapshotMigration,
|
|
3
3
|
migrateSnapshot,
|
|
4
4
|
migrateSnapshotFile
|
|
5
|
-
} from "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-SIR35W6T.js";
|
|
6
6
|
import {
|
|
7
7
|
createLintModulesFromRuntimeRegistry
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-SMGNJNDU.js";
|
|
9
9
|
import {
|
|
10
10
|
makeMcpModule
|
|
11
|
-
} from "./chunks/chunk-
|
|
11
|
+
} from "./chunks/chunk-P66QKVQC.js";
|
|
12
12
|
import {
|
|
13
13
|
AgentSpawnError,
|
|
14
14
|
SPAWN_MODES,
|
|
@@ -17,44 +17,49 @@ import {
|
|
|
17
17
|
extractBlock,
|
|
18
18
|
formatInterpreterError,
|
|
19
19
|
makeAgentModule,
|
|
20
|
-
makeLogModule,
|
|
21
20
|
maskSource,
|
|
22
21
|
parseFsConfig,
|
|
23
22
|
resolveFsConfig,
|
|
24
23
|
runWithSpawnUsageAccumulator,
|
|
25
24
|
splitFrontmatter,
|
|
26
25
|
supportsSpawnMode
|
|
27
|
-
} from "./chunks/chunk-
|
|
26
|
+
} from "./chunks/chunk-ECMGBHAB.js";
|
|
28
27
|
import {
|
|
29
28
|
parseMcpConfig
|
|
30
|
-
} from "./chunks/chunk-
|
|
29
|
+
} from "./chunks/chunk-CKOGIOB3.js";
|
|
31
30
|
import {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
deepCopyFromSandbox,
|
|
32
|
+
makeTimeModule,
|
|
33
|
+
parse,
|
|
34
|
+
parseModule as parseModule2,
|
|
35
|
+
parseSourceModule,
|
|
36
|
+
restore
|
|
37
|
+
} from "./chunks/chunk-JMDWLOJV.js";
|
|
34
38
|
import {
|
|
35
39
|
makeHarnessModule
|
|
36
|
-
} from "./chunks/chunk-
|
|
40
|
+
} from "./chunks/chunk-6AO2T2VZ.js";
|
|
37
41
|
import {
|
|
38
42
|
EnvAccessError,
|
|
39
43
|
lint,
|
|
40
44
|
makeEnvModule,
|
|
41
45
|
makeFailModule,
|
|
46
|
+
makeLogModule,
|
|
42
47
|
makeMetricModule,
|
|
43
48
|
parseEnvConfig
|
|
44
|
-
} from "./chunks/chunk-
|
|
49
|
+
} from "./chunks/chunk-RPGCF4KE.js";
|
|
45
50
|
import "./chunks/chunk-X3YCE3ZH.js";
|
|
46
51
|
import {
|
|
47
52
|
makeFsModule
|
|
48
|
-
} from "./chunks/chunk-
|
|
53
|
+
} from "./chunks/chunk-BYDDUKS3.js";
|
|
49
54
|
import {
|
|
50
55
|
createRootedSourceResolver
|
|
51
|
-
} from "./chunks/chunk-
|
|
56
|
+
} from "./chunks/chunk-JQ5QJV5Q.js";
|
|
52
57
|
import {
|
|
53
58
|
FileSnapshotBackend,
|
|
54
59
|
createRealm,
|
|
55
60
|
createReplayableRandom,
|
|
56
61
|
run
|
|
57
|
-
} from "./chunks/chunk-
|
|
62
|
+
} from "./chunks/chunk-36PBWSDR.js";
|
|
58
63
|
import "./chunks/chunk-DHGJSEFX.js";
|
|
59
64
|
import {
|
|
60
65
|
fsCodec
|
|
@@ -62,43 +67,35 @@ import {
|
|
|
62
67
|
import {
|
|
63
68
|
hasOwnErrorCode
|
|
64
69
|
} from "./chunks/chunk-ONWFPHUI.js";
|
|
65
|
-
import
|
|
66
|
-
|
|
67
|
-
} from "./chunks/chunk-D36FRVNN.js";
|
|
68
|
-
import "./chunks/chunk-WRGATIKL.js";
|
|
70
|
+
import "./chunks/chunk-CVPZFRCC.js";
|
|
71
|
+
import "./chunks/chunk-MJH73KJI.js";
|
|
69
72
|
import {
|
|
70
73
|
dump
|
|
71
|
-
} from "./chunks/chunk-
|
|
74
|
+
} from "./chunks/chunk-VLRTLEDI.js";
|
|
72
75
|
import {
|
|
73
76
|
HostCallResumabilityError,
|
|
74
77
|
HostOperationResumePolicyError,
|
|
75
78
|
SnapshotValidationError,
|
|
76
79
|
admitNativePromiseProperties,
|
|
77
80
|
declareHostOperation,
|
|
78
|
-
deepCopyFromSandbox,
|
|
79
81
|
deepCopyToSandbox,
|
|
80
82
|
defineExtension,
|
|
81
83
|
registerPendingHostCallPolicy
|
|
82
|
-
} from "./chunks/chunk-
|
|
84
|
+
} from "./chunks/chunk-BKNQTNHP.js";
|
|
83
85
|
import {
|
|
84
86
|
Budget,
|
|
85
87
|
SandboxError,
|
|
86
88
|
noopOtelSink,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
parseSourceModule
|
|
90
|
-
} from "./chunks/chunk-A3LXCGMJ.js";
|
|
89
|
+
parseModule
|
|
90
|
+
} from "./chunks/chunk-EQUBWQJN.js";
|
|
91
91
|
import {
|
|
92
92
|
extname
|
|
93
|
-
} from "./chunks/chunk-
|
|
93
|
+
} from "./chunks/chunk-KMBCLXER.js";
|
|
94
94
|
import {
|
|
95
95
|
hostFs
|
|
96
|
-
} from "./chunks/chunk-
|
|
96
|
+
} from "./chunks/chunk-VVOPJZRG.js";
|
|
97
97
|
import "./chunks/chunk-CQ52GEHY.js";
|
|
98
98
|
|
|
99
|
-
// packages/safe-js/src/parse.ts
|
|
100
|
-
var parse2 = parse;
|
|
101
|
-
|
|
102
99
|
// packages/safe-js/src/runner/run-harness.ts
|
|
103
100
|
import { createFsBridge } from "@poe-platform/safe-fs/core";
|
|
104
101
|
function getOwnEntry(record, key) {
|
|
@@ -371,12 +368,6 @@ function findExportedConstInitializer(module, name) {
|
|
|
371
368
|
}
|
|
372
369
|
return void 0;
|
|
373
370
|
}
|
|
374
|
-
|
|
375
|
-
// packages/safe-js/src/index.ts
|
|
376
|
-
var parseModule2 = parseModule;
|
|
377
|
-
var parseSourceModule2 = parseSourceModule;
|
|
378
|
-
var restore2 = restore;
|
|
379
|
-
var deepCopyFromSandbox2 = deepCopyFromSandbox;
|
|
380
371
|
export {
|
|
381
372
|
AgentSpawnError,
|
|
382
373
|
Budget,
|
|
@@ -392,7 +383,7 @@ export {
|
|
|
392
383
|
createRootedSourceResolver,
|
|
393
384
|
createSpawnUsageAccumulator,
|
|
394
385
|
declareHostOperation,
|
|
395
|
-
|
|
386
|
+
deepCopyFromSandbox,
|
|
396
387
|
deepCopyToSandbox,
|
|
397
388
|
defineExtension,
|
|
398
389
|
dump,
|
|
@@ -413,15 +404,15 @@ export {
|
|
|
413
404
|
migrateSnapshot,
|
|
414
405
|
migrateSnapshotFile,
|
|
415
406
|
noopOtelSink,
|
|
416
|
-
|
|
407
|
+
parse,
|
|
417
408
|
parseEnvConfig,
|
|
418
409
|
parseFsConfig,
|
|
419
410
|
parseMcpConfig,
|
|
420
411
|
parseModule2 as parseModule,
|
|
421
|
-
|
|
412
|
+
parseSourceModule,
|
|
422
413
|
registerPendingHostCallPolicy,
|
|
423
414
|
resolveFsConfig,
|
|
424
|
-
|
|
415
|
+
restore,
|
|
425
416
|
run,
|
|
426
417
|
runHarness,
|
|
427
418
|
runHarnessPair,
|
|
@@ -74,9 +74,7 @@ export type InterpretOptions = {
|
|
|
74
74
|
};
|
|
75
75
|
snapshot?: InterpreterSnapshot;
|
|
76
76
|
};
|
|
77
|
-
type EvaluationContext = AsyncEvaluationContext
|
|
78
|
-
deferDataScans?: boolean;
|
|
79
|
-
};
|
|
77
|
+
type EvaluationContext = AsyncEvaluationContext;
|
|
80
78
|
type EvaluationResult = AsyncEvaluationResult;
|
|
81
79
|
export declare function interpret(node: ParseResult, options?: InterpretOptions): Promise<InterpreterResult>;
|
|
82
80
|
export { Scope } from "./scope.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FS_OPTION_SURFACE,
|
|
3
3
|
makeFsModule
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-BYDDUKS3.js";
|
|
5
5
|
import "../chunks/chunk-DIG26TEI.js";
|
|
6
6
|
import "../chunks/chunk-ONWFPHUI.js";
|
|
7
|
-
import "../chunks/chunk-
|
|
8
|
-
import "../chunks/chunk-
|
|
9
|
-
import "../chunks/chunk-
|
|
10
|
-
import "../chunks/chunk-
|
|
7
|
+
import "../chunks/chunk-BKNQTNHP.js";
|
|
8
|
+
import "../chunks/chunk-EQUBWQJN.js";
|
|
9
|
+
import "../chunks/chunk-KMBCLXER.js";
|
|
10
|
+
import "../chunks/chunk-VVOPJZRG.js";
|
|
11
11
|
import "../chunks/chunk-CQ52GEHY.js";
|
|
12
12
|
export {
|
|
13
13
|
FS_OPTION_SURFACE,
|
|
@@ -14,3 +14,4 @@ export { constants as fsConstants } from "node:fs";
|
|
|
14
14
|
export declare const hostFs: typeof nativeFsPromises;
|
|
15
15
|
export declare const hostCwd: () => string;
|
|
16
16
|
export declare const hostPlatform: NodeJS.Platform;
|
|
17
|
+
export declare const hostEnv: () => Readonly<Record<string, string | undefined>>;
|
|
@@ -8,6 +8,7 @@ export declare const accessDeniedSystemError: readonly [number, string];
|
|
|
8
8
|
export declare const yieldToHost: () => Promise<void>;
|
|
9
9
|
export declare const hostCwd: () => string;
|
|
10
10
|
export declare const hostPlatform = "workerd";
|
|
11
|
+
export declare const hostEnv: () => Readonly<Record<string, string | undefined>>;
|
|
11
12
|
export declare const fsConstants: {
|
|
12
13
|
F_OK: number;
|
|
13
14
|
R_OK: number;
|
|
@@ -25,6 +25,8 @@ export const accessDeniedSystemError = [-13, "permission denied"];
|
|
|
25
25
|
export const yieldToHost = () => new Promise(resolve => setTimeout(resolve, 0));
|
|
26
26
|
export const hostCwd = () => "/";
|
|
27
27
|
export const hostPlatform = "workerd";
|
|
28
|
+
// Worker bindings are capabilities supplied explicitly through module options.
|
|
29
|
+
export const hostEnv = () => ({});
|
|
28
30
|
export const fsConstants = { F_OK: 0, R_OK: 4, W_OK: 2, X_OK: 1, COPYFILE_EXCL: 1 };
|
|
29
31
|
export const hostFs = new Proxy({}, {
|
|
30
32
|
get() { throw new TypeError("A filesystem adapter is required on this host."); }
|