@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.
@@ -1 +1 @@
1
- {"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../../../../src/transport/Transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAG1D;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC,MAAM,EACN,MAAM,GAAG,MAAM,GAAG,SAAS,CAC5B,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,sBAAsB,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,OAAO,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,GAAG,OAAO,EACpC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,GAClB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3B,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
1
+ {"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../../../../src/transport/Transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC,MAAM,EACN,MAAM,GAAG,MAAM,GAAG,SAAS,CAC5B,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,sBAAsB,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,OAAO,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,GAAG,OAAO,EACpC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,GAClB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3B,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
package/lib/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebSocket } from 'ws';
2
- import { GraphBuilder, UnifiedEngine } from '@bian-womp/spark-graph';
2
+ import { GraphBuilder, LocalEngine } from '@bian-womp/spark-graph';
3
3
 
4
4
  class SeqGenerator {
5
5
  constructor() {
@@ -555,9 +555,8 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
555
555
  update: async (def, options) => {
556
556
  if (!graphRuntime)
557
557
  return;
558
- const wasPaused = graphRuntime.isPaused();
559
- if (options?.dry && !wasPaused)
560
- graphRuntime.pause();
558
+ // Use requestPause for dry mode to temporarily pause without affecting base run mode
559
+ const releasePause = options?.dry ? graphRuntime.requestPause() : null;
561
560
  try {
562
561
  graphRuntime.update(def, registry);
563
562
  send({
@@ -568,16 +567,14 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
568
567
  });
569
568
  }
570
569
  finally {
571
- if (options?.dry && !wasPaused)
572
- graphRuntime.resume();
570
+ releasePause?.();
573
571
  }
574
572
  },
575
573
  setEnvironment: async (env, opts) => {
576
574
  if (!graphRuntime)
577
575
  return;
578
- const wasPaused = graphRuntime.isPaused();
579
- if (opts?.dry && !wasPaused)
580
- graphRuntime.pause();
576
+ // Use requestPause for dry mode to temporarily pause without affecting base run mode
577
+ const releasePause = opts?.dry ? graphRuntime.requestPause() : null;
581
578
  try {
582
579
  if (opts?.merge) {
583
580
  const current = graphRuntime.getEnvironment();
@@ -589,8 +586,7 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
589
586
  }
590
587
  }
591
588
  finally {
592
- if (opts?.dry && !wasPaused)
593
- graphRuntime.resume();
589
+ releasePause?.();
594
590
  }
595
591
  },
596
592
  setInputs: (nodeId, inputs, options) => {
@@ -618,7 +614,7 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
618
614
  engine = undefined;
619
615
  }
620
616
  // Create new engine using shared factory
621
- engine = new UnifiedEngine(graphRuntime, opts?.runMode);
617
+ engine = new LocalEngine(graphRuntime, opts?.runMode);
622
618
  engine.launch(opts?.invalidate);
623
619
  },
624
620
  setRunMode: (runMode) => {
@@ -767,13 +763,8 @@ class RemoteEngine {
767
763
  this.emit("stats", msg.payload);
768
764
  }
769
765
  }
770
- launch(invalidate, runMode) {
771
- this.transport.send({
772
- message: {
773
- type: "Launch",
774
- payload: { runMode, invalidate },
775
- },
776
- });
766
+ launch() {
767
+ throw new Error("RemoteEngine.launch() is not supported. Use GraphLifecycleApi.launch() instead.");
777
768
  }
778
769
  setRunMode(runMode) {
779
770
  this.transport.send({