@poe-platform/safe-js 0.1.743 → 0.1.745
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 -3
- package/dist/safe-js/chunks/{chunk-F6CV74HU.js → chunk-3NFTBEZR.js} +2 -3
- package/dist/safe-js/chunks/{chunk-LMS5SSTN.js → chunk-5WP5IRMP.js} +437 -388
- package/dist/safe-js/chunks/{chunk-47JWFV2B.js → chunk-6UP3B5TB.js} +7 -8
- package/dist/safe-js/chunks/{chunk-24Z6PSCN.js → chunk-6ZVFR4HR.js} +1 -2
- package/dist/safe-js/chunks/{chunk-J3CUCOMP.js → chunk-AB6ERQE5.js} +14798 -14210
- package/dist/safe-js/chunks/{chunk-4YIDX44G.js → chunk-CQ52GEHY.js} +0 -1
- package/dist/safe-js/chunks/chunk-DHGJSEFX.js +0 -0
- package/dist/safe-js/chunks/{chunk-GVKXZW53.js → chunk-DIG26TEI.js} +0 -1
- package/dist/safe-js/chunks/{chunk-JCVARKWT.js → chunk-DIMBVKHT.js} +6 -7
- package/dist/safe-js/chunks/{chunk-UQPYTZOZ.js → chunk-JCHJGIQA.js} +0 -1
- package/dist/safe-js/chunks/{chunk-IRYOK5BR.js → chunk-L265M6OS.js} +2 -3
- package/dist/safe-js/chunks/{chunk-3ITVV2R6.js → chunk-L3MIVH3T.js} +1 -2
- package/dist/safe-js/chunks/{chunk-AUVGHYM5.js → chunk-LRINZRJA.js} +2 -3
- package/dist/safe-js/chunks/{chunk-UIUJHTWG.js → chunk-MKY3MQUB.js} +3 -4
- package/dist/safe-js/chunks/{chunk-YDVEVDVT.js → chunk-MLJ4BKDX.js} +102 -20
- package/dist/safe-js/chunks/{chunk-YUQFFRUF.js → chunk-MMN3IESA.js} +1 -2
- package/dist/safe-js/chunks/{chunk-WEGFNME4.js → chunk-O3S3JVWS.js} +1 -2
- package/dist/safe-js/chunks/{chunk-2GVBG23M.js → chunk-ONWFPHUI.js} +0 -1
- package/dist/safe-js/chunks/chunk-OQYVEDRN.js +66 -0
- package/dist/safe-js/chunks/{chunk-EMH7CXQM.js → chunk-POEMWNHD.js} +1 -2
- package/dist/safe-js/chunks/{chunk-G6WTEIJJ.js → chunk-X3YCE3ZH.js} +1 -2
- package/dist/safe-js/chunks/{chunk-WWETRQCF.js → chunk-YYF5R6ML.js} +3 -4
- package/dist/safe-js/chunks/{cli-runtime-3SOHLG5M.js → cli-runtime-BGB24HNE.js} +19 -20
- package/dist/safe-js/chunks/{dump-CSLHITIE.js → dump-M7CMVXW7.js} +5 -6
- package/dist/safe-js/chunks/harness-4CPQ7WKS.js +10 -0
- package/dist/safe-js/chunks/mcp-7SNWIP5H.js +11 -0
- package/dist/safe-js/chunks/migration-file-CPBVNMLD.js +14 -0
- package/dist/safe-js/chunks/restore-FLH6OC5F.js +13 -0
- package/dist/safe-js/chunks/run-KFAD7GTT.js +19 -0
- package/dist/safe-js/chunks/runtime-modules-D6NO4KJW.js +10 -0
- package/dist/safe-js/chunks/source-files-BSDM22Y2.js +9 -0
- package/dist/safe-js/cli.js +5 -6
- package/dist/safe-js/core.d.ts +1 -1
- package/dist/safe-js/core.js +14 -15
- package/dist/safe-js/extensions.d.ts +17 -0
- package/dist/safe-js/index.d.ts +2 -2
- package/dist/safe-js/index.js +22 -23
- package/dist/safe-js/interp/arguments.d.ts +2 -0
- package/dist/safe-js/interp/collection-properties.d.ts +2 -0
- package/dist/safe-js/interp/data-copy.d.ts +2 -0
- package/dist/safe-js/interp/host-bridge.d.ts +5 -0
- package/dist/safe-js/interp/host-capabilities.d.ts +5 -0
- package/dist/safe-js/interp/internal-symbols.d.ts +1 -0
- package/dist/safe-js/interp/interpreter.d.ts +3 -1
- package/dist/safe-js/interp/regex/compile-guard.d.ts +6 -4
- package/dist/safe-js/interp/template-cache.d.ts +5 -0
- package/dist/safe-js/interp/values.d.ts +11 -0
- package/dist/safe-js/modules/fs.d.ts +4 -3
- package/dist/safe-js/modules/fs.js +8 -9
- package/dist/safe-js/platform/context.d.ts +14 -0
- package/dist/safe-js/platform/node.d.ts +16 -0
- package/dist/safe-js/platform/types.d.ts +18 -0
- package/dist/safe-js/platform/workerd.d.ts +21 -0
- package/dist/safe-js/restore.d.ts +1 -1
- package/dist/safe-js/snapshot/validation.d.ts +2 -1
- package/package.json +5 -5
- package/dist/safe-js/chunks/chunk-24Z6PSCN.js.map +0 -7
- package/dist/safe-js/chunks/chunk-2GVBG23M.js.map +0 -7
- package/dist/safe-js/chunks/chunk-3ITVV2R6.js.map +0 -7
- package/dist/safe-js/chunks/chunk-47JWFV2B.js.map +0 -7
- package/dist/safe-js/chunks/chunk-4YIDX44G.js.map +0 -7
- package/dist/safe-js/chunks/chunk-AUVGHYM5.js.map +0 -7
- package/dist/safe-js/chunks/chunk-EMH7CXQM.js.map +0 -7
- package/dist/safe-js/chunks/chunk-F6CV74HU.js.map +0 -7
- package/dist/safe-js/chunks/chunk-G6WTEIJJ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-GVKXZW53.js.map +0 -7
- package/dist/safe-js/chunks/chunk-IRYOK5BR.js.map +0 -7
- package/dist/safe-js/chunks/chunk-J3CUCOMP.js.map +0 -7
- package/dist/safe-js/chunks/chunk-JCVARKWT.js.map +0 -7
- package/dist/safe-js/chunks/chunk-LMS5SSTN.js.map +0 -7
- package/dist/safe-js/chunks/chunk-U7ZNMTSQ.js +0 -1
- package/dist/safe-js/chunks/chunk-U7ZNMTSQ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-UIUJHTWG.js.map +0 -7
- package/dist/safe-js/chunks/chunk-UQPYTZOZ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-V72WS373.js +0 -128
- package/dist/safe-js/chunks/chunk-V72WS373.js.map +0 -7
- package/dist/safe-js/chunks/chunk-WEGFNME4.js.map +0 -7
- package/dist/safe-js/chunks/chunk-WWETRQCF.js.map +0 -7
- package/dist/safe-js/chunks/chunk-YDVEVDVT.js.map +0 -7
- package/dist/safe-js/chunks/chunk-YUQFFRUF.js.map +0 -7
- package/dist/safe-js/chunks/cli-runtime-3SOHLG5M.js.map +0 -7
- package/dist/safe-js/chunks/dump-CSLHITIE.js.map +0 -7
- package/dist/safe-js/chunks/harness-QKPVLVOT.js +0 -11
- package/dist/safe-js/chunks/harness-QKPVLVOT.js.map +0 -7
- package/dist/safe-js/chunks/mcp-A4YKQCIS.js +0 -12
- package/dist/safe-js/chunks/mcp-A4YKQCIS.js.map +0 -7
- package/dist/safe-js/chunks/migration-file-QCZTVXEU.js +0 -15
- package/dist/safe-js/chunks/migration-file-QCZTVXEU.js.map +0 -7
- package/dist/safe-js/chunks/restore-22OGYS6N.js +0 -14
- package/dist/safe-js/chunks/restore-22OGYS6N.js.map +0 -7
- package/dist/safe-js/chunks/run-EMFOFJ22.js +0 -20
- package/dist/safe-js/chunks/run-EMFOFJ22.js.map +0 -7
- package/dist/safe-js/chunks/runtime-modules-QCVDLUVF.js +0 -11
- package/dist/safe-js/chunks/runtime-modules-QCVDLUVF.js.map +0 -7
- package/dist/safe-js/chunks/source-files-L3SGK63Z.js +0 -10
- package/dist/safe-js/chunks/source-files-L3SGK63Z.js.map +0 -7
- package/dist/safe-js/cli.js.map +0 -7
- package/dist/safe-js/core.js.map +0 -7
- package/dist/safe-js/index.js.map +0 -7
- package/dist/safe-js/modules/fs.js.map +0 -7
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
dump,
|
|
5
5
|
dumpCurrent,
|
|
6
6
|
serializeRunSnapshot
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-L265M6OS.js";
|
|
8
|
+
import "./chunk-AB6ERQE5.js";
|
|
9
|
+
import "./chunk-5WP5IRMP.js";
|
|
10
|
+
import "./chunk-JCHJGIQA.js";
|
|
11
|
+
import "./chunk-CQ52GEHY.js";
|
|
12
12
|
export {
|
|
13
13
|
attachDumpController,
|
|
14
14
|
createDumpController,
|
|
@@ -16,4 +16,3 @@ export {
|
|
|
16
16
|
dumpCurrent,
|
|
17
17
|
serializeRunSnapshot
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=dump-CSLHITIE.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
migrateSnapshotFile
|
|
3
|
+
} from "./chunk-6UP3B5TB.js";
|
|
4
|
+
import "./chunk-DIG26TEI.js";
|
|
5
|
+
import "./chunk-ONWFPHUI.js";
|
|
6
|
+
import "./chunk-LRINZRJA.js";
|
|
7
|
+
import "./chunk-AB6ERQE5.js";
|
|
8
|
+
import "./chunk-5WP5IRMP.js";
|
|
9
|
+
import "./chunk-MMN3IESA.js";
|
|
10
|
+
import "./chunk-JCHJGIQA.js";
|
|
11
|
+
import "./chunk-CQ52GEHY.js";
|
|
12
|
+
export {
|
|
13
|
+
migrateSnapshotFile
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SnapshotMismatchError,
|
|
3
|
+
restore
|
|
4
|
+
} from "./chunk-OQYVEDRN.js";
|
|
5
|
+
import "./chunk-LRINZRJA.js";
|
|
6
|
+
import "./chunk-AB6ERQE5.js";
|
|
7
|
+
import "./chunk-5WP5IRMP.js";
|
|
8
|
+
import "./chunk-JCHJGIQA.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-MLJ4BKDX.js";
|
|
5
|
+
import "./chunk-DHGJSEFX.js";
|
|
6
|
+
import "./chunk-DIG26TEI.js";
|
|
7
|
+
import "./chunk-ONWFPHUI.js";
|
|
8
|
+
import "./chunk-OQYVEDRN.js";
|
|
9
|
+
import "./chunk-LRINZRJA.js";
|
|
10
|
+
import "./chunk-L265M6OS.js";
|
|
11
|
+
import "./chunk-AB6ERQE5.js";
|
|
12
|
+
import "./chunk-5WP5IRMP.js";
|
|
13
|
+
import "./chunk-MMN3IESA.js";
|
|
14
|
+
import "./chunk-JCHJGIQA.js";
|
|
15
|
+
import "./chunk-CQ52GEHY.js";
|
|
16
|
+
export {
|
|
17
|
+
UnhandledRejectionError,
|
|
18
|
+
run
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createLintModulesFromRuntimeRegistry
|
|
3
|
+
} from "./chunk-O3S3JVWS.js";
|
|
4
|
+
import "./chunk-AB6ERQE5.js";
|
|
5
|
+
import "./chunk-5WP5IRMP.js";
|
|
6
|
+
import "./chunk-JCHJGIQA.js";
|
|
7
|
+
import "./chunk-CQ52GEHY.js";
|
|
8
|
+
export {
|
|
9
|
+
createLintModulesFromRuntimeRegistry
|
|
10
|
+
};
|
package/dist/safe-js/cli.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
createBrokenPipeState,
|
|
4
4
|
createSafeOutputStream,
|
|
5
5
|
withBrokenPipeGuard
|
|
6
|
-
} from "./chunks/chunk-
|
|
7
|
-
import "./chunks/chunk-
|
|
8
|
-
import "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-X3YCE3ZH.js";
|
|
7
|
+
import "./chunks/chunk-ONWFPHUI.js";
|
|
8
|
+
import "./chunks/chunk-CQ52GEHY.js";
|
|
9
9
|
|
|
10
10
|
// packages/safe-js/src/cli.ts
|
|
11
11
|
import { realpath } from "node:fs/promises";
|
|
@@ -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-BGB24HNE.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-BGB24HNE.js");
|
|
36
36
|
return exitCodeForError(error);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -92,4 +92,3 @@ if (await isDirectExecution(process.argv[1])) {
|
|
|
92
92
|
export {
|
|
93
93
|
runCli
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/safe-js/core.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { run } from "./run.js";
|
|
|
4
4
|
export type { RunPromise } from "./run.js";
|
|
5
5
|
export type { ExecutionControl } from "./interp/jobs.js";
|
|
6
6
|
export { createRealm, type SafeJSRealm, type RealmOptions, type RealmResult, type RealmLimits } from "./realm.js";
|
|
7
|
-
export { defineExtension, type SafeJSExtension, type ExtensionDefinition, type ExtensionManifest, type ExtensionContext, type ExtensionExports, type CallbackOptions, type CallbackInvocation } from "./extensions.js";
|
|
7
|
+
export { defineExtension, type SafeJSExtension, type ExtensionDefinition, type ExtensionManifest, type ExtensionContext, type HostConstructorOptions, type ExtensionExports, type CallbackOptions, type CallbackInvocation } from "./extensions.js";
|
|
8
8
|
export type { HostObject, HostObjectDefinition, HostObjectIndexedDefinition, HostObjectNamedDefinition, GuestReference } from "./interp/host-capabilities.js";
|
|
9
9
|
export { createReplayableRandom, type ReplayableRandom } from "./random.js";
|
|
10
10
|
export type { RunClock, RunClockSnapshot, RunRandom } from "./run.js";
|
package/dist/safe-js/core.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
lint
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-POEMWNHD.js";
|
|
4
4
|
import {
|
|
5
5
|
createRootedSourceResolver
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-3NFTBEZR.js";
|
|
7
7
|
import {
|
|
8
8
|
createRealm,
|
|
9
9
|
createReplayableRandom,
|
|
10
10
|
run
|
|
11
|
-
} from "./chunks/chunk-
|
|
12
|
-
import "./chunks/chunk-
|
|
13
|
-
import "./chunks/chunk-
|
|
14
|
-
import "./chunks/chunk-
|
|
15
|
-
import "./chunks/chunk-
|
|
16
|
-
import "./chunks/chunk-
|
|
17
|
-
import "./chunks/chunk-
|
|
11
|
+
} from "./chunks/chunk-MLJ4BKDX.js";
|
|
12
|
+
import "./chunks/chunk-DHGJSEFX.js";
|
|
13
|
+
import "./chunks/chunk-DIG26TEI.js";
|
|
14
|
+
import "./chunks/chunk-ONWFPHUI.js";
|
|
15
|
+
import "./chunks/chunk-OQYVEDRN.js";
|
|
16
|
+
import "./chunks/chunk-LRINZRJA.js";
|
|
17
|
+
import "./chunks/chunk-L265M6OS.js";
|
|
18
18
|
import {
|
|
19
19
|
admitNativePromiseProperties,
|
|
20
20
|
defineExtension
|
|
21
|
-
} from "./chunks/chunk-
|
|
21
|
+
} from "./chunks/chunk-AB6ERQE5.js";
|
|
22
22
|
import {
|
|
23
23
|
Budget
|
|
24
|
-
} from "./chunks/chunk-
|
|
25
|
-
import "./chunks/chunk-
|
|
26
|
-
import "./chunks/chunk-
|
|
27
|
-
import "./chunks/chunk-
|
|
24
|
+
} from "./chunks/chunk-5WP5IRMP.js";
|
|
25
|
+
import "./chunks/chunk-MMN3IESA.js";
|
|
26
|
+
import "./chunks/chunk-JCHJGIQA.js";
|
|
27
|
+
import "./chunks/chunk-CQ52GEHY.js";
|
|
28
28
|
export {
|
|
29
29
|
Budget,
|
|
30
30
|
admitNativePromiseProperties,
|
|
@@ -35,4 +35,3 @@ export {
|
|
|
35
35
|
lint,
|
|
36
36
|
run
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=core.js.map
|
|
@@ -23,11 +23,28 @@ export type ExtensionExports = {
|
|
|
23
23
|
globals?: Record<string, CallerInjectedBinding>;
|
|
24
24
|
modules?: ModuleRegistry;
|
|
25
25
|
};
|
|
26
|
+
export type HostConstructorOptions = {
|
|
27
|
+
/** Another native constructor handle from this realm. */
|
|
28
|
+
parent?: GuestReference;
|
|
29
|
+
/** Native interface brand. Only live host objects reach this synchronous check.
|
|
30
|
+
* Also installs the interface name as its prototype's Symbol.toStringTag.
|
|
31
|
+
*/
|
|
32
|
+
hasInstance?: (value: HostObject) => boolean;
|
|
33
|
+
/** Read-only enumerable numeric constants on the constructor and prototype. */
|
|
34
|
+
constants?: Readonly<Record<string, number>>;
|
|
35
|
+
};
|
|
26
36
|
export type ExtensionContext = {
|
|
27
37
|
readonly signal: AbortSignal;
|
|
28
38
|
onCleanup(cleanup: () => void | Promise<void>): void;
|
|
29
39
|
chargeWork(units?: number): void;
|
|
30
40
|
createHostObject(definition: HostObjectDefinition): HostObject;
|
|
41
|
+
/** Link a live capability to an owned guest prototype reference (or null). */
|
|
42
|
+
setHostObjectPrototype(value: HostObject, prototype: unknown, assertActive?: () => void): void;
|
|
43
|
+
/** A realm-owned constructor that synchronously returns a live host object.
|
|
44
|
+
* Release the opaque handle with releaseGuestReference when no longer needed.
|
|
45
|
+
* Returned objects keep their existing identity and prototype, including with newTarget.
|
|
46
|
+
*/
|
|
47
|
+
createHostConstructor(name: string, construct: (...args: readonly unknown[]) => HostObject, options?: HostConstructorOptions): GuestReference;
|
|
31
48
|
/** Explicit realm-owned live fixed buffer; default host ingress still copies. */
|
|
32
49
|
createArrayBufferReference(buffer: ArrayBuffer): GuestReference;
|
|
33
50
|
startCallback(callback: unknown, options?: CallbackOptions): CallbackInvocation;
|
package/dist/safe-js/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { run } from "./run.js";
|
|
|
17
17
|
export type { RunPromise } from "./run.js";
|
|
18
18
|
export type { ExecutionControl } from "./interp/jobs.js";
|
|
19
19
|
export { createRealm, type SafeJSRealm, type RealmOptions, type RealmResult, type RealmLimits } from "./realm.js";
|
|
20
|
-
export { defineExtension, type SafeJSExtension, type ExtensionDefinition, type ExtensionManifest, type ExtensionContext, type ExtensionExports, type CallbackOptions, type CallbackInvocation } from "./extensions.js";
|
|
20
|
+
export { defineExtension, type SafeJSExtension, type ExtensionDefinition, type ExtensionManifest, type ExtensionContext, type HostConstructorOptions, type ExtensionExports, type CallbackOptions, type CallbackInvocation } from "./extensions.js";
|
|
21
21
|
export type { HostObject, HostObjectDefinition, HostObjectIndexedDefinition, HostObjectNamedDefinition, GuestReference } from "./interp/host-capabilities.js";
|
|
22
22
|
export { createReplayableRandom, type ReplayableRandom } from "./random.js";
|
|
23
23
|
export type { RunClock, RunClockSnapshot, RunRandom } from "./run.js";
|
|
@@ -53,7 +53,7 @@ export { makeFailModule } from "./modules/fail.js";
|
|
|
53
53
|
export { makeFsModule } from "./modules/fs.js";
|
|
54
54
|
export { parseFsConfig, resolveFsConfig } from "./modules/fs-config.js";
|
|
55
55
|
export type { FsConfig, ResolveFsConfigOptions } from "./modules/fs-config.js";
|
|
56
|
-
export type { FsImplementation, FsModule, FsModuleOptions, SandboxDirent, SandboxStats } from "./modules/fs.js";
|
|
56
|
+
export type { FsImplementation, FsModule, FsModuleExports, FsModuleOptions, SandboxDirent, SandboxStats } from "./modules/fs.js";
|
|
57
57
|
export { makeHarnessModule } from "./modules/harness.js";
|
|
58
58
|
export { makeLogModule } from "./modules/log.js";
|
|
59
59
|
export { makeMetricModule } from "./modules/metric.js";
|
package/dist/safe-js/index.js
CHANGED
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
inspectSnapshotMigration,
|
|
3
3
|
migrateSnapshot,
|
|
4
4
|
migrateSnapshotFile
|
|
5
|
-
} from "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-6UP3B5TB.js";
|
|
6
6
|
import {
|
|
7
7
|
createLintModulesFromRuntimeRegistry
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-O3S3JVWS.js";
|
|
9
9
|
import {
|
|
10
10
|
makeHarnessModule
|
|
11
|
-
} from "./chunks/chunk-
|
|
11
|
+
} from "./chunks/chunk-6ZVFR4HR.js";
|
|
12
12
|
import {
|
|
13
13
|
makeMcpModule
|
|
14
|
-
} from "./chunks/chunk-
|
|
14
|
+
} from "./chunks/chunk-YYF5R6ML.js";
|
|
15
15
|
import {
|
|
16
16
|
AgentSpawnError,
|
|
17
17
|
EnvAccessError,
|
|
@@ -32,40 +32,40 @@ import {
|
|
|
32
32
|
runWithSpawnUsageAccumulator,
|
|
33
33
|
splitFrontmatter,
|
|
34
34
|
supportsSpawnMode
|
|
35
|
-
} from "./chunks/chunk-
|
|
35
|
+
} from "./chunks/chunk-MKY3MQUB.js";
|
|
36
36
|
import {
|
|
37
37
|
parseMcpConfig
|
|
38
|
-
} from "./chunks/chunk-
|
|
38
|
+
} from "./chunks/chunk-L3MIVH3T.js";
|
|
39
39
|
import {
|
|
40
40
|
lint
|
|
41
|
-
} from "./chunks/chunk-
|
|
42
|
-
import "./chunks/chunk-
|
|
41
|
+
} from "./chunks/chunk-POEMWNHD.js";
|
|
42
|
+
import "./chunks/chunk-X3YCE3ZH.js";
|
|
43
43
|
import {
|
|
44
44
|
makeFsModule
|
|
45
|
-
} from "./chunks/chunk-
|
|
45
|
+
} from "./chunks/chunk-DIMBVKHT.js";
|
|
46
46
|
import {
|
|
47
47
|
createRootedSourceResolver
|
|
48
|
-
} from "./chunks/chunk-
|
|
48
|
+
} from "./chunks/chunk-3NFTBEZR.js";
|
|
49
49
|
import {
|
|
50
50
|
FileSnapshotBackend,
|
|
51
51
|
createRealm,
|
|
52
52
|
createReplayableRandom,
|
|
53
53
|
run
|
|
54
|
-
} from "./chunks/chunk-
|
|
55
|
-
import "./chunks/chunk-
|
|
54
|
+
} from "./chunks/chunk-MLJ4BKDX.js";
|
|
55
|
+
import "./chunks/chunk-DHGJSEFX.js";
|
|
56
56
|
import {
|
|
57
57
|
fsCodec
|
|
58
|
-
} from "./chunks/chunk-
|
|
58
|
+
} from "./chunks/chunk-DIG26TEI.js";
|
|
59
59
|
import {
|
|
60
60
|
hasOwnErrorCode
|
|
61
|
-
} from "./chunks/chunk-
|
|
61
|
+
} from "./chunks/chunk-ONWFPHUI.js";
|
|
62
62
|
import {
|
|
63
63
|
restore
|
|
64
|
-
} from "./chunks/chunk-
|
|
65
|
-
import "./chunks/chunk-
|
|
64
|
+
} from "./chunks/chunk-OQYVEDRN.js";
|
|
65
|
+
import "./chunks/chunk-LRINZRJA.js";
|
|
66
66
|
import {
|
|
67
67
|
dump
|
|
68
|
-
} from "./chunks/chunk-
|
|
68
|
+
} from "./chunks/chunk-L265M6OS.js";
|
|
69
69
|
import {
|
|
70
70
|
HostCallResumabilityError,
|
|
71
71
|
HostOperationResumePolicyError,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
deepCopyToSandbox,
|
|
78
78
|
defineExtension,
|
|
79
79
|
registerPendingHostCallPolicy
|
|
80
|
-
} from "./chunks/chunk-
|
|
80
|
+
} from "./chunks/chunk-AB6ERQE5.js";
|
|
81
81
|
import {
|
|
82
82
|
Budget,
|
|
83
83
|
SandboxError,
|
|
@@ -85,14 +85,14 @@ import {
|
|
|
85
85
|
parse,
|
|
86
86
|
parseModule,
|
|
87
87
|
parseSourceModule
|
|
88
|
-
} from "./chunks/chunk-
|
|
88
|
+
} from "./chunks/chunk-5WP5IRMP.js";
|
|
89
89
|
import {
|
|
90
90
|
extname
|
|
91
|
-
} from "./chunks/chunk-
|
|
91
|
+
} from "./chunks/chunk-MMN3IESA.js";
|
|
92
92
|
import {
|
|
93
93
|
hostFs
|
|
94
|
-
} from "./chunks/chunk-
|
|
95
|
-
import "./chunks/chunk-
|
|
94
|
+
} from "./chunks/chunk-JCHJGIQA.js";
|
|
95
|
+
import "./chunks/chunk-CQ52GEHY.js";
|
|
96
96
|
|
|
97
97
|
// packages/safe-js/src/parse.ts
|
|
98
98
|
var parse2 = parse;
|
|
@@ -497,4 +497,3 @@ export {
|
|
|
497
497
|
runWithSpawnUsageAccumulator,
|
|
498
498
|
splitFrontmatter
|
|
499
499
|
};
|
|
500
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SandboxObject, SandboxValue } from "./values.js";
|
|
2
2
|
import type { Scope } from "./scope.js";
|
|
3
|
+
import { type DataCopyOperation } from "./data-copy.js";
|
|
3
4
|
export declare const sandboxArgumentsBrand: unique symbol;
|
|
4
5
|
export type SandboxArguments = SandboxObject & {
|
|
5
6
|
readonly [sandboxArgumentsBrand]: true;
|
|
@@ -16,3 +17,4 @@ export declare function createSandboxArguments(values: readonly SandboxValue[],
|
|
|
16
17
|
export declare function isSandboxArguments(value: unknown): value is SandboxArguments;
|
|
17
18
|
export declare function getSandboxArgumentEntries(value: SandboxObject): Array<[string, SandboxValue]>;
|
|
18
19
|
export declare function copySandboxArgumentProperties(source: SandboxObject, target: object, copyValue: (value: SandboxValue, key: string | symbol) => unknown): void;
|
|
20
|
+
export declare function copySandboxArgumentPropertiesOperation<T>(source: SandboxObject, target: object, copyValue: (value: SandboxValue, key: string | symbol) => DataCopyOperation<T>): DataCopyOperation<T>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SandboxMap, SandboxObject, SandboxSet } from "./values.js";
|
|
2
|
+
import { type DataCopyOperation } from "./data-copy.js";
|
|
2
3
|
export declare const collectionGuestProperties: WeakMap<object, SandboxObject>;
|
|
3
4
|
export declare function getCollectionProperties(value: SandboxMap | SandboxSet): SandboxObject;
|
|
4
5
|
export declare function copyCollectionProperties(source: SandboxMap | SandboxSet | Map<unknown, unknown> | Set<unknown>, target: object, encode: (value: unknown, key: string | symbol) => unknown): void;
|
|
6
|
+
export declare function copyCollectionPropertiesOperation<T>(source: SandboxMap | SandboxSet | Map<unknown, unknown> | Set<unknown>, target: object, encode: (value: unknown, key: string | symbol) => DataCopyOperation<T>): DataCopyOperation<T>;
|
|
@@ -44,6 +44,11 @@ export declare function declareHostOperation<TFunction extends CallerInjectedFun
|
|
|
44
44
|
}): TFunction;
|
|
45
45
|
export declare function readHostOperationPolicy(operation: CallerInjectedFunction): PendingHostCallPolicyMode | undefined;
|
|
46
46
|
export declare function wrapCallerInjectedBindings(bindings: Record<string, CallerInjectedBinding>, options: HostBridgeOptions): Record<string, SandboxValue>;
|
|
47
|
+
export declare function wrapHostConstructor(name: string, construct: CallerInjectedFunction, options: HostBridgeOptions, definition: {
|
|
48
|
+
parent?: SandboxValue;
|
|
49
|
+
hasInstance?: CallerInjectedFunction;
|
|
50
|
+
constants: Record<string, number>;
|
|
51
|
+
}): SandboxClosure;
|
|
47
52
|
export declare function copyHostValueToSandbox(value: unknown, stackFrames: readonly string[], options: HostBridgeOptions & {
|
|
48
53
|
errorData?: boolean;
|
|
49
54
|
}, state: {
|
|
@@ -70,7 +70,12 @@ export declare function registerGuestCallback(callback: HostOperation, state: Gu
|
|
|
70
70
|
export declare function readGuestCallback(callback: unknown, owner: object): SandboxClosure;
|
|
71
71
|
export declare function revokeGuestCallback(callback: object, owner: object): void;
|
|
72
72
|
export declare function revokeHostObject(value: HostObject, owner: object): void;
|
|
73
|
+
export declare function setHostObjectPrototype(value: HostObject, reference: unknown, owner: object, guard?: () => void): void;
|
|
74
|
+
export declare function getHostObjectPrototype(value: SandboxObject): SandboxObject | null | undefined;
|
|
75
|
+
export declare function hostObjectPrototypeRoot(value: HostObject | SandboxObject): SandboxObject | undefined;
|
|
76
|
+
export declare const noHostObjectMember: unique symbol;
|
|
73
77
|
export declare function getHostObjectMember(value: SandboxObject, key: string | symbol): SandboxValue;
|
|
78
|
+
export declare function getHostObjectOwnMember(value: SandboxObject, key: string | symbol): SandboxValue;
|
|
74
79
|
export declare function setHostObjectMember(value: SandboxObject, key: string | symbol, entry: SandboxValue): void;
|
|
75
80
|
export declare function deleteHostObjectMember(value: SandboxObject, key: string | symbol): boolean;
|
|
76
81
|
export declare function getHostObjectKeys(value: SandboxObject): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const internalSymbols: Set<symbol>;
|
|
@@ -74,7 +74,9 @@ export type InterpretOptions = {
|
|
|
74
74
|
};
|
|
75
75
|
snapshot?: InterpreterSnapshot;
|
|
76
76
|
};
|
|
77
|
-
type EvaluationContext = AsyncEvaluationContext
|
|
77
|
+
type EvaluationContext = AsyncEvaluationContext & {
|
|
78
|
+
deferDataScans?: boolean;
|
|
79
|
+
};
|
|
78
80
|
type EvaluationResult = AsyncEvaluationResult;
|
|
79
81
|
export declare function interpret(node: ParseResult, options?: InterpretOptions): Promise<InterpreterResult>;
|
|
80
82
|
export { Scope } from "./scope.js";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type CompileOwner, type CompileTicket } from "../budget.js";
|
|
2
2
|
import type { RegexPattern } from "./parse.js";
|
|
3
|
+
type CompiledData = Readonly<{
|
|
4
|
+
units: number;
|
|
5
|
+
ticket: CompileTicket | undefined;
|
|
6
|
+
}>;
|
|
3
7
|
export declare class CompileScope {
|
|
4
8
|
readonly owner?: CompileOwner | undefined;
|
|
5
9
|
readonly parent?: CompileScope | undefined;
|
|
@@ -27,7 +31,5 @@ export declare class RegexCompileGuard {
|
|
|
27
31
|
retainScratch(): void;
|
|
28
32
|
close(): void;
|
|
29
33
|
}
|
|
30
|
-
export declare function regexCompiledData(pattern: RegexPattern):
|
|
31
|
-
|
|
32
|
-
ticket?: CompileTicket;
|
|
33
|
-
};
|
|
34
|
+
export declare function regexCompiledData(pattern: RegexPattern): CompiledData;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TemplateLiteral } from "../parse.js";
|
|
2
|
+
import type { Budget } from "./budget.js";
|
|
3
|
+
import type { SandboxArray } from "./values.js";
|
|
4
|
+
export declare const templateRealms: WeakMap<Budget, Map<TemplateLiteral, SandboxArray>>;
|
|
5
|
+
export declare function releaseTemplateObjects(budget: Budget): void;
|
|
@@ -136,6 +136,7 @@ export declare function createSandboxClosure(input: {
|
|
|
136
136
|
properties?: SandboxObject | ((closure: SandboxClosure) => SandboxObject);
|
|
137
137
|
retainedValues?: () => Iterable<SandboxValue>;
|
|
138
138
|
}): SandboxClosure;
|
|
139
|
+
export declare function registerDeferredClosureProperties(closure: SandboxClosure, root: SandboxObject): void;
|
|
139
140
|
export declare function registerDeferredClosureChargeIdentity(closure: SandboxClosure, identity: object): void;
|
|
140
141
|
export declare function registerClosureCaptureCollector(closure: SandboxClosure, provider: () => Iterable<SandboxValue>, collect: (append: (value: SandboxValue) => void) => void): void;
|
|
141
142
|
export declare function ownEnumerableSandboxEntries(value: SandboxValue, excludedKeys?: ReadonlySet<string>): Array<[string, SandboxValue]>;
|
|
@@ -185,9 +186,19 @@ export type StructuredCloneRequest = {
|
|
|
185
186
|
};
|
|
186
187
|
/** Serialization pauses for guest reads/coercion; ordinary data stays synchronous. */
|
|
187
188
|
export declare function cloneStructuredGraph(value: SandboxValue, state: CopyState<SandboxValue>, budget: Budget, depth?: number): Generator<StructuredCloneRequest, SandboxValue, SandboxValue>;
|
|
189
|
+
export declare const defaultDataMeasurementOptions: Readonly<{
|
|
190
|
+
ignoreClosures: false;
|
|
191
|
+
ignoreClosureCaptures: false;
|
|
192
|
+
ignoreHostObjectPrototypes: false;
|
|
193
|
+
compileTickets: Set<CompileTicket> | undefined;
|
|
194
|
+
}>;
|
|
188
195
|
export declare function measureSandboxData(values: Iterable<unknown>, options?: {
|
|
189
196
|
ignoreClosures?: boolean;
|
|
190
197
|
ignoreClosureCaptures?: boolean;
|
|
198
|
+
/** Host-result allocation only: linked prototypes are already realm-owned.
|
|
199
|
+
* Primary reconciliation must always traverse the complete mutable graph.
|
|
200
|
+
*/
|
|
201
|
+
ignoreHostObjectPrototypes?: boolean;
|
|
191
202
|
compileTickets?: Set<CompileTicket>;
|
|
192
203
|
}): number;
|
|
193
204
|
export declare function reconcileCompiledValues(budget: Budget, values: Iterable<unknown>, compilation?: CompileScope, parent?: CompileScope, escaping?: Iterable<unknown>): void;
|
|
@@ -82,8 +82,9 @@ export type FsModule = Pick<FsImplementation, FsPassthroughName> & {
|
|
|
82
82
|
COPYFILE_EXCL: number;
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
|
-
export
|
|
86
|
-
default:
|
|
87
|
-
promises:
|
|
85
|
+
export type FsModuleExports = FsModule & {
|
|
86
|
+
default: FsModuleExports;
|
|
87
|
+
promises: FsModuleExports;
|
|
88
88
|
};
|
|
89
|
+
export declare function makeFsModule(options?: FsModuleOptions): FsModuleExports;
|
|
89
90
|
export {};
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FS_OPTION_SURFACE,
|
|
3
3
|
makeFsModule
|
|
4
|
-
} from "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-
|
|
6
|
-
import "../chunks/chunk-
|
|
7
|
-
import "../chunks/chunk-
|
|
8
|
-
import "../chunks/chunk-
|
|
9
|
-
import "../chunks/chunk-
|
|
10
|
-
import "../chunks/chunk-
|
|
11
|
-
import "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-DIMBVKHT.js";
|
|
5
|
+
import "../chunks/chunk-DIG26TEI.js";
|
|
6
|
+
import "../chunks/chunk-ONWFPHUI.js";
|
|
7
|
+
import "../chunks/chunk-AB6ERQE5.js";
|
|
8
|
+
import "../chunks/chunk-5WP5IRMP.js";
|
|
9
|
+
import "../chunks/chunk-MMN3IESA.js";
|
|
10
|
+
import "../chunks/chunk-JCHJGIQA.js";
|
|
11
|
+
import "../chunks/chunk-CQ52GEHY.js";
|
|
12
12
|
export {
|
|
13
13
|
FS_OPTION_SURFACE,
|
|
14
14
|
makeFsModule
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=fs.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Stack-scoped context for hosts without native asynchronous context support.
|
|
2
|
+
* Continuations scheduled by SafeJS capture and restore these stacks explicitly.
|
|
3
|
+
*/
|
|
4
|
+
export declare class StackContext<T> {
|
|
5
|
+
private static readonly stores;
|
|
6
|
+
private value?;
|
|
7
|
+
private generation;
|
|
8
|
+
constructor();
|
|
9
|
+
getStore(): T | undefined;
|
|
10
|
+
run<Result>(value: T, callback: () => Result): Result;
|
|
11
|
+
exit<Result>(callback: () => Result): Result;
|
|
12
|
+
disable(): void;
|
|
13
|
+
static snapshot(): <Result>(callback: () => Result) => Result;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as nodeUtil from "node:util";
|
|
2
|
+
import * as nativeFsPromises from "node:fs/promises";
|
|
3
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
+
import type { HostCallbackContext } from "../interp/host-callback-context.js";
|
|
5
|
+
export declare const cloneSharedBufferWrapper: (value: SharedArrayBuffer) => SharedArrayBuffer;
|
|
6
|
+
export declare function createHostCallbackContext(): HostCallbackContext;
|
|
7
|
+
export declare const accessDeniedSystemError: readonly [number, string];
|
|
8
|
+
export { AsyncLocalStorage };
|
|
9
|
+
export declare const types: typeof nodeUtil.types;
|
|
10
|
+
export { setImmediate as yieldToHost } from "node:timers/promises";
|
|
11
|
+
export { inspect } from "node:util";
|
|
12
|
+
export { formatWithOptions } from "node:util";
|
|
13
|
+
export { constants as fsConstants } from "node:fs";
|
|
14
|
+
export declare const hostFs: typeof nativeFsPromises;
|
|
15
|
+
export declare const hostCwd: () => string;
|
|
16
|
+
export declare const hostPlatform: NodeJS.Platform;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function createTrackedProxy<T extends object>(target: T, handler: ProxyHandler<T>): T;
|
|
2
|
+
export declare const types: {
|
|
3
|
+
isProxy: (value: unknown) => boolean;
|
|
4
|
+
isBooleanObject: (value: unknown) => boolean;
|
|
5
|
+
isNumberObject: (value: unknown) => boolean;
|
|
6
|
+
isStringObject: (value: unknown) => boolean;
|
|
7
|
+
isBigIntObject: (value: unknown) => boolean;
|
|
8
|
+
isSymbolObject: (value: unknown) => boolean;
|
|
9
|
+
isDate: (value: unknown) => boolean;
|
|
10
|
+
isRegExp: (value: unknown) => boolean;
|
|
11
|
+
isArrayBuffer: (value: unknown) => boolean;
|
|
12
|
+
isDataView: (value: unknown) => boolean;
|
|
13
|
+
isMap: (value: unknown) => boolean;
|
|
14
|
+
isPromise(value: unknown): value is Promise<unknown>;
|
|
15
|
+
isAsyncFunction: (value: unknown) => boolean;
|
|
16
|
+
isGeneratorFunction: (value: unknown) => boolean;
|
|
17
|
+
isNativeError: (value: unknown) => value is Error;
|
|
18
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StackContext } from "./context.js";
|
|
2
|
+
export declare const AsyncLocalStorage: typeof StackContext;
|
|
3
|
+
export { types } from "./types.js";
|
|
4
|
+
import type { HostCallbackContext } from "../interp/host-callback-context.js";
|
|
5
|
+
export declare const cloneSharedBufferWrapper: (value: SharedArrayBuffer) => SharedArrayBuffer;
|
|
6
|
+
export declare function createHostCallbackContext(): HostCallbackContext;
|
|
7
|
+
export declare const accessDeniedSystemError: readonly [number, string];
|
|
8
|
+
export declare const yieldToHost: () => Promise<void>;
|
|
9
|
+
export declare const hostCwd: () => string;
|
|
10
|
+
export declare const hostPlatform = "workerd";
|
|
11
|
+
export declare const fsConstants: {
|
|
12
|
+
F_OK: number;
|
|
13
|
+
R_OK: number;
|
|
14
|
+
W_OK: number;
|
|
15
|
+
X_OK: number;
|
|
16
|
+
COPYFILE_EXCL: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const hostFs: import("@poe-platform/safe-fs/core").FsBridge;
|
|
19
|
+
export declare function inspect(value: unknown, _options?: {
|
|
20
|
+
depth?: number;
|
|
21
|
+
}): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Budget, CompileOwner } from "../interp/budget.js";
|
|
2
2
|
import { type DynamicSource } from "../parse/dynamic-source.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type ParseResult } from "../parse/parser.js";
|
|
4
4
|
export type SnapshotValidationCode = "budgetExceeded" | "danglingReference" | "duplicateId" | "invalidCycle" | "invalidState" | "invalidType" | "invalidValue" | "unknownTag" | "unsupportedVersion";
|
|
5
5
|
export declare class SnapshotValidationError extends Error {
|
|
6
6
|
readonly code: SnapshotValidationCode;
|
|
@@ -10,6 +10,7 @@ export declare class SnapshotValidationError extends Error {
|
|
|
10
10
|
export declare function validateSnapshotData(value: unknown): void;
|
|
11
11
|
export declare function validateDumpEnvelope(snapshot: unknown, options?: {
|
|
12
12
|
resume?: boolean;
|
|
13
|
+
source?: string;
|
|
13
14
|
}): asserts snapshot is Record<string, unknown>;
|
|
14
15
|
export declare function validateInterpreterSnapshot(snapshot: unknown, nodeById: ReadonlyMap<number, ParseResult>, budget: Budget, dynamicSources?: Map<number, DynamicSource>, owner?: CompileOwner): asserts snapshot is Record<string, unknown>;
|
|
15
16
|
export declare function validateSnapshotSourceHash(snapshot: unknown): asserts snapshot is {
|