@valerypopoff/rivet2-core 2.31.0 → 2.33.0
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/cjs/bundle.cjs +33 -23
- package/dist/cjs/bundle.cjs.map +3 -3
- package/dist/cjs/serialization.cjs +32 -4
- package/dist/cjs/serialization.cjs.map +3 -3
- package/dist/esm/model/NodePrefabResolver.js +13 -7
- package/dist/esm/serialization.js +1 -0
- package/dist/esm/utils/serialization/serialization_v4.js +27 -1
- package/dist/types/model/NodeBase.d.ts +2 -0
- package/dist/types/serialization.d.ts +1 -0
- package/dist/types/utils/serialization/serialization_v4.d.ts +3 -0
- package/package.json +1 -1
|
@@ -30,12 +30,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/serialization.ts
|
|
31
31
|
var serialization_exports = {};
|
|
32
32
|
__export(serialization_exports, {
|
|
33
|
+
bindSharedReplayProjectId: () => bindSharedReplayProjectId,
|
|
33
34
|
deserializeDatasets: () => deserializeDatasets,
|
|
34
35
|
deserializeGraph: () => deserializeGraph,
|
|
35
36
|
deserializeProject: () => deserializeProject,
|
|
36
37
|
serializeDatasets: () => serializeDatasets,
|
|
37
38
|
serializeGraph: () => serializeGraph,
|
|
38
|
-
serializeProject: () => serializeProject
|
|
39
|
+
serializeProject: () => serializeProject,
|
|
40
|
+
serializeSharedReplayProject: () => serializeSharedReplayProject
|
|
39
41
|
});
|
|
40
42
|
module.exports = __toCommonJS(serialization_exports);
|
|
41
43
|
|
|
@@ -1409,6 +1411,7 @@ function getError(error) {
|
|
|
1409
1411
|
|
|
1410
1412
|
// src/utils/serialization/serialization_v4.ts
|
|
1411
1413
|
var import_lodash_es2 = require("lodash");
|
|
1414
|
+
var import_safe_stable_stringify3 = __toESM(require("safe-stable-stringify"), 1);
|
|
1412
1415
|
|
|
1413
1416
|
// src/model/chat-v2/llmChatV2NodeMigration.ts
|
|
1414
1417
|
function normalizeSerializedLLMTemperatureData(nodeType, data) {
|
|
@@ -1459,6 +1462,27 @@ function graphV4Deserializer(data) {
|
|
|
1459
1462
|
return fromSerializedGraph2(serializedGraph);
|
|
1460
1463
|
}
|
|
1461
1464
|
function projectV4Serializer(project, attachedData) {
|
|
1465
|
+
return wrapInYamlEnvelope(4, prepareSerializedProject(project, attachedData));
|
|
1466
|
+
}
|
|
1467
|
+
var replayProjectHeader = '{"version":4,"data":{"metadata":{"id":';
|
|
1468
|
+
function serializeSharedReplayProject(project, attachedData) {
|
|
1469
|
+
const {
|
|
1470
|
+
metadata: { id, ...metadata },
|
|
1471
|
+
...data
|
|
1472
|
+
} = prepareSerializedProject(project, attachedData);
|
|
1473
|
+
const metadataJson = (0, import_safe_stable_stringify3.default)(metadata);
|
|
1474
|
+
const dataJson = (0, import_safe_stable_stringify3.default)(data);
|
|
1475
|
+
const metadataTail = metadataJson === "{}" ? "}" : "," + metadataJson.slice(1);
|
|
1476
|
+
return replayProjectHeader + JSON.stringify(id) + metadataTail + "," + dataJson.slice(1) + "}";
|
|
1477
|
+
}
|
|
1478
|
+
function bindSharedReplayProjectId(snapshot, sourceId, recordingId) {
|
|
1479
|
+
const sourceHeader = replayProjectHeader + JSON.stringify(sourceId);
|
|
1480
|
+
const afterId = snapshot[sourceHeader.length];
|
|
1481
|
+
if (!snapshot.startsWith(sourceHeader) || afterId !== "," && afterId !== "}")
|
|
1482
|
+
throw new Error("Shared replay project has an invalid source identity.");
|
|
1483
|
+
return replayProjectHeader + JSON.stringify(recordingId) + snapshot.slice(sourceHeader.length);
|
|
1484
|
+
}
|
|
1485
|
+
function prepareSerializedProject(project, attachedData) {
|
|
1462
1486
|
if (!isValidProjectStaticData(project.data)) {
|
|
1463
1487
|
throw new Error("Project data must be a record of static-data strings");
|
|
1464
1488
|
}
|
|
@@ -1472,7 +1496,7 @@ function projectV4Serializer(project, attachedData) {
|
|
|
1472
1496
|
path: void 0
|
|
1473
1497
|
}
|
|
1474
1498
|
};
|
|
1475
|
-
return
|
|
1499
|
+
return toSerializedProject(filteredProject, attachedData);
|
|
1476
1500
|
}
|
|
1477
1501
|
function graphV4Serializer(graph) {
|
|
1478
1502
|
return wrapInYamlEnvelope(4, toSerializedGraph(graph));
|
|
@@ -1592,6 +1616,7 @@ function toSerializedNode(node, allNodes, allConnections) {
|
|
|
1592
1616
|
return {
|
|
1593
1617
|
description: ((_a = node.description) == null ? void 0 : _a.trim()) ? node.description : void 0,
|
|
1594
1618
|
visualData: packVisualDataV4(node),
|
|
1619
|
+
dataBusChannelOrder: node.visualData.dataBusChannelOrder,
|
|
1595
1620
|
isSplitRun: node.isSplitRun ? true : void 0,
|
|
1596
1621
|
splitRunMax: node.isSplitRun ? node.splitRunMax : void 0,
|
|
1597
1622
|
splitRunConcurrency: node.isSplitRun ? node.splitRunConcurrency : void 0,
|
|
@@ -1627,7 +1652,8 @@ function fromSerializedNode2(serializedNode, serializedNodeInfo) {
|
|
|
1627
1652
|
y,
|
|
1628
1653
|
width,
|
|
1629
1654
|
zIndex,
|
|
1630
|
-
color
|
|
1655
|
+
color,
|
|
1656
|
+
...Array.isArray(serializedNode.dataBusChannelOrder) ? { dataBusChannelOrder: serializedNode.dataBusChannelOrder } : {}
|
|
1631
1657
|
},
|
|
1632
1658
|
data: serializedNode.data ?? {},
|
|
1633
1659
|
variants: serializedNode.variants ?? [],
|
|
@@ -1871,11 +1897,13 @@ function deserializeDatasets(serializedDatasets) {
|
|
|
1871
1897
|
}
|
|
1872
1898
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1873
1899
|
0 && (module.exports = {
|
|
1900
|
+
bindSharedReplayProjectId,
|
|
1874
1901
|
deserializeDatasets,
|
|
1875
1902
|
deserializeGraph,
|
|
1876
1903
|
deserializeProject,
|
|
1877
1904
|
serializeDatasets,
|
|
1878
1905
|
serializeGraph,
|
|
1879
|
-
serializeProject
|
|
1906
|
+
serializeProject,
|
|
1907
|
+
serializeSharedReplayProject
|
|
1880
1908
|
});
|
|
1881
1909
|
//# sourceMappingURL=serialization.cjs.map
|