graphai 0.6.14 → 0.6.16
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 +3 -0
- 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/index.d.ts +2 -1
- package/lib/node.d.ts +1 -1
- package/lib/node.js +3 -0
- package/lib/utils/result.js +2 -2
- package/lib/validators/agent_validator.js +1 -1
- package/lib/validators/computed_node_validator.js +1 -1
- package/lib/validators/graph_data_validator.js +1 -1
- package/lib/validators/nodeValidator.js +1 -1
- package/lib/validators/relation_validator.js +1 -1
- package/lib/validators/static_node_validator.js +1 -1
- package/package.json +1 -1
package/lib/node.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class ComputedNode extends Node {
|
|
|
23
23
|
readonly retryLimit: number;
|
|
24
24
|
retryCount: number;
|
|
25
25
|
private readonly agentId?;
|
|
26
|
-
private
|
|
26
|
+
private agentFunction?;
|
|
27
27
|
readonly timeout?: number;
|
|
28
28
|
readonly priority: number;
|
|
29
29
|
error?: Error;
|
package/lib/node.js
CHANGED
|
@@ -232,6 +232,9 @@ class ComputedNode extends Node {
|
|
|
232
232
|
}
|
|
233
233
|
const previousResults = this.graph.resultsOf(this.inputs, this.anyInput);
|
|
234
234
|
const agentId = this.agentId ? this.graph.resultOf((0, utils_2.parseNodeName)(this.agentId)) : this.agentId;
|
|
235
|
+
if (typeof agentId === "function") {
|
|
236
|
+
this.agentFunction = agentId;
|
|
237
|
+
}
|
|
235
238
|
const config = this.getConfig(!!this.nestedGraph, agentId);
|
|
236
239
|
const transactionId = Date.now();
|
|
237
240
|
this.prepareExecute(transactionId, Object.values(previousResults));
|
package/lib/utils/result.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cleanResult = exports.cleanResultInner = exports.resultOf = exports.resultsOf = void 0;
|
|
4
|
-
const utils_1 = require("
|
|
5
|
-
const data_source_1 = require("
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const data_source_1 = require("./data_source");
|
|
6
6
|
const resultsOfInner = (input, nodes, propFunctions, isSelfNode = false) => {
|
|
7
7
|
if (Array.isArray(input)) {
|
|
8
8
|
return input.map((inp) => resultsOfInner(inp, nodes, propFunctions, isSelfNode));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.agentValidator = void 0;
|
|
4
|
-
const common_1 = require("
|
|
4
|
+
const common_1 = require("./common");
|
|
5
5
|
const agentValidator = (graphAgentIds, agentIds) => {
|
|
6
6
|
graphAgentIds.forEach((agentId) => {
|
|
7
7
|
// agentId or dynamic agentId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.computedNodeValidator = void 0;
|
|
4
|
-
const common_1 = require("
|
|
4
|
+
const common_1 = require("./common");
|
|
5
5
|
const computedNodeValidator = (nodeData) => {
|
|
6
6
|
Object.keys(nodeData).forEach((key) => {
|
|
7
7
|
if (!common_1.computedNodeAttributeKeys.includes(key)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.graphDataValidator = exports.graphNodesValidator = void 0;
|
|
4
|
-
const common_1 = require("
|
|
4
|
+
const common_1 = require("./common");
|
|
5
5
|
const graphNodesValidator = (data) => {
|
|
6
6
|
if (data.nodes === undefined) {
|
|
7
7
|
throw new common_1.ValidationError("Invalid Graph Data: no nodes");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nodeValidator = void 0;
|
|
4
|
-
const common_1 = require("
|
|
4
|
+
const common_1 = require("./common");
|
|
5
5
|
const nodeValidator = (nodeData) => {
|
|
6
6
|
if (nodeData.agent && nodeData.value) {
|
|
7
7
|
throw new common_1.ValidationError("Cannot set both agent and value");
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.relationValidator = void 0;
|
|
4
4
|
const utils_1 = require("../utils/utils");
|
|
5
|
-
const common_1 = require("../validators/common");
|
|
6
5
|
const nodeUtils_1 = require("../utils/nodeUtils");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
7
|
const relationValidator = (graphData, staticNodeIds, computedNodeIds) => {
|
|
8
8
|
const nodeIds = new Set(Object.keys(graphData.nodes));
|
|
9
9
|
const pendings = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.staticNodeValidator = void 0;
|
|
4
|
-
const common_1 = require("
|
|
4
|
+
const common_1 = require("./common");
|
|
5
5
|
const staticNodeValidator = (nodeData) => {
|
|
6
6
|
Object.keys(nodeData).forEach((key) => {
|
|
7
7
|
if (!common_1.staticNodeAttributeKeys.includes(key)) {
|