@bian-womp/spark-graph 0.3.91 → 0.3.92
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/cjs/index.cjs +25 -0
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/runtime/GraphRuntime.d.ts +19 -0
- package/lib/cjs/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/lib/esm/index.js +25 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/runtime/GraphRuntime.d.ts +19 -0
- package/lib/esm/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/package.json +2 -2
package/lib/cjs/index.cjs
CHANGED
|
@@ -4095,6 +4095,7 @@ class GraphRuntime {
|
|
|
4095
4095
|
if (!node)
|
|
4096
4096
|
return undefined;
|
|
4097
4097
|
return {
|
|
4098
|
+
typeId: node.typeId,
|
|
4098
4099
|
inputs: node.inputs,
|
|
4099
4100
|
outputs: node.outputs,
|
|
4100
4101
|
state: node.state,
|
|
@@ -4102,6 +4103,20 @@ class GraphRuntime {
|
|
|
4102
4103
|
stats: node.stats,
|
|
4103
4104
|
};
|
|
4104
4105
|
}
|
|
4106
|
+
/**
|
|
4107
|
+
* Update a node input without scheduling execution.
|
|
4108
|
+
* Used for selection-only updates (e.g. ImageIndex on ext.ai.generateImage).
|
|
4109
|
+
*/
|
|
4110
|
+
updateNodeInput(nodeId, handle, value) {
|
|
4111
|
+
this.graph.updateNodeInput(nodeId, handle, value, true);
|
|
4112
|
+
}
|
|
4113
|
+
/**
|
|
4114
|
+
* Update a node output and optionally propagate downstream.
|
|
4115
|
+
* Does not run the node. Used for selection-only updates.
|
|
4116
|
+
*/
|
|
4117
|
+
updateNodeOutput(nodeId, handle, value) {
|
|
4118
|
+
this.graph.updateNodeOutput(nodeId, handle, value);
|
|
4119
|
+
}
|
|
4105
4120
|
getEnvironment() {
|
|
4106
4121
|
return { ...this.environment };
|
|
4107
4122
|
}
|
|
@@ -4582,6 +4597,16 @@ class GraphRuntime {
|
|
|
4582
4597
|
propagate(srcNodeId, srcHandle, value, runContextIds) {
|
|
4583
4598
|
this.edgePropagator.propagate(srcNodeId, srcHandle, value, runContextIds);
|
|
4584
4599
|
}
|
|
4600
|
+
/**
|
|
4601
|
+
* Propagate a value from a node with a temporary run context so downstream execution
|
|
4602
|
+
* is allowed in manual mode. Use this when updating an output without running the node
|
|
4603
|
+
* (e.g. selection-only ImageIndex update on ext.ai.generateImage).
|
|
4604
|
+
*/
|
|
4605
|
+
propagateWithRunContext(srcNodeId, srcHandle, value, options) {
|
|
4606
|
+
this.withRunContext(srcNodeId, { propagate: options?.propagate ?? true }, (runContextIds) => {
|
|
4607
|
+
this.propagate(srcNodeId, srcHandle, value, runContextIds);
|
|
4608
|
+
});
|
|
4609
|
+
}
|
|
4585
4610
|
invalidateDownstream(nodeId) {
|
|
4586
4611
|
this.edgePropagator.invalidateDownstream(nodeId);
|
|
4587
4612
|
}
|