@bian-womp/spark-remote 0.3.9 → 0.3.10

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":"ServerRuntimeAdapter.d.ts","sourceRoot":"","sources":["../../../../src/server/ServerRuntimeAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAIZ,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,WAAW,EAGX,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAGZ,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,WAAW,oBACf,SAAQ,iBAAiB,EACvB,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;CAEzB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,eAAe,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClE;AAED,MAAM,MAAM,6BAA6B,GAAG;KACzC,CAAC,IAAI,MAAM,oBAAoB,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAClE,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,GAAG,GACJ,CACE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,2BAA2B,EACpC,GAAG,IAAI,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,KACzC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,GACxC,KAAK;CACV,CAAC;AAEF,wBAAsB,0BAA0B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AAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,KACzC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,GACxC,KAAK;CACV,CAAC;AAEF,wBAAsB,0BAA0B,CAC9C,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,EAClD,IAAI,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,IAAI,EACzC,UAAU,CAAC,EAAE,6BAA6B,GACzC,OAAO,CAAC,oBAAoB,CAAC,CA8X/B"}
package/lib/esm/index.js CHANGED
@@ -396,7 +396,9 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
396
396
  return await resolved.convertAsync(value, ac.signal);
397
397
  },
398
398
  getEnvironment: async () => {
399
- return graphRuntime?.getEnvironment?.() ?? {};
399
+ if (!graphRuntime)
400
+ return {};
401
+ return graphRuntime.getEnvironment();
400
402
  },
401
403
  applyRegistry: async (deltas) => {
402
404
  // Pause runtime if exists
@@ -443,8 +445,8 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
443
445
  });
444
446
  },
445
447
  build: async (def, opts) => {
446
- const env = opts?.environment || {};
447
- graphRuntime = builder.build(def, { environment: env });
448
+ const environment = opts?.environment || {};
449
+ graphRuntime = builder.build(def, { environment });
448
450
  graphRuntime.on("value", (p) => send({ message: { type: "value", payload: p } }));
449
451
  graphRuntime.on("invalidate", (p) => send({ message: { type: "invalidate", payload: p } }));
450
452
  graphRuntime.on("error", (p) => send({ message: { type: "error", payload: p } }));
@@ -487,15 +489,12 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
487
489
  return { inputs, outputs };
488
490
  },
489
491
  snapshotFull: async () => {
492
+ if (!graphRuntime)
493
+ return { inputs: {}, outputs: {} };
490
494
  const snap = await originalAdapter.snapshot();
491
- const env = graphRuntime?.getEnvironment?.() ?? {};
492
- const def = graphRuntime?.getGraphDef();
493
- return {
494
- ...snap,
495
- def,
496
- environment: env,
497
- extData,
498
- };
495
+ const environment = graphRuntime.getEnvironment();
496
+ const def = graphRuntime.getGraphDef();
497
+ return { ...snap, def, environment, extData };
499
498
  },
500
499
  applySnapshotFull: async (payload, options) => {
501
500
  const def = payload.def;
@@ -511,7 +510,9 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
511
510
  await originalAdapter.build(def, { environment: payload.environment });
512
511
  }
513
512
  // Hydrate inputs/outputs exactly, then re-emit outputs without scheduling runs
514
- graphRuntime?.hydrate({
513
+ if (!graphRuntime)
514
+ return;
515
+ graphRuntime.hydrate({
515
516
  inputs: payload.inputs,
516
517
  outputs: payload.outputs,
517
518
  });