@lace-cloud/proto 0.29.0 → 0.30.0

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/dist/index.cjs CHANGED
@@ -3581,10 +3581,10 @@ function deriveNodeConfig(bundle, instanceId) {
3581
3581
  description: def.description || void 0,
3582
3582
  sensitive: def.sensitive || void 0
3583
3583
  }));
3584
- const siblingIds = [
3584
+ const dependencyOptions = [
3585
3585
  ...(scope.modules ?? []).map((u) => u.id),
3586
3586
  ...(scope.resources ?? []).map((r) => r.id)
3587
- ].filter((id) => id !== child.id);
3587
+ ].filter((id) => id !== child.id).map(childReference);
3588
3588
  const dependsOn = child.use?.depends_on ?? child.resource?.depends_on ?? [];
3589
3589
  const providers = child.use?.providers ?? {};
3590
3590
  const meta = child.use ?? child.resource;
@@ -3595,9 +3595,10 @@ function deriveNodeConfig(bundle, instanceId) {
3595
3595
  return {
3596
3596
  instance_id: instanceId,
3597
3597
  module_key: child.use?.module,
3598
+ source: child.use ? callSource(bundle, resolved.scopeKey, child.use.module) : void 0,
3598
3599
  inputs,
3599
3600
  outputs,
3600
- sibling_ids: siblingIds,
3601
+ dependency_options: dependencyOptions,
3601
3602
  depends_on: dependsOn,
3602
3603
  providers,
3603
3604
  count: bindingText(meta?.count),
@@ -3605,6 +3606,38 @@ function deriveNodeConfig(bundle, instanceId) {
3605
3606
  available_variables: availableVariables
3606
3607
  };
3607
3608
  }
3609
+ function callSource(bundle, scopeKey, moduleKey) {
3610
+ const from = dirOf(bundle, scopeKey);
3611
+ const to = sourceDir(bundle, moduleKey);
3612
+ if (from !== void 0 && to !== void 0) return memberSourcePath(from, to);
3613
+ const source = bundle.modules[moduleKey]?.source;
3614
+ return source ? sourceText(source) : "";
3615
+ }
3616
+ function isMemberDir(id) {
3617
+ return id !== "" && id !== "." && id !== ".." && !id.startsWith("./") && !id.startsWith("../") && !id.startsWith("/");
3618
+ }
3619
+ function dirOf(bundle, key) {
3620
+ if (key === bundle.entry) return "";
3621
+ const mod = bundle.modules[key];
3622
+ if (!mod || mod.source || !isMemberDir(mod.id)) return void 0;
3623
+ return mod.id;
3624
+ }
3625
+ function sourceDir(bundle, key) {
3626
+ const dir = dirOf(bundle, key);
3627
+ if (dir !== void 0) return dir;
3628
+ const mod = bundle.modules[key];
3629
+ return mod?.source?.kind === "local" && isMemberDir(mod.id) ? mod.id : void 0;
3630
+ }
3631
+ function memberSourcePath(from, to) {
3632
+ const base = from === "" ? [] : from.split("/");
3633
+ const target = to.split("/");
3634
+ let shared = 0;
3635
+ while (shared < base.length && shared < target.length && base[shared] === target[shared]) {
3636
+ shared++;
3637
+ }
3638
+ const rel = [...base.slice(shared).map(() => ".."), ...target.slice(shared)].join("/") || ".";
3639
+ return rel.startsWith("../") ? rel : `./${rel}`;
3640
+ }
3608
3641
  function sourceText(source) {
3609
3642
  if (source.kind === "git") {
3610
3643
  const subdir = source.subdir ? `//${source.subdir}` : "";
@@ -5079,7 +5112,7 @@ function isSet3(value) {
5079
5112
  var CanvasViewProto = CanvasView;
5080
5113
 
5081
5114
  // src/protocol-version.ts
5082
- var ENGINE_PROTOCOL_VERSION = String(6 /* PROTOCOL_VERSION_CURRENT */);
5115
+ var ENGINE_PROTOCOL_VERSION = String(7 /* PROTOCOL_VERSION_CURRENT */);
5083
5116
  var EngineProtocolMismatchError = class extends Error {
5084
5117
  constructor(engineVersion, engineProtocol, requiredProtocol) {
5085
5118
  super(