@receptron/graphai_cli 0.6.5 → 0.6.8

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/docs.d.ts CHANGED
@@ -1 +1,3 @@
1
+ import { AgentFunctionInfoDictionary } from "graphai";
1
2
  export declare const readTemplate: (file: string) => string;
3
+ export declare const generateDoc: (base_path: string, agents: AgentFunctionInfoDictionary) => void;
package/lib/docs.js CHANGED
@@ -1,46 +1,11 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.readTemplate = void 0;
6
+ exports.generateDoc = exports.readTemplate = void 0;
40
7
  const utils_1 = require("graphai/lib/utils/utils");
41
8
  const json_schema_generator_1 = __importDefault(require("json-schema-generator"));
42
- const packages = __importStar(require("@graphai/agents"));
43
- const vanilla_node_agents_1 = require("@graphai/vanilla_node_agents");
44
9
  const fs_1 = __importDefault(require("fs"));
45
10
  const path_1 = __importDefault(require("path"));
46
11
  const agentAttribute = (agentInfo, key) => {
@@ -118,10 +83,9 @@ const IndexMd = (ret) => {
118
83
  }
119
84
  return templates.join("\n");
120
85
  };
121
- const main = () => {
86
+ const generateDoc = (base_path, agents) => {
122
87
  const ret = {};
123
- const base_path = __dirname + "/../../../docs/agentDocs/";
124
- Object.values({ ...packages, fileReadAgent: vanilla_node_agents_1.fileReadAgent }).map((agent) => {
88
+ Object.values(agents).map((agent) => {
125
89
  const md = agentMd(agent);
126
90
  agent.category.map(async (cat) => {
127
91
  if (!ret[cat]) {
@@ -137,4 +101,4 @@ const main = () => {
137
101
  const index = IndexMd(ret);
138
102
  fs_1.default.writeFileSync(base_path + "/README.md", index);
139
103
  };
140
- main();
104
+ exports.generateDoc = generateDoc;
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@receptron/graphai_cli",
3
- "version": "0.6.5",
3
+ "version": "0.6.8",
4
4
  "description": "GraphAI command line tools.",
5
5
  "main": "lib/graphai_cli.js",
6
6
  "bin": {
7
7
  "graphai": "lib/graphai_cli.js"
8
8
  },
9
9
  "files": [
10
- "./lib",
11
- "./templates"
10
+ "./lib"
12
11
  ],
13
12
  "scripts": {
14
13
  "build": "tsc && tsc-alias",
15
14
  "eslint": "eslint --fix",
16
- "doc": "npx ts-node -r tsconfig-paths/register src/docs.ts",
15
+ "doc": "echo nothing",
17
16
  "format": "prettier --write '{src,test_yaml,samples}/**/*.{yaml,ts,json}'",
18
17
  "test": "yarn run test_sh",
19
18
  "test_sh": "./scripts/test.sh",
@@ -32,16 +31,14 @@
32
31
  },
33
32
  "homepage": "https://github.com/receptron/graphai#readme",
34
33
  "devDependencies": {
35
- "@types/json-schema-generator": "^2.0.3",
36
34
  "@types/yargs": "^17.0.33"
37
35
  },
38
36
  "dependencies": {
39
- "@graphai/agent_filters": "^0.0.8",
40
- "@graphai/agents": "^0.2.3",
37
+ "@graphai/agent_filters": "^0.0.9",
38
+ "@graphai/agents": "^0.2.5",
41
39
  "@receptron/test_utils": "^0.2.2",
42
40
  "dotenv": "^16.4.7",
43
- "graphai": "^0.6.6",
44
- "json-schema-generator": "^2.0.6",
41
+ "graphai": "^0.6.11",
45
42
  "yargs": "^17.7.2"
46
43
  },
47
44
  "types": "./lib/graphai_cli.d.ts",
@@ -1,30 +0,0 @@
1
- # {name}
2
-
3
- ## Description
4
-
5
- {description}
6
-
7
- ## Schema
8
-
9
- {schemas}
10
-
11
- ## Input example of the next node
12
-
13
- {resultKey}
14
-
15
- ## Samples
16
-
17
- {samples}
18
-
19
- ## Author
20
-
21
- {author}
22
-
23
- ## Repository
24
-
25
- {repository}
26
-
27
- ## License
28
-
29
- {license}
30
-
@@ -1,23 +0,0 @@
1
-
2
- # {packageName} for GraphAI
3
-
4
- {description}
5
-
6
- ### Install
7
-
8
- ```sh
9
- yarn add {packageName}
10
- ```
11
-
12
- ### Usage
13
-
14
- ```typescript
15
- import { GraphAI } from "graphai";
16
- import { {agents} } from "{packageName}";
17
-
18
- const agents = { {agents} };
19
-
20
- const graph = new GraphAI(graph_data, agents);
21
- const result = await graph.run();
22
- ```
23
-