@bian-womp/spark-graph 0.3.33 → 0.3.35

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 CHANGED
@@ -2380,7 +2380,7 @@ class NodeExecutor {
2380
2380
  /**
2381
2381
  * Internal method for executing inputs changed (also used by GraphRuntime)
2382
2382
  */
2383
- execute(nodeId, runContextIds) {
2383
+ execute(nodeId, runContextIds, canSkipHandleResolution) {
2384
2384
  const node = this.graph.getNode(nodeId);
2385
2385
  if (!node)
2386
2386
  return;
@@ -2430,6 +2430,10 @@ class NodeExecutor {
2430
2430
  if (runContextIds) {
2431
2431
  this.graph.addNodeRunContextIds(nodeId, runContextIds);
2432
2432
  }
2433
+ if (!canSkipHandleResolution &&
2434
+ !this.handleResolver.getPendingResolution(nodeId)) {
2435
+ this.handleResolver.scheduleRecomputeHandles(nodeId);
2436
+ }
2433
2437
  // Check if handles are being resolved - wait for resolution before executing
2434
2438
  // Do this AFTER setting up run contexts so handle resolution can track them
2435
2439
  const pendingResolution = this.handleResolver.getPendingResolution(nodeId);
@@ -2444,7 +2448,7 @@ class NodeExecutor {
2444
2448
  // Re-check node still exists and conditions
2445
2449
  const nodeAfter = this.graph.getNode(nodeId);
2446
2450
  if (nodeAfter) {
2447
- this.execute(nodeId, runContextIds);
2451
+ this.execute(nodeId, runContextIds, true);
2448
2452
  }
2449
2453
  if (runContextIds && runContextIds.size > 0) {
2450
2454
  for (const id of runContextIds) {
@@ -3322,6 +3326,7 @@ class GraphRuntime {
3322
3326
  if (!fromNode?.outputs)
3323
3327
  return;
3324
3328
  this.hydrate({ outputs: { [toNodeId]: { ...fromNode.outputs } } }, { invalidate: !options?.dry });
3329
+ this.handleResolver.scheduleRecomputeHandles(toNodeId);
3325
3330
  }
3326
3331
  hydrate(payload, opts) {
3327
3332
  const releasePause = this.requestPause();
@@ -3638,8 +3643,8 @@ class GraphRuntime {
3638
3643
  });
3639
3644
  this.graph.clear();
3640
3645
  }
3641
- execute(nodeId, runContextIds) {
3642
- this.nodeExecutor.execute(nodeId, runContextIds);
3646
+ execute(nodeId, runContextIds, resolveHandles) {
3647
+ this.nodeExecutor.execute(nodeId, runContextIds, resolveHandles);
3643
3648
  }
3644
3649
  propagate(srcNodeId, srcHandle, value, runContextIds) {
3645
3650
  this.edgePropagator.propagate(srcNodeId, srcHandle, value, runContextIds);