@poe-platform/safe-js 0.1.307 → 0.1.309

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-V6LQP64H.js";
30
+ } from "./chunk-A5S5VD23.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-W623YLMU.js.map
8252
+ //# sourceMappingURL=chunk-KZ2S6QYZ.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-W623YLMU.js";
25
+ } from "./chunks/chunk-KZ2S6QYZ.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-V6LQP64H.js";
37
+ } from "./chunks/chunk-A5S5VD23.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-V6LQP64H.js";
8
+ } from "./chunks/chunk-A5S5VD23.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-W623YLMU.js";
29
+ } from "./chunks/chunk-KZ2S6QYZ.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-V6LQP64H.js";
53
+ } from "./chunks/chunk-A5S5VD23.js";
54
54
  import "./chunks/chunk-4YIDX44G.js";
55
55
 
56
56
  // packages/safe-js/src/parse.ts
@@ -1,3 +1,6 @@
1
+ import type { GuestObjectState } from "./guest-heap.js";
2
+ export declare function captureFloat32State<T>(value: Float32Array, encode: (value: unknown) => T): GuestObjectState<T>;
3
+ export declare function restoreFloat32Properties<T>(value: Float32Array, state: GuestObjectState<T>, decode: (value: T) => unknown): void;
1
4
  export type Float32Data<TReference> = {
2
5
  kind: "float32array";
3
6
  byteOffset: number;
@@ -0,0 +1,114 @@
1
+ import { type SandboxErrorName } from "../error/shape.js";
2
+ import { type ScopeFrame } from "../interp/scope.js";
3
+ import { type PropertyDescriptorData } from "./property-descriptors.js";
4
+ import type { CompletionResult } from "../interp/exceptions.js";
5
+ import type { GeneratorExpressionState } from "../interp/generator-expression-state.js";
6
+ import { type IteratorSnapshot } from "../interp/iteration.js";
7
+ export type GeneratorFinallyCompletion<T> = Omit<CompletionResult, "value" | "node" | "stackFrames"> & {
8
+ value: T;
9
+ nodeId?: number;
10
+ stackFrames?: string[];
11
+ };
12
+ export type GuestObjectState<T> = {
13
+ properties: PropertyDescriptorData<T>;
14
+ prototype?: T;
15
+ };
16
+ export type GuestHeapNode<T> = {
17
+ kind: "bound-function";
18
+ target: T;
19
+ thisValue: T;
20
+ args: T[];
21
+ name?: string;
22
+ length: T;
23
+ state: GuestObjectState<T>;
24
+ } | {
25
+ kind: "array-iterator";
26
+ source: T;
27
+ index: number;
28
+ method: "keys" | "values" | "entries";
29
+ state: GuestObjectState<T>;
30
+ } | {
31
+ kind: "guest-class";
32
+ astNodeId: number;
33
+ scope: T;
34
+ name?: string;
35
+ fields: Array<{
36
+ index: number;
37
+ key: T;
38
+ }>;
39
+ state: GuestObjectState<T>;
40
+ } | {
41
+ kind: "map";
42
+ entries: Array<[T, T]>;
43
+ propertyState?: PropertyDescriptorData<T>;
44
+ prototype?: T;
45
+ } | {
46
+ kind: "set";
47
+ values: T[];
48
+ propertyState?: PropertyDescriptorData<T>;
49
+ prototype?: T;
50
+ } | {
51
+ kind: "raw-json";
52
+ text: string;
53
+ } | {
54
+ kind: "guest-generator";
55
+ state: "start" | "running" | "suspended" | "done";
56
+ astNodeId: number;
57
+ async: boolean;
58
+ scope: T;
59
+ closureScope: T;
60
+ suspendedScope?: T;
61
+ yieldNodeId?: number;
62
+ blockScopes?: Record<string, T>;
63
+ finallyCompletions?: Record<string, GeneratorFinallyCompletion<T>>;
64
+ expressionStates?: Record<string, GeneratorExpressionState<T, T, IteratorSnapshot<T>>>;
65
+ sent: Array<{
66
+ type: "normal" | "return" | "throw";
67
+ value: T;
68
+ }>;
69
+ environment?: {
70
+ homeObject?: T;
71
+ newTarget?: T;
72
+ };
73
+ objectState?: GuestObjectState<T>;
74
+ } | {
75
+ kind: "guest-object";
76
+ state: GuestObjectState<T>;
77
+ errorType?: SandboxErrorName;
78
+ } | {
79
+ kind: "guest-array";
80
+ state: GuestObjectState<T>;
81
+ templateNodeId?: number;
82
+ templateOwner?: T;
83
+ } | {
84
+ kind: "intrinsic";
85
+ id: string;
86
+ state?: GuestObjectState<T>;
87
+ } | {
88
+ kind: "guest-function";
89
+ astNodeId: number;
90
+ scope: T;
91
+ name?: string;
92
+ state: GuestObjectState<T>;
93
+ environment?: {
94
+ homeObject?: T;
95
+ newTarget?: T;
96
+ };
97
+ } | {
98
+ kind: "scope-frame";
99
+ parent: T;
100
+ importMeta: T;
101
+ functionBoundary: boolean;
102
+ chargeData: boolean;
103
+ bindings: Array<[string, number]>;
104
+ cells: Array<{
105
+ kind: ScopeFrame["cells"][number]["kind"];
106
+ } & ({
107
+ initialized: false;
108
+ } | {
109
+ initialized: true;
110
+ value: T;
111
+ })>;
112
+ restoredBindings?: Array<[string, T]>;
113
+ };
114
+ export declare function captureGuestHeapNode<T>(value: object, encode: (value: unknown) => T): GuestHeapNode<T> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-js",
3
- "version": "0.1.307",
3
+ "version": "0.1.309",
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.307",
61
+ "@poe-platform/safe-fs": "0.1.309",
62
62
  "yaml": "^2.8.2",
63
63
  "jose": "^6.1.3",
64
64
  "@types/node": "^25.2.2"