@poe-platform/safe-js 0.1.433 → 0.1.435

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-35AKWKAL.js";
30
+ } from "./chunk-H3E7APSE.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-HBSJ2KM3.js.map
8252
+ //# sourceMappingURL=chunk-JJ3J6ZJF.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-HBSJ2KM3.js";
25
+ } from "./chunks/chunk-JJ3J6ZJF.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-35AKWKAL.js";
37
+ } from "./chunks/chunk-H3E7APSE.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-35AKWKAL.js";
8
+ } from "./chunks/chunk-H3E7APSE.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-HBSJ2KM3.js";
29
+ } from "./chunks/chunk-JJ3J6ZJF.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-35AKWKAL.js";
53
+ } from "./chunks/chunk-H3E7APSE.js";
54
54
  import "./chunks/chunk-4YIDX44G.js";
55
55
 
56
56
  // packages/safe-js/src/parse.ts
@@ -2,10 +2,12 @@ import type { VariableDeclarationKind } from "../parse.js";
2
2
  import type { PrivateName } from "./private-state.js";
3
3
  import type { InterpreterSnapshot, InterpreterValue } from "./interpreter.js";
4
4
  import type { ResourceScopeState } from "./resource-management.js";
5
+ import type { SandboxObject } from "./values.js";
5
6
  type ScopeLookupResult = {
6
7
  found: true;
7
8
  kind: VariableDeclarationKind;
8
9
  value: InterpreterValue;
10
+ object?: SandboxObject;
9
11
  } | {
10
12
  found: false;
11
13
  };
@@ -14,6 +16,7 @@ type ScopeOptions = {
14
16
  chargeData?: boolean;
15
17
  };
16
18
  export type ScopeFrame = {
19
+ objectEnvironment?: SandboxObject;
17
20
  resourceState?: ResourceScopeState;
18
21
  privateNames?: Array<[string, PrivateName]>;
19
22
  parent?: Scope;
@@ -36,6 +39,7 @@ export declare class Scope {
36
39
  private readonly parent?;
37
40
  private importMeta?;
38
41
  private readonly options;
42
+ private objectEnvironment?;
39
43
  resourceState?: ResourceScopeState;
40
44
  privateNames?: Map<string, PrivateName>;
41
45
  constructor(bindings?: Record<string, InterpreterValue>, parent?: Scope | undefined, importMeta?: InterpreterValue, options?: ScopeOptions, restoredBindings?: Record<string, InterpreterValue>);
@@ -53,12 +57,13 @@ export declare class Scope {
53
57
  isFunctionBoundary(): boolean;
54
58
  iterationChild(names: readonly string[]): Scope;
55
59
  lookupImportMeta(): InterpreterValue;
60
+ lookupThis(): InterpreterValue;
56
61
  retainedValues(): InterpreterValue[];
57
62
  declare(name: string, kind: VariableDeclarationKind, value: InterpreterValue): void;
58
63
  declareAlias(name: string, target: string): void;
59
64
  declareVar(name: string): void;
60
65
  predeclare(name: string, kind: VariableDeclarationKind): void;
61
- assign(name: string, value: InterpreterValue): void;
66
+ assign(name: string, value: InterpreterValue, setProperty?: (object: SandboxObject, key: string, value: InterpreterValue) => void | Promise<void>): void | Promise<void>;
62
67
  lookup(name: string): ScopeLookupResult;
63
68
  snapshot(): InterpreterSnapshot;
64
69
  captureFrame(): ScopeFrame;
@@ -355,6 +355,7 @@ export type GuestHeapNode<T> = {
355
355
  importMeta: T;
356
356
  functionBoundary: boolean;
357
357
  chargeData: boolean;
358
+ objectEnvironment?: T;
358
359
  resourceState?: T;
359
360
  privateNames?: Array<[string, T]>;
360
361
  bindings: Array<[string, number]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-js",
3
- "version": "0.1.433",
3
+ "version": "0.1.435",
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.433",
61
+ "@poe-platform/safe-fs": "0.1.435",
62
62
  "@petamoriken/float16": "^3.9.3",
63
63
  "yaml": "^2.8.2",
64
64
  "jose": "^6.1.3",