@poe-platform/safe-js 0.1.228 → 0.1.229
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.
- package/dist/safe-js/chunks/{chunk-PHJUQHVC.js → chunk-WWVQVQWC.js} +10176 -10036
- package/dist/safe-js/chunks/chunk-WWVQVQWC.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-NJ2FVOTB.js → chunk-YKU535ND.js} +2 -2
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +1 -1
- package/dist/safe-js/index.js +2 -2
- package/dist/safe-js/interp/generator-expression-state.d.ts +18 -1
- package/dist/safe-js/interp/iteration.d.ts +18 -0
- package/dist/safe-js/interp/patterns.d.ts +8 -1
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-PHJUQHVC.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-NJ2FVOTB.js.map → chunk-YKU535ND.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WWVQVQWC.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-
|
|
8252
|
+
//# sourceMappingURL=chunk-YKU535ND.js.map
|
package/dist/safe-js/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveFsConfig,
|
|
23
23
|
splitFrontmatter,
|
|
24
24
|
withBrokenPipeGuard
|
|
25
|
-
} from "./chunks/chunk-
|
|
25
|
+
} from "./chunks/chunk-YKU535ND.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-
|
|
37
|
+
} from "./chunks/chunk-WWVQVQWC.js";
|
|
38
38
|
import "./chunks/chunk-4YIDX44G.js";
|
|
39
39
|
|
|
40
40
|
// packages/safe-js/src/cli.ts
|
package/dist/safe-js/core.js
CHANGED
package/dist/safe-js/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
runWithSpawnUsageAccumulator,
|
|
27
27
|
splitFrontmatter,
|
|
28
28
|
supportsSpawnMode
|
|
29
|
-
} from "./chunks/chunk-
|
|
29
|
+
} from "./chunks/chunk-YKU535ND.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-
|
|
53
|
+
} from "./chunks/chunk-WWVQVQWC.js";
|
|
54
54
|
import "./chunks/chunk-4YIDX44G.js";
|
|
55
55
|
|
|
56
56
|
// packages/safe-js/src/parse.ts
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import type { SandboxValue } from "./values.js";
|
|
2
2
|
import type { Scope } from "./scope.js";
|
|
3
|
-
|
|
3
|
+
import type { SandboxIterator, IteratorSnapshot } from "./iteration.js";
|
|
4
|
+
export type GeneratorExpressionState<T = SandboxValue, S = Scope, I = SandboxIterator | IteratorSnapshot> = {
|
|
5
|
+
kind: "for-of-array";
|
|
6
|
+
phase: "left" | "body";
|
|
7
|
+
values: T;
|
|
8
|
+
current: T;
|
|
9
|
+
index: number;
|
|
10
|
+
scope: S;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "for-of-iterator";
|
|
13
|
+
phase: "left" | "body";
|
|
14
|
+
async: boolean;
|
|
15
|
+
value: T;
|
|
16
|
+
current: T;
|
|
17
|
+
index: number;
|
|
18
|
+
scope: S;
|
|
19
|
+
iterator: I;
|
|
20
|
+
} | {
|
|
4
21
|
kind: "for-in";
|
|
5
22
|
object: T;
|
|
6
23
|
keys: string[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type SandboxGenerator, type SandboxCallContext, type SandboxValue } from "./values.js";
|
|
2
2
|
import { Budget } from "./budget.js";
|
|
3
3
|
export type SandboxIterator = {
|
|
4
|
+
snapshot?(): IteratorSnapshot;
|
|
4
5
|
readonly asyncProtocol?: true;
|
|
5
6
|
readonly generator?: true;
|
|
6
7
|
readonly asynchronous?: true;
|
|
@@ -14,6 +15,23 @@ export type SandboxIterator = {
|
|
|
14
15
|
return?(value?: SandboxValue): IteratorResult<SandboxValue> | Promise<IteratorResult<SandboxValue>>;
|
|
15
16
|
throw?(error?: SandboxValue): IteratorResult<SandboxValue> | Promise<IteratorResult<SandboxValue>>;
|
|
16
17
|
};
|
|
18
|
+
export type IteratorSnapshot<T = SandboxValue> = {
|
|
19
|
+
kind: "guest";
|
|
20
|
+
value: T;
|
|
21
|
+
next: T;
|
|
22
|
+
async: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "builtin";
|
|
25
|
+
value: T;
|
|
26
|
+
index: number;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "async-from-sync";
|
|
29
|
+
inner: IteratorSnapshot<T>;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "unsupported";
|
|
32
|
+
};
|
|
33
|
+
export declare function mapIteratorSnapshot<T, U>(snapshot: IteratorSnapshot<T>, map: (value: T) => U): IteratorSnapshot<U>;
|
|
34
|
+
export declare function restoreSandboxIterator(snapshot: IteratorSnapshot, budget: Budget, context: SandboxCallContext, signal?: AbortSignal): Promise<SandboxIterator>;
|
|
17
35
|
export declare function acquireSandboxIterator(value: SandboxValue, budget: Budget, context: SandboxCallContext, asyncProtocol?: boolean, signal?: AbortSignal): Promise<SandboxIterator | undefined>;
|
|
18
36
|
export declare function readIteratorResult(iterator: SandboxIterator, result: IteratorResult<SandboxValue>, property: "done" | "value"): Promise<{
|
|
19
37
|
value: SandboxValue;
|
|
@@ -4,7 +4,7 @@ import type { Scope } from "./scope.js";
|
|
|
4
4
|
import { Budget } from "./budget.js";
|
|
5
5
|
import { type SandboxCallContext, type SandboxValue } from "./values.js";
|
|
6
6
|
type Pattern = VariableDeclarator["id"] | AssignmentPattern | MemberExpression | RestElement;
|
|
7
|
-
type AssignmentReference = {
|
|
7
|
+
export type AssignmentReference = {
|
|
8
8
|
object: SandboxValue;
|
|
9
9
|
key: PropertyKey;
|
|
10
10
|
};
|
|
@@ -15,6 +15,13 @@ export type PatternTarget = {
|
|
|
15
15
|
assign: true;
|
|
16
16
|
};
|
|
17
17
|
export type PatternContext = {
|
|
18
|
+
prepareMemberReference?(pattern: MemberExpression): Promise<{
|
|
19
|
+
ok: true;
|
|
20
|
+
reference: AssignmentReference;
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
result: AsyncEvaluationResult;
|
|
24
|
+
}>;
|
|
18
25
|
budget?: Budget;
|
|
19
26
|
callContext?: SandboxCallContext;
|
|
20
27
|
evaluate(node: ParseResult, inferredName?: string): Promise<AsyncEvaluationResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.229",
|
|
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.
|
|
61
|
+
"@poe-platform/safe-fs": "0.1.229",
|
|
62
62
|
"yaml": "^2.8.2",
|
|
63
63
|
"jose": "^6.1.3",
|
|
64
64
|
"@types/node": "^25.2.2"
|