@poe-platform/safe-js 0.1.802 → 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.
Files changed (57) hide show
  1. package/README.md +4 -4
  2. package/dist/safe-js/bundled-yaml/LICENSE +13 -0
  3. package/dist/safe-js/bundled-yaml/index.js +6601 -0
  4. package/dist/safe-js/chunks/{chunk-HFRBLE6Y.js → chunk-36PBWSDR.js} +23 -11
  5. package/dist/safe-js/chunks/{chunk-CK3YK2EC.js → chunk-6AO2T2VZ.js} +1 -1
  6. package/dist/safe-js/chunks/{chunk-5RLD4TVI.js → chunk-BKNQTNHP.js} +36 -23
  7. package/dist/safe-js/chunks/{chunk-YCFOANSU.js → chunk-BYDDUKS3.js} +3 -3
  8. package/dist/safe-js/chunks/{chunk-6H5VC5W5.js → chunk-CKOGIOB3.js} +470 -464
  9. package/dist/safe-js/chunks/{chunk-XOMGWE37.js → chunk-CVPZFRCC.js} +3 -3
  10. package/dist/safe-js/chunks/{chunk-4KMUWNZD.js → chunk-ECMGBHAB.js} +13 -137
  11. package/dist/safe-js/chunks/{chunk-A3LXCGMJ.js → chunk-EQUBWQJN.js} +57 -34
  12. package/dist/safe-js/chunks/{chunk-QRWRR6IA.js → chunk-JMDWLOJV.js} +26 -3
  13. package/dist/safe-js/chunks/{chunk-3NFTBEZR.js → chunk-JQ5QJV5Q.js} +2 -2
  14. package/dist/safe-js/chunks/{chunk-MMN3IESA.js → chunk-KMBCLXER.js} +1 -1
  15. package/dist/safe-js/chunks/{chunk-PMOXSLM5.js → chunk-MJH73KJI.js} +2 -2
  16. package/dist/safe-js/chunks/{chunk-IB6WAQAE.js → chunk-P66QKVQC.js} +3 -3
  17. package/dist/safe-js/chunks/{chunk-HPHCQNFV.js → chunk-RPGCF4KE.js} +130 -3
  18. package/dist/safe-js/chunks/{chunk-F6Y734YA.js → chunk-SIR35W6T.js} +5 -5
  19. package/dist/safe-js/chunks/{chunk-7THYP46K.js → chunk-SMGNJNDU.js} +1 -1
  20. package/dist/safe-js/chunks/{chunk-XV5OYKND.js → chunk-VLRTLEDI.js} +2 -2
  21. package/dist/safe-js/chunks/{chunk-JCHJGIQA.js → chunk-VVOPJZRG.js} +2 -0
  22. package/dist/safe-js/chunks/{cli-runtime-L4IABN2W.js → cli-runtime-A353G7DR.js} +15 -15
  23. package/dist/safe-js/chunks/{dump-KUPBSXSL.js → dump-KQZFULX2.js} +4 -4
  24. package/dist/safe-js/chunks/harness-XT6K6X67.js +10 -0
  25. package/dist/safe-js/chunks/mcp-VWE444VD.js +11 -0
  26. package/dist/safe-js/chunks/migration-file-NSKXOMAO.js +14 -0
  27. package/dist/safe-js/chunks/restore-SHPORPY4.js +13 -0
  28. package/dist/safe-js/chunks/run-FQOSICOT.js +19 -0
  29. package/dist/safe-js/chunks/{runtime-modules-MGSXY4BN.js → runtime-modules-DBRXXRND.js} +4 -4
  30. package/dist/safe-js/chunks/{source-files-BSDM22Y2.js → source-files-A2WSOO6G.js} +3 -3
  31. package/dist/safe-js/cli.js +2 -2
  32. package/dist/safe-js/core.d.ts +19 -0
  33. package/dist/safe-js/core.js +39 -15
  34. package/dist/safe-js/error/format.d.ts +3 -0
  35. package/dist/safe-js/index.d.ts +1 -12
  36. package/dist/safe-js/index.js +30 -39
  37. package/dist/safe-js/interp/host-call.d.ts +1 -0
  38. package/dist/safe-js/interp/interpreter.d.ts +1 -3
  39. package/dist/safe-js/modules/fs.js +5 -5
  40. package/dist/safe-js/platform/node.d.ts +1 -0
  41. package/dist/safe-js/platform/node.js +1 -0
  42. package/dist/safe-js/platform/workerd.d.ts +1 -0
  43. package/dist/safe-js/platform/workerd.js +2 -0
  44. package/dist/safe-js/portable/chunks/{chunk-XCTU25SU.js → chunk-NLGXLZCK.js} +1 -1
  45. package/dist/safe-js/portable/chunks/{chunk-2FNMGWDK.js → chunk-SRMMDXD3.js} +127 -91
  46. package/dist/safe-js/portable/chunks/{chunk-H5X3T5VP.js → chunk-W6MZOTYR.js} +2 -0
  47. package/dist/safe-js/portable/chunks/{source-files-CVU252FB.js → source-files-AEDWESAJ.js} +2 -2
  48. package/dist/safe-js/portable/core.js +467 -249
  49. package/dist/safe-js/portable/modules/fs.js +2 -2
  50. package/dist/safe-js/workerd.js +57987 -57738
  51. package/package.json +6 -5
  52. package/dist/safe-js/chunks/harness-3DDUS3RY.js +0 -10
  53. package/dist/safe-js/chunks/mcp-5TMFK3UE.js +0 -11
  54. package/dist/safe-js/chunks/migration-file-4CYSJ6LO.js +0 -14
  55. package/dist/safe-js/chunks/restore-GDHBT5ZD.js +0 -13
  56. package/dist/safe-js/chunks/run-M6N5KCPF.js +0 -19
  57. 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-4KMUWNZD.js";
10
+ } from "./chunk-ECMGBHAB.js";
12
11
  import {
13
12
  parseMcpConfig
14
- } from "./chunk-6H5VC5W5.js";
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-HPHCQNFV.js";
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-3NFTBEZR.js";
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-A3LXCGMJ.js";
43
+ } from "./chunk-EQUBWQJN.js";
44
44
  import {
45
45
  dirname,
46
46
  extname,
47
47
  paths_default
48
- } from "./chunk-MMN3IESA.js";
48
+ } from "./chunk-KMBCLXER.js";
49
49
  import {
50
50
  formatWithOptions,
51
51
  hostFs
52
- } from "./chunk-JCHJGIQA.js";
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-4CYSJ6LO.js");
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-M6N5KCPF.js"),
295
- import("./restore-GDHBT5ZD.js"),
296
- import("./dump-KUPBSXSL.js"),
297
- import("./runtime-modules-MGSXY4BN.js"),
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-5TMFK3UE.js")
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-3DDUS3RY.js"),
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-XV5OYKND.js";
8
- import "./chunk-5RLD4TVI.js";
9
- import "./chunk-A3LXCGMJ.js";
10
- import "./chunk-JCHJGIQA.js";
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,10 @@
1
+ import {
2
+ makeHarnessModule
3
+ } from "./chunk-6AO2T2VZ.js";
4
+ import "./chunk-BKNQTNHP.js";
5
+ import "./chunk-EQUBWQJN.js";
6
+ import "./chunk-VVOPJZRG.js";
7
+ import "./chunk-CQ52GEHY.js";
8
+ export {
9
+ makeHarnessModule
10
+ };
@@ -0,0 +1,11 @@
1
+ import {
2
+ makeMcpModule
3
+ } from "./chunk-P66QKVQC.js";
4
+ import "./chunk-CKOGIOB3.js";
5
+ import "./chunk-BKNQTNHP.js";
6
+ import "./chunk-EQUBWQJN.js";
7
+ import "./chunk-VVOPJZRG.js";
8
+ import "./chunk-CQ52GEHY.js";
9
+ export {
10
+ makeMcpModule
11
+ };
@@ -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-7THYP46K.js";
4
- import "./chunk-5RLD4TVI.js";
5
- import "./chunk-A3LXCGMJ.js";
6
- import "./chunk-JCHJGIQA.js";
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-3NFTBEZR.js";
4
- import "./chunk-MMN3IESA.js";
5
- import "./chunk-JCHJGIQA.js";
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
@@ -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-L4IABN2W.js");
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-L4IABN2W.js");
35
+ const { exitCodeForError } = await import("./chunks/cli-runtime-A353G7DR.js");
36
36
  return exitCodeForError(error);
37
37
  }
38
38
  }
@@ -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";
@@ -1,63 +1,87 @@
1
1
  import {
2
- makeTimeModule
3
- } from "./chunks/chunk-QRWRR6IA.js";
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-CK3YK2EC.js";
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-HPHCQNFV.js";
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-YCFOANSU.js";
26
+ } from "./chunks/chunk-BYDDUKS3.js";
20
27
  import {
21
28
  createRootedSourceResolver
22
- } from "./chunks/chunk-3NFTBEZR.js";
29
+ } from "./chunks/chunk-JQ5QJV5Q.js";
23
30
  import {
24
31
  createRealm,
25
32
  createReplayableRandom,
26
33
  run
27
- } from "./chunks/chunk-HFRBLE6Y.js";
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-XOMGWE37.js";
32
- import "./chunks/chunk-PMOXSLM5.js";
33
- import "./chunks/chunk-XV5OYKND.js";
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-5RLD4TVI.js";
49
+ } from "./chunks/chunk-BKNQTNHP.js";
38
50
  import {
39
- Budget
40
- } from "./chunks/chunk-A3LXCGMJ.js";
41
- import "./chunks/chunk-MMN3IESA.js";
42
- import "./chunks/chunk-JCHJGIQA.js";
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;
@@ -1,17 +1,6 @@
1
1
  export { admitNativePromiseProperties } from "./interp/native-promise-properties.js";
2
- import { type Module, type ParsedSourceModule } from "./parse/parser.js";
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";
@@ -2,13 +2,13 @@ import {
2
2
  inspectSnapshotMigration,
3
3
  migrateSnapshot,
4
4
  migrateSnapshotFile
5
- } from "./chunks/chunk-F6Y734YA.js";
5
+ } from "./chunks/chunk-SIR35W6T.js";
6
6
  import {
7
7
  createLintModulesFromRuntimeRegistry
8
- } from "./chunks/chunk-7THYP46K.js";
8
+ } from "./chunks/chunk-SMGNJNDU.js";
9
9
  import {
10
10
  makeMcpModule
11
- } from "./chunks/chunk-IB6WAQAE.js";
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-4KMUWNZD.js";
26
+ } from "./chunks/chunk-ECMGBHAB.js";
28
27
  import {
29
28
  parseMcpConfig
30
- } from "./chunks/chunk-6H5VC5W5.js";
29
+ } from "./chunks/chunk-CKOGIOB3.js";
31
30
  import {
32
- makeTimeModule
33
- } from "./chunks/chunk-QRWRR6IA.js";
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-CK3YK2EC.js";
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-HPHCQNFV.js";
49
+ } from "./chunks/chunk-RPGCF4KE.js";
45
50
  import "./chunks/chunk-X3YCE3ZH.js";
46
51
  import {
47
52
  makeFsModule
48
- } from "./chunks/chunk-YCFOANSU.js";
53
+ } from "./chunks/chunk-BYDDUKS3.js";
49
54
  import {
50
55
  createRootedSourceResolver
51
- } from "./chunks/chunk-3NFTBEZR.js";
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-HFRBLE6Y.js";
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
- restore
67
- } from "./chunks/chunk-XOMGWE37.js";
68
- import "./chunks/chunk-PMOXSLM5.js";
70
+ import "./chunks/chunk-CVPZFRCC.js";
71
+ import "./chunks/chunk-MJH73KJI.js";
69
72
  import {
70
73
  dump
71
- } from "./chunks/chunk-XV5OYKND.js";
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-5RLD4TVI.js";
84
+ } from "./chunks/chunk-BKNQTNHP.js";
83
85
  import {
84
86
  Budget,
85
87
  SandboxError,
86
88
  noopOtelSink,
87
- parse,
88
- parseModule,
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-MMN3IESA.js";
93
+ } from "./chunks/chunk-KMBCLXER.js";
94
94
  import {
95
95
  hostFs
96
- } from "./chunks/chunk-JCHJGIQA.js";
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
- deepCopyFromSandbox2 as deepCopyFromSandbox,
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
- parse2 as parse,
407
+ parse,
417
408
  parseEnvConfig,
418
409
  parseFsConfig,
419
410
  parseMcpConfig,
420
411
  parseModule2 as parseModule,
421
- parseSourceModule2 as parseSourceModule,
412
+ parseSourceModule,
422
413
  registerPendingHostCallPolicy,
423
414
  resolveFsConfig,
424
- restore2 as restore,
415
+ restore,
425
416
  run,
426
417
  runHarness,
427
418
  runHarnessPair,
@@ -155,6 +155,7 @@ export declare class HostCallJournal {
155
155
  reconcile(record: HostCallRecord, context?: HostCallResumeContext): Promise<HostCallOutcome>;
156
156
  private awaitReconciliation;
157
157
  snapshot(): HostCallRecord[];
158
+ inputPromiseOrder(): string[];
158
159
  dispose(): void;
159
160
  registerCallbackFunction(record: HostCallRecord, id: number, closure: SandboxClosure, native: object): void;
160
161
  registerHostCapability(path: string, closure: SandboxClosure, native: object): void;
@@ -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-YCFOANSU.js";
4
+ } from "../chunks/chunk-BYDDUKS3.js";
5
5
  import "../chunks/chunk-DIG26TEI.js";
6
6
  import "../chunks/chunk-ONWFPHUI.js";
7
- import "../chunks/chunk-5RLD4TVI.js";
8
- import "../chunks/chunk-A3LXCGMJ.js";
9
- import "../chunks/chunk-MMN3IESA.js";
10
- import "../chunks/chunk-JCHJGIQA.js";
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>>;
@@ -62,3 +62,4 @@ export { constants as fsConstants } from "node:fs";
62
62
  export const hostFs = nativeFsPromises;
63
63
  export const hostCwd = process.cwd.bind(process);
64
64
  export const hostPlatform = process.platform;
65
+ export const hostEnv = () => process.env;
@@ -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."); }
@@ -2,7 +2,7 @@ import {
2
2
  fsConstants,
3
3
  hostFs,
4
4
  paths_default
5
- } from "./chunk-H5X3T5VP.js";
5
+ } from "./chunk-W6MZOTYR.js";
6
6
 
7
7
  // packages/safe-js/src/modules/source-files.ts
8
8
  import { resolvePath } from "@poe-platform/safe-fs/core";