graphai 0.6.9 → 0.6.10
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/lib/bundle.cjs.js +1 -1
- package/lib/bundle.cjs.js.map +1 -1
- package/lib/bundle.esm.js +13 -5
- package/lib/bundle.esm.js.map +1 -1
- package/lib/bundle.umd.js +1 -1
- package/lib/bundle.umd.js.map +1 -1
- package/lib/node.js +1 -1
- package/lib/validators/relation_validator.d.ts +1 -1
- package/lib/validators/relation_validator.js +12 -4
- package/package.json +2 -2
|
@@ -4,13 +4,13 @@ exports.relationValidator = void 0;
|
|
|
4
4
|
const utils_1 = require("../utils/utils");
|
|
5
5
|
const common_1 = require("../validators/common");
|
|
6
6
|
const nodeUtils_1 = require("../utils/nodeUtils");
|
|
7
|
-
const relationValidator = (
|
|
8
|
-
const nodeIds = new Set(Object.keys(
|
|
7
|
+
const relationValidator = (graphData, staticNodeIds, computedNodeIds) => {
|
|
8
|
+
const nodeIds = new Set(Object.keys(graphData.nodes));
|
|
9
9
|
const pendings = {};
|
|
10
10
|
const waitlist = {};
|
|
11
11
|
// validate input relation and set pendings and wait list
|
|
12
12
|
computedNodeIds.forEach((computedNodeId) => {
|
|
13
|
-
const nodeData =
|
|
13
|
+
const nodeData = graphData.nodes[computedNodeId];
|
|
14
14
|
pendings[computedNodeId] = new Set();
|
|
15
15
|
const dataSourceValidator = (sourceType, sourceNodeIds) => {
|
|
16
16
|
sourceNodeIds.forEach((sourceNodeId) => {
|
|
@@ -29,6 +29,10 @@ const relationValidator = (data, staticNodeIds, computedNodeIds) => {
|
|
|
29
29
|
const sourceNodeIds = (0, nodeUtils_1.dataSourceNodeIds)((0, nodeUtils_1.inputs2dataSources)(nodeData.inputs));
|
|
30
30
|
dataSourceValidator("Inputs", sourceNodeIds);
|
|
31
31
|
}
|
|
32
|
+
if (nodeData.params) {
|
|
33
|
+
const sourceNodeIds = (0, nodeUtils_1.dataSourceNodeIds)((0, nodeUtils_1.inputs2dataSources)(nodeData.params));
|
|
34
|
+
dataSourceValidator("Params", sourceNodeIds);
|
|
35
|
+
}
|
|
32
36
|
if (nodeData.if) {
|
|
33
37
|
const sourceNodeIds = (0, nodeUtils_1.dataSourceNodeIds)((0, nodeUtils_1.inputs2dataSources)({ if: nodeData.if }));
|
|
34
38
|
dataSourceValidator("If", sourceNodeIds);
|
|
@@ -41,11 +45,15 @@ const relationValidator = (data, staticNodeIds, computedNodeIds) => {
|
|
|
41
45
|
const sourceNodeIds = (0, nodeUtils_1.dataSourceNodeIds)((0, nodeUtils_1.inputs2dataSources)({ graph: nodeData.graph }));
|
|
42
46
|
dataSourceValidator("Graph", sourceNodeIds);
|
|
43
47
|
}
|
|
48
|
+
if (typeof nodeData.agent === "string" && nodeData.agent[0] === ":") {
|
|
49
|
+
const sourceNodeIds = (0, nodeUtils_1.dataSourceNodeIds)((0, nodeUtils_1.inputs2dataSources)({ agent: nodeData.agent }));
|
|
50
|
+
dataSourceValidator("Agent", sourceNodeIds);
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
});
|
|
46
54
|
// TODO. validate update
|
|
47
55
|
staticNodeIds.forEach((staticNodeId) => {
|
|
48
|
-
const nodeData =
|
|
56
|
+
const nodeData = graphData.nodes[staticNodeId];
|
|
49
57
|
if ("value" in nodeData && nodeData.update) {
|
|
50
58
|
const update = nodeData.update;
|
|
51
59
|
const updateNodeId = (0, utils_1.parseNodeName)(update).nodeId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphai",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "Asynchronous data flow execution engine for agentic AI apps.",
|
|
5
5
|
"main": "lib/bundle.cjs.js",
|
|
6
6
|
"module": "lib/bundle.esm.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/receptron/graphai#readme",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"typedoc": "^0.27.
|
|
30
|
+
"typedoc": "^0.27.5"
|
|
31
31
|
},
|
|
32
32
|
"types": "./lib/index.d.ts",
|
|
33
33
|
"directories": {
|