@poe-platform/safe-js 0.1.720 → 0.1.722
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/README.md +50 -7
- package/dist/config-mutations/types.d.ts +3 -1
- package/dist/safe-js/chunks/{chunk-B2SQLK4O.js → chunk-3QQYJ4RQ.js} +3 -2
- package/dist/safe-js/chunks/chunk-3QQYJ4RQ.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-OP3H3ZDN.js → chunk-55RIIUGG.js} +23 -7
- package/dist/safe-js/chunks/chunk-55RIIUGG.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-NJM2Q74Z.js → chunk-7SBQ7WTV.js} +10 -11
- package/dist/safe-js/chunks/chunk-7SBQ7WTV.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-KP6I45ET.js → chunk-BNIEPGDU.js} +9885 -8523
- package/dist/safe-js/chunks/{chunk-KP6I45ET.js.map → chunk-BNIEPGDU.js.map} +4 -4
- package/dist/safe-js/chunks/{chunk-HYD4K4HN.js → chunk-D3GC5QPZ.js} +63 -1
- package/dist/safe-js/chunks/chunk-D3GC5QPZ.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-KK5NCR5R.js → chunk-EH5A2EQI.js} +501 -150
- package/dist/safe-js/chunks/chunk-EH5A2EQI.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-APKV5Y6T.js → chunk-FA5CQO6V.js} +2 -2
- package/dist/safe-js/chunks/{chunk-RML35GIF.js → chunk-GCOLKRMY.js} +4 -4
- package/dist/safe-js/chunks/{chunk-U6KZ2DQ2.js → chunk-K3ZRBAG5.js} +3 -3
- package/dist/safe-js/chunks/{chunk-BGJXQN4A.js → chunk-QL2ALAE6.js} +4 -4
- package/dist/safe-js/chunks/{chunk-IDQ67DY2.js → chunk-RYVHEOHM.js} +1131 -101
- package/dist/safe-js/chunks/chunk-RYVHEOHM.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-A7CADQAD.js → chunk-S2GFVXSI.js} +3 -3
- package/dist/safe-js/chunks/{chunk-XMA6FOJU.js → chunk-WF7HYDJ4.js} +4 -5
- package/dist/safe-js/chunks/{chunk-XMA6FOJU.js.map → chunk-WF7HYDJ4.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-NEJ44T4Y.js → chunk-XHSOM5CG.js} +2 -2
- package/dist/safe-js/chunks/{cli-runtime-PO6DQDHP.js → cli-runtime-6QPGM3TX.js} +14 -14
- package/dist/safe-js/chunks/{dump-TRGFSCJ7.js → dump-TU6SYRFD.js} +4 -4
- package/dist/safe-js/chunks/{fs-4T5MZW5J.js → fs-HTZT32MQ.js} +4 -4
- package/dist/safe-js/chunks/harness-RYAMI444.js +10 -0
- package/dist/safe-js/chunks/mcp-DO2IRFGQ.js +11 -0
- package/dist/safe-js/chunks/migration-file-K7UH5ZG6.js +12 -0
- package/dist/safe-js/chunks/restore-7LRP4BM3.js +13 -0
- package/dist/safe-js/chunks/run-6SETM7SV.js +17 -0
- package/dist/safe-js/chunks/runtime-modules-MCQS2SHQ.js +10 -0
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +7 -7
- package/dist/safe-js/extensions.d.ts +3 -1
- package/dist/safe-js/index.js +14 -14
- package/dist/safe-js/interp/async.d.ts +4 -1
- package/dist/safe-js/interp/budget.d.ts +15 -6
- package/dist/safe-js/interp/collection-iterator.d.ts +1 -1
- package/dist/safe-js/interp/host-bridge.d.ts +1 -0
- package/dist/safe-js/interp/host-capabilities.d.ts +13 -4
- package/dist/safe-js/interp/interpreter.d.ts +5 -1
- package/dist/safe-js/interp/intl-numberformat.d.ts +2 -2
- package/dist/safe-js/interp/jobs.d.ts +8 -0
- package/dist/safe-js/interp/scope.d.ts +13 -3
- package/dist/safe-js/interp/typed-array.d.ts +5 -2
- package/dist/safe-js/interp/values.d.ts +1 -0
- package/dist/safe-js/modules/registry.d.ts +4 -1
- package/dist/safe-js/modules/source-graph.d.ts +19 -1
- package/dist/safe-js/parse/compact-spans.d.ts +18 -0
- package/dist/safe-js/parse/dynamic-source.d.ts +3 -1
- package/dist/safe-js/parse/function-source.d.ts +1 -1
- package/dist/safe-js/parse/parser.d.ts +8 -3
- package/dist/safe-js/parse/tokenizer.d.ts +4 -0
- package/dist/safe-js/realm.d.ts +17 -3
- package/dist/safe-js/restore.d.ts +1 -0
- package/dist/safe-js/run.d.ts +10 -0
- package/dist/safe-js/snapshot/guest-heap.d.ts +1 -0
- package/dist/toolcraft-design/prompts/primitives/note.d.ts +1 -1
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-B2SQLK4O.js.map +0 -7
- package/dist/safe-js/chunks/chunk-HYD4K4HN.js.map +0 -7
- package/dist/safe-js/chunks/chunk-IDQ67DY2.js.map +0 -7
- package/dist/safe-js/chunks/chunk-KK5NCR5R.js.map +0 -7
- package/dist/safe-js/chunks/chunk-NJM2Q74Z.js.map +0 -7
- package/dist/safe-js/chunks/chunk-OP3H3ZDN.js.map +0 -7
- package/dist/safe-js/chunks/harness-DLEQ2Z3O.js +0 -10
- package/dist/safe-js/chunks/mcp-TNVEFJ6K.js +0 -11
- package/dist/safe-js/chunks/migration-file-IDIUFLKY.js +0 -12
- package/dist/safe-js/chunks/restore-P27AUZR2.js +0 -13
- package/dist/safe-js/chunks/run-KGAEHYMV.js +0 -17
- package/dist/safe-js/chunks/runtime-modules-KICK45EE.js +0 -10
- /package/dist/safe-js/chunks/{chunk-APKV5Y6T.js.map → chunk-FA5CQO6V.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-RML35GIF.js.map → chunk-GCOLKRMY.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-U6KZ2DQ2.js.map → chunk-K3ZRBAG5.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-BGJXQN4A.js.map → chunk-QL2ALAE6.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-A7CADQAD.js.map → chunk-S2GFVXSI.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-NEJ44T4Y.js.map → chunk-XHSOM5CG.js.map} +0 -0
- /package/dist/safe-js/chunks/{cli-runtime-PO6DQDHP.js.map → cli-runtime-6QPGM3TX.js.map} +0 -0
- /package/dist/safe-js/chunks/{dump-TRGFSCJ7.js.map → dump-TU6SYRFD.js.map} +0 -0
- /package/dist/safe-js/chunks/{fs-4T5MZW5J.js.map → fs-HTZT32MQ.js.map} +0 -0
- /package/dist/safe-js/chunks/{harness-DLEQ2Z3O.js.map → harness-RYAMI444.js.map} +0 -0
- /package/dist/safe-js/chunks/{mcp-TNVEFJ6K.js.map → mcp-DO2IRFGQ.js.map} +0 -0
- /package/dist/safe-js/chunks/{migration-file-IDIUFLKY.js.map → migration-file-K7UH5ZG6.js.map} +0 -0
- /package/dist/safe-js/chunks/{restore-P27AUZR2.js.map → restore-7LRP4BM3.js.map} +0 -0
- /package/dist/safe-js/chunks/{run-KGAEHYMV.js.map → run-6SETM7SV.js.map} +0 -0
- /package/dist/safe-js/chunks/{runtime-modules-KICK45EE.js.map → runtime-modules-MCQS2SHQ.js.map} +0 -0
|
@@ -5,7 +5,9 @@ export declare const typedArrayViewLayouts: WeakMap<NumericTypedArray, {
|
|
|
5
5
|
byteOffset: number;
|
|
6
6
|
length?: number;
|
|
7
7
|
}>;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function createOwnedTypedArray(Native: NumericTypedArrayConstructor, args: unknown[]): NumericTypedArray;
|
|
9
|
+
export declare function nativeTypedArrayView<T extends object>(value: T): T;
|
|
10
|
+
export declare function restoreTypedArrayView(buffer: ArrayBufferLike, byteOffset: number, length?: number, budget?: Budget, Native?: NumericTypedArrayConstructor, owned?: boolean): NumericTypedArray;
|
|
9
11
|
export declare function isNumericTypedArray(value: unknown): value is NumericTypedArray;
|
|
10
12
|
export declare function typedArrayStorage(value: NumericTypedArray, requireInBounds?: boolean): {
|
|
11
13
|
buffer: ArrayBufferLike;
|
|
@@ -16,6 +18,7 @@ export declare function typedArrayStorage(value: NumericTypedArray, requireInBou
|
|
|
16
18
|
elementSize: number;
|
|
17
19
|
};
|
|
18
20
|
export declare function typedArrayProperties(value: NumericTypedArray): Array<[PropertyKey, PropertyDescriptor]>;
|
|
21
|
+
export declare function typedArraySymbolKeys(value: NumericTypedArray): symbol[];
|
|
19
22
|
export declare function typedArrayDataProperties(value: NumericTypedArray): Array<[string, PropertyDescriptor]>;
|
|
20
23
|
export declare function isTypedArrayIndex(key: string): boolean;
|
|
21
24
|
export declare function typedArrayNumber(value: unknown): number;
|
|
@@ -23,5 +26,5 @@ export declare function checkTypedArrayAllocation(length: number, budget: Budget
|
|
|
23
26
|
export declare function copyTypedArrayStorage<TValue>(value: NumericTypedArray, state: {
|
|
24
27
|
seen: WeakMap<object, TValue>;
|
|
25
28
|
float32Buffers?: WeakMap<ArrayBufferLike, ArrayBufferLike>;
|
|
26
|
-
}): NumericTypedArray;
|
|
29
|
+
}, owned?: boolean): NumericTypedArray;
|
|
27
30
|
export declare function requireUint8Array(value: unknown): Uint8Array<ArrayBuffer>;
|
|
@@ -136,6 +136,7 @@ export declare function createSandboxClosure(input: {
|
|
|
136
136
|
properties?: SandboxObject | ((closure: SandboxClosure) => SandboxObject);
|
|
137
137
|
retainedValues?: () => Iterable<SandboxValue>;
|
|
138
138
|
}): SandboxClosure;
|
|
139
|
+
export declare function registerDeferredClosureChargeIdentity(closure: SandboxClosure, identity: object): void;
|
|
139
140
|
export declare function ownEnumerableSandboxEntries(value: SandboxValue, excludedKeys?: ReadonlySet<string>): Array<[string, SandboxValue]>;
|
|
140
141
|
export declare function ownSandboxSymbolKeys(value: SandboxValue): symbol[];
|
|
141
142
|
export declare function ownEnumerableSandboxKeys(value: SandboxValue): string[];
|
|
@@ -20,6 +20,7 @@ export type ModuleEnvironmentOptions = {
|
|
|
20
20
|
prepareNamespace?: (namespace: Record<string, SandboxValue>, moduleName: string) => Record<string, SandboxValue>;
|
|
21
21
|
};
|
|
22
22
|
export declare function createModuleEnvironment(modules: ModuleRegistry | undefined, options: ModuleEnvironmentOptions, restored?: ModuleEnvironment): ModuleEnvironment;
|
|
23
|
+
export declare function createImmutableEmptyModuleEnvironment(options: ModuleEnvironmentOptions): ModuleEnvironment;
|
|
23
24
|
export declare function resolveModuleNamespace(environment: ModuleEnvironment, moduleName: string, prepare?: boolean): Record<string, SandboxValue>;
|
|
24
25
|
export declare function resolveModuleFunction(environment: ModuleEnvironment, origin: ModuleFunctionOrigin): SandboxClosure;
|
|
25
26
|
export declare function createUnknownModuleMessage(moduleName: string, moduleNames: readonly string[]): string;
|
|
@@ -28,5 +29,7 @@ export declare function resolveModuleImports(module: Module, modules: ModuleRegi
|
|
|
28
29
|
environment?: ModuleEnvironment;
|
|
29
30
|
allowMissing?: boolean;
|
|
30
31
|
}): Record<string, SandboxValue>;
|
|
31
|
-
export declare function attachSourceLoader(environment: ModuleEnvironment, loader: (specifier: string, referrer: string) => Promise<Record<string, SandboxValue
|
|
32
|
+
export declare function attachSourceLoader(environment: ModuleEnvironment, loader: (specifier: string, referrer: string) => Promise<Record<string, SandboxValue>>, options?: {
|
|
33
|
+
preserveImmutableNamespaces?: true;
|
|
34
|
+
}): void;
|
|
32
35
|
export declare function importModuleNamespace(environment: ModuleEnvironment, specifier: string, referrer: string): Record<string, SandboxValue> | Promise<Record<string, SandboxValue>>;
|
|
@@ -19,7 +19,11 @@ export declare class SourceModuleGraph {
|
|
|
19
19
|
private readonly records;
|
|
20
20
|
private readonly requests;
|
|
21
21
|
private requestDataSize;
|
|
22
|
+
private lookupDataSize;
|
|
22
23
|
private readonly pendingImports;
|
|
24
|
+
private fulfilledImports;
|
|
25
|
+
private rejectedImports;
|
|
26
|
+
private readonly importGroup;
|
|
23
27
|
private readonly jobs;
|
|
24
28
|
private readonly evaluationStack;
|
|
25
29
|
private evaluationIndex;
|
|
@@ -27,10 +31,24 @@ export declare class SourceModuleGraph {
|
|
|
27
31
|
scope: Scope;
|
|
28
32
|
resolver: SourceResolver;
|
|
29
33
|
modules: ModuleEnvironment;
|
|
34
|
+
serializePreparation?: boolean;
|
|
35
|
+
importDeadline?: {
|
|
36
|
+
timeoutMs: number;
|
|
37
|
+
abort(reason: unknown): void;
|
|
38
|
+
};
|
|
30
39
|
});
|
|
31
40
|
close(): void;
|
|
41
|
+
sourceModuleStatus(): Readonly<{
|
|
42
|
+
pendingImports: number;
|
|
43
|
+
preparedModules: number;
|
|
44
|
+
fulfilledImports: number;
|
|
45
|
+
rejectedImports: number;
|
|
46
|
+
}>;
|
|
32
47
|
import(specifier: string, referrer: string): Promise<SandboxObject>;
|
|
33
|
-
|
|
48
|
+
private startImportDeadline;
|
|
49
|
+
withoutImportGroup<Result>(task: () => Result): Result;
|
|
50
|
+
withImportGroup<Result>(task: () => Promise<Result>): Promise<Result>;
|
|
51
|
+
settle(pendingImports?: Set<Promise<SandboxObject>>): Promise<void>;
|
|
34
52
|
evaluateSource(source: SourceModule, beforeEvaluation?: (module: Module) => void): Promise<SandboxObject>;
|
|
35
53
|
private register;
|
|
36
54
|
private load;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SourceSpan } from "./parser.js";
|
|
2
|
+
import type { Position } from "./tokenizer.js";
|
|
3
|
+
/** Immutable source coordinates shared by compiler-owned offset spans. */
|
|
4
|
+
export declare class CompactSourcePositions {
|
|
5
|
+
private readonly sourceLength;
|
|
6
|
+
private readonly lines;
|
|
7
|
+
private readonly positions;
|
|
8
|
+
private readonly makeSpan;
|
|
9
|
+
constructor(source: string);
|
|
10
|
+
position(offset: number): Position;
|
|
11
|
+
span(start: number, end: number): SourceSpan;
|
|
12
|
+
compatiblePosition(position: Position): Position | undefined;
|
|
13
|
+
private assertOffset;
|
|
14
|
+
}
|
|
15
|
+
/** Rebased template coordinates compact only when their existing data agrees. */
|
|
16
|
+
export declare function compactDerivedPosition(base: Position, position: Position): Position | undefined;
|
|
17
|
+
/** Only privately owned points from the same source can become offset spans. */
|
|
18
|
+
export declare function compactSourceSpan(start: Position, end: Position): SourceSpan | undefined;
|
|
@@ -23,7 +23,9 @@ export declare function createDynamicSource(kind: DynamicFunctionKind, parameter
|
|
|
23
23
|
};
|
|
24
24
|
export declare function createEvalSource(body: string, context: Omit<EvalParseContext, "privateNames"> & {
|
|
25
25
|
privateNames?: Iterable<string>;
|
|
26
|
-
}, owner?: CompileOwner
|
|
26
|
+
}, owner?: CompileOwner, filename?: string, options?: {
|
|
27
|
+
compactAst?: boolean;
|
|
28
|
+
}): {
|
|
27
29
|
source: {
|
|
28
30
|
body: string;
|
|
29
31
|
nodes: Map<number, ParseResult>;
|
|
@@ -4,7 +4,7 @@ export type FunctionSource = {
|
|
|
4
4
|
readonly start: number;
|
|
5
5
|
readonly end: number;
|
|
6
6
|
};
|
|
7
|
-
export declare const functionSources: WeakMap<
|
|
7
|
+
export declare const functionSources: WeakMap<FunctionNode | ClassNode, FunctionSource>;
|
|
8
8
|
export declare const templateSources: WeakMap<TemplateLiteral, string>;
|
|
9
9
|
export declare const functionStrictness: WeakMap<FunctionNode, boolean>;
|
|
10
10
|
/** Eval-root declarations are instantiated before statement execution. */
|
|
@@ -421,8 +421,11 @@ export type Expression = ArrowFunctionExpression | AssignmentExpression | ArrayE
|
|
|
421
421
|
export type ParseResult = Expression | Statement;
|
|
422
422
|
export declare function parse(source: string, filename?: string, owner?: CompileOwner): ParseResult;
|
|
423
423
|
export declare function parseModule(source: string, filename?: string, owner?: CompileOwner): Module;
|
|
424
|
-
export declare function parseSourceModule(source: string, filename?: string, owner?: CompileOwner
|
|
425
|
-
|
|
424
|
+
export declare function parseSourceModule(source: string, filename?: string, owner?: CompileOwner, options?: {
|
|
425
|
+
sharedPositions?: boolean;
|
|
426
|
+
compactAst?: boolean;
|
|
427
|
+
}): ParsedSourceModule;
|
|
428
|
+
export declare function parseExecutableModule(source: string, filename?: string, owner?: CompileOwner, importSpecifiers?: readonly string[]): Module;
|
|
426
429
|
export type EvalParseContext = {
|
|
427
430
|
strict?: boolean;
|
|
428
431
|
newTarget?: boolean;
|
|
@@ -431,7 +434,9 @@ export type EvalParseContext = {
|
|
|
431
434
|
arguments?: boolean;
|
|
432
435
|
privateNames?: ReadonlySet<string>;
|
|
433
436
|
};
|
|
434
|
-
export declare function parseEvalScript(source: string, context?: EvalParseContext, owner?: CompileOwner
|
|
437
|
+
export declare function parseEvalScript(source: string, context?: EvalParseContext, owner?: CompileOwner, filename?: string, options?: {
|
|
438
|
+
compactAst?: boolean;
|
|
439
|
+
}): {
|
|
435
440
|
node: Module;
|
|
436
441
|
strict: boolean;
|
|
437
442
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CompactSourcePositions } from "./compact-spans.js";
|
|
1
2
|
import { type CompileScope } from "../interp/regex/compile-guard.js";
|
|
2
3
|
export type Position = {
|
|
3
4
|
line: number;
|
|
@@ -30,7 +31,10 @@ export type TokenizeOptions = {
|
|
|
30
31
|
allowHtmlComments?: boolean;
|
|
31
32
|
comments?: Comment[];
|
|
32
33
|
compilation?: CompileScope;
|
|
34
|
+
sharedPositions?: boolean;
|
|
33
35
|
};
|
|
34
36
|
export declare const RESERVED_IDENTIFIER_SPELLINGS: Set<string>;
|
|
35
37
|
export declare function tokenize(source: string, options?: TokenizeOptions): Token[];
|
|
38
|
+
/** Internal classic compilation with bounded materialized token/position caches. */
|
|
39
|
+
export declare function tokenizeCompact(source: string, options: TokenizeOptions, positions: CompactSourcePositions): Token[];
|
|
36
40
|
export declare function collectComments(source: string): Comment[];
|
package/dist/safe-js/realm.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type InterpreterResult } from "./interp/interpreter.js";
|
|
|
3
3
|
import { SandboxJobQueue, type ExecutionControl } from "./interp/jobs.js";
|
|
4
4
|
import { type CallerInjectedBinding } from "./interp/host-bridge.js";
|
|
5
5
|
import { type CallbackOptions, type CallbackInvocation, type SafeJSExtension } from "./extensions.js";
|
|
6
|
-
import { type SourceResolver } from "./modules/source-graph.js";
|
|
6
|
+
import { SourceModuleGraph, type SourceResolver } from "./modules/source-graph.js";
|
|
7
7
|
import { type ModuleRegistry } from "./modules/registry.js";
|
|
8
8
|
import type { ConsoleSink } from "./interp/globals/console-json.js";
|
|
9
9
|
import type { RunClock, RunOptions, RunResult } from "./run.js";
|
|
@@ -16,7 +16,13 @@ export type RealmLimits = {
|
|
|
16
16
|
nestedEvaluations?: number;
|
|
17
17
|
};
|
|
18
18
|
export type RealmOptions = {
|
|
19
|
+
stringCompilation?: "allow" | "deny";
|
|
20
|
+
classicScripts?: boolean;
|
|
21
|
+
classicScriptErrors?: "fatal" | "report";
|
|
22
|
+
callbackScheduling?: "after-prefix";
|
|
19
23
|
sourceResolver?: SourceResolver;
|
|
24
|
+
/** Elapsed host-time limit per dynamic import; expiry revokes the whole realm. */
|
|
25
|
+
sourceImportTimeoutMs?: number;
|
|
20
26
|
clock?: RunClock;
|
|
21
27
|
bindings?: Record<string, CallerInjectedBinding>;
|
|
22
28
|
modules?: ModuleRegistry;
|
|
@@ -35,19 +41,27 @@ export type RealmResult = (Omit<Extract<InterpreterResult, {
|
|
|
35
41
|
ok: true;
|
|
36
42
|
}>, "snapshot" | "returnValue"> & {
|
|
37
43
|
returnValue?: unknown;
|
|
38
|
-
}) | Omit<Extract<InterpreterResult, {
|
|
44
|
+
}) | (Omit<Extract<InterpreterResult, {
|
|
39
45
|
ok: false;
|
|
40
|
-
}>, "snapshot"
|
|
46
|
+
}>, "snapshot"> & {
|
|
47
|
+
recoverable?: true;
|
|
48
|
+
});
|
|
41
49
|
export type SafeJSRealm = ExecutionControl & {
|
|
50
|
+
readonly stringCompilation: "allow" | "deny";
|
|
51
|
+
readonly classicScriptErrors: "fatal" | "report";
|
|
52
|
+
readonly supportsDiscardResult: true;
|
|
53
|
+
readonly sourceImportTimeoutMs?: number;
|
|
42
54
|
readonly extensions: readonly SafeJSExtension["manifest"][];
|
|
43
55
|
evaluate(source: string, options?: {
|
|
44
56
|
filename?: string;
|
|
45
57
|
sourceType?: "module";
|
|
58
|
+
discardResult?: boolean;
|
|
46
59
|
}): Promise<RealmResult>;
|
|
47
60
|
startCallback(callback: unknown, options?: CallbackOptions): CallbackInvocation;
|
|
48
61
|
invokeCallback(callback: unknown, options?: CallbackOptions): Promise<unknown>;
|
|
49
62
|
releaseCallback(callback: unknown): void;
|
|
50
63
|
releaseGuestReference(reference: unknown): void;
|
|
64
|
+
sourceModuleStatus(): ReturnType<SourceModuleGraph["sourceModuleStatus"]>;
|
|
51
65
|
close(): Promise<void>;
|
|
52
66
|
};
|
|
53
67
|
export declare function createRealm(options?: RealmOptions): SafeJSRealm;
|
package/dist/safe-js/run.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { type OtelSink } from "./observability/otel.js";
|
|
|
15
15
|
import type { SnapshotBackend } from "./snapshot/backend.js";
|
|
16
16
|
import { type ReplayData } from "./snapshot/replay-data.js";
|
|
17
17
|
export type RunOptions = {
|
|
18
|
+
importSpecifiers?: readonly string[];
|
|
18
19
|
sourceType?: "module";
|
|
19
20
|
sourceResolver?: SourceResolver;
|
|
20
21
|
sourceRoot?: string;
|
|
@@ -27,6 +28,15 @@ export type RunOptions = {
|
|
|
27
28
|
clock?: RunClock;
|
|
28
29
|
entryPointArgs?: readonly unknown[];
|
|
29
30
|
filename?: string;
|
|
31
|
+
/** Trusted diagnostic mapping; re-supply when resuming a snapshot. Does not change source or execution. */
|
|
32
|
+
sourceLocation?: (position: {
|
|
33
|
+
line: number;
|
|
34
|
+
column: number;
|
|
35
|
+
}) => {
|
|
36
|
+
filename: string;
|
|
37
|
+
line: number;
|
|
38
|
+
column: number;
|
|
39
|
+
} | undefined;
|
|
30
40
|
importMeta?: Record<string, unknown>;
|
|
31
41
|
hostCallResumeProvider?: HostCallResumeProvider;
|
|
32
42
|
modules?: ModuleRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function note(message: string, title?: string): void;
|
|
1
|
+
export declare function note(message: string, title?: string, write?: (chunk: string) => void): void;
|
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.722",
|
|
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.722",
|
|
62
62
|
"@petamoriken/float16": "^3.9.3",
|
|
63
63
|
"@formatjs/intl-localematcher": "0.8.13",
|
|
64
64
|
"@formatjs/bigdecimal": "0.2.7",
|