@aggrega-ai/aggrega-abi 0.0.0-stage → 0.9.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.
Files changed (41) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +23 -2
  3. package/dist/abi_version_enums_gen.d.ts +1 -0
  4. package/dist/abi_version_enums_gen.js +33 -0
  5. package/dist/annotationtransform_gen.d.ts +56 -0
  6. package/dist/annotationtransform_gen.js +385 -0
  7. package/dist/cbor_gen.d.ts +28 -0
  8. package/dist/cbor_gen.js +413 -0
  9. package/dist/cli_gen.d.ts +11 -0
  10. package/dist/cli_gen.js +75 -0
  11. package/dist/describe_gen.d.ts +165 -0
  12. package/dist/describe_gen.js +1154 -0
  13. package/dist/diagnostic_enums_gen.d.ts +3 -0
  14. package/dist/diagnostic_enums_gen.js +27 -0
  15. package/dist/diagnostic_gen.d.ts +45 -0
  16. package/dist/diagnostic_gen.js +309 -0
  17. package/dist/frp_gen.d.ts +97 -0
  18. package/dist/frp_gen.js +731 -0
  19. package/dist/hostfunc_error_enums_gen.d.ts +13 -0
  20. package/dist/hostfunc_error_enums_gen.js +35 -0
  21. package/dist/import_gen.d.ts +159 -0
  22. package/dist/import_gen.js +1050 -0
  23. package/dist/index.d.ts +33 -0
  24. package/dist/index.js +51 -0
  25. package/dist/ir_gen.d.ts +180 -0
  26. package/dist/ir_gen.js +1640 -0
  27. package/dist/linter_gen.d.ts +45 -0
  28. package/dist/linter_gen.js +374 -0
  29. package/dist/mutator_gen.d.ts +64 -0
  30. package/dist/mutator_gen.js +448 -0
  31. package/dist/orderedmap_gen.d.ts +5 -0
  32. package/dist/orderedmap_gen.js +186 -0
  33. package/dist/parse_gen.d.ts +60 -0
  34. package/dist/parse_gen.js +364 -0
  35. package/dist/policy_gen.d.ts +69 -0
  36. package/dist/policy_gen.js +461 -0
  37. package/dist/providerrender_gen.d.ts +495 -0
  38. package/dist/providerrender_gen.js +3756 -0
  39. package/dist/servewire_gen.d.ts +1643 -0
  40. package/dist/servewire_gen.js +3035 -0
  41. package/package.json +30 -4
@@ -0,0 +1,3756 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Copyright 2026 Cognitio s.r.l.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.encodeRenderNodeInput = encodeRenderNodeInput;
6
+ exports.decodeRenderNodeInput = decodeRenderNodeInput;
7
+ exports.encodeIRNodeProjection = encodeIRNodeProjection;
8
+ exports.decodeIRNodeProjection = decodeIRNodeProjection;
9
+ exports.encodeNodeProvenance = encodeNodeProvenance;
10
+ exports.decodeNodeProvenance = decodeNodeProvenance;
11
+ exports.encodeRenderNodeOutput = encodeRenderNodeOutput;
12
+ exports.decodeRenderNodeOutput = decodeRenderNodeOutput;
13
+ exports.encodeValidateNodeOutput = encodeValidateNodeOutput;
14
+ exports.decodeValidateNodeOutput = decodeValidateNodeOutput;
15
+ exports.encodeRenderedFile = encodeRenderedFile;
16
+ exports.decodeRenderedFile = decodeRenderedFile;
17
+ exports.encodeRenderFact = encodeRenderFact;
18
+ exports.decodeRenderFact = decodeRenderFact;
19
+ exports.encodeOmitEntry = encodeOmitEntry;
20
+ exports.decodeOmitEntry = decodeOmitEntry;
21
+ exports.encodeSourceFile = encodeSourceFile;
22
+ exports.decodeSourceFile = decodeSourceFile;
23
+ exports.encodeSourceProjection = encodeSourceProjection;
24
+ exports.decodeSourceProjection = decodeSourceProjection;
25
+ exports.encodeSourceEntry = encodeSourceEntry;
26
+ exports.decodeSourceEntry = decodeSourceEntry;
27
+ exports.encodeSourceListing = encodeSourceListing;
28
+ exports.decodeSourceListing = decodeSourceListing;
29
+ exports.encodeSourcePackRequest = encodeSourcePackRequest;
30
+ exports.decodeSourcePackRequest = decodeSourcePackRequest;
31
+ exports.encodeSourcePackResponse = encodeSourcePackResponse;
32
+ exports.decodeSourcePackResponse = decodeSourcePackResponse;
33
+ exports.encodeSourceFileRequest = encodeSourceFileRequest;
34
+ exports.decodeSourceFileRequest = decodeSourceFileRequest;
35
+ exports.encodeSourceFileResponse = encodeSourceFileResponse;
36
+ exports.decodeSourceFileResponse = decodeSourceFileResponse;
37
+ exports.encodeFetchExternalInputResponse = encodeFetchExternalInputResponse;
38
+ exports.decodeFetchExternalInputResponse = decodeFetchExternalInputResponse;
39
+ exports.encodeWorkloadProjection = encodeWorkloadProjection;
40
+ exports.decodeWorkloadProjection = decodeWorkloadProjection;
41
+ exports.encodeArtifactsProjection = encodeArtifactsProjection;
42
+ exports.decodeArtifactsProjection = decodeArtifactsProjection;
43
+ exports.encodeArtifactProjectionEntry = encodeArtifactProjectionEntry;
44
+ exports.decodeArtifactProjectionEntry = decodeArtifactProjectionEntry;
45
+ exports.encodeAssembleBoundaryInput = encodeAssembleBoundaryInput;
46
+ exports.decodeAssembleBoundaryInput = decodeAssembleBoundaryInput;
47
+ exports.encodeRenderedNode = encodeRenderedNode;
48
+ exports.decodeRenderedNode = decodeRenderedNode;
49
+ exports.encodeRenderEdge = encodeRenderEdge;
50
+ exports.decodeRenderEdge = decodeRenderEdge;
51
+ exports.encodeSubChart = encodeSubChart;
52
+ exports.decodeSubChart = decodeSubChart;
53
+ exports.encodeAssembleBoundaryOutput = encodeAssembleBoundaryOutput;
54
+ exports.decodeAssembleBoundaryOutput = decodeAssembleBoundaryOutput;
55
+ exports.encodeCarveInput = encodeCarveInput;
56
+ exports.decodeCarveInput = decodeCarveInput;
57
+ exports.encodeCarveOutput = encodeCarveOutput;
58
+ exports.decodeCarveOutput = decodeCarveOutput;
59
+ exports.encodeReassembleInput = encodeReassembleInput;
60
+ exports.decodeReassembleInput = decodeReassembleInput;
61
+ exports.encodeReassembleOutput = encodeReassembleOutput;
62
+ exports.decodeReassembleOutput = decodeReassembleOutput;
63
+ exports.encodeNameBoundInput = encodeNameBoundInput;
64
+ exports.decodeNameBoundInput = decodeNameBoundInput;
65
+ exports.encodeDerivedNameVerdict = encodeDerivedNameVerdict;
66
+ exports.decodeDerivedNameVerdict = decodeDerivedNameVerdict;
67
+ exports.encodeNameBoundOutput = encodeNameBoundOutput;
68
+ exports.decodeNameBoundOutput = decodeNameBoundOutput;
69
+ exports.encodeRenderedNameInput = encodeRenderedNameInput;
70
+ exports.decodeRenderedNameInput = decodeRenderedNameInput;
71
+ exports.encodeRenderedNameOutput = encodeRenderedNameOutput;
72
+ exports.decodeRenderedNameOutput = decodeRenderedNameOutput;
73
+ exports.encodeLinkEndpoint = encodeLinkEndpoint;
74
+ exports.decodeLinkEndpoint = decodeLinkEndpoint;
75
+ exports.encodeLinkEdge = encodeLinkEdge;
76
+ exports.decodeLinkEdge = decodeLinkEdge;
77
+ exports.encodeLinkPatch = encodeLinkPatch;
78
+ exports.decodeLinkPatch = decodeLinkPatch;
79
+ exports.encodeLinkPublishInput = encodeLinkPublishInput;
80
+ exports.decodeLinkPublishInput = decodeLinkPublishInput;
81
+ exports.encodeLinkPublishOutput = encodeLinkPublishOutput;
82
+ exports.decodeLinkPublishOutput = decodeLinkPublishOutput;
83
+ exports.encodeLinkResolveInput = encodeLinkResolveInput;
84
+ exports.decodeLinkResolveInput = decodeLinkResolveInput;
85
+ exports.encodeLinkResolveOutput = encodeLinkResolveOutput;
86
+ exports.decodeLinkResolveOutput = decodeLinkResolveOutput;
87
+ exports.encodeCBORRenderNodeInput = encodeCBORRenderNodeInput;
88
+ exports.appendCBORRenderNodeInput = appendCBORRenderNodeInput;
89
+ exports.decodeCBORRenderNodeInput = decodeCBORRenderNodeInput;
90
+ exports.decodeCBORRenderNodeInputFrom = decodeCBORRenderNodeInputFrom;
91
+ exports.encodeCBORIRNodeProjection = encodeCBORIRNodeProjection;
92
+ exports.appendCBORIRNodeProjection = appendCBORIRNodeProjection;
93
+ exports.decodeCBORIRNodeProjection = decodeCBORIRNodeProjection;
94
+ exports.decodeCBORIRNodeProjectionFrom = decodeCBORIRNodeProjectionFrom;
95
+ exports.encodeCBORNodeProvenance = encodeCBORNodeProvenance;
96
+ exports.appendCBORNodeProvenance = appendCBORNodeProvenance;
97
+ exports.decodeCBORNodeProvenance = decodeCBORNodeProvenance;
98
+ exports.decodeCBORNodeProvenanceFrom = decodeCBORNodeProvenanceFrom;
99
+ exports.encodeCBORRenderNodeOutput = encodeCBORRenderNodeOutput;
100
+ exports.appendCBORRenderNodeOutput = appendCBORRenderNodeOutput;
101
+ exports.decodeCBORRenderNodeOutput = decodeCBORRenderNodeOutput;
102
+ exports.decodeCBORRenderNodeOutputFrom = decodeCBORRenderNodeOutputFrom;
103
+ exports.encodeCBORValidateNodeOutput = encodeCBORValidateNodeOutput;
104
+ exports.appendCBORValidateNodeOutput = appendCBORValidateNodeOutput;
105
+ exports.decodeCBORValidateNodeOutput = decodeCBORValidateNodeOutput;
106
+ exports.decodeCBORValidateNodeOutputFrom = decodeCBORValidateNodeOutputFrom;
107
+ exports.encodeCBORRenderedFile = encodeCBORRenderedFile;
108
+ exports.appendCBORRenderedFile = appendCBORRenderedFile;
109
+ exports.decodeCBORRenderedFile = decodeCBORRenderedFile;
110
+ exports.decodeCBORRenderedFileFrom = decodeCBORRenderedFileFrom;
111
+ exports.encodeCBORRenderFact = encodeCBORRenderFact;
112
+ exports.appendCBORRenderFact = appendCBORRenderFact;
113
+ exports.decodeCBORRenderFact = decodeCBORRenderFact;
114
+ exports.decodeCBORRenderFactFrom = decodeCBORRenderFactFrom;
115
+ exports.encodeCBOROmitEntry = encodeCBOROmitEntry;
116
+ exports.appendCBOROmitEntry = appendCBOROmitEntry;
117
+ exports.decodeCBOROmitEntry = decodeCBOROmitEntry;
118
+ exports.decodeCBOROmitEntryFrom = decodeCBOROmitEntryFrom;
119
+ exports.encodeCBORSourceFile = encodeCBORSourceFile;
120
+ exports.appendCBORSourceFile = appendCBORSourceFile;
121
+ exports.decodeCBORSourceFile = decodeCBORSourceFile;
122
+ exports.decodeCBORSourceFileFrom = decodeCBORSourceFileFrom;
123
+ exports.encodeCBORSourceProjection = encodeCBORSourceProjection;
124
+ exports.appendCBORSourceProjection = appendCBORSourceProjection;
125
+ exports.decodeCBORSourceProjection = decodeCBORSourceProjection;
126
+ exports.decodeCBORSourceProjectionFrom = decodeCBORSourceProjectionFrom;
127
+ exports.encodeCBORSourceEntry = encodeCBORSourceEntry;
128
+ exports.appendCBORSourceEntry = appendCBORSourceEntry;
129
+ exports.decodeCBORSourceEntry = decodeCBORSourceEntry;
130
+ exports.decodeCBORSourceEntryFrom = decodeCBORSourceEntryFrom;
131
+ exports.encodeCBORSourceListing = encodeCBORSourceListing;
132
+ exports.appendCBORSourceListing = appendCBORSourceListing;
133
+ exports.decodeCBORSourceListing = decodeCBORSourceListing;
134
+ exports.decodeCBORSourceListingFrom = decodeCBORSourceListingFrom;
135
+ exports.encodeCBORSourcePackRequest = encodeCBORSourcePackRequest;
136
+ exports.appendCBORSourcePackRequest = appendCBORSourcePackRequest;
137
+ exports.decodeCBORSourcePackRequest = decodeCBORSourcePackRequest;
138
+ exports.decodeCBORSourcePackRequestFrom = decodeCBORSourcePackRequestFrom;
139
+ exports.encodeCBORSourcePackResponse = encodeCBORSourcePackResponse;
140
+ exports.appendCBORSourcePackResponse = appendCBORSourcePackResponse;
141
+ exports.decodeCBORSourcePackResponse = decodeCBORSourcePackResponse;
142
+ exports.decodeCBORSourcePackResponseFrom = decodeCBORSourcePackResponseFrom;
143
+ exports.encodeCBORSourceFileRequest = encodeCBORSourceFileRequest;
144
+ exports.appendCBORSourceFileRequest = appendCBORSourceFileRequest;
145
+ exports.decodeCBORSourceFileRequest = decodeCBORSourceFileRequest;
146
+ exports.decodeCBORSourceFileRequestFrom = decodeCBORSourceFileRequestFrom;
147
+ exports.encodeCBORSourceFileResponse = encodeCBORSourceFileResponse;
148
+ exports.appendCBORSourceFileResponse = appendCBORSourceFileResponse;
149
+ exports.decodeCBORSourceFileResponse = decodeCBORSourceFileResponse;
150
+ exports.decodeCBORSourceFileResponseFrom = decodeCBORSourceFileResponseFrom;
151
+ exports.encodeCBORFetchExternalInputResponse = encodeCBORFetchExternalInputResponse;
152
+ exports.appendCBORFetchExternalInputResponse = appendCBORFetchExternalInputResponse;
153
+ exports.decodeCBORFetchExternalInputResponse = decodeCBORFetchExternalInputResponse;
154
+ exports.decodeCBORFetchExternalInputResponseFrom = decodeCBORFetchExternalInputResponseFrom;
155
+ exports.encodeCBORWorkloadProjection = encodeCBORWorkloadProjection;
156
+ exports.appendCBORWorkloadProjection = appendCBORWorkloadProjection;
157
+ exports.decodeCBORWorkloadProjection = decodeCBORWorkloadProjection;
158
+ exports.decodeCBORWorkloadProjectionFrom = decodeCBORWorkloadProjectionFrom;
159
+ exports.encodeCBORArtifactsProjection = encodeCBORArtifactsProjection;
160
+ exports.appendCBORArtifactsProjection = appendCBORArtifactsProjection;
161
+ exports.decodeCBORArtifactsProjection = decodeCBORArtifactsProjection;
162
+ exports.decodeCBORArtifactsProjectionFrom = decodeCBORArtifactsProjectionFrom;
163
+ exports.encodeCBORArtifactProjectionEntry = encodeCBORArtifactProjectionEntry;
164
+ exports.appendCBORArtifactProjectionEntry = appendCBORArtifactProjectionEntry;
165
+ exports.decodeCBORArtifactProjectionEntry = decodeCBORArtifactProjectionEntry;
166
+ exports.decodeCBORArtifactProjectionEntryFrom = decodeCBORArtifactProjectionEntryFrom;
167
+ exports.encodeCBORAssembleBoundaryInput = encodeCBORAssembleBoundaryInput;
168
+ exports.appendCBORAssembleBoundaryInput = appendCBORAssembleBoundaryInput;
169
+ exports.decodeCBORAssembleBoundaryInput = decodeCBORAssembleBoundaryInput;
170
+ exports.decodeCBORAssembleBoundaryInputFrom = decodeCBORAssembleBoundaryInputFrom;
171
+ exports.encodeCBORRenderedNode = encodeCBORRenderedNode;
172
+ exports.appendCBORRenderedNode = appendCBORRenderedNode;
173
+ exports.decodeCBORRenderedNode = decodeCBORRenderedNode;
174
+ exports.decodeCBORRenderedNodeFrom = decodeCBORRenderedNodeFrom;
175
+ exports.encodeCBORRenderEdge = encodeCBORRenderEdge;
176
+ exports.appendCBORRenderEdge = appendCBORRenderEdge;
177
+ exports.decodeCBORRenderEdge = decodeCBORRenderEdge;
178
+ exports.decodeCBORRenderEdgeFrom = decodeCBORRenderEdgeFrom;
179
+ exports.encodeCBORSubChart = encodeCBORSubChart;
180
+ exports.appendCBORSubChart = appendCBORSubChart;
181
+ exports.decodeCBORSubChart = decodeCBORSubChart;
182
+ exports.decodeCBORSubChartFrom = decodeCBORSubChartFrom;
183
+ exports.encodeCBORAssembleBoundaryOutput = encodeCBORAssembleBoundaryOutput;
184
+ exports.appendCBORAssembleBoundaryOutput = appendCBORAssembleBoundaryOutput;
185
+ exports.decodeCBORAssembleBoundaryOutput = decodeCBORAssembleBoundaryOutput;
186
+ exports.decodeCBORAssembleBoundaryOutputFrom = decodeCBORAssembleBoundaryOutputFrom;
187
+ exports.encodeCBORCarveInput = encodeCBORCarveInput;
188
+ exports.appendCBORCarveInput = appendCBORCarveInput;
189
+ exports.decodeCBORCarveInput = decodeCBORCarveInput;
190
+ exports.decodeCBORCarveInputFrom = decodeCBORCarveInputFrom;
191
+ exports.encodeCBORCarveOutput = encodeCBORCarveOutput;
192
+ exports.appendCBORCarveOutput = appendCBORCarveOutput;
193
+ exports.decodeCBORCarveOutput = decodeCBORCarveOutput;
194
+ exports.decodeCBORCarveOutputFrom = decodeCBORCarveOutputFrom;
195
+ exports.encodeCBORReassembleInput = encodeCBORReassembleInput;
196
+ exports.appendCBORReassembleInput = appendCBORReassembleInput;
197
+ exports.decodeCBORReassembleInput = decodeCBORReassembleInput;
198
+ exports.decodeCBORReassembleInputFrom = decodeCBORReassembleInputFrom;
199
+ exports.encodeCBORReassembleOutput = encodeCBORReassembleOutput;
200
+ exports.appendCBORReassembleOutput = appendCBORReassembleOutput;
201
+ exports.decodeCBORReassembleOutput = decodeCBORReassembleOutput;
202
+ exports.decodeCBORReassembleOutputFrom = decodeCBORReassembleOutputFrom;
203
+ exports.encodeCBORNameBoundInput = encodeCBORNameBoundInput;
204
+ exports.appendCBORNameBoundInput = appendCBORNameBoundInput;
205
+ exports.decodeCBORNameBoundInput = decodeCBORNameBoundInput;
206
+ exports.decodeCBORNameBoundInputFrom = decodeCBORNameBoundInputFrom;
207
+ exports.encodeCBORDerivedNameVerdict = encodeCBORDerivedNameVerdict;
208
+ exports.appendCBORDerivedNameVerdict = appendCBORDerivedNameVerdict;
209
+ exports.decodeCBORDerivedNameVerdict = decodeCBORDerivedNameVerdict;
210
+ exports.decodeCBORDerivedNameVerdictFrom = decodeCBORDerivedNameVerdictFrom;
211
+ exports.encodeCBORNameBoundOutput = encodeCBORNameBoundOutput;
212
+ exports.appendCBORNameBoundOutput = appendCBORNameBoundOutput;
213
+ exports.decodeCBORNameBoundOutput = decodeCBORNameBoundOutput;
214
+ exports.decodeCBORNameBoundOutputFrom = decodeCBORNameBoundOutputFrom;
215
+ exports.encodeCBORRenderedNameInput = encodeCBORRenderedNameInput;
216
+ exports.appendCBORRenderedNameInput = appendCBORRenderedNameInput;
217
+ exports.decodeCBORRenderedNameInput = decodeCBORRenderedNameInput;
218
+ exports.decodeCBORRenderedNameInputFrom = decodeCBORRenderedNameInputFrom;
219
+ exports.encodeCBORRenderedNameOutput = encodeCBORRenderedNameOutput;
220
+ exports.appendCBORRenderedNameOutput = appendCBORRenderedNameOutput;
221
+ exports.decodeCBORRenderedNameOutput = decodeCBORRenderedNameOutput;
222
+ exports.decodeCBORRenderedNameOutputFrom = decodeCBORRenderedNameOutputFrom;
223
+ exports.encodeCBORLinkEndpoint = encodeCBORLinkEndpoint;
224
+ exports.appendCBORLinkEndpoint = appendCBORLinkEndpoint;
225
+ exports.decodeCBORLinkEndpoint = decodeCBORLinkEndpoint;
226
+ exports.decodeCBORLinkEndpointFrom = decodeCBORLinkEndpointFrom;
227
+ exports.encodeCBORLinkEdge = encodeCBORLinkEdge;
228
+ exports.appendCBORLinkEdge = appendCBORLinkEdge;
229
+ exports.decodeCBORLinkEdge = decodeCBORLinkEdge;
230
+ exports.decodeCBORLinkEdgeFrom = decodeCBORLinkEdgeFrom;
231
+ exports.encodeCBORLinkPatch = encodeCBORLinkPatch;
232
+ exports.appendCBORLinkPatch = appendCBORLinkPatch;
233
+ exports.decodeCBORLinkPatch = decodeCBORLinkPatch;
234
+ exports.decodeCBORLinkPatchFrom = decodeCBORLinkPatchFrom;
235
+ exports.encodeCBORLinkPublishInput = encodeCBORLinkPublishInput;
236
+ exports.appendCBORLinkPublishInput = appendCBORLinkPublishInput;
237
+ exports.decodeCBORLinkPublishInput = decodeCBORLinkPublishInput;
238
+ exports.decodeCBORLinkPublishInputFrom = decodeCBORLinkPublishInputFrom;
239
+ exports.encodeCBORLinkPublishOutput = encodeCBORLinkPublishOutput;
240
+ exports.appendCBORLinkPublishOutput = appendCBORLinkPublishOutput;
241
+ exports.decodeCBORLinkPublishOutput = decodeCBORLinkPublishOutput;
242
+ exports.decodeCBORLinkPublishOutputFrom = decodeCBORLinkPublishOutputFrom;
243
+ exports.encodeCBORLinkResolveInput = encodeCBORLinkResolveInput;
244
+ exports.appendCBORLinkResolveInput = appendCBORLinkResolveInput;
245
+ exports.decodeCBORLinkResolveInput = decodeCBORLinkResolveInput;
246
+ exports.decodeCBORLinkResolveInputFrom = decodeCBORLinkResolveInputFrom;
247
+ exports.encodeCBORLinkResolveOutput = encodeCBORLinkResolveOutput;
248
+ exports.appendCBORLinkResolveOutput = appendCBORLinkResolveOutput;
249
+ exports.decodeCBORLinkResolveOutput = decodeCBORLinkResolveOutput;
250
+ exports.decodeCBORLinkResolveOutputFrom = decodeCBORLinkResolveOutputFrom;
251
+ // Code generated by internal/tools/typegen from
252
+ // aggrega-schemas/json/wasm-provider-v1beta1.schema.json. DO NOT EDIT.
253
+ // Regenerate with `go generate ./internal/tools/typegen` from the
254
+ // aggrega-cli checkout.
255
+ const diagnostic_gen_ts_1 = require("./diagnostic_gen.js");
256
+ const orderedmap_gen_ts_1 = require("./orderedmap_gen.js");
257
+ const cbor_gen_ts_1 = require("./cbor_gen.js");
258
+ const diagnostic_gen_ts_2 = require("./diagnostic_gen.js");
259
+ function jstr(s) {
260
+ return JSON.stringify(s);
261
+ }
262
+ // encodeOpaque carries an opaque (`any` / RawMessage) value VERBATIM: the
263
+ // key order from JSON.parse is preserved, matching the Go and Rust codecs'
264
+ // byte-carry of opaque values. Opaque values are never sorted.
265
+ function encodeOpaque(v) {
266
+ return JSON.stringify(v);
267
+ }
268
+ function encodeRenderNodeInput(v) {
269
+ const parts = [];
270
+ parts.push(`${jstr("node")}:${encodeIRNodeProjection(v.node)}`);
271
+ parts.push(`${jstr("context")}:${encodeOpaque(v.context)}`);
272
+ if (v.source_listing !== undefined && v.source_listing !== null)
273
+ parts.push(`${jstr("source_listing")}:${encodeSourceListing(v.source_listing)}`);
274
+ if (v.workload_projection !== undefined && v.workload_projection !== null)
275
+ parts.push(`${jstr("workload_projection")}:${encodeWorkloadProjection(v.workload_projection)}`);
276
+ if (v.artifacts_projection !== undefined && v.artifacts_projection !== null)
277
+ parts.push(`${jstr("artifacts_projection")}:${encodeArtifactsProjection(v.artifacts_projection)}`);
278
+ if (v.omits !== undefined && v.omits.length > 0)
279
+ parts.push(`${jstr("omits")}:${`[${v.omits.map((e0) => encodeOmitEntry(e0)).join(",")}]`}`);
280
+ return `{${parts.join(",")}}`;
281
+ }
282
+ function decodeRenderNodeInput(data) {
283
+ const o = {};
284
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
285
+ switch (k) {
286
+ case "node":
287
+ o["node"] = decodeIRNodeProjection(raw);
288
+ break;
289
+ case "context":
290
+ o["context"] = JSON.parse(raw);
291
+ break;
292
+ case "source_listing":
293
+ o["source_listing"] = JSON.parse(raw);
294
+ break;
295
+ case "workload_projection":
296
+ o["workload_projection"] = (raw === "null" ? null : decodeWorkloadProjection(raw));
297
+ break;
298
+ case "artifacts_projection":
299
+ o["artifacts_projection"] = JSON.parse(raw);
300
+ break;
301
+ case "omits":
302
+ o["omits"] = JSON.parse(raw);
303
+ break;
304
+ }
305
+ });
306
+ return o;
307
+ }
308
+ function encodeIRNodeProjection(v) {
309
+ const parts = [];
310
+ parts.push(`${jstr("id")}:${jstr(v.id)}`);
311
+ parts.push(`${jstr("type")}:${jstr(v.type)}`);
312
+ parts.push(`${jstr("resolved_recipe")}:${jstr(v.resolved_recipe)}`);
313
+ if (v.values !== undefined && v.values.size > 0)
314
+ parts.push(`${jstr("values")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.values, (v0) => encodeOpaque(v0))}`);
315
+ if (v.features !== undefined && v.features.size > 0)
316
+ parts.push(`${jstr("features")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.features, (v0) => encodeOpaque(v0))}`);
317
+ if (v.sensitive_rendered_keys !== undefined && Object.keys(v.sensitive_rendered_keys).length > 0)
318
+ parts.push(`${jstr("sensitive_rendered_keys")}:${`{${Object.keys(v.sensitive_rendered_keys).sort().map((k0) => `${jstr(k0)}:${jstr(v.sensitive_rendered_keys[k0])}`).join(",")}}`}`);
319
+ if (v.sensitive_values !== undefined && v.sensitive_values !== false)
320
+ parts.push(`${jstr("sensitive_values")}:${String(v.sensitive_values)}`);
321
+ if (v.values_mapped !== undefined && v.values_mapped !== false)
322
+ parts.push(`${jstr("values_mapped")}:${String(v.values_mapped)}`);
323
+ if (v.uses !== undefined && v.uses.size > 0)
324
+ parts.push(`${jstr("uses")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.uses, (v0) => `[${v0.map((e1) => jstr(e1)).join(",")}]`)}`);
325
+ if (v.boundary_path !== undefined && v.boundary_path !== "")
326
+ parts.push(`${jstr("boundary_path")}:${jstr(v.boundary_path)}`);
327
+ if (v.sync_wave !== undefined && v.sync_wave !== 0)
328
+ parts.push(`${jstr("sync_wave")}:${String(v.sync_wave)}`);
329
+ if (v.recipe_name !== undefined && v.recipe_name !== "")
330
+ parts.push(`${jstr("recipe_name")}:${jstr(v.recipe_name)}`);
331
+ if (v.recipe_version !== undefined && v.recipe_version !== "")
332
+ parts.push(`${jstr("recipe_version")}:${jstr(v.recipe_version)}`);
333
+ if (v.label_component_id !== undefined && v.label_component_id !== "")
334
+ parts.push(`${jstr("label_component_id")}:${jstr(v.label_component_id)}`);
335
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "")
336
+ parts.push(`${jstr("derived_name_basis")}:${jstr(v.derived_name_basis)}`);
337
+ if (v.output_labels !== undefined && Object.keys(v.output_labels).length > 0)
338
+ parts.push(`${jstr("output_labels")}:${`{${Object.keys(v.output_labels).sort().map((k0) => `${jstr(k0)}:${jstr(v.output_labels[k0])}`).join(",")}}`}`);
339
+ parts.push(`${jstr("provenance")}:${encodeNodeProvenance(v.provenance)}`);
340
+ return `{${parts.join(",")}}`;
341
+ }
342
+ function decodeIRNodeProjection(data) {
343
+ const o = {};
344
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
345
+ switch (k) {
346
+ case "id":
347
+ o["id"] = JSON.parse(raw);
348
+ break;
349
+ case "type":
350
+ o["type"] = JSON.parse(raw);
351
+ break;
352
+ case "resolved_recipe":
353
+ o["resolved_recipe"] = JSON.parse(raw);
354
+ break;
355
+ case "values":
356
+ o["values"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
357
+ break;
358
+ case "features":
359
+ o["features"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
360
+ break;
361
+ case "sensitive_rendered_keys":
362
+ o["sensitive_rendered_keys"] = JSON.parse(raw);
363
+ break;
364
+ case "sensitive_values":
365
+ o["sensitive_values"] = JSON.parse(raw);
366
+ break;
367
+ case "values_mapped":
368
+ o["values_mapped"] = JSON.parse(raw);
369
+ break;
370
+ case "uses":
371
+ o["uses"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
372
+ break;
373
+ case "boundary_path":
374
+ o["boundary_path"] = JSON.parse(raw);
375
+ break;
376
+ case "sync_wave":
377
+ o["sync_wave"] = JSON.parse(raw);
378
+ break;
379
+ case "recipe_name":
380
+ o["recipe_name"] = JSON.parse(raw);
381
+ break;
382
+ case "recipe_version":
383
+ o["recipe_version"] = JSON.parse(raw);
384
+ break;
385
+ case "label_component_id":
386
+ o["label_component_id"] = JSON.parse(raw);
387
+ break;
388
+ case "derived_name_basis":
389
+ o["derived_name_basis"] = JSON.parse(raw);
390
+ break;
391
+ case "output_labels":
392
+ o["output_labels"] = JSON.parse(raw);
393
+ break;
394
+ case "provenance":
395
+ o["provenance"] = JSON.parse(raw);
396
+ break;
397
+ }
398
+ });
399
+ return o;
400
+ }
401
+ function encodeNodeProvenance(v) {
402
+ const parts = [];
403
+ if (v.compiler_version !== undefined && v.compiler_version !== "")
404
+ parts.push(`${jstr("compiler_version")}:${jstr(v.compiler_version)}`);
405
+ if (v.aggregate_name !== undefined && v.aggregate_name !== "")
406
+ parts.push(`${jstr("aggregate_name")}:${jstr(v.aggregate_name)}`);
407
+ if (v.environment !== undefined && v.environment !== "")
408
+ parts.push(`${jstr("environment")}:${jstr(v.environment)}`);
409
+ if (v.provider_name !== undefined && v.provider_name !== "")
410
+ parts.push(`${jstr("provider_name")}:${jstr(v.provider_name)}`);
411
+ if (v.provider_version !== undefined && v.provider_version !== "")
412
+ parts.push(`${jstr("provider_version")}:${jstr(v.provider_version)}`);
413
+ return `{${parts.join(",")}}`;
414
+ }
415
+ function decodeNodeProvenance(data) {
416
+ return JSON.parse(data);
417
+ }
418
+ function encodeRenderNodeOutput(v) {
419
+ const parts = [];
420
+ parts.push(`${jstr("files")}:${`[${v.files.map((e0) => encodeRenderedFile(e0)).join(",")}]`}`);
421
+ if (v.derived_keys !== undefined && v.derived_keys.size > 0)
422
+ parts.push(`${jstr("derived_keys")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.derived_keys, (v0) => `[${v0.map((e1) => jstr(e1)).join(",")}]`)}`);
423
+ if (v.render_facts !== undefined && v.render_facts.length > 0)
424
+ parts.push(`${jstr("render_facts")}:${`[${v.render_facts.map((e0) => encodeRenderFact(e0)).join(",")}]`}`);
425
+ if (v.omitted !== undefined && v.omitted.length > 0)
426
+ parts.push(`${jstr("omitted")}:${`[${v.omitted.map((e0) => String(e0)).join(",")}]`}`);
427
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0)
428
+ parts.push(`${jstr("diagnostics")}:${`[${v.diagnostics.map((e0) => (0, diagnostic_gen_ts_1.encodeDiagnostic)(e0)).join(",")}]`}`);
429
+ if (v.error !== undefined && v.error !== "")
430
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
431
+ if (v.condition_code !== undefined && v.condition_code !== "")
432
+ parts.push(`${jstr("condition_code")}:${jstr(v.condition_code)}`);
433
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
434
+ parts.push(`${jstr("condition_short_code")}:${jstr(v.condition_short_code)}`);
435
+ return `{${parts.join(",")}}`;
436
+ }
437
+ function decodeRenderNodeOutput(data) {
438
+ const o = {};
439
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
440
+ switch (k) {
441
+ case "files":
442
+ o["files"] = JSON.parse(raw);
443
+ break;
444
+ case "derived_keys":
445
+ o["derived_keys"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
446
+ break;
447
+ case "render_facts":
448
+ o["render_facts"] = JSON.parse(raw);
449
+ break;
450
+ case "omitted":
451
+ o["omitted"] = JSON.parse(raw);
452
+ break;
453
+ case "diagnostics":
454
+ o["diagnostics"] = JSON.parse(raw);
455
+ break;
456
+ case "error":
457
+ o["error"] = JSON.parse(raw);
458
+ break;
459
+ case "condition_code":
460
+ o["condition_code"] = JSON.parse(raw);
461
+ break;
462
+ case "condition_short_code":
463
+ o["condition_short_code"] = JSON.parse(raw);
464
+ break;
465
+ }
466
+ });
467
+ return o;
468
+ }
469
+ function encodeValidateNodeOutput(v) {
470
+ const parts = [];
471
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0)
472
+ parts.push(`${jstr("diagnostics")}:${`[${v.diagnostics.map((e0) => (0, diagnostic_gen_ts_1.encodeDiagnostic)(e0)).join(",")}]`}`);
473
+ if (v.error !== undefined && v.error !== "")
474
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
475
+ if (v.condition_code !== undefined && v.condition_code !== "")
476
+ parts.push(`${jstr("condition_code")}:${jstr(v.condition_code)}`);
477
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
478
+ parts.push(`${jstr("condition_short_code")}:${jstr(v.condition_short_code)}`);
479
+ return `{${parts.join(",")}}`;
480
+ }
481
+ function decodeValidateNodeOutput(data) {
482
+ return JSON.parse(data);
483
+ }
484
+ function encodeRenderedFile(v) {
485
+ const parts = [];
486
+ parts.push(`${jstr("path")}:${jstr(v.path)}`);
487
+ parts.push(`${jstr("content")}:${jstr(v.content)}`);
488
+ if (v.format !== undefined && v.format !== "")
489
+ parts.push(`${jstr("format")}:${jstr(v.format)}`);
490
+ return `{${parts.join(",")}}`;
491
+ }
492
+ function decodeRenderedFile(data) {
493
+ return JSON.parse(data);
494
+ }
495
+ function encodeRenderFact(v) {
496
+ const parts = [];
497
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
498
+ parts.push(`${jstr("value")}:${encodeOpaque(v.value)}`);
499
+ return `{${parts.join(",")}}`;
500
+ }
501
+ function decodeRenderFact(data) {
502
+ return JSON.parse(data);
503
+ }
504
+ function encodeOmitEntry(v) {
505
+ const parts = [];
506
+ parts.push(`${jstr("kind")}:${jstr(v.kind)}`);
507
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
508
+ if (v.namespace !== undefined && v.namespace !== "")
509
+ parts.push(`${jstr("namespace")}:${jstr(v.namespace)}`);
510
+ if (v.subchart !== undefined && v.subchart !== "")
511
+ parts.push(`${jstr("subchart")}:${jstr(v.subchart)}`);
512
+ if (v.sensitive !== undefined && v.sensitive !== false)
513
+ parts.push(`${jstr("sensitive")}:${String(v.sensitive)}`);
514
+ return `{${parts.join(",")}}`;
515
+ }
516
+ function decodeOmitEntry(data) {
517
+ return JSON.parse(data);
518
+ }
519
+ function encodeSourceFile(v) {
520
+ const parts = [];
521
+ parts.push(`${jstr("path")}:${jstr(v.path)}`);
522
+ parts.push(`${jstr("content")}:${jstr(v.content)}`);
523
+ return `{${parts.join(",")}}`;
524
+ }
525
+ function decodeSourceFile(data) {
526
+ return JSON.parse(data);
527
+ }
528
+ function encodeSourceProjection(v) {
529
+ const parts = [];
530
+ parts.push(`${jstr("files")}:${`[${v.files.map((e0) => encodeSourceFile(e0)).join(",")}]`}`);
531
+ return `{${parts.join(",")}}`;
532
+ }
533
+ function decodeSourceProjection(data) {
534
+ return JSON.parse(data);
535
+ }
536
+ function encodeSourceEntry(v) {
537
+ const parts = [];
538
+ parts.push(`${jstr("path")}:${jstr(v.path)}`);
539
+ parts.push(`${jstr("is_dir")}:${String(v.is_dir)}`);
540
+ return `{${parts.join(",")}}`;
541
+ }
542
+ function decodeSourceEntry(data) {
543
+ return JSON.parse(data);
544
+ }
545
+ function encodeSourceListing(v) {
546
+ const parts = [];
547
+ parts.push(`${jstr("root")}:${jstr(v.root)}`);
548
+ if (v.root_is_dir !== undefined && v.root_is_dir !== false)
549
+ parts.push(`${jstr("root_is_dir")}:${String(v.root_is_dir)}`);
550
+ parts.push(`${jstr("entries")}:${`[${v.entries.map((e0) => encodeSourceEntry(e0)).join(",")}]`}`);
551
+ return `{${parts.join(",")}}`;
552
+ }
553
+ function decodeSourceListing(data) {
554
+ return JSON.parse(data);
555
+ }
556
+ function encodeSourcePackRequest(v) {
557
+ const parts = [];
558
+ parts.push(`${jstr("op")}:${jstr(v.op)}`);
559
+ parts.push(`${jstr("path")}:${jstr(v.path)}`);
560
+ return `{${parts.join(",")}}`;
561
+ }
562
+ function decodeSourcePackRequest(data) {
563
+ return JSON.parse(data);
564
+ }
565
+ function encodeSourcePackResponse(v) {
566
+ const parts = [];
567
+ if (v.source_projection !== undefined && v.source_projection !== null)
568
+ parts.push(`${jstr("source_projection")}:${encodeSourceProjection(v.source_projection)}`);
569
+ if (v.error !== undefined && v.error !== "")
570
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
571
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "")
572
+ parts.push(`${jstr("hostfunc_error_code")}:${jstr(v.hostfunc_error_code)}`);
573
+ return `{${parts.join(",")}}`;
574
+ }
575
+ function decodeSourcePackResponse(data) {
576
+ return JSON.parse(data);
577
+ }
578
+ function encodeSourceFileRequest(v) {
579
+ const parts = [];
580
+ parts.push(`${jstr("path")}:${jstr(v.path)}`);
581
+ return `{${parts.join(",")}}`;
582
+ }
583
+ function decodeSourceFileRequest(data) {
584
+ return JSON.parse(data);
585
+ }
586
+ function encodeSourceFileResponse(v) {
587
+ const parts = [];
588
+ if (v.content !== undefined && v.content !== "")
589
+ parts.push(`${jstr("content")}:${jstr(v.content)}`);
590
+ if (v.error !== undefined && v.error !== "")
591
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
592
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "")
593
+ parts.push(`${jstr("hostfunc_error_code")}:${jstr(v.hostfunc_error_code)}`);
594
+ return `{${parts.join(",")}}`;
595
+ }
596
+ function decodeSourceFileResponse(data) {
597
+ return JSON.parse(data);
598
+ }
599
+ function encodeFetchExternalInputResponse(v) {
600
+ const parts = [];
601
+ if (v.content !== undefined && v.content !== "")
602
+ parts.push(`${jstr("content")}:${jstr(v.content)}`);
603
+ if (v.error !== undefined && v.error !== "")
604
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
605
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "")
606
+ parts.push(`${jstr("hostfunc_error_code")}:${jstr(v.hostfunc_error_code)}`);
607
+ return `{${parts.join(",")}}`;
608
+ }
609
+ function decodeFetchExternalInputResponse(data) {
610
+ return JSON.parse(data);
611
+ }
612
+ function encodeWorkloadProjection(v) {
613
+ const parts = [];
614
+ parts.push(`${jstr("workload")}:${encodeOpaque(v.workload)}`);
615
+ if (v.sensitive_workload !== undefined && v.sensitive_workload !== false)
616
+ parts.push(`${jstr("sensitive_workload")}:${String(v.sensitive_workload)}`);
617
+ if (v.attachment_provides !== undefined && Object.keys(v.attachment_provides).length > 0)
618
+ parts.push(`${jstr("attachment_provides")}:${`{${Object.keys(v.attachment_provides).sort().map((k0) => `${jstr(k0)}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.attachment_provides[k0], (v1) => jstr(v1))}`).join(",")}}`}`);
619
+ return `{${parts.join(",")}}`;
620
+ }
621
+ function decodeWorkloadProjection(data) {
622
+ const o = {};
623
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
624
+ switch (k) {
625
+ case "workload":
626
+ o["workload"] = JSON.parse(raw);
627
+ break;
628
+ case "sensitive_workload":
629
+ o["sensitive_workload"] = JSON.parse(raw);
630
+ break;
631
+ case "attachment_provides":
632
+ o["attachment_provides"] = (0, orderedmap_gen_ts_1.readPlainObject)(raw, (r0) => (0, orderedmap_gen_ts_1.readOrderedObject)(r0, (r1) => JSON.parse(r1)));
633
+ break;
634
+ }
635
+ });
636
+ return o;
637
+ }
638
+ function encodeArtifactsProjection(v) {
639
+ const parts = [];
640
+ parts.push(`${jstr("entries")}:${`[${v.entries.map((e0) => encodeArtifactProjectionEntry(e0)).join(",")}]`}`);
641
+ return `{${parts.join(",")}}`;
642
+ }
643
+ function decodeArtifactsProjection(data) {
644
+ return JSON.parse(data);
645
+ }
646
+ function encodeArtifactProjectionEntry(v) {
647
+ const parts = [];
648
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
649
+ parts.push(`${jstr("origin")}:${jstr(v.origin)}`);
650
+ parts.push(`${jstr("content")}:${jstr(v.content)}`);
651
+ if (v.sensitive_content !== undefined && v.sensitive_content !== false)
652
+ parts.push(`${jstr("sensitive_content")}:${String(v.sensitive_content)}`);
653
+ if (v.labels !== undefined && Object.keys(v.labels).length > 0)
654
+ parts.push(`${jstr("labels")}:${`{${Object.keys(v.labels).sort().map((k0) => `${jstr(k0)}:${jstr(v.labels[k0])}`).join(",")}}`}`);
655
+ if (v.annotations !== undefined && Object.keys(v.annotations).length > 0)
656
+ parts.push(`${jstr("annotations")}:${`{${Object.keys(v.annotations).sort().map((k0) => `${jstr(k0)}:${jstr(v.annotations[k0])}`).join(",")}}`}`);
657
+ return `{${parts.join(",")}}`;
658
+ }
659
+ function decodeArtifactProjectionEntry(data) {
660
+ return JSON.parse(data);
661
+ }
662
+ function encodeAssembleBoundaryInput(v) {
663
+ const parts = [];
664
+ parts.push(`${jstr("rendered_nodes")}:${`[${v.rendered_nodes.map((e0) => encodeRenderedNode(e0)).join(",")}]`}`);
665
+ parts.push(`${jstr("context")}:${encodeOpaque(v.context)}`);
666
+ parts.push(`${jstr("boundary_path")}:${jstr(v.boundary_path)}`);
667
+ if (v.edges !== undefined && v.edges.length > 0)
668
+ parts.push(`${jstr("edges")}:${`[${v.edges.map((e0) => encodeRenderEdge(e0)).join(",")}]`}`);
669
+ if (v.sub_charts !== undefined && v.sub_charts.length > 0)
670
+ parts.push(`${jstr("sub_charts")}:${`[${v.sub_charts.map((e0) => encodeSubChart(e0)).join(",")}]`}`);
671
+ if (v.chart_name !== undefined && v.chart_name !== "")
672
+ parts.push(`${jstr("chart_name")}:${jstr(v.chart_name)}`);
673
+ if (v.aggregate_name !== undefined && v.aggregate_name !== "")
674
+ parts.push(`${jstr("aggregate_name")}:${jstr(v.aggregate_name)}`);
675
+ return `{${parts.join(",")}}`;
676
+ }
677
+ function decodeAssembleBoundaryInput(data) {
678
+ const o = {};
679
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
680
+ switch (k) {
681
+ case "rendered_nodes":
682
+ o["rendered_nodes"] = (0, orderedmap_gen_ts_1.readJSONArray)(raw, (r0) => decodeRenderedNode(r0));
683
+ break;
684
+ case "context":
685
+ o["context"] = JSON.parse(raw);
686
+ break;
687
+ case "boundary_path":
688
+ o["boundary_path"] = JSON.parse(raw);
689
+ break;
690
+ case "edges":
691
+ o["edges"] = JSON.parse(raw);
692
+ break;
693
+ case "sub_charts":
694
+ o["sub_charts"] = (0, orderedmap_gen_ts_1.readJSONArray)(raw, (r0) => decodeSubChart(r0));
695
+ break;
696
+ case "chart_name":
697
+ o["chart_name"] = JSON.parse(raw);
698
+ break;
699
+ case "aggregate_name":
700
+ o["aggregate_name"] = JSON.parse(raw);
701
+ break;
702
+ }
703
+ });
704
+ return o;
705
+ }
706
+ function encodeRenderedNode(v) {
707
+ const parts = [];
708
+ parts.push(`${jstr("id")}:${jstr(v.id)}`);
709
+ parts.push(`${jstr("type")}:${jstr(v.type)}`);
710
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "")
711
+ parts.push(`${jstr("derived_name_basis")}:${jstr(v.derived_name_basis)}`);
712
+ if (v.output_directory !== undefined && v.output_directory !== "")
713
+ parts.push(`${jstr("output_directory")}:${jstr(v.output_directory)}`);
714
+ parts.push(`${jstr("rendered")}:${encodeRenderNodeOutput(v.rendered)}`);
715
+ if (v.annotations !== undefined && v.annotations.size > 0)
716
+ parts.push(`${jstr("annotations")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.annotations, (v0) => jstr(v0))}`);
717
+ if (v.sync_wave !== undefined && v.sync_wave !== 0)
718
+ parts.push(`${jstr("sync_wave")}:${String(v.sync_wave)}`);
719
+ if (v.values !== undefined && v.values.size > 0)
720
+ parts.push(`${jstr("values")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.values, (v0) => encodeOpaque(v0))}`);
721
+ if (v.values_mapped !== undefined && v.values_mapped !== false)
722
+ parts.push(`${jstr("values_mapped")}:${String(v.values_mapped)}`);
723
+ return `{${parts.join(",")}}`;
724
+ }
725
+ function decodeRenderedNode(data) {
726
+ const o = {};
727
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
728
+ switch (k) {
729
+ case "id":
730
+ o["id"] = JSON.parse(raw);
731
+ break;
732
+ case "type":
733
+ o["type"] = JSON.parse(raw);
734
+ break;
735
+ case "derived_name_basis":
736
+ o["derived_name_basis"] = JSON.parse(raw);
737
+ break;
738
+ case "output_directory":
739
+ o["output_directory"] = JSON.parse(raw);
740
+ break;
741
+ case "rendered":
742
+ o["rendered"] = decodeRenderNodeOutput(raw);
743
+ break;
744
+ case "annotations":
745
+ o["annotations"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
746
+ break;
747
+ case "sync_wave":
748
+ o["sync_wave"] = JSON.parse(raw);
749
+ break;
750
+ case "values":
751
+ o["values"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
752
+ break;
753
+ case "values_mapped":
754
+ o["values_mapped"] = JSON.parse(raw);
755
+ break;
756
+ }
757
+ });
758
+ return o;
759
+ }
760
+ function encodeRenderEdge(v) {
761
+ const parts = [];
762
+ parts.push(`${jstr("source")}:${jstr(v.source)}`);
763
+ parts.push(`${jstr("target")}:${jstr(v.target)}`);
764
+ return `{${parts.join(",")}}`;
765
+ }
766
+ function decodeRenderEdge(data) {
767
+ return JSON.parse(data);
768
+ }
769
+ function encodeSubChart(v) {
770
+ const parts = [];
771
+ parts.push(`${jstr("instance_id")}:${jstr(v.instance_id)}`);
772
+ if (v.version !== undefined && v.version !== "")
773
+ parts.push(`${jstr("version")}:${jstr(v.version)}`);
774
+ if (v.values !== undefined && v.values.size > 0)
775
+ parts.push(`${jstr("values")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.values, (v0) => encodeOpaque(v0))}`);
776
+ if (v.chart_yaml !== undefined && v.chart_yaml !== "")
777
+ parts.push(`${jstr("chart_yaml")}:${jstr(v.chart_yaml)}`);
778
+ return `{${parts.join(",")}}`;
779
+ }
780
+ function decodeSubChart(data) {
781
+ const o = {};
782
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
783
+ switch (k) {
784
+ case "instance_id":
785
+ o["instance_id"] = JSON.parse(raw);
786
+ break;
787
+ case "version":
788
+ o["version"] = JSON.parse(raw);
789
+ break;
790
+ case "values":
791
+ o["values"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
792
+ break;
793
+ case "chart_yaml":
794
+ o["chart_yaml"] = JSON.parse(raw);
795
+ break;
796
+ }
797
+ });
798
+ return o;
799
+ }
800
+ function encodeAssembleBoundaryOutput(v) {
801
+ const parts = [];
802
+ parts.push(`${jstr("files")}:${`[${v.files.map((e0) => encodeRenderedFile(e0)).join(",")}]`}`);
803
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0)
804
+ parts.push(`${jstr("diagnostics")}:${`[${v.diagnostics.map((e0) => (0, diagnostic_gen_ts_1.encodeDiagnostic)(e0)).join(",")}]`}`);
805
+ if (v.error !== undefined && v.error !== "")
806
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
807
+ if (v.condition_code !== undefined && v.condition_code !== "")
808
+ parts.push(`${jstr("condition_code")}:${jstr(v.condition_code)}`);
809
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
810
+ parts.push(`${jstr("condition_short_code")}:${jstr(v.condition_short_code)}`);
811
+ return `{${parts.join(",")}}`;
812
+ }
813
+ function decodeAssembleBoundaryOutput(data) {
814
+ return JSON.parse(data);
815
+ }
816
+ function encodeCarveInput(v) {
817
+ const parts = [];
818
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
819
+ parts.push(`${jstr("body")}:${jstr(v.body)}`);
820
+ if (v.yaml_indent !== undefined && v.yaml_indent !== 0)
821
+ parts.push(`${jstr("yaml_indent")}:${String(v.yaml_indent)}`);
822
+ return `{${parts.join(",")}}`;
823
+ }
824
+ function decodeCarveInput(data) {
825
+ return JSON.parse(data);
826
+ }
827
+ function encodeCarveOutput(v) {
828
+ const parts = [];
829
+ parts.push(`${jstr("units")}:${`[${v.units.map((e0) => encodeOpaque(e0)).join(",")}]`}`);
830
+ return `{${parts.join(",")}}`;
831
+ }
832
+ function decodeCarveOutput(data) {
833
+ return JSON.parse(data);
834
+ }
835
+ function encodeReassembleInput(v) {
836
+ const parts = [];
837
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
838
+ parts.push(`${jstr("body")}:${jstr(v.body)}`);
839
+ if (v.segs !== undefined && v.segs.length > 0)
840
+ parts.push(`${jstr("segs")}:${`[${v.segs.map((e0) => encodeOpaque(e0)).join(",")}]`}`);
841
+ if (v.patched !== undefined && v.patched.length > 0)
842
+ parts.push(`${jstr("patched")}:${`[${v.patched.map((e0) => encodeOpaque(e0)).join(",")}]`}`);
843
+ if (v.yaml_indent !== undefined && v.yaml_indent !== 0)
844
+ parts.push(`${jstr("yaml_indent")}:${String(v.yaml_indent)}`);
845
+ return `{${parts.join(",")}}`;
846
+ }
847
+ function decodeReassembleInput(data) {
848
+ return JSON.parse(data);
849
+ }
850
+ function encodeReassembleOutput(v) {
851
+ const parts = [];
852
+ parts.push(`${jstr("body")}:${jstr(v.body)}`);
853
+ return `{${parts.join(",")}}`;
854
+ }
855
+ function decodeReassembleOutput(data) {
856
+ return JSON.parse(data);
857
+ }
858
+ function encodeNameBoundInput(v) {
859
+ const parts = [];
860
+ parts.push(`${jstr("proposed")}:${jstr(v.proposed)}`);
861
+ if (v.authored !== undefined && v.authored !== false)
862
+ parts.push(`${jstr("authored")}:${String(v.authored)}`);
863
+ if (v.workload_form !== undefined && v.workload_form !== "")
864
+ parts.push(`${jstr("workload_form")}:${jstr(v.workload_form)}`);
865
+ if (v.service_keys !== undefined && v.service_keys.length > 0)
866
+ parts.push(`${jstr("service_keys")}:${`[${v.service_keys.map((e0) => jstr(e0)).join(",")}]`}`);
867
+ return `{${parts.join(",")}}`;
868
+ }
869
+ function decodeNameBoundInput(data) {
870
+ return JSON.parse(data);
871
+ }
872
+ function encodeDerivedNameVerdict(v) {
873
+ const parts = [];
874
+ parts.push(`${jstr("kind")}:${jstr(v.kind)}`);
875
+ parts.push(`${jstr("usable")}:${String(v.usable)}`);
876
+ if (v.bound !== undefined && v.bound !== null)
877
+ parts.push(`${jstr("bound")}:${String(v.bound)}`);
878
+ if (v.reason !== undefined && v.reason !== "")
879
+ parts.push(`${jstr("reason")}:${jstr(v.reason)}`);
880
+ return `{${parts.join(",")}}`;
881
+ }
882
+ function decodeDerivedNameVerdict(data) {
883
+ return JSON.parse(data);
884
+ }
885
+ function encodeNameBoundOutput(v) {
886
+ const parts = [];
887
+ if (v.names !== undefined && v.names.length > 0)
888
+ parts.push(`${jstr("names")}:${`[${v.names.map((e0) => encodeDerivedNameVerdict(e0)).join(",")}]`}`);
889
+ if (v.error !== undefined && v.error !== "")
890
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
891
+ if (v.condition_code !== undefined && v.condition_code !== "")
892
+ parts.push(`${jstr("condition_code")}:${jstr(v.condition_code)}`);
893
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
894
+ parts.push(`${jstr("condition_short_code")}:${jstr(v.condition_short_code)}`);
895
+ return `{${parts.join(",")}}`;
896
+ }
897
+ function decodeNameBoundOutput(data) {
898
+ return JSON.parse(data);
899
+ }
900
+ function encodeRenderedNameInput(v) {
901
+ const parts = [];
902
+ parts.push(`${jstr("node_id")}:${jstr(v.node_id)}`);
903
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "")
904
+ parts.push(`${jstr("derived_name_basis")}:${jstr(v.derived_name_basis)}`);
905
+ if (v.sourced !== undefined && v.sourced !== false)
906
+ parts.push(`${jstr("sourced")}:${String(v.sourced)}`);
907
+ if (v.synthesized !== undefined && v.synthesized !== false)
908
+ parts.push(`${jstr("synthesized")}:${String(v.synthesized)}`);
909
+ return `{${parts.join(",")}}`;
910
+ }
911
+ function decodeRenderedNameInput(data) {
912
+ return JSON.parse(data);
913
+ }
914
+ function encodeRenderedNameOutput(v) {
915
+ const parts = [];
916
+ if (v.name !== undefined && v.name !== "")
917
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
918
+ if (v.error !== undefined && v.error !== "")
919
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
920
+ if (v.condition_code !== undefined && v.condition_code !== "")
921
+ parts.push(`${jstr("condition_code")}:${jstr(v.condition_code)}`);
922
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
923
+ parts.push(`${jstr("condition_short_code")}:${jstr(v.condition_short_code)}`);
924
+ return `{${parts.join(",")}}`;
925
+ }
926
+ function decodeRenderedNameOutput(data) {
927
+ return JSON.parse(data);
928
+ }
929
+ function encodeLinkEndpoint(v) {
930
+ const parts = [];
931
+ parts.push(`${jstr("node")}:${jstr(v.node)}`);
932
+ parts.push(`${jstr("boundary")}:${jstr(v.boundary)}`);
933
+ parts.push(`${jstr("provider")}:${jstr(v.provider)}`);
934
+ if (v.release !== undefined && v.release !== "")
935
+ parts.push(`${jstr("release")}:${jstr(v.release)}`);
936
+ return `{${parts.join(",")}}`;
937
+ }
938
+ function decodeLinkEndpoint(data) {
939
+ return JSON.parse(data);
940
+ }
941
+ function encodeLinkEdge(v) {
942
+ const parts = [];
943
+ parts.push(`${jstr("source")}:${encodeLinkEndpoint(v.source)}`);
944
+ parts.push(`${jstr("target")}:${encodeLinkEndpoint(v.target)}`);
945
+ if (v.target_annotations !== undefined && Object.keys(v.target_annotations).length > 0)
946
+ parts.push(`${jstr("target_annotations")}:${`{${Object.keys(v.target_annotations).sort().map((k0) => `${jstr(k0)}:${jstr(v.target_annotations[k0])}`).join(",")}}`}`);
947
+ if (v.source_annotations !== undefined && Object.keys(v.source_annotations).length > 0)
948
+ parts.push(`${jstr("source_annotations")}:${`{${Object.keys(v.source_annotations).sort().map((k0) => `${jstr(k0)}:${jstr(v.source_annotations[k0])}`).join(",")}}`}`);
949
+ parts.push(`${jstr("socket")}:${jstr(v.socket)}`);
950
+ parts.push(`${jstr("provides")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.provides, (v0) => jstr(v0))}`);
951
+ parts.push(`${jstr("inject")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.inject, (v0) => (0, orderedmap_gen_ts_1.writeOrderedObject)(v0, (v1) => jstr(v1)))}`);
952
+ if (v.read_provides_keys !== undefined && v.read_provides_keys.length > 0)
953
+ parts.push(`${jstr("read_provides_keys")}:${`[${v.read_provides_keys.map((e0) => jstr(e0)).join(",")}]`}`);
954
+ return `{${parts.join(",")}}`;
955
+ }
956
+ function decodeLinkEdge(data) {
957
+ const o = {};
958
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
959
+ switch (k) {
960
+ case "source":
961
+ o["source"] = JSON.parse(raw);
962
+ break;
963
+ case "target":
964
+ o["target"] = JSON.parse(raw);
965
+ break;
966
+ case "target_annotations":
967
+ o["target_annotations"] = JSON.parse(raw);
968
+ break;
969
+ case "source_annotations":
970
+ o["source_annotations"] = JSON.parse(raw);
971
+ break;
972
+ case "socket":
973
+ o["socket"] = JSON.parse(raw);
974
+ break;
975
+ case "provides":
976
+ o["provides"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
977
+ break;
978
+ case "inject":
979
+ o["inject"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => (0, orderedmap_gen_ts_1.readOrderedObject)(r0, (r1) => JSON.parse(r1)));
980
+ break;
981
+ case "read_provides_keys":
982
+ o["read_provides_keys"] = JSON.parse(raw);
983
+ break;
984
+ }
985
+ });
986
+ return o;
987
+ }
988
+ function encodeLinkPatch(v) {
989
+ const parts = [];
990
+ parts.push(`${jstr("file")}:${jstr(v.file)}`);
991
+ parts.push(`${jstr("ops")}:${`[${v.ops.map((e0) => encodeOpaque(e0)).join(",")}]`}`);
992
+ return `{${parts.join(",")}}`;
993
+ }
994
+ function decodeLinkPatch(data) {
995
+ return JSON.parse(data);
996
+ }
997
+ function encodeLinkPublishInput(v) {
998
+ const parts = [];
999
+ parts.push(`${jstr("edge")}:${encodeLinkEdge(v.edge)}`);
1000
+ if (v.producer_files !== undefined && v.producer_files.length > 0)
1001
+ parts.push(`${jstr("producer_files")}:${`[${v.producer_files.map((e0) => encodeRenderedFile(e0)).join(",")}]`}`);
1002
+ return `{${parts.join(",")}}`;
1003
+ }
1004
+ function decodeLinkPublishInput(data) {
1005
+ const o = {};
1006
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
1007
+ switch (k) {
1008
+ case "edge":
1009
+ o["edge"] = decodeLinkEdge(raw);
1010
+ break;
1011
+ case "producer_files":
1012
+ o["producer_files"] = JSON.parse(raw);
1013
+ break;
1014
+ }
1015
+ });
1016
+ return o;
1017
+ }
1018
+ function encodeLinkPublishOutput(v) {
1019
+ const parts = [];
1020
+ parts.push(`${jstr("handle")}:${`{${Object.keys(v.handle).sort().map((k0) => `${jstr(k0)}:${jstr(v.handle[k0])}`).join(",")}}`}`);
1021
+ if (v.patches !== undefined && v.patches.length > 0)
1022
+ parts.push(`${jstr("patches")}:${`[${v.patches.map((e0) => encodeLinkPatch(e0)).join(",")}]`}`);
1023
+ if (v.error !== undefined && v.error !== "")
1024
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
1025
+ if (v.condition_code !== undefined && v.condition_code !== "")
1026
+ parts.push(`${jstr("condition_code")}:${jstr(v.condition_code)}`);
1027
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
1028
+ parts.push(`${jstr("condition_short_code")}:${jstr(v.condition_short_code)}`);
1029
+ return `{${parts.join(",")}}`;
1030
+ }
1031
+ function decodeLinkPublishOutput(data) {
1032
+ return JSON.parse(data);
1033
+ }
1034
+ function encodeLinkResolveInput(v) {
1035
+ const parts = [];
1036
+ parts.push(`${jstr("edge")}:${encodeLinkEdge(v.edge)}`);
1037
+ parts.push(`${jstr("handle")}:${`{${Object.keys(v.handle).sort().map((k0) => `${jstr(k0)}:${jstr(v.handle[k0])}`).join(",")}}`}`);
1038
+ if (v.consumer_files !== undefined && v.consumer_files.length > 0)
1039
+ parts.push(`${jstr("consumer_files")}:${`[${v.consumer_files.map((e0) => encodeRenderedFile(e0)).join(",")}]`}`);
1040
+ return `{${parts.join(",")}}`;
1041
+ }
1042
+ function decodeLinkResolveInput(data) {
1043
+ const o = {};
1044
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
1045
+ switch (k) {
1046
+ case "edge":
1047
+ o["edge"] = decodeLinkEdge(raw);
1048
+ break;
1049
+ case "handle":
1050
+ o["handle"] = JSON.parse(raw);
1051
+ break;
1052
+ case "consumer_files":
1053
+ o["consumer_files"] = JSON.parse(raw);
1054
+ break;
1055
+ }
1056
+ });
1057
+ return o;
1058
+ }
1059
+ function encodeLinkResolveOutput(v) {
1060
+ const parts = [];
1061
+ parts.push(`${jstr("patches")}:${`[${v.patches.map((e0) => encodeLinkPatch(e0)).join(",")}]`}`);
1062
+ if (v.error !== undefined && v.error !== "")
1063
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
1064
+ if (v.condition_code !== undefined && v.condition_code !== "")
1065
+ parts.push(`${jstr("condition_code")}:${jstr(v.condition_code)}`);
1066
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
1067
+ parts.push(`${jstr("condition_short_code")}:${jstr(v.condition_short_code)}`);
1068
+ return `{${parts.join(",")}}`;
1069
+ }
1070
+ function decodeLinkResolveOutput(data) {
1071
+ return JSON.parse(data);
1072
+ }
1073
+ function encodeCBORRenderNodeInput(v) {
1074
+ const out = [];
1075
+ appendCBORRenderNodeInput(out, v);
1076
+ return new Uint8Array(out);
1077
+ }
1078
+ function appendCBORRenderNodeInput(out, v) {
1079
+ let n = 2;
1080
+ if (v.omits !== undefined && v.omits.length > 0)
1081
+ n++;
1082
+ if (v.source_listing !== undefined && v.source_listing !== null)
1083
+ n++;
1084
+ if (v.workload_projection !== undefined && v.workload_projection !== null)
1085
+ n++;
1086
+ if (v.artifacts_projection !== undefined && v.artifacts_projection !== null)
1087
+ n++;
1088
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1089
+ (0, cbor_gen_ts_1.writeText)(out, "node");
1090
+ appendCBORIRNodeProjection(out, v.node);
1091
+ if (v.omits !== undefined && v.omits.length > 0) {
1092
+ (0, cbor_gen_ts_1.writeText)(out, "omits");
1093
+ {
1094
+ const a0 = v.omits;
1095
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1096
+ for (const ee0 of a0) {
1097
+ appendCBOROmitEntry(out, ee0);
1098
+ }
1099
+ }
1100
+ }
1101
+ (0, cbor_gen_ts_1.writeText)(out, "context");
1102
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.context)));
1103
+ if (v.source_listing !== undefined && v.source_listing !== null) {
1104
+ (0, cbor_gen_ts_1.writeText)(out, "source_listing");
1105
+ appendCBORSourceListing(out, v.source_listing);
1106
+ }
1107
+ if (v.workload_projection !== undefined && v.workload_projection !== null) {
1108
+ (0, cbor_gen_ts_1.writeText)(out, "workload_projection");
1109
+ appendCBORWorkloadProjection(out, v.workload_projection);
1110
+ }
1111
+ if (v.artifacts_projection !== undefined && v.artifacts_projection !== null) {
1112
+ (0, cbor_gen_ts_1.writeText)(out, "artifacts_projection");
1113
+ appendCBORArtifactsProjection(out, v.artifacts_projection);
1114
+ }
1115
+ }
1116
+ function decodeCBORRenderNodeInput(data) {
1117
+ const dec = new cbor_gen_ts_1.CborDec(data);
1118
+ return decodeCBORRenderNodeInputFrom(dec);
1119
+ }
1120
+ function decodeCBORRenderNodeInputFrom(dec) {
1121
+ const o = {};
1122
+ const n = dec.readMapHeader();
1123
+ for (let i = 0; i < n; i++) {
1124
+ const k = dec.readText();
1125
+ switch (k) {
1126
+ case "node":
1127
+ o["node"] = decodeCBORIRNodeProjectionFrom(dec);
1128
+ break;
1129
+ case "context":
1130
+ o["context"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
1131
+ break;
1132
+ case "source_listing":
1133
+ o["source_listing"] = decodeCBORSourceListingFrom(dec);
1134
+ break;
1135
+ case "workload_projection":
1136
+ o["workload_projection"] = decodeCBORWorkloadProjectionFrom(dec);
1137
+ break;
1138
+ case "artifacts_projection":
1139
+ o["artifacts_projection"] = decodeCBORArtifactsProjectionFrom(dec);
1140
+ break;
1141
+ case "omits":
1142
+ o["omits"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1143
+ a.push(decodeCBOROmitEntryFrom(dec));
1144
+ } return a; })();
1145
+ break;
1146
+ default: dec.skip();
1147
+ }
1148
+ }
1149
+ return o;
1150
+ }
1151
+ function encodeCBORIRNodeProjection(v) {
1152
+ const out = [];
1153
+ appendCBORIRNodeProjection(out, v);
1154
+ return new Uint8Array(out);
1155
+ }
1156
+ function appendCBORIRNodeProjection(out, v) {
1157
+ let n = 4;
1158
+ if (v.uses !== undefined && v.uses.size > 0)
1159
+ n++;
1160
+ if (v.values !== undefined && v.values.size > 0)
1161
+ n++;
1162
+ if (v.features !== undefined && v.features.size > 0)
1163
+ n++;
1164
+ if (v.sync_wave !== undefined && v.sync_wave !== 0)
1165
+ n++;
1166
+ if (v.recipe_name !== undefined && v.recipe_name !== "")
1167
+ n++;
1168
+ if (v.boundary_path !== undefined && v.boundary_path !== "")
1169
+ n++;
1170
+ if (v.output_labels !== undefined && Object.keys(v.output_labels).length > 0)
1171
+ n++;
1172
+ if (v.values_mapped !== undefined && v.values_mapped !== false)
1173
+ n++;
1174
+ if (v.recipe_version !== undefined && v.recipe_version !== "")
1175
+ n++;
1176
+ if (v.sensitive_values !== undefined && v.sensitive_values !== false)
1177
+ n++;
1178
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "")
1179
+ n++;
1180
+ if (v.label_component_id !== undefined && v.label_component_id !== "")
1181
+ n++;
1182
+ if (v.sensitive_rendered_keys !== undefined && Object.keys(v.sensitive_rendered_keys).length > 0)
1183
+ n++;
1184
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1185
+ (0, cbor_gen_ts_1.writeText)(out, "id");
1186
+ (0, cbor_gen_ts_1.writeText)(out, v.id);
1187
+ (0, cbor_gen_ts_1.writeText)(out, "type");
1188
+ (0, cbor_gen_ts_1.writeText)(out, v.type);
1189
+ if (v.uses !== undefined && v.uses.size > 0) {
1190
+ (0, cbor_gen_ts_1.writeText)(out, "uses");
1191
+ {
1192
+ const m0 = v.uses;
1193
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
1194
+ for (const [kk0, vv0] of m0) {
1195
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
1196
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
1197
+ {
1198
+ const a1 = vv0;
1199
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a1.length);
1200
+ for (const ee1 of a1) {
1201
+ (0, cbor_gen_ts_1.writeText)(out, ee1);
1202
+ }
1203
+ }
1204
+ }
1205
+ }
1206
+ }
1207
+ if (v.values !== undefined && v.values.size > 0) {
1208
+ (0, cbor_gen_ts_1.writeText)(out, "values");
1209
+ {
1210
+ const m0 = v.values;
1211
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
1212
+ for (const [kk0, vv0] of m0) {
1213
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
1214
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
1215
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
1216
+ }
1217
+ }
1218
+ }
1219
+ if (v.features !== undefined && v.features.size > 0) {
1220
+ (0, cbor_gen_ts_1.writeText)(out, "features");
1221
+ {
1222
+ const m0 = v.features;
1223
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
1224
+ for (const [kk0, vv0] of m0) {
1225
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
1226
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
1227
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
1228
+ }
1229
+ }
1230
+ }
1231
+ if (v.sync_wave !== undefined && v.sync_wave !== 0) {
1232
+ (0, cbor_gen_ts_1.writeText)(out, "sync_wave");
1233
+ (0, cbor_gen_ts_1.writeInt)(out, v.sync_wave);
1234
+ }
1235
+ (0, cbor_gen_ts_1.writeText)(out, "provenance");
1236
+ appendCBORNodeProvenance(out, v.provenance);
1237
+ if (v.recipe_name !== undefined && v.recipe_name !== "") {
1238
+ (0, cbor_gen_ts_1.writeText)(out, "recipe_name");
1239
+ (0, cbor_gen_ts_1.writeText)(out, v.recipe_name);
1240
+ }
1241
+ if (v.boundary_path !== undefined && v.boundary_path !== "") {
1242
+ (0, cbor_gen_ts_1.writeText)(out, "boundary_path");
1243
+ (0, cbor_gen_ts_1.writeText)(out, v.boundary_path);
1244
+ }
1245
+ if (v.output_labels !== undefined && Object.keys(v.output_labels).length > 0) {
1246
+ (0, cbor_gen_ts_1.writeText)(out, "output_labels");
1247
+ {
1248
+ const m0 = v.output_labels;
1249
+ const ks0 = Object.keys(m0);
1250
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
1251
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
1252
+ for (const kk0 of ks0) {
1253
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
1254
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
1255
+ }
1256
+ }
1257
+ }
1258
+ if (v.values_mapped !== undefined && v.values_mapped !== false) {
1259
+ (0, cbor_gen_ts_1.writeText)(out, "values_mapped");
1260
+ (0, cbor_gen_ts_1.writeBool)(out, v.values_mapped);
1261
+ }
1262
+ if (v.recipe_version !== undefined && v.recipe_version !== "") {
1263
+ (0, cbor_gen_ts_1.writeText)(out, "recipe_version");
1264
+ (0, cbor_gen_ts_1.writeText)(out, v.recipe_version);
1265
+ }
1266
+ (0, cbor_gen_ts_1.writeText)(out, "resolved_recipe");
1267
+ (0, cbor_gen_ts_1.writeText)(out, v.resolved_recipe);
1268
+ if (v.sensitive_values !== undefined && v.sensitive_values !== false) {
1269
+ (0, cbor_gen_ts_1.writeText)(out, "sensitive_values");
1270
+ (0, cbor_gen_ts_1.writeBool)(out, v.sensitive_values);
1271
+ }
1272
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "") {
1273
+ (0, cbor_gen_ts_1.writeText)(out, "derived_name_basis");
1274
+ (0, cbor_gen_ts_1.writeText)(out, v.derived_name_basis);
1275
+ }
1276
+ if (v.label_component_id !== undefined && v.label_component_id !== "") {
1277
+ (0, cbor_gen_ts_1.writeText)(out, "label_component_id");
1278
+ (0, cbor_gen_ts_1.writeText)(out, v.label_component_id);
1279
+ }
1280
+ if (v.sensitive_rendered_keys !== undefined && Object.keys(v.sensitive_rendered_keys).length > 0) {
1281
+ (0, cbor_gen_ts_1.writeText)(out, "sensitive_rendered_keys");
1282
+ {
1283
+ const m0 = v.sensitive_rendered_keys;
1284
+ const ks0 = Object.keys(m0);
1285
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
1286
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
1287
+ for (const kk0 of ks0) {
1288
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
1289
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
1290
+ }
1291
+ }
1292
+ }
1293
+ }
1294
+ function decodeCBORIRNodeProjection(data) {
1295
+ const dec = new cbor_gen_ts_1.CborDec(data);
1296
+ return decodeCBORIRNodeProjectionFrom(dec);
1297
+ }
1298
+ function decodeCBORIRNodeProjectionFrom(dec) {
1299
+ const o = {};
1300
+ const n = dec.readMapHeader();
1301
+ for (let i = 0; i < n; i++) {
1302
+ const k = dec.readText();
1303
+ switch (k) {
1304
+ case "id":
1305
+ o["id"] = dec.readText();
1306
+ break;
1307
+ case "type":
1308
+ o["type"] = dec.readText();
1309
+ break;
1310
+ case "resolved_recipe":
1311
+ o["resolved_recipe"] = dec.readText();
1312
+ break;
1313
+ case "values":
1314
+ o["values"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
1315
+ const mk = dec.readEntryKey();
1316
+ if (m.has(mk))
1317
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
1318
+ m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
1319
+ } return m; })();
1320
+ break;
1321
+ case "features":
1322
+ o["features"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
1323
+ const mk = dec.readEntryKey();
1324
+ if (m.has(mk))
1325
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
1326
+ m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
1327
+ } return m; })();
1328
+ break;
1329
+ case "sensitive_rendered_keys":
1330
+ o["sensitive_rendered_keys"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
1331
+ const mk = dec.readText();
1332
+ m[mk] = dec.readText();
1333
+ } return m; })();
1334
+ break;
1335
+ case "sensitive_values":
1336
+ o["sensitive_values"] = dec.readBool();
1337
+ break;
1338
+ case "values_mapped":
1339
+ o["values_mapped"] = dec.readBool();
1340
+ break;
1341
+ case "uses":
1342
+ o["uses"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
1343
+ const mk = dec.readEntryKey();
1344
+ if (m.has(mk))
1345
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
1346
+ m.set(mk, (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1347
+ a.push(dec.readText());
1348
+ } return a; })());
1349
+ } return m; })();
1350
+ break;
1351
+ case "boundary_path":
1352
+ o["boundary_path"] = dec.readText();
1353
+ break;
1354
+ case "sync_wave":
1355
+ o["sync_wave"] = dec.readInt();
1356
+ break;
1357
+ case "recipe_name":
1358
+ o["recipe_name"] = dec.readText();
1359
+ break;
1360
+ case "recipe_version":
1361
+ o["recipe_version"] = dec.readText();
1362
+ break;
1363
+ case "label_component_id":
1364
+ o["label_component_id"] = dec.readText();
1365
+ break;
1366
+ case "derived_name_basis":
1367
+ o["derived_name_basis"] = dec.readText();
1368
+ break;
1369
+ case "output_labels":
1370
+ o["output_labels"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
1371
+ const mk = dec.readText();
1372
+ m[mk] = dec.readText();
1373
+ } return m; })();
1374
+ break;
1375
+ case "provenance":
1376
+ o["provenance"] = decodeCBORNodeProvenanceFrom(dec);
1377
+ break;
1378
+ default: dec.skip();
1379
+ }
1380
+ }
1381
+ return o;
1382
+ }
1383
+ function encodeCBORNodeProvenance(v) {
1384
+ const out = [];
1385
+ appendCBORNodeProvenance(out, v);
1386
+ return new Uint8Array(out);
1387
+ }
1388
+ function appendCBORNodeProvenance(out, v) {
1389
+ let n = 0;
1390
+ if (v.environment !== undefined && v.environment !== "")
1391
+ n++;
1392
+ if (v.provider_name !== undefined && v.provider_name !== "")
1393
+ n++;
1394
+ if (v.aggregate_name !== undefined && v.aggregate_name !== "")
1395
+ n++;
1396
+ if (v.compiler_version !== undefined && v.compiler_version !== "")
1397
+ n++;
1398
+ if (v.provider_version !== undefined && v.provider_version !== "")
1399
+ n++;
1400
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1401
+ if (v.environment !== undefined && v.environment !== "") {
1402
+ (0, cbor_gen_ts_1.writeText)(out, "environment");
1403
+ (0, cbor_gen_ts_1.writeText)(out, v.environment);
1404
+ }
1405
+ if (v.provider_name !== undefined && v.provider_name !== "") {
1406
+ (0, cbor_gen_ts_1.writeText)(out, "provider_name");
1407
+ (0, cbor_gen_ts_1.writeText)(out, v.provider_name);
1408
+ }
1409
+ if (v.aggregate_name !== undefined && v.aggregate_name !== "") {
1410
+ (0, cbor_gen_ts_1.writeText)(out, "aggregate_name");
1411
+ (0, cbor_gen_ts_1.writeText)(out, v.aggregate_name);
1412
+ }
1413
+ if (v.compiler_version !== undefined && v.compiler_version !== "") {
1414
+ (0, cbor_gen_ts_1.writeText)(out, "compiler_version");
1415
+ (0, cbor_gen_ts_1.writeText)(out, v.compiler_version);
1416
+ }
1417
+ if (v.provider_version !== undefined && v.provider_version !== "") {
1418
+ (0, cbor_gen_ts_1.writeText)(out, "provider_version");
1419
+ (0, cbor_gen_ts_1.writeText)(out, v.provider_version);
1420
+ }
1421
+ }
1422
+ function decodeCBORNodeProvenance(data) {
1423
+ const dec = new cbor_gen_ts_1.CborDec(data);
1424
+ return decodeCBORNodeProvenanceFrom(dec);
1425
+ }
1426
+ function decodeCBORNodeProvenanceFrom(dec) {
1427
+ const o = {};
1428
+ const n = dec.readMapHeader();
1429
+ for (let i = 0; i < n; i++) {
1430
+ const k = dec.readText();
1431
+ switch (k) {
1432
+ case "compiler_version":
1433
+ o["compiler_version"] = dec.readText();
1434
+ break;
1435
+ case "aggregate_name":
1436
+ o["aggregate_name"] = dec.readText();
1437
+ break;
1438
+ case "environment":
1439
+ o["environment"] = dec.readText();
1440
+ break;
1441
+ case "provider_name":
1442
+ o["provider_name"] = dec.readText();
1443
+ break;
1444
+ case "provider_version":
1445
+ o["provider_version"] = dec.readText();
1446
+ break;
1447
+ default: dec.skip();
1448
+ }
1449
+ }
1450
+ return o;
1451
+ }
1452
+ function encodeCBORRenderNodeOutput(v) {
1453
+ const out = [];
1454
+ appendCBORRenderNodeOutput(out, v);
1455
+ return new Uint8Array(out);
1456
+ }
1457
+ function appendCBORRenderNodeOutput(out, v) {
1458
+ let n = 1;
1459
+ if (v.error !== undefined && v.error !== "")
1460
+ n++;
1461
+ if (v.omitted !== undefined && v.omitted.length > 0)
1462
+ n++;
1463
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0)
1464
+ n++;
1465
+ if (v.derived_keys !== undefined && v.derived_keys.size > 0)
1466
+ n++;
1467
+ if (v.render_facts !== undefined && v.render_facts.length > 0)
1468
+ n++;
1469
+ if (v.condition_code !== undefined && v.condition_code !== "")
1470
+ n++;
1471
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
1472
+ n++;
1473
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1474
+ if (v.error !== undefined && v.error !== "") {
1475
+ (0, cbor_gen_ts_1.writeText)(out, "error");
1476
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
1477
+ }
1478
+ (0, cbor_gen_ts_1.writeText)(out, "files");
1479
+ {
1480
+ const a0 = v.files;
1481
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1482
+ for (const ee0 of a0) {
1483
+ appendCBORRenderedFile(out, ee0);
1484
+ }
1485
+ }
1486
+ if (v.omitted !== undefined && v.omitted.length > 0) {
1487
+ (0, cbor_gen_ts_1.writeText)(out, "omitted");
1488
+ {
1489
+ const a0 = v.omitted;
1490
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1491
+ for (const ee0 of a0) {
1492
+ (0, cbor_gen_ts_1.writeInt)(out, ee0);
1493
+ }
1494
+ }
1495
+ }
1496
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0) {
1497
+ (0, cbor_gen_ts_1.writeText)(out, "diagnostics");
1498
+ {
1499
+ const a0 = v.diagnostics;
1500
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1501
+ for (const ee0 of a0) {
1502
+ (0, diagnostic_gen_ts_2.appendCBORDiagnostic)(out, ee0);
1503
+ }
1504
+ }
1505
+ }
1506
+ if (v.derived_keys !== undefined && v.derived_keys.size > 0) {
1507
+ (0, cbor_gen_ts_1.writeText)(out, "derived_keys");
1508
+ {
1509
+ const m0 = v.derived_keys;
1510
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
1511
+ for (const [kk0, vv0] of m0) {
1512
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
1513
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
1514
+ {
1515
+ const a1 = vv0;
1516
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a1.length);
1517
+ for (const ee1 of a1) {
1518
+ (0, cbor_gen_ts_1.writeText)(out, ee1);
1519
+ }
1520
+ }
1521
+ }
1522
+ }
1523
+ }
1524
+ if (v.render_facts !== undefined && v.render_facts.length > 0) {
1525
+ (0, cbor_gen_ts_1.writeText)(out, "render_facts");
1526
+ {
1527
+ const a0 = v.render_facts;
1528
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1529
+ for (const ee0 of a0) {
1530
+ appendCBORRenderFact(out, ee0);
1531
+ }
1532
+ }
1533
+ }
1534
+ if (v.condition_code !== undefined && v.condition_code !== "") {
1535
+ (0, cbor_gen_ts_1.writeText)(out, "condition_code");
1536
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_code);
1537
+ }
1538
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "") {
1539
+ (0, cbor_gen_ts_1.writeText)(out, "condition_short_code");
1540
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_short_code);
1541
+ }
1542
+ }
1543
+ function decodeCBORRenderNodeOutput(data) {
1544
+ const dec = new cbor_gen_ts_1.CborDec(data);
1545
+ return decodeCBORRenderNodeOutputFrom(dec);
1546
+ }
1547
+ function decodeCBORRenderNodeOutputFrom(dec) {
1548
+ const o = {};
1549
+ const n = dec.readMapHeader();
1550
+ for (let i = 0; i < n; i++) {
1551
+ const k = dec.readText();
1552
+ switch (k) {
1553
+ case "files":
1554
+ o["files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1555
+ a.push(decodeCBORRenderedFileFrom(dec));
1556
+ } return a; })();
1557
+ break;
1558
+ case "derived_keys":
1559
+ o["derived_keys"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
1560
+ const mk = dec.readEntryKey();
1561
+ if (m.has(mk))
1562
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
1563
+ m.set(mk, (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1564
+ a.push(dec.readText());
1565
+ } return a; })());
1566
+ } return m; })();
1567
+ break;
1568
+ case "render_facts":
1569
+ o["render_facts"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1570
+ a.push(decodeCBORRenderFactFrom(dec));
1571
+ } return a; })();
1572
+ break;
1573
+ case "omitted":
1574
+ o["omitted"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1575
+ a.push(dec.readInt());
1576
+ } return a; })();
1577
+ break;
1578
+ case "diagnostics":
1579
+ o["diagnostics"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1580
+ a.push((0, diagnostic_gen_ts_2.decodeCBORDiagnosticFrom)(dec));
1581
+ } return a; })();
1582
+ break;
1583
+ case "error":
1584
+ o["error"] = dec.readText();
1585
+ break;
1586
+ case "condition_code":
1587
+ o["condition_code"] = dec.readText();
1588
+ break;
1589
+ case "condition_short_code":
1590
+ o["condition_short_code"] = dec.readText();
1591
+ break;
1592
+ default: dec.skip();
1593
+ }
1594
+ }
1595
+ return o;
1596
+ }
1597
+ function encodeCBORValidateNodeOutput(v) {
1598
+ const out = [];
1599
+ appendCBORValidateNodeOutput(out, v);
1600
+ return new Uint8Array(out);
1601
+ }
1602
+ function appendCBORValidateNodeOutput(out, v) {
1603
+ let n = 0;
1604
+ if (v.error !== undefined && v.error !== "")
1605
+ n++;
1606
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0)
1607
+ n++;
1608
+ if (v.condition_code !== undefined && v.condition_code !== "")
1609
+ n++;
1610
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
1611
+ n++;
1612
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1613
+ if (v.error !== undefined && v.error !== "") {
1614
+ (0, cbor_gen_ts_1.writeText)(out, "error");
1615
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
1616
+ }
1617
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0) {
1618
+ (0, cbor_gen_ts_1.writeText)(out, "diagnostics");
1619
+ {
1620
+ const a0 = v.diagnostics;
1621
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1622
+ for (const ee0 of a0) {
1623
+ (0, diagnostic_gen_ts_2.appendCBORDiagnostic)(out, ee0);
1624
+ }
1625
+ }
1626
+ }
1627
+ if (v.condition_code !== undefined && v.condition_code !== "") {
1628
+ (0, cbor_gen_ts_1.writeText)(out, "condition_code");
1629
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_code);
1630
+ }
1631
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "") {
1632
+ (0, cbor_gen_ts_1.writeText)(out, "condition_short_code");
1633
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_short_code);
1634
+ }
1635
+ }
1636
+ function decodeCBORValidateNodeOutput(data) {
1637
+ const dec = new cbor_gen_ts_1.CborDec(data);
1638
+ return decodeCBORValidateNodeOutputFrom(dec);
1639
+ }
1640
+ function decodeCBORValidateNodeOutputFrom(dec) {
1641
+ const o = {};
1642
+ const n = dec.readMapHeader();
1643
+ for (let i = 0; i < n; i++) {
1644
+ const k = dec.readText();
1645
+ switch (k) {
1646
+ case "diagnostics":
1647
+ o["diagnostics"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1648
+ a.push((0, diagnostic_gen_ts_2.decodeCBORDiagnosticFrom)(dec));
1649
+ } return a; })();
1650
+ break;
1651
+ case "error":
1652
+ o["error"] = dec.readText();
1653
+ break;
1654
+ case "condition_code":
1655
+ o["condition_code"] = dec.readText();
1656
+ break;
1657
+ case "condition_short_code":
1658
+ o["condition_short_code"] = dec.readText();
1659
+ break;
1660
+ default: dec.skip();
1661
+ }
1662
+ }
1663
+ return o;
1664
+ }
1665
+ function encodeCBORRenderedFile(v) {
1666
+ const out = [];
1667
+ appendCBORRenderedFile(out, v);
1668
+ return new Uint8Array(out);
1669
+ }
1670
+ function appendCBORRenderedFile(out, v) {
1671
+ let n = 2;
1672
+ if (v.format !== undefined && v.format !== "")
1673
+ n++;
1674
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1675
+ (0, cbor_gen_ts_1.writeText)(out, "path");
1676
+ (0, cbor_gen_ts_1.writeText)(out, v.path);
1677
+ if (v.format !== undefined && v.format !== "") {
1678
+ (0, cbor_gen_ts_1.writeText)(out, "format");
1679
+ (0, cbor_gen_ts_1.writeText)(out, v.format);
1680
+ }
1681
+ (0, cbor_gen_ts_1.writeText)(out, "content");
1682
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.content));
1683
+ }
1684
+ function decodeCBORRenderedFile(data) {
1685
+ const dec = new cbor_gen_ts_1.CborDec(data);
1686
+ return decodeCBORRenderedFileFrom(dec);
1687
+ }
1688
+ function decodeCBORRenderedFileFrom(dec) {
1689
+ const o = {};
1690
+ const n = dec.readMapHeader();
1691
+ for (let i = 0; i < n; i++) {
1692
+ const k = dec.readText();
1693
+ switch (k) {
1694
+ case "path":
1695
+ o["path"] = dec.readText();
1696
+ break;
1697
+ case "content":
1698
+ o["content"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
1699
+ break;
1700
+ case "format":
1701
+ o["format"] = dec.readText();
1702
+ break;
1703
+ default: dec.skip();
1704
+ }
1705
+ }
1706
+ return o;
1707
+ }
1708
+ function encodeCBORRenderFact(v) {
1709
+ const out = [];
1710
+ appendCBORRenderFact(out, v);
1711
+ return new Uint8Array(out);
1712
+ }
1713
+ function appendCBORRenderFact(out, v) {
1714
+ let n = 2;
1715
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1716
+ (0, cbor_gen_ts_1.writeText)(out, "name");
1717
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
1718
+ (0, cbor_gen_ts_1.writeText)(out, "value");
1719
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.value)));
1720
+ }
1721
+ function decodeCBORRenderFact(data) {
1722
+ const dec = new cbor_gen_ts_1.CborDec(data);
1723
+ return decodeCBORRenderFactFrom(dec);
1724
+ }
1725
+ function decodeCBORRenderFactFrom(dec) {
1726
+ const o = {};
1727
+ const n = dec.readMapHeader();
1728
+ for (let i = 0; i < n; i++) {
1729
+ const k = dec.readText();
1730
+ switch (k) {
1731
+ case "name":
1732
+ o["name"] = dec.readText();
1733
+ break;
1734
+ case "value":
1735
+ o["value"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
1736
+ break;
1737
+ default: dec.skip();
1738
+ }
1739
+ }
1740
+ return o;
1741
+ }
1742
+ function encodeCBOROmitEntry(v) {
1743
+ const out = [];
1744
+ appendCBOROmitEntry(out, v);
1745
+ return new Uint8Array(out);
1746
+ }
1747
+ function appendCBOROmitEntry(out, v) {
1748
+ let n = 2;
1749
+ if (v.subchart !== undefined && v.subchart !== "")
1750
+ n++;
1751
+ if (v.namespace !== undefined && v.namespace !== "")
1752
+ n++;
1753
+ if (v.sensitive !== undefined && v.sensitive !== false)
1754
+ n++;
1755
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1756
+ (0, cbor_gen_ts_1.writeText)(out, "kind");
1757
+ (0, cbor_gen_ts_1.writeText)(out, v.kind);
1758
+ (0, cbor_gen_ts_1.writeText)(out, "name");
1759
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
1760
+ if (v.subchart !== undefined && v.subchart !== "") {
1761
+ (0, cbor_gen_ts_1.writeText)(out, "subchart");
1762
+ (0, cbor_gen_ts_1.writeText)(out, v.subchart);
1763
+ }
1764
+ if (v.namespace !== undefined && v.namespace !== "") {
1765
+ (0, cbor_gen_ts_1.writeText)(out, "namespace");
1766
+ (0, cbor_gen_ts_1.writeText)(out, v.namespace);
1767
+ }
1768
+ if (v.sensitive !== undefined && v.sensitive !== false) {
1769
+ (0, cbor_gen_ts_1.writeText)(out, "sensitive");
1770
+ (0, cbor_gen_ts_1.writeBool)(out, v.sensitive);
1771
+ }
1772
+ }
1773
+ function decodeCBOROmitEntry(data) {
1774
+ const dec = new cbor_gen_ts_1.CborDec(data);
1775
+ return decodeCBOROmitEntryFrom(dec);
1776
+ }
1777
+ function decodeCBOROmitEntryFrom(dec) {
1778
+ const o = {};
1779
+ const n = dec.readMapHeader();
1780
+ for (let i = 0; i < n; i++) {
1781
+ const k = dec.readText();
1782
+ switch (k) {
1783
+ case "kind":
1784
+ o["kind"] = dec.readText();
1785
+ break;
1786
+ case "name":
1787
+ o["name"] = dec.readText();
1788
+ break;
1789
+ case "namespace":
1790
+ o["namespace"] = dec.readText();
1791
+ break;
1792
+ case "subchart":
1793
+ o["subchart"] = dec.readText();
1794
+ break;
1795
+ case "sensitive":
1796
+ o["sensitive"] = dec.readBool();
1797
+ break;
1798
+ default: dec.skip();
1799
+ }
1800
+ }
1801
+ return o;
1802
+ }
1803
+ function encodeCBORSourceFile(v) {
1804
+ const out = [];
1805
+ appendCBORSourceFile(out, v);
1806
+ return new Uint8Array(out);
1807
+ }
1808
+ function appendCBORSourceFile(out, v) {
1809
+ let n = 2;
1810
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1811
+ (0, cbor_gen_ts_1.writeText)(out, "path");
1812
+ (0, cbor_gen_ts_1.writeText)(out, v.path);
1813
+ (0, cbor_gen_ts_1.writeText)(out, "content");
1814
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.content));
1815
+ }
1816
+ function decodeCBORSourceFile(data) {
1817
+ const dec = new cbor_gen_ts_1.CborDec(data);
1818
+ return decodeCBORSourceFileFrom(dec);
1819
+ }
1820
+ function decodeCBORSourceFileFrom(dec) {
1821
+ const o = {};
1822
+ const n = dec.readMapHeader();
1823
+ for (let i = 0; i < n; i++) {
1824
+ const k = dec.readText();
1825
+ switch (k) {
1826
+ case "path":
1827
+ o["path"] = dec.readText();
1828
+ break;
1829
+ case "content":
1830
+ o["content"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
1831
+ break;
1832
+ default: dec.skip();
1833
+ }
1834
+ }
1835
+ return o;
1836
+ }
1837
+ function encodeCBORSourceProjection(v) {
1838
+ const out = [];
1839
+ appendCBORSourceProjection(out, v);
1840
+ return new Uint8Array(out);
1841
+ }
1842
+ function appendCBORSourceProjection(out, v) {
1843
+ let n = 1;
1844
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1845
+ (0, cbor_gen_ts_1.writeText)(out, "files");
1846
+ {
1847
+ const a0 = v.files;
1848
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1849
+ for (const ee0 of a0) {
1850
+ appendCBORSourceFile(out, ee0);
1851
+ }
1852
+ }
1853
+ }
1854
+ function decodeCBORSourceProjection(data) {
1855
+ const dec = new cbor_gen_ts_1.CborDec(data);
1856
+ return decodeCBORSourceProjectionFrom(dec);
1857
+ }
1858
+ function decodeCBORSourceProjectionFrom(dec) {
1859
+ const o = {};
1860
+ const n = dec.readMapHeader();
1861
+ for (let i = 0; i < n; i++) {
1862
+ const k = dec.readText();
1863
+ switch (k) {
1864
+ case "files":
1865
+ o["files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1866
+ a.push(decodeCBORSourceFileFrom(dec));
1867
+ } return a; })();
1868
+ break;
1869
+ default: dec.skip();
1870
+ }
1871
+ }
1872
+ return o;
1873
+ }
1874
+ function encodeCBORSourceEntry(v) {
1875
+ const out = [];
1876
+ appendCBORSourceEntry(out, v);
1877
+ return new Uint8Array(out);
1878
+ }
1879
+ function appendCBORSourceEntry(out, v) {
1880
+ let n = 2;
1881
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1882
+ (0, cbor_gen_ts_1.writeText)(out, "path");
1883
+ (0, cbor_gen_ts_1.writeText)(out, v.path);
1884
+ (0, cbor_gen_ts_1.writeText)(out, "is_dir");
1885
+ (0, cbor_gen_ts_1.writeBool)(out, v.is_dir);
1886
+ }
1887
+ function decodeCBORSourceEntry(data) {
1888
+ const dec = new cbor_gen_ts_1.CborDec(data);
1889
+ return decodeCBORSourceEntryFrom(dec);
1890
+ }
1891
+ function decodeCBORSourceEntryFrom(dec) {
1892
+ const o = {};
1893
+ const n = dec.readMapHeader();
1894
+ for (let i = 0; i < n; i++) {
1895
+ const k = dec.readText();
1896
+ switch (k) {
1897
+ case "path":
1898
+ o["path"] = dec.readText();
1899
+ break;
1900
+ case "is_dir":
1901
+ o["is_dir"] = dec.readBool();
1902
+ break;
1903
+ default: dec.skip();
1904
+ }
1905
+ }
1906
+ return o;
1907
+ }
1908
+ function encodeCBORSourceListing(v) {
1909
+ const out = [];
1910
+ appendCBORSourceListing(out, v);
1911
+ return new Uint8Array(out);
1912
+ }
1913
+ function appendCBORSourceListing(out, v) {
1914
+ let n = 2;
1915
+ if (v.root_is_dir !== undefined && v.root_is_dir !== false)
1916
+ n++;
1917
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1918
+ (0, cbor_gen_ts_1.writeText)(out, "root");
1919
+ (0, cbor_gen_ts_1.writeText)(out, v.root);
1920
+ (0, cbor_gen_ts_1.writeText)(out, "entries");
1921
+ {
1922
+ const a0 = v.entries;
1923
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1924
+ for (const ee0 of a0) {
1925
+ appendCBORSourceEntry(out, ee0);
1926
+ }
1927
+ }
1928
+ if (v.root_is_dir !== undefined && v.root_is_dir !== false) {
1929
+ (0, cbor_gen_ts_1.writeText)(out, "root_is_dir");
1930
+ (0, cbor_gen_ts_1.writeBool)(out, v.root_is_dir);
1931
+ }
1932
+ }
1933
+ function decodeCBORSourceListing(data) {
1934
+ const dec = new cbor_gen_ts_1.CborDec(data);
1935
+ return decodeCBORSourceListingFrom(dec);
1936
+ }
1937
+ function decodeCBORSourceListingFrom(dec) {
1938
+ const o = {};
1939
+ const n = dec.readMapHeader();
1940
+ for (let i = 0; i < n; i++) {
1941
+ const k = dec.readText();
1942
+ switch (k) {
1943
+ case "root":
1944
+ o["root"] = dec.readText();
1945
+ break;
1946
+ case "root_is_dir":
1947
+ o["root_is_dir"] = dec.readBool();
1948
+ break;
1949
+ case "entries":
1950
+ o["entries"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1951
+ a.push(decodeCBORSourceEntryFrom(dec));
1952
+ } return a; })();
1953
+ break;
1954
+ default: dec.skip();
1955
+ }
1956
+ }
1957
+ return o;
1958
+ }
1959
+ function encodeCBORSourcePackRequest(v) {
1960
+ const out = [];
1961
+ appendCBORSourcePackRequest(out, v);
1962
+ return new Uint8Array(out);
1963
+ }
1964
+ function appendCBORSourcePackRequest(out, v) {
1965
+ let n = 2;
1966
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1967
+ (0, cbor_gen_ts_1.writeText)(out, "op");
1968
+ (0, cbor_gen_ts_1.writeText)(out, v.op);
1969
+ (0, cbor_gen_ts_1.writeText)(out, "path");
1970
+ (0, cbor_gen_ts_1.writeText)(out, v.path);
1971
+ }
1972
+ function decodeCBORSourcePackRequest(data) {
1973
+ const dec = new cbor_gen_ts_1.CborDec(data);
1974
+ return decodeCBORSourcePackRequestFrom(dec);
1975
+ }
1976
+ function decodeCBORSourcePackRequestFrom(dec) {
1977
+ const o = {};
1978
+ const n = dec.readMapHeader();
1979
+ for (let i = 0; i < n; i++) {
1980
+ const k = dec.readText();
1981
+ switch (k) {
1982
+ case "op":
1983
+ o["op"] = dec.readText();
1984
+ break;
1985
+ case "path":
1986
+ o["path"] = dec.readText();
1987
+ break;
1988
+ default: dec.skip();
1989
+ }
1990
+ }
1991
+ return o;
1992
+ }
1993
+ function encodeCBORSourcePackResponse(v) {
1994
+ const out = [];
1995
+ appendCBORSourcePackResponse(out, v);
1996
+ return new Uint8Array(out);
1997
+ }
1998
+ function appendCBORSourcePackResponse(out, v) {
1999
+ let n = 0;
2000
+ if (v.error !== undefined && v.error !== "")
2001
+ n++;
2002
+ if (v.source_projection !== undefined && v.source_projection !== null)
2003
+ n++;
2004
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "")
2005
+ n++;
2006
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2007
+ if (v.error !== undefined && v.error !== "") {
2008
+ (0, cbor_gen_ts_1.writeText)(out, "error");
2009
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
2010
+ }
2011
+ if (v.source_projection !== undefined && v.source_projection !== null) {
2012
+ (0, cbor_gen_ts_1.writeText)(out, "source_projection");
2013
+ appendCBORSourceProjection(out, v.source_projection);
2014
+ }
2015
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "") {
2016
+ (0, cbor_gen_ts_1.writeText)(out, "hostfunc_error_code");
2017
+ (0, cbor_gen_ts_1.writeText)(out, v.hostfunc_error_code);
2018
+ }
2019
+ }
2020
+ function decodeCBORSourcePackResponse(data) {
2021
+ const dec = new cbor_gen_ts_1.CborDec(data);
2022
+ return decodeCBORSourcePackResponseFrom(dec);
2023
+ }
2024
+ function decodeCBORSourcePackResponseFrom(dec) {
2025
+ const o = {};
2026
+ const n = dec.readMapHeader();
2027
+ for (let i = 0; i < n; i++) {
2028
+ const k = dec.readText();
2029
+ switch (k) {
2030
+ case "source_projection":
2031
+ o["source_projection"] = decodeCBORSourceProjectionFrom(dec);
2032
+ break;
2033
+ case "error":
2034
+ o["error"] = dec.readText();
2035
+ break;
2036
+ case "hostfunc_error_code":
2037
+ o["hostfunc_error_code"] = dec.readText();
2038
+ break;
2039
+ default: dec.skip();
2040
+ }
2041
+ }
2042
+ return o;
2043
+ }
2044
+ function encodeCBORSourceFileRequest(v) {
2045
+ const out = [];
2046
+ appendCBORSourceFileRequest(out, v);
2047
+ return new Uint8Array(out);
2048
+ }
2049
+ function appendCBORSourceFileRequest(out, v) {
2050
+ let n = 1;
2051
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2052
+ (0, cbor_gen_ts_1.writeText)(out, "path");
2053
+ (0, cbor_gen_ts_1.writeText)(out, v.path);
2054
+ }
2055
+ function decodeCBORSourceFileRequest(data) {
2056
+ const dec = new cbor_gen_ts_1.CborDec(data);
2057
+ return decodeCBORSourceFileRequestFrom(dec);
2058
+ }
2059
+ function decodeCBORSourceFileRequestFrom(dec) {
2060
+ const o = {};
2061
+ const n = dec.readMapHeader();
2062
+ for (let i = 0; i < n; i++) {
2063
+ const k = dec.readText();
2064
+ switch (k) {
2065
+ case "path":
2066
+ o["path"] = dec.readText();
2067
+ break;
2068
+ default: dec.skip();
2069
+ }
2070
+ }
2071
+ return o;
2072
+ }
2073
+ function encodeCBORSourceFileResponse(v) {
2074
+ const out = [];
2075
+ appendCBORSourceFileResponse(out, v);
2076
+ return new Uint8Array(out);
2077
+ }
2078
+ function appendCBORSourceFileResponse(out, v) {
2079
+ let n = 0;
2080
+ if (v.error !== undefined && v.error !== "")
2081
+ n++;
2082
+ if (v.content !== undefined && v.content !== "")
2083
+ n++;
2084
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "")
2085
+ n++;
2086
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2087
+ if (v.error !== undefined && v.error !== "") {
2088
+ (0, cbor_gen_ts_1.writeText)(out, "error");
2089
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
2090
+ }
2091
+ if (v.content !== undefined && v.content !== "") {
2092
+ (0, cbor_gen_ts_1.writeText)(out, "content");
2093
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.content));
2094
+ }
2095
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "") {
2096
+ (0, cbor_gen_ts_1.writeText)(out, "hostfunc_error_code");
2097
+ (0, cbor_gen_ts_1.writeText)(out, v.hostfunc_error_code);
2098
+ }
2099
+ }
2100
+ function decodeCBORSourceFileResponse(data) {
2101
+ const dec = new cbor_gen_ts_1.CborDec(data);
2102
+ return decodeCBORSourceFileResponseFrom(dec);
2103
+ }
2104
+ function decodeCBORSourceFileResponseFrom(dec) {
2105
+ const o = {};
2106
+ const n = dec.readMapHeader();
2107
+ for (let i = 0; i < n; i++) {
2108
+ const k = dec.readText();
2109
+ switch (k) {
2110
+ case "content":
2111
+ o["content"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
2112
+ break;
2113
+ case "error":
2114
+ o["error"] = dec.readText();
2115
+ break;
2116
+ case "hostfunc_error_code":
2117
+ o["hostfunc_error_code"] = dec.readText();
2118
+ break;
2119
+ default: dec.skip();
2120
+ }
2121
+ }
2122
+ return o;
2123
+ }
2124
+ function encodeCBORFetchExternalInputResponse(v) {
2125
+ const out = [];
2126
+ appendCBORFetchExternalInputResponse(out, v);
2127
+ return new Uint8Array(out);
2128
+ }
2129
+ function appendCBORFetchExternalInputResponse(out, v) {
2130
+ let n = 0;
2131
+ if (v.error !== undefined && v.error !== "")
2132
+ n++;
2133
+ if (v.content !== undefined && v.content !== "")
2134
+ n++;
2135
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "")
2136
+ n++;
2137
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2138
+ if (v.error !== undefined && v.error !== "") {
2139
+ (0, cbor_gen_ts_1.writeText)(out, "error");
2140
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
2141
+ }
2142
+ if (v.content !== undefined && v.content !== "") {
2143
+ (0, cbor_gen_ts_1.writeText)(out, "content");
2144
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.content));
2145
+ }
2146
+ if (v.hostfunc_error_code !== undefined && v.hostfunc_error_code !== "") {
2147
+ (0, cbor_gen_ts_1.writeText)(out, "hostfunc_error_code");
2148
+ (0, cbor_gen_ts_1.writeText)(out, v.hostfunc_error_code);
2149
+ }
2150
+ }
2151
+ function decodeCBORFetchExternalInputResponse(data) {
2152
+ const dec = new cbor_gen_ts_1.CborDec(data);
2153
+ return decodeCBORFetchExternalInputResponseFrom(dec);
2154
+ }
2155
+ function decodeCBORFetchExternalInputResponseFrom(dec) {
2156
+ const o = {};
2157
+ const n = dec.readMapHeader();
2158
+ for (let i = 0; i < n; i++) {
2159
+ const k = dec.readText();
2160
+ switch (k) {
2161
+ case "content":
2162
+ o["content"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
2163
+ break;
2164
+ case "error":
2165
+ o["error"] = dec.readText();
2166
+ break;
2167
+ case "hostfunc_error_code":
2168
+ o["hostfunc_error_code"] = dec.readText();
2169
+ break;
2170
+ default: dec.skip();
2171
+ }
2172
+ }
2173
+ return o;
2174
+ }
2175
+ function encodeCBORWorkloadProjection(v) {
2176
+ const out = [];
2177
+ appendCBORWorkloadProjection(out, v);
2178
+ return new Uint8Array(out);
2179
+ }
2180
+ function appendCBORWorkloadProjection(out, v) {
2181
+ let n = 1;
2182
+ if (v.sensitive_workload !== undefined && v.sensitive_workload !== false)
2183
+ n++;
2184
+ if (v.attachment_provides !== undefined && Object.keys(v.attachment_provides).length > 0)
2185
+ n++;
2186
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2187
+ (0, cbor_gen_ts_1.writeText)(out, "workload");
2188
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.workload)));
2189
+ if (v.sensitive_workload !== undefined && v.sensitive_workload !== false) {
2190
+ (0, cbor_gen_ts_1.writeText)(out, "sensitive_workload");
2191
+ (0, cbor_gen_ts_1.writeBool)(out, v.sensitive_workload);
2192
+ }
2193
+ if (v.attachment_provides !== undefined && Object.keys(v.attachment_provides).length > 0) {
2194
+ (0, cbor_gen_ts_1.writeText)(out, "attachment_provides");
2195
+ {
2196
+ const m0 = v.attachment_provides;
2197
+ const ks0 = Object.keys(m0);
2198
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
2199
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
2200
+ for (const kk0 of ks0) {
2201
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
2202
+ {
2203
+ const m1 = m0[kk0];
2204
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m1.size);
2205
+ for (const [kk1, vv1] of m1) {
2206
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
2207
+ (0, cbor_gen_ts_1.writeText)(out, kk1);
2208
+ (0, cbor_gen_ts_1.writeText)(out, vv1);
2209
+ }
2210
+ }
2211
+ }
2212
+ }
2213
+ }
2214
+ }
2215
+ function decodeCBORWorkloadProjection(data) {
2216
+ const dec = new cbor_gen_ts_1.CborDec(data);
2217
+ return decodeCBORWorkloadProjectionFrom(dec);
2218
+ }
2219
+ function decodeCBORWorkloadProjectionFrom(dec) {
2220
+ const o = {};
2221
+ const n = dec.readMapHeader();
2222
+ for (let i = 0; i < n; i++) {
2223
+ const k = dec.readText();
2224
+ switch (k) {
2225
+ case "workload":
2226
+ o["workload"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
2227
+ break;
2228
+ case "sensitive_workload":
2229
+ o["sensitive_workload"] = dec.readBool();
2230
+ break;
2231
+ case "attachment_provides":
2232
+ o["attachment_provides"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
2233
+ const mk = dec.readText();
2234
+ m[mk] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
2235
+ const mk = dec.readEntryKey();
2236
+ if (m.has(mk))
2237
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
2238
+ m.set(mk, dec.readText());
2239
+ } return m; })();
2240
+ } return m; })();
2241
+ break;
2242
+ default: dec.skip();
2243
+ }
2244
+ }
2245
+ return o;
2246
+ }
2247
+ function encodeCBORArtifactsProjection(v) {
2248
+ const out = [];
2249
+ appendCBORArtifactsProjection(out, v);
2250
+ return new Uint8Array(out);
2251
+ }
2252
+ function appendCBORArtifactsProjection(out, v) {
2253
+ let n = 1;
2254
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2255
+ (0, cbor_gen_ts_1.writeText)(out, "entries");
2256
+ {
2257
+ const a0 = v.entries;
2258
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2259
+ for (const ee0 of a0) {
2260
+ appendCBORArtifactProjectionEntry(out, ee0);
2261
+ }
2262
+ }
2263
+ }
2264
+ function decodeCBORArtifactsProjection(data) {
2265
+ const dec = new cbor_gen_ts_1.CborDec(data);
2266
+ return decodeCBORArtifactsProjectionFrom(dec);
2267
+ }
2268
+ function decodeCBORArtifactsProjectionFrom(dec) {
2269
+ const o = {};
2270
+ const n = dec.readMapHeader();
2271
+ for (let i = 0; i < n; i++) {
2272
+ const k = dec.readText();
2273
+ switch (k) {
2274
+ case "entries":
2275
+ o["entries"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2276
+ a.push(decodeCBORArtifactProjectionEntryFrom(dec));
2277
+ } return a; })();
2278
+ break;
2279
+ default: dec.skip();
2280
+ }
2281
+ }
2282
+ return o;
2283
+ }
2284
+ function encodeCBORArtifactProjectionEntry(v) {
2285
+ const out = [];
2286
+ appendCBORArtifactProjectionEntry(out, v);
2287
+ return new Uint8Array(out);
2288
+ }
2289
+ function appendCBORArtifactProjectionEntry(out, v) {
2290
+ let n = 3;
2291
+ if (v.labels !== undefined && Object.keys(v.labels).length > 0)
2292
+ n++;
2293
+ if (v.annotations !== undefined && Object.keys(v.annotations).length > 0)
2294
+ n++;
2295
+ if (v.sensitive_content !== undefined && v.sensitive_content !== false)
2296
+ n++;
2297
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2298
+ (0, cbor_gen_ts_1.writeText)(out, "name");
2299
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
2300
+ if (v.labels !== undefined && Object.keys(v.labels).length > 0) {
2301
+ (0, cbor_gen_ts_1.writeText)(out, "labels");
2302
+ {
2303
+ const m0 = v.labels;
2304
+ const ks0 = Object.keys(m0);
2305
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
2306
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
2307
+ for (const kk0 of ks0) {
2308
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
2309
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
2310
+ }
2311
+ }
2312
+ }
2313
+ (0, cbor_gen_ts_1.writeText)(out, "origin");
2314
+ (0, cbor_gen_ts_1.writeText)(out, v.origin);
2315
+ (0, cbor_gen_ts_1.writeText)(out, "content");
2316
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.content));
2317
+ if (v.annotations !== undefined && Object.keys(v.annotations).length > 0) {
2318
+ (0, cbor_gen_ts_1.writeText)(out, "annotations");
2319
+ {
2320
+ const m0 = v.annotations;
2321
+ const ks0 = Object.keys(m0);
2322
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
2323
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
2324
+ for (const kk0 of ks0) {
2325
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
2326
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
2327
+ }
2328
+ }
2329
+ }
2330
+ if (v.sensitive_content !== undefined && v.sensitive_content !== false) {
2331
+ (0, cbor_gen_ts_1.writeText)(out, "sensitive_content");
2332
+ (0, cbor_gen_ts_1.writeBool)(out, v.sensitive_content);
2333
+ }
2334
+ }
2335
+ function decodeCBORArtifactProjectionEntry(data) {
2336
+ const dec = new cbor_gen_ts_1.CborDec(data);
2337
+ return decodeCBORArtifactProjectionEntryFrom(dec);
2338
+ }
2339
+ function decodeCBORArtifactProjectionEntryFrom(dec) {
2340
+ const o = {};
2341
+ const n = dec.readMapHeader();
2342
+ for (let i = 0; i < n; i++) {
2343
+ const k = dec.readText();
2344
+ switch (k) {
2345
+ case "name":
2346
+ o["name"] = dec.readText();
2347
+ break;
2348
+ case "origin":
2349
+ o["origin"] = dec.readText();
2350
+ break;
2351
+ case "content":
2352
+ o["content"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
2353
+ break;
2354
+ case "sensitive_content":
2355
+ o["sensitive_content"] = dec.readBool();
2356
+ break;
2357
+ case "labels":
2358
+ o["labels"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
2359
+ const mk = dec.readText();
2360
+ m[mk] = dec.readText();
2361
+ } return m; })();
2362
+ break;
2363
+ case "annotations":
2364
+ o["annotations"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
2365
+ const mk = dec.readText();
2366
+ m[mk] = dec.readText();
2367
+ } return m; })();
2368
+ break;
2369
+ default: dec.skip();
2370
+ }
2371
+ }
2372
+ return o;
2373
+ }
2374
+ function encodeCBORAssembleBoundaryInput(v) {
2375
+ const out = [];
2376
+ appendCBORAssembleBoundaryInput(out, v);
2377
+ return new Uint8Array(out);
2378
+ }
2379
+ function appendCBORAssembleBoundaryInput(out, v) {
2380
+ let n = 3;
2381
+ if (v.edges !== undefined && v.edges.length > 0)
2382
+ n++;
2383
+ if (v.chart_name !== undefined && v.chart_name !== "")
2384
+ n++;
2385
+ if (v.sub_charts !== undefined && v.sub_charts.length > 0)
2386
+ n++;
2387
+ if (v.aggregate_name !== undefined && v.aggregate_name !== "")
2388
+ n++;
2389
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2390
+ if (v.edges !== undefined && v.edges.length > 0) {
2391
+ (0, cbor_gen_ts_1.writeText)(out, "edges");
2392
+ {
2393
+ const a0 = v.edges;
2394
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2395
+ for (const ee0 of a0) {
2396
+ appendCBORRenderEdge(out, ee0);
2397
+ }
2398
+ }
2399
+ }
2400
+ (0, cbor_gen_ts_1.writeText)(out, "context");
2401
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.context)));
2402
+ if (v.chart_name !== undefined && v.chart_name !== "") {
2403
+ (0, cbor_gen_ts_1.writeText)(out, "chart_name");
2404
+ (0, cbor_gen_ts_1.writeText)(out, v.chart_name);
2405
+ }
2406
+ if (v.sub_charts !== undefined && v.sub_charts.length > 0) {
2407
+ (0, cbor_gen_ts_1.writeText)(out, "sub_charts");
2408
+ {
2409
+ const a0 = v.sub_charts;
2410
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2411
+ for (const ee0 of a0) {
2412
+ appendCBORSubChart(out, ee0);
2413
+ }
2414
+ }
2415
+ }
2416
+ (0, cbor_gen_ts_1.writeText)(out, "boundary_path");
2417
+ (0, cbor_gen_ts_1.writeText)(out, v.boundary_path);
2418
+ if (v.aggregate_name !== undefined && v.aggregate_name !== "") {
2419
+ (0, cbor_gen_ts_1.writeText)(out, "aggregate_name");
2420
+ (0, cbor_gen_ts_1.writeText)(out, v.aggregate_name);
2421
+ }
2422
+ (0, cbor_gen_ts_1.writeText)(out, "rendered_nodes");
2423
+ {
2424
+ const a0 = v.rendered_nodes;
2425
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2426
+ for (const ee0 of a0) {
2427
+ appendCBORRenderedNode(out, ee0);
2428
+ }
2429
+ }
2430
+ }
2431
+ function decodeCBORAssembleBoundaryInput(data) {
2432
+ const dec = new cbor_gen_ts_1.CborDec(data);
2433
+ return decodeCBORAssembleBoundaryInputFrom(dec);
2434
+ }
2435
+ function decodeCBORAssembleBoundaryInputFrom(dec) {
2436
+ const o = {};
2437
+ const n = dec.readMapHeader();
2438
+ for (let i = 0; i < n; i++) {
2439
+ const k = dec.readText();
2440
+ switch (k) {
2441
+ case "rendered_nodes":
2442
+ o["rendered_nodes"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2443
+ a.push(decodeCBORRenderedNodeFrom(dec));
2444
+ } return a; })();
2445
+ break;
2446
+ case "context":
2447
+ o["context"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
2448
+ break;
2449
+ case "boundary_path":
2450
+ o["boundary_path"] = dec.readText();
2451
+ break;
2452
+ case "edges":
2453
+ o["edges"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2454
+ a.push(decodeCBORRenderEdgeFrom(dec));
2455
+ } return a; })();
2456
+ break;
2457
+ case "sub_charts":
2458
+ o["sub_charts"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2459
+ a.push(decodeCBORSubChartFrom(dec));
2460
+ } return a; })();
2461
+ break;
2462
+ case "chart_name":
2463
+ o["chart_name"] = dec.readText();
2464
+ break;
2465
+ case "aggregate_name":
2466
+ o["aggregate_name"] = dec.readText();
2467
+ break;
2468
+ default: dec.skip();
2469
+ }
2470
+ }
2471
+ return o;
2472
+ }
2473
+ function encodeCBORRenderedNode(v) {
2474
+ const out = [];
2475
+ appendCBORRenderedNode(out, v);
2476
+ return new Uint8Array(out);
2477
+ }
2478
+ function appendCBORRenderedNode(out, v) {
2479
+ let n = 3;
2480
+ if (v.values !== undefined && v.values.size > 0)
2481
+ n++;
2482
+ if (v.sync_wave !== undefined && v.sync_wave !== 0)
2483
+ n++;
2484
+ if (v.annotations !== undefined && v.annotations.size > 0)
2485
+ n++;
2486
+ if (v.values_mapped !== undefined && v.values_mapped !== false)
2487
+ n++;
2488
+ if (v.output_directory !== undefined && v.output_directory !== "")
2489
+ n++;
2490
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "")
2491
+ n++;
2492
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2493
+ (0, cbor_gen_ts_1.writeText)(out, "id");
2494
+ (0, cbor_gen_ts_1.writeText)(out, v.id);
2495
+ (0, cbor_gen_ts_1.writeText)(out, "type");
2496
+ (0, cbor_gen_ts_1.writeText)(out, v.type);
2497
+ if (v.values !== undefined && v.values.size > 0) {
2498
+ (0, cbor_gen_ts_1.writeText)(out, "values");
2499
+ {
2500
+ const m0 = v.values;
2501
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
2502
+ for (const [kk0, vv0] of m0) {
2503
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
2504
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
2505
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
2506
+ }
2507
+ }
2508
+ }
2509
+ (0, cbor_gen_ts_1.writeText)(out, "rendered");
2510
+ appendCBORRenderNodeOutput(out, v.rendered);
2511
+ if (v.sync_wave !== undefined && v.sync_wave !== 0) {
2512
+ (0, cbor_gen_ts_1.writeText)(out, "sync_wave");
2513
+ (0, cbor_gen_ts_1.writeInt)(out, v.sync_wave);
2514
+ }
2515
+ if (v.annotations !== undefined && v.annotations.size > 0) {
2516
+ (0, cbor_gen_ts_1.writeText)(out, "annotations");
2517
+ {
2518
+ const m0 = v.annotations;
2519
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
2520
+ for (const [kk0, vv0] of m0) {
2521
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
2522
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
2523
+ (0, cbor_gen_ts_1.writeText)(out, vv0);
2524
+ }
2525
+ }
2526
+ }
2527
+ if (v.values_mapped !== undefined && v.values_mapped !== false) {
2528
+ (0, cbor_gen_ts_1.writeText)(out, "values_mapped");
2529
+ (0, cbor_gen_ts_1.writeBool)(out, v.values_mapped);
2530
+ }
2531
+ if (v.output_directory !== undefined && v.output_directory !== "") {
2532
+ (0, cbor_gen_ts_1.writeText)(out, "output_directory");
2533
+ (0, cbor_gen_ts_1.writeText)(out, v.output_directory);
2534
+ }
2535
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "") {
2536
+ (0, cbor_gen_ts_1.writeText)(out, "derived_name_basis");
2537
+ (0, cbor_gen_ts_1.writeText)(out, v.derived_name_basis);
2538
+ }
2539
+ }
2540
+ function decodeCBORRenderedNode(data) {
2541
+ const dec = new cbor_gen_ts_1.CborDec(data);
2542
+ return decodeCBORRenderedNodeFrom(dec);
2543
+ }
2544
+ function decodeCBORRenderedNodeFrom(dec) {
2545
+ const o = {};
2546
+ const n = dec.readMapHeader();
2547
+ for (let i = 0; i < n; i++) {
2548
+ const k = dec.readText();
2549
+ switch (k) {
2550
+ case "id":
2551
+ o["id"] = dec.readText();
2552
+ break;
2553
+ case "type":
2554
+ o["type"] = dec.readText();
2555
+ break;
2556
+ case "derived_name_basis":
2557
+ o["derived_name_basis"] = dec.readText();
2558
+ break;
2559
+ case "output_directory":
2560
+ o["output_directory"] = dec.readText();
2561
+ break;
2562
+ case "rendered":
2563
+ o["rendered"] = decodeCBORRenderNodeOutputFrom(dec);
2564
+ break;
2565
+ case "annotations":
2566
+ o["annotations"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
2567
+ const mk = dec.readEntryKey();
2568
+ if (m.has(mk))
2569
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
2570
+ m.set(mk, dec.readText());
2571
+ } return m; })();
2572
+ break;
2573
+ case "sync_wave":
2574
+ o["sync_wave"] = dec.readInt();
2575
+ break;
2576
+ case "values":
2577
+ o["values"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
2578
+ const mk = dec.readEntryKey();
2579
+ if (m.has(mk))
2580
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
2581
+ m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
2582
+ } return m; })();
2583
+ break;
2584
+ case "values_mapped":
2585
+ o["values_mapped"] = dec.readBool();
2586
+ break;
2587
+ default: dec.skip();
2588
+ }
2589
+ }
2590
+ return o;
2591
+ }
2592
+ function encodeCBORRenderEdge(v) {
2593
+ const out = [];
2594
+ appendCBORRenderEdge(out, v);
2595
+ return new Uint8Array(out);
2596
+ }
2597
+ function appendCBORRenderEdge(out, v) {
2598
+ let n = 2;
2599
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2600
+ (0, cbor_gen_ts_1.writeText)(out, "source");
2601
+ (0, cbor_gen_ts_1.writeText)(out, v.source);
2602
+ (0, cbor_gen_ts_1.writeText)(out, "target");
2603
+ (0, cbor_gen_ts_1.writeText)(out, v.target);
2604
+ }
2605
+ function decodeCBORRenderEdge(data) {
2606
+ const dec = new cbor_gen_ts_1.CborDec(data);
2607
+ return decodeCBORRenderEdgeFrom(dec);
2608
+ }
2609
+ function decodeCBORRenderEdgeFrom(dec) {
2610
+ const o = {};
2611
+ const n = dec.readMapHeader();
2612
+ for (let i = 0; i < n; i++) {
2613
+ const k = dec.readText();
2614
+ switch (k) {
2615
+ case "source":
2616
+ o["source"] = dec.readText();
2617
+ break;
2618
+ case "target":
2619
+ o["target"] = dec.readText();
2620
+ break;
2621
+ default: dec.skip();
2622
+ }
2623
+ }
2624
+ return o;
2625
+ }
2626
+ function encodeCBORSubChart(v) {
2627
+ const out = [];
2628
+ appendCBORSubChart(out, v);
2629
+ return new Uint8Array(out);
2630
+ }
2631
+ function appendCBORSubChart(out, v) {
2632
+ let n = 1;
2633
+ if (v.values !== undefined && v.values.size > 0)
2634
+ n++;
2635
+ if (v.version !== undefined && v.version !== "")
2636
+ n++;
2637
+ if (v.chart_yaml !== undefined && v.chart_yaml !== "")
2638
+ n++;
2639
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2640
+ if (v.values !== undefined && v.values.size > 0) {
2641
+ (0, cbor_gen_ts_1.writeText)(out, "values");
2642
+ {
2643
+ const m0 = v.values;
2644
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
2645
+ for (const [kk0, vv0] of m0) {
2646
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
2647
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
2648
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
2649
+ }
2650
+ }
2651
+ }
2652
+ if (v.version !== undefined && v.version !== "") {
2653
+ (0, cbor_gen_ts_1.writeText)(out, "version");
2654
+ (0, cbor_gen_ts_1.writeText)(out, v.version);
2655
+ }
2656
+ if (v.chart_yaml !== undefined && v.chart_yaml !== "") {
2657
+ (0, cbor_gen_ts_1.writeText)(out, "chart_yaml");
2658
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.chart_yaml));
2659
+ }
2660
+ (0, cbor_gen_ts_1.writeText)(out, "instance_id");
2661
+ (0, cbor_gen_ts_1.writeText)(out, v.instance_id);
2662
+ }
2663
+ function decodeCBORSubChart(data) {
2664
+ const dec = new cbor_gen_ts_1.CborDec(data);
2665
+ return decodeCBORSubChartFrom(dec);
2666
+ }
2667
+ function decodeCBORSubChartFrom(dec) {
2668
+ const o = {};
2669
+ const n = dec.readMapHeader();
2670
+ for (let i = 0; i < n; i++) {
2671
+ const k = dec.readText();
2672
+ switch (k) {
2673
+ case "instance_id":
2674
+ o["instance_id"] = dec.readText();
2675
+ break;
2676
+ case "version":
2677
+ o["version"] = dec.readText();
2678
+ break;
2679
+ case "values":
2680
+ o["values"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
2681
+ const mk = dec.readEntryKey();
2682
+ if (m.has(mk))
2683
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
2684
+ m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
2685
+ } return m; })();
2686
+ break;
2687
+ case "chart_yaml":
2688
+ o["chart_yaml"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
2689
+ break;
2690
+ default: dec.skip();
2691
+ }
2692
+ }
2693
+ return o;
2694
+ }
2695
+ function encodeCBORAssembleBoundaryOutput(v) {
2696
+ const out = [];
2697
+ appendCBORAssembleBoundaryOutput(out, v);
2698
+ return new Uint8Array(out);
2699
+ }
2700
+ function appendCBORAssembleBoundaryOutput(out, v) {
2701
+ let n = 1;
2702
+ if (v.error !== undefined && v.error !== "")
2703
+ n++;
2704
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0)
2705
+ n++;
2706
+ if (v.condition_code !== undefined && v.condition_code !== "")
2707
+ n++;
2708
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
2709
+ n++;
2710
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2711
+ if (v.error !== undefined && v.error !== "") {
2712
+ (0, cbor_gen_ts_1.writeText)(out, "error");
2713
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
2714
+ }
2715
+ (0, cbor_gen_ts_1.writeText)(out, "files");
2716
+ {
2717
+ const a0 = v.files;
2718
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2719
+ for (const ee0 of a0) {
2720
+ appendCBORRenderedFile(out, ee0);
2721
+ }
2722
+ }
2723
+ if (v.diagnostics !== undefined && v.diagnostics.length > 0) {
2724
+ (0, cbor_gen_ts_1.writeText)(out, "diagnostics");
2725
+ {
2726
+ const a0 = v.diagnostics;
2727
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2728
+ for (const ee0 of a0) {
2729
+ (0, diagnostic_gen_ts_2.appendCBORDiagnostic)(out, ee0);
2730
+ }
2731
+ }
2732
+ }
2733
+ if (v.condition_code !== undefined && v.condition_code !== "") {
2734
+ (0, cbor_gen_ts_1.writeText)(out, "condition_code");
2735
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_code);
2736
+ }
2737
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "") {
2738
+ (0, cbor_gen_ts_1.writeText)(out, "condition_short_code");
2739
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_short_code);
2740
+ }
2741
+ }
2742
+ function decodeCBORAssembleBoundaryOutput(data) {
2743
+ const dec = new cbor_gen_ts_1.CborDec(data);
2744
+ return decodeCBORAssembleBoundaryOutputFrom(dec);
2745
+ }
2746
+ function decodeCBORAssembleBoundaryOutputFrom(dec) {
2747
+ const o = {};
2748
+ const n = dec.readMapHeader();
2749
+ for (let i = 0; i < n; i++) {
2750
+ const k = dec.readText();
2751
+ switch (k) {
2752
+ case "files":
2753
+ o["files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2754
+ a.push(decodeCBORRenderedFileFrom(dec));
2755
+ } return a; })();
2756
+ break;
2757
+ case "diagnostics":
2758
+ o["diagnostics"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2759
+ a.push((0, diagnostic_gen_ts_2.decodeCBORDiagnosticFrom)(dec));
2760
+ } return a; })();
2761
+ break;
2762
+ case "error":
2763
+ o["error"] = dec.readText();
2764
+ break;
2765
+ case "condition_code":
2766
+ o["condition_code"] = dec.readText();
2767
+ break;
2768
+ case "condition_short_code":
2769
+ o["condition_short_code"] = dec.readText();
2770
+ break;
2771
+ default: dec.skip();
2772
+ }
2773
+ }
2774
+ return o;
2775
+ }
2776
+ function encodeCBORCarveInput(v) {
2777
+ const out = [];
2778
+ appendCBORCarveInput(out, v);
2779
+ return new Uint8Array(out);
2780
+ }
2781
+ function appendCBORCarveInput(out, v) {
2782
+ let n = 2;
2783
+ if (v.yaml_indent !== undefined && v.yaml_indent !== 0)
2784
+ n++;
2785
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2786
+ (0, cbor_gen_ts_1.writeText)(out, "body");
2787
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.body));
2788
+ (0, cbor_gen_ts_1.writeText)(out, "name");
2789
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
2790
+ if (v.yaml_indent !== undefined && v.yaml_indent !== 0) {
2791
+ (0, cbor_gen_ts_1.writeText)(out, "yaml_indent");
2792
+ (0, cbor_gen_ts_1.writeInt)(out, v.yaml_indent);
2793
+ }
2794
+ }
2795
+ function decodeCBORCarveInput(data) {
2796
+ const dec = new cbor_gen_ts_1.CborDec(data);
2797
+ return decodeCBORCarveInputFrom(dec);
2798
+ }
2799
+ function decodeCBORCarveInputFrom(dec) {
2800
+ const o = {};
2801
+ const n = dec.readMapHeader();
2802
+ for (let i = 0; i < n; i++) {
2803
+ const k = dec.readText();
2804
+ switch (k) {
2805
+ case "name":
2806
+ o["name"] = dec.readText();
2807
+ break;
2808
+ case "body":
2809
+ o["body"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
2810
+ break;
2811
+ case "yaml_indent":
2812
+ o["yaml_indent"] = dec.readInt();
2813
+ break;
2814
+ default: dec.skip();
2815
+ }
2816
+ }
2817
+ return o;
2818
+ }
2819
+ function encodeCBORCarveOutput(v) {
2820
+ const out = [];
2821
+ appendCBORCarveOutput(out, v);
2822
+ return new Uint8Array(out);
2823
+ }
2824
+ function appendCBORCarveOutput(out, v) {
2825
+ let n = 1;
2826
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2827
+ (0, cbor_gen_ts_1.writeText)(out, "units");
2828
+ {
2829
+ const a0 = v.units;
2830
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2831
+ for (const ee0 of a0) {
2832
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(ee0)));
2833
+ }
2834
+ }
2835
+ }
2836
+ function decodeCBORCarveOutput(data) {
2837
+ const dec = new cbor_gen_ts_1.CborDec(data);
2838
+ return decodeCBORCarveOutputFrom(dec);
2839
+ }
2840
+ function decodeCBORCarveOutputFrom(dec) {
2841
+ const o = {};
2842
+ const n = dec.readMapHeader();
2843
+ for (let i = 0; i < n; i++) {
2844
+ const k = dec.readText();
2845
+ switch (k) {
2846
+ case "units":
2847
+ o["units"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2848
+ a.push(JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
2849
+ } return a; })();
2850
+ break;
2851
+ default: dec.skip();
2852
+ }
2853
+ }
2854
+ return o;
2855
+ }
2856
+ function encodeCBORReassembleInput(v) {
2857
+ const out = [];
2858
+ appendCBORReassembleInput(out, v);
2859
+ return new Uint8Array(out);
2860
+ }
2861
+ function appendCBORReassembleInput(out, v) {
2862
+ let n = 2;
2863
+ if (v.segs !== undefined && v.segs.length > 0)
2864
+ n++;
2865
+ if (v.patched !== undefined && v.patched.length > 0)
2866
+ n++;
2867
+ if (v.yaml_indent !== undefined && v.yaml_indent !== 0)
2868
+ n++;
2869
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2870
+ (0, cbor_gen_ts_1.writeText)(out, "body");
2871
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.body));
2872
+ (0, cbor_gen_ts_1.writeText)(out, "name");
2873
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
2874
+ if (v.segs !== undefined && v.segs.length > 0) {
2875
+ (0, cbor_gen_ts_1.writeText)(out, "segs");
2876
+ {
2877
+ const a0 = v.segs;
2878
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2879
+ for (const ee0 of a0) {
2880
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(ee0)));
2881
+ }
2882
+ }
2883
+ }
2884
+ if (v.patched !== undefined && v.patched.length > 0) {
2885
+ (0, cbor_gen_ts_1.writeText)(out, "patched");
2886
+ {
2887
+ const a0 = v.patched;
2888
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2889
+ for (const ee0 of a0) {
2890
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(ee0)));
2891
+ }
2892
+ }
2893
+ }
2894
+ if (v.yaml_indent !== undefined && v.yaml_indent !== 0) {
2895
+ (0, cbor_gen_ts_1.writeText)(out, "yaml_indent");
2896
+ (0, cbor_gen_ts_1.writeInt)(out, v.yaml_indent);
2897
+ }
2898
+ }
2899
+ function decodeCBORReassembleInput(data) {
2900
+ const dec = new cbor_gen_ts_1.CborDec(data);
2901
+ return decodeCBORReassembleInputFrom(dec);
2902
+ }
2903
+ function decodeCBORReassembleInputFrom(dec) {
2904
+ const o = {};
2905
+ const n = dec.readMapHeader();
2906
+ for (let i = 0; i < n; i++) {
2907
+ const k = dec.readText();
2908
+ switch (k) {
2909
+ case "name":
2910
+ o["name"] = dec.readText();
2911
+ break;
2912
+ case "body":
2913
+ o["body"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
2914
+ break;
2915
+ case "segs":
2916
+ o["segs"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2917
+ a.push(JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
2918
+ } return a; })();
2919
+ break;
2920
+ case "patched":
2921
+ o["patched"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
2922
+ a.push(JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
2923
+ } return a; })();
2924
+ break;
2925
+ case "yaml_indent":
2926
+ o["yaml_indent"] = dec.readInt();
2927
+ break;
2928
+ default: dec.skip();
2929
+ }
2930
+ }
2931
+ return o;
2932
+ }
2933
+ function encodeCBORReassembleOutput(v) {
2934
+ const out = [];
2935
+ appendCBORReassembleOutput(out, v);
2936
+ return new Uint8Array(out);
2937
+ }
2938
+ function appendCBORReassembleOutput(out, v) {
2939
+ let n = 1;
2940
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2941
+ (0, cbor_gen_ts_1.writeText)(out, "body");
2942
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.body));
2943
+ }
2944
+ function decodeCBORReassembleOutput(data) {
2945
+ const dec = new cbor_gen_ts_1.CborDec(data);
2946
+ return decodeCBORReassembleOutputFrom(dec);
2947
+ }
2948
+ function decodeCBORReassembleOutputFrom(dec) {
2949
+ const o = {};
2950
+ const n = dec.readMapHeader();
2951
+ for (let i = 0; i < n; i++) {
2952
+ const k = dec.readText();
2953
+ switch (k) {
2954
+ case "body":
2955
+ o["body"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
2956
+ break;
2957
+ default: dec.skip();
2958
+ }
2959
+ }
2960
+ return o;
2961
+ }
2962
+ function encodeCBORNameBoundInput(v) {
2963
+ const out = [];
2964
+ appendCBORNameBoundInput(out, v);
2965
+ return new Uint8Array(out);
2966
+ }
2967
+ function appendCBORNameBoundInput(out, v) {
2968
+ let n = 1;
2969
+ if (v.authored !== undefined && v.authored !== false)
2970
+ n++;
2971
+ if (v.service_keys !== undefined && v.service_keys.length > 0)
2972
+ n++;
2973
+ if (v.workload_form !== undefined && v.workload_form !== "")
2974
+ n++;
2975
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
2976
+ if (v.authored !== undefined && v.authored !== false) {
2977
+ (0, cbor_gen_ts_1.writeText)(out, "authored");
2978
+ (0, cbor_gen_ts_1.writeBool)(out, v.authored);
2979
+ }
2980
+ (0, cbor_gen_ts_1.writeText)(out, "proposed");
2981
+ (0, cbor_gen_ts_1.writeText)(out, v.proposed);
2982
+ if (v.service_keys !== undefined && v.service_keys.length > 0) {
2983
+ (0, cbor_gen_ts_1.writeText)(out, "service_keys");
2984
+ {
2985
+ const a0 = v.service_keys;
2986
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
2987
+ for (const ee0 of a0) {
2988
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
2989
+ }
2990
+ }
2991
+ }
2992
+ if (v.workload_form !== undefined && v.workload_form !== "") {
2993
+ (0, cbor_gen_ts_1.writeText)(out, "workload_form");
2994
+ (0, cbor_gen_ts_1.writeText)(out, v.workload_form);
2995
+ }
2996
+ }
2997
+ function decodeCBORNameBoundInput(data) {
2998
+ const dec = new cbor_gen_ts_1.CborDec(data);
2999
+ return decodeCBORNameBoundInputFrom(dec);
3000
+ }
3001
+ function decodeCBORNameBoundInputFrom(dec) {
3002
+ const o = {};
3003
+ const n = dec.readMapHeader();
3004
+ for (let i = 0; i < n; i++) {
3005
+ const k = dec.readText();
3006
+ switch (k) {
3007
+ case "proposed":
3008
+ o["proposed"] = dec.readText();
3009
+ break;
3010
+ case "authored":
3011
+ o["authored"] = dec.readBool();
3012
+ break;
3013
+ case "workload_form":
3014
+ o["workload_form"] = dec.readText();
3015
+ break;
3016
+ case "service_keys":
3017
+ o["service_keys"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3018
+ a.push(dec.readText());
3019
+ } return a; })();
3020
+ break;
3021
+ default: dec.skip();
3022
+ }
3023
+ }
3024
+ return o;
3025
+ }
3026
+ function encodeCBORDerivedNameVerdict(v) {
3027
+ const out = [];
3028
+ appendCBORDerivedNameVerdict(out, v);
3029
+ return new Uint8Array(out);
3030
+ }
3031
+ function appendCBORDerivedNameVerdict(out, v) {
3032
+ let n = 2;
3033
+ if (v.bound !== undefined && v.bound !== null)
3034
+ n++;
3035
+ if (v.reason !== undefined && v.reason !== "")
3036
+ n++;
3037
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3038
+ (0, cbor_gen_ts_1.writeText)(out, "kind");
3039
+ (0, cbor_gen_ts_1.writeText)(out, v.kind);
3040
+ if (v.bound !== undefined && v.bound !== null) {
3041
+ (0, cbor_gen_ts_1.writeText)(out, "bound");
3042
+ (0, cbor_gen_ts_1.writeInt)(out, v.bound);
3043
+ }
3044
+ if (v.reason !== undefined && v.reason !== "") {
3045
+ (0, cbor_gen_ts_1.writeText)(out, "reason");
3046
+ (0, cbor_gen_ts_1.writeText)(out, v.reason);
3047
+ }
3048
+ (0, cbor_gen_ts_1.writeText)(out, "usable");
3049
+ (0, cbor_gen_ts_1.writeBool)(out, v.usable);
3050
+ }
3051
+ function decodeCBORDerivedNameVerdict(data) {
3052
+ const dec = new cbor_gen_ts_1.CborDec(data);
3053
+ return decodeCBORDerivedNameVerdictFrom(dec);
3054
+ }
3055
+ function decodeCBORDerivedNameVerdictFrom(dec) {
3056
+ const o = {};
3057
+ const n = dec.readMapHeader();
3058
+ for (let i = 0; i < n; i++) {
3059
+ const k = dec.readText();
3060
+ switch (k) {
3061
+ case "kind":
3062
+ o["kind"] = dec.readText();
3063
+ break;
3064
+ case "usable":
3065
+ o["usable"] = dec.readBool();
3066
+ break;
3067
+ case "bound":
3068
+ o["bound"] = dec.readInt();
3069
+ break;
3070
+ case "reason":
3071
+ o["reason"] = dec.readText();
3072
+ break;
3073
+ default: dec.skip();
3074
+ }
3075
+ }
3076
+ return o;
3077
+ }
3078
+ function encodeCBORNameBoundOutput(v) {
3079
+ const out = [];
3080
+ appendCBORNameBoundOutput(out, v);
3081
+ return new Uint8Array(out);
3082
+ }
3083
+ function appendCBORNameBoundOutput(out, v) {
3084
+ let n = 0;
3085
+ if (v.error !== undefined && v.error !== "")
3086
+ n++;
3087
+ if (v.names !== undefined && v.names.length > 0)
3088
+ n++;
3089
+ if (v.condition_code !== undefined && v.condition_code !== "")
3090
+ n++;
3091
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
3092
+ n++;
3093
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3094
+ if (v.error !== undefined && v.error !== "") {
3095
+ (0, cbor_gen_ts_1.writeText)(out, "error");
3096
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
3097
+ }
3098
+ if (v.names !== undefined && v.names.length > 0) {
3099
+ (0, cbor_gen_ts_1.writeText)(out, "names");
3100
+ {
3101
+ const a0 = v.names;
3102
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
3103
+ for (const ee0 of a0) {
3104
+ appendCBORDerivedNameVerdict(out, ee0);
3105
+ }
3106
+ }
3107
+ }
3108
+ if (v.condition_code !== undefined && v.condition_code !== "") {
3109
+ (0, cbor_gen_ts_1.writeText)(out, "condition_code");
3110
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_code);
3111
+ }
3112
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "") {
3113
+ (0, cbor_gen_ts_1.writeText)(out, "condition_short_code");
3114
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_short_code);
3115
+ }
3116
+ }
3117
+ function decodeCBORNameBoundOutput(data) {
3118
+ const dec = new cbor_gen_ts_1.CborDec(data);
3119
+ return decodeCBORNameBoundOutputFrom(dec);
3120
+ }
3121
+ function decodeCBORNameBoundOutputFrom(dec) {
3122
+ const o = {};
3123
+ const n = dec.readMapHeader();
3124
+ for (let i = 0; i < n; i++) {
3125
+ const k = dec.readText();
3126
+ switch (k) {
3127
+ case "names":
3128
+ o["names"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3129
+ a.push(decodeCBORDerivedNameVerdictFrom(dec));
3130
+ } return a; })();
3131
+ break;
3132
+ case "error":
3133
+ o["error"] = dec.readText();
3134
+ break;
3135
+ case "condition_code":
3136
+ o["condition_code"] = dec.readText();
3137
+ break;
3138
+ case "condition_short_code":
3139
+ o["condition_short_code"] = dec.readText();
3140
+ break;
3141
+ default: dec.skip();
3142
+ }
3143
+ }
3144
+ return o;
3145
+ }
3146
+ function encodeCBORRenderedNameInput(v) {
3147
+ const out = [];
3148
+ appendCBORRenderedNameInput(out, v);
3149
+ return new Uint8Array(out);
3150
+ }
3151
+ function appendCBORRenderedNameInput(out, v) {
3152
+ let n = 1;
3153
+ if (v.sourced !== undefined && v.sourced !== false)
3154
+ n++;
3155
+ if (v.synthesized !== undefined && v.synthesized !== false)
3156
+ n++;
3157
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "")
3158
+ n++;
3159
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3160
+ (0, cbor_gen_ts_1.writeText)(out, "node_id");
3161
+ (0, cbor_gen_ts_1.writeText)(out, v.node_id);
3162
+ if (v.sourced !== undefined && v.sourced !== false) {
3163
+ (0, cbor_gen_ts_1.writeText)(out, "sourced");
3164
+ (0, cbor_gen_ts_1.writeBool)(out, v.sourced);
3165
+ }
3166
+ if (v.synthesized !== undefined && v.synthesized !== false) {
3167
+ (0, cbor_gen_ts_1.writeText)(out, "synthesized");
3168
+ (0, cbor_gen_ts_1.writeBool)(out, v.synthesized);
3169
+ }
3170
+ if (v.derived_name_basis !== undefined && v.derived_name_basis !== "") {
3171
+ (0, cbor_gen_ts_1.writeText)(out, "derived_name_basis");
3172
+ (0, cbor_gen_ts_1.writeText)(out, v.derived_name_basis);
3173
+ }
3174
+ }
3175
+ function decodeCBORRenderedNameInput(data) {
3176
+ const dec = new cbor_gen_ts_1.CborDec(data);
3177
+ return decodeCBORRenderedNameInputFrom(dec);
3178
+ }
3179
+ function decodeCBORRenderedNameInputFrom(dec) {
3180
+ const o = {};
3181
+ const n = dec.readMapHeader();
3182
+ for (let i = 0; i < n; i++) {
3183
+ const k = dec.readText();
3184
+ switch (k) {
3185
+ case "node_id":
3186
+ o["node_id"] = dec.readText();
3187
+ break;
3188
+ case "derived_name_basis":
3189
+ o["derived_name_basis"] = dec.readText();
3190
+ break;
3191
+ case "sourced":
3192
+ o["sourced"] = dec.readBool();
3193
+ break;
3194
+ case "synthesized":
3195
+ o["synthesized"] = dec.readBool();
3196
+ break;
3197
+ default: dec.skip();
3198
+ }
3199
+ }
3200
+ return o;
3201
+ }
3202
+ function encodeCBORRenderedNameOutput(v) {
3203
+ const out = [];
3204
+ appendCBORRenderedNameOutput(out, v);
3205
+ return new Uint8Array(out);
3206
+ }
3207
+ function appendCBORRenderedNameOutput(out, v) {
3208
+ let n = 0;
3209
+ if (v.name !== undefined && v.name !== "")
3210
+ n++;
3211
+ if (v.error !== undefined && v.error !== "")
3212
+ n++;
3213
+ if (v.condition_code !== undefined && v.condition_code !== "")
3214
+ n++;
3215
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
3216
+ n++;
3217
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3218
+ if (v.name !== undefined && v.name !== "") {
3219
+ (0, cbor_gen_ts_1.writeText)(out, "name");
3220
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
3221
+ }
3222
+ if (v.error !== undefined && v.error !== "") {
3223
+ (0, cbor_gen_ts_1.writeText)(out, "error");
3224
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
3225
+ }
3226
+ if (v.condition_code !== undefined && v.condition_code !== "") {
3227
+ (0, cbor_gen_ts_1.writeText)(out, "condition_code");
3228
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_code);
3229
+ }
3230
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "") {
3231
+ (0, cbor_gen_ts_1.writeText)(out, "condition_short_code");
3232
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_short_code);
3233
+ }
3234
+ }
3235
+ function decodeCBORRenderedNameOutput(data) {
3236
+ const dec = new cbor_gen_ts_1.CborDec(data);
3237
+ return decodeCBORRenderedNameOutputFrom(dec);
3238
+ }
3239
+ function decodeCBORRenderedNameOutputFrom(dec) {
3240
+ const o = {};
3241
+ const n = dec.readMapHeader();
3242
+ for (let i = 0; i < n; i++) {
3243
+ const k = dec.readText();
3244
+ switch (k) {
3245
+ case "name":
3246
+ o["name"] = dec.readText();
3247
+ break;
3248
+ case "error":
3249
+ o["error"] = dec.readText();
3250
+ break;
3251
+ case "condition_code":
3252
+ o["condition_code"] = dec.readText();
3253
+ break;
3254
+ case "condition_short_code":
3255
+ o["condition_short_code"] = dec.readText();
3256
+ break;
3257
+ default: dec.skip();
3258
+ }
3259
+ }
3260
+ return o;
3261
+ }
3262
+ function encodeCBORLinkEndpoint(v) {
3263
+ const out = [];
3264
+ appendCBORLinkEndpoint(out, v);
3265
+ return new Uint8Array(out);
3266
+ }
3267
+ function appendCBORLinkEndpoint(out, v) {
3268
+ let n = 3;
3269
+ if (v.release !== undefined && v.release !== "")
3270
+ n++;
3271
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3272
+ (0, cbor_gen_ts_1.writeText)(out, "node");
3273
+ (0, cbor_gen_ts_1.writeText)(out, v.node);
3274
+ if (v.release !== undefined && v.release !== "") {
3275
+ (0, cbor_gen_ts_1.writeText)(out, "release");
3276
+ (0, cbor_gen_ts_1.writeText)(out, v.release);
3277
+ }
3278
+ (0, cbor_gen_ts_1.writeText)(out, "boundary");
3279
+ (0, cbor_gen_ts_1.writeText)(out, v.boundary);
3280
+ (0, cbor_gen_ts_1.writeText)(out, "provider");
3281
+ (0, cbor_gen_ts_1.writeText)(out, v.provider);
3282
+ }
3283
+ function decodeCBORLinkEndpoint(data) {
3284
+ const dec = new cbor_gen_ts_1.CborDec(data);
3285
+ return decodeCBORLinkEndpointFrom(dec);
3286
+ }
3287
+ function decodeCBORLinkEndpointFrom(dec) {
3288
+ const o = {};
3289
+ const n = dec.readMapHeader();
3290
+ for (let i = 0; i < n; i++) {
3291
+ const k = dec.readText();
3292
+ switch (k) {
3293
+ case "node":
3294
+ o["node"] = dec.readText();
3295
+ break;
3296
+ case "boundary":
3297
+ o["boundary"] = dec.readText();
3298
+ break;
3299
+ case "provider":
3300
+ o["provider"] = dec.readText();
3301
+ break;
3302
+ case "release":
3303
+ o["release"] = dec.readText();
3304
+ break;
3305
+ default: dec.skip();
3306
+ }
3307
+ }
3308
+ return o;
3309
+ }
3310
+ function encodeCBORLinkEdge(v) {
3311
+ const out = [];
3312
+ appendCBORLinkEdge(out, v);
3313
+ return new Uint8Array(out);
3314
+ }
3315
+ function appendCBORLinkEdge(out, v) {
3316
+ let n = 5;
3317
+ if (v.read_provides_keys !== undefined && v.read_provides_keys.length > 0)
3318
+ n++;
3319
+ if (v.source_annotations !== undefined && Object.keys(v.source_annotations).length > 0)
3320
+ n++;
3321
+ if (v.target_annotations !== undefined && Object.keys(v.target_annotations).length > 0)
3322
+ n++;
3323
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3324
+ (0, cbor_gen_ts_1.writeText)(out, "inject");
3325
+ {
3326
+ const m0 = v.inject;
3327
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
3328
+ for (const [kk0, vv0] of m0) {
3329
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
3330
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
3331
+ {
3332
+ const m1 = vv0;
3333
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m1.size);
3334
+ for (const [kk1, vv1] of m1) {
3335
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
3336
+ (0, cbor_gen_ts_1.writeText)(out, kk1);
3337
+ (0, cbor_gen_ts_1.writeText)(out, vv1);
3338
+ }
3339
+ }
3340
+ }
3341
+ }
3342
+ (0, cbor_gen_ts_1.writeText)(out, "socket");
3343
+ (0, cbor_gen_ts_1.writeText)(out, v.socket);
3344
+ (0, cbor_gen_ts_1.writeText)(out, "source");
3345
+ appendCBORLinkEndpoint(out, v.source);
3346
+ (0, cbor_gen_ts_1.writeText)(out, "target");
3347
+ appendCBORLinkEndpoint(out, v.target);
3348
+ (0, cbor_gen_ts_1.writeText)(out, "provides");
3349
+ {
3350
+ const m0 = v.provides;
3351
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
3352
+ for (const [kk0, vv0] of m0) {
3353
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
3354
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
3355
+ (0, cbor_gen_ts_1.writeText)(out, vv0);
3356
+ }
3357
+ }
3358
+ if (v.read_provides_keys !== undefined && v.read_provides_keys.length > 0) {
3359
+ (0, cbor_gen_ts_1.writeText)(out, "read_provides_keys");
3360
+ {
3361
+ const a0 = v.read_provides_keys;
3362
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
3363
+ for (const ee0 of a0) {
3364
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
3365
+ }
3366
+ }
3367
+ }
3368
+ if (v.source_annotations !== undefined && Object.keys(v.source_annotations).length > 0) {
3369
+ (0, cbor_gen_ts_1.writeText)(out, "source_annotations");
3370
+ {
3371
+ const m0 = v.source_annotations;
3372
+ const ks0 = Object.keys(m0);
3373
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
3374
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
3375
+ for (const kk0 of ks0) {
3376
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
3377
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
3378
+ }
3379
+ }
3380
+ }
3381
+ if (v.target_annotations !== undefined && Object.keys(v.target_annotations).length > 0) {
3382
+ (0, cbor_gen_ts_1.writeText)(out, "target_annotations");
3383
+ {
3384
+ const m0 = v.target_annotations;
3385
+ const ks0 = Object.keys(m0);
3386
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
3387
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
3388
+ for (const kk0 of ks0) {
3389
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
3390
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
3391
+ }
3392
+ }
3393
+ }
3394
+ }
3395
+ function decodeCBORLinkEdge(data) {
3396
+ const dec = new cbor_gen_ts_1.CborDec(data);
3397
+ return decodeCBORLinkEdgeFrom(dec);
3398
+ }
3399
+ function decodeCBORLinkEdgeFrom(dec) {
3400
+ const o = {};
3401
+ const n = dec.readMapHeader();
3402
+ for (let i = 0; i < n; i++) {
3403
+ const k = dec.readText();
3404
+ switch (k) {
3405
+ case "source":
3406
+ o["source"] = decodeCBORLinkEndpointFrom(dec);
3407
+ break;
3408
+ case "target":
3409
+ o["target"] = decodeCBORLinkEndpointFrom(dec);
3410
+ break;
3411
+ case "target_annotations":
3412
+ o["target_annotations"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
3413
+ const mk = dec.readText();
3414
+ m[mk] = dec.readText();
3415
+ } return m; })();
3416
+ break;
3417
+ case "source_annotations":
3418
+ o["source_annotations"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
3419
+ const mk = dec.readText();
3420
+ m[mk] = dec.readText();
3421
+ } return m; })();
3422
+ break;
3423
+ case "socket":
3424
+ o["socket"] = dec.readText();
3425
+ break;
3426
+ case "provides":
3427
+ o["provides"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
3428
+ const mk = dec.readEntryKey();
3429
+ if (m.has(mk))
3430
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
3431
+ m.set(mk, dec.readText());
3432
+ } return m; })();
3433
+ break;
3434
+ case "inject":
3435
+ o["inject"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
3436
+ const mk = dec.readEntryKey();
3437
+ if (m.has(mk))
3438
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
3439
+ m.set(mk, (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
3440
+ const mk = dec.readEntryKey();
3441
+ if (m.has(mk))
3442
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
3443
+ m.set(mk, dec.readText());
3444
+ } return m; })());
3445
+ } return m; })();
3446
+ break;
3447
+ case "read_provides_keys":
3448
+ o["read_provides_keys"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3449
+ a.push(dec.readText());
3450
+ } return a; })();
3451
+ break;
3452
+ default: dec.skip();
3453
+ }
3454
+ }
3455
+ return o;
3456
+ }
3457
+ function encodeCBORLinkPatch(v) {
3458
+ const out = [];
3459
+ appendCBORLinkPatch(out, v);
3460
+ return new Uint8Array(out);
3461
+ }
3462
+ function appendCBORLinkPatch(out, v) {
3463
+ let n = 2;
3464
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3465
+ (0, cbor_gen_ts_1.writeText)(out, "ops");
3466
+ {
3467
+ const a0 = v.ops;
3468
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
3469
+ for (const ee0 of a0) {
3470
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(ee0)));
3471
+ }
3472
+ }
3473
+ (0, cbor_gen_ts_1.writeText)(out, "file");
3474
+ (0, cbor_gen_ts_1.writeText)(out, v.file);
3475
+ }
3476
+ function decodeCBORLinkPatch(data) {
3477
+ const dec = new cbor_gen_ts_1.CborDec(data);
3478
+ return decodeCBORLinkPatchFrom(dec);
3479
+ }
3480
+ function decodeCBORLinkPatchFrom(dec) {
3481
+ const o = {};
3482
+ const n = dec.readMapHeader();
3483
+ for (let i = 0; i < n; i++) {
3484
+ const k = dec.readText();
3485
+ switch (k) {
3486
+ case "file":
3487
+ o["file"] = dec.readText();
3488
+ break;
3489
+ case "ops":
3490
+ o["ops"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3491
+ a.push(JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
3492
+ } return a; })();
3493
+ break;
3494
+ default: dec.skip();
3495
+ }
3496
+ }
3497
+ return o;
3498
+ }
3499
+ function encodeCBORLinkPublishInput(v) {
3500
+ const out = [];
3501
+ appendCBORLinkPublishInput(out, v);
3502
+ return new Uint8Array(out);
3503
+ }
3504
+ function appendCBORLinkPublishInput(out, v) {
3505
+ let n = 1;
3506
+ if (v.producer_files !== undefined && v.producer_files.length > 0)
3507
+ n++;
3508
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3509
+ (0, cbor_gen_ts_1.writeText)(out, "edge");
3510
+ appendCBORLinkEdge(out, v.edge);
3511
+ if (v.producer_files !== undefined && v.producer_files.length > 0) {
3512
+ (0, cbor_gen_ts_1.writeText)(out, "producer_files");
3513
+ {
3514
+ const a0 = v.producer_files;
3515
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
3516
+ for (const ee0 of a0) {
3517
+ appendCBORRenderedFile(out, ee0);
3518
+ }
3519
+ }
3520
+ }
3521
+ }
3522
+ function decodeCBORLinkPublishInput(data) {
3523
+ const dec = new cbor_gen_ts_1.CborDec(data);
3524
+ return decodeCBORLinkPublishInputFrom(dec);
3525
+ }
3526
+ function decodeCBORLinkPublishInputFrom(dec) {
3527
+ const o = {};
3528
+ const n = dec.readMapHeader();
3529
+ for (let i = 0; i < n; i++) {
3530
+ const k = dec.readText();
3531
+ switch (k) {
3532
+ case "edge":
3533
+ o["edge"] = decodeCBORLinkEdgeFrom(dec);
3534
+ break;
3535
+ case "producer_files":
3536
+ o["producer_files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3537
+ a.push(decodeCBORRenderedFileFrom(dec));
3538
+ } return a; })();
3539
+ break;
3540
+ default: dec.skip();
3541
+ }
3542
+ }
3543
+ return o;
3544
+ }
3545
+ function encodeCBORLinkPublishOutput(v) {
3546
+ const out = [];
3547
+ appendCBORLinkPublishOutput(out, v);
3548
+ return new Uint8Array(out);
3549
+ }
3550
+ function appendCBORLinkPublishOutput(out, v) {
3551
+ let n = 1;
3552
+ if (v.error !== undefined && v.error !== "")
3553
+ n++;
3554
+ if (v.patches !== undefined && v.patches.length > 0)
3555
+ n++;
3556
+ if (v.condition_code !== undefined && v.condition_code !== "")
3557
+ n++;
3558
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
3559
+ n++;
3560
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3561
+ if (v.error !== undefined && v.error !== "") {
3562
+ (0, cbor_gen_ts_1.writeText)(out, "error");
3563
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
3564
+ }
3565
+ (0, cbor_gen_ts_1.writeText)(out, "handle");
3566
+ {
3567
+ const m0 = v.handle;
3568
+ const ks0 = Object.keys(m0);
3569
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
3570
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
3571
+ for (const kk0 of ks0) {
3572
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
3573
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
3574
+ }
3575
+ }
3576
+ if (v.patches !== undefined && v.patches.length > 0) {
3577
+ (0, cbor_gen_ts_1.writeText)(out, "patches");
3578
+ {
3579
+ const a0 = v.patches;
3580
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
3581
+ for (const ee0 of a0) {
3582
+ appendCBORLinkPatch(out, ee0);
3583
+ }
3584
+ }
3585
+ }
3586
+ if (v.condition_code !== undefined && v.condition_code !== "") {
3587
+ (0, cbor_gen_ts_1.writeText)(out, "condition_code");
3588
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_code);
3589
+ }
3590
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "") {
3591
+ (0, cbor_gen_ts_1.writeText)(out, "condition_short_code");
3592
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_short_code);
3593
+ }
3594
+ }
3595
+ function decodeCBORLinkPublishOutput(data) {
3596
+ const dec = new cbor_gen_ts_1.CborDec(data);
3597
+ return decodeCBORLinkPublishOutputFrom(dec);
3598
+ }
3599
+ function decodeCBORLinkPublishOutputFrom(dec) {
3600
+ const o = {};
3601
+ const n = dec.readMapHeader();
3602
+ for (let i = 0; i < n; i++) {
3603
+ const k = dec.readText();
3604
+ switch (k) {
3605
+ case "handle":
3606
+ o["handle"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
3607
+ const mk = dec.readText();
3608
+ m[mk] = dec.readText();
3609
+ } return m; })();
3610
+ break;
3611
+ case "patches":
3612
+ o["patches"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3613
+ a.push(decodeCBORLinkPatchFrom(dec));
3614
+ } return a; })();
3615
+ break;
3616
+ case "error":
3617
+ o["error"] = dec.readText();
3618
+ break;
3619
+ case "condition_code":
3620
+ o["condition_code"] = dec.readText();
3621
+ break;
3622
+ case "condition_short_code":
3623
+ o["condition_short_code"] = dec.readText();
3624
+ break;
3625
+ default: dec.skip();
3626
+ }
3627
+ }
3628
+ return o;
3629
+ }
3630
+ function encodeCBORLinkResolveInput(v) {
3631
+ const out = [];
3632
+ appendCBORLinkResolveInput(out, v);
3633
+ return new Uint8Array(out);
3634
+ }
3635
+ function appendCBORLinkResolveInput(out, v) {
3636
+ let n = 2;
3637
+ if (v.consumer_files !== undefined && v.consumer_files.length > 0)
3638
+ n++;
3639
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3640
+ (0, cbor_gen_ts_1.writeText)(out, "edge");
3641
+ appendCBORLinkEdge(out, v.edge);
3642
+ (0, cbor_gen_ts_1.writeText)(out, "handle");
3643
+ {
3644
+ const m0 = v.handle;
3645
+ const ks0 = Object.keys(m0);
3646
+ (0, cbor_gen_ts_1.sortKeys)(ks0);
3647
+ (0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
3648
+ for (const kk0 of ks0) {
3649
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
3650
+ (0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
3651
+ }
3652
+ }
3653
+ if (v.consumer_files !== undefined && v.consumer_files.length > 0) {
3654
+ (0, cbor_gen_ts_1.writeText)(out, "consumer_files");
3655
+ {
3656
+ const a0 = v.consumer_files;
3657
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
3658
+ for (const ee0 of a0) {
3659
+ appendCBORRenderedFile(out, ee0);
3660
+ }
3661
+ }
3662
+ }
3663
+ }
3664
+ function decodeCBORLinkResolveInput(data) {
3665
+ const dec = new cbor_gen_ts_1.CborDec(data);
3666
+ return decodeCBORLinkResolveInputFrom(dec);
3667
+ }
3668
+ function decodeCBORLinkResolveInputFrom(dec) {
3669
+ const o = {};
3670
+ const n = dec.readMapHeader();
3671
+ for (let i = 0; i < n; i++) {
3672
+ const k = dec.readText();
3673
+ switch (k) {
3674
+ case "edge":
3675
+ o["edge"] = decodeCBORLinkEdgeFrom(dec);
3676
+ break;
3677
+ case "handle":
3678
+ o["handle"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
3679
+ const mk = dec.readText();
3680
+ m[mk] = dec.readText();
3681
+ } return m; })();
3682
+ break;
3683
+ case "consumer_files":
3684
+ o["consumer_files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3685
+ a.push(decodeCBORRenderedFileFrom(dec));
3686
+ } return a; })();
3687
+ break;
3688
+ default: dec.skip();
3689
+ }
3690
+ }
3691
+ return o;
3692
+ }
3693
+ function encodeCBORLinkResolveOutput(v) {
3694
+ const out = [];
3695
+ appendCBORLinkResolveOutput(out, v);
3696
+ return new Uint8Array(out);
3697
+ }
3698
+ function appendCBORLinkResolveOutput(out, v) {
3699
+ let n = 1;
3700
+ if (v.error !== undefined && v.error !== "")
3701
+ n++;
3702
+ if (v.condition_code !== undefined && v.condition_code !== "")
3703
+ n++;
3704
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "")
3705
+ n++;
3706
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
3707
+ if (v.error !== undefined && v.error !== "") {
3708
+ (0, cbor_gen_ts_1.writeText)(out, "error");
3709
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
3710
+ }
3711
+ (0, cbor_gen_ts_1.writeText)(out, "patches");
3712
+ {
3713
+ const a0 = v.patches;
3714
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
3715
+ for (const ee0 of a0) {
3716
+ appendCBORLinkPatch(out, ee0);
3717
+ }
3718
+ }
3719
+ if (v.condition_code !== undefined && v.condition_code !== "") {
3720
+ (0, cbor_gen_ts_1.writeText)(out, "condition_code");
3721
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_code);
3722
+ }
3723
+ if (v.condition_short_code !== undefined && v.condition_short_code !== "") {
3724
+ (0, cbor_gen_ts_1.writeText)(out, "condition_short_code");
3725
+ (0, cbor_gen_ts_1.writeText)(out, v.condition_short_code);
3726
+ }
3727
+ }
3728
+ function decodeCBORLinkResolveOutput(data) {
3729
+ const dec = new cbor_gen_ts_1.CborDec(data);
3730
+ return decodeCBORLinkResolveOutputFrom(dec);
3731
+ }
3732
+ function decodeCBORLinkResolveOutputFrom(dec) {
3733
+ const o = {};
3734
+ const n = dec.readMapHeader();
3735
+ for (let i = 0; i < n; i++) {
3736
+ const k = dec.readText();
3737
+ switch (k) {
3738
+ case "patches":
3739
+ o["patches"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
3740
+ a.push(decodeCBORLinkPatchFrom(dec));
3741
+ } return a; })();
3742
+ break;
3743
+ case "error":
3744
+ o["error"] = dec.readText();
3745
+ break;
3746
+ case "condition_code":
3747
+ o["condition_code"] = dec.readText();
3748
+ break;
3749
+ case "condition_short_code":
3750
+ o["condition_short_code"] = dec.readText();
3751
+ break;
3752
+ default: dec.skip();
3753
+ }
3754
+ }
3755
+ return o;
3756
+ }