@fbp/evaluator 0.2.0 → 1.0.0
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/esm/evaluate.js +14 -0
- package/evaluate.js +14 -0
- package/package.json +6 -6
package/esm/evaluate.js
CHANGED
|
@@ -72,6 +72,20 @@ export async function evaluate(graph, options) {
|
|
|
72
72
|
cache.set(nodeName, result);
|
|
73
73
|
return result;
|
|
74
74
|
}
|
|
75
|
+
if (node.type === 'graphOutput') {
|
|
76
|
+
// graphOutput is a pass-through: evaluate its upstream 'value' input
|
|
77
|
+
const portEdges = edgesByDst.get(nodeName);
|
|
78
|
+
const edges = portEdges?.get('value') ?? [];
|
|
79
|
+
let value = undefined;
|
|
80
|
+
if (edges.length > 0) {
|
|
81
|
+
const edge = edges[0];
|
|
82
|
+
const upstreamOutputs = await evaluateNode(edge.src.node);
|
|
83
|
+
value = upstreamOutputs[edge.src.port];
|
|
84
|
+
}
|
|
85
|
+
const result = { value };
|
|
86
|
+
cache.set(nodeName, result);
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
75
89
|
// Handle subnet nodes (kind: 'subnet')
|
|
76
90
|
if (node.kind === 'subnet' && node.nodes && node.edges) {
|
|
77
91
|
// Collect inputs for the subnet by evaluating upstream nodes
|
package/evaluate.js
CHANGED
|
@@ -75,6 +75,20 @@ async function evaluate(graph, options) {
|
|
|
75
75
|
cache.set(nodeName, result);
|
|
76
76
|
return result;
|
|
77
77
|
}
|
|
78
|
+
if (node.type === 'graphOutput') {
|
|
79
|
+
// graphOutput is a pass-through: evaluate its upstream 'value' input
|
|
80
|
+
const portEdges = edgesByDst.get(nodeName);
|
|
81
|
+
const edges = portEdges?.get('value') ?? [];
|
|
82
|
+
let value = undefined;
|
|
83
|
+
if (edges.length > 0) {
|
|
84
|
+
const edge = edges[0];
|
|
85
|
+
const upstreamOutputs = await evaluateNode(edge.src.node);
|
|
86
|
+
value = upstreamOutputs[edge.src.port];
|
|
87
|
+
}
|
|
88
|
+
const result = { value };
|
|
89
|
+
cache.set(nodeName, result);
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
78
92
|
// Handle subnet nodes (kind: 'subnet')
|
|
79
93
|
if (node.kind === 'subnet' && node.nodes && node.edges) {
|
|
80
94
|
// Collect inputs for the subnet by evaluating upstream nodes
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fbp/evaluator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "Lazy graph evaluator for Flow-Based Programming",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"module": "esm/index.js",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
|
-
"homepage": "https://github.com/
|
|
9
|
+
"homepage": "https://github.com/flow-based-programming/spec",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/
|
|
17
|
+
"url": "https://github.com/flow-based-programming/spec"
|
|
18
18
|
},
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/flow-based-programming/spec/issues"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"clean": "makage clean",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"lazy-evaluation"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@fbp/types": "0.
|
|
38
|
+
"@fbp/types": "1.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"makage": "0.1.9"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "eb437177718d8b0c6279a727281567598a5a0958"
|
|
44
44
|
}
|