@poe-platform/safe-js 0.1.736 → 0.1.738
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-UVJ27MVC.js → chunk-35JWEKXL.js} +2 -2
- package/dist/safe-js/chunks/{chunk-356QH3RB.js → chunk-4TXOBR4J.js} +2 -2
- package/dist/safe-js/chunks/{chunk-7AHNAUR5.js → chunk-7DLY2WYQ.js} +2 -2
- package/dist/safe-js/chunks/{chunk-SBFOCNNW.js → chunk-ELJ4PYL2.js} +5 -4
- package/dist/safe-js/chunks/{chunk-SBFOCNNW.js.map → chunk-ELJ4PYL2.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-FUUG7UIZ.js → chunk-FKV4UG26.js} +3 -3
- package/dist/safe-js/chunks/{chunk-WDEOWDLS.js → chunk-FOPBX4EE.js} +17 -3
- package/dist/safe-js/chunks/chunk-FOPBX4EE.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-33AKDRQ4.js → chunk-HR4F3RRX.js} +2 -2
- package/dist/safe-js/chunks/{chunk-LELXBLG2.js → chunk-JRUMDV3W.js} +5 -5
- package/dist/safe-js/chunks/{chunk-IKRAX7Z5.js → chunk-OEFI64BI.js} +2 -2
- package/dist/safe-js/chunks/{chunk-ZNAW4ZDX.js → chunk-QUDIENBB.js} +2 -2
- package/dist/safe-js/chunks/{cli-runtime-FMSBDP7G.js → cli-runtime-GZL4KBFM.js} +8 -8
- package/dist/safe-js/chunks/{dump-2IM3WE2J.js → dump-5HPQH2TV.js} +3 -3
- package/dist/safe-js/chunks/{harness-ZLV6ZBEU.js → harness-3Z4ABNRY.js} +3 -3
- package/dist/safe-js/chunks/{mcp-42AFDWT3.js → mcp-PADFJXDB.js} +3 -3
- package/dist/safe-js/chunks/{migration-file-AYLLA72K.js → migration-file-WIJFLWAW.js} +4 -4
- package/dist/safe-js/chunks/{restore-SGQO4E4M.js → restore-275PJW3U.js} +4 -4
- package/dist/safe-js/chunks/{run-Q5Z4TRQO.js → run-N3TS7H43.js} +6 -6
- package/dist/safe-js/chunks/{runtime-modules-3P6FZJ55.js → runtime-modules-75NU2HLD.js} +3 -3
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +5 -5
- package/dist/safe-js/index.js +10 -10
- package/dist/safe-js/modules/fs.js +2 -2
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-WDEOWDLS.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-UVJ27MVC.js.map → chunk-35JWEKXL.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-356QH3RB.js.map → chunk-4TXOBR4J.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-7AHNAUR5.js.map → chunk-7DLY2WYQ.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-FUUG7UIZ.js.map → chunk-FKV4UG26.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-33AKDRQ4.js.map → chunk-HR4F3RRX.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-LELXBLG2.js.map → chunk-JRUMDV3W.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-IKRAX7Z5.js.map → chunk-OEFI64BI.js.map} +0 -0
- /package/dist/safe-js/chunks/{chunk-ZNAW4ZDX.js.map → chunk-QUDIENBB.js.map} +0 -0
- /package/dist/safe-js/chunks/{cli-runtime-FMSBDP7G.js.map → cli-runtime-GZL4KBFM.js.map} +0 -0
- /package/dist/safe-js/chunks/{dump-2IM3WE2J.js.map → dump-5HPQH2TV.js.map} +0 -0
- /package/dist/safe-js/chunks/{harness-ZLV6ZBEU.js.map → harness-3Z4ABNRY.js.map} +0 -0
- /package/dist/safe-js/chunks/{mcp-42AFDWT3.js.map → mcp-PADFJXDB.js.map} +0 -0
- /package/dist/safe-js/chunks/{migration-file-AYLLA72K.js.map → migration-file-WIJFLWAW.js.map} +0 -0
- /package/dist/safe-js/chunks/{restore-SGQO4E4M.js.map → restore-275PJW3U.js.map} +0 -0
- /package/dist/safe-js/chunks/{run-Q5Z4TRQO.js.map → run-N3TS7H43.js.map} +0 -0
- /package/dist/safe-js/chunks/{runtime-modules-3P6FZJ55.js.map → runtime-modules-75NU2HLD.js.map} +0 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
validateMigrationReconciliation,
|
|
11
11
|
validateMigrationSemantics,
|
|
12
12
|
validateSnapshotMigration
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OEFI64BI.js";
|
|
14
14
|
import {
|
|
15
15
|
DUMP_FORMAT_VERSION,
|
|
16
16
|
EXECUTION_SEMANTICS,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
serializeSafeJSSnapshot,
|
|
21
21
|
validateDumpEnvelope,
|
|
22
22
|
validateSnapshotData
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ELJ4PYL2.js";
|
|
24
24
|
import {
|
|
25
25
|
parseModule
|
|
26
26
|
} from "./chunk-VQGYRKM4.js";
|
|
@@ -215,4 +215,4 @@ export {
|
|
|
215
215
|
migrateSnapshot,
|
|
216
216
|
migrateSnapshotFile
|
|
217
217
|
};
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
218
|
+
//# sourceMappingURL=chunk-FKV4UG26.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
hashParsedAst,
|
|
3
3
|
hashSource,
|
|
4
4
|
validateSnapshotMigration
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OEFI64BI.js";
|
|
6
6
|
import {
|
|
7
7
|
SnapshotValidationError,
|
|
8
8
|
assertSnapshotInactive,
|
|
@@ -13,9 +13,10 @@ import {
|
|
|
13
13
|
serializeSafeJSSnapshot,
|
|
14
14
|
validateDumpEnvelope,
|
|
15
15
|
validateGuestFunctionAst,
|
|
16
|
+
validateGuestHeapGraphs,
|
|
16
17
|
validateRuntimeSnapshotDescriptors,
|
|
17
18
|
validateTemplateObjects
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ELJ4PYL2.js";
|
|
19
20
|
import {
|
|
20
21
|
ParseError,
|
|
21
22
|
parseExecutableModule,
|
|
@@ -86,6 +87,7 @@ function restore(snapshot, options, owner) {
|
|
|
86
87
|
}
|
|
87
88
|
for (const entry of Object.values(node)) pending.push(entry);
|
|
88
89
|
}
|
|
90
|
+
const functionConstructibility = /* @__PURE__ */ new Map();
|
|
89
91
|
for (const [id, value] of closures) {
|
|
90
92
|
const record = value;
|
|
91
93
|
if (record.kind === "guest-array") continue;
|
|
@@ -93,10 +95,22 @@ function restore(snapshot, options, owner) {
|
|
|
93
95
|
const origin = nodes.get(record.astNodeId);
|
|
94
96
|
try {
|
|
95
97
|
validateGuestFunctionAst(record, origin);
|
|
98
|
+
if (record.kind === "guest-function") {
|
|
99
|
+
const node = origin;
|
|
100
|
+
functionConstructibility.set(
|
|
101
|
+
id,
|
|
102
|
+
(node.type === "FunctionDeclaration" || node.type === "FunctionExpression" && !node.method) && !node.async && !node.generator && !record.environment?.classInitializer
|
|
103
|
+
);
|
|
104
|
+
}
|
|
96
105
|
} catch (error) {
|
|
97
106
|
throw new SnapshotValidationError("invalidValue", `$.heap[${JSON.stringify(id)}].astNodeId`, error instanceof Error ? error.message : String(error));
|
|
98
107
|
}
|
|
99
108
|
}
|
|
109
|
+
try {
|
|
110
|
+
validateGuestHeapGraphs(snapshot.heap, functionConstructibility);
|
|
111
|
+
} catch (error) {
|
|
112
|
+
throw new SnapshotValidationError("invalidValue", "$.heap", error instanceof Error ? error.message : String(error));
|
|
113
|
+
}
|
|
100
114
|
try {
|
|
101
115
|
validateTemplateObjects(snapshot.heap, functions.values(), dynamicSources);
|
|
102
116
|
} catch (error) {
|
|
@@ -111,4 +125,4 @@ export {
|
|
|
111
125
|
SnapshotMismatchError,
|
|
112
126
|
restore
|
|
113
127
|
};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-FOPBX4EE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/restore.ts"],
|
|
4
|
+
"sourcesContent": ["import { hashParsedAst, hashSource } from \"./parse/hash.js\";\nimport type { CompileOwner } from \"./interp/budget.js\";\nimport { replaceErrorStack } from \"./error/shape.js\";\nimport { SnapshotValidationError, validateDumpEnvelope, validateRuntimeSnapshotDescriptors } from \"./snapshot/validation.js\";\nimport { inMemoryRunSnapshots, serializeSafeJSSnapshot } from \"./snapshot/dump-format.js\";\nimport { assertSnapshotInactive } from \"./interp/running-state.js\";\nimport { validateSnapshotMigration, type SnapshotMigration } from \"./snapshot/migration.js\";\nimport { parseExecutableModule, parseModule } from \"./parse/parser.js\";\nimport { ParseError } from \"./parse/format-error.js\";\nimport { createModuleSource, createDynamicSource, createEvalSource, type DynamicSource, type EvalSourceContext } from \"./parse/dynamic-source.js\";\nimport { validateGuestFunctionAst } from \"./snapshot/guest-ast-validation.js\";\nimport { validateGuestHeapGraphs } from \"./snapshot/guest-heap-validation.js\";\nimport { validateTemplateObjects } from \"./snapshot/template-validation.js\";\nimport type { ParseResult } from \"./parse.js\";\n\nexport type SafeJSSnapshot = {\n version?: number;\n sourceHash: string;\n migration?: SnapshotMigration;\n clock?: {\n next: number;\n };\n random?: {\n seed: number;\n state: number;\n initialState?: number;\n resumeState?: number;\n };\n [key: string]: unknown;\n};\n\nexport type RestoreOptions = {\n source: string;\n importSpecifiers?: readonly string[];\n};\n\nexport class SnapshotMismatchError extends Error {\n readonly actualHash: string;\n readonly expectedHash: string;\n\n constructor(expectedHash: string, actualHash: string) {\n super(\n `source changed since snapshot was taken (hash ${expectedHash} expected, got ${actualHash}); pass --reset to discard`\n );\n this.name = \"SnapshotMismatchError\";\n this.actualHash = actualHash;\n this.expectedHash = expectedHash;\n replaceErrorStack(this);\n }\n}\n\nexport function restore<TSnapshot extends SafeJSSnapshot>(\n snapshot: TSnapshot,\n options: RestoreOptions,\n owner?: CompileOwner\n): TSnapshot {\n assertSnapshotInactive(snapshot);\n try {\n validateDumpEnvelope(snapshot, { resume: true });\n } catch (error) {\n if (!(error instanceof SnapshotValidationError) || error.code !== \"invalidState\" || error.path === \"$.replayError\" ||\n !inMemoryRunSnapshots.has(snapshot)) throw error;\n // Runtime snapshots can retain guest descriptor state. Use the same portable\n // representation as dump(), then apply all normal validation below.\n validateRuntimeSnapshotDescriptors(snapshot);\n snapshot = JSON.parse(serializeSafeJSSnapshot(snapshot)) as TSnapshot;\n validateDumpEnvelope(snapshot, { resume: true });\n }\n validateSnapshotMigration(snapshot.migration, snapshot.sourceHash, owner);\n\n const includeFunctionSource = snapshot.executionSemantics !== \"jobs-v6\" && snapshot.executionSemantics !== \"jobs-v7\";\n const currentSourceHash = options.importSpecifiers === undefined\n ? hashSource(options.source, owner, includeFunctionSource)\n : hashParsedAst(parseExecutableModule(options.source, \"<input>\", owner, options.importSpecifiers), includeFunctionSource);\n\n if (snapshot.sourceHash !== currentSourceHash) {\n throw new SnapshotMismatchError(snapshot.sourceHash, currentSourceHash);\n }\n\n if (snapshot.heap !== undefined && typeof snapshot.heap === \"object\" && snapshot.heap !== null) {\n const entries = Object.entries(snapshot.heap);\n const closures = entries.filter(([, value]) =>\n value !== null && typeof value === \"object\" && ([\"guest-function\", \"guest-class\", \"guest-generator\"].includes(String((value as Record<string, unknown>).kind)) ||\n (value as Record<string, unknown>).templateNodeId !== undefined));\n const dynamicSources = new Map<number, DynamicSource>();\n for (const [id, value] of entries) {\n const record = value as Record<string, unknown>;\n if (record.kind === \"guest-source\" || record.kind === \"guest-script\") {\n try {\n const compiled = record.kind === \"guest-script\"\n ? createEvalSource(record.body as string, record.context as EvalSourceContext, owner)\n : record.functionKind === \"module\" ? createModuleSource(record.body as string, owner)\n : createDynamicSource(record.functionKind as Exclude<DynamicSource[\"kind\"], \"eval\" | \"module\">,\n record.parameters as string, record.body as string, owner);\n dynamicSources.set(Number(id), compiled.source);\n } catch (error) {\n if (!(error instanceof SyntaxError) && !(error instanceof ParseError)) throw error;\n throw new SnapshotValidationError(\"invalidValue\", `$.heap[${JSON.stringify(id)}]`, error.message);\n }\n }\n }\n if (closures.length > 0) {\n const functions = new Map<number, Record<string, unknown>>();\n const pending: unknown[] = [options.importSpecifiers === undefined\n ? parseModule(options.source, \"<input>\", owner)\n : parseExecutableModule(options.source, \"<input>\", owner, options.importSpecifiers)];\n while (pending.length > 0) {\n const value = pending.pop();\n if (value === null || typeof value !== \"object\") continue;\n const node = value as Record<string, unknown>;\n if (typeof node.nodeId === \"number\") {\n functions.set(node.nodeId, node);\n }\n for (const entry of Object.values(node)) pending.push(entry);\n }\n const functionConstructibility = new Map<string, boolean>();\n for (const [id, value] of closures) {\n const record = value as Record<string, unknown>;\n if (record.kind === \"guest-array\") continue;\n const nodes = record.dynamicSource === undefined ? functions\n : dynamicSources.get((record.dynamicSource as {id: number}).id)!.nodes;\n const origin = nodes.get(record.astNodeId as number);\n try {\n validateGuestFunctionAst(record, origin);\n if (record.kind === \"guest-function\") {\n const node = origin as Record<string, unknown>;\n functionConstructibility.set(id,\n (node.type === \"FunctionDeclaration\" || (node.type === \"FunctionExpression\" && !node.method)) &&\n !node.async && !node.generator && !(record.environment as Record<string, unknown> | undefined)?.classInitializer);\n }\n }\n catch (error) {\n throw new SnapshotValidationError(\"invalidValue\", `$.heap[${JSON.stringify(id)}].astNodeId`, error instanceof Error ? error.message : String(error));\n }\n }\n try { validateGuestHeapGraphs(snapshot.heap as Record<string, unknown>, functionConstructibility); }\n catch (error) { throw new SnapshotValidationError(\"invalidValue\", \"$.heap\", error instanceof Error ? error.message : String(error)); }\n try { validateTemplateObjects(snapshot.heap as Record<string, unknown>, functions.values() as Iterable<ParseResult>, dynamicSources); }\n catch (error) { throw new SnapshotValidationError(\"invalidValue\", \"$.heap\", String(error)); }\n }\n }\n\n return snapshot;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO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VQGYRKM4.js";
|
|
@@ -195,4 +195,4 @@ export {
|
|
|
195
195
|
dumpCurrent,
|
|
196
196
|
serializeRunSnapshot
|
|
197
197
|
};
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
198
|
+
//# sourceMappingURL=chunk-HR4F3RRX.js.map
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
} from "./chunk-2GVBG23M.js";
|
|
8
8
|
import {
|
|
9
9
|
restore
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FOPBX4EE.js";
|
|
11
11
|
import {
|
|
12
12
|
hashParsedAst,
|
|
13
13
|
hashSource
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OEFI64BI.js";
|
|
15
15
|
import {
|
|
16
16
|
attachDumpController,
|
|
17
17
|
createDumpController
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HR4F3RRX.js";
|
|
19
19
|
import {
|
|
20
20
|
DUMP_FORMAT_VERSION,
|
|
21
21
|
EXECUTION_SEMANTICS,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
withSandboxPromiseRejectionTracker,
|
|
104
104
|
wrapCallerInjectedBindings,
|
|
105
105
|
wrapCancelableBindings
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-ELJ4PYL2.js";
|
|
107
107
|
import {
|
|
108
108
|
Budget,
|
|
109
109
|
CompileScope,
|
|
@@ -2839,4 +2839,4 @@ export {
|
|
|
2839
2839
|
UnhandledRejectionError,
|
|
2840
2840
|
run
|
|
2841
2841
|
};
|
|
2842
|
-
//# sourceMappingURL=chunk-
|
|
2842
|
+
//# sourceMappingURL=chunk-JRUMDV3W.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
HostCallJournal,
|
|
3
3
|
decodeReplayData,
|
|
4
4
|
validateSnapshotData
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ELJ4PYL2.js";
|
|
6
6
|
import {
|
|
7
7
|
CompileScope,
|
|
8
8
|
SandboxError,
|
|
@@ -219,4 +219,4 @@ export {
|
|
|
219
219
|
validateMigrationReconciliation,
|
|
220
220
|
validateSnapshotMigration
|
|
221
221
|
};
|
|
222
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-OEFI64BI.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deepCopyToSandbox
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ELJ4PYL2.js";
|
|
4
4
|
|
|
5
5
|
// packages/safe-js/src/modules/harness.ts
|
|
6
6
|
function makeHarnessModule(frontmatter, meta) {
|
|
@@ -52,4 +52,4 @@ ${prompt}`;
|
|
|
52
52
|
export {
|
|
53
53
|
makeHarnessModule
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-QUDIENBB.js.map
|
|
@@ -72,7 +72,7 @@ async function runCli(argv, options, usage) {
|
|
|
72
72
|
async () => {
|
|
73
73
|
try {
|
|
74
74
|
if (argv[0] === "migrate") {
|
|
75
|
-
const { migrateSnapshotFile } = await import("./migration-file-
|
|
75
|
+
const { migrateSnapshotFile } = await import("./migration-file-WIJFLWAW.js");
|
|
76
76
|
const result = await migrateSnapshotFile({
|
|
77
77
|
...parseMigrationArgs(argv.slice(1)),
|
|
78
78
|
cwd: options.cwd ?? readCurrentWorkingDirectory(),
|
|
@@ -291,12 +291,12 @@ async function assertHarnessFile(input) {
|
|
|
291
291
|
}
|
|
292
292
|
async function runScriptFile(filepath, parsed, options) {
|
|
293
293
|
const [{ run }, { restore }, { dump, dumpCurrent }, { createLintModulesFromRuntimeRegistry }, { makeFsModule }, { makeMcpModule }] = await Promise.all([
|
|
294
|
-
import("./run-
|
|
295
|
-
import("./restore-
|
|
296
|
-
import("./dump-
|
|
297
|
-
import("./runtime-modules-
|
|
294
|
+
import("./run-N3TS7H43.js"),
|
|
295
|
+
import("./restore-275PJW3U.js"),
|
|
296
|
+
import("./dump-5HPQH2TV.js"),
|
|
297
|
+
import("./runtime-modules-75NU2HLD.js"),
|
|
298
298
|
import("../modules/fs.js"),
|
|
299
|
-
import("./mcp-
|
|
299
|
+
import("./mcp-PADFJXDB.js")
|
|
300
300
|
]);
|
|
301
301
|
const loaded = loadExecutableSource(filepath, await options.readFile(filepath, "utf8"));
|
|
302
302
|
const meta = {
|
|
@@ -534,7 +534,7 @@ async function createRuntime(frontmatter, meta, options) {
|
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
const [{ makeHarnessModule }, { makeFsModule }] = await Promise.all([
|
|
537
|
-
import("./harness-
|
|
537
|
+
import("./harness-3Z4ABNRY.js"),
|
|
538
538
|
import("../modules/fs.js")
|
|
539
539
|
]);
|
|
540
540
|
const state = {
|
|
@@ -725,4 +725,4 @@ export {
|
|
|
725
725
|
exitCodeForError,
|
|
726
726
|
runCli
|
|
727
727
|
};
|
|
728
|
-
//# sourceMappingURL=cli-runtime-
|
|
728
|
+
//# sourceMappingURL=cli-runtime-GZL4KBFM.js.map
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
dump,
|
|
5
5
|
dumpCurrent,
|
|
6
6
|
serializeRunSnapshot
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-HR4F3RRX.js";
|
|
8
|
+
import "./chunk-ELJ4PYL2.js";
|
|
9
9
|
import "./chunk-VQGYRKM4.js";
|
|
10
10
|
import "./chunk-UQPYTZOZ.js";
|
|
11
11
|
import "./chunk-4YIDX44G.js";
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
dumpCurrent,
|
|
17
17
|
serializeRunSnapshot
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=dump-
|
|
19
|
+
//# sourceMappingURL=dump-5HPQH2TV.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeHarnessModule
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-QUDIENBB.js";
|
|
4
|
+
import "./chunk-ELJ4PYL2.js";
|
|
5
5
|
import "./chunk-VQGYRKM4.js";
|
|
6
6
|
import "./chunk-UQPYTZOZ.js";
|
|
7
7
|
import "./chunk-4YIDX44G.js";
|
|
8
8
|
export {
|
|
9
9
|
makeHarnessModule
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=harness-
|
|
11
|
+
//# sourceMappingURL=harness-3Z4ABNRY.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeMcpModule
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-35JWEKXL.js";
|
|
4
4
|
import "./chunk-3ITVV2R6.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-ELJ4PYL2.js";
|
|
6
6
|
import "./chunk-VQGYRKM4.js";
|
|
7
7
|
import "./chunk-UQPYTZOZ.js";
|
|
8
8
|
import "./chunk-4YIDX44G.js";
|
|
9
9
|
export {
|
|
10
10
|
makeMcpModule
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=mcp-
|
|
12
|
+
//# sourceMappingURL=mcp-PADFJXDB.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
migrateSnapshotFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FKV4UG26.js";
|
|
4
4
|
import "./chunk-GVKXZW53.js";
|
|
5
5
|
import "./chunk-2GVBG23M.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-OEFI64BI.js";
|
|
7
|
+
import "./chunk-ELJ4PYL2.js";
|
|
8
8
|
import "./chunk-VQGYRKM4.js";
|
|
9
9
|
import "./chunk-YUQFFRUF.js";
|
|
10
10
|
import "./chunk-UQPYTZOZ.js";
|
|
@@ -12,4 +12,4 @@ import "./chunk-4YIDX44G.js";
|
|
|
12
12
|
export {
|
|
13
13
|
migrateSnapshotFile
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=migration-file-
|
|
15
|
+
//# sourceMappingURL=migration-file-WIJFLWAW.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SnapshotMismatchError,
|
|
3
3
|
restore
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-FOPBX4EE.js";
|
|
5
|
+
import "./chunk-OEFI64BI.js";
|
|
6
|
+
import "./chunk-ELJ4PYL2.js";
|
|
7
7
|
import "./chunk-VQGYRKM4.js";
|
|
8
8
|
import "./chunk-UQPYTZOZ.js";
|
|
9
9
|
import "./chunk-4YIDX44G.js";
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
SnapshotMismatchError,
|
|
12
12
|
restore
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=restore-
|
|
14
|
+
//# sourceMappingURL=restore-275PJW3U.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnhandledRejectionError,
|
|
3
3
|
run
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JRUMDV3W.js";
|
|
5
5
|
import "./chunk-U7ZNMTSQ.js";
|
|
6
6
|
import "./chunk-GVKXZW53.js";
|
|
7
7
|
import "./chunk-2GVBG23M.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-FOPBX4EE.js";
|
|
9
|
+
import "./chunk-OEFI64BI.js";
|
|
10
|
+
import "./chunk-HR4F3RRX.js";
|
|
11
|
+
import "./chunk-ELJ4PYL2.js";
|
|
12
12
|
import "./chunk-VQGYRKM4.js";
|
|
13
13
|
import "./chunk-YUQFFRUF.js";
|
|
14
14
|
import "./chunk-UQPYTZOZ.js";
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
UnhandledRejectionError,
|
|
18
18
|
run
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=run-
|
|
20
|
+
//# sourceMappingURL=run-N3TS7H43.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLintModulesFromRuntimeRegistry
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7DLY2WYQ.js";
|
|
4
|
+
import "./chunk-ELJ4PYL2.js";
|
|
5
5
|
import "./chunk-VQGYRKM4.js";
|
|
6
6
|
import "./chunk-UQPYTZOZ.js";
|
|
7
7
|
import "./chunk-4YIDX44G.js";
|
|
8
8
|
export {
|
|
9
9
|
createLintModulesFromRuntimeRegistry
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=runtime-modules-
|
|
11
|
+
//# sourceMappingURL=runtime-modules-75NU2HLD.js.map
|
package/dist/safe-js/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import path from "node:path";
|
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
14
|
async function runCli(argv, options = {}) {
|
|
15
15
|
if (!argv.includes("--help") && !argv.includes("-h")) {
|
|
16
|
-
const runtime = await import("./chunks/cli-runtime-
|
|
16
|
+
const runtime = await import("./chunks/cli-runtime-GZL4KBFM.js");
|
|
17
17
|
return runtime.runCli(argv, options, createUsage());
|
|
18
18
|
}
|
|
19
19
|
const brokenPipe = createBrokenPipeState();
|
|
@@ -32,7 +32,7 @@ async function runCli(argv, options = {}) {
|
|
|
32
32
|
stderr.write(`${error instanceof Error ? error.message : String(error)}
|
|
33
33
|
`);
|
|
34
34
|
if (brokenPipe.closed) return 0;
|
|
35
|
-
const { exitCodeForError } = await import("./chunks/cli-runtime-
|
|
35
|
+
const { exitCodeForError } = await import("./chunks/cli-runtime-GZL4KBFM.js");
|
|
36
36
|
return exitCodeForError(error);
|
|
37
37
|
}
|
|
38
38
|
}
|
package/dist/safe-js/core.js
CHANGED
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
createRealm,
|
|
9
9
|
createReplayableRandom,
|
|
10
10
|
run
|
|
11
|
-
} from "./chunks/chunk-
|
|
11
|
+
} from "./chunks/chunk-JRUMDV3W.js";
|
|
12
12
|
import "./chunks/chunk-U7ZNMTSQ.js";
|
|
13
13
|
import "./chunks/chunk-GVKXZW53.js";
|
|
14
14
|
import "./chunks/chunk-2GVBG23M.js";
|
|
15
|
-
import "./chunks/chunk-
|
|
16
|
-
import "./chunks/chunk-
|
|
17
|
-
import "./chunks/chunk-
|
|
15
|
+
import "./chunks/chunk-FOPBX4EE.js";
|
|
16
|
+
import "./chunks/chunk-OEFI64BI.js";
|
|
17
|
+
import "./chunks/chunk-HR4F3RRX.js";
|
|
18
18
|
import {
|
|
19
19
|
admitNativePromiseProperties,
|
|
20
20
|
defineExtension
|
|
21
|
-
} from "./chunks/chunk-
|
|
21
|
+
} from "./chunks/chunk-ELJ4PYL2.js";
|
|
22
22
|
import {
|
|
23
23
|
Budget
|
|
24
24
|
} from "./chunks/chunk-VQGYRKM4.js";
|
package/dist/safe-js/index.js
CHANGED
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
inspectSnapshotMigration,
|
|
3
3
|
migrateSnapshot,
|
|
4
4
|
migrateSnapshotFile
|
|
5
|
-
} from "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-FKV4UG26.js";
|
|
6
6
|
import {
|
|
7
7
|
createLintModulesFromRuntimeRegistry
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-7DLY2WYQ.js";
|
|
9
9
|
import {
|
|
10
10
|
makeHarnessModule
|
|
11
|
-
} from "./chunks/chunk-
|
|
11
|
+
} from "./chunks/chunk-QUDIENBB.js";
|
|
12
12
|
import {
|
|
13
13
|
makeMcpModule
|
|
14
|
-
} from "./chunks/chunk-
|
|
14
|
+
} from "./chunks/chunk-35JWEKXL.js";
|
|
15
15
|
import {
|
|
16
16
|
AgentSpawnError,
|
|
17
17
|
EnvAccessError,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
import "./chunks/chunk-G6WTEIJJ.js";
|
|
43
43
|
import {
|
|
44
44
|
makeFsModule
|
|
45
|
-
} from "./chunks/chunk-
|
|
45
|
+
} from "./chunks/chunk-4TXOBR4J.js";
|
|
46
46
|
import {
|
|
47
47
|
createRootedSourceResolver
|
|
48
48
|
} from "./chunks/chunk-F6CV74HU.js";
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
createRealm,
|
|
52
52
|
createReplayableRandom,
|
|
53
53
|
run
|
|
54
|
-
} from "./chunks/chunk-
|
|
54
|
+
} from "./chunks/chunk-JRUMDV3W.js";
|
|
55
55
|
import "./chunks/chunk-U7ZNMTSQ.js";
|
|
56
56
|
import {
|
|
57
57
|
fsCodec
|
|
@@ -61,11 +61,11 @@ import {
|
|
|
61
61
|
} from "./chunks/chunk-2GVBG23M.js";
|
|
62
62
|
import {
|
|
63
63
|
restore
|
|
64
|
-
} from "./chunks/chunk-
|
|
65
|
-
import "./chunks/chunk-
|
|
64
|
+
} from "./chunks/chunk-FOPBX4EE.js";
|
|
65
|
+
import "./chunks/chunk-OEFI64BI.js";
|
|
66
66
|
import {
|
|
67
67
|
dump
|
|
68
|
-
} from "./chunks/chunk-
|
|
68
|
+
} from "./chunks/chunk-HR4F3RRX.js";
|
|
69
69
|
import {
|
|
70
70
|
HostCallResumabilityError,
|
|
71
71
|
HostOperationResumePolicyError,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
deepCopyToSandbox,
|
|
78
78
|
defineExtension,
|
|
79
79
|
registerPendingHostCallPolicy
|
|
80
|
-
} from "./chunks/chunk-
|
|
80
|
+
} from "./chunks/chunk-ELJ4PYL2.js";
|
|
81
81
|
import {
|
|
82
82
|
Budget,
|
|
83
83
|
SandboxError,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FS_OPTION_SURFACE,
|
|
3
3
|
makeFsModule
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-4TXOBR4J.js";
|
|
5
5
|
import "../chunks/chunk-GVKXZW53.js";
|
|
6
6
|
import "../chunks/chunk-2GVBG23M.js";
|
|
7
|
-
import "../chunks/chunk-
|
|
7
|
+
import "../chunks/chunk-ELJ4PYL2.js";
|
|
8
8
|
import "../chunks/chunk-VQGYRKM4.js";
|
|
9
9
|
import "../chunks/chunk-YUQFFRUF.js";
|
|
10
10
|
import "../chunks/chunk-UQPYTZOZ.js";
|
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.738",
|
|
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.738",
|
|
62
62
|
"@petamoriken/float16": "^3.9.3",
|
|
63
63
|
"@noble/hashes": "2.4.0",
|
|
64
64
|
"@formatjs/intl-localematcher": "0.8.13",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/restore.ts"],
|
|
4
|
-
"sourcesContent": ["import { hashParsedAst, hashSource } from \"./parse/hash.js\";\nimport type { CompileOwner } from \"./interp/budget.js\";\nimport { replaceErrorStack } from \"./error/shape.js\";\nimport { SnapshotValidationError, validateDumpEnvelope, validateRuntimeSnapshotDescriptors } from \"./snapshot/validation.js\";\nimport { inMemoryRunSnapshots, serializeSafeJSSnapshot } from \"./snapshot/dump-format.js\";\nimport { assertSnapshotInactive } from \"./interp/running-state.js\";\nimport { validateSnapshotMigration, type SnapshotMigration } from \"./snapshot/migration.js\";\nimport { parseExecutableModule, parseModule } from \"./parse/parser.js\";\nimport { ParseError } from \"./parse/format-error.js\";\nimport { createModuleSource, createDynamicSource, createEvalSource, type DynamicSource, type EvalSourceContext } from \"./parse/dynamic-source.js\";\nimport { validateGuestFunctionAst } from \"./snapshot/guest-ast-validation.js\";\nimport { validateTemplateObjects } from \"./snapshot/template-validation.js\";\nimport type { ParseResult } from \"./parse.js\";\n\nexport type SafeJSSnapshot = {\n version?: number;\n sourceHash: string;\n migration?: SnapshotMigration;\n clock?: {\n next: number;\n };\n random?: {\n seed: number;\n state: number;\n initialState?: number;\n resumeState?: number;\n };\n [key: string]: unknown;\n};\n\nexport type RestoreOptions = {\n source: string;\n importSpecifiers?: readonly string[];\n};\n\nexport class SnapshotMismatchError extends Error {\n readonly actualHash: string;\n readonly expectedHash: string;\n\n constructor(expectedHash: string, actualHash: string) {\n super(\n `source changed since snapshot was taken (hash ${expectedHash} expected, got ${actualHash}); pass --reset to discard`\n );\n this.name = \"SnapshotMismatchError\";\n this.actualHash = actualHash;\n this.expectedHash = expectedHash;\n replaceErrorStack(this);\n }\n}\n\nexport function restore<TSnapshot extends SafeJSSnapshot>(\n snapshot: TSnapshot,\n options: RestoreOptions,\n owner?: CompileOwner\n): TSnapshot {\n assertSnapshotInactive(snapshot);\n try {\n validateDumpEnvelope(snapshot, { resume: true });\n } catch (error) {\n if (!(error instanceof SnapshotValidationError) || error.code !== \"invalidState\" || error.path === \"$.replayError\" ||\n !inMemoryRunSnapshots.has(snapshot)) throw error;\n // Runtime snapshots can retain guest descriptor state. Use the same portable\n // representation as dump(), then apply all normal validation below.\n validateRuntimeSnapshotDescriptors(snapshot);\n snapshot = JSON.parse(serializeSafeJSSnapshot(snapshot)) as TSnapshot;\n validateDumpEnvelope(snapshot, { resume: true });\n }\n validateSnapshotMigration(snapshot.migration, snapshot.sourceHash, owner);\n\n const includeFunctionSource = snapshot.executionSemantics !== \"jobs-v6\" && snapshot.executionSemantics !== \"jobs-v7\";\n const currentSourceHash = options.importSpecifiers === undefined\n ? hashSource(options.source, owner, includeFunctionSource)\n : hashParsedAst(parseExecutableModule(options.source, \"<input>\", owner, options.importSpecifiers), includeFunctionSource);\n\n if (snapshot.sourceHash !== currentSourceHash) {\n throw new SnapshotMismatchError(snapshot.sourceHash, currentSourceHash);\n }\n\n if (snapshot.heap !== undefined && typeof snapshot.heap === \"object\" && snapshot.heap !== null) {\n const entries = Object.entries(snapshot.heap);\n const closures = entries.filter(([, value]) =>\n value !== null && typeof value === \"object\" && ([\"guest-function\", \"guest-class\", \"guest-generator\"].includes(String((value as Record<string, unknown>).kind)) ||\n (value as Record<string, unknown>).templateNodeId !== undefined));\n const dynamicSources = new Map<number, DynamicSource>();\n for (const [id, value] of entries) {\n const record = value as Record<string, unknown>;\n if (record.kind === \"guest-source\" || record.kind === \"guest-script\") {\n try {\n const compiled = record.kind === \"guest-script\"\n ? createEvalSource(record.body as string, record.context as EvalSourceContext, owner)\n : record.functionKind === \"module\" ? createModuleSource(record.body as string, owner)\n : createDynamicSource(record.functionKind as Exclude<DynamicSource[\"kind\"], \"eval\" | \"module\">,\n record.parameters as string, record.body as string, owner);\n dynamicSources.set(Number(id), compiled.source);\n } catch (error) {\n if (!(error instanceof SyntaxError) && !(error instanceof ParseError)) throw error;\n throw new SnapshotValidationError(\"invalidValue\", `$.heap[${JSON.stringify(id)}]`, error.message);\n }\n }\n }\n if (closures.length > 0) {\n const functions = new Map<number, Record<string, unknown>>();\n const pending: unknown[] = [options.importSpecifiers === undefined\n ? parseModule(options.source, \"<input>\", owner)\n : parseExecutableModule(options.source, \"<input>\", owner, options.importSpecifiers)];\n while (pending.length > 0) {\n const value = pending.pop();\n if (value === null || typeof value !== \"object\") continue;\n const node = value as Record<string, unknown>;\n if (typeof node.nodeId === \"number\") {\n functions.set(node.nodeId, node);\n }\n for (const entry of Object.values(node)) pending.push(entry);\n }\n for (const [id, value] of closures) {\n const record = value as Record<string, unknown>;\n if (record.kind === \"guest-array\") continue;\n const nodes = record.dynamicSource === undefined ? functions\n : dynamicSources.get((record.dynamicSource as {id: number}).id)!.nodes;\n const origin = nodes.get(record.astNodeId as number);\n try { validateGuestFunctionAst(record, origin); }\n catch (error) {\n throw new SnapshotValidationError(\"invalidValue\", `$.heap[${JSON.stringify(id)}].astNodeId`, error instanceof Error ? error.message : String(error));\n }\n }\n try { validateTemplateObjects(snapshot.heap as Record<string, unknown>, functions.values() as Iterable<ParseResult>, dynamicSources); }\n catch (error) { throw new SnapshotValidationError(\"invalidValue\", \"$.heap\", String(error)); }\n }\n }\n\n return snapshot;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,IAAM,wBAAN,cAAoC,MAAM;AAAA,EACtC;AAAA,EACA;AAAA,EAET,YAAY,cAAsB,YAAoB;AACpD;AAAA,MACE,iDAAiD,YAAY,kBAAkB,UAAU;AAAA,IAC3F;AACA,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,eAAe;AACpB,sBAAkB,IAAI;AAAA,EACxB;AACF;AAEO,SAAS,QACd,UACA,SACA,OACW;AACX,yBAAuB,QAAQ;AAC/B,MAAI;AACF,yBAAqB,UAAU,EAAE,QAAQ,KAAK,CAAC;AAAA,EACjD,SAAS,OAAO;AACd,QAAI,EAAE,iBAAiB,4BAA4B,MAAM,SAAS,kBAAkB,MAAM,SAAS,mBAC/F,CAAC,qBAAqB,IAAI,QAAQ,EAAG,OAAM;AAG/C,uCAAmC,QAAQ;AAC3C,eAAW,KAAK,MAAM,wBAAwB,QAAQ,CAAC;AACvD,yBAAqB,UAAU,EAAE,QAAQ,KAAK,CAAC;AAAA,EACjD;AACA,4BAA0B,SAAS,WAAW,SAAS,YAAY,KAAK;AAExE,QAAM,wBAAwB,SAAS,uBAAuB,aAAa,SAA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ACvB,YAAM,YAAY,oBAAI,IAAqC;AAC3D,YAAM,UAAqB,CAAC,QAAQ,qBAAqB,SACrD,YAAY,QAAQ,QAAQ,WAAW,KAAK,IAC5C,sBAAsB,QAAQ,QAAQ,WAAW,OAAO,QAAQ,gBAAgB,CAAC;AACrF,aAAO,QAAQ,SAAS,GAAG;AACzB,cAAM,QAAQ,QAAQ,IAAI;AAC1B,YAAI,UAAU,QAAQ,OAAO,UAAU,SAAU;AACjD,cAAM,OAAO;AACb,YAAI,OAAO,KAAK,WAAW,UAAU;AACnC,oBAAU,IAAI,KAAK,QAAQ,IAAI;AAAA,QACjC;AACA,mBAAW,SAAS,OAAO,OAAO,IAAI,EAAG,SAAQ,KAAK,KAAK;AAAA,MAC7D;AACA,iBAAW,CAAC,IAAI,KAAK,KAAK,UAAU;AAClC,cAAM,SAAS;AACf,YAAI,OAAO,SAAS,cAAe;AACnC,cAAM,QAAQ,OAAO,kBAAkB,SAAY,YAC/C,eAAe,IAAK,OAAO,cAA+B,EAAE,EAAG;AACnE,cAAM,SAAS,MAAM,IAAI,OAAO,SAAmB;AACnD,YAAI;AAAE,mCAAyB,QAAQ,MAAM;AAAA,QAAG,SACzC,OAAO;AACZ,gBAAM,IAAI,wBAAwB,gBAAgB,UAAU,KAAK,UAAU,EAAE,CAAC,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,QACrJ;AAAA,MACF;AACA,UAAI;AAAE,gCAAwB,SAAS,MAAiC,UAAU,OAAO,GAA4B,cAAc;AAAA,MAAG,SAC/H,OAAO;AAAE,cAAM,IAAI,wBAAwB,gBAAgB,UAAU,OAAO,KAAK,CAAC;AAAA,MAAG;AAAA,IAC9F;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/safe-js/chunks/{migration-file-AYLLA72K.js.map → migration-file-WIJFLWAW.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/safe-js/chunks/{runtime-modules-3P6FZJ55.js.map → runtime-modules-75NU2HLD.js.map}
RENAMED
|
File without changes
|