@bian-womp/spark-remote 0.3.1 → 0.3.2

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
@@ -557,9 +557,8 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
557
557
  update: async (def, options) => {
558
558
  if (!graphRuntime)
559
559
  return;
560
- const wasPaused = graphRuntime.isPaused();
561
- if (options?.dry && !wasPaused)
562
- graphRuntime.pause();
560
+ // Use requestPause for dry mode to temporarily pause without affecting base run mode
561
+ const releasePause = options?.dry ? graphRuntime.requestPause() : null;
563
562
  try {
564
563
  graphRuntime.update(def, registry);
565
564
  send({
@@ -570,16 +569,14 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
570
569
  });
571
570
  }
572
571
  finally {
573
- if (options?.dry && !wasPaused)
574
- graphRuntime.resume();
572
+ releasePause?.();
575
573
  }
576
574
  },
577
575
  setEnvironment: async (env, opts) => {
578
576
  if (!graphRuntime)
579
577
  return;
580
- const wasPaused = graphRuntime.isPaused();
581
- if (opts?.dry && !wasPaused)
582
- graphRuntime.pause();
578
+ // Use requestPause for dry mode to temporarily pause without affecting base run mode
579
+ const releasePause = opts?.dry ? graphRuntime.requestPause() : null;
583
580
  try {
584
581
  if (opts?.merge) {
585
582
  const current = graphRuntime.getEnvironment();
@@ -591,8 +588,7 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
591
588
  }
592
589
  }
593
590
  finally {
594
- if (opts?.dry && !wasPaused)
595
- graphRuntime.resume();
591
+ releasePause?.();
596
592
  }
597
593
  },
598
594
  setInputs: (nodeId, inputs, options) => {
@@ -620,7 +616,7 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
620
616
  engine = undefined;
621
617
  }
622
618
  // Create new engine using shared factory
623
- engine = new sparkGraph.UnifiedEngine(graphRuntime, opts?.runMode);
619
+ engine = new sparkGraph.LocalEngine(graphRuntime, opts?.runMode);
624
620
  engine.launch(opts?.invalidate);
625
621
  },
626
622
  setRunMode: (runMode) => {
@@ -769,13 +765,8 @@ class RemoteEngine {
769
765
  this.emit("stats", msg.payload);
770
766
  }
771
767
  }
772
- launch(invalidate, runMode) {
773
- this.transport.send({
774
- message: {
775
- type: "Launch",
776
- payload: { runMode, invalidate },
777
- },
778
- });
768
+ launch() {
769
+ throw new Error("RemoteEngine.launch() is not supported. Use GraphLifecycleApi.launch() instead.");
779
770
  }
780
771
  setRunMode(runMode) {
781
772
  this.transport.send({