graphai 2.0.8 → 2.0.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 +28 -3
- 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/graphai.d.ts +2 -1
- package/lib/graphai.js +7 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/utils/prop_function.js +20 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GraphAILogger = exports.ValidationError = exports.inputs2dataSources = exports.isStaticNodeData = exports.isComputedNodeData = exports.debugResultKey = exports.parseNodeName = exports.isObject = exports.sleep = exports.assert = exports.strIntentionalError = exports.defaultTestContext = exports.agentInfoWrapper = exports.defaultAgentInfo = exports.NodeState = exports.graphDataLatestVersion = exports.defaultConcurrency = exports.GraphAI = void 0;
|
|
3
|
+
exports.TaskManager = exports.GraphAILogger = exports.ValidationError = exports.inputs2dataSources = exports.isStaticNodeData = exports.isComputedNodeData = exports.debugResultKey = exports.parseNodeName = exports.isObject = exports.sleep = exports.assert = exports.strIntentionalError = exports.defaultTestContext = exports.agentInfoWrapper = exports.defaultAgentInfo = exports.NodeState = exports.graphDataLatestVersion = exports.defaultConcurrency = exports.GraphAI = void 0;
|
|
4
4
|
var graphai_1 = require("./graphai");
|
|
5
5
|
Object.defineProperty(exports, "GraphAI", { enumerable: true, get: function () { return graphai_1.GraphAI; } });
|
|
6
6
|
Object.defineProperty(exports, "defaultConcurrency", { enumerable: true, get: function () { return graphai_1.defaultConcurrency; } });
|
|
@@ -25,3 +25,5 @@ var common_1 = require("./validators/common");
|
|
|
25
25
|
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return common_1.ValidationError; } });
|
|
26
26
|
var GraphAILogger_1 = require("./utils/GraphAILogger");
|
|
27
27
|
Object.defineProperty(exports, "GraphAILogger", { enumerable: true, get: function () { return GraphAILogger_1.GraphAILogger; } });
|
|
28
|
+
var task_manager_1 = require("./task_manager");
|
|
29
|
+
Object.defineProperty(exports, "TaskManager", { enumerable: true, get: function () { return task_manager_1.TaskManager; } });
|
|
@@ -18,6 +18,18 @@ const propArrayFunction = (result, propId) => {
|
|
|
18
18
|
if (propId === "isEmpty()") {
|
|
19
19
|
return result.length === 0;
|
|
20
20
|
}
|
|
21
|
+
if (propId === "average()" || propId === "mean()") {
|
|
22
|
+
return result.length ? result.reduce((a, b) => a + b, 0) / result.length : 0;
|
|
23
|
+
}
|
|
24
|
+
if (propId === "sum()") {
|
|
25
|
+
return result.reduce((a, b) => a + b, 0);
|
|
26
|
+
}
|
|
27
|
+
if (propId === "max()") {
|
|
28
|
+
return result.length ? Math.max(...result) : 0;
|
|
29
|
+
}
|
|
30
|
+
if (propId === "min()") {
|
|
31
|
+
return result.length ? Math.min(...result) : 0;
|
|
32
|
+
}
|
|
21
33
|
// array join
|
|
22
34
|
const matchJoin = propId.match(/^join\(([,-\s]?)\)$/);
|
|
23
35
|
if (matchJoin && Array.isArray(matchJoin)) {
|
|
@@ -43,10 +55,17 @@ const propObjectFunction = (result, propId) => {
|
|
|
43
55
|
const propStringFunction = (result, propId) => {
|
|
44
56
|
if (typeof result === "string") {
|
|
45
57
|
if (propId === "codeBlock()") {
|
|
46
|
-
const match = ("\n" + result).match(/\n```[a-zA-
|
|
58
|
+
const match = ("\n" + result).match(/\n```[a-zA-Z]*([\s\S]*?)\n```/);
|
|
59
|
+
if (match) {
|
|
60
|
+
return match[1];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (propId === "codeBlockOrRaw()") {
|
|
64
|
+
const match = ("\n" + result).match(/\n```[a-zA-Z]*([\s\S]*?)\n```/);
|
|
47
65
|
if (match) {
|
|
48
66
|
return match[1];
|
|
49
67
|
}
|
|
68
|
+
return result;
|
|
50
69
|
}
|
|
51
70
|
if (propId === "jsonParse()") {
|
|
52
71
|
return JSON.parse(result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphai",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.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",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/receptron/graphai#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"typedoc": "^0.28.
|
|
33
|
-
"typedoc-plugin-markdown": "^4.
|
|
32
|
+
"typedoc": "^0.28.7",
|
|
33
|
+
"typedoc-plugin-markdown": "^4.7.0"
|
|
34
34
|
},
|
|
35
35
|
"types": "./lib/index.d.ts",
|
|
36
36
|
"directories": {
|