@poe-platform/safe-js 0.1.384 → 0.1.386

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.
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-4OTKJDYX.js";
25
+ } from "./chunks/chunk-IZEDCQDW.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-N3C4UP54.js";
37
+ } from "./chunks/chunk-XJL73BPS.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-N3C4UP54.js";
8
+ } from "./chunks/chunk-XJL73BPS.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-4OTKJDYX.js";
29
+ } from "./chunks/chunk-IZEDCQDW.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-N3C4UP54.js";
53
+ } from "./chunks/chunk-XJL73BPS.js";
54
54
  import "./chunks/chunk-4YIDX44G.js";
55
55
 
56
56
  // packages/safe-js/src/parse.ts
@@ -1,5 +1,6 @@
1
1
  import type { Budget } from "./budget.js";
2
- import type { SandboxMap, SandboxSet, SandboxValue } from "./values.js";
2
+ import type { SandboxMap, SandboxSet, SandboxValue, SandboxObject } from "./values.js";
3
+ export declare const collectionIteratorPrototypes: WeakMap<Budget, Partial<Record<"set" | "map", SandboxObject>>>;
3
4
  declare const collectionIteratorBrand: unique symbol;
4
5
  export type SandboxCollectionIterator = {
5
6
  readonly [collectionIteratorBrand]: true;
@@ -16,7 +17,7 @@ type IteratorState = Omit<CollectionIteratorSnapshot, "index"> & {
16
17
  iterator: Iterator<SandboxValue> | undefined;
17
18
  };
18
19
  export declare function isSandboxCollectionIterator(value: unknown): value is SandboxCollectionIterator;
19
- export declare function createSandboxCollectionIterator(collection: SandboxMap | SandboxSet, method: CollectionIterationMethod): SandboxCollectionIterator;
20
+ export declare function createSandboxCollectionIterator(collection: SandboxMap | SandboxSet, method: CollectionIterationMethod, budget?: Budget): SandboxCollectionIterator;
20
21
  export declare function restoreSandboxCollectionIterator(snapshot: CollectionIteratorSnapshot, target?: SandboxCollectionIterator): SandboxCollectionIterator;
21
22
  export declare function collectionIteratorState(value: SandboxCollectionIterator): Readonly<IteratorState>;
22
23
  export declare function snapshotCollectionIterator(value: SandboxCollectionIterator): CollectionIteratorSnapshot;
@@ -1,4 +1,6 @@
1
- import type { SandboxValue } from "./values.js";
1
+ import type { SandboxObject, SandboxValue } from "./values.js";
2
+ import type { Budget } from "./budget.js";
3
+ export declare const regexpIteratorPrototypes: WeakMap<Budget, SandboxObject>;
2
4
  declare const regexpIteratorBrand: unique symbol;
3
5
  export type SandboxRegExpIterator = {
4
6
  readonly [regexpIteratorBrand]: true;
@@ -11,6 +13,6 @@ export type RegExpIteratorState = {
11
13
  unicode?: boolean;
12
14
  };
13
15
  export declare function isSandboxRegExpIterator(value: unknown): value is SandboxRegExpIterator;
14
- export declare function restoreSandboxRegExpIterator(state: RegExpIteratorState, target?: SandboxRegExpIterator): SandboxRegExpIterator;
16
+ export declare function restoreSandboxRegExpIterator(state: RegExpIteratorState, target?: SandboxRegExpIterator, budget?: Budget): SandboxRegExpIterator;
15
17
  export declare function regexpIteratorState(value: SandboxRegExpIterator): RegExpIteratorState;
16
18
  export {};
@@ -1,4 +1,5 @@
1
1
  import { type SandboxErrorName } from "../error/shape.js";
2
+ import { type CollectionIterationMethod } from "../interp/collection-iterator.js";
2
3
  import { type ScopeFrame } from "../interp/scope.js";
3
4
  import { type PropertyDescriptorData } from "./property-descriptors.js";
4
5
  import type { CompletionResult } from "../interp/exceptions.js";
@@ -21,6 +22,22 @@ export type GuestHeapNode<T> = {
21
22
  input: T;
22
23
  index: number;
23
24
  state: GuestObjectState<T>;
25
+ } | {
26
+ kind: "guest-collection-iterator";
27
+ collectionKind: "map" | "set";
28
+ method: CollectionIterationMethod;
29
+ collection: T;
30
+ index: number;
31
+ exhausted: boolean;
32
+ state: GuestObjectState<T>;
33
+ } | {
34
+ kind: "guest-regexp-iterator";
35
+ matcher: T;
36
+ input: T;
37
+ exhausted: boolean;
38
+ global?: boolean;
39
+ unicode?: boolean;
40
+ state: GuestObjectState<T>;
24
41
  } | {
25
42
  kind: "bound-function";
26
43
  target: T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-js",
3
- "version": "0.1.384",
3
+ "version": "0.1.386",
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.384",
61
+ "@poe-platform/safe-fs": "0.1.386",
62
62
  "@petamoriken/float16": "^3.9.3",
63
63
  "yaml": "^2.8.2",
64
64
  "jose": "^6.1.3",