@poe-platform/safe-js 0.1.212 → 0.1.214
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-FOLK4TOQ.js → chunk-7HDFRW4L.js} +2 -2
- package/dist/safe-js/chunks/{chunk-T34A2ZQF.js → chunk-OFYATXUI.js} +23180 -22500
- package/dist/safe-js/chunks/chunk-OFYATXUI.js.map +7 -0
- 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/async.d.ts +8 -0
- package/dist/safe-js/interp/exceptions.d.ts +9 -0
- package/dist/safe-js/interp/generator-expression-state.d.ts +9 -0
- package/dist/safe-js/interp/interpreter.d.ts +1 -1
- package/dist/safe-js/interp/scope.d.ts +19 -1
- package/dist/safe-js/snapshot/dump-format.d.ts +1 -1
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-T34A2ZQF.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-FOLK4TOQ.js.map → chunk-7HDFRW4L.js.map} +0 -0
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-7HDFRW4L.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-OFYATXUI.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-7HDFRW4L.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-OFYATXUI.js";
|
|
54
54
|
import "./chunks/chunk-4YIDX44G.js";
|
|
55
55
|
|
|
56
56
|
// packages/safe-js/src/parse.ts
|
|
@@ -53,7 +53,15 @@ export type AsyncEvaluationContext = {
|
|
|
53
53
|
};
|
|
54
54
|
generatorYield?: (value?: SandboxValue, yieldNodeId?: number) => Promise<GeneratorCompletion>;
|
|
55
55
|
asyncGenerator?: boolean;
|
|
56
|
+
captureGeneratorScope?: (scope: Scope, blocks?: ReadonlyMap<number, Scope>, completions?: ReadonlyMap<number, import("./exceptions.js").CompletionResult>, expressions?: ReadonlyMap<number, import("./generator-expression-state.js").GeneratorExpressionState>) => void;
|
|
57
|
+
generatorExpressionStates?: ReadonlyMap<number, import("./generator-expression-state.js").GeneratorExpressionState>;
|
|
58
|
+
restoredGeneratorExpressionStates?: ReadonlyMap<number, import("./generator-expression-state.js").GeneratorExpressionState>;
|
|
59
|
+
finallyCompletions?: ReadonlyMap<number, import("./exceptions.js").CompletionResult>;
|
|
60
|
+
restoredFinallyCompletions?: ReadonlyMap<number, import("./exceptions.js").CompletionResult>;
|
|
61
|
+
generatorBlockScopes?: ReadonlyMap<number, Scope>;
|
|
62
|
+
restoredGeneratorBlockScopes?: ReadonlyMap<number, Scope>;
|
|
56
63
|
generatorResume?: {
|
|
64
|
+
completed?: boolean;
|
|
57
65
|
sent: GeneratorCompletion[];
|
|
58
66
|
yieldNodeId: number;
|
|
59
67
|
};
|
|
@@ -30,6 +30,15 @@ type ExceptionContext = {
|
|
|
30
30
|
budget: Budget;
|
|
31
31
|
callStack: readonly string[];
|
|
32
32
|
scope: Scope;
|
|
33
|
+
generatorYield?: unknown;
|
|
34
|
+
generatorResume?: {
|
|
35
|
+
yieldNodeId: number;
|
|
36
|
+
completed?: boolean;
|
|
37
|
+
};
|
|
38
|
+
generatorBlockScopes?: ReadonlyMap<number, Scope>;
|
|
39
|
+
restoredGeneratorBlockScopes?: ReadonlyMap<number, Scope>;
|
|
40
|
+
finallyCompletions?: ReadonlyMap<number, CompletionResult>;
|
|
41
|
+
restoredFinallyCompletions?: ReadonlyMap<number, CompletionResult>;
|
|
33
42
|
toPropertyKey?: (value: SandboxValue) => string | symbol | Promise<string | symbol>;
|
|
34
43
|
getProperty?: (value: SandboxValue, key: PropertyKey) => SandboxValue | Promise<SandboxValue>;
|
|
35
44
|
};
|
|
@@ -70,6 +70,6 @@ type EvaluationContext = AsyncEvaluationContext;
|
|
|
70
70
|
type EvaluationResult = AsyncEvaluationResult;
|
|
71
71
|
export declare function interpret(node: ParseResult, options?: InterpretOptions): Promise<InterpreterResult>;
|
|
72
72
|
export { Scope } from "./scope.js";
|
|
73
|
-
declare function evaluateNode(node: ParseResult, context: EvaluationContext): Promise<EvaluationResult>;
|
|
73
|
+
export declare function evaluateNode(node: ParseResult, context: EvaluationContext): Promise<EvaluationResult>;
|
|
74
74
|
export declare function createPatternContext(context: AsyncEvaluationContext, scope?: Scope, evaluate?: typeof evaluateNode): PatternContext;
|
|
75
75
|
export declare function setSandboxProperty(target: SandboxValue, property: PropertyKey, value: SandboxValue, budget: Budget, checkInherited?: boolean, context?: SandboxCallContext): void | Promise<void>;
|
|
@@ -11,10 +11,26 @@ type ScopeOptions = {
|
|
|
11
11
|
functionBoundary?: boolean;
|
|
12
12
|
chargeData?: boolean;
|
|
13
13
|
};
|
|
14
|
+
export type ScopeFrame = {
|
|
15
|
+
parent?: Scope;
|
|
16
|
+
importMeta?: InterpreterValue;
|
|
17
|
+
functionBoundary: boolean;
|
|
18
|
+
chargeData: boolean;
|
|
19
|
+
bindings: Array<[string, number]>;
|
|
20
|
+
cells: Array<{
|
|
21
|
+
kind: VariableDeclarationKind;
|
|
22
|
+
} & ({
|
|
23
|
+
initialized: false;
|
|
24
|
+
} | {
|
|
25
|
+
initialized: true;
|
|
26
|
+
value: InterpreterValue;
|
|
27
|
+
})>;
|
|
28
|
+
restoredBindings?: Array<[string, InterpreterValue]>;
|
|
29
|
+
};
|
|
14
30
|
export declare class Scope {
|
|
15
31
|
#private;
|
|
16
32
|
private readonly parent?;
|
|
17
|
-
private
|
|
33
|
+
private importMeta?;
|
|
18
34
|
private readonly options;
|
|
19
35
|
constructor(bindings?: Record<string, InterpreterValue>, parent?: Scope | undefined, importMeta?: InterpreterValue, options?: ScopeOptions, restoredBindings?: Record<string, InterpreterValue>);
|
|
20
36
|
child(bindings?: Record<string, InterpreterValue>, options?: ScopeOptions): Scope;
|
|
@@ -37,6 +53,8 @@ export declare class Scope {
|
|
|
37
53
|
assign(name: string, value: InterpreterValue): void;
|
|
38
54
|
lookup(name: string): ScopeLookupResult;
|
|
39
55
|
snapshot(): InterpreterSnapshot;
|
|
56
|
+
captureFrame(): ScopeFrame;
|
|
57
|
+
hydrateFrame(frame: ScopeFrame): void;
|
|
40
58
|
copyInitializedBindingsFrom(source: Scope, names: readonly string[]): void;
|
|
41
59
|
private resolveScope;
|
|
42
60
|
private requireInitializedBinding;
|
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.214",
|
|
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.214",
|
|
62
62
|
"yaml": "^2.8.2",
|
|
63
63
|
"jose": "^6.1.3",
|
|
64
64
|
"@types/node": "^25.2.2"
|