@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.
Files changed (66) hide show
  1. package/README.md +15 -2
  2. package/dist/safe-js/chunks/{chunk-APKV5Y6T.js → chunk-4CX3HYRY.js} +2 -2
  3. package/dist/safe-js/chunks/{chunk-NJM2Q74Z.js → chunk-A4L72WXV.js} +4 -4
  4. package/dist/safe-js/chunks/{chunk-B2SQLK4O.js → chunk-B4M6QVUV.js} +2 -2
  5. package/dist/safe-js/chunks/{chunk-A7CADQAD.js → chunk-BEXRQET4.js} +3 -3
  6. package/dist/safe-js/chunks/{chunk-OP3H3ZDN.js → chunk-BHYBD6SY.js} +2 -2
  7. package/dist/safe-js/chunks/{chunk-KP6I45ET.js → chunk-DNA7BMBY.js} +192 -38
  8. package/dist/safe-js/chunks/{chunk-KP6I45ET.js.map → chunk-DNA7BMBY.js.map} +3 -3
  9. package/dist/safe-js/chunks/{chunk-U6KZ2DQ2.js → chunk-GMPZBMPA.js} +3 -3
  10. package/dist/safe-js/chunks/{chunk-IDQ67DY2.js → chunk-ILYJBA2D.js} +24 -3
  11. package/dist/safe-js/chunks/chunk-ILYJBA2D.js.map +7 -0
  12. package/dist/safe-js/chunks/{chunk-NEJ44T4Y.js → chunk-IS7YUCOF.js} +2 -2
  13. package/dist/safe-js/chunks/{chunk-BGJXQN4A.js → chunk-JNLY7IMV.js} +4 -4
  14. package/dist/safe-js/chunks/{chunk-RML35GIF.js → chunk-LPBTSTDG.js} +3 -3
  15. package/dist/safe-js/chunks/{chunk-KK5NCR5R.js → chunk-Q7B6JIMI.js} +110 -46
  16. package/dist/safe-js/chunks/chunk-Q7B6JIMI.js.map +7 -0
  17. package/dist/safe-js/chunks/{chunk-XMA6FOJU.js → chunk-Y4LNCDCP.js} +2 -2
  18. package/dist/safe-js/chunks/{cli-runtime-PO6DQDHP.js → cli-runtime-YK2WE33M.js} +13 -13
  19. package/dist/safe-js/chunks/{dump-TRGFSCJ7.js → dump-ATWBOZWV.js} +4 -4
  20. package/dist/safe-js/chunks/{fs-4T5MZW5J.js → fs-D72Y52I5.js} +4 -4
  21. package/dist/safe-js/chunks/harness-LUYCGWHZ.js +10 -0
  22. package/dist/safe-js/chunks/mcp-IWKZB2R2.js +11 -0
  23. package/dist/safe-js/chunks/migration-file-IXO5MLP4.js +12 -0
  24. package/dist/safe-js/chunks/restore-SI7HOC6C.js +13 -0
  25. package/dist/safe-js/chunks/run-SHI2PYR6.js +17 -0
  26. package/dist/safe-js/chunks/runtime-modules-OO72HTVF.js +10 -0
  27. package/dist/safe-js/cli.js +2 -2
  28. package/dist/safe-js/core.js +7 -7
  29. package/dist/safe-js/extensions.d.ts +3 -1
  30. package/dist/safe-js/index.js +13 -13
  31. package/dist/safe-js/interp/budget.d.ts +3 -0
  32. package/dist/safe-js/interp/scope.d.ts +4 -1
  33. package/dist/safe-js/interp/typed-array.d.ts +3 -0
  34. package/dist/safe-js/parse/dynamic-source.d.ts +1 -1
  35. package/dist/safe-js/parse/parser.d.ts +1 -1
  36. package/dist/safe-js/realm.d.ts +1 -0
  37. package/dist/safe-js/snapshot/guest-heap.d.ts +1 -0
  38. package/dist/toolcraft-design/prompts/primitives/note.d.ts +1 -1
  39. package/package.json +2 -2
  40. package/dist/safe-js/chunks/chunk-IDQ67DY2.js.map +0 -7
  41. package/dist/safe-js/chunks/chunk-KK5NCR5R.js.map +0 -7
  42. package/dist/safe-js/chunks/harness-DLEQ2Z3O.js +0 -10
  43. package/dist/safe-js/chunks/mcp-TNVEFJ6K.js +0 -11
  44. package/dist/safe-js/chunks/migration-file-IDIUFLKY.js +0 -12
  45. package/dist/safe-js/chunks/restore-P27AUZR2.js +0 -13
  46. package/dist/safe-js/chunks/run-KGAEHYMV.js +0 -17
  47. package/dist/safe-js/chunks/runtime-modules-KICK45EE.js +0 -10
  48. /package/dist/safe-js/chunks/{chunk-APKV5Y6T.js.map → chunk-4CX3HYRY.js.map} +0 -0
  49. /package/dist/safe-js/chunks/{chunk-NJM2Q74Z.js.map → chunk-A4L72WXV.js.map} +0 -0
  50. /package/dist/safe-js/chunks/{chunk-B2SQLK4O.js.map → chunk-B4M6QVUV.js.map} +0 -0
  51. /package/dist/safe-js/chunks/{chunk-A7CADQAD.js.map → chunk-BEXRQET4.js.map} +0 -0
  52. /package/dist/safe-js/chunks/{chunk-OP3H3ZDN.js.map → chunk-BHYBD6SY.js.map} +0 -0
  53. /package/dist/safe-js/chunks/{chunk-U6KZ2DQ2.js.map → chunk-GMPZBMPA.js.map} +0 -0
  54. /package/dist/safe-js/chunks/{chunk-NEJ44T4Y.js.map → chunk-IS7YUCOF.js.map} +0 -0
  55. /package/dist/safe-js/chunks/{chunk-BGJXQN4A.js.map → chunk-JNLY7IMV.js.map} +0 -0
  56. /package/dist/safe-js/chunks/{chunk-RML35GIF.js.map → chunk-LPBTSTDG.js.map} +0 -0
  57. /package/dist/safe-js/chunks/{chunk-XMA6FOJU.js.map → chunk-Y4LNCDCP.js.map} +0 -0
  58. /package/dist/safe-js/chunks/{cli-runtime-PO6DQDHP.js.map → cli-runtime-YK2WE33M.js.map} +0 -0
  59. /package/dist/safe-js/chunks/{dump-TRGFSCJ7.js.map → dump-ATWBOZWV.js.map} +0 -0
  60. /package/dist/safe-js/chunks/{fs-4T5MZW5J.js.map → fs-D72Y52I5.js.map} +0 -0
  61. /package/dist/safe-js/chunks/{harness-DLEQ2Z3O.js.map → harness-LUYCGWHZ.js.map} +0 -0
  62. /package/dist/safe-js/chunks/{mcp-TNVEFJ6K.js.map → mcp-IWKZB2R2.js.map} +0 -0
  63. /package/dist/safe-js/chunks/{migration-file-IDIUFLKY.js.map → migration-file-IXO5MLP4.js.map} +0 -0
  64. /package/dist/safe-js/chunks/{restore-P27AUZR2.js.map → restore-SI7HOC6C.js.map} +0 -0
  65. /package/dist/safe-js/chunks/{run-KGAEHYMV.js.map → run-SHI2PYR6.js.map} +0 -0
  66. /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-XMA6FOJU.js";
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-B2SQLK4O.js";
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-IDQ67DY2.js";
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-IDIUFLKY.js");
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-KGAEHYMV.js"),
276
- import("./restore-P27AUZR2.js"),
277
- import("./dump-TRGFSCJ7.js"),
278
- import("./runtime-modules-KICK45EE.js"),
279
- import("./fs-4T5MZW5J.js"),
280
- import("./mcp-TNVEFJ6K.js")
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-DLEQ2Z3O.js"),
517
- import("./fs-4T5MZW5J.js")
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-PO6DQDHP.js.map
707
+ //# sourceMappingURL=cli-runtime-YK2WE33M.js.map
@@ -4,9 +4,9 @@ import {
4
4
  dump,
5
5
  dumpCurrent,
6
6
  serializeRunSnapshot
7
- } from "./chunk-A7CADQAD.js";
8
- import "./chunk-KP6I45ET.js";
9
- import "./chunk-IDQ67DY2.js";
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-TRGFSCJ7.js.map
18
+ //# sourceMappingURL=dump-ATWBOZWV.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  FS_OPTION_SURFACE,
3
3
  makeFsModule
4
- } from "./chunk-OP3H3ZDN.js";
4
+ } from "./chunk-BHYBD6SY.js";
5
5
  import "./chunk-SJZWSPWD.js";
6
- import "./chunk-KP6I45ET.js";
7
- import "./chunk-IDQ67DY2.js";
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-4T5MZW5J.js.map
13
+ //# sourceMappingURL=fs-D72Y52I5.js.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ makeHarnessModule
3
+ } from "./chunk-IS7YUCOF.js";
4
+ import "./chunk-DNA7BMBY.js";
5
+ import "./chunk-ILYJBA2D.js";
6
+ import "./chunk-4YIDX44G.js";
7
+ export {
8
+ makeHarnessModule
9
+ };
10
+ //# sourceMappingURL=harness-LUYCGWHZ.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
@@ -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-PO6DQDHP.js");
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-PO6DQDHP.js");
35
+ const { exitCodeForError } = await import("./chunks/cli-runtime-YK2WE33M.js");
36
36
  return exitCodeForError(error);
37
37
  }
38
38
  }
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  lint
3
- } from "./chunks/chunk-B2SQLK4O.js";
3
+ } from "./chunks/chunk-B4M6QVUV.js";
4
4
  import {
5
5
  createRealm,
6
6
  createReplayableRandom,
7
7
  run
8
- } from "./chunks/chunk-KK5NCR5R.js";
8
+ } from "./chunks/chunk-Q7B6JIMI.js";
9
9
  import "./chunks/chunk-U7ZNMTSQ.js";
10
- import "./chunks/chunk-NJM2Q74Z.js";
11
- import "./chunks/chunk-A7CADQAD.js";
10
+ import "./chunks/chunk-A4L72WXV.js";
11
+ import "./chunks/chunk-BEXRQET4.js";
12
12
  import "./chunks/chunk-SJZWSPWD.js";
13
- import "./chunks/chunk-U6KZ2DQ2.js";
13
+ import "./chunks/chunk-GMPZBMPA.js";
14
14
  import {
15
15
  admitNativePromiseProperties,
16
16
  defineExtension
17
- } from "./chunks/chunk-KP6I45ET.js";
17
+ } from "./chunks/chunk-DNA7BMBY.js";
18
18
  import {
19
19
  Budget
20
- } from "./chunks/chunk-IDQ67DY2.js";
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;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  createLintModulesFromRuntimeRegistry
3
- } from "./chunks/chunk-APKV5Y6T.js";
3
+ } from "./chunks/chunk-4CX3HYRY.js";
4
4
  import {
5
5
  makeFsModule
6
- } from "./chunks/chunk-OP3H3ZDN.js";
6
+ } from "./chunks/chunk-BHYBD6SY.js";
7
7
  import {
8
8
  makeHarnessModule
9
- } from "./chunks/chunk-NEJ44T4Y.js";
9
+ } from "./chunks/chunk-IS7YUCOF.js";
10
10
  import {
11
11
  makeMcpModule
12
- } from "./chunks/chunk-RML35GIF.js";
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-XMA6FOJU.js";
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-B2SQLK4O.js";
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-KK5NCR5R.js";
49
+ } from "./chunks/chunk-Q7B6JIMI.js";
50
50
  import "./chunks/chunk-U7ZNMTSQ.js";
51
51
  import {
52
52
  restore
53
- } from "./chunks/chunk-NJM2Q74Z.js";
53
+ } from "./chunks/chunk-A4L72WXV.js";
54
54
  import {
55
55
  dump
56
- } from "./chunks/chunk-A7CADQAD.js";
56
+ } from "./chunks/chunk-BEXRQET4.js";
57
57
  import {
58
58
  inspectSnapshotMigration,
59
59
  migrateSnapshot,
60
60
  migrateSnapshotFile
61
- } from "./chunks/chunk-BGJXQN4A.js";
61
+ } from "./chunks/chunk-JNLY7IMV.js";
62
62
  import {
63
63
  hasOwnErrorCode
64
64
  } from "./chunks/chunk-SJZWSPWD.js";
65
- import "./chunks/chunk-U6KZ2DQ2.js";
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-KP6I45ET.js";
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-IDQ67DY2.js";
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
  };
@@ -16,6 +16,7 @@ export type RealmLimits = {
16
16
  nestedEvaluations?: number;
17
17
  };
18
18
  export type RealmOptions = {
19
+ classicScripts?: boolean;
19
20
  sourceResolver?: SourceResolver;
20
21
  clock?: RunClock;
21
22
  bindings?: Record<string, CallerInjectedBinding>;
@@ -542,6 +542,7 @@ export type GuestHeapNode<T> = {
542
542
  chargeData: boolean;
543
543
  simpleCatchParameter?: string;
544
544
  globalEnvironment?: boolean;
545
+ globalVarNames?: string[];
545
546
  moduleEnvironment?: {
546
547
  available: string[];
547
548
  namespaces: T;
@@ -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.720",
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.720",
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",