@poe-platform/safe-js 0.1.720 → 0.1.721
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 +15 -2
- package/dist/safe-js/chunks/{chunk-APKV5Y6T.js → chunk-4CX3HYRY.js} +2 -2
- package/dist/safe-js/chunks/{chunk-NJM2Q74Z.js → chunk-A4L72WXV.js} +4 -4
- package/dist/safe-js/chunks/{chunk-B2SQLK4O.js → chunk-B4M6QVUV.js} +2 -2
- package/dist/safe-js/chunks/{chunk-A7CADQAD.js → chunk-BEXRQET4.js} +3 -3
- package/dist/safe-js/chunks/{chunk-OP3H3ZDN.js → chunk-BHYBD6SY.js} +2 -2
- package/dist/safe-js/chunks/{chunk-KP6I45ET.js → chunk-DNA7BMBY.js} +192 -38
- package/dist/safe-js/chunks/{chunk-KP6I45ET.js.map → chunk-DNA7BMBY.js.map} +3 -3
- package/dist/safe-js/chunks/{chunk-U6KZ2DQ2.js → chunk-GMPZBMPA.js} +3 -3
- package/dist/safe-js/chunks/{chunk-IDQ67DY2.js → chunk-ILYJBA2D.js} +24 -3
- package/dist/safe-js/chunks/chunk-ILYJBA2D.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-NEJ44T4Y.js → chunk-IS7YUCOF.js} +2 -2
- package/dist/safe-js/chunks/{chunk-BGJXQN4A.js → chunk-JNLY7IMV.js} +4 -4
- package/dist/safe-js/chunks/{chunk-RML35GIF.js → chunk-LPBTSTDG.js} +3 -3
- package/dist/safe-js/chunks/{chunk-KK5NCR5R.js → chunk-Q7B6JIMI.js} +110 -46
- package/dist/safe-js/chunks/chunk-Q7B6JIMI.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-XMA6FOJU.js → chunk-Y4LNCDCP.js} +2 -2
- package/dist/safe-js/chunks/{cli-runtime-PO6DQDHP.js → cli-runtime-YK2WE33M.js} +13 -13
- package/dist/safe-js/chunks/{dump-TRGFSCJ7.js → dump-ATWBOZWV.js} +4 -4
- package/dist/safe-js/chunks/{fs-4T5MZW5J.js → fs-D72Y52I5.js} +4 -4
- package/dist/safe-js/chunks/harness-LUYCGWHZ.js +10 -0
- package/dist/safe-js/chunks/mcp-IWKZB2R2.js +11 -0
- package/dist/safe-js/chunks/migration-file-IXO5MLP4.js +12 -0
- package/dist/safe-js/chunks/restore-SI7HOC6C.js +13 -0
- package/dist/safe-js/chunks/run-SHI2PYR6.js +17 -0
- package/dist/safe-js/chunks/runtime-modules-OO72HTVF.js +10 -0
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +7 -7
- package/dist/safe-js/extensions.d.ts +3 -1
- package/dist/safe-js/index.js +13 -13
- package/dist/safe-js/interp/budget.d.ts +3 -0
- package/dist/safe-js/interp/scope.d.ts +4 -1
- package/dist/safe-js/interp/typed-array.d.ts +3 -0
- package/dist/safe-js/parse/dynamic-source.d.ts +1 -1
- package/dist/safe-js/parse/parser.d.ts +1 -1
- package/dist/safe-js/realm.d.ts +1 -0
- package/dist/safe-js/snapshot/guest-heap.d.ts +1 -0
- package/dist/toolcraft-design/prompts/primitives/note.d.ts +1 -1
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-IDQ67DY2.js.map +0 -7
- package/dist/safe-js/chunks/chunk-KK5NCR5R.js.map +0 -7
- package/dist/safe-js/chunks/harness-DLEQ2Z3O.js +0 -10
- package/dist/safe-js/chunks/mcp-TNVEFJ6K.js +0 -11
- package/dist/safe-js/chunks/migration-file-IDIUFLKY.js +0 -12
- package/dist/safe-js/chunks/restore-P27AUZR2.js +0 -13
- package/dist/safe-js/chunks/run-KGAEHYMV.js +0 -17
- package/dist/safe-js/chunks/runtime-modules-KICK45EE.js +0 -10
- /package/dist/safe-js/chunks/{chunk-APKV5Y6T.js.map → chunk-4CX3HYRY.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-NJM2Q74Z.js.map → chunk-A4L72WXV.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-B2SQLK4O.js.map → chunk-B4M6QVUV.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-A7CADQAD.js.map → chunk-BEXRQET4.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-OP3H3ZDN.js.map → chunk-BHYBD6SY.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-U6KZ2DQ2.js.map → chunk-GMPZBMPA.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-NEJ44T4Y.js.map → chunk-IS7YUCOF.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-BGJXQN4A.js.map → chunk-JNLY7IMV.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-RML35GIF.js.map → chunk-LPBTSTDG.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-XMA6FOJU.js.map → chunk-Y4LNCDCP.js.map} +0 -0
- /package/dist/safe-js/chunks/{cli-runtime-PO6DQDHP.js.map → cli-runtime-YK2WE33M.js.map} +0 -0
- /package/dist/safe-js/chunks/{dump-TRGFSCJ7.js.map → dump-ATWBOZWV.js.map} +0 -0
- /package/dist/safe-js/chunks/{fs-4T5MZW5J.js.map → fs-D72Y52I5.js.map} +0 -0
- /package/dist/safe-js/chunks/{harness-DLEQ2Z3O.js.map → harness-LUYCGWHZ.js.map} +0 -0
- /package/dist/safe-js/chunks/{mcp-TNVEFJ6K.js.map → mcp-IWKZB2R2.js.map} +0 -0
- /package/dist/safe-js/chunks/{migration-file-IDIUFLKY.js.map → migration-file-IXO5MLP4.js.map} +0 -0
- /package/dist/safe-js/chunks/{restore-P27AUZR2.js.map → restore-SI7HOC6C.js.map} +0 -0
- /package/dist/safe-js/chunks/{run-KGAEHYMV.js.map → run-SHI2PYR6.js.map} +0 -0
- /package/dist/safe-js/chunks/{runtime-modules-KICK45EE.js.map → runtime-modules-OO72HTVF.js.map} +0 -0
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
parseFsConfig,
|
|
13
13
|
resolveFsConfig,
|
|
14
14
|
splitFrontmatter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Y4LNCDCP.js";
|
|
16
16
|
import {
|
|
17
17
|
parseMcpConfig
|
|
18
18
|
} from "./chunk-HYD4K4HN.js";
|
|
19
19
|
import {
|
|
20
20
|
lint
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-B4M6QVUV.js";
|
|
22
22
|
import {
|
|
23
23
|
createBrokenPipeState,
|
|
24
24
|
createSafeOutputStream,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
parseModule,
|
|
35
35
|
parseSourceModule,
|
|
36
36
|
replaceErrorStack
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-ILYJBA2D.js";
|
|
38
38
|
import "./chunk-4YIDX44G.js";
|
|
39
39
|
|
|
40
40
|
// packages/safe-js/src/cli-runtime.ts
|
|
@@ -55,7 +55,7 @@ async function runCli(argv, options, usage) {
|
|
|
55
55
|
async () => {
|
|
56
56
|
try {
|
|
57
57
|
if (argv[0] === "migrate") {
|
|
58
|
-
const { migrateSnapshotFile } = await import("./migration-file-
|
|
58
|
+
const { migrateSnapshotFile } = await import("./migration-file-IXO5MLP4.js");
|
|
59
59
|
const result = await migrateSnapshotFile({
|
|
60
60
|
...parseMigrationArgs(argv.slice(1)),
|
|
61
61
|
cwd: options.cwd ?? readCurrentWorkingDirectory()
|
|
@@ -272,12 +272,12 @@ async function assertHarnessFile(input) {
|
|
|
272
272
|
}
|
|
273
273
|
async function runScriptFile(filepath, parsed, options) {
|
|
274
274
|
const [{ run }, { restore }, { dump, dumpCurrent }, { createLintModulesFromRuntimeRegistry }, { makeFsModule }, { makeMcpModule }] = await Promise.all([
|
|
275
|
-
import("./run-
|
|
276
|
-
import("./restore-
|
|
277
|
-
import("./dump-
|
|
278
|
-
import("./runtime-modules-
|
|
279
|
-
import("./fs-
|
|
280
|
-
import("./mcp-
|
|
275
|
+
import("./run-SHI2PYR6.js"),
|
|
276
|
+
import("./restore-SI7HOC6C.js"),
|
|
277
|
+
import("./dump-ATWBOZWV.js"),
|
|
278
|
+
import("./runtime-modules-OO72HTVF.js"),
|
|
279
|
+
import("./fs-D72Y52I5.js"),
|
|
280
|
+
import("./mcp-IWKZB2R2.js")
|
|
281
281
|
]);
|
|
282
282
|
const loaded = loadExecutableSource(filepath, await options.readFile(filepath, "utf8"));
|
|
283
283
|
const meta = {
|
|
@@ -513,8 +513,8 @@ async function createRuntime(frontmatter, meta, options) {
|
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
const [{ makeHarnessModule }, { makeFsModule }] = await Promise.all([
|
|
516
|
-
import("./harness-
|
|
517
|
-
import("./fs-
|
|
516
|
+
import("./harness-LUYCGWHZ.js"),
|
|
517
|
+
import("./fs-D72Y52I5.js")
|
|
518
518
|
]);
|
|
519
519
|
const state = {
|
|
520
520
|
metricCalls: /* @__PURE__ */ new Map(),
|
|
@@ -704,4 +704,4 @@ export {
|
|
|
704
704
|
exitCodeForError,
|
|
705
705
|
runCli
|
|
706
706
|
};
|
|
707
|
-
//# sourceMappingURL=cli-runtime-
|
|
707
|
+
//# sourceMappingURL=cli-runtime-YK2WE33M.js.map
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
dump,
|
|
5
5
|
dumpCurrent,
|
|
6
6
|
serializeRunSnapshot
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-BEXRQET4.js";
|
|
8
|
+
import "./chunk-DNA7BMBY.js";
|
|
9
|
+
import "./chunk-ILYJBA2D.js";
|
|
10
10
|
import "./chunk-4YIDX44G.js";
|
|
11
11
|
export {
|
|
12
12
|
attachDumpController,
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
dumpCurrent,
|
|
16
16
|
serializeRunSnapshot
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=dump-
|
|
18
|
+
//# sourceMappingURL=dump-ATWBOZWV.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FS_OPTION_SURFACE,
|
|
3
3
|
makeFsModule
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BHYBD6SY.js";
|
|
5
5
|
import "./chunk-SJZWSPWD.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-DNA7BMBY.js";
|
|
7
|
+
import "./chunk-ILYJBA2D.js";
|
|
8
8
|
import "./chunk-4YIDX44G.js";
|
|
9
9
|
export {
|
|
10
10
|
FS_OPTION_SURFACE,
|
|
11
11
|
makeFsModule
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=fs-
|
|
13
|
+
//# sourceMappingURL=fs-D72Y52I5.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeMcpModule
|
|
3
|
+
} from "./chunk-LPBTSTDG.js";
|
|
4
|
+
import "./chunk-HYD4K4HN.js";
|
|
5
|
+
import "./chunk-DNA7BMBY.js";
|
|
6
|
+
import "./chunk-ILYJBA2D.js";
|
|
7
|
+
import "./chunk-4YIDX44G.js";
|
|
8
|
+
export {
|
|
9
|
+
makeMcpModule
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=mcp-IWKZB2R2.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
migrateSnapshotFile
|
|
3
|
+
} from "./chunk-JNLY7IMV.js";
|
|
4
|
+
import "./chunk-SJZWSPWD.js";
|
|
5
|
+
import "./chunk-GMPZBMPA.js";
|
|
6
|
+
import "./chunk-DNA7BMBY.js";
|
|
7
|
+
import "./chunk-ILYJBA2D.js";
|
|
8
|
+
import "./chunk-4YIDX44G.js";
|
|
9
|
+
export {
|
|
10
|
+
migrateSnapshotFile
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=migration-file-IXO5MLP4.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SnapshotMismatchError,
|
|
3
|
+
restore
|
|
4
|
+
} from "./chunk-A4L72WXV.js";
|
|
5
|
+
import "./chunk-GMPZBMPA.js";
|
|
6
|
+
import "./chunk-DNA7BMBY.js";
|
|
7
|
+
import "./chunk-ILYJBA2D.js";
|
|
8
|
+
import "./chunk-4YIDX44G.js";
|
|
9
|
+
export {
|
|
10
|
+
SnapshotMismatchError,
|
|
11
|
+
restore
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=restore-SI7HOC6C.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UnhandledRejectionError,
|
|
3
|
+
run
|
|
4
|
+
} from "./chunk-Q7B6JIMI.js";
|
|
5
|
+
import "./chunk-U7ZNMTSQ.js";
|
|
6
|
+
import "./chunk-A4L72WXV.js";
|
|
7
|
+
import "./chunk-BEXRQET4.js";
|
|
8
|
+
import "./chunk-SJZWSPWD.js";
|
|
9
|
+
import "./chunk-GMPZBMPA.js";
|
|
10
|
+
import "./chunk-DNA7BMBY.js";
|
|
11
|
+
import "./chunk-ILYJBA2D.js";
|
|
12
|
+
import "./chunk-4YIDX44G.js";
|
|
13
|
+
export {
|
|
14
|
+
UnhandledRejectionError,
|
|
15
|
+
run
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=run-SHI2PYR6.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createLintModulesFromRuntimeRegistry
|
|
3
|
+
} from "./chunk-4CX3HYRY.js";
|
|
4
|
+
import "./chunk-DNA7BMBY.js";
|
|
5
|
+
import "./chunk-ILYJBA2D.js";
|
|
6
|
+
import "./chunk-4YIDX44G.js";
|
|
7
|
+
export {
|
|
8
|
+
createLintModulesFromRuntimeRegistry
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=runtime-modules-OO72HTVF.js.map
|
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-YK2WE33M.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-YK2WE33M.js");
|
|
36
36
|
return exitCodeForError(error);
|
|
37
37
|
}
|
|
38
38
|
}
|
package/dist/safe-js/core.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
lint
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-B4M6QVUV.js";
|
|
4
4
|
import {
|
|
5
5
|
createRealm,
|
|
6
6
|
createReplayableRandom,
|
|
7
7
|
run
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-Q7B6JIMI.js";
|
|
9
9
|
import "./chunks/chunk-U7ZNMTSQ.js";
|
|
10
|
-
import "./chunks/chunk-
|
|
11
|
-
import "./chunks/chunk-
|
|
10
|
+
import "./chunks/chunk-A4L72WXV.js";
|
|
11
|
+
import "./chunks/chunk-BEXRQET4.js";
|
|
12
12
|
import "./chunks/chunk-SJZWSPWD.js";
|
|
13
|
-
import "./chunks/chunk-
|
|
13
|
+
import "./chunks/chunk-GMPZBMPA.js";
|
|
14
14
|
import {
|
|
15
15
|
admitNativePromiseProperties,
|
|
16
16
|
defineExtension
|
|
17
|
-
} from "./chunks/chunk-
|
|
17
|
+
} from "./chunks/chunk-DNA7BMBY.js";
|
|
18
18
|
import {
|
|
19
19
|
Budget
|
|
20
|
-
} from "./chunks/chunk-
|
|
20
|
+
} from "./chunks/chunk-ILYJBA2D.js";
|
|
21
21
|
import "./chunks/chunk-4YIDX44G.js";
|
|
22
22
|
export {
|
|
23
23
|
Budget,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HostObjectDefinition, HostObject } from "./interp/host-capabilities.js";
|
|
1
|
+
import type { HostObjectDefinition, HostObject, GuestReference } from "./interp/host-capabilities.js";
|
|
2
2
|
import type { ModuleRegistry } from "./modules/registry.js";
|
|
3
3
|
import type { CallerInjectedBinding } from "./interp/host-bridge.js";
|
|
4
4
|
export type CallbackOptions = {
|
|
@@ -28,6 +28,8 @@ export type ExtensionContext = {
|
|
|
28
28
|
onCleanup(cleanup: () => void | Promise<void>): void;
|
|
29
29
|
chargeWork(units?: number): void;
|
|
30
30
|
createHostObject(definition: HostObjectDefinition): HostObject;
|
|
31
|
+
/** Explicit realm-owned live fixed buffer; default host ingress still copies. */
|
|
32
|
+
createArrayBufferReference(buffer: ArrayBuffer): GuestReference;
|
|
31
33
|
startCallback(callback: unknown, options?: CallbackOptions): CallbackInvocation;
|
|
32
34
|
invokeCallback(callback: unknown, options?: CallbackOptions): Promise<unknown>;
|
|
33
35
|
releaseCallback(callback: unknown): void;
|
package/dist/safe-js/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLintModulesFromRuntimeRegistry
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-4CX3HYRY.js";
|
|
4
4
|
import {
|
|
5
5
|
makeFsModule
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-BHYBD6SY.js";
|
|
7
7
|
import {
|
|
8
8
|
makeHarnessModule
|
|
9
|
-
} from "./chunks/chunk-
|
|
9
|
+
} from "./chunks/chunk-IS7YUCOF.js";
|
|
10
10
|
import {
|
|
11
11
|
makeMcpModule
|
|
12
|
-
} from "./chunks/chunk-
|
|
12
|
+
} from "./chunks/chunk-LPBTSTDG.js";
|
|
13
13
|
import {
|
|
14
14
|
AgentSpawnError,
|
|
15
15
|
EnvAccessError,
|
|
@@ -30,13 +30,13 @@ import {
|
|
|
30
30
|
runWithSpawnUsageAccumulator,
|
|
31
31
|
splitFrontmatter,
|
|
32
32
|
supportsSpawnMode
|
|
33
|
-
} from "./chunks/chunk-
|
|
33
|
+
} from "./chunks/chunk-Y4LNCDCP.js";
|
|
34
34
|
import {
|
|
35
35
|
parseMcpConfig
|
|
36
36
|
} from "./chunks/chunk-HYD4K4HN.js";
|
|
37
37
|
import {
|
|
38
38
|
lint
|
|
39
|
-
} from "./chunks/chunk-
|
|
39
|
+
} from "./chunks/chunk-B4M6QVUV.js";
|
|
40
40
|
import "./chunks/chunk-OZLTLIHX.js";
|
|
41
41
|
import {
|
|
42
42
|
createRootedSourceResolver
|
|
@@ -46,23 +46,23 @@ import {
|
|
|
46
46
|
createRealm,
|
|
47
47
|
createReplayableRandom,
|
|
48
48
|
run
|
|
49
|
-
} from "./chunks/chunk-
|
|
49
|
+
} from "./chunks/chunk-Q7B6JIMI.js";
|
|
50
50
|
import "./chunks/chunk-U7ZNMTSQ.js";
|
|
51
51
|
import {
|
|
52
52
|
restore
|
|
53
|
-
} from "./chunks/chunk-
|
|
53
|
+
} from "./chunks/chunk-A4L72WXV.js";
|
|
54
54
|
import {
|
|
55
55
|
dump
|
|
56
|
-
} from "./chunks/chunk-
|
|
56
|
+
} from "./chunks/chunk-BEXRQET4.js";
|
|
57
57
|
import {
|
|
58
58
|
inspectSnapshotMigration,
|
|
59
59
|
migrateSnapshot,
|
|
60
60
|
migrateSnapshotFile
|
|
61
|
-
} from "./chunks/chunk-
|
|
61
|
+
} from "./chunks/chunk-JNLY7IMV.js";
|
|
62
62
|
import {
|
|
63
63
|
hasOwnErrorCode
|
|
64
64
|
} from "./chunks/chunk-SJZWSPWD.js";
|
|
65
|
-
import "./chunks/chunk-
|
|
65
|
+
import "./chunks/chunk-GMPZBMPA.js";
|
|
66
66
|
import {
|
|
67
67
|
HostCallResumabilityError,
|
|
68
68
|
HostOperationResumePolicyError,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
deepCopyToSandbox,
|
|
75
75
|
defineExtension,
|
|
76
76
|
registerPendingHostCallPolicy
|
|
77
|
-
} from "./chunks/chunk-
|
|
77
|
+
} from "./chunks/chunk-DNA7BMBY.js";
|
|
78
78
|
import {
|
|
79
79
|
Budget,
|
|
80
80
|
SandboxError,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
parse,
|
|
83
83
|
parseModule,
|
|
84
84
|
parseSourceModule
|
|
85
|
-
} from "./chunks/chunk-
|
|
85
|
+
} from "./chunks/chunk-ILYJBA2D.js";
|
|
86
86
|
import "./chunks/chunk-4YIDX44G.js";
|
|
87
87
|
|
|
88
88
|
// packages/safe-js/src/parse.ts
|
|
@@ -44,6 +44,8 @@ export type CompileTicket = {
|
|
|
44
44
|
};
|
|
45
45
|
export declare class Budget {
|
|
46
46
|
private accounting;
|
|
47
|
+
private realmView;
|
|
48
|
+
private realmLease;
|
|
47
49
|
constructor(options?: BudgetOptions);
|
|
48
50
|
get deadline(): number | undefined;
|
|
49
51
|
get limits(): Readonly<BudgetLimits>;
|
|
@@ -58,6 +60,7 @@ export declare class Budget {
|
|
|
58
60
|
get currentCallDepth(): number;
|
|
59
61
|
set currentCallDepth(value: number);
|
|
60
62
|
forkRealm(): Budget;
|
|
63
|
+
acquireRealmOwner(): ReturnType<Budget["acquireCompileOwner"]>;
|
|
61
64
|
visitNode(units?: number): void;
|
|
62
65
|
allocateString(value: string): string;
|
|
63
66
|
allocateArrayLength(length: number): void;
|
|
@@ -25,6 +25,7 @@ export type BindingReference = {
|
|
|
25
25
|
name: string;
|
|
26
26
|
object: SandboxObject;
|
|
27
27
|
withEnvironment: boolean;
|
|
28
|
+
globalEnvironment?: Scope;
|
|
28
29
|
};
|
|
29
30
|
export type BindingOperations = {
|
|
30
31
|
has(object: SandboxObject, name: string): boolean | Promise<boolean>;
|
|
@@ -39,6 +40,7 @@ type ScopeOptions = {
|
|
|
39
40
|
export type ScopeFrame = {
|
|
40
41
|
simpleCatchParameter?: string;
|
|
41
42
|
globalEnvironment?: boolean;
|
|
43
|
+
globalVarNames?: string[];
|
|
42
44
|
moduleEnvironment?: ModuleEnvironment;
|
|
43
45
|
objectEnvironment?: SandboxObject;
|
|
44
46
|
withObject?: SandboxObject;
|
|
@@ -75,7 +77,7 @@ export declare class Scope {
|
|
|
75
77
|
constructor(bindings?: Record<string, InterpreterValue>, parent?: Scope | undefined, importMeta?: InterpreterValue, options?: ScopeOptions, restoredBindings?: Record<string, InterpreterValue>);
|
|
76
78
|
child(bindings?: Record<string, InterpreterValue>, options?: ScopeOptions): Scope;
|
|
77
79
|
withObject(object: SandboxObject): Scope;
|
|
78
|
-
resolveBinding(name: string, operations: BindingOperations): BindingReference | Promise<BindingReference>;
|
|
80
|
+
resolveBinding(name: string, operations: BindingOperations, globalEnvironment?: Scope): BindingReference | Promise<BindingReference>;
|
|
79
81
|
private resolveObjectBinding;
|
|
80
82
|
declarePrivateName(description: string): PrivateName;
|
|
81
83
|
resolvePrivateName(description: string): PrivateName;
|
|
@@ -88,6 +90,7 @@ export declare class Scope {
|
|
|
88
90
|
};
|
|
89
91
|
hasOwnBinding(name: string): boolean;
|
|
90
92
|
deleteBinding(name: string): boolean;
|
|
93
|
+
deleteGlobalBinding(name: string): boolean;
|
|
91
94
|
getOwnBindingKind(name: string): VariableDeclarationKind | undefined;
|
|
92
95
|
isFunctionBoundary(): boolean;
|
|
93
96
|
iterationChild(names: readonly string[]): Scope;
|
|
@@ -5,6 +5,8 @@ export declare const typedArrayViewLayouts: WeakMap<NumericTypedArray, {
|
|
|
5
5
|
byteOffset: number;
|
|
6
6
|
length?: number;
|
|
7
7
|
}>;
|
|
8
|
+
export declare function createOwnedTypedArray(Native: NumericTypedArrayConstructor, args: unknown[]): NumericTypedArray;
|
|
9
|
+
export declare function nativeTypedArrayView<T extends object>(value: T): T;
|
|
8
10
|
export declare function restoreTypedArrayView(buffer: ArrayBufferLike, byteOffset: number, length?: number, budget?: Budget, Native?: NumericTypedArrayConstructor): NumericTypedArray;
|
|
9
11
|
export declare function isNumericTypedArray(value: unknown): value is NumericTypedArray;
|
|
10
12
|
export declare function typedArrayStorage(value: NumericTypedArray, requireInBounds?: boolean): {
|
|
@@ -16,6 +18,7 @@ export declare function typedArrayStorage(value: NumericTypedArray, requireInBou
|
|
|
16
18
|
elementSize: number;
|
|
17
19
|
};
|
|
18
20
|
export declare function typedArrayProperties(value: NumericTypedArray): Array<[PropertyKey, PropertyDescriptor]>;
|
|
21
|
+
export declare function typedArraySymbolKeys(value: NumericTypedArray): symbol[];
|
|
19
22
|
export declare function typedArrayDataProperties(value: NumericTypedArray): Array<[string, PropertyDescriptor]>;
|
|
20
23
|
export declare function isTypedArrayIndex(key: string): boolean;
|
|
21
24
|
export declare function typedArrayNumber(value: unknown): number;
|
|
@@ -23,7 +23,7 @@ export declare function createDynamicSource(kind: DynamicFunctionKind, parameter
|
|
|
23
23
|
};
|
|
24
24
|
export declare function createEvalSource(body: string, context: Omit<EvalParseContext, "privateNames"> & {
|
|
25
25
|
privateNames?: Iterable<string>;
|
|
26
|
-
}, owner?: CompileOwner): {
|
|
26
|
+
}, owner?: CompileOwner, filename?: string): {
|
|
27
27
|
source: {
|
|
28
28
|
body: string;
|
|
29
29
|
nodes: Map<number, ParseResult>;
|
|
@@ -431,7 +431,7 @@ export type EvalParseContext = {
|
|
|
431
431
|
arguments?: boolean;
|
|
432
432
|
privateNames?: ReadonlySet<string>;
|
|
433
433
|
};
|
|
434
|
-
export declare function parseEvalScript(source: string, context?: EvalParseContext, owner?: CompileOwner): {
|
|
434
|
+
export declare function parseEvalScript(source: string, context?: EvalParseContext, owner?: CompileOwner, filename?: string): {
|
|
435
435
|
node: Module;
|
|
436
436
|
strict: boolean;
|
|
437
437
|
};
|
package/dist/safe-js/realm.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function note(message: string, title?: string): void;
|
|
1
|
+
export declare function note(message: string, title?: string, write?: (chunk: string) => void): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.721",
|
|
4
4
|
"description": "Budgeted JavaScript interpreter with explicit host capabilities and resumable execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@poe-platform/safe-fs": "0.1.
|
|
61
|
+
"@poe-platform/safe-fs": "0.1.721",
|
|
62
62
|
"@petamoriken/float16": "^3.9.3",
|
|
63
63
|
"@formatjs/intl-localematcher": "0.8.13",
|
|
64
64
|
"@formatjs/bigdecimal": "0.2.7",
|