graphai 0.6.12 → 0.6.13

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/node.js CHANGED
@@ -74,7 +74,7 @@ class ComputedNode extends Node {
74
74
  const agent = data.agent;
75
75
  this.agentFunction = async ({ namedInputs, params }) => agent(namedInputs, params);
76
76
  }
77
- this.config = this.agentId ? (data.graph ? this.graph.config : ((this.graph.config ?? {})[this.agentId] ?? {})) : {};
77
+ this.config = this.getConfig(!!data.graph);
78
78
  this.anyInput = data.anyInput ?? false;
79
79
  this.inputs = data.inputs;
80
80
  this.output = data.output;
@@ -108,6 +108,19 @@ class ComputedNode extends Node {
108
108
  getAgentId() {
109
109
  return this.agentId ?? "__custom__function"; // only for display purpose in the log.
110
110
  }
111
+ getConfig(hasGraphData) {
112
+ if (this.agentId) {
113
+ if (hasGraphData) {
114
+ return this.graph.config;
115
+ }
116
+ const config = this.graph.config ?? {};
117
+ return {
118
+ ...(config["global"] ?? {}),
119
+ ...(config[this.agentId] ?? {}),
120
+ };
121
+ }
122
+ return {};
123
+ }
111
124
  addPendingNode(nodeId) {
112
125
  const source = (0, utils_2.parseNodeName)(nodeId);
113
126
  (0, utils_2.assert)(!!source.nodeId, `Invalid data source ${nodeId}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphai",
3
- "version": "0.6.12",
3
+ "version": "0.6.13",
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",