@bian-womp/spark-graph 0.3.66 → 0.3.67
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 +15 -0
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/core/types.d.ts +1 -0
- package/lib/cjs/src/core/types.d.ts.map +1 -1
- package/lib/cjs/src/runtime/GraphRuntime.d.ts +3 -0
- package/lib/cjs/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/lib/cjs/src/runtime/components/NodeExecutor.d.ts +2 -0
- package/lib/cjs/src/runtime/components/NodeExecutor.d.ts.map +1 -1
- package/lib/esm/index.js +15 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/core/types.d.ts +1 -0
- package/lib/esm/src/core/types.d.ts.map +1 -1
- package/lib/esm/src/runtime/GraphRuntime.d.ts +3 -0
- package/lib/esm/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/lib/esm/src/runtime/components/NodeExecutor.d.ts +2 -0
- package/lib/esm/src/runtime/components/NodeExecutor.d.ts.map +1 -1
- package/package.json +2 -2
package/lib/cjs/index.cjs
CHANGED
|
@@ -2961,11 +2961,15 @@ class NodeExecutor {
|
|
|
2961
2961
|
this.edgePropagator = edgePropagator;
|
|
2962
2962
|
this.runtime = runtime;
|
|
2963
2963
|
this.environment = {};
|
|
2964
|
+
this.customNodeData = {};
|
|
2964
2965
|
this.environment = environment ?? {};
|
|
2965
2966
|
}
|
|
2966
2967
|
setEnvironment(environment) {
|
|
2967
2968
|
this.environment = environment;
|
|
2968
2969
|
}
|
|
2970
|
+
setCustomNodeData(customNodeData) {
|
|
2971
|
+
this.customNodeData = customNodeData;
|
|
2972
|
+
}
|
|
2969
2973
|
/**
|
|
2970
2974
|
* Compute effective inputs for a node by merging real inputs with defaults
|
|
2971
2975
|
*/
|
|
@@ -3034,6 +3038,7 @@ class NodeExecutor {
|
|
|
3034
3038
|
},
|
|
3035
3039
|
getInput: (handle) => inputs[handle],
|
|
3036
3040
|
environment: this.environment,
|
|
3041
|
+
customNodeData: this.customNodeData[nodeId],
|
|
3037
3042
|
runId,
|
|
3038
3043
|
abortSignal,
|
|
3039
3044
|
reportProgress,
|
|
@@ -3652,6 +3657,7 @@ class GraphRuntime {
|
|
|
3652
3657
|
constructor() {
|
|
3653
3658
|
// State
|
|
3654
3659
|
this.environment = {};
|
|
3660
|
+
this.customNodeData = {};
|
|
3655
3661
|
this.runMode = null;
|
|
3656
3662
|
this.pauseRefCount = 0;
|
|
3657
3663
|
this.persistentPauseToken = null;
|
|
@@ -3671,11 +3677,13 @@ class GraphRuntime {
|
|
|
3671
3677
|
if (opts?.startPaused)
|
|
3672
3678
|
gr.pause();
|
|
3673
3679
|
gr.environment = opts?.environment ?? {};
|
|
3680
|
+
gr.customNodeData = {};
|
|
3674
3681
|
// Set registry and environment on components
|
|
3675
3682
|
gr.graph.setRegistry(registry);
|
|
3676
3683
|
gr.handleResolver.setRegistry(registry);
|
|
3677
3684
|
gr.handleResolver.setEnvironment(gr.environment);
|
|
3678
3685
|
gr.nodeExecutor.setEnvironment(gr.environment);
|
|
3686
|
+
gr.nodeExecutor.setCustomNodeData(gr.customNodeData);
|
|
3679
3687
|
gr.runtimeValidatorManager.setRegistry(registry);
|
|
3680
3688
|
// Precompute per-node resolved handles (use def-provided overrides; do not compute dynamically here)
|
|
3681
3689
|
const initial = gr.isPaused()
|
|
@@ -3897,6 +3905,13 @@ class GraphRuntime {
|
|
|
3897
3905
|
this.handleResolver.scheduleRecomputeHandles(nodeId);
|
|
3898
3906
|
}
|
|
3899
3907
|
}
|
|
3908
|
+
setCustomNodeData(customNodeData) {
|
|
3909
|
+
this.customNodeData = { ...customNodeData };
|
|
3910
|
+
this.nodeExecutor.setCustomNodeData(this.customNodeData);
|
|
3911
|
+
}
|
|
3912
|
+
getCustomNodeData() {
|
|
3913
|
+
return { ...this.customNodeData };
|
|
3914
|
+
}
|
|
3900
3915
|
/**
|
|
3901
3916
|
* Register a runtime validator that will be called before node execution.
|
|
3902
3917
|
* Validators are called in registration order - if any returns true, execution is blocked.
|