@poe-platform/safe-js 0.1.435 → 0.1.438
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-JJ3J6ZJF.js → chunk-ANWXJ2PE.js} +2 -2
- package/dist/safe-js/chunks/{chunk-H3E7APSE.js → chunk-WFY3GNFP.js} +26 -7
- package/dist/safe-js/chunks/{chunk-H3E7APSE.js.map → chunk-WFY3GNFP.js.map} +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/snapshot/replay-data.d.ts +13 -0
- package/package.json +2 -2
- /package/dist/safe-js/chunks/{chunk-JJ3J6ZJF.js.map → chunk-ANWXJ2PE.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WFY3GNFP.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-ANWXJ2PE.js.map
|
|
@@ -19408,11 +19408,20 @@ import { types as types8 } from "node:util";
|
|
|
19408
19408
|
// packages/safe-js/src/snapshot/replay-data.ts
|
|
19409
19409
|
var MissingReplayCapabilityError = class extends TypeError {
|
|
19410
19410
|
};
|
|
19411
|
+
function createReplayEncodingContext() {
|
|
19412
|
+
return {
|
|
19413
|
+
nodes: [],
|
|
19414
|
+
seen: /* @__PURE__ */ new WeakMap(),
|
|
19415
|
+
symbols: /* @__PURE__ */ new Map(),
|
|
19416
|
+
float32Buffers: /* @__PURE__ */ new WeakMap(),
|
|
19417
|
+
failed: false
|
|
19418
|
+
};
|
|
19419
|
+
}
|
|
19411
19420
|
function encodeReplayData(value, options = {}) {
|
|
19412
|
-
const
|
|
19413
|
-
|
|
19414
|
-
const
|
|
19415
|
-
const
|
|
19421
|
+
const context = options.context ?? createReplayEncodingContext();
|
|
19422
|
+
if (context.failed) throw new TypeError("Cannot extend an incomplete graph.");
|
|
19423
|
+
const { nodes, seen, symbols, float32Buffers } = context;
|
|
19424
|
+
const initialNodeCount = nodes.length;
|
|
19416
19425
|
const encode = (entry, depth, path) => {
|
|
19417
19426
|
if (depth > MAX_DATA_DEPTH) throw new TypeError("Replay data exceeds the nesting limit.");
|
|
19418
19427
|
if (entry === null || typeof entry === "boolean" || typeof entry === "string") return entry;
|
|
@@ -19606,7 +19615,13 @@ function encodeReplayData(value, options = {}) {
|
|
|
19606
19615
|
}
|
|
19607
19616
|
return { tag: "ref", id };
|
|
19608
19617
|
};
|
|
19609
|
-
|
|
19618
|
+
try {
|
|
19619
|
+
return { root: encode(value, 0, options.path ?? []), nodes };
|
|
19620
|
+
} catch (error) {
|
|
19621
|
+
context.failed = true;
|
|
19622
|
+
nodes.length = initialNodeCount;
|
|
19623
|
+
throw error;
|
|
19624
|
+
}
|
|
19610
19625
|
}
|
|
19611
19626
|
function decodeReplayData(input, options = {}, parent) {
|
|
19612
19627
|
const compilation = new CompileScope(parent?.owner);
|
|
@@ -19614,7 +19629,9 @@ function decodeReplayData(input, options = {}, parent) {
|
|
|
19614
19629
|
validateSnapshotData(input);
|
|
19615
19630
|
const graph = record2(input);
|
|
19616
19631
|
const nodes = list(own(graph, "nodes"));
|
|
19617
|
-
|
|
19632
|
+
if (options.memo !== void 0 && options.memo.nodes !== nodes)
|
|
19633
|
+
throw new TypeError("Replay memo belongs to a different graph.");
|
|
19634
|
+
const restored = new Map(options.memo?.values);
|
|
19618
19635
|
const initializeValues = [];
|
|
19619
19636
|
const detachBuffers = [];
|
|
19620
19637
|
const decode = (entry, depth = 0) => {
|
|
@@ -19878,6 +19895,8 @@ function decodeReplayData(input, options = {}, parent) {
|
|
|
19878
19895
|
for (const initialize of initializeValues) initialize();
|
|
19879
19896
|
for (const detach of detachBuffers) detach();
|
|
19880
19897
|
if (parent !== void 0) compilation.forward(compilation.tickets, parent);
|
|
19898
|
+
if (options.memo !== void 0)
|
|
19899
|
+
for (const [id, value] of restored) options.memo.values.set(id, value);
|
|
19881
19900
|
return result;
|
|
19882
19901
|
} finally {
|
|
19883
19902
|
compilation.dispose();
|
|
@@ -47240,4 +47259,4 @@ export {
|
|
|
47240
47259
|
FileSnapshotBackend,
|
|
47241
47260
|
run
|
|
47242
47261
|
};
|
|
47243
|
-
//# sourceMappingURL=chunk-
|
|
47262
|
+
//# sourceMappingURL=chunk-WFY3GNFP.js.map
|