@poe-platform/safe-js 0.1.231 → 0.1.232

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-5SF3QHIJ.js";
30
+ } from "./chunk-CCJSAZ73.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-NOPEM57U.js.map
8252
+ //# sourceMappingURL=chunk-HRN2V5KG.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-NOPEM57U.js";
25
+ } from "./chunks/chunk-HRN2V5KG.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-5SF3QHIJ.js";
37
+ } from "./chunks/chunk-CCJSAZ73.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-5SF3QHIJ.js";
8
+ } from "./chunks/chunk-CCJSAZ73.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-NOPEM57U.js";
29
+ } from "./chunks/chunk-HRN2V5KG.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-5SF3QHIJ.js";
53
+ } from "./chunks/chunk-CCJSAZ73.js";
54
54
  import "./chunks/chunk-4YIDX44G.js";
55
55
 
56
56
  // packages/safe-js/src/parse.ts
@@ -2,6 +2,15 @@ import type { SandboxValue } from "./values.js";
2
2
  import type { Scope } from "./scope.js";
3
3
  import type { SandboxIterator, IteratorSnapshot } from "./iteration.js";
4
4
  export type GeneratorExpressionState<T = SandboxValue, S = Scope, I = SandboxIterator | IteratorSnapshot> = {
5
+ kind: "array-pattern";
6
+ phase: "reference" | "binding";
7
+ index: number;
8
+ done: boolean;
9
+ current: T;
10
+ iterator: I;
11
+ referenceObject?: T;
12
+ referenceKey?: T;
13
+ } | {
5
14
  kind: "for-of-array";
6
15
  phase: "left" | "body";
7
16
  values: T;
@@ -19,6 +28,7 @@ export type GeneratorExpressionState<T = SandboxValue, S = Scope, I = SandboxIte
19
28
  iterator: I;
20
29
  } | {
21
30
  kind: "for-in";
31
+ phase?: "left" | "body";
22
32
  object: T;
23
33
  keys: string[];
24
34
  index: number;
@@ -2,6 +2,7 @@ import type { AssignmentPattern, MemberExpression, ParseResult, RestElement, Var
2
2
  import type { AsyncEvaluationResult } from "./async.js";
3
3
  import type { Scope } from "./scope.js";
4
4
  import { Budget } from "./budget.js";
5
+ import type { GeneratorExpressionState } from "./generator-expression-state.js";
5
6
  import { type SandboxCallContext, type SandboxValue } from "./values.js";
6
7
  type Pattern = VariableDeclarator["id"] | AssignmentPattern | MemberExpression | RestElement;
7
8
  export type AssignmentReference = {
@@ -15,6 +16,8 @@ export type PatternTarget = {
15
16
  assign: true;
16
17
  };
17
18
  export type PatternContext = {
19
+ restoredPatternState?(id: number): GeneratorExpressionState | undefined;
20
+ withPatternState?(id: number, state: GeneratorExpressionState): PatternContext;
18
21
  prepareMemberReference?(pattern: MemberExpression): Promise<{
19
22
  ok: true;
20
23
  reference: AssignmentReference;
@@ -320,7 +320,7 @@ export type ForOfStatement = BaseNode & {
320
320
  };
321
321
  export type ForInStatement = BaseNode & {
322
322
  type: "ForInStatement";
323
- left: Identifier | VariableDeclaration;
323
+ left: PatternTarget | VariableDeclaration;
324
324
  right: Expression;
325
325
  body: Statement;
326
326
  label?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-js",
3
- "version": "0.1.231",
3
+ "version": "0.1.232",
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.231",
61
+ "@poe-platform/safe-fs": "0.1.232",
62
62
  "yaml": "^2.8.2",
63
63
  "jose": "^6.1.3",
64
64
  "@types/node": "^25.2.2"