@lace-cloud/proto 0.16.2 → 0.18.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.mjs CHANGED
@@ -1,224 +1,47 @@
1
1
  // src/converters.ts
2
- var NODE_KIND_MODULE = 1;
3
- var NODE_KIND_RESOURCE = 2;
4
- var NODE_KIND_DATA = 3;
5
- var INPUT_MODE_EMPTY = 1;
6
- var INPUT_MODE_LITERAL = 2;
7
- var INPUT_MODE_VARIABLE = 3;
8
- var INPUT_MODE_EXPRESSION = 4;
9
- var INPUT_MODE_WIRED = 5;
10
2
  var DIAGNOSTIC_SEVERITY_WARNING = 2;
11
3
  var DIAGNOSTIC_SEVERITY_INFO = 3;
12
- function convertNodeKind(value) {
13
- switch (value) {
14
- case NODE_KIND_MODULE:
15
- return "module";
16
- case NODE_KIND_RESOURCE:
17
- return "resource";
18
- case NODE_KIND_DATA:
19
- return "data";
20
- default:
21
- return "module";
22
- }
23
- }
24
- function convertInputMode(value) {
25
- switch (value) {
26
- case INPUT_MODE_LITERAL:
27
- return "literal";
28
- case INPUT_MODE_VARIABLE:
29
- return "variable";
30
- case INPUT_MODE_EXPRESSION:
31
- return "expression";
32
- case INPUT_MODE_WIRED:
33
- return "wired";
34
- default:
35
- return "empty";
36
- }
37
- }
38
- function convertDiagnosticSeverity(value) {
39
- switch (value) {
4
+ function convertDiagnostic(d) {
5
+ let severity;
6
+ switch (d.severity) {
40
7
  case DIAGNOSTIC_SEVERITY_WARNING:
41
- return "warning";
8
+ severity = "warning";
9
+ break;
42
10
  case DIAGNOSTIC_SEVERITY_INFO:
43
- return "info";
44
- default:
45
- return "error";
46
- }
47
- }
48
- function modeToInputMode(mode) {
49
- switch (mode) {
50
- case "literal":
51
- return INPUT_MODE_LITERAL;
52
- case "variable":
53
- return INPUT_MODE_VARIABLE;
54
- case "expression":
55
- return INPUT_MODE_EXPRESSION;
56
- case "wired":
57
- return INPUT_MODE_WIRED;
11
+ severity = "info";
12
+ break;
58
13
  default:
59
- return INPUT_MODE_EMPTY;
14
+ severity = "error";
60
15
  }
61
- }
62
- function convertRenderInput(input) {
63
- return {
64
- name: input.name,
65
- type: input.type,
66
- required: input.required,
67
- description: input.description || void 0,
68
- default_value: input.default_value ?? void 0,
69
- validation: input.validation ? { condition: input.validation.condition, error_message: input.validation.error_message } : void 0,
70
- mode: convertInputMode(input.mode),
71
- value: input.value ?? void 0,
72
- variable: input.variable || void 0,
73
- expression: input.expression || void 0,
74
- wired_source: input.wired_source || void 0
75
- };
76
- }
77
- function convertRenderNode(node) {
78
- return {
79
- id: node.id,
80
- label: node.label,
81
- kind: convertNodeKind(node.kind),
82
- module_key: node.module_key || void 0,
83
- position: node.position ?? { x: 0, y: 0 },
84
- has_errors: node.has_errors,
85
- error_messages: node.error_messages,
86
- inputs: node.inputs.map((p) => ({
87
- name: p.name,
88
- type: p.type,
89
- required: p.required || void 0,
90
- wired: p.wired || void 0,
91
- description: p.description || void 0
92
- })),
93
- outputs: node.outputs.map((p) => ({
94
- name: p.name,
95
- type: p.type,
96
- wired: p.wired || void 0,
97
- description: p.description || void 0,
98
- sensitive: p.sensitive || void 0
99
- }))
100
- };
101
- }
102
- function convertRenderError(error) {
103
- return {
104
- instance_id: error.instance_id || void 0,
105
- input_name: error.input_name || void 0,
106
- message: error.message
107
- };
108
- }
109
- function convertCanvasView(proto) {
110
- return {
111
- module_name: proto.module_name,
112
- nodes: proto.nodes.map(convertRenderNode),
113
- edges: proto.edges.map((e) => ({
114
- id: e.id,
115
- source: e.source,
116
- target: e.target,
117
- source_output: e.source_output,
118
- target_input: e.target_input
119
- })),
120
- errors: proto.errors.map(convertRenderError),
121
- can_undo: proto.can_undo,
122
- can_redo: proto.can_redo,
123
- is_dirty: proto.is_dirty,
124
- groups: proto.groups.map((g) => ({
125
- id: g.id,
126
- label: g.label,
127
- node_ids: g.node_ids,
128
- collapsed: g.collapsed,
129
- module_key: g.module_key || void 0,
130
- inputs: g.inputs && g.inputs.length > 0 ? g.inputs : void 0,
131
- outputs: g.outputs && g.outputs.length > 0 ? g.outputs : void 0
132
- }))
133
- };
134
- }
135
- function convertNodeConfig(proto) {
136
- return {
137
- instance_id: proto.instance_id,
138
- inputs: proto.inputs.map(convertRenderInput),
139
- outputs: proto.outputs.map((o) => ({
140
- name: o.name,
141
- type: o.type,
142
- description: o.description || void 0,
143
- sensitive: o.sensitive
144
- })),
145
- sibling_ids: proto.sibling_ids,
146
- depends_on: proto.depends_on,
147
- providers: proto.providers ?? {},
148
- available_variables: proto.available_variables.map((v) => ({ name: v.name, type: v.type }))
149
- };
150
- }
151
- function convertEdgeConfig(proto) {
152
- return {
153
- source_instance: proto.source_instance,
154
- target_instance: proto.target_instance,
155
- source_outputs: proto.source_outputs.map((o) => ({
156
- name: o.name,
157
- type: o.type,
158
- description: o.description || void 0,
159
- sensitive: o.sensitive
160
- })),
161
- target_unbound_inputs: proto.target_unbound_inputs.map(convertRenderInput)
162
- };
163
- }
164
- function convertSettingsConfig(proto) {
165
- return {
166
- terraform: {
167
- required_version: proto.terraform?.required_version ?? "",
168
- required_providers: (proto.terraform?.required_providers ?? []).map((p) => ({
169
- name: p.name,
170
- source: p.source,
171
- version: p.version,
172
- configuration_aliases: p.configuration_aliases && p.configuration_aliases.length > 0 ? p.configuration_aliases : void 0
173
- }))
174
- },
175
- providers: proto.providers.map((p) => ({
176
- name: p.name,
177
- alias: p.alias,
178
- config: p.config ?? {},
179
- blocks: p.blocks && p.blocks.length > 0 ? p.blocks : void 0
180
- })),
181
- locals: proto.locals.map((l) => ({
182
- name: l.name,
183
- mode: l.mode,
184
- value_display: l.value_display
185
- })),
186
- environments: proto.environments ?? {},
187
- variables: (proto.variables ?? []).map((v) => ({
188
- name: v.name,
189
- type: v.type,
190
- required: v.required,
191
- description: v.description || void 0,
192
- default_value: v.default_value,
193
- validation: v.validation && v.validation.length > 0 ? v.validation.map((b) => ({ condition: b.condition, error_message: b.error_message })) : void 0,
194
- ephemeral: v.ephemeral,
195
- sensitive: v.sensitive,
196
- nullable: v.nullable
197
- })),
198
- exports: (proto.exports ?? []).map((e) => ({
199
- name: e.name,
200
- source_instance: e.source_instance,
201
- source_output: e.source_output
202
- })),
203
- output_defs: (proto.output_defs ?? []).map((d) => ({
204
- name: d.name,
205
- type: d.type,
206
- description: d.description || void 0,
207
- sensitive: d.sensitive,
208
- depends_on: d.depends_on && d.depends_on.length > 0 ? d.depends_on : void 0
209
- }))
210
- };
211
- }
212
- function convertDiagnostic(d) {
213
16
  return {
214
- severity: convertDiagnosticSeverity(d.severity),
17
+ severity,
215
18
  message: d.message,
19
+ module_key: d.module_key || void 0,
20
+ instance_id: d.instance_id || void 0,
21
+ input_name: d.input_name || void 0,
216
22
  file: d.file || void 0,
217
23
  line: d.line || void 0,
218
24
  column: d.column || void 0
219
25
  };
220
26
  }
221
27
 
28
+ // src/engine-bridge.ts
29
+ var ENGINE_METHODS = [
30
+ "Initialize",
31
+ "SessionOpen",
32
+ "TestSessionOpen",
33
+ "SessionSave",
34
+ "SessionClose",
35
+ "SessionGenerate",
36
+ "SessionResolveConflict",
37
+ "ApplyAction",
38
+ "CancelInvoke"
39
+ ];
40
+ var ENGINE_STREAM_METHODS = ["Subscribe", "Invoke"];
41
+ var BRIDGE_METHODS = ENGINE_METHODS.filter(
42
+ (m) => m !== "TestSessionOpen"
43
+ );
44
+
222
45
  // src/generated/state.ts
223
46
  import { BinaryReader as BinaryReader2, BinaryWriter as BinaryWriter2 } from "@bufbuild/protobuf/wire";
224
47
 
@@ -650,7 +473,7 @@ function isSet(value) {
650
473
 
651
474
  // src/generated/state.ts
652
475
  function createBaseBundle() {
653
- return { schema_version: "", kind: "", entry: "", modules: {}, environments: {}, environment_backends: {} };
476
+ return { schema_version: "", kind: "", entry: "", modules: {} };
654
477
  }
655
478
  var Bundle = {
656
479
  encode(message, writer = new BinaryWriter2()) {
@@ -666,16 +489,6 @@ var Bundle = {
666
489
  globalThis.Object.entries(message.modules).forEach(([key, value]) => {
667
490
  Bundle_ModulesEntry.encode({ key, value }, writer.uint32(34).fork()).join();
668
491
  });
669
- globalThis.Object.entries(message.environments).forEach(
670
- ([key, value]) => {
671
- if (value !== void 0) {
672
- Bundle_EnvironmentsEntry.encode({ key, value }, writer.uint32(42).fork()).join();
673
- }
674
- }
675
- );
676
- globalThis.Object.entries(message.environment_backends).forEach(([key, value]) => {
677
- Bundle_EnvironmentBackendsEntry.encode({ key, value }, writer.uint32(50).fork()).join();
678
- });
679
492
  return writer;
680
493
  },
681
494
  decode(input, length) {
@@ -716,26 +529,6 @@ var Bundle = {
716
529
  }
717
530
  continue;
718
531
  }
719
- case 5: {
720
- if (tag !== 42) {
721
- break;
722
- }
723
- const entry5 = Bundle_EnvironmentsEntry.decode(reader, reader.uint32());
724
- if (entry5.value !== void 0) {
725
- message.environments[entry5.key] = entry5.value;
726
- }
727
- continue;
728
- }
729
- case 6: {
730
- if (tag !== 50) {
731
- break;
732
- }
733
- const entry6 = Bundle_EnvironmentBackendsEntry.decode(reader, reader.uint32());
734
- if (entry6.value !== void 0) {
735
- message.environment_backends[entry6.key] = entry6.value;
736
- }
737
- continue;
738
- }
739
532
  }
740
533
  if ((tag & 7) === 4 || tag === 0) {
741
534
  break;
@@ -755,26 +548,6 @@ var Bundle = {
755
548
  return acc;
756
549
  },
757
550
  {}
758
- ) : {},
759
- environments: isObject2(object.environments) ? globalThis.Object.entries(object.environments).reduce(
760
- (acc, [key, value]) => {
761
- acc[key] = value;
762
- return acc;
763
- },
764
- {}
765
- ) : {},
766
- environment_backends: isObject2(object.environmentBackends) ? globalThis.Object.entries(object.environmentBackends).reduce(
767
- (acc, [key, value]) => {
768
- acc[key] = BackendConfig.fromJSON(value);
769
- return acc;
770
- },
771
- {}
772
- ) : isObject2(object.environment_backends) ? globalThis.Object.entries(object.environment_backends).reduce(
773
- (acc, [key, value]) => {
774
- acc[key] = BackendConfig.fromJSON(value);
775
- return acc;
776
- },
777
- {}
778
551
  ) : {}
779
552
  };
780
553
  },
@@ -798,24 +571,6 @@ var Bundle = {
798
571
  });
799
572
  }
800
573
  }
801
- if (message.environments) {
802
- const entries = globalThis.Object.entries(message.environments);
803
- if (entries.length > 0) {
804
- obj.environments = {};
805
- entries.forEach(([k, v]) => {
806
- obj.environments[k] = v;
807
- });
808
- }
809
- }
810
- if (message.environment_backends) {
811
- const entries = globalThis.Object.entries(message.environment_backends);
812
- if (entries.length > 0) {
813
- obj.environmentBackends = {};
814
- entries.forEach(([k, v]) => {
815
- obj.environmentBackends[k] = BackendConfig.toJSON(v);
816
- });
817
- }
818
- }
819
574
  return obj;
820
575
  },
821
576
  create(base) {
@@ -835,24 +590,6 @@ var Bundle = {
835
590
  },
836
591
  {}
837
592
  );
838
- message.environments = globalThis.Object.entries(object.environments ?? {}).reduce(
839
- (acc, [key, value]) => {
840
- if (value !== void 0) {
841
- acc[key] = value;
842
- }
843
- return acc;
844
- },
845
- {}
846
- );
847
- message.environment_backends = globalThis.Object.entries(object.environment_backends ?? {}).reduce(
848
- (acc, [key, value]) => {
849
- if (value !== void 0) {
850
- acc[key] = BackendConfig.fromPartial(value);
851
- }
852
- return acc;
853
- },
854
- {}
855
- );
856
593
  return message;
857
594
  }
858
595
  };
@@ -924,142 +661,6 @@ var Bundle_ModulesEntry = {
924
661
  return message;
925
662
  }
926
663
  };
927
- function createBaseBundle_EnvironmentsEntry() {
928
- return { key: "", value: void 0 };
929
- }
930
- var Bundle_EnvironmentsEntry = {
931
- encode(message, writer = new BinaryWriter2()) {
932
- if (message.key !== "") {
933
- writer.uint32(10).string(message.key);
934
- }
935
- if (message.value !== void 0) {
936
- Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join();
937
- }
938
- return writer;
939
- },
940
- decode(input, length) {
941
- const reader = input instanceof BinaryReader2 ? input : new BinaryReader2(input);
942
- const end = length === void 0 ? reader.len : reader.pos + length;
943
- const message = createBaseBundle_EnvironmentsEntry();
944
- while (reader.pos < end) {
945
- const tag = reader.uint32();
946
- switch (tag >>> 3) {
947
- case 1: {
948
- if (tag !== 10) {
949
- break;
950
- }
951
- message.key = reader.string();
952
- continue;
953
- }
954
- case 2: {
955
- if (tag !== 18) {
956
- break;
957
- }
958
- message.value = Struct.unwrap(Struct.decode(reader, reader.uint32()));
959
- continue;
960
- }
961
- }
962
- if ((tag & 7) === 4 || tag === 0) {
963
- break;
964
- }
965
- reader.skip(tag & 7);
966
- }
967
- return message;
968
- },
969
- fromJSON(object) {
970
- return {
971
- key: isSet2(object.key) ? globalThis.String(object.key) : "",
972
- value: isObject2(object.value) ? object.value : void 0
973
- };
974
- },
975
- toJSON(message) {
976
- const obj = {};
977
- if (message.key !== "") {
978
- obj.key = message.key;
979
- }
980
- if (message.value !== void 0) {
981
- obj.value = message.value;
982
- }
983
- return obj;
984
- },
985
- create(base) {
986
- return Bundle_EnvironmentsEntry.fromPartial(base ?? {});
987
- },
988
- fromPartial(object) {
989
- const message = createBaseBundle_EnvironmentsEntry();
990
- message.key = object.key ?? "";
991
- message.value = object.value ?? void 0;
992
- return message;
993
- }
994
- };
995
- function createBaseBundle_EnvironmentBackendsEntry() {
996
- return { key: "", value: void 0 };
997
- }
998
- var Bundle_EnvironmentBackendsEntry = {
999
- encode(message, writer = new BinaryWriter2()) {
1000
- if (message.key !== "") {
1001
- writer.uint32(10).string(message.key);
1002
- }
1003
- if (message.value !== void 0) {
1004
- BackendConfig.encode(message.value, writer.uint32(18).fork()).join();
1005
- }
1006
- return writer;
1007
- },
1008
- decode(input, length) {
1009
- const reader = input instanceof BinaryReader2 ? input : new BinaryReader2(input);
1010
- const end = length === void 0 ? reader.len : reader.pos + length;
1011
- const message = createBaseBundle_EnvironmentBackendsEntry();
1012
- while (reader.pos < end) {
1013
- const tag = reader.uint32();
1014
- switch (tag >>> 3) {
1015
- case 1: {
1016
- if (tag !== 10) {
1017
- break;
1018
- }
1019
- message.key = reader.string();
1020
- continue;
1021
- }
1022
- case 2: {
1023
- if (tag !== 18) {
1024
- break;
1025
- }
1026
- message.value = BackendConfig.decode(reader, reader.uint32());
1027
- continue;
1028
- }
1029
- }
1030
- if ((tag & 7) === 4 || tag === 0) {
1031
- break;
1032
- }
1033
- reader.skip(tag & 7);
1034
- }
1035
- return message;
1036
- },
1037
- fromJSON(object) {
1038
- return {
1039
- key: isSet2(object.key) ? globalThis.String(object.key) : "",
1040
- value: isSet2(object.value) ? BackendConfig.fromJSON(object.value) : void 0
1041
- };
1042
- },
1043
- toJSON(message) {
1044
- const obj = {};
1045
- if (message.key !== "") {
1046
- obj.key = message.key;
1047
- }
1048
- if (message.value !== void 0) {
1049
- obj.value = BackendConfig.toJSON(message.value);
1050
- }
1051
- return obj;
1052
- },
1053
- create(base) {
1054
- return Bundle_EnvironmentBackendsEntry.fromPartial(base ?? {});
1055
- },
1056
- fromPartial(object) {
1057
- const message = createBaseBundle_EnvironmentBackendsEntry();
1058
- message.key = object.key ?? "";
1059
- message.value = object.value !== void 0 && object.value !== null ? BackendConfig.fromPartial(object.value) : void 0;
1060
- return message;
1061
- }
1062
- };
1063
664
  function createBaseModule() {
1064
665
  return {
1065
666
  id: "",
@@ -1708,7 +1309,7 @@ var OutputDef = {
1708
1309
  }
1709
1310
  };
1710
1311
  function createBaseSource() {
1711
- return { kind: "", repo: "", subdir: "", ref: "", organization: "" };
1312
+ return { kind: "", repo: "", subdir: "", ref: "" };
1712
1313
  }
1713
1314
  var Source = {
1714
1315
  encode(message, writer = new BinaryWriter2()) {
@@ -1724,9 +1325,6 @@ var Source = {
1724
1325
  if (message.ref !== "") {
1725
1326
  writer.uint32(34).string(message.ref);
1726
1327
  }
1727
- if (message.organization !== "") {
1728
- writer.uint32(42).string(message.organization);
1729
- }
1730
1328
  return writer;
1731
1329
  },
1732
1330
  decode(input, length) {
@@ -1764,13 +1362,6 @@ var Source = {
1764
1362
  message.ref = reader.string();
1765
1363
  continue;
1766
1364
  }
1767
- case 5: {
1768
- if (tag !== 42) {
1769
- break;
1770
- }
1771
- message.organization = reader.string();
1772
- continue;
1773
- }
1774
1365
  }
1775
1366
  if ((tag & 7) === 4 || tag === 0) {
1776
1367
  break;
@@ -1784,8 +1375,7 @@ var Source = {
1784
1375
  kind: isSet2(object.kind) ? globalThis.String(object.kind) : "",
1785
1376
  repo: isSet2(object.repo) ? globalThis.String(object.repo) : "",
1786
1377
  subdir: isSet2(object.subdir) ? globalThis.String(object.subdir) : "",
1787
- ref: isSet2(object.ref) ? globalThis.String(object.ref) : "",
1788
- organization: isSet2(object.organization) ? globalThis.String(object.organization) : ""
1378
+ ref: isSet2(object.ref) ? globalThis.String(object.ref) : ""
1789
1379
  };
1790
1380
  },
1791
1381
  toJSON(message) {
@@ -1802,9 +1392,6 @@ var Source = {
1802
1392
  if (message.ref !== "") {
1803
1393
  obj.ref = message.ref;
1804
1394
  }
1805
- if (message.organization !== "") {
1806
- obj.organization = message.organization;
1807
- }
1808
1395
  return obj;
1809
1396
  },
1810
1397
  create(base) {
@@ -1816,7 +1403,6 @@ var Source = {
1816
1403
  message.repo = object.repo ?? "";
1817
1404
  message.subdir = object.subdir ?? "";
1818
1405
  message.ref = object.ref ?? "";
1819
- message.organization = object.organization ?? "";
1820
1406
  return message;
1821
1407
  }
1822
1408
  };
@@ -3749,25 +3335,270 @@ function isSet2(value) {
3749
3335
  return value !== null && value !== void 0;
3750
3336
  }
3751
3337
 
3752
- // src/projection/parse-module-key.ts
3753
- function parseModuleKey(key) {
3754
- const at = key.lastIndexOf("@");
3755
- if (at < 0) return { id: key, version: "" };
3756
- return { id: key.slice(0, at), version: key.slice(at + 1) };
3338
+ // src/projection/inspect.ts
3339
+ function hclLiteralText(lit) {
3340
+ if (typeof lit === "string") return quoteHclString(lit);
3341
+ if (typeof lit === "number" || typeof lit === "boolean") return String(lit);
3342
+ if (Array.isArray(lit)) return `[${lit.map(hclLiteralText).join(", ")}]`;
3343
+ if (lit !== null && typeof lit === "object") {
3344
+ return hclObjectText(lit);
3345
+ }
3346
+ return String(lit);
3757
3347
  }
3758
-
3759
- // src/projection/classify-child.ts
3760
- function isGroupUse(bundle, use) {
3761
- const target = bundle.modules[use.module];
3762
- if (!target) return false;
3763
- return (target.modules?.length ?? 0) > 0;
3348
+ function quoteHclString(s) {
3349
+ let out = "";
3350
+ for (let i = 0; i < s.length; i++) {
3351
+ const c = s[i];
3352
+ switch (c) {
3353
+ case "\\":
3354
+ out += "\\\\";
3355
+ break;
3356
+ case '"':
3357
+ out += '\\"';
3358
+ break;
3359
+ case "\n":
3360
+ out += "\\n";
3361
+ break;
3362
+ case "\r":
3363
+ out += "\\r";
3364
+ break;
3365
+ case " ":
3366
+ out += "\\t";
3367
+ break;
3368
+ case "$":
3369
+ case "%":
3370
+ out += s[i + 1] === "{" ? c + c : c;
3371
+ break;
3372
+ default:
3373
+ out += c;
3374
+ }
3375
+ }
3376
+ return `"${out}"`;
3764
3377
  }
3765
-
3766
- // src/projection/compute-layout.ts
3767
- var SPACING_X = 260;
3768
- var SPACING_Y = 180;
3769
- function gridPosition(index, n) {
3770
- const cols = Math.max(2, Math.ceil(Math.sqrt(n)));
3378
+ function hclObjectText(obj) {
3379
+ const entries = Object.entries(obj).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
3380
+ if (entries.length === 0) return "{}";
3381
+ const width = Math.max(...entries.map(([k]) => k.length)) + 1;
3382
+ const lines = entries.map(([k, v]) => ` ${k.padEnd(width)}= ${hclLiteralText(v)}`);
3383
+ return `{
3384
+ ${lines.join("\n")}
3385
+ }`;
3386
+ }
3387
+ function bindingText(b) {
3388
+ if (!b) return "";
3389
+ if (b.lit !== void 0 && b.lit !== null) return hclLiteralText(b.lit);
3390
+ if (b.var) return `var.${b.var}`;
3391
+ if (b.out) return `module.${b.out.module}.${b.out.name}`;
3392
+ if (b.expr) return b.expr.value;
3393
+ return "";
3394
+ }
3395
+ function bindingMode(b) {
3396
+ if (!b) return { mode: "empty" };
3397
+ if (b.out) return { mode: "wired", wired_source: bindingText(b) };
3398
+ if (b.var) return { mode: "variable", variable: b.var };
3399
+ if (b.expr) return { mode: "expression", expression: b.expr.value };
3400
+ if (b.lit !== void 0 && b.lit !== null) return { mode: "literal", value: b.lit };
3401
+ return { mode: "empty" };
3402
+ }
3403
+ function describeBinding(b) {
3404
+ return { mode: bindingMode(b).mode, display: bindingText(b) };
3405
+ }
3406
+ function findChild(mod, id) {
3407
+ for (const use of mod.modules ?? []) {
3408
+ if (use.id === id) return { id, use };
3409
+ }
3410
+ for (const resource of mod.resources ?? []) {
3411
+ if (resource.id === id) return { id, resource };
3412
+ }
3413
+ return null;
3414
+ }
3415
+ function deriveNodeConfig(bundle, instanceId) {
3416
+ const entry = bundle.modules[bundle.entry];
3417
+ if (!entry) return null;
3418
+ const child = findChild(entry, instanceId);
3419
+ if (!child) return null;
3420
+ const target = child.use ? bundle.modules[child.use.module] : void 0;
3421
+ const schemaInputs = target?.interface?.inputs ?? [];
3422
+ const schemaOutputs = target?.interface?.outputs ?? [];
3423
+ const boundInputs = child.use?.inputs ?? child.resource?.inputs ?? {};
3424
+ const inputs = schemaInputs.map((def) => ({
3425
+ name: def.name,
3426
+ type: def.type,
3427
+ required: def.required,
3428
+ description: def.description || void 0,
3429
+ default_value: def.default_value,
3430
+ validation: def.validation?.[0] ? { condition: def.validation[0].condition, error_message: def.validation[0].error_message } : void 0,
3431
+ ...bindingMode(boundInputs[def.name])
3432
+ }));
3433
+ const outputs = schemaOutputs.map((def) => ({
3434
+ name: def.name,
3435
+ type: def.type,
3436
+ description: def.description || void 0,
3437
+ sensitive: def.sensitive || void 0
3438
+ }));
3439
+ const siblingIds = [
3440
+ ...(entry.modules ?? []).map((u) => u.id),
3441
+ ...(entry.resources ?? []).map((r) => r.id)
3442
+ ].filter((id) => id !== instanceId);
3443
+ const dependsOn = child.use?.depends_on ?? child.resource?.depends_on ?? [];
3444
+ const providers = child.use?.providers ?? {};
3445
+ const availableVariables = (entry.interface?.inputs ?? []).map((v) => ({
3446
+ name: v.name,
3447
+ type: v.type
3448
+ }));
3449
+ return {
3450
+ instance_id: instanceId,
3451
+ inputs,
3452
+ outputs,
3453
+ sibling_ids: siblingIds,
3454
+ depends_on: dependsOn,
3455
+ providers,
3456
+ available_variables: availableVariables
3457
+ };
3458
+ }
3459
+ function deriveSettingsConfig(bundle) {
3460
+ const entry = bundle.modules[bundle.entry];
3461
+ const terraform = entry?.terraform ? {
3462
+ required_version: entry.terraform.required_version,
3463
+ required_providers: Object.entries(entry.terraform.required_providers ?? {}).map(
3464
+ ([name, req]) => ({
3465
+ name,
3466
+ source: req.source,
3467
+ version: req.version,
3468
+ configuration_aliases: req.configuration_aliases
3469
+ })
3470
+ )
3471
+ } : { required_version: "", required_providers: [] };
3472
+ const providers = (entry?.providers ?? []).map((p) => {
3473
+ const config = {};
3474
+ for (const [k, v] of Object.entries(p.config ?? {})) {
3475
+ config[k] = describeBinding(v).display;
3476
+ }
3477
+ return { name: p.name, alias: p.alias, config, blocks: p.blocks };
3478
+ });
3479
+ const locals = (entry?.locals ?? []).map((l) => {
3480
+ const { mode, display } = describeBinding(l.value);
3481
+ return { name: l.name, mode, value_display: display };
3482
+ });
3483
+ const variables = (entry?.interface?.inputs ?? []).map((v) => ({
3484
+ name: v.name,
3485
+ type: v.type,
3486
+ required: v.required,
3487
+ description: v.description || void 0,
3488
+ default_value: v.default_value,
3489
+ validation: v.validation?.map((b) => ({
3490
+ condition: b.condition,
3491
+ error_message: b.error_message
3492
+ })),
3493
+ ephemeral: v.ephemeral,
3494
+ sensitive: v.sensitive || void 0,
3495
+ nullable: v.nullable
3496
+ }));
3497
+ const output_defs = (entry?.interface?.outputs ?? []).map((o) => ({
3498
+ name: o.name,
3499
+ type: o.type,
3500
+ description: o.description || void 0,
3501
+ sensitive: o.sensitive || void 0,
3502
+ depends_on: o.depends_on
3503
+ }));
3504
+ const exports = Object.entries(entry?.exports?.outputs ?? {}).flatMap(([name, exp]) => {
3505
+ if (!exp.out) return [];
3506
+ return [{ name, source_instance: exp.out.module, source_output: exp.out.name }];
3507
+ });
3508
+ return { terraform, providers, locals, variables, exports, output_defs };
3509
+ }
3510
+
3511
+ // src/projection/join-path.ts
3512
+ function joinPath(prefix, localId) {
3513
+ return prefix === "" ? localId : `${prefix}.${localId}`;
3514
+ }
3515
+
3516
+ // src/projection/node-for-address.ts
3517
+ var INSTANCE_KEY = /\[[^\]]*\]$/;
3518
+ function tokenizeAddress(address) {
3519
+ const tokens = [];
3520
+ let current = "";
3521
+ let depth = 0;
3522
+ for (const ch of address) {
3523
+ if (ch === "[") depth++;
3524
+ else if (ch === "]") depth--;
3525
+ if (ch === "." && depth === 0) {
3526
+ tokens.push(current);
3527
+ current = "";
3528
+ } else {
3529
+ current += ch;
3530
+ }
3531
+ }
3532
+ tokens.push(current);
3533
+ return tokens;
3534
+ }
3535
+ function nodeIdForAddress(view, address) {
3536
+ const tokens = tokenizeAddress(address);
3537
+ const moduleNames = [];
3538
+ let i = 0;
3539
+ while (i + 1 < tokens.length && tokens[i] === "module") {
3540
+ moduleNames.push(tokens[i + 1].replace(INSTANCE_KEY, ""));
3541
+ i += 2;
3542
+ }
3543
+ if (moduleNames.length === 0) return null;
3544
+ const known = /* @__PURE__ */ new Set();
3545
+ for (const n of view.nodes) known.add(n.id);
3546
+ for (const g of view.groups) known.add(g.id);
3547
+ for (let k = moduleNames.length; k >= 1; k--) {
3548
+ let path = "";
3549
+ for (let j = 0; j < k; j++) path = joinPath(path, moduleNames[j]);
3550
+ if (known.has(path)) return path;
3551
+ }
3552
+ return null;
3553
+ }
3554
+
3555
+ // src/projection/node-for-diagnostic.ts
3556
+ function buildScopeIndex(view) {
3557
+ const byModuleKey = /* @__PURE__ */ new Map();
3558
+ const known = /* @__PURE__ */ new Set();
3559
+ for (const n of view.nodes) known.add(n.id);
3560
+ for (const g of view.groups) {
3561
+ known.add(g.id);
3562
+ if (g.module_key) {
3563
+ const ids = byModuleKey.get(g.module_key);
3564
+ if (ids) ids.push(g.id);
3565
+ else byModuleKey.set(g.module_key, [g.id]);
3566
+ }
3567
+ }
3568
+ return { byModuleKey, known };
3569
+ }
3570
+ function nodeIdForDiagnostic(view, diagnostic) {
3571
+ if (diagnostic.address) return nodeIdForAddress(view, diagnostic.address);
3572
+ if (!diagnostic.instance_id) return null;
3573
+ const index = buildScopeIndex(view);
3574
+ const scopeIds = diagnostic.module_key ? index.byModuleKey.get(diagnostic.module_key) : void 0;
3575
+ if (!scopeIds || scopeIds.length === 0) {
3576
+ return index.known.has(diagnostic.instance_id) ? diagnostic.instance_id : null;
3577
+ }
3578
+ if (scopeIds.length > 1) return null;
3579
+ const nodeId = `${scopeIds[0]}.${diagnostic.instance_id}`;
3580
+ return index.known.has(nodeId) ? nodeId : null;
3581
+ }
3582
+
3583
+ // src/projection/parse-module-key.ts
3584
+ function parseModuleKey(key) {
3585
+ const at = key.lastIndexOf("@");
3586
+ if (at < 0) return { id: key, version: "" };
3587
+ return { id: key.slice(0, at), version: key.slice(at + 1) };
3588
+ }
3589
+
3590
+ // src/projection/classify-child.ts
3591
+ function isGroupUse(bundle, use) {
3592
+ const target = bundle.modules[use.module];
3593
+ if (!target) return false;
3594
+ return (target.modules?.length ?? 0) > 0;
3595
+ }
3596
+
3597
+ // src/projection/compute-layout.ts
3598
+ var SPACING_X = 260;
3599
+ var SPACING_Y = 180;
3600
+ function gridPosition(index, n) {
3601
+ const cols = Math.max(2, Math.ceil(Math.sqrt(n)));
3771
3602
  const col = index % cols;
3772
3603
  const row = Math.floor(index / cols);
3773
3604
  return { x: col * SPACING_X, y: row * SPACING_Y };
@@ -3943,11 +3774,6 @@ function indexWires(edges) {
3943
3774
  return { inputs, outputs };
3944
3775
  }
3945
3776
 
3946
- // src/projection/join-path.ts
3947
- function joinPath(prefix, localId) {
3948
- return prefix === "" ? localId : `${prefix}.${localId}`;
3949
- }
3950
-
3951
3777
  // src/projection/project-group.ts
3952
3778
  function projectGroup(use, target, fullId, parentArrangement) {
3953
3779
  const childIds = (target.modules ?? []).map((u) => joinPath(fullId, u.id));
@@ -4004,8 +3830,7 @@ function descendScope(bundle, scopeKey, segments) {
4004
3830
  }
4005
3831
 
4006
3832
  // src/projection/project-node.ts
4007
- function projectNode(bundle, use, fullId, position, wiredIn, wiredOut, errorsByInstance) {
4008
- const errorMessages = errorsByInstance.get(use.id) ?? [];
3833
+ function projectNode(bundle, use, fullId, position, wiredIn, wiredOut) {
4009
3834
  const schema = resolveSchema(bundle, use);
4010
3835
  return {
4011
3836
  id: fullId,
@@ -4013,8 +3838,6 @@ function projectNode(bundle, use, fullId, position, wiredIn, wiredOut, errorsByI
4013
3838
  kind: "module",
4014
3839
  module_key: use.module,
4015
3840
  position,
4016
- has_errors: errorMessages.length > 0,
4017
- error_messages: errorMessages,
4018
3841
  inputs: schema.inputs.map((in_) => ({
4019
3842
  name: in_.name,
4020
3843
  type: in_.type,
@@ -4033,7 +3856,12 @@ function projectNode(bundle, use, fullId, position, wiredIn, wiredOut, errorsByI
4033
3856
  }
4034
3857
 
4035
3858
  // src/projection/project-scope.ts
4036
- function projectScope(bundle, mod, path, arrangement, errorsByInstance) {
3859
+ function requirePosition(positions, id) {
3860
+ const pos = positions.get(id);
3861
+ if (!pos) throw new Error(`projectScope: no computed position for "${id}"`);
3862
+ return pos;
3863
+ }
3864
+ function projectScope(bundle, mod, path, arrangement) {
4037
3865
  const uses = mod.modules ?? [];
4038
3866
  const derived = deriveEdges(uses);
4039
3867
  const { inputs: wiredIn, outputs: wiredOut } = indexWires(derived);
@@ -4057,12 +3885,11 @@ function projectScope(bundle, mod, path, arrangement, errorsByInstance) {
4057
3885
  use,
4058
3886
  fullId,
4059
3887
  // Every non-group use is in nodeUseIds, so resolveScopePositionsByDepth
4060
- // always has an entry for it — a fallback here would only mask a
4061
- // classification bug, not handle a real gap.
4062
- positions.get(use.id),
3888
+ // always has an entry for it — requirePosition turns that into a
3889
+ // checked invariant instead of a silent gap a fallback would mask.
3890
+ requirePosition(positions, use.id),
4063
3891
  wiredIn.get(use.id) ?? /* @__PURE__ */ new Set(),
4064
- wiredOut.get(use.id) ?? /* @__PURE__ */ new Set(),
4065
- errorsByInstance
3892
+ wiredOut.get(use.id) ?? /* @__PURE__ */ new Set()
4066
3893
  )
4067
3894
  );
4068
3895
  }
@@ -4080,38 +3907,6 @@ function projectScope(bundle, mod, path, arrangement, errorsByInstance) {
4080
3907
  return { nodes, edges, groups };
4081
3908
  }
4082
3909
 
4083
- // src/projection/view-validate.ts
4084
- function missingRequiredInputErrors(nodes) {
4085
- const errors = [];
4086
- for (const node of nodes) {
4087
- for (const pin of node.inputs ?? []) {
4088
- if (pin.required && !pin.wired) {
4089
- errors.push({
4090
- instance_id: node.id,
4091
- input_name: pin.name,
4092
- message: `Required input "${pin.name}" is not set`
4093
- });
4094
- }
4095
- }
4096
- }
4097
- return errors;
4098
- }
4099
- function danglingEdgeErrors(nodes, groups, edges) {
4100
- const known = /* @__PURE__ */ new Set();
4101
- for (const n of nodes) known.add(n.id);
4102
- for (const g of groups) known.add(g.id);
4103
- const errors = [];
4104
- for (const e of edges) {
4105
- if (!known.has(e.source) || !known.has(e.target)) {
4106
- errors.push({
4107
- instance_id: e.id,
4108
- message: `Edge "${e.id}" has dangling endpoint(s): source="${e.source}" target="${e.target}"`
4109
- });
4110
- }
4111
- }
4112
- return errors;
4113
- }
4114
-
4115
3910
  // src/projection/walk-modules.ts
4116
3911
  function walk(bundle, visit) {
4117
3912
  if (!bundle) return;
@@ -4129,39 +3924,30 @@ function walkFrom(bundle, mod, use, path, visit) {
4129
3924
  }
4130
3925
 
4131
3926
  // src/projection/project.ts
3927
+ var EMPTY_BUNDLE = Bundle.fromPartial({
3928
+ entry: "root@v1",
3929
+ modules: { "root@v1": { id: "root", version: "v1.0.0" } }
3930
+ });
4132
3931
  function projectCanvasView(bundle, arrangement, meta) {
4133
3932
  const nodes = [];
4134
3933
  const edges = [];
4135
3934
  const groups = [];
4136
- const errorsByInstance = /* @__PURE__ */ new Map();
4137
3935
  walk(bundle, (mod, _use, path) => {
4138
- const scope = projectScope(bundle, mod, path, arrangement, errorsByInstance);
3936
+ const scope = projectScope(bundle, mod, path, arrangement);
4139
3937
  nodes.push(...scope.nodes);
4140
3938
  edges.push(...scope.edges);
4141
3939
  groups.push(...scope.groups);
4142
3940
  });
4143
- const errors = [
4144
- ...missingRequiredInputErrors(nodes),
4145
- ...danglingEdgeErrors(nodes, groups, edges)
4146
- ];
4147
- errors.sort((a, b) => {
4148
- const ai = a.instance_id ?? "";
4149
- const bi = b.instance_id ?? "";
4150
- if (ai !== bi) return ai < bi ? -1 : 1;
4151
- const an = a.input_name ?? "";
4152
- const bn = b.input_name ?? "";
4153
- if (an !== bn) return an < bn ? -1 : 1;
4154
- return a.message < b.message ? -1 : a.message > b.message ? 1 : 0;
4155
- });
4156
3941
  const moduleName = meta.moduleName ?? parseModuleKey(bundle.entry).id;
4157
3942
  return {
4158
3943
  module_name: moduleName,
4159
3944
  nodes,
4160
3945
  edges,
4161
- errors,
4162
3946
  can_undo: meta.canUndo,
4163
3947
  can_redo: meta.canRedo,
4164
- is_dirty: meta.isDirty,
3948
+ unsaved: meta.unsaved,
3949
+ conflict: meta.conflict,
3950
+ ungenerated: meta.ungenerated ?? false,
4165
3951
  // Every group is now a Use whose target has sub-Uses (CreateGroupAction
4166
3952
  // mints a module); emission order already mirrors Use declaration order
4167
3953
  // via the walk, so no separate user-group sort is needed.
@@ -4206,145 +3992,8 @@ function nodeKindToJSON(object) {
4206
3992
  return "UNRECOGNIZED";
4207
3993
  }
4208
3994
  }
4209
- function inputModeFromJSON(object) {
4210
- switch (object) {
4211
- case 0:
4212
- case "INPUT_MODE_UNSPECIFIED":
4213
- return 0 /* INPUT_MODE_UNSPECIFIED */;
4214
- case 1:
4215
- case "INPUT_MODE_EMPTY":
4216
- return 1 /* INPUT_MODE_EMPTY */;
4217
- case 2:
4218
- case "INPUT_MODE_LITERAL":
4219
- return 2 /* INPUT_MODE_LITERAL */;
4220
- case 3:
4221
- case "INPUT_MODE_VARIABLE":
4222
- return 3 /* INPUT_MODE_VARIABLE */;
4223
- case 4:
4224
- case "INPUT_MODE_EXPRESSION":
4225
- return 4 /* INPUT_MODE_EXPRESSION */;
4226
- case 5:
4227
- case "INPUT_MODE_WIRED":
4228
- return 5 /* INPUT_MODE_WIRED */;
4229
- case -1:
4230
- case "UNRECOGNIZED":
4231
- default:
4232
- return -1 /* UNRECOGNIZED */;
4233
- }
4234
- }
4235
- function inputModeToJSON(object) {
4236
- switch (object) {
4237
- case 0 /* INPUT_MODE_UNSPECIFIED */:
4238
- return "INPUT_MODE_UNSPECIFIED";
4239
- case 1 /* INPUT_MODE_EMPTY */:
4240
- return "INPUT_MODE_EMPTY";
4241
- case 2 /* INPUT_MODE_LITERAL */:
4242
- return "INPUT_MODE_LITERAL";
4243
- case 3 /* INPUT_MODE_VARIABLE */:
4244
- return "INPUT_MODE_VARIABLE";
4245
- case 4 /* INPUT_MODE_EXPRESSION */:
4246
- return "INPUT_MODE_EXPRESSION";
4247
- case 5 /* INPUT_MODE_WIRED */:
4248
- return "INPUT_MODE_WIRED";
4249
- case -1 /* UNRECOGNIZED */:
4250
- default:
4251
- return "UNRECOGNIZED";
4252
- }
4253
- }
4254
- function createBaseOutputExportEntry() {
4255
- return { name: "", source_instance: "", source_output: "" };
4256
- }
4257
- var OutputExportEntry = {
4258
- encode(message, writer = new BinaryWriter3()) {
4259
- if (message.name !== "") {
4260
- writer.uint32(10).string(message.name);
4261
- }
4262
- if (message.source_instance !== "") {
4263
- writer.uint32(18).string(message.source_instance);
4264
- }
4265
- if (message.source_output !== "") {
4266
- writer.uint32(26).string(message.source_output);
4267
- }
4268
- return writer;
4269
- },
4270
- decode(input, length) {
4271
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
4272
- const end = length === void 0 ? reader.len : reader.pos + length;
4273
- const message = createBaseOutputExportEntry();
4274
- while (reader.pos < end) {
4275
- const tag = reader.uint32();
4276
- switch (tag >>> 3) {
4277
- case 1: {
4278
- if (tag !== 10) {
4279
- break;
4280
- }
4281
- message.name = reader.string();
4282
- continue;
4283
- }
4284
- case 2: {
4285
- if (tag !== 18) {
4286
- break;
4287
- }
4288
- message.source_instance = reader.string();
4289
- continue;
4290
- }
4291
- case 3: {
4292
- if (tag !== 26) {
4293
- break;
4294
- }
4295
- message.source_output = reader.string();
4296
- continue;
4297
- }
4298
- }
4299
- if ((tag & 7) === 4 || tag === 0) {
4300
- break;
4301
- }
4302
- reader.skip(tag & 7);
4303
- }
4304
- return message;
4305
- },
4306
- fromJSON(object) {
4307
- return {
4308
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
4309
- source_instance: isSet3(object.sourceInstance) ? globalThis.String(object.sourceInstance) : isSet3(object.source_instance) ? globalThis.String(object.source_instance) : "",
4310
- source_output: isSet3(object.sourceOutput) ? globalThis.String(object.sourceOutput) : isSet3(object.source_output) ? globalThis.String(object.source_output) : ""
4311
- };
4312
- },
4313
- toJSON(message) {
4314
- const obj = {};
4315
- if (message.name !== "") {
4316
- obj.name = message.name;
4317
- }
4318
- if (message.source_instance !== "") {
4319
- obj.sourceInstance = message.source_instance;
4320
- }
4321
- if (message.source_output !== "") {
4322
- obj.sourceOutput = message.source_output;
4323
- }
4324
- return obj;
4325
- },
4326
- create(base) {
4327
- return OutputExportEntry.fromPartial(base ?? {});
4328
- },
4329
- fromPartial(object) {
4330
- const message = createBaseOutputExportEntry();
4331
- message.name = object.name ?? "";
4332
- message.source_instance = object.source_instance ?? "";
4333
- message.source_output = object.source_output ?? "";
4334
- return message;
4335
- }
4336
- };
4337
3995
  function createBaseCanvasView() {
4338
- return {
4339
- module_name: "",
4340
- nodes: [],
4341
- edges: [],
4342
- errors: [],
4343
- can_undo: false,
4344
- can_redo: false,
4345
- is_dirty: false,
4346
- groups: []
4347
- };
3996
+ return { module_name: "", nodes: [], edges: [], can_undo: false, can_redo: false, unsaved: false, groups: [] };
4348
3997
  }
4349
3998
  var CanvasView = {
4350
3999
  encode(message, writer = new BinaryWriter3()) {
@@ -4357,17 +4006,14 @@ var CanvasView = {
4357
4006
  for (const v of message.edges) {
4358
4007
  RenderEdge.encode(v, writer.uint32(26).fork()).join();
4359
4008
  }
4360
- for (const v of message.errors) {
4361
- RenderError.encode(v, writer.uint32(34).fork()).join();
4362
- }
4363
4009
  if (message.can_undo !== false) {
4364
4010
  writer.uint32(40).bool(message.can_undo);
4365
4011
  }
4366
4012
  if (message.can_redo !== false) {
4367
4013
  writer.uint32(48).bool(message.can_redo);
4368
4014
  }
4369
- if (message.is_dirty !== false) {
4370
- writer.uint32(56).bool(message.is_dirty);
4015
+ if (message.unsaved !== false) {
4016
+ writer.uint32(56).bool(message.unsaved);
4371
4017
  }
4372
4018
  for (const v of message.groups) {
4373
4019
  RenderGroup.encode(v, writer.uint32(66).fork()).join();
@@ -4402,13 +4048,6 @@ var CanvasView = {
4402
4048
  message.edges.push(RenderEdge.decode(reader, reader.uint32()));
4403
4049
  continue;
4404
4050
  }
4405
- case 4: {
4406
- if (tag !== 34) {
4407
- break;
4408
- }
4409
- message.errors.push(RenderError.decode(reader, reader.uint32()));
4410
- continue;
4411
- }
4412
4051
  case 5: {
4413
4052
  if (tag !== 40) {
4414
4053
  break;
@@ -4427,7 +4066,7 @@ var CanvasView = {
4427
4066
  if (tag !== 56) {
4428
4067
  break;
4429
4068
  }
4430
- message.is_dirty = reader.bool();
4069
+ message.unsaved = reader.bool();
4431
4070
  continue;
4432
4071
  }
4433
4072
  case 8: {
@@ -4450,10 +4089,9 @@ var CanvasView = {
4450
4089
  module_name: isSet3(object.moduleName) ? globalThis.String(object.moduleName) : isSet3(object.module_name) ? globalThis.String(object.module_name) : "",
4451
4090
  nodes: globalThis.Array.isArray(object?.nodes) ? object.nodes.map((e) => RenderNode.fromJSON(e)) : [],
4452
4091
  edges: globalThis.Array.isArray(object?.edges) ? object.edges.map((e) => RenderEdge.fromJSON(e)) : [],
4453
- errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e) => RenderError.fromJSON(e)) : [],
4454
4092
  can_undo: isSet3(object.canUndo) ? globalThis.Boolean(object.canUndo) : isSet3(object.can_undo) ? globalThis.Boolean(object.can_undo) : false,
4455
4093
  can_redo: isSet3(object.canRedo) ? globalThis.Boolean(object.canRedo) : isSet3(object.can_redo) ? globalThis.Boolean(object.can_redo) : false,
4456
- is_dirty: isSet3(object.isDirty) ? globalThis.Boolean(object.isDirty) : isSet3(object.is_dirty) ? globalThis.Boolean(object.is_dirty) : false,
4094
+ unsaved: isSet3(object.unsaved) ? globalThis.Boolean(object.unsaved) : false,
4457
4095
  groups: globalThis.Array.isArray(object?.groups) ? object.groups.map((e) => RenderGroup.fromJSON(e)) : []
4458
4096
  };
4459
4097
  },
@@ -4468,17 +4106,14 @@ var CanvasView = {
4468
4106
  if (message.edges?.length) {
4469
4107
  obj.edges = message.edges.map((e) => RenderEdge.toJSON(e));
4470
4108
  }
4471
- if (message.errors?.length) {
4472
- obj.errors = message.errors.map((e) => RenderError.toJSON(e));
4473
- }
4474
4109
  if (message.can_undo !== false) {
4475
4110
  obj.canUndo = message.can_undo;
4476
4111
  }
4477
4112
  if (message.can_redo !== false) {
4478
4113
  obj.canRedo = message.can_redo;
4479
4114
  }
4480
- if (message.is_dirty !== false) {
4481
- obj.isDirty = message.is_dirty;
4115
+ if (message.unsaved !== false) {
4116
+ obj.unsaved = message.unsaved;
4482
4117
  }
4483
4118
  if (message.groups?.length) {
4484
4119
  obj.groups = message.groups.map((e) => RenderGroup.toJSON(e));
@@ -4493,10 +4128,9 @@ var CanvasView = {
4493
4128
  message.module_name = object.module_name ?? "";
4494
4129
  message.nodes = object.nodes?.map((e) => RenderNode.fromPartial(e)) || [];
4495
4130
  message.edges = object.edges?.map((e) => RenderEdge.fromPartial(e)) || [];
4496
- message.errors = object.errors?.map((e) => RenderError.fromPartial(e)) || [];
4497
4131
  message.can_undo = object.can_undo ?? false;
4498
4132
  message.can_redo = object.can_redo ?? false;
4499
- message.is_dirty = object.is_dirty ?? false;
4133
+ message.unsaved = object.unsaved ?? false;
4500
4134
  message.groups = object.groups?.map((e) => RenderGroup.fromPartial(e)) || [];
4501
4135
  return message;
4502
4136
  }
@@ -4645,18 +4279,7 @@ var RenderGroup = {
4645
4279
  }
4646
4280
  };
4647
4281
  function createBaseRenderNode() {
4648
- return {
4649
- id: "",
4650
- label: "",
4651
- kind: 0,
4652
- module_key: "",
4653
- icon_url: "",
4654
- position: void 0,
4655
- has_errors: false,
4656
- error_messages: [],
4657
- inputs: [],
4658
- outputs: []
4659
- };
4282
+ return { id: "", label: "", kind: 0, module_key: "", icon_url: "", position: void 0, inputs: [], outputs: [] };
4660
4283
  }
4661
4284
  var RenderNode = {
4662
4285
  encode(message, writer = new BinaryWriter3()) {
@@ -4678,12 +4301,6 @@ var RenderNode = {
4678
4301
  if (message.position !== void 0) {
4679
4302
  Position.encode(message.position, writer.uint32(50).fork()).join();
4680
4303
  }
4681
- if (message.has_errors !== false) {
4682
- writer.uint32(56).bool(message.has_errors);
4683
- }
4684
- for (const v of message.error_messages) {
4685
- writer.uint32(66).string(v);
4686
- }
4687
4304
  for (const v of message.inputs) {
4688
4305
  NodePin.encode(v, writer.uint32(74).fork()).join();
4689
4306
  }
@@ -4741,20 +4358,6 @@ var RenderNode = {
4741
4358
  message.position = Position.decode(reader, reader.uint32());
4742
4359
  continue;
4743
4360
  }
4744
- case 7: {
4745
- if (tag !== 56) {
4746
- break;
4747
- }
4748
- message.has_errors = reader.bool();
4749
- continue;
4750
- }
4751
- case 8: {
4752
- if (tag !== 66) {
4753
- break;
4754
- }
4755
- message.error_messages.push(reader.string());
4756
- continue;
4757
- }
4758
4361
  case 9: {
4759
4362
  if (tag !== 74) {
4760
4363
  break;
@@ -4785,8 +4388,6 @@ var RenderNode = {
4785
4388
  module_key: isSet3(object.moduleKey) ? globalThis.String(object.moduleKey) : isSet3(object.module_key) ? globalThis.String(object.module_key) : "",
4786
4389
  icon_url: isSet3(object.iconUrl) ? globalThis.String(object.iconUrl) : isSet3(object.icon_url) ? globalThis.String(object.icon_url) : "",
4787
4390
  position: isSet3(object.position) ? Position.fromJSON(object.position) : void 0,
4788
- has_errors: isSet3(object.hasErrors) ? globalThis.Boolean(object.hasErrors) : isSet3(object.has_errors) ? globalThis.Boolean(object.has_errors) : false,
4789
- error_messages: globalThis.Array.isArray(object?.errorMessages) ? object.errorMessages.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.error_messages) ? object.error_messages.map((e) => globalThis.String(e)) : [],
4790
4391
  inputs: globalThis.Array.isArray(object?.inputs) ? object.inputs.map((e) => NodePin.fromJSON(e)) : [],
4791
4392
  outputs: globalThis.Array.isArray(object?.outputs) ? object.outputs.map((e) => NodePin.fromJSON(e)) : []
4792
4393
  };
@@ -4811,12 +4412,6 @@ var RenderNode = {
4811
4412
  if (message.position !== void 0) {
4812
4413
  obj.position = Position.toJSON(message.position);
4813
4414
  }
4814
- if (message.has_errors !== false) {
4815
- obj.hasErrors = message.has_errors;
4816
- }
4817
- if (message.error_messages?.length) {
4818
- obj.errorMessages = message.error_messages;
4819
- }
4820
4415
  if (message.inputs?.length) {
4821
4416
  obj.inputs = message.inputs.map((e) => NodePin.toJSON(e));
4822
4417
  }
@@ -4836,8 +4431,6 @@ var RenderNode = {
4836
4431
  message.module_key = object.module_key ?? "";
4837
4432
  message.icon_url = object.icon_url ?? "";
4838
4433
  message.position = object.position !== void 0 && object.position !== null ? Position.fromPartial(object.position) : void 0;
4839
- message.has_errors = object.has_errors ?? false;
4840
- message.error_messages = object.error_messages?.map((e) => e) || [];
4841
4434
  message.inputs = object.inputs?.map((e) => NodePin.fromPartial(e)) || [];
4842
4435
  message.outputs = object.outputs?.map((e) => NodePin.fromPartial(e)) || [];
4843
4436
  return message;
@@ -5084,2164 +4677,38 @@ var RenderEdge = {
5084
4677
  return message;
5085
4678
  }
5086
4679
  };
5087
- function createBaseRenderInput() {
5088
- return {
5089
- name: "",
5090
- type: "",
5091
- required: false,
5092
- description: "",
5093
- default_value: void 0,
5094
- validation: void 0,
5095
- mode: 0,
5096
- value: void 0,
5097
- variable: "",
5098
- expression: "",
5099
- wired_source: ""
5100
- };
4680
+ function createBasePosition() {
4681
+ return { x: 0, y: 0 };
5101
4682
  }
5102
- var RenderInput = {
4683
+ var Position = {
5103
4684
  encode(message, writer = new BinaryWriter3()) {
5104
- if (message.name !== "") {
5105
- writer.uint32(10).string(message.name);
5106
- }
5107
- if (message.type !== "") {
5108
- writer.uint32(18).string(message.type);
5109
- }
5110
- if (message.required !== false) {
5111
- writer.uint32(24).bool(message.required);
5112
- }
5113
- if (message.description !== "") {
5114
- writer.uint32(34).string(message.description);
5115
- }
5116
- if (message.default_value !== void 0) {
5117
- Value.encode(Value.wrap(message.default_value), writer.uint32(42).fork()).join();
5118
- }
5119
- if (message.validation !== void 0) {
5120
- ValidationBlock2.encode(message.validation, writer.uint32(50).fork()).join();
5121
- }
5122
- if (message.mode !== 0) {
5123
- writer.uint32(56).int32(message.mode);
5124
- }
5125
- if (message.value !== void 0) {
5126
- Value.encode(Value.wrap(message.value), writer.uint32(66).fork()).join();
5127
- }
5128
- if (message.variable !== "") {
5129
- writer.uint32(74).string(message.variable);
5130
- }
5131
- if (message.expression !== "") {
5132
- writer.uint32(82).string(message.expression);
4685
+ if (message.x !== 0) {
4686
+ writer.uint32(9).double(message.x);
5133
4687
  }
5134
- if (message.wired_source !== "") {
5135
- writer.uint32(90).string(message.wired_source);
4688
+ if (message.y !== 0) {
4689
+ writer.uint32(17).double(message.y);
5136
4690
  }
5137
4691
  return writer;
5138
4692
  },
5139
4693
  decode(input, length) {
5140
4694
  const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
5141
4695
  const end = length === void 0 ? reader.len : reader.pos + length;
5142
- const message = createBaseRenderInput();
4696
+ const message = createBasePosition();
5143
4697
  while (reader.pos < end) {
5144
4698
  const tag = reader.uint32();
5145
4699
  switch (tag >>> 3) {
5146
4700
  case 1: {
5147
- if (tag !== 10) {
4701
+ if (tag !== 9) {
5148
4702
  break;
5149
4703
  }
5150
- message.name = reader.string();
4704
+ message.x = reader.double();
5151
4705
  continue;
5152
4706
  }
5153
4707
  case 2: {
5154
- if (tag !== 18) {
5155
- break;
5156
- }
5157
- message.type = reader.string();
5158
- continue;
5159
- }
5160
- case 3: {
5161
- if (tag !== 24) {
5162
- break;
5163
- }
5164
- message.required = reader.bool();
5165
- continue;
5166
- }
5167
- case 4: {
5168
- if (tag !== 34) {
4708
+ if (tag !== 17) {
5169
4709
  break;
5170
4710
  }
5171
- message.description = reader.string();
5172
- continue;
5173
- }
5174
- case 5: {
5175
- if (tag !== 42) {
5176
- break;
5177
- }
5178
- message.default_value = Value.unwrap(Value.decode(reader, reader.uint32()));
5179
- continue;
5180
- }
5181
- case 6: {
5182
- if (tag !== 50) {
5183
- break;
5184
- }
5185
- message.validation = ValidationBlock2.decode(reader, reader.uint32());
5186
- continue;
5187
- }
5188
- case 7: {
5189
- if (tag !== 56) {
5190
- break;
5191
- }
5192
- message.mode = reader.int32();
5193
- continue;
5194
- }
5195
- case 8: {
5196
- if (tag !== 66) {
5197
- break;
5198
- }
5199
- message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
5200
- continue;
5201
- }
5202
- case 9: {
5203
- if (tag !== 74) {
5204
- break;
5205
- }
5206
- message.variable = reader.string();
5207
- continue;
5208
- }
5209
- case 10: {
5210
- if (tag !== 82) {
5211
- break;
5212
- }
5213
- message.expression = reader.string();
5214
- continue;
5215
- }
5216
- case 11: {
5217
- if (tag !== 90) {
5218
- break;
5219
- }
5220
- message.wired_source = reader.string();
5221
- continue;
5222
- }
5223
- }
5224
- if ((tag & 7) === 4 || tag === 0) {
5225
- break;
5226
- }
5227
- reader.skip(tag & 7);
5228
- }
5229
- return message;
5230
- },
5231
- fromJSON(object) {
5232
- return {
5233
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
5234
- type: isSet3(object.type) ? globalThis.String(object.type) : "",
5235
- required: isSet3(object.required) ? globalThis.Boolean(object.required) : false,
5236
- description: isSet3(object.description) ? globalThis.String(object.description) : "",
5237
- default_value: isSet3(object?.defaultValue) ? object.defaultValue : isSet3(object?.default_value) ? object.default_value : void 0,
5238
- validation: isSet3(object.validation) ? ValidationBlock2.fromJSON(object.validation) : void 0,
5239
- mode: isSet3(object.mode) ? inputModeFromJSON(object.mode) : 0,
5240
- value: isSet3(object?.value) ? object.value : void 0,
5241
- variable: isSet3(object.variable) ? globalThis.String(object.variable) : "",
5242
- expression: isSet3(object.expression) ? globalThis.String(object.expression) : "",
5243
- wired_source: isSet3(object.wiredSource) ? globalThis.String(object.wiredSource) : isSet3(object.wired_source) ? globalThis.String(object.wired_source) : ""
5244
- };
5245
- },
5246
- toJSON(message) {
5247
- const obj = {};
5248
- if (message.name !== "") {
5249
- obj.name = message.name;
5250
- }
5251
- if (message.type !== "") {
5252
- obj.type = message.type;
5253
- }
5254
- if (message.required !== false) {
5255
- obj.required = message.required;
5256
- }
5257
- if (message.description !== "") {
5258
- obj.description = message.description;
5259
- }
5260
- if (message.default_value !== void 0) {
5261
- obj.defaultValue = message.default_value;
5262
- }
5263
- if (message.validation !== void 0) {
5264
- obj.validation = ValidationBlock2.toJSON(message.validation);
5265
- }
5266
- if (message.mode !== 0) {
5267
- obj.mode = inputModeToJSON(message.mode);
5268
- }
5269
- if (message.value !== void 0) {
5270
- obj.value = message.value;
5271
- }
5272
- if (message.variable !== "") {
5273
- obj.variable = message.variable;
5274
- }
5275
- if (message.expression !== "") {
5276
- obj.expression = message.expression;
5277
- }
5278
- if (message.wired_source !== "") {
5279
- obj.wiredSource = message.wired_source;
5280
- }
5281
- return obj;
5282
- },
5283
- create(base) {
5284
- return RenderInput.fromPartial(base ?? {});
5285
- },
5286
- fromPartial(object) {
5287
- const message = createBaseRenderInput();
5288
- message.name = object.name ?? "";
5289
- message.type = object.type ?? "";
5290
- message.required = object.required ?? false;
5291
- message.description = object.description ?? "";
5292
- message.default_value = object.default_value ?? void 0;
5293
- message.validation = object.validation !== void 0 && object.validation !== null ? ValidationBlock2.fromPartial(object.validation) : void 0;
5294
- message.mode = object.mode ?? 0;
5295
- message.value = object.value ?? void 0;
5296
- message.variable = object.variable ?? "";
5297
- message.expression = object.expression ?? "";
5298
- message.wired_source = object.wired_source ?? "";
5299
- return message;
5300
- }
5301
- };
5302
- function createBaseRenderOutput() {
5303
- return { name: "", type: "", description: "", sensitive: false };
5304
- }
5305
- var RenderOutput = {
5306
- encode(message, writer = new BinaryWriter3()) {
5307
- if (message.name !== "") {
5308
- writer.uint32(10).string(message.name);
5309
- }
5310
- if (message.type !== "") {
5311
- writer.uint32(18).string(message.type);
5312
- }
5313
- if (message.description !== "") {
5314
- writer.uint32(26).string(message.description);
5315
- }
5316
- if (message.sensitive !== false) {
5317
- writer.uint32(32).bool(message.sensitive);
5318
- }
5319
- return writer;
5320
- },
5321
- decode(input, length) {
5322
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
5323
- const end = length === void 0 ? reader.len : reader.pos + length;
5324
- const message = createBaseRenderOutput();
5325
- while (reader.pos < end) {
5326
- const tag = reader.uint32();
5327
- switch (tag >>> 3) {
5328
- case 1: {
5329
- if (tag !== 10) {
5330
- break;
5331
- }
5332
- message.name = reader.string();
5333
- continue;
5334
- }
5335
- case 2: {
5336
- if (tag !== 18) {
5337
- break;
5338
- }
5339
- message.type = reader.string();
5340
- continue;
5341
- }
5342
- case 3: {
5343
- if (tag !== 26) {
5344
- break;
5345
- }
5346
- message.description = reader.string();
5347
- continue;
5348
- }
5349
- case 4: {
5350
- if (tag !== 32) {
5351
- break;
5352
- }
5353
- message.sensitive = reader.bool();
5354
- continue;
5355
- }
5356
- }
5357
- if ((tag & 7) === 4 || tag === 0) {
5358
- break;
5359
- }
5360
- reader.skip(tag & 7);
5361
- }
5362
- return message;
5363
- },
5364
- fromJSON(object) {
5365
- return {
5366
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
5367
- type: isSet3(object.type) ? globalThis.String(object.type) : "",
5368
- description: isSet3(object.description) ? globalThis.String(object.description) : "",
5369
- sensitive: isSet3(object.sensitive) ? globalThis.Boolean(object.sensitive) : false
5370
- };
5371
- },
5372
- toJSON(message) {
5373
- const obj = {};
5374
- if (message.name !== "") {
5375
- obj.name = message.name;
5376
- }
5377
- if (message.type !== "") {
5378
- obj.type = message.type;
5379
- }
5380
- if (message.description !== "") {
5381
- obj.description = message.description;
5382
- }
5383
- if (message.sensitive !== false) {
5384
- obj.sensitive = message.sensitive;
5385
- }
5386
- return obj;
5387
- },
5388
- create(base) {
5389
- return RenderOutput.fromPartial(base ?? {});
5390
- },
5391
- fromPartial(object) {
5392
- const message = createBaseRenderOutput();
5393
- message.name = object.name ?? "";
5394
- message.type = object.type ?? "";
5395
- message.description = object.description ?? "";
5396
- message.sensitive = object.sensitive ?? false;
5397
- return message;
5398
- }
5399
- };
5400
- function createBaseNodeConfig() {
5401
- return {
5402
- instance_id: "",
5403
- inputs: [],
5404
- outputs: [],
5405
- sibling_ids: [],
5406
- depends_on: [],
5407
- available_variables: [],
5408
- providers: {}
5409
- };
5410
- }
5411
- var NodeConfig = {
5412
- encode(message, writer = new BinaryWriter3()) {
5413
- if (message.instance_id !== "") {
5414
- writer.uint32(10).string(message.instance_id);
5415
- }
5416
- for (const v of message.inputs) {
5417
- RenderInput.encode(v, writer.uint32(18).fork()).join();
5418
- }
5419
- for (const v of message.outputs) {
5420
- RenderOutput.encode(v, writer.uint32(26).fork()).join();
5421
- }
5422
- for (const v of message.sibling_ids) {
5423
- writer.uint32(34).string(v);
5424
- }
5425
- for (const v of message.depends_on) {
5426
- writer.uint32(42).string(v);
5427
- }
5428
- for (const v of message.available_variables) {
5429
- VariableRef.encode(v, writer.uint32(50).fork()).join();
5430
- }
5431
- globalThis.Object.entries(message.providers).forEach(([key, value]) => {
5432
- NodeConfig_ProvidersEntry.encode({ key, value }, writer.uint32(58).fork()).join();
5433
- });
5434
- return writer;
5435
- },
5436
- decode(input, length) {
5437
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
5438
- const end = length === void 0 ? reader.len : reader.pos + length;
5439
- const message = createBaseNodeConfig();
5440
- while (reader.pos < end) {
5441
- const tag = reader.uint32();
5442
- switch (tag >>> 3) {
5443
- case 1: {
5444
- if (tag !== 10) {
5445
- break;
5446
- }
5447
- message.instance_id = reader.string();
5448
- continue;
5449
- }
5450
- case 2: {
5451
- if (tag !== 18) {
5452
- break;
5453
- }
5454
- message.inputs.push(RenderInput.decode(reader, reader.uint32()));
5455
- continue;
5456
- }
5457
- case 3: {
5458
- if (tag !== 26) {
5459
- break;
5460
- }
5461
- message.outputs.push(RenderOutput.decode(reader, reader.uint32()));
5462
- continue;
5463
- }
5464
- case 4: {
5465
- if (tag !== 34) {
5466
- break;
5467
- }
5468
- message.sibling_ids.push(reader.string());
5469
- continue;
5470
- }
5471
- case 5: {
5472
- if (tag !== 42) {
5473
- break;
5474
- }
5475
- message.depends_on.push(reader.string());
5476
- continue;
5477
- }
5478
- case 6: {
5479
- if (tag !== 50) {
5480
- break;
5481
- }
5482
- message.available_variables.push(VariableRef.decode(reader, reader.uint32()));
5483
- continue;
5484
- }
5485
- case 7: {
5486
- if (tag !== 58) {
5487
- break;
5488
- }
5489
- const entry7 = NodeConfig_ProvidersEntry.decode(reader, reader.uint32());
5490
- if (entry7.value !== void 0) {
5491
- message.providers[entry7.key] = entry7.value;
5492
- }
5493
- continue;
5494
- }
5495
- }
5496
- if ((tag & 7) === 4 || tag === 0) {
5497
- break;
5498
- }
5499
- reader.skip(tag & 7);
5500
- }
5501
- return message;
5502
- },
5503
- fromJSON(object) {
5504
- return {
5505
- instance_id: isSet3(object.instanceId) ? globalThis.String(object.instanceId) : isSet3(object.instance_id) ? globalThis.String(object.instance_id) : "",
5506
- inputs: globalThis.Array.isArray(object?.inputs) ? object.inputs.map((e) => RenderInput.fromJSON(e)) : [],
5507
- outputs: globalThis.Array.isArray(object?.outputs) ? object.outputs.map((e) => RenderOutput.fromJSON(e)) : [],
5508
- sibling_ids: globalThis.Array.isArray(object?.siblingIds) ? object.siblingIds.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.sibling_ids) ? object.sibling_ids.map((e) => globalThis.String(e)) : [],
5509
- depends_on: globalThis.Array.isArray(object?.dependsOn) ? object.dependsOn.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.depends_on) ? object.depends_on.map((e) => globalThis.String(e)) : [],
5510
- available_variables: globalThis.Array.isArray(object?.availableVariables) ? object.availableVariables.map((e) => VariableRef.fromJSON(e)) : globalThis.Array.isArray(object?.available_variables) ? object.available_variables.map((e) => VariableRef.fromJSON(e)) : [],
5511
- providers: isObject3(object.providers) ? globalThis.Object.entries(object.providers).reduce(
5512
- (acc, [key, value]) => {
5513
- acc[key] = globalThis.String(value);
5514
- return acc;
5515
- },
5516
- {}
5517
- ) : {}
5518
- };
5519
- },
5520
- toJSON(message) {
5521
- const obj = {};
5522
- if (message.instance_id !== "") {
5523
- obj.instanceId = message.instance_id;
5524
- }
5525
- if (message.inputs?.length) {
5526
- obj.inputs = message.inputs.map((e) => RenderInput.toJSON(e));
5527
- }
5528
- if (message.outputs?.length) {
5529
- obj.outputs = message.outputs.map((e) => RenderOutput.toJSON(e));
5530
- }
5531
- if (message.sibling_ids?.length) {
5532
- obj.siblingIds = message.sibling_ids;
5533
- }
5534
- if (message.depends_on?.length) {
5535
- obj.dependsOn = message.depends_on;
5536
- }
5537
- if (message.available_variables?.length) {
5538
- obj.availableVariables = message.available_variables.map((e) => VariableRef.toJSON(e));
5539
- }
5540
- if (message.providers) {
5541
- const entries = globalThis.Object.entries(message.providers);
5542
- if (entries.length > 0) {
5543
- obj.providers = {};
5544
- entries.forEach(([k, v]) => {
5545
- obj.providers[k] = v;
5546
- });
5547
- }
5548
- }
5549
- return obj;
5550
- },
5551
- create(base) {
5552
- return NodeConfig.fromPartial(base ?? {});
5553
- },
5554
- fromPartial(object) {
5555
- const message = createBaseNodeConfig();
5556
- message.instance_id = object.instance_id ?? "";
5557
- message.inputs = object.inputs?.map((e) => RenderInput.fromPartial(e)) || [];
5558
- message.outputs = object.outputs?.map((e) => RenderOutput.fromPartial(e)) || [];
5559
- message.sibling_ids = object.sibling_ids?.map((e) => e) || [];
5560
- message.depends_on = object.depends_on?.map((e) => e) || [];
5561
- message.available_variables = object.available_variables?.map((e) => VariableRef.fromPartial(e)) || [];
5562
- message.providers = globalThis.Object.entries(object.providers ?? {}).reduce(
5563
- (acc, [key, value]) => {
5564
- if (value !== void 0) {
5565
- acc[key] = globalThis.String(value);
5566
- }
5567
- return acc;
5568
- },
5569
- {}
5570
- );
5571
- return message;
5572
- }
5573
- };
5574
- function createBaseNodeConfig_ProvidersEntry() {
5575
- return { key: "", value: "" };
5576
- }
5577
- var NodeConfig_ProvidersEntry = {
5578
- encode(message, writer = new BinaryWriter3()) {
5579
- if (message.key !== "") {
5580
- writer.uint32(10).string(message.key);
5581
- }
5582
- if (message.value !== "") {
5583
- writer.uint32(18).string(message.value);
5584
- }
5585
- return writer;
5586
- },
5587
- decode(input, length) {
5588
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
5589
- const end = length === void 0 ? reader.len : reader.pos + length;
5590
- const message = createBaseNodeConfig_ProvidersEntry();
5591
- while (reader.pos < end) {
5592
- const tag = reader.uint32();
5593
- switch (tag >>> 3) {
5594
- case 1: {
5595
- if (tag !== 10) {
5596
- break;
5597
- }
5598
- message.key = reader.string();
5599
- continue;
5600
- }
5601
- case 2: {
5602
- if (tag !== 18) {
5603
- break;
5604
- }
5605
- message.value = reader.string();
5606
- continue;
5607
- }
5608
- }
5609
- if ((tag & 7) === 4 || tag === 0) {
5610
- break;
5611
- }
5612
- reader.skip(tag & 7);
5613
- }
5614
- return message;
5615
- },
5616
- fromJSON(object) {
5617
- return {
5618
- key: isSet3(object.key) ? globalThis.String(object.key) : "",
5619
- value: isSet3(object.value) ? globalThis.String(object.value) : ""
5620
- };
5621
- },
5622
- toJSON(message) {
5623
- const obj = {};
5624
- if (message.key !== "") {
5625
- obj.key = message.key;
5626
- }
5627
- if (message.value !== "") {
5628
- obj.value = message.value;
5629
- }
5630
- return obj;
5631
- },
5632
- create(base) {
5633
- return NodeConfig_ProvidersEntry.fromPartial(base ?? {});
5634
- },
5635
- fromPartial(object) {
5636
- const message = createBaseNodeConfig_ProvidersEntry();
5637
- message.key = object.key ?? "";
5638
- message.value = object.value ?? "";
5639
- return message;
5640
- }
5641
- };
5642
- function createBaseVariableRef() {
5643
- return { name: "", type: "" };
5644
- }
5645
- var VariableRef = {
5646
- encode(message, writer = new BinaryWriter3()) {
5647
- if (message.name !== "") {
5648
- writer.uint32(10).string(message.name);
5649
- }
5650
- if (message.type !== "") {
5651
- writer.uint32(18).string(message.type);
5652
- }
5653
- return writer;
5654
- },
5655
- decode(input, length) {
5656
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
5657
- const end = length === void 0 ? reader.len : reader.pos + length;
5658
- const message = createBaseVariableRef();
5659
- while (reader.pos < end) {
5660
- const tag = reader.uint32();
5661
- switch (tag >>> 3) {
5662
- case 1: {
5663
- if (tag !== 10) {
5664
- break;
5665
- }
5666
- message.name = reader.string();
5667
- continue;
5668
- }
5669
- case 2: {
5670
- if (tag !== 18) {
5671
- break;
5672
- }
5673
- message.type = reader.string();
5674
- continue;
5675
- }
5676
- }
5677
- if ((tag & 7) === 4 || tag === 0) {
5678
- break;
5679
- }
5680
- reader.skip(tag & 7);
5681
- }
5682
- return message;
5683
- },
5684
- fromJSON(object) {
5685
- return {
5686
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
5687
- type: isSet3(object.type) ? globalThis.String(object.type) : ""
5688
- };
5689
- },
5690
- toJSON(message) {
5691
- const obj = {};
5692
- if (message.name !== "") {
5693
- obj.name = message.name;
5694
- }
5695
- if (message.type !== "") {
5696
- obj.type = message.type;
5697
- }
5698
- return obj;
5699
- },
5700
- create(base) {
5701
- return VariableRef.fromPartial(base ?? {});
5702
- },
5703
- fromPartial(object) {
5704
- const message = createBaseVariableRef();
5705
- message.name = object.name ?? "";
5706
- message.type = object.type ?? "";
5707
- return message;
5708
- }
5709
- };
5710
- function createBaseEdgeConfig() {
5711
- return { source_instance: "", target_instance: "", source_outputs: [], target_unbound_inputs: [] };
5712
- }
5713
- var EdgeConfig = {
5714
- encode(message, writer = new BinaryWriter3()) {
5715
- if (message.source_instance !== "") {
5716
- writer.uint32(10).string(message.source_instance);
5717
- }
5718
- if (message.target_instance !== "") {
5719
- writer.uint32(18).string(message.target_instance);
5720
- }
5721
- for (const v of message.source_outputs) {
5722
- RenderOutput.encode(v, writer.uint32(26).fork()).join();
5723
- }
5724
- for (const v of message.target_unbound_inputs) {
5725
- RenderInput.encode(v, writer.uint32(34).fork()).join();
5726
- }
5727
- return writer;
5728
- },
5729
- decode(input, length) {
5730
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
5731
- const end = length === void 0 ? reader.len : reader.pos + length;
5732
- const message = createBaseEdgeConfig();
5733
- while (reader.pos < end) {
5734
- const tag = reader.uint32();
5735
- switch (tag >>> 3) {
5736
- case 1: {
5737
- if (tag !== 10) {
5738
- break;
5739
- }
5740
- message.source_instance = reader.string();
5741
- continue;
5742
- }
5743
- case 2: {
5744
- if (tag !== 18) {
5745
- break;
5746
- }
5747
- message.target_instance = reader.string();
5748
- continue;
5749
- }
5750
- case 3: {
5751
- if (tag !== 26) {
5752
- break;
5753
- }
5754
- message.source_outputs.push(RenderOutput.decode(reader, reader.uint32()));
5755
- continue;
5756
- }
5757
- case 4: {
5758
- if (tag !== 34) {
5759
- break;
5760
- }
5761
- message.target_unbound_inputs.push(RenderInput.decode(reader, reader.uint32()));
5762
- continue;
5763
- }
5764
- }
5765
- if ((tag & 7) === 4 || tag === 0) {
5766
- break;
5767
- }
5768
- reader.skip(tag & 7);
5769
- }
5770
- return message;
5771
- },
5772
- fromJSON(object) {
5773
- return {
5774
- source_instance: isSet3(object.sourceInstance) ? globalThis.String(object.sourceInstance) : isSet3(object.source_instance) ? globalThis.String(object.source_instance) : "",
5775
- target_instance: isSet3(object.targetInstance) ? globalThis.String(object.targetInstance) : isSet3(object.target_instance) ? globalThis.String(object.target_instance) : "",
5776
- source_outputs: globalThis.Array.isArray(object?.sourceOutputs) ? object.sourceOutputs.map((e) => RenderOutput.fromJSON(e)) : globalThis.Array.isArray(object?.source_outputs) ? object.source_outputs.map((e) => RenderOutput.fromJSON(e)) : [],
5777
- target_unbound_inputs: globalThis.Array.isArray(object?.targetUnboundInputs) ? object.targetUnboundInputs.map((e) => RenderInput.fromJSON(e)) : globalThis.Array.isArray(object?.target_unbound_inputs) ? object.target_unbound_inputs.map((e) => RenderInput.fromJSON(e)) : []
5778
- };
5779
- },
5780
- toJSON(message) {
5781
- const obj = {};
5782
- if (message.source_instance !== "") {
5783
- obj.sourceInstance = message.source_instance;
5784
- }
5785
- if (message.target_instance !== "") {
5786
- obj.targetInstance = message.target_instance;
5787
- }
5788
- if (message.source_outputs?.length) {
5789
- obj.sourceOutputs = message.source_outputs.map((e) => RenderOutput.toJSON(e));
5790
- }
5791
- if (message.target_unbound_inputs?.length) {
5792
- obj.targetUnboundInputs = message.target_unbound_inputs.map((e) => RenderInput.toJSON(e));
5793
- }
5794
- return obj;
5795
- },
5796
- create(base) {
5797
- return EdgeConfig.fromPartial(base ?? {});
5798
- },
5799
- fromPartial(object) {
5800
- const message = createBaseEdgeConfig();
5801
- message.source_instance = object.source_instance ?? "";
5802
- message.target_instance = object.target_instance ?? "";
5803
- message.source_outputs = object.source_outputs?.map((e) => RenderOutput.fromPartial(e)) || [];
5804
- message.target_unbound_inputs = object.target_unbound_inputs?.map((e) => RenderInput.fromPartial(e)) || [];
5805
- return message;
5806
- }
5807
- };
5808
- function createBaseSettingsConfig() {
5809
- return {
5810
- terraform: void 0,
5811
- providers: [],
5812
- locals: [],
5813
- environments: {},
5814
- environment_backends: {},
5815
- variables: [],
5816
- exports: [],
5817
- output_defs: []
5818
- };
5819
- }
5820
- var SettingsConfig = {
5821
- encode(message, writer = new BinaryWriter3()) {
5822
- if (message.terraform !== void 0) {
5823
- TerraformView.encode(message.terraform, writer.uint32(10).fork()).join();
5824
- }
5825
- for (const v of message.providers) {
5826
- ProviderView.encode(v, writer.uint32(18).fork()).join();
5827
- }
5828
- for (const v of message.locals) {
5829
- LocalView.encode(v, writer.uint32(26).fork()).join();
5830
- }
5831
- globalThis.Object.entries(message.environments).forEach(
5832
- ([key, value]) => {
5833
- if (value !== void 0) {
5834
- SettingsConfig_EnvironmentsEntry.encode({ key, value }, writer.uint32(34).fork()).join();
5835
- }
5836
- }
5837
- );
5838
- globalThis.Object.entries(message.environment_backends).forEach(([key, value]) => {
5839
- SettingsConfig_EnvironmentBackendsEntry.encode({ key, value }, writer.uint32(42).fork()).join();
5840
- });
5841
- for (const v of message.variables) {
5842
- InputDef2.encode(v, writer.uint32(50).fork()).join();
5843
- }
5844
- for (const v of message.exports) {
5845
- OutputExportEntry.encode(v, writer.uint32(58).fork()).join();
5846
- }
5847
- for (const v of message.output_defs) {
5848
- OutputDef2.encode(v, writer.uint32(66).fork()).join();
5849
- }
5850
- return writer;
5851
- },
5852
- decode(input, length) {
5853
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
5854
- const end = length === void 0 ? reader.len : reader.pos + length;
5855
- const message = createBaseSettingsConfig();
5856
- while (reader.pos < end) {
5857
- const tag = reader.uint32();
5858
- switch (tag >>> 3) {
5859
- case 1: {
5860
- if (tag !== 10) {
5861
- break;
5862
- }
5863
- message.terraform = TerraformView.decode(reader, reader.uint32());
5864
- continue;
5865
- }
5866
- case 2: {
5867
- if (tag !== 18) {
5868
- break;
5869
- }
5870
- message.providers.push(ProviderView.decode(reader, reader.uint32()));
5871
- continue;
5872
- }
5873
- case 3: {
5874
- if (tag !== 26) {
5875
- break;
5876
- }
5877
- message.locals.push(LocalView.decode(reader, reader.uint32()));
5878
- continue;
5879
- }
5880
- case 4: {
5881
- if (tag !== 34) {
5882
- break;
5883
- }
5884
- const entry4 = SettingsConfig_EnvironmentsEntry.decode(reader, reader.uint32());
5885
- if (entry4.value !== void 0) {
5886
- message.environments[entry4.key] = entry4.value;
5887
- }
5888
- continue;
5889
- }
5890
- case 5: {
5891
- if (tag !== 42) {
5892
- break;
5893
- }
5894
- const entry5 = SettingsConfig_EnvironmentBackendsEntry.decode(reader, reader.uint32());
5895
- if (entry5.value !== void 0) {
5896
- message.environment_backends[entry5.key] = entry5.value;
5897
- }
5898
- continue;
5899
- }
5900
- case 6: {
5901
- if (tag !== 50) {
5902
- break;
5903
- }
5904
- message.variables.push(InputDef2.decode(reader, reader.uint32()));
5905
- continue;
5906
- }
5907
- case 7: {
5908
- if (tag !== 58) {
5909
- break;
5910
- }
5911
- message.exports.push(OutputExportEntry.decode(reader, reader.uint32()));
5912
- continue;
5913
- }
5914
- case 8: {
5915
- if (tag !== 66) {
5916
- break;
5917
- }
5918
- message.output_defs.push(OutputDef2.decode(reader, reader.uint32()));
5919
- continue;
5920
- }
5921
- }
5922
- if ((tag & 7) === 4 || tag === 0) {
5923
- break;
5924
- }
5925
- reader.skip(tag & 7);
5926
- }
5927
- return message;
5928
- },
5929
- fromJSON(object) {
5930
- return {
5931
- terraform: isSet3(object.terraform) ? TerraformView.fromJSON(object.terraform) : void 0,
5932
- providers: globalThis.Array.isArray(object?.providers) ? object.providers.map((e) => ProviderView.fromJSON(e)) : [],
5933
- locals: globalThis.Array.isArray(object?.locals) ? object.locals.map((e) => LocalView.fromJSON(e)) : [],
5934
- environments: isObject3(object.environments) ? globalThis.Object.entries(object.environments).reduce(
5935
- (acc, [key, value]) => {
5936
- acc[key] = value;
5937
- return acc;
5938
- },
5939
- {}
5940
- ) : {},
5941
- environment_backends: isObject3(object.environmentBackends) ? globalThis.Object.entries(object.environmentBackends).reduce(
5942
- (acc, [key, value]) => {
5943
- acc[key] = BackendView.fromJSON(value);
5944
- return acc;
5945
- },
5946
- {}
5947
- ) : isObject3(object.environment_backends) ? globalThis.Object.entries(object.environment_backends).reduce(
5948
- (acc, [key, value]) => {
5949
- acc[key] = BackendView.fromJSON(value);
5950
- return acc;
5951
- },
5952
- {}
5953
- ) : {},
5954
- variables: globalThis.Array.isArray(object?.variables) ? object.variables.map((e) => InputDef2.fromJSON(e)) : [],
5955
- exports: globalThis.Array.isArray(object?.exports) ? object.exports.map((e) => OutputExportEntry.fromJSON(e)) : [],
5956
- output_defs: globalThis.Array.isArray(object?.outputDefs) ? object.outputDefs.map((e) => OutputDef2.fromJSON(e)) : globalThis.Array.isArray(object?.output_defs) ? object.output_defs.map((e) => OutputDef2.fromJSON(e)) : []
5957
- };
5958
- },
5959
- toJSON(message) {
5960
- const obj = {};
5961
- if (message.terraform !== void 0) {
5962
- obj.terraform = TerraformView.toJSON(message.terraform);
5963
- }
5964
- if (message.providers?.length) {
5965
- obj.providers = message.providers.map((e) => ProviderView.toJSON(e));
5966
- }
5967
- if (message.locals?.length) {
5968
- obj.locals = message.locals.map((e) => LocalView.toJSON(e));
5969
- }
5970
- if (message.environments) {
5971
- const entries = globalThis.Object.entries(message.environments);
5972
- if (entries.length > 0) {
5973
- obj.environments = {};
5974
- entries.forEach(([k, v]) => {
5975
- obj.environments[k] = v;
5976
- });
5977
- }
5978
- }
5979
- if (message.environment_backends) {
5980
- const entries = globalThis.Object.entries(message.environment_backends);
5981
- if (entries.length > 0) {
5982
- obj.environmentBackends = {};
5983
- entries.forEach(([k, v]) => {
5984
- obj.environmentBackends[k] = BackendView.toJSON(v);
5985
- });
5986
- }
5987
- }
5988
- if (message.variables?.length) {
5989
- obj.variables = message.variables.map((e) => InputDef2.toJSON(e));
5990
- }
5991
- if (message.exports?.length) {
5992
- obj.exports = message.exports.map((e) => OutputExportEntry.toJSON(e));
5993
- }
5994
- if (message.output_defs?.length) {
5995
- obj.outputDefs = message.output_defs.map((e) => OutputDef2.toJSON(e));
5996
- }
5997
- return obj;
5998
- },
5999
- create(base) {
6000
- return SettingsConfig.fromPartial(base ?? {});
6001
- },
6002
- fromPartial(object) {
6003
- const message = createBaseSettingsConfig();
6004
- message.terraform = object.terraform !== void 0 && object.terraform !== null ? TerraformView.fromPartial(object.terraform) : void 0;
6005
- message.providers = object.providers?.map((e) => ProviderView.fromPartial(e)) || [];
6006
- message.locals = object.locals?.map((e) => LocalView.fromPartial(e)) || [];
6007
- message.environments = globalThis.Object.entries(object.environments ?? {}).reduce(
6008
- (acc, [key, value]) => {
6009
- if (value !== void 0) {
6010
- acc[key] = value;
6011
- }
6012
- return acc;
6013
- },
6014
- {}
6015
- );
6016
- message.environment_backends = globalThis.Object.entries(object.environment_backends ?? {}).reduce(
6017
- (acc, [key, value]) => {
6018
- if (value !== void 0) {
6019
- acc[key] = BackendView.fromPartial(value);
6020
- }
6021
- return acc;
6022
- },
6023
- {}
6024
- );
6025
- message.variables = object.variables?.map((e) => InputDef2.fromPartial(e)) || [];
6026
- message.exports = object.exports?.map((e) => OutputExportEntry.fromPartial(e)) || [];
6027
- message.output_defs = object.output_defs?.map((e) => OutputDef2.fromPartial(e)) || [];
6028
- return message;
6029
- }
6030
- };
6031
- function createBaseSettingsConfig_EnvironmentsEntry() {
6032
- return { key: "", value: void 0 };
6033
- }
6034
- var SettingsConfig_EnvironmentsEntry = {
6035
- encode(message, writer = new BinaryWriter3()) {
6036
- if (message.key !== "") {
6037
- writer.uint32(10).string(message.key);
6038
- }
6039
- if (message.value !== void 0) {
6040
- Struct.encode(Struct.wrap(message.value), writer.uint32(18).fork()).join();
6041
- }
6042
- return writer;
6043
- },
6044
- decode(input, length) {
6045
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6046
- const end = length === void 0 ? reader.len : reader.pos + length;
6047
- const message = createBaseSettingsConfig_EnvironmentsEntry();
6048
- while (reader.pos < end) {
6049
- const tag = reader.uint32();
6050
- switch (tag >>> 3) {
6051
- case 1: {
6052
- if (tag !== 10) {
6053
- break;
6054
- }
6055
- message.key = reader.string();
6056
- continue;
6057
- }
6058
- case 2: {
6059
- if (tag !== 18) {
6060
- break;
6061
- }
6062
- message.value = Struct.unwrap(Struct.decode(reader, reader.uint32()));
6063
- continue;
6064
- }
6065
- }
6066
- if ((tag & 7) === 4 || tag === 0) {
6067
- break;
6068
- }
6069
- reader.skip(tag & 7);
6070
- }
6071
- return message;
6072
- },
6073
- fromJSON(object) {
6074
- return {
6075
- key: isSet3(object.key) ? globalThis.String(object.key) : "",
6076
- value: isObject3(object.value) ? object.value : void 0
6077
- };
6078
- },
6079
- toJSON(message) {
6080
- const obj = {};
6081
- if (message.key !== "") {
6082
- obj.key = message.key;
6083
- }
6084
- if (message.value !== void 0) {
6085
- obj.value = message.value;
6086
- }
6087
- return obj;
6088
- },
6089
- create(base) {
6090
- return SettingsConfig_EnvironmentsEntry.fromPartial(base ?? {});
6091
- },
6092
- fromPartial(object) {
6093
- const message = createBaseSettingsConfig_EnvironmentsEntry();
6094
- message.key = object.key ?? "";
6095
- message.value = object.value ?? void 0;
6096
- return message;
6097
- }
6098
- };
6099
- function createBaseSettingsConfig_EnvironmentBackendsEntry() {
6100
- return { key: "", value: void 0 };
6101
- }
6102
- var SettingsConfig_EnvironmentBackendsEntry = {
6103
- encode(message, writer = new BinaryWriter3()) {
6104
- if (message.key !== "") {
6105
- writer.uint32(10).string(message.key);
6106
- }
6107
- if (message.value !== void 0) {
6108
- BackendView.encode(message.value, writer.uint32(18).fork()).join();
6109
- }
6110
- return writer;
6111
- },
6112
- decode(input, length) {
6113
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6114
- const end = length === void 0 ? reader.len : reader.pos + length;
6115
- const message = createBaseSettingsConfig_EnvironmentBackendsEntry();
6116
- while (reader.pos < end) {
6117
- const tag = reader.uint32();
6118
- switch (tag >>> 3) {
6119
- case 1: {
6120
- if (tag !== 10) {
6121
- break;
6122
- }
6123
- message.key = reader.string();
6124
- continue;
6125
- }
6126
- case 2: {
6127
- if (tag !== 18) {
6128
- break;
6129
- }
6130
- message.value = BackendView.decode(reader, reader.uint32());
6131
- continue;
6132
- }
6133
- }
6134
- if ((tag & 7) === 4 || tag === 0) {
6135
- break;
6136
- }
6137
- reader.skip(tag & 7);
6138
- }
6139
- return message;
6140
- },
6141
- fromJSON(object) {
6142
- return {
6143
- key: isSet3(object.key) ? globalThis.String(object.key) : "",
6144
- value: isSet3(object.value) ? BackendView.fromJSON(object.value) : void 0
6145
- };
6146
- },
6147
- toJSON(message) {
6148
- const obj = {};
6149
- if (message.key !== "") {
6150
- obj.key = message.key;
6151
- }
6152
- if (message.value !== void 0) {
6153
- obj.value = BackendView.toJSON(message.value);
6154
- }
6155
- return obj;
6156
- },
6157
- create(base) {
6158
- return SettingsConfig_EnvironmentBackendsEntry.fromPartial(base ?? {});
6159
- },
6160
- fromPartial(object) {
6161
- const message = createBaseSettingsConfig_EnvironmentBackendsEntry();
6162
- message.key = object.key ?? "";
6163
- message.value = object.value !== void 0 && object.value !== null ? BackendView.fromPartial(object.value) : void 0;
6164
- return message;
6165
- }
6166
- };
6167
- function createBaseTerraformView() {
6168
- return { required_version: "", required_providers: [], backend: void 0 };
6169
- }
6170
- var TerraformView = {
6171
- encode(message, writer = new BinaryWriter3()) {
6172
- if (message.required_version !== "") {
6173
- writer.uint32(10).string(message.required_version);
6174
- }
6175
- for (const v of message.required_providers) {
6176
- ProviderReqView.encode(v, writer.uint32(18).fork()).join();
6177
- }
6178
- if (message.backend !== void 0) {
6179
- BackendView.encode(message.backend, writer.uint32(26).fork()).join();
6180
- }
6181
- return writer;
6182
- },
6183
- decode(input, length) {
6184
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6185
- const end = length === void 0 ? reader.len : reader.pos + length;
6186
- const message = createBaseTerraformView();
6187
- while (reader.pos < end) {
6188
- const tag = reader.uint32();
6189
- switch (tag >>> 3) {
6190
- case 1: {
6191
- if (tag !== 10) {
6192
- break;
6193
- }
6194
- message.required_version = reader.string();
6195
- continue;
6196
- }
6197
- case 2: {
6198
- if (tag !== 18) {
6199
- break;
6200
- }
6201
- message.required_providers.push(ProviderReqView.decode(reader, reader.uint32()));
6202
- continue;
6203
- }
6204
- case 3: {
6205
- if (tag !== 26) {
6206
- break;
6207
- }
6208
- message.backend = BackendView.decode(reader, reader.uint32());
6209
- continue;
6210
- }
6211
- }
6212
- if ((tag & 7) === 4 || tag === 0) {
6213
- break;
6214
- }
6215
- reader.skip(tag & 7);
6216
- }
6217
- return message;
6218
- },
6219
- fromJSON(object) {
6220
- return {
6221
- required_version: isSet3(object.requiredVersion) ? globalThis.String(object.requiredVersion) : isSet3(object.required_version) ? globalThis.String(object.required_version) : "",
6222
- required_providers: globalThis.Array.isArray(object?.requiredProviders) ? object.requiredProviders.map((e) => ProviderReqView.fromJSON(e)) : globalThis.Array.isArray(object?.required_providers) ? object.required_providers.map((e) => ProviderReqView.fromJSON(e)) : [],
6223
- backend: isSet3(object.backend) ? BackendView.fromJSON(object.backend) : void 0
6224
- };
6225
- },
6226
- toJSON(message) {
6227
- const obj = {};
6228
- if (message.required_version !== "") {
6229
- obj.requiredVersion = message.required_version;
6230
- }
6231
- if (message.required_providers?.length) {
6232
- obj.requiredProviders = message.required_providers.map((e) => ProviderReqView.toJSON(e));
6233
- }
6234
- if (message.backend !== void 0) {
6235
- obj.backend = BackendView.toJSON(message.backend);
6236
- }
6237
- return obj;
6238
- },
6239
- create(base) {
6240
- return TerraformView.fromPartial(base ?? {});
6241
- },
6242
- fromPartial(object) {
6243
- const message = createBaseTerraformView();
6244
- message.required_version = object.required_version ?? "";
6245
- message.required_providers = object.required_providers?.map((e) => ProviderReqView.fromPartial(e)) || [];
6246
- message.backend = object.backend !== void 0 && object.backend !== null ? BackendView.fromPartial(object.backend) : void 0;
6247
- return message;
6248
- }
6249
- };
6250
- function createBaseProviderReqView() {
6251
- return { name: "", source: "", version: "", configuration_aliases: [] };
6252
- }
6253
- var ProviderReqView = {
6254
- encode(message, writer = new BinaryWriter3()) {
6255
- if (message.name !== "") {
6256
- writer.uint32(10).string(message.name);
6257
- }
6258
- if (message.source !== "") {
6259
- writer.uint32(18).string(message.source);
6260
- }
6261
- if (message.version !== "") {
6262
- writer.uint32(26).string(message.version);
6263
- }
6264
- for (const v of message.configuration_aliases) {
6265
- writer.uint32(34).string(v);
6266
- }
6267
- return writer;
6268
- },
6269
- decode(input, length) {
6270
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6271
- const end = length === void 0 ? reader.len : reader.pos + length;
6272
- const message = createBaseProviderReqView();
6273
- while (reader.pos < end) {
6274
- const tag = reader.uint32();
6275
- switch (tag >>> 3) {
6276
- case 1: {
6277
- if (tag !== 10) {
6278
- break;
6279
- }
6280
- message.name = reader.string();
6281
- continue;
6282
- }
6283
- case 2: {
6284
- if (tag !== 18) {
6285
- break;
6286
- }
6287
- message.source = reader.string();
6288
- continue;
6289
- }
6290
- case 3: {
6291
- if (tag !== 26) {
6292
- break;
6293
- }
6294
- message.version = reader.string();
6295
- continue;
6296
- }
6297
- case 4: {
6298
- if (tag !== 34) {
6299
- break;
6300
- }
6301
- message.configuration_aliases.push(reader.string());
6302
- continue;
6303
- }
6304
- }
6305
- if ((tag & 7) === 4 || tag === 0) {
6306
- break;
6307
- }
6308
- reader.skip(tag & 7);
6309
- }
6310
- return message;
6311
- },
6312
- fromJSON(object) {
6313
- return {
6314
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
6315
- source: isSet3(object.source) ? globalThis.String(object.source) : "",
6316
- version: isSet3(object.version) ? globalThis.String(object.version) : "",
6317
- configuration_aliases: globalThis.Array.isArray(object?.configurationAliases) ? object.configurationAliases.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.configuration_aliases) ? object.configuration_aliases.map((e) => globalThis.String(e)) : []
6318
- };
6319
- },
6320
- toJSON(message) {
6321
- const obj = {};
6322
- if (message.name !== "") {
6323
- obj.name = message.name;
6324
- }
6325
- if (message.source !== "") {
6326
- obj.source = message.source;
6327
- }
6328
- if (message.version !== "") {
6329
- obj.version = message.version;
6330
- }
6331
- if (message.configuration_aliases?.length) {
6332
- obj.configurationAliases = message.configuration_aliases;
6333
- }
6334
- return obj;
6335
- },
6336
- create(base) {
6337
- return ProviderReqView.fromPartial(base ?? {});
6338
- },
6339
- fromPartial(object) {
6340
- const message = createBaseProviderReqView();
6341
- message.name = object.name ?? "";
6342
- message.source = object.source ?? "";
6343
- message.version = object.version ?? "";
6344
- message.configuration_aliases = object.configuration_aliases?.map((e) => e) || [];
6345
- return message;
6346
- }
6347
- };
6348
- function createBaseBackendView() {
6349
- return { type: "", config: {} };
6350
- }
6351
- var BackendView = {
6352
- encode(message, writer = new BinaryWriter3()) {
6353
- if (message.type !== "") {
6354
- writer.uint32(10).string(message.type);
6355
- }
6356
- globalThis.Object.entries(message.config).forEach(([key, value]) => {
6357
- if (value !== void 0) {
6358
- BackendView_ConfigEntry.encode({ key, value }, writer.uint32(18).fork()).join();
6359
- }
6360
- });
6361
- return writer;
6362
- },
6363
- decode(input, length) {
6364
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6365
- const end = length === void 0 ? reader.len : reader.pos + length;
6366
- const message = createBaseBackendView();
6367
- while (reader.pos < end) {
6368
- const tag = reader.uint32();
6369
- switch (tag >>> 3) {
6370
- case 1: {
6371
- if (tag !== 10) {
6372
- break;
6373
- }
6374
- message.type = reader.string();
6375
- continue;
6376
- }
6377
- case 2: {
6378
- if (tag !== 18) {
6379
- break;
6380
- }
6381
- const entry2 = BackendView_ConfigEntry.decode(reader, reader.uint32());
6382
- if (entry2.value !== void 0) {
6383
- message.config[entry2.key] = entry2.value;
6384
- }
6385
- continue;
6386
- }
6387
- }
6388
- if ((tag & 7) === 4 || tag === 0) {
6389
- break;
6390
- }
6391
- reader.skip(tag & 7);
6392
- }
6393
- return message;
6394
- },
6395
- fromJSON(object) {
6396
- return {
6397
- type: isSet3(object.type) ? globalThis.String(object.type) : "",
6398
- config: isObject3(object.config) ? globalThis.Object.entries(object.config).reduce(
6399
- (acc, [key, value]) => {
6400
- acc[key] = value;
6401
- return acc;
6402
- },
6403
- {}
6404
- ) : {}
6405
- };
6406
- },
6407
- toJSON(message) {
6408
- const obj = {};
6409
- if (message.type !== "") {
6410
- obj.type = message.type;
6411
- }
6412
- if (message.config) {
6413
- const entries = globalThis.Object.entries(message.config);
6414
- if (entries.length > 0) {
6415
- obj.config = {};
6416
- entries.forEach(([k, v]) => {
6417
- obj.config[k] = v;
6418
- });
6419
- }
6420
- }
6421
- return obj;
6422
- },
6423
- create(base) {
6424
- return BackendView.fromPartial(base ?? {});
6425
- },
6426
- fromPartial(object) {
6427
- const message = createBaseBackendView();
6428
- message.type = object.type ?? "";
6429
- message.config = globalThis.Object.entries(object.config ?? {}).reduce(
6430
- (acc, [key, value]) => {
6431
- if (value !== void 0) {
6432
- acc[key] = value;
6433
- }
6434
- return acc;
6435
- },
6436
- {}
6437
- );
6438
- return message;
6439
- }
6440
- };
6441
- function createBaseBackendView_ConfigEntry() {
6442
- return { key: "", value: void 0 };
6443
- }
6444
- var BackendView_ConfigEntry = {
6445
- encode(message, writer = new BinaryWriter3()) {
6446
- if (message.key !== "") {
6447
- writer.uint32(10).string(message.key);
6448
- }
6449
- if (message.value !== void 0) {
6450
- Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
6451
- }
6452
- return writer;
6453
- },
6454
- decode(input, length) {
6455
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6456
- const end = length === void 0 ? reader.len : reader.pos + length;
6457
- const message = createBaseBackendView_ConfigEntry();
6458
- while (reader.pos < end) {
6459
- const tag = reader.uint32();
6460
- switch (tag >>> 3) {
6461
- case 1: {
6462
- if (tag !== 10) {
6463
- break;
6464
- }
6465
- message.key = reader.string();
6466
- continue;
6467
- }
6468
- case 2: {
6469
- if (tag !== 18) {
6470
- break;
6471
- }
6472
- message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
6473
- continue;
6474
- }
6475
- }
6476
- if ((tag & 7) === 4 || tag === 0) {
6477
- break;
6478
- }
6479
- reader.skip(tag & 7);
6480
- }
6481
- return message;
6482
- },
6483
- fromJSON(object) {
6484
- return {
6485
- key: isSet3(object.key) ? globalThis.String(object.key) : "",
6486
- value: isSet3(object?.value) ? object.value : void 0
6487
- };
6488
- },
6489
- toJSON(message) {
6490
- const obj = {};
6491
- if (message.key !== "") {
6492
- obj.key = message.key;
6493
- }
6494
- if (message.value !== void 0) {
6495
- obj.value = message.value;
6496
- }
6497
- return obj;
6498
- },
6499
- create(base) {
6500
- return BackendView_ConfigEntry.fromPartial(base ?? {});
6501
- },
6502
- fromPartial(object) {
6503
- const message = createBaseBackendView_ConfigEntry();
6504
- message.key = object.key ?? "";
6505
- message.value = object.value ?? void 0;
6506
- return message;
6507
- }
6508
- };
6509
- function createBaseProviderView() {
6510
- return { name: "", alias: "", config: {}, blocks: [] };
6511
- }
6512
- var ProviderView = {
6513
- encode(message, writer = new BinaryWriter3()) {
6514
- if (message.name !== "") {
6515
- writer.uint32(10).string(message.name);
6516
- }
6517
- if (message.alias !== "") {
6518
- writer.uint32(18).string(message.alias);
6519
- }
6520
- globalThis.Object.entries(message.config).forEach(([key, value]) => {
6521
- ProviderView_ConfigEntry.encode({ key, value }, writer.uint32(26).fork()).join();
6522
- });
6523
- for (const v of message.blocks) {
6524
- Block.encode(v, writer.uint32(34).fork()).join();
6525
- }
6526
- return writer;
6527
- },
6528
- decode(input, length) {
6529
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6530
- const end = length === void 0 ? reader.len : reader.pos + length;
6531
- const message = createBaseProviderView();
6532
- while (reader.pos < end) {
6533
- const tag = reader.uint32();
6534
- switch (tag >>> 3) {
6535
- case 1: {
6536
- if (tag !== 10) {
6537
- break;
6538
- }
6539
- message.name = reader.string();
6540
- continue;
6541
- }
6542
- case 2: {
6543
- if (tag !== 18) {
6544
- break;
6545
- }
6546
- message.alias = reader.string();
6547
- continue;
6548
- }
6549
- case 3: {
6550
- if (tag !== 26) {
6551
- break;
6552
- }
6553
- const entry3 = ProviderView_ConfigEntry.decode(reader, reader.uint32());
6554
- if (entry3.value !== void 0) {
6555
- message.config[entry3.key] = entry3.value;
6556
- }
6557
- continue;
6558
- }
6559
- case 4: {
6560
- if (tag !== 34) {
6561
- break;
6562
- }
6563
- message.blocks.push(Block.decode(reader, reader.uint32()));
6564
- continue;
6565
- }
6566
- }
6567
- if ((tag & 7) === 4 || tag === 0) {
6568
- break;
6569
- }
6570
- reader.skip(tag & 7);
6571
- }
6572
- return message;
6573
- },
6574
- fromJSON(object) {
6575
- return {
6576
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
6577
- alias: isSet3(object.alias) ? globalThis.String(object.alias) : "",
6578
- config: isObject3(object.config) ? globalThis.Object.entries(object.config).reduce(
6579
- (acc, [key, value]) => {
6580
- acc[key] = globalThis.String(value);
6581
- return acc;
6582
- },
6583
- {}
6584
- ) : {},
6585
- blocks: globalThis.Array.isArray(object?.blocks) ? object.blocks.map((e) => Block.fromJSON(e)) : []
6586
- };
6587
- },
6588
- toJSON(message) {
6589
- const obj = {};
6590
- if (message.name !== "") {
6591
- obj.name = message.name;
6592
- }
6593
- if (message.alias !== "") {
6594
- obj.alias = message.alias;
6595
- }
6596
- if (message.config) {
6597
- const entries = globalThis.Object.entries(message.config);
6598
- if (entries.length > 0) {
6599
- obj.config = {};
6600
- entries.forEach(([k, v]) => {
6601
- obj.config[k] = v;
6602
- });
6603
- }
6604
- }
6605
- if (message.blocks?.length) {
6606
- obj.blocks = message.blocks.map((e) => Block.toJSON(e));
6607
- }
6608
- return obj;
6609
- },
6610
- create(base) {
6611
- return ProviderView.fromPartial(base ?? {});
6612
- },
6613
- fromPartial(object) {
6614
- const message = createBaseProviderView();
6615
- message.name = object.name ?? "";
6616
- message.alias = object.alias ?? "";
6617
- message.config = globalThis.Object.entries(object.config ?? {}).reduce(
6618
- (acc, [key, value]) => {
6619
- if (value !== void 0) {
6620
- acc[key] = globalThis.String(value);
6621
- }
6622
- return acc;
6623
- },
6624
- {}
6625
- );
6626
- message.blocks = object.blocks?.map((e) => Block.fromPartial(e)) || [];
6627
- return message;
6628
- }
6629
- };
6630
- function createBaseProviderView_ConfigEntry() {
6631
- return { key: "", value: "" };
6632
- }
6633
- var ProviderView_ConfigEntry = {
6634
- encode(message, writer = new BinaryWriter3()) {
6635
- if (message.key !== "") {
6636
- writer.uint32(10).string(message.key);
6637
- }
6638
- if (message.value !== "") {
6639
- writer.uint32(18).string(message.value);
6640
- }
6641
- return writer;
6642
- },
6643
- decode(input, length) {
6644
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6645
- const end = length === void 0 ? reader.len : reader.pos + length;
6646
- const message = createBaseProviderView_ConfigEntry();
6647
- while (reader.pos < end) {
6648
- const tag = reader.uint32();
6649
- switch (tag >>> 3) {
6650
- case 1: {
6651
- if (tag !== 10) {
6652
- break;
6653
- }
6654
- message.key = reader.string();
6655
- continue;
6656
- }
6657
- case 2: {
6658
- if (tag !== 18) {
6659
- break;
6660
- }
6661
- message.value = reader.string();
6662
- continue;
6663
- }
6664
- }
6665
- if ((tag & 7) === 4 || tag === 0) {
6666
- break;
6667
- }
6668
- reader.skip(tag & 7);
6669
- }
6670
- return message;
6671
- },
6672
- fromJSON(object) {
6673
- return {
6674
- key: isSet3(object.key) ? globalThis.String(object.key) : "",
6675
- value: isSet3(object.value) ? globalThis.String(object.value) : ""
6676
- };
6677
- },
6678
- toJSON(message) {
6679
- const obj = {};
6680
- if (message.key !== "") {
6681
- obj.key = message.key;
6682
- }
6683
- if (message.value !== "") {
6684
- obj.value = message.value;
6685
- }
6686
- return obj;
6687
- },
6688
- create(base) {
6689
- return ProviderView_ConfigEntry.fromPartial(base ?? {});
6690
- },
6691
- fromPartial(object) {
6692
- const message = createBaseProviderView_ConfigEntry();
6693
- message.key = object.key ?? "";
6694
- message.value = object.value ?? "";
6695
- return message;
6696
- }
6697
- };
6698
- function createBaseLocalView() {
6699
- return { name: "", mode: "", value_display: "" };
6700
- }
6701
- var LocalView = {
6702
- encode(message, writer = new BinaryWriter3()) {
6703
- if (message.name !== "") {
6704
- writer.uint32(10).string(message.name);
6705
- }
6706
- if (message.mode !== "") {
6707
- writer.uint32(18).string(message.mode);
6708
- }
6709
- if (message.value_display !== "") {
6710
- writer.uint32(26).string(message.value_display);
6711
- }
6712
- return writer;
6713
- },
6714
- decode(input, length) {
6715
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6716
- const end = length === void 0 ? reader.len : reader.pos + length;
6717
- const message = createBaseLocalView();
6718
- while (reader.pos < end) {
6719
- const tag = reader.uint32();
6720
- switch (tag >>> 3) {
6721
- case 1: {
6722
- if (tag !== 10) {
6723
- break;
6724
- }
6725
- message.name = reader.string();
6726
- continue;
6727
- }
6728
- case 2: {
6729
- if (tag !== 18) {
6730
- break;
6731
- }
6732
- message.mode = reader.string();
6733
- continue;
6734
- }
6735
- case 3: {
6736
- if (tag !== 26) {
6737
- break;
6738
- }
6739
- message.value_display = reader.string();
6740
- continue;
6741
- }
6742
- }
6743
- if ((tag & 7) === 4 || tag === 0) {
6744
- break;
6745
- }
6746
- reader.skip(tag & 7);
6747
- }
6748
- return message;
6749
- },
6750
- fromJSON(object) {
6751
- return {
6752
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
6753
- mode: isSet3(object.mode) ? globalThis.String(object.mode) : "",
6754
- value_display: isSet3(object.valueDisplay) ? globalThis.String(object.valueDisplay) : isSet3(object.value_display) ? globalThis.String(object.value_display) : ""
6755
- };
6756
- },
6757
- toJSON(message) {
6758
- const obj = {};
6759
- if (message.name !== "") {
6760
- obj.name = message.name;
6761
- }
6762
- if (message.mode !== "") {
6763
- obj.mode = message.mode;
6764
- }
6765
- if (message.value_display !== "") {
6766
- obj.valueDisplay = message.value_display;
6767
- }
6768
- return obj;
6769
- },
6770
- create(base) {
6771
- return LocalView.fromPartial(base ?? {});
6772
- },
6773
- fromPartial(object) {
6774
- const message = createBaseLocalView();
6775
- message.name = object.name ?? "";
6776
- message.mode = object.mode ?? "";
6777
- message.value_display = object.value_display ?? "";
6778
- return message;
6779
- }
6780
- };
6781
- function createBaseRenderError() {
6782
- return { instance_id: "", input_name: "", message: "" };
6783
- }
6784
- var RenderError = {
6785
- encode(message, writer = new BinaryWriter3()) {
6786
- if (message.instance_id !== "") {
6787
- writer.uint32(10).string(message.instance_id);
6788
- }
6789
- if (message.input_name !== "") {
6790
- writer.uint32(18).string(message.input_name);
6791
- }
6792
- if (message.message !== "") {
6793
- writer.uint32(26).string(message.message);
6794
- }
6795
- return writer;
6796
- },
6797
- decode(input, length) {
6798
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6799
- const end = length === void 0 ? reader.len : reader.pos + length;
6800
- const message = createBaseRenderError();
6801
- while (reader.pos < end) {
6802
- const tag = reader.uint32();
6803
- switch (tag >>> 3) {
6804
- case 1: {
6805
- if (tag !== 10) {
6806
- break;
6807
- }
6808
- message.instance_id = reader.string();
6809
- continue;
6810
- }
6811
- case 2: {
6812
- if (tag !== 18) {
6813
- break;
6814
- }
6815
- message.input_name = reader.string();
6816
- continue;
6817
- }
6818
- case 3: {
6819
- if (tag !== 26) {
6820
- break;
6821
- }
6822
- message.message = reader.string();
6823
- continue;
6824
- }
6825
- }
6826
- if ((tag & 7) === 4 || tag === 0) {
6827
- break;
6828
- }
6829
- reader.skip(tag & 7);
6830
- }
6831
- return message;
6832
- },
6833
- fromJSON(object) {
6834
- return {
6835
- instance_id: isSet3(object.instanceId) ? globalThis.String(object.instanceId) : isSet3(object.instance_id) ? globalThis.String(object.instance_id) : "",
6836
- input_name: isSet3(object.inputName) ? globalThis.String(object.inputName) : isSet3(object.input_name) ? globalThis.String(object.input_name) : "",
6837
- message: isSet3(object.message) ? globalThis.String(object.message) : ""
6838
- };
6839
- },
6840
- toJSON(message) {
6841
- const obj = {};
6842
- if (message.instance_id !== "") {
6843
- obj.instanceId = message.instance_id;
6844
- }
6845
- if (message.input_name !== "") {
6846
- obj.inputName = message.input_name;
6847
- }
6848
- if (message.message !== "") {
6849
- obj.message = message.message;
6850
- }
6851
- return obj;
6852
- },
6853
- create(base) {
6854
- return RenderError.fromPartial(base ?? {});
6855
- },
6856
- fromPartial(object) {
6857
- const message = createBaseRenderError();
6858
- message.instance_id = object.instance_id ?? "";
6859
- message.input_name = object.input_name ?? "";
6860
- message.message = object.message ?? "";
6861
- return message;
6862
- }
6863
- };
6864
- function createBasePosition() {
6865
- return { x: 0, y: 0 };
6866
- }
6867
- var Position = {
6868
- encode(message, writer = new BinaryWriter3()) {
6869
- if (message.x !== 0) {
6870
- writer.uint32(9).double(message.x);
6871
- }
6872
- if (message.y !== 0) {
6873
- writer.uint32(17).double(message.y);
6874
- }
6875
- return writer;
6876
- },
6877
- decode(input, length) {
6878
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6879
- const end = length === void 0 ? reader.len : reader.pos + length;
6880
- const message = createBasePosition();
6881
- while (reader.pos < end) {
6882
- const tag = reader.uint32();
6883
- switch (tag >>> 3) {
6884
- case 1: {
6885
- if (tag !== 9) {
6886
- break;
6887
- }
6888
- message.x = reader.double();
6889
- continue;
6890
- }
6891
- case 2: {
6892
- if (tag !== 17) {
6893
- break;
6894
- }
6895
- message.y = reader.double();
6896
- continue;
6897
- }
6898
- }
6899
- if ((tag & 7) === 4 || tag === 0) {
6900
- break;
6901
- }
6902
- reader.skip(tag & 7);
6903
- }
6904
- return message;
6905
- },
6906
- fromJSON(object) {
6907
- return {
6908
- x: isSet3(object.x) ? globalThis.Number(object.x) : 0,
6909
- y: isSet3(object.y) ? globalThis.Number(object.y) : 0
6910
- };
6911
- },
6912
- toJSON(message) {
6913
- const obj = {};
6914
- if (message.x !== 0) {
6915
- obj.x = message.x;
6916
- }
6917
- if (message.y !== 0) {
6918
- obj.y = message.y;
6919
- }
6920
- return obj;
6921
- },
6922
- create(base) {
6923
- return Position.fromPartial(base ?? {});
6924
- },
6925
- fromPartial(object) {
6926
- const message = createBasePosition();
6927
- message.x = object.x ?? 0;
6928
- message.y = object.y ?? 0;
6929
- return message;
6930
- }
6931
- };
6932
- function createBaseInputDef2() {
6933
- return {
6934
- name: "",
6935
- type: "",
6936
- required: false,
6937
- description: "",
6938
- default_value: void 0,
6939
- validation: [],
6940
- ephemeral: void 0,
6941
- nullable: void 0,
6942
- sensitive: false
6943
- };
6944
- }
6945
- var InputDef2 = {
6946
- encode(message, writer = new BinaryWriter3()) {
6947
- if (message.name !== "") {
6948
- writer.uint32(10).string(message.name);
6949
- }
6950
- if (message.type !== "") {
6951
- writer.uint32(18).string(message.type);
6952
- }
6953
- if (message.required !== false) {
6954
- writer.uint32(24).bool(message.required);
6955
- }
6956
- if (message.description !== "") {
6957
- writer.uint32(34).string(message.description);
6958
- }
6959
- if (message.default_value !== void 0) {
6960
- Value.encode(Value.wrap(message.default_value), writer.uint32(42).fork()).join();
6961
- }
6962
- for (const v of message.validation) {
6963
- ValidationBlock2.encode(v, writer.uint32(50).fork()).join();
6964
- }
6965
- if (message.ephemeral !== void 0) {
6966
- writer.uint32(56).bool(message.ephemeral);
6967
- }
6968
- if (message.nullable !== void 0) {
6969
- writer.uint32(64).bool(message.nullable);
6970
- }
6971
- if (message.sensitive !== false) {
6972
- writer.uint32(72).bool(message.sensitive);
6973
- }
6974
- return writer;
6975
- },
6976
- decode(input, length) {
6977
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6978
- const end = length === void 0 ? reader.len : reader.pos + length;
6979
- const message = createBaseInputDef2();
6980
- while (reader.pos < end) {
6981
- const tag = reader.uint32();
6982
- switch (tag >>> 3) {
6983
- case 1: {
6984
- if (tag !== 10) {
6985
- break;
6986
- }
6987
- message.name = reader.string();
6988
- continue;
6989
- }
6990
- case 2: {
6991
- if (tag !== 18) {
6992
- break;
6993
- }
6994
- message.type = reader.string();
6995
- continue;
6996
- }
6997
- case 3: {
6998
- if (tag !== 24) {
6999
- break;
7000
- }
7001
- message.required = reader.bool();
7002
- continue;
7003
- }
7004
- case 4: {
7005
- if (tag !== 34) {
7006
- break;
7007
- }
7008
- message.description = reader.string();
7009
- continue;
7010
- }
7011
- case 5: {
7012
- if (tag !== 42) {
7013
- break;
7014
- }
7015
- message.default_value = Value.unwrap(Value.decode(reader, reader.uint32()));
7016
- continue;
7017
- }
7018
- case 6: {
7019
- if (tag !== 50) {
7020
- break;
7021
- }
7022
- message.validation.push(ValidationBlock2.decode(reader, reader.uint32()));
7023
- continue;
7024
- }
7025
- case 7: {
7026
- if (tag !== 56) {
7027
- break;
7028
- }
7029
- message.ephemeral = reader.bool();
7030
- continue;
7031
- }
7032
- case 8: {
7033
- if (tag !== 64) {
7034
- break;
7035
- }
7036
- message.nullable = reader.bool();
7037
- continue;
7038
- }
7039
- case 9: {
7040
- if (tag !== 72) {
7041
- break;
7042
- }
7043
- message.sensitive = reader.bool();
7044
- continue;
7045
- }
7046
- }
7047
- if ((tag & 7) === 4 || tag === 0) {
7048
- break;
7049
- }
7050
- reader.skip(tag & 7);
7051
- }
7052
- return message;
7053
- },
7054
- fromJSON(object) {
7055
- return {
7056
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
7057
- type: isSet3(object.type) ? globalThis.String(object.type) : "",
7058
- required: isSet3(object.required) ? globalThis.Boolean(object.required) : false,
7059
- description: isSet3(object.description) ? globalThis.String(object.description) : "",
7060
- default_value: isSet3(object?.defaultValue) ? object.defaultValue : isSet3(object?.default_value) ? object.default_value : void 0,
7061
- validation: globalThis.Array.isArray(object?.validation) ? object.validation.map((e) => ValidationBlock2.fromJSON(e)) : [],
7062
- ephemeral: isSet3(object.ephemeral) ? globalThis.Boolean(object.ephemeral) : void 0,
7063
- nullable: isSet3(object.nullable) ? globalThis.Boolean(object.nullable) : void 0,
7064
- sensitive: isSet3(object.sensitive) ? globalThis.Boolean(object.sensitive) : false
7065
- };
7066
- },
7067
- toJSON(message) {
7068
- const obj = {};
7069
- if (message.name !== "") {
7070
- obj.name = message.name;
7071
- }
7072
- if (message.type !== "") {
7073
- obj.type = message.type;
7074
- }
7075
- if (message.required !== false) {
7076
- obj.required = message.required;
7077
- }
7078
- if (message.description !== "") {
7079
- obj.description = message.description;
7080
- }
7081
- if (message.default_value !== void 0) {
7082
- obj.defaultValue = message.default_value;
7083
- }
7084
- if (message.validation?.length) {
7085
- obj.validation = message.validation.map((e) => ValidationBlock2.toJSON(e));
7086
- }
7087
- if (message.ephemeral !== void 0) {
7088
- obj.ephemeral = message.ephemeral;
7089
- }
7090
- if (message.nullable !== void 0) {
7091
- obj.nullable = message.nullable;
7092
- }
7093
- if (message.sensitive !== false) {
7094
- obj.sensitive = message.sensitive;
7095
- }
7096
- return obj;
7097
- },
7098
- create(base) {
7099
- return InputDef2.fromPartial(base ?? {});
7100
- },
7101
- fromPartial(object) {
7102
- const message = createBaseInputDef2();
7103
- message.name = object.name ?? "";
7104
- message.type = object.type ?? "";
7105
- message.required = object.required ?? false;
7106
- message.description = object.description ?? "";
7107
- message.default_value = object.default_value ?? void 0;
7108
- message.validation = object.validation?.map((e) => ValidationBlock2.fromPartial(e)) || [];
7109
- message.ephemeral = object.ephemeral ?? void 0;
7110
- message.nullable = object.nullable ?? void 0;
7111
- message.sensitive = object.sensitive ?? false;
7112
- return message;
7113
- }
7114
- };
7115
- function createBaseValidationBlock2() {
7116
- return { condition: "", error_message: "" };
7117
- }
7118
- var ValidationBlock2 = {
7119
- encode(message, writer = new BinaryWriter3()) {
7120
- if (message.condition !== "") {
7121
- writer.uint32(10).string(message.condition);
7122
- }
7123
- if (message.error_message !== "") {
7124
- writer.uint32(18).string(message.error_message);
7125
- }
7126
- return writer;
7127
- },
7128
- decode(input, length) {
7129
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
7130
- const end = length === void 0 ? reader.len : reader.pos + length;
7131
- const message = createBaseValidationBlock2();
7132
- while (reader.pos < end) {
7133
- const tag = reader.uint32();
7134
- switch (tag >>> 3) {
7135
- case 1: {
7136
- if (tag !== 10) {
7137
- break;
7138
- }
7139
- message.condition = reader.string();
7140
- continue;
7141
- }
7142
- case 2: {
7143
- if (tag !== 18) {
7144
- break;
7145
- }
7146
- message.error_message = reader.string();
7147
- continue;
7148
- }
7149
- }
7150
- if ((tag & 7) === 4 || tag === 0) {
7151
- break;
7152
- }
7153
- reader.skip(tag & 7);
7154
- }
7155
- return message;
7156
- },
7157
- fromJSON(object) {
7158
- return {
7159
- condition: isSet3(object.condition) ? globalThis.String(object.condition) : "",
7160
- error_message: isSet3(object.errorMessage) ? globalThis.String(object.errorMessage) : isSet3(object.error_message) ? globalThis.String(object.error_message) : ""
7161
- };
7162
- },
7163
- toJSON(message) {
7164
- const obj = {};
7165
- if (message.condition !== "") {
7166
- obj.condition = message.condition;
7167
- }
7168
- if (message.error_message !== "") {
7169
- obj.errorMessage = message.error_message;
7170
- }
7171
- return obj;
7172
- },
7173
- create(base) {
7174
- return ValidationBlock2.fromPartial(base ?? {});
7175
- },
7176
- fromPartial(object) {
7177
- const message = createBaseValidationBlock2();
7178
- message.condition = object.condition ?? "";
7179
- message.error_message = object.error_message ?? "";
7180
- return message;
7181
- }
7182
- };
7183
- function createBaseOutputDef2() {
7184
- return { name: "", type: "", description: "", sensitive: false, depends_on: [] };
7185
- }
7186
- var OutputDef2 = {
7187
- encode(message, writer = new BinaryWriter3()) {
7188
- if (message.name !== "") {
7189
- writer.uint32(10).string(message.name);
7190
- }
7191
- if (message.type !== "") {
7192
- writer.uint32(18).string(message.type);
7193
- }
7194
- if (message.description !== "") {
7195
- writer.uint32(26).string(message.description);
7196
- }
7197
- if (message.sensitive !== false) {
7198
- writer.uint32(32).bool(message.sensitive);
7199
- }
7200
- for (const v of message.depends_on) {
7201
- writer.uint32(42).string(v);
7202
- }
7203
- return writer;
7204
- },
7205
- decode(input, length) {
7206
- const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
7207
- const end = length === void 0 ? reader.len : reader.pos + length;
7208
- const message = createBaseOutputDef2();
7209
- while (reader.pos < end) {
7210
- const tag = reader.uint32();
7211
- switch (tag >>> 3) {
7212
- case 1: {
7213
- if (tag !== 10) {
7214
- break;
7215
- }
7216
- message.name = reader.string();
7217
- continue;
7218
- }
7219
- case 2: {
7220
- if (tag !== 18) {
7221
- break;
7222
- }
7223
- message.type = reader.string();
7224
- continue;
7225
- }
7226
- case 3: {
7227
- if (tag !== 26) {
7228
- break;
7229
- }
7230
- message.description = reader.string();
7231
- continue;
7232
- }
7233
- case 4: {
7234
- if (tag !== 32) {
7235
- break;
7236
- }
7237
- message.sensitive = reader.bool();
7238
- continue;
7239
- }
7240
- case 5: {
7241
- if (tag !== 42) {
7242
- break;
7243
- }
7244
- message.depends_on.push(reader.string());
4711
+ message.y = reader.double();
7245
4712
  continue;
7246
4713
  }
7247
4714
  }
@@ -7254,75 +4721,48 @@ var OutputDef2 = {
7254
4721
  },
7255
4722
  fromJSON(object) {
7256
4723
  return {
7257
- name: isSet3(object.name) ? globalThis.String(object.name) : "",
7258
- type: isSet3(object.type) ? globalThis.String(object.type) : "",
7259
- description: isSet3(object.description) ? globalThis.String(object.description) : "",
7260
- sensitive: isSet3(object.sensitive) ? globalThis.Boolean(object.sensitive) : false,
7261
- depends_on: globalThis.Array.isArray(object?.dependsOn) ? object.dependsOn.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.depends_on) ? object.depends_on.map((e) => globalThis.String(e)) : []
4724
+ x: isSet3(object.x) ? globalThis.Number(object.x) : 0,
4725
+ y: isSet3(object.y) ? globalThis.Number(object.y) : 0
7262
4726
  };
7263
4727
  },
7264
4728
  toJSON(message) {
7265
4729
  const obj = {};
7266
- if (message.name !== "") {
7267
- obj.name = message.name;
7268
- }
7269
- if (message.type !== "") {
7270
- obj.type = message.type;
7271
- }
7272
- if (message.description !== "") {
7273
- obj.description = message.description;
7274
- }
7275
- if (message.sensitive !== false) {
7276
- obj.sensitive = message.sensitive;
4730
+ if (message.x !== 0) {
4731
+ obj.x = message.x;
7277
4732
  }
7278
- if (message.depends_on?.length) {
7279
- obj.dependsOn = message.depends_on;
4733
+ if (message.y !== 0) {
4734
+ obj.y = message.y;
7280
4735
  }
7281
4736
  return obj;
7282
4737
  },
7283
4738
  create(base) {
7284
- return OutputDef2.fromPartial(base ?? {});
4739
+ return Position.fromPartial(base ?? {});
7285
4740
  },
7286
4741
  fromPartial(object) {
7287
- const message = createBaseOutputDef2();
7288
- message.name = object.name ?? "";
7289
- message.type = object.type ?? "";
7290
- message.description = object.description ?? "";
7291
- message.sensitive = object.sensitive ?? false;
7292
- message.depends_on = object.depends_on?.map((e) => e) || [];
4742
+ const message = createBasePosition();
4743
+ message.x = object.x ?? 0;
4744
+ message.y = object.y ?? 0;
7293
4745
  return message;
7294
4746
  }
7295
4747
  };
7296
- function isObject3(value) {
7297
- return typeof value === "object" && value !== null;
7298
- }
7299
4748
  function isSet3(value) {
7300
4749
  return value !== null && value !== void 0;
7301
4750
  }
7302
4751
 
7303
4752
  // src/proto-messages.ts
7304
4753
  var CanvasViewProto = CanvasView;
7305
- var NodeConfigProto = NodeConfig;
7306
- var EdgeConfigProto = EdgeConfig;
7307
- var SettingsConfigProto = SettingsConfig;
7308
4754
  export {
4755
+ BRIDGE_METHODS,
7309
4756
  Bundle,
7310
4757
  CanvasViewProto,
7311
- EdgeConfigProto,
7312
- NodeConfigProto,
7313
- SettingsConfigProto,
7314
- convertCanvasView,
4758
+ EMPTY_BUNDLE,
4759
+ ENGINE_METHODS,
4760
+ ENGINE_STREAM_METHODS,
7315
4761
  convertDiagnostic,
7316
- convertDiagnosticSeverity,
7317
- convertEdgeConfig,
7318
- convertInputMode,
7319
- convertNodeConfig,
7320
- convertNodeKind,
7321
- convertRenderError,
7322
- convertRenderInput,
7323
- convertRenderNode,
7324
- convertSettingsConfig,
7325
- modeToInputMode,
4762
+ deriveNodeConfig,
4763
+ deriveSettingsConfig,
4764
+ nodeIdForAddress,
4765
+ nodeIdForDiagnostic,
7326
4766
  parseModuleKey,
7327
4767
  projectCanvasView,
7328
4768
  resolveScopePath,