@receptron/graphai_cli 0.5.21 → 0.5.23

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.
Files changed (2) hide show
  1. package/lib/mermaid.js +16 -28
  2. package/package.json +5 -6
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 utils_1 = require("graphai/lib/utils/utils");
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
- if (Array.isArray(node.inputs)) {
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 ("value" in node) {
40
- // console.log(node.value);
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.21",
3
+ "version": "0.5.23",
4
4
  "description": "GraphAI command line tools.",
5
5
  "main": "lib/graphai_cli.js",
6
6
  "bin": {
@@ -32,16 +32,15 @@
32
32
  },
33
33
  "homepage": "https://github.com/receptron/graphai#readme",
34
34
  "devDependencies": {
35
- "@rollup/plugin-commonjs": "^26.0.1",
36
35
  "@types/json-schema-generator": "^2.0.3",
37
36
  "@types/yargs": "^17.0.33"
38
37
  },
39
38
  "dependencies": {
40
- "@graphai/agent_filters": "^0.0.6",
41
- "@graphai/agents": "^0.1.4",
42
- "@receptron/test_utils": "^0.0.7",
39
+ "@graphai/agent_filters": "^0.0.8",
40
+ "@graphai/agents": "^0.1.6",
41
+ "@receptron/test_utils": "^0.0.8",
43
42
  "dotenv": "^16.4.5",
44
- "graphai": "^0.5.14",
43
+ "graphai": "^0.5.19",
45
44
  "json-schema-generator": "^2.0.6",
46
45
  "yargs": "^17.7.2"
47
46
  },