@receptron/graphai_cli 0.5.21 → 0.5.22
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/mermaid.js +16 -28
- package/package.json +3 -3
package/lib/mermaid.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mermaid = void 0;
|
|
4
|
-
const
|
|
4
|
+
const graphai_1 = require("graphai");
|
|
5
|
+
const mapData = (nodeId, inputs) => {
|
|
6
|
+
(0, graphai_1.inputs2dataSources)(inputs).map((source) => {
|
|
7
|
+
if (source.nodeId) {
|
|
8
|
+
if (source.propIds) {
|
|
9
|
+
console.log(` ${source.nodeId}(${source.nodeId}) -- ${source.propIds.join(".")} --> ${nodeId}`);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
console.log(` ${source.nodeId}(${source.nodeId}) --> ${nodeId}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
5
17
|
const mermaid = (graphData) => {
|
|
6
18
|
console.log("flowchart TD");
|
|
7
19
|
Object.keys(graphData.nodes).forEach((nodeId) => {
|
|
@@ -9,35 +21,11 @@ const mermaid = (graphData) => {
|
|
|
9
21
|
// label / name
|
|
10
22
|
if ("agent" in node) {
|
|
11
23
|
if (node.inputs) {
|
|
12
|
-
|
|
13
|
-
node.inputs.forEach((input) => {
|
|
14
|
-
const source = (0, utils_1.parseNodeName)(input);
|
|
15
|
-
if (source.propIds) {
|
|
16
|
-
console.log(` ${source.nodeId}(${source.nodeId}) -- ${source.propIds.join(".")} --> ${nodeId}`);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
console.log(` ${source.nodeId}(${source.nodeId}) --> ${nodeId}`);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
// LATER: Display the inputName as well.
|
|
25
|
-
const inputNames = Object.keys(node.inputs);
|
|
26
|
-
inputNames.forEach((inputName) => {
|
|
27
|
-
const input = node.inputs[inputName];
|
|
28
|
-
const source = (0, utils_1.parseNodeName)(input);
|
|
29
|
-
if (source.propIds) {
|
|
30
|
-
console.log(` ${source.nodeId}(${source.nodeId}) -- ${source.propIds.join(".")} --> ${nodeId}`);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
console.log(` ${source.nodeId}(${source.nodeId}) --> ${nodeId}`);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
24
|
+
mapData(nodeId, node.inputs);
|
|
37
25
|
}
|
|
38
26
|
}
|
|
39
|
-
if ("
|
|
40
|
-
|
|
27
|
+
if ("update" in node) {
|
|
28
|
+
mapData(nodeId, { update: node.update });
|
|
41
29
|
}
|
|
42
30
|
});
|
|
43
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@receptron/graphai_cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.22",
|
|
4
4
|
"description": "GraphAI command line tools.",
|
|
5
5
|
"main": "lib/graphai_cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@graphai/agent_filters": "^0.0.6",
|
|
41
|
-
"@graphai/agents": "^0.1.
|
|
41
|
+
"@graphai/agents": "^0.1.5",
|
|
42
42
|
"@receptron/test_utils": "^0.0.7",
|
|
43
43
|
"dotenv": "^16.4.5",
|
|
44
|
-
"graphai": "^0.5.
|
|
44
|
+
"graphai": "^0.5.16",
|
|
45
45
|
"json-schema-generator": "^2.0.6",
|
|
46
46
|
"yargs": "^17.7.2"
|
|
47
47
|
},
|