@poe-platform/safe-js 0.1.313 → 0.1.315

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-HUG5DIKM.js";
30
+ } from "./chunk-C26TRM5L.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-Y6XY6F5K.js.map
8252
+ //# sourceMappingURL=chunk-PUYCRO6S.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-Y6XY6F5K.js";
25
+ } from "./chunks/chunk-PUYCRO6S.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-HUG5DIKM.js";
37
+ } from "./chunks/chunk-C26TRM5L.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-HUG5DIKM.js";
8
+ } from "./chunks/chunk-C26TRM5L.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-Y6XY6F5K.js";
29
+ } from "./chunks/chunk-PUYCRO6S.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-HUG5DIKM.js";
53
+ } from "./chunks/chunk-C26TRM5L.js";
54
54
  import "./chunks/chunk-4YIDX44G.js";
55
55
 
56
56
  // packages/safe-js/src/parse.ts
@@ -42,5 +42,6 @@ export declare function copyHostValueToSandbox(value: unknown, stackFrames: read
42
42
  errorData?: boolean;
43
43
  }, state: {
44
44
  seen: WeakMap<object, SandboxValue>;
45
+ float32Buffers?: WeakMap<ArrayBuffer, ArrayBuffer>;
45
46
  }, path: string): SandboxValue;
46
47
  export {};
@@ -17,7 +17,7 @@ declare const sandboxRegexBrand: unique symbol;
17
17
  declare const sandboxRegexPattern: unique symbol;
18
18
  declare const sandboxRetainedValues: unique symbol;
19
19
  export type SandboxPrimitive = string | number | bigint | boolean | symbol | null | undefined;
20
- export type SandboxValue = SandboxPrimitive | Date | Float32Array | SandboxObject | SandboxArray | SandboxClosure | SandboxGenerator | SandboxCollectionIterator | SandboxRegExpIterator | SandboxMap | SandboxSet | SandboxPromise | SandboxRegex;
20
+ export type SandboxValue = SandboxPrimitive | Date | Float32Array | ArrayBuffer | SandboxObject | SandboxArray | SandboxClosure | SandboxGenerator | SandboxCollectionIterator | SandboxRegExpIterator | SandboxMap | SandboxSet | SandboxPromise | SandboxRegex;
21
21
  export type SandboxObject = {
22
22
  [key: string]: SandboxValue;
23
23
  [key: symbol]: SandboxValue;
@@ -0,0 +1,13 @@
1
+ import type { GuestObjectState } from "./guest-heap.js";
2
+ export type ArrayBufferData<TReference> = {
3
+ kind: "arraybuffer";
4
+ } & ({
5
+ bytes: number[];
6
+ maxByteLength?: number;
7
+ } | {
8
+ buffer: TReference;
9
+ });
10
+ export declare function captureArrayBufferState<T>(value: ArrayBuffer, encode: (value: unknown) => T): GuestObjectState<T>;
11
+ export declare function encodeArrayBufferStorage<T>(value: ArrayBuffer, id: number, buffers: WeakMap<ArrayBuffer, number>, reference: (id: number) => T): ArrayBufferData<T>;
12
+ export declare function validateArrayBufferStorage(value: Record<string, unknown>): void;
13
+ export declare function decodeArrayBufferStorage(value: Record<string, unknown>, resolve: (reference: unknown) => unknown): ArrayBuffer;
@@ -1,15 +1,22 @@
1
1
  import type { GuestObjectState } from "./guest-heap.js";
2
+ import type { Budget } from "../interp/budget.js";
2
3
  export declare function captureFloat32State<T>(value: Float32Array, encode: (value: unknown) => T): GuestObjectState<T>;
3
4
  export declare function restoreFloat32Properties<T>(value: Float32Array, state: GuestObjectState<T>, decode: (value: T) => unknown): void;
4
5
  export type Float32Data<TReference> = {
5
6
  kind: "float32array";
6
7
  byteOffset: number;
7
8
  length: number;
9
+ lengthTracking?: true;
8
10
  } & ({
9
11
  bytes: number[];
10
12
  } | {
11
13
  buffer: TReference;
12
14
  });
15
+ export declare function encodeFloat32Layout(value: Float32Array): {
16
+ byteOffset: number;
17
+ length: number;
18
+ lengthTracking?: true;
19
+ };
13
20
  export declare function encodeFloat32Storage<TReference>(value: Float32Array, id: number, buffers: WeakMap<ArrayBuffer, number>, reference: (id: number) => TReference): Float32Data<TReference>;
14
21
  export declare function validateFloat32Storage(value: Record<string, unknown>): void;
15
- export declare function decodeFloat32Storage(value: Record<string, unknown>, resolve: (reference: unknown) => unknown): Float32Array;
22
+ export declare function decodeFloat32Storage(value: Record<string, unknown>, resolve: (reference: unknown) => unknown, budget?: Budget): Float32Array;
@@ -4,6 +4,7 @@ import { type SerializedSymbol, type SerializedSymbolProperty } from "./symbols.
4
4
  import { type CollectionIterationMethod } from "../interp/collection-iterator.js";
5
5
  import { CompileScope } from "../interp/regex/compile-guard.js";
6
6
  import { type Float32Data } from "./float32array.js";
7
+ import { type ArrayBufferData } from "./array-buffer.js";
7
8
  import { type SandboxErrorName } from "../error/shape.js";
8
9
  import { type SandboxClosure, type SandboxPromise, type SandboxValue } from "../interp/values.js";
9
10
  import { type SerializedArguments } from "./arguments.js";
@@ -69,6 +70,10 @@ type DataNode = {
69
70
  } | (Float32Data<Atom> & {
70
71
  properties: Properties;
71
72
  extensible: boolean;
73
+ }) | (ArrayBufferData<Atom> & {
74
+ properties: Properties;
75
+ extensible: boolean;
76
+ symbolEntries?: Array<SerializedSymbolProperty<Atom>>;
72
77
  }) | {
73
78
  kind: "capability";
74
79
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-js",
3
- "version": "0.1.313",
3
+ "version": "0.1.315",
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.313",
61
+ "@poe-platform/safe-fs": "0.1.315",
62
62
  "yaml": "^2.8.2",
63
63
  "jose": "^6.1.3",
64
64
  "@types/node": "^25.2.2"