@poe-platform/safe-js 0.1.24 → 0.1.26

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-MXUOEOBE.js";
30
+ } from "./chunk-2LVAGOJR.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8245,4 +8245,4 @@ export {
8245
8245
  parseMcpConfig,
8246
8246
  makeMcpModule
8247
8247
  };
8248
- //# sourceMappingURL=chunk-X32RVLSM.js.map
8248
+ //# sourceMappingURL=chunk-I2SNTMRS.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-X32RVLSM.js";
25
+ } from "./chunks/chunk-I2SNTMRS.js";
26
26
  import {
27
27
  Budget,
28
28
  SandboxError,
@@ -34,7 +34,7 @@ import {
34
34
  replaceErrorStack,
35
35
  restore,
36
36
  run
37
- } from "./chunks/chunk-MXUOEOBE.js";
37
+ } from "./chunks/chunk-2LVAGOJR.js";
38
38
  import "./chunks/chunk-4YIDX44G.js";
39
39
 
40
40
  // packages/safe-js/src/cli.ts
@@ -5,7 +5,7 @@ import {
5
5
  defineExtension,
6
6
  lint,
7
7
  run
8
- } from "./chunks/chunk-MXUOEOBE.js";
8
+ } from "./chunks/chunk-2LVAGOJR.js";
9
9
  import "./chunks/chunk-4YIDX44G.js";
10
10
  export {
11
11
  Budget,
@@ -26,7 +26,7 @@ import {
26
26
  runWithSpawnUsageAccumulator,
27
27
  splitFrontmatter,
28
28
  supportsSpawnMode
29
- } from "./chunks/chunk-X32RVLSM.js";
29
+ } from "./chunks/chunk-I2SNTMRS.js";
30
30
  import {
31
31
  Budget,
32
32
  FileSnapshotBackend,
@@ -50,7 +50,7 @@ import {
50
50
  registerPendingHostCallPolicy,
51
51
  restore,
52
52
  run
53
- } from "./chunks/chunk-MXUOEOBE.js";
53
+ } from "./chunks/chunk-2LVAGOJR.js";
54
54
  import "./chunks/chunk-4YIDX44G.js";
55
55
 
56
56
  // packages/safe-js/src/parse.ts
@@ -12,7 +12,7 @@ declare const sandboxRegexPattern: unique symbol;
12
12
  declare const sandboxSetBrand: unique symbol;
13
13
  declare const sandboxRetainedValues: unique symbol;
14
14
  export type SandboxPrimitive = string | number | boolean | null | undefined;
15
- export type SandboxValue = SandboxPrimitive | Float32Array | SandboxObject | SandboxArray | SandboxClosure | SandboxGenerator | SandboxMap | SandboxSet | SandboxPromise | SandboxRegex;
15
+ export type SandboxValue = SandboxPrimitive | Date | Float32Array | SandboxObject | SandboxArray | SandboxClosure | SandboxGenerator | SandboxMap | SandboxSet | SandboxPromise | SandboxRegex;
16
16
  export type SandboxObject = {
17
17
  [key: string]: SandboxValue;
18
18
  };
@@ -55,6 +55,7 @@ export type SandboxCallContext = {
55
55
  };
56
56
  export type SandboxClosure = {
57
57
  readonly async?: true;
58
+ readonly generator?: true;
58
59
  readonly sandbox?: true;
59
60
  readonly boundTarget?: SandboxClosure;
60
61
  readonly cancellationSignal?: AbortSignal;
@@ -92,6 +93,7 @@ type CopyFromSandboxOptions = {
92
93
  export declare function createSandboxClosure(input: {
93
94
  guest?: boolean;
94
95
  async?: boolean;
96
+ generator?: boolean;
95
97
  sandbox?: boolean;
96
98
  boundTarget?: SandboxClosure;
97
99
  cancellationSignal?: AbortSignal;
@@ -4,7 +4,7 @@ import { type CallerInjectedBinding } from "./interp/host-bridge.js";
4
4
  import { type CallbackOptions, type SafeJSExtension } from "./extensions.js";
5
5
  import { type ModuleRegistry } from "./modules/registry.js";
6
6
  import type { ConsoleSink } from "./interp/globals/console-json.js";
7
- import type { RunOptions, RunResult } from "./run.js";
7
+ import type { RunClock, RunOptions, RunResult } from "./run.js";
8
8
  export type RealmLimits = {
9
9
  extensions?: number;
10
10
  hostObjects?: number;
@@ -14,6 +14,7 @@ export type RealmLimits = {
14
14
  nestedEvaluations?: number;
15
15
  };
16
16
  export type RealmOptions = {
17
+ clock?: RunClock;
17
18
  bindings?: Record<string, CallerInjectedBinding>;
18
19
  modules?: ModuleRegistry;
19
20
  extensions?: readonly SafeJSExtension[];
@@ -63,6 +63,8 @@ export type RunClockSnapshot = {
63
63
  next: number;
64
64
  };
65
65
  export type RunClock = {
66
+ now?: () => number;
67
+ restore?: (snapshot: RunClockSnapshot) => void;
66
68
  snapshot: () => RunClockSnapshot | undefined;
67
69
  };
68
70
  export type RunRandom = {
@@ -24,7 +24,10 @@ type Properties = Record<string, {
24
24
  enumerable: boolean;
25
25
  writable: boolean;
26
26
  }>;
27
- type DataNode = (Float32Data<Atom> & {
27
+ type DataNode = {
28
+ kind: "date";
29
+ time: number | null;
30
+ } | (Float32Data<Atom> & {
28
31
  properties: Properties;
29
32
  extensible: boolean;
30
33
  }) | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-js",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
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.24",
61
+ "@poe-platform/safe-fs": "0.1.26",
62
62
  "yaml": "^2.8.2",
63
63
  "jose": "^6.1.3",
64
64
  "@types/node": "^25.2.2"