@aggrega-ai/aggrega-abi 0.0.0-stage → 0.9.1

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 +27 -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 +31 -4
@@ -0,0 +1,1154 @@
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.encodePluginDescriptor = encodePluginDescriptor;
6
+ exports.decodePluginDescriptor = decodePluginDescriptor;
7
+ exports.encodePluginExport = encodePluginExport;
8
+ exports.decodePluginExport = decodePluginExport;
9
+ exports.encodePluginCLICommand = encodePluginCLICommand;
10
+ exports.decodePluginCLICommand = decodePluginCLICommand;
11
+ exports.encodePluginCommandFlag = encodePluginCommandFlag;
12
+ exports.decodePluginCommandFlag = decodePluginCommandFlag;
13
+ exports.encodePluginDescriptorMeta = encodePluginDescriptorMeta;
14
+ exports.decodePluginDescriptorMeta = decodePluginDescriptorMeta;
15
+ exports.encodeProviderContract = encodeProviderContract;
16
+ exports.decodeProviderContract = decodeProviderContract;
17
+ exports.encodeSourceIgnore = encodeSourceIgnore;
18
+ exports.decodeSourceIgnore = decodeSourceIgnore;
19
+ exports.encodeInputKinds = encodeInputKinds;
20
+ exports.decodeInputKinds = decodeInputKinds;
21
+ exports.encodeArtifactDelimiters = encodeArtifactDelimiters;
22
+ exports.decodeArtifactDelimiters = decodeArtifactDelimiters;
23
+ exports.encodeAssemblyNameAnnotation = encodeAssemblyNameAnnotation;
24
+ exports.decodeAssemblyNameAnnotation = decodeAssemblyNameAnnotation;
25
+ exports.encodeImporterContract = encodeImporterContract;
26
+ exports.decodeImporterContract = decodeImporterContract;
27
+ exports.encodeDetectSignature = encodeDetectSignature;
28
+ exports.decodeDetectSignature = decodeDetectSignature;
29
+ exports.encodePathMatch = encodePathMatch;
30
+ exports.decodePathMatch = decodePathMatch;
31
+ exports.encodeCBORPluginDescriptor = encodeCBORPluginDescriptor;
32
+ exports.appendCBORPluginDescriptor = appendCBORPluginDescriptor;
33
+ exports.decodeCBORPluginDescriptor = decodeCBORPluginDescriptor;
34
+ exports.decodeCBORPluginDescriptorFrom = decodeCBORPluginDescriptorFrom;
35
+ exports.encodeCBORPluginExport = encodeCBORPluginExport;
36
+ exports.appendCBORPluginExport = appendCBORPluginExport;
37
+ exports.decodeCBORPluginExport = decodeCBORPluginExport;
38
+ exports.decodeCBORPluginExportFrom = decodeCBORPluginExportFrom;
39
+ exports.encodeCBORPluginCLICommand = encodeCBORPluginCLICommand;
40
+ exports.appendCBORPluginCLICommand = appendCBORPluginCLICommand;
41
+ exports.decodeCBORPluginCLICommand = decodeCBORPluginCLICommand;
42
+ exports.decodeCBORPluginCLICommandFrom = decodeCBORPluginCLICommandFrom;
43
+ exports.encodeCBORPluginCommandFlag = encodeCBORPluginCommandFlag;
44
+ exports.appendCBORPluginCommandFlag = appendCBORPluginCommandFlag;
45
+ exports.decodeCBORPluginCommandFlag = decodeCBORPluginCommandFlag;
46
+ exports.decodeCBORPluginCommandFlagFrom = decodeCBORPluginCommandFlagFrom;
47
+ exports.encodeCBORPluginDescriptorMeta = encodeCBORPluginDescriptorMeta;
48
+ exports.appendCBORPluginDescriptorMeta = appendCBORPluginDescriptorMeta;
49
+ exports.decodeCBORPluginDescriptorMeta = decodeCBORPluginDescriptorMeta;
50
+ exports.decodeCBORPluginDescriptorMetaFrom = decodeCBORPluginDescriptorMetaFrom;
51
+ exports.encodeCBORProviderContract = encodeCBORProviderContract;
52
+ exports.appendCBORProviderContract = appendCBORProviderContract;
53
+ exports.decodeCBORProviderContract = decodeCBORProviderContract;
54
+ exports.decodeCBORProviderContractFrom = decodeCBORProviderContractFrom;
55
+ exports.encodeCBORSourceIgnore = encodeCBORSourceIgnore;
56
+ exports.appendCBORSourceIgnore = appendCBORSourceIgnore;
57
+ exports.decodeCBORSourceIgnore = decodeCBORSourceIgnore;
58
+ exports.decodeCBORSourceIgnoreFrom = decodeCBORSourceIgnoreFrom;
59
+ exports.encodeCBORInputKinds = encodeCBORInputKinds;
60
+ exports.appendCBORInputKinds = appendCBORInputKinds;
61
+ exports.decodeCBORInputKinds = decodeCBORInputKinds;
62
+ exports.decodeCBORInputKindsFrom = decodeCBORInputKindsFrom;
63
+ exports.encodeCBORArtifactDelimiters = encodeCBORArtifactDelimiters;
64
+ exports.appendCBORArtifactDelimiters = appendCBORArtifactDelimiters;
65
+ exports.decodeCBORArtifactDelimiters = decodeCBORArtifactDelimiters;
66
+ exports.decodeCBORArtifactDelimitersFrom = decodeCBORArtifactDelimitersFrom;
67
+ exports.encodeCBORAssemblyNameAnnotation = encodeCBORAssemblyNameAnnotation;
68
+ exports.appendCBORAssemblyNameAnnotation = appendCBORAssemblyNameAnnotation;
69
+ exports.decodeCBORAssemblyNameAnnotation = decodeCBORAssemblyNameAnnotation;
70
+ exports.decodeCBORAssemblyNameAnnotationFrom = decodeCBORAssemblyNameAnnotationFrom;
71
+ exports.encodeCBORImporterContract = encodeCBORImporterContract;
72
+ exports.appendCBORImporterContract = appendCBORImporterContract;
73
+ exports.decodeCBORImporterContract = decodeCBORImporterContract;
74
+ exports.decodeCBORImporterContractFrom = decodeCBORImporterContractFrom;
75
+ exports.encodeCBORDetectSignature = encodeCBORDetectSignature;
76
+ exports.appendCBORDetectSignature = appendCBORDetectSignature;
77
+ exports.decodeCBORDetectSignature = decodeCBORDetectSignature;
78
+ exports.decodeCBORDetectSignatureFrom = decodeCBORDetectSignatureFrom;
79
+ exports.encodeCBORPathMatch = encodeCBORPathMatch;
80
+ exports.appendCBORPathMatch = appendCBORPathMatch;
81
+ exports.decodeCBORPathMatch = decodeCBORPathMatch;
82
+ exports.decodeCBORPathMatchFrom = decodeCBORPathMatchFrom;
83
+ // Code generated by internal/tools/typegen from
84
+ // aggrega-schemas/json/wasm-describe-v1beta1.schema.json. DO NOT EDIT.
85
+ // Regenerate with `go generate ./internal/tools/typegen` from the
86
+ // aggrega-cli checkout.
87
+ const cbor_gen_ts_1 = require("./cbor_gen.js");
88
+ function jstr(s) {
89
+ return JSON.stringify(s);
90
+ }
91
+ // encodeOpaque carries an opaque (`any` / RawMessage) value VERBATIM: the
92
+ // key order from JSON.parse is preserved, matching the Go and Rust codecs'
93
+ // byte-carry of opaque values. Opaque values are never sorted.
94
+ function encodeOpaque(v) {
95
+ return JSON.stringify(v);
96
+ }
97
+ function encodePluginDescriptor(v) {
98
+ const parts = [];
99
+ parts.push(`${jstr("abi_version")}:${jstr(v.abi_version)}`);
100
+ parts.push(`${jstr("plugin_type")}:${jstr(v.plugin_type)}`);
101
+ if (v.capabilities !== undefined && v.capabilities.length > 0)
102
+ parts.push(`${jstr("capabilities")}:${`[${v.capabilities.map((e0) => jstr(e0)).join(",")}]`}`);
103
+ parts.push(`${jstr("exports")}:${`[${v.exports.map((e0) => encodePluginExport(e0)).join(",")}]`}`);
104
+ if (v.contract !== undefined && v.contract !== null)
105
+ parts.push(`${jstr("contract")}:${encodeProviderContract(v.contract)}`);
106
+ if (v.importer !== undefined && v.importer !== null)
107
+ parts.push(`${jstr("importer")}:${encodeImporterContract(v.importer)}`);
108
+ if (v.description !== undefined && v.description !== "")
109
+ parts.push(`${jstr("description")}:${jstr(v.description)}`);
110
+ if (v.commands !== undefined && v.commands.length > 0)
111
+ parts.push(`${jstr("commands")}:${`[${v.commands.map((e0) => encodePluginCLICommand(e0)).join(",")}]`}`);
112
+ if (v.settings_schema !== undefined && v.settings_schema !== null)
113
+ parts.push(`${jstr("settings_schema")}:${encodeOpaque(v.settings_schema)}`);
114
+ if (v.metadata !== undefined && v.metadata !== null)
115
+ parts.push(`${jstr("metadata")}:${encodePluginDescriptorMeta(v.metadata)}`);
116
+ return `{${parts.join(",")}}`;
117
+ }
118
+ function decodePluginDescriptor(data) {
119
+ return JSON.parse(data);
120
+ }
121
+ function encodePluginExport(v) {
122
+ const parts = [];
123
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
124
+ if (v.input_pattern !== undefined && v.input_pattern !== "")
125
+ parts.push(`${jstr("input_pattern")}:${jstr(v.input_pattern)}`);
126
+ if (v.host_functions !== undefined && v.host_functions.length > 0)
127
+ parts.push(`${jstr("host_functions")}:${`[${v.host_functions.map((e0) => jstr(e0)).join(",")}]`}`);
128
+ if (v.description !== undefined && v.description !== "")
129
+ parts.push(`${jstr("description")}:${jstr(v.description)}`);
130
+ if (v.stability !== undefined && v.stability !== "")
131
+ parts.push(`${jstr("stability")}:${jstr(v.stability)}`);
132
+ if (v.operates !== undefined && v.operates !== "")
133
+ parts.push(`${jstr("operates")}:${jstr(v.operates)}`);
134
+ if (v.scope !== undefined && v.scope !== "")
135
+ parts.push(`${jstr("scope")}:${jstr(v.scope)}`);
136
+ if (v.selector !== undefined && v.selector !== "")
137
+ parts.push(`${jstr("selector")}:${jstr(v.selector)}`);
138
+ if (v.input !== undefined && v.input !== null)
139
+ parts.push(`${jstr("input")}:${encodeOpaque(v.input)}`);
140
+ if (v.output !== undefined && v.output !== null)
141
+ parts.push(`${jstr("output")}:${encodeOpaque(v.output)}`);
142
+ return `{${parts.join(",")}}`;
143
+ }
144
+ function decodePluginExport(data) {
145
+ return JSON.parse(data);
146
+ }
147
+ function encodePluginCLICommand(v) {
148
+ const parts = [];
149
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
150
+ if (v.description !== undefined && v.description !== "")
151
+ parts.push(`${jstr("description")}:${jstr(v.description)}`);
152
+ if (v.flags !== undefined && v.flags.length > 0)
153
+ parts.push(`${jstr("flags")}:${`[${v.flags.map((e0) => encodePluginCommandFlag(e0)).join(",")}]`}`);
154
+ return `{${parts.join(",")}}`;
155
+ }
156
+ function decodePluginCLICommand(data) {
157
+ return JSON.parse(data);
158
+ }
159
+ function encodePluginCommandFlag(v) {
160
+ const parts = [];
161
+ parts.push(`${jstr("name")}:${jstr(v.name)}`);
162
+ if (v.shorthand !== undefined && v.shorthand !== "")
163
+ parts.push(`${jstr("shorthand")}:${jstr(v.shorthand)}`);
164
+ if (v.description !== undefined && v.description !== "")
165
+ parts.push(`${jstr("description")}:${jstr(v.description)}`);
166
+ if (v.type !== undefined && v.type !== "")
167
+ parts.push(`${jstr("type")}:${jstr(v.type)}`);
168
+ if (v.default !== undefined && v.default !== "")
169
+ parts.push(`${jstr("default")}:${jstr(v.default)}`);
170
+ return `{${parts.join(",")}}`;
171
+ }
172
+ function decodePluginCommandFlag(data) {
173
+ return JSON.parse(data);
174
+ }
175
+ function encodePluginDescriptorMeta(v) {
176
+ const parts = [];
177
+ if (v.author !== undefined && v.author !== "")
178
+ parts.push(`${jstr("author")}:${jstr(v.author)}`);
179
+ if (v.repository !== undefined && v.repository !== "")
180
+ parts.push(`${jstr("repository")}:${jstr(v.repository)}`);
181
+ if (v.license !== undefined && v.license !== "")
182
+ parts.push(`${jstr("license")}:${jstr(v.license)}`);
183
+ if (v.version !== undefined && v.version !== "")
184
+ parts.push(`${jstr("version")}:${jstr(v.version)}`);
185
+ if (v.commit !== undefined && v.commit !== "")
186
+ parts.push(`${jstr("commit")}:${jstr(v.commit)}`);
187
+ return `{${parts.join(",")}}`;
188
+ }
189
+ function decodePluginDescriptorMeta(data) {
190
+ return JSON.parse(data);
191
+ }
192
+ function encodeProviderContract(v) {
193
+ const parts = [];
194
+ parts.push(`${jstr("input_kinds")}:${encodeInputKinds(v.input_kinds)}`);
195
+ parts.push(`${jstr("boundary_assembly")}:${jstr(v.boundary_assembly)}`);
196
+ if (v.artifact_delimiters !== undefined && v.artifact_delimiters !== null)
197
+ parts.push(`${jstr("artifact_delimiters")}:${encodeArtifactDelimiters(v.artifact_delimiters)}`);
198
+ if (v.assembly_name_annotation !== undefined && v.assembly_name_annotation !== null)
199
+ parts.push(`${jstr("assembly_name_annotation")}:${encodeAssemblyNameAnnotation(v.assembly_name_annotation)}`);
200
+ if (v.reusable_instance !== undefined && v.reusable_instance !== false)
201
+ parts.push(`${jstr("reusable_instance")}:${String(v.reusable_instance)}`);
202
+ if (v.cross_boundary_linking !== undefined && v.cross_boundary_linking !== false)
203
+ parts.push(`${jstr("cross_boundary_linking")}:${String(v.cross_boundary_linking)}`);
204
+ if (v.omits !== undefined && v.omits !== false)
205
+ parts.push(`${jstr("omits")}:${String(v.omits)}`);
206
+ if (v.boundary_artifacts !== undefined && v.boundary_artifacts !== false)
207
+ parts.push(`${jstr("boundary_artifacts")}:${String(v.boundary_artifacts)}`);
208
+ if (v.nest_segment !== undefined && v.nest_segment !== "")
209
+ parts.push(`${jstr("nest_segment")}:${jstr(v.nest_segment)}`);
210
+ if (v.source_ignore !== undefined && v.source_ignore !== null)
211
+ parts.push(`${jstr("source_ignore")}:${encodeSourceIgnore(v.source_ignore)}`);
212
+ return `{${parts.join(",")}}`;
213
+ }
214
+ function decodeProviderContract(data) {
215
+ return JSON.parse(data);
216
+ }
217
+ function encodeSourceIgnore(v) {
218
+ const parts = [];
219
+ if (v.patterns !== undefined && v.patterns.length > 0)
220
+ parts.push(`${jstr("patterns")}:${`[${v.patterns.map((e0) => jstr(e0)).join(",")}]`}`);
221
+ if (v.files !== undefined && v.files.length > 0)
222
+ parts.push(`${jstr("files")}:${`[${v.files.map((e0) => jstr(e0)).join(",")}]`}`);
223
+ return `{${parts.join(",")}}`;
224
+ }
225
+ function decodeSourceIgnore(data) {
226
+ return JSON.parse(data);
227
+ }
228
+ function encodeInputKinds(v) {
229
+ const parts = [];
230
+ parts.push(`${jstr("sourced")}:${String(v.sourced)}`);
231
+ parts.push(`${jstr("synthesized")}:${String(v.synthesized)}`);
232
+ parts.push(`${jstr("artifacts_standalone")}:${String(v.artifacts_standalone)}`);
233
+ return `{${parts.join(",")}}`;
234
+ }
235
+ function decodeInputKinds(data) {
236
+ return JSON.parse(data);
237
+ }
238
+ function encodeArtifactDelimiters(v) {
239
+ const parts = [];
240
+ parts.push(`${jstr("left")}:${jstr(v.left)}`);
241
+ parts.push(`${jstr("right")}:${jstr(v.right)}`);
242
+ return `{${parts.join(",")}}`;
243
+ }
244
+ function decodeArtifactDelimiters(data) {
245
+ return JSON.parse(data);
246
+ }
247
+ function encodeAssemblyNameAnnotation(v) {
248
+ const parts = [];
249
+ parts.push(`${jstr("annotation")}:${jstr(v.annotation)}`);
250
+ if (v.require_unique !== undefined && v.require_unique !== false)
251
+ parts.push(`${jstr("require_unique")}:${String(v.require_unique)}`);
252
+ return `{${parts.join(",")}}`;
253
+ }
254
+ function decodeAssemblyNameAnnotation(data) {
255
+ return JSON.parse(data);
256
+ }
257
+ function encodeImporterContract(v) {
258
+ const parts = [];
259
+ if (v.detect !== undefined && v.detect.length > 0)
260
+ parts.push(`${jstr("detect")}:${`[${v.detect.map((e0) => encodeDetectSignature(e0)).join(",")}]`}`);
261
+ return `{${parts.join(",")}}`;
262
+ }
263
+ function decodeImporterContract(data) {
264
+ return JSON.parse(data);
265
+ }
266
+ function encodeDetectSignature(v) {
267
+ const parts = [];
268
+ parts.push(`${jstr("syntax")}:${jstr(v.syntax)}`);
269
+ if (v.files !== undefined && v.files.length > 0)
270
+ parts.push(`${jstr("files")}:${`[${v.files.map((e0) => jstr(e0)).join(",")}]`}`);
271
+ if (v.match !== undefined && v.match.length > 0)
272
+ parts.push(`${jstr("match")}:${`[${v.match.map((e0) => encodePathMatch(e0)).join(",")}]`}`);
273
+ return `{${parts.join(",")}}`;
274
+ }
275
+ function decodeDetectSignature(data) {
276
+ return JSON.parse(data);
277
+ }
278
+ function encodePathMatch(v) {
279
+ const parts = [];
280
+ parts.push(`${jstr("path")}:${jstr(v.path)}`);
281
+ parts.push(`${jstr("is")}:${jstr(v.is)}`);
282
+ if (v.equals !== undefined && v.equals !== "")
283
+ parts.push(`${jstr("equals")}:${jstr(v.equals)}`);
284
+ if (v.prefix !== undefined && v.prefix !== "")
285
+ parts.push(`${jstr("prefix")}:${jstr(v.prefix)}`);
286
+ return `{${parts.join(",")}}`;
287
+ }
288
+ function decodePathMatch(data) {
289
+ return JSON.parse(data);
290
+ }
291
+ function encodeCBORPluginDescriptor(v) {
292
+ const out = [];
293
+ appendCBORPluginDescriptor(out, v);
294
+ return new Uint8Array(out);
295
+ }
296
+ function appendCBORPluginDescriptor(out, v) {
297
+ let n = 3;
298
+ if (v.commands !== undefined && v.commands.length > 0)
299
+ n++;
300
+ if (v.contract !== undefined && v.contract !== null)
301
+ n++;
302
+ if (v.importer !== undefined && v.importer !== null)
303
+ n++;
304
+ if (v.metadata !== undefined && v.metadata !== null)
305
+ n++;
306
+ if (v.description !== undefined && v.description !== "")
307
+ n++;
308
+ if (v.capabilities !== undefined && v.capabilities.length > 0)
309
+ n++;
310
+ if (v.settings_schema !== undefined && v.settings_schema !== null)
311
+ n++;
312
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
313
+ (0, cbor_gen_ts_1.writeText)(out, "exports");
314
+ {
315
+ const a0 = v.exports;
316
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
317
+ for (const ee0 of a0) {
318
+ appendCBORPluginExport(out, ee0);
319
+ }
320
+ }
321
+ if (v.commands !== undefined && v.commands.length > 0) {
322
+ (0, cbor_gen_ts_1.writeText)(out, "commands");
323
+ {
324
+ const a0 = v.commands;
325
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
326
+ for (const ee0 of a0) {
327
+ appendCBORPluginCLICommand(out, ee0);
328
+ }
329
+ }
330
+ }
331
+ if (v.contract !== undefined && v.contract !== null) {
332
+ (0, cbor_gen_ts_1.writeText)(out, "contract");
333
+ appendCBORProviderContract(out, v.contract);
334
+ }
335
+ if (v.importer !== undefined && v.importer !== null) {
336
+ (0, cbor_gen_ts_1.writeText)(out, "importer");
337
+ appendCBORImporterContract(out, v.importer);
338
+ }
339
+ if (v.metadata !== undefined && v.metadata !== null) {
340
+ (0, cbor_gen_ts_1.writeText)(out, "metadata");
341
+ appendCBORPluginDescriptorMeta(out, v.metadata);
342
+ }
343
+ (0, cbor_gen_ts_1.writeText)(out, "abi_version");
344
+ (0, cbor_gen_ts_1.writeText)(out, v.abi_version);
345
+ if (v.description !== undefined && v.description !== "") {
346
+ (0, cbor_gen_ts_1.writeText)(out, "description");
347
+ (0, cbor_gen_ts_1.writeText)(out, v.description);
348
+ }
349
+ (0, cbor_gen_ts_1.writeText)(out, "plugin_type");
350
+ (0, cbor_gen_ts_1.writeText)(out, v.plugin_type);
351
+ if (v.capabilities !== undefined && v.capabilities.length > 0) {
352
+ (0, cbor_gen_ts_1.writeText)(out, "capabilities");
353
+ {
354
+ const a0 = v.capabilities;
355
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
356
+ for (const ee0 of a0) {
357
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
358
+ }
359
+ }
360
+ }
361
+ if (v.settings_schema !== undefined && v.settings_schema !== null) {
362
+ (0, cbor_gen_ts_1.writeText)(out, "settings_schema");
363
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.settings_schema)));
364
+ }
365
+ }
366
+ function decodeCBORPluginDescriptor(data) {
367
+ const dec = new cbor_gen_ts_1.CborDec(data);
368
+ return decodeCBORPluginDescriptorFrom(dec);
369
+ }
370
+ function decodeCBORPluginDescriptorFrom(dec) {
371
+ const o = {};
372
+ const n = dec.readMapHeader();
373
+ for (let i = 0; i < n; i++) {
374
+ const k = dec.readText();
375
+ switch (k) {
376
+ case "abi_version":
377
+ o["abi_version"] = dec.readText();
378
+ break;
379
+ case "plugin_type":
380
+ o["plugin_type"] = dec.readText();
381
+ break;
382
+ case "capabilities":
383
+ o["capabilities"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
384
+ a.push(dec.readText());
385
+ } return a; })();
386
+ break;
387
+ case "exports":
388
+ o["exports"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
389
+ a.push(decodeCBORPluginExportFrom(dec));
390
+ } return a; })();
391
+ break;
392
+ case "contract":
393
+ o["contract"] = decodeCBORProviderContractFrom(dec);
394
+ break;
395
+ case "importer":
396
+ o["importer"] = decodeCBORImporterContractFrom(dec);
397
+ break;
398
+ case "description":
399
+ o["description"] = dec.readText();
400
+ break;
401
+ case "commands":
402
+ o["commands"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
403
+ a.push(decodeCBORPluginCLICommandFrom(dec));
404
+ } return a; })();
405
+ break;
406
+ case "settings_schema":
407
+ o["settings_schema"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
408
+ break;
409
+ case "metadata":
410
+ o["metadata"] = decodeCBORPluginDescriptorMetaFrom(dec);
411
+ break;
412
+ default: dec.skip();
413
+ }
414
+ }
415
+ return o;
416
+ }
417
+ function encodeCBORPluginExport(v) {
418
+ const out = [];
419
+ appendCBORPluginExport(out, v);
420
+ return new Uint8Array(out);
421
+ }
422
+ function appendCBORPluginExport(out, v) {
423
+ let n = 1;
424
+ if (v.input !== undefined && v.input !== null)
425
+ n++;
426
+ if (v.scope !== undefined && v.scope !== "")
427
+ n++;
428
+ if (v.output !== undefined && v.output !== null)
429
+ n++;
430
+ if (v.operates !== undefined && v.operates !== "")
431
+ n++;
432
+ if (v.selector !== undefined && v.selector !== "")
433
+ n++;
434
+ if (v.stability !== undefined && v.stability !== "")
435
+ n++;
436
+ if (v.description !== undefined && v.description !== "")
437
+ n++;
438
+ if (v.input_pattern !== undefined && v.input_pattern !== "")
439
+ n++;
440
+ if (v.host_functions !== undefined && v.host_functions.length > 0)
441
+ n++;
442
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
443
+ (0, cbor_gen_ts_1.writeText)(out, "name");
444
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
445
+ if (v.input !== undefined && v.input !== null) {
446
+ (0, cbor_gen_ts_1.writeText)(out, "input");
447
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.input)));
448
+ }
449
+ if (v.scope !== undefined && v.scope !== "") {
450
+ (0, cbor_gen_ts_1.writeText)(out, "scope");
451
+ (0, cbor_gen_ts_1.writeText)(out, v.scope);
452
+ }
453
+ if (v.output !== undefined && v.output !== null) {
454
+ (0, cbor_gen_ts_1.writeText)(out, "output");
455
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.output)));
456
+ }
457
+ if (v.operates !== undefined && v.operates !== "") {
458
+ (0, cbor_gen_ts_1.writeText)(out, "operates");
459
+ (0, cbor_gen_ts_1.writeText)(out, v.operates);
460
+ }
461
+ if (v.selector !== undefined && v.selector !== "") {
462
+ (0, cbor_gen_ts_1.writeText)(out, "selector");
463
+ (0, cbor_gen_ts_1.writeText)(out, v.selector);
464
+ }
465
+ if (v.stability !== undefined && v.stability !== "") {
466
+ (0, cbor_gen_ts_1.writeText)(out, "stability");
467
+ (0, cbor_gen_ts_1.writeText)(out, v.stability);
468
+ }
469
+ if (v.description !== undefined && v.description !== "") {
470
+ (0, cbor_gen_ts_1.writeText)(out, "description");
471
+ (0, cbor_gen_ts_1.writeText)(out, v.description);
472
+ }
473
+ if (v.input_pattern !== undefined && v.input_pattern !== "") {
474
+ (0, cbor_gen_ts_1.writeText)(out, "input_pattern");
475
+ (0, cbor_gen_ts_1.writeText)(out, v.input_pattern);
476
+ }
477
+ if (v.host_functions !== undefined && v.host_functions.length > 0) {
478
+ (0, cbor_gen_ts_1.writeText)(out, "host_functions");
479
+ {
480
+ const a0 = v.host_functions;
481
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
482
+ for (const ee0 of a0) {
483
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
484
+ }
485
+ }
486
+ }
487
+ }
488
+ function decodeCBORPluginExport(data) {
489
+ const dec = new cbor_gen_ts_1.CborDec(data);
490
+ return decodeCBORPluginExportFrom(dec);
491
+ }
492
+ function decodeCBORPluginExportFrom(dec) {
493
+ const o = {};
494
+ const n = dec.readMapHeader();
495
+ for (let i = 0; i < n; i++) {
496
+ const k = dec.readText();
497
+ switch (k) {
498
+ case "name":
499
+ o["name"] = dec.readText();
500
+ break;
501
+ case "input_pattern":
502
+ o["input_pattern"] = dec.readText();
503
+ break;
504
+ case "host_functions":
505
+ o["host_functions"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
506
+ a.push(dec.readText());
507
+ } return a; })();
508
+ break;
509
+ case "description":
510
+ o["description"] = dec.readText();
511
+ break;
512
+ case "stability":
513
+ o["stability"] = dec.readText();
514
+ break;
515
+ case "operates":
516
+ o["operates"] = dec.readText();
517
+ break;
518
+ case "scope":
519
+ o["scope"] = dec.readText();
520
+ break;
521
+ case "selector":
522
+ o["selector"] = dec.readText();
523
+ break;
524
+ case "input":
525
+ o["input"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
526
+ break;
527
+ case "output":
528
+ o["output"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
529
+ break;
530
+ default: dec.skip();
531
+ }
532
+ }
533
+ return o;
534
+ }
535
+ function encodeCBORPluginCLICommand(v) {
536
+ const out = [];
537
+ appendCBORPluginCLICommand(out, v);
538
+ return new Uint8Array(out);
539
+ }
540
+ function appendCBORPluginCLICommand(out, v) {
541
+ let n = 1;
542
+ if (v.flags !== undefined && v.flags.length > 0)
543
+ n++;
544
+ if (v.description !== undefined && v.description !== "")
545
+ n++;
546
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
547
+ (0, cbor_gen_ts_1.writeText)(out, "name");
548
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
549
+ if (v.flags !== undefined && v.flags.length > 0) {
550
+ (0, cbor_gen_ts_1.writeText)(out, "flags");
551
+ {
552
+ const a0 = v.flags;
553
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
554
+ for (const ee0 of a0) {
555
+ appendCBORPluginCommandFlag(out, ee0);
556
+ }
557
+ }
558
+ }
559
+ if (v.description !== undefined && v.description !== "") {
560
+ (0, cbor_gen_ts_1.writeText)(out, "description");
561
+ (0, cbor_gen_ts_1.writeText)(out, v.description);
562
+ }
563
+ }
564
+ function decodeCBORPluginCLICommand(data) {
565
+ const dec = new cbor_gen_ts_1.CborDec(data);
566
+ return decodeCBORPluginCLICommandFrom(dec);
567
+ }
568
+ function decodeCBORPluginCLICommandFrom(dec) {
569
+ const o = {};
570
+ const n = dec.readMapHeader();
571
+ for (let i = 0; i < n; i++) {
572
+ const k = dec.readText();
573
+ switch (k) {
574
+ case "name":
575
+ o["name"] = dec.readText();
576
+ break;
577
+ case "description":
578
+ o["description"] = dec.readText();
579
+ break;
580
+ case "flags":
581
+ o["flags"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
582
+ a.push(decodeCBORPluginCommandFlagFrom(dec));
583
+ } return a; })();
584
+ break;
585
+ default: dec.skip();
586
+ }
587
+ }
588
+ return o;
589
+ }
590
+ function encodeCBORPluginCommandFlag(v) {
591
+ const out = [];
592
+ appendCBORPluginCommandFlag(out, v);
593
+ return new Uint8Array(out);
594
+ }
595
+ function appendCBORPluginCommandFlag(out, v) {
596
+ let n = 1;
597
+ if (v.type !== undefined && v.type !== "")
598
+ n++;
599
+ if (v.default !== undefined && v.default !== "")
600
+ n++;
601
+ if (v.shorthand !== undefined && v.shorthand !== "")
602
+ n++;
603
+ if (v.description !== undefined && v.description !== "")
604
+ n++;
605
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
606
+ (0, cbor_gen_ts_1.writeText)(out, "name");
607
+ (0, cbor_gen_ts_1.writeText)(out, v.name);
608
+ if (v.type !== undefined && v.type !== "") {
609
+ (0, cbor_gen_ts_1.writeText)(out, "type");
610
+ (0, cbor_gen_ts_1.writeText)(out, v.type);
611
+ }
612
+ if (v.default !== undefined && v.default !== "") {
613
+ (0, cbor_gen_ts_1.writeText)(out, "default");
614
+ (0, cbor_gen_ts_1.writeText)(out, v.default);
615
+ }
616
+ if (v.shorthand !== undefined && v.shorthand !== "") {
617
+ (0, cbor_gen_ts_1.writeText)(out, "shorthand");
618
+ (0, cbor_gen_ts_1.writeText)(out, v.shorthand);
619
+ }
620
+ if (v.description !== undefined && v.description !== "") {
621
+ (0, cbor_gen_ts_1.writeText)(out, "description");
622
+ (0, cbor_gen_ts_1.writeText)(out, v.description);
623
+ }
624
+ }
625
+ function decodeCBORPluginCommandFlag(data) {
626
+ const dec = new cbor_gen_ts_1.CborDec(data);
627
+ return decodeCBORPluginCommandFlagFrom(dec);
628
+ }
629
+ function decodeCBORPluginCommandFlagFrom(dec) {
630
+ const o = {};
631
+ const n = dec.readMapHeader();
632
+ for (let i = 0; i < n; i++) {
633
+ const k = dec.readText();
634
+ switch (k) {
635
+ case "name":
636
+ o["name"] = dec.readText();
637
+ break;
638
+ case "shorthand":
639
+ o["shorthand"] = dec.readText();
640
+ break;
641
+ case "description":
642
+ o["description"] = dec.readText();
643
+ break;
644
+ case "type":
645
+ o["type"] = dec.readText();
646
+ break;
647
+ case "default":
648
+ o["default"] = dec.readText();
649
+ break;
650
+ default: dec.skip();
651
+ }
652
+ }
653
+ return o;
654
+ }
655
+ function encodeCBORPluginDescriptorMeta(v) {
656
+ const out = [];
657
+ appendCBORPluginDescriptorMeta(out, v);
658
+ return new Uint8Array(out);
659
+ }
660
+ function appendCBORPluginDescriptorMeta(out, v) {
661
+ let n = 0;
662
+ if (v.author !== undefined && v.author !== "")
663
+ n++;
664
+ if (v.commit !== undefined && v.commit !== "")
665
+ n++;
666
+ if (v.license !== undefined && v.license !== "")
667
+ n++;
668
+ if (v.version !== undefined && v.version !== "")
669
+ n++;
670
+ if (v.repository !== undefined && v.repository !== "")
671
+ n++;
672
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
673
+ if (v.author !== undefined && v.author !== "") {
674
+ (0, cbor_gen_ts_1.writeText)(out, "author");
675
+ (0, cbor_gen_ts_1.writeText)(out, v.author);
676
+ }
677
+ if (v.commit !== undefined && v.commit !== "") {
678
+ (0, cbor_gen_ts_1.writeText)(out, "commit");
679
+ (0, cbor_gen_ts_1.writeText)(out, v.commit);
680
+ }
681
+ if (v.license !== undefined && v.license !== "") {
682
+ (0, cbor_gen_ts_1.writeText)(out, "license");
683
+ (0, cbor_gen_ts_1.writeText)(out, v.license);
684
+ }
685
+ if (v.version !== undefined && v.version !== "") {
686
+ (0, cbor_gen_ts_1.writeText)(out, "version");
687
+ (0, cbor_gen_ts_1.writeText)(out, v.version);
688
+ }
689
+ if (v.repository !== undefined && v.repository !== "") {
690
+ (0, cbor_gen_ts_1.writeText)(out, "repository");
691
+ (0, cbor_gen_ts_1.writeText)(out, v.repository);
692
+ }
693
+ }
694
+ function decodeCBORPluginDescriptorMeta(data) {
695
+ const dec = new cbor_gen_ts_1.CborDec(data);
696
+ return decodeCBORPluginDescriptorMetaFrom(dec);
697
+ }
698
+ function decodeCBORPluginDescriptorMetaFrom(dec) {
699
+ const o = {};
700
+ const n = dec.readMapHeader();
701
+ for (let i = 0; i < n; i++) {
702
+ const k = dec.readText();
703
+ switch (k) {
704
+ case "author":
705
+ o["author"] = dec.readText();
706
+ break;
707
+ case "repository":
708
+ o["repository"] = dec.readText();
709
+ break;
710
+ case "license":
711
+ o["license"] = dec.readText();
712
+ break;
713
+ case "version":
714
+ o["version"] = dec.readText();
715
+ break;
716
+ case "commit":
717
+ o["commit"] = dec.readText();
718
+ break;
719
+ default: dec.skip();
720
+ }
721
+ }
722
+ return o;
723
+ }
724
+ function encodeCBORProviderContract(v) {
725
+ const out = [];
726
+ appendCBORProviderContract(out, v);
727
+ return new Uint8Array(out);
728
+ }
729
+ function appendCBORProviderContract(out, v) {
730
+ let n = 2;
731
+ if (v.omits !== undefined && v.omits !== false)
732
+ n++;
733
+ if (v.nest_segment !== undefined && v.nest_segment !== "")
734
+ n++;
735
+ if (v.source_ignore !== undefined && v.source_ignore !== null)
736
+ n++;
737
+ if (v.reusable_instance !== undefined && v.reusable_instance !== false)
738
+ n++;
739
+ if (v.boundary_artifacts !== undefined && v.boundary_artifacts !== false)
740
+ n++;
741
+ if (v.artifact_delimiters !== undefined && v.artifact_delimiters !== null)
742
+ n++;
743
+ if (v.cross_boundary_linking !== undefined && v.cross_boundary_linking !== false)
744
+ n++;
745
+ if (v.assembly_name_annotation !== undefined && v.assembly_name_annotation !== null)
746
+ n++;
747
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
748
+ if (v.omits !== undefined && v.omits !== false) {
749
+ (0, cbor_gen_ts_1.writeText)(out, "omits");
750
+ (0, cbor_gen_ts_1.writeBool)(out, v.omits);
751
+ }
752
+ (0, cbor_gen_ts_1.writeText)(out, "input_kinds");
753
+ appendCBORInputKinds(out, v.input_kinds);
754
+ if (v.nest_segment !== undefined && v.nest_segment !== "") {
755
+ (0, cbor_gen_ts_1.writeText)(out, "nest_segment");
756
+ (0, cbor_gen_ts_1.writeText)(out, v.nest_segment);
757
+ }
758
+ if (v.source_ignore !== undefined && v.source_ignore !== null) {
759
+ (0, cbor_gen_ts_1.writeText)(out, "source_ignore");
760
+ appendCBORSourceIgnore(out, v.source_ignore);
761
+ }
762
+ (0, cbor_gen_ts_1.writeText)(out, "boundary_assembly");
763
+ (0, cbor_gen_ts_1.writeText)(out, v.boundary_assembly);
764
+ if (v.reusable_instance !== undefined && v.reusable_instance !== false) {
765
+ (0, cbor_gen_ts_1.writeText)(out, "reusable_instance");
766
+ (0, cbor_gen_ts_1.writeBool)(out, v.reusable_instance);
767
+ }
768
+ if (v.boundary_artifacts !== undefined && v.boundary_artifacts !== false) {
769
+ (0, cbor_gen_ts_1.writeText)(out, "boundary_artifacts");
770
+ (0, cbor_gen_ts_1.writeBool)(out, v.boundary_artifacts);
771
+ }
772
+ if (v.artifact_delimiters !== undefined && v.artifact_delimiters !== null) {
773
+ (0, cbor_gen_ts_1.writeText)(out, "artifact_delimiters");
774
+ appendCBORArtifactDelimiters(out, v.artifact_delimiters);
775
+ }
776
+ if (v.cross_boundary_linking !== undefined && v.cross_boundary_linking !== false) {
777
+ (0, cbor_gen_ts_1.writeText)(out, "cross_boundary_linking");
778
+ (0, cbor_gen_ts_1.writeBool)(out, v.cross_boundary_linking);
779
+ }
780
+ if (v.assembly_name_annotation !== undefined && v.assembly_name_annotation !== null) {
781
+ (0, cbor_gen_ts_1.writeText)(out, "assembly_name_annotation");
782
+ appendCBORAssemblyNameAnnotation(out, v.assembly_name_annotation);
783
+ }
784
+ }
785
+ function decodeCBORProviderContract(data) {
786
+ const dec = new cbor_gen_ts_1.CborDec(data);
787
+ return decodeCBORProviderContractFrom(dec);
788
+ }
789
+ function decodeCBORProviderContractFrom(dec) {
790
+ const o = {};
791
+ const n = dec.readMapHeader();
792
+ for (let i = 0; i < n; i++) {
793
+ const k = dec.readText();
794
+ switch (k) {
795
+ case "input_kinds":
796
+ o["input_kinds"] = decodeCBORInputKindsFrom(dec);
797
+ break;
798
+ case "boundary_assembly":
799
+ o["boundary_assembly"] = dec.readText();
800
+ break;
801
+ case "artifact_delimiters":
802
+ o["artifact_delimiters"] = decodeCBORArtifactDelimitersFrom(dec);
803
+ break;
804
+ case "assembly_name_annotation":
805
+ o["assembly_name_annotation"] = decodeCBORAssemblyNameAnnotationFrom(dec);
806
+ break;
807
+ case "reusable_instance":
808
+ o["reusable_instance"] = dec.readBool();
809
+ break;
810
+ case "cross_boundary_linking":
811
+ o["cross_boundary_linking"] = dec.readBool();
812
+ break;
813
+ case "omits":
814
+ o["omits"] = dec.readBool();
815
+ break;
816
+ case "boundary_artifacts":
817
+ o["boundary_artifacts"] = dec.readBool();
818
+ break;
819
+ case "nest_segment":
820
+ o["nest_segment"] = dec.readText();
821
+ break;
822
+ case "source_ignore":
823
+ o["source_ignore"] = decodeCBORSourceIgnoreFrom(dec);
824
+ break;
825
+ default: dec.skip();
826
+ }
827
+ }
828
+ return o;
829
+ }
830
+ function encodeCBORSourceIgnore(v) {
831
+ const out = [];
832
+ appendCBORSourceIgnore(out, v);
833
+ return new Uint8Array(out);
834
+ }
835
+ function appendCBORSourceIgnore(out, v) {
836
+ let n = 0;
837
+ if (v.files !== undefined && v.files.length > 0)
838
+ n++;
839
+ if (v.patterns !== undefined && v.patterns.length > 0)
840
+ n++;
841
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
842
+ if (v.files !== undefined && v.files.length > 0) {
843
+ (0, cbor_gen_ts_1.writeText)(out, "files");
844
+ {
845
+ const a0 = v.files;
846
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
847
+ for (const ee0 of a0) {
848
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
849
+ }
850
+ }
851
+ }
852
+ if (v.patterns !== undefined && v.patterns.length > 0) {
853
+ (0, cbor_gen_ts_1.writeText)(out, "patterns");
854
+ {
855
+ const a0 = v.patterns;
856
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
857
+ for (const ee0 of a0) {
858
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
859
+ }
860
+ }
861
+ }
862
+ }
863
+ function decodeCBORSourceIgnore(data) {
864
+ const dec = new cbor_gen_ts_1.CborDec(data);
865
+ return decodeCBORSourceIgnoreFrom(dec);
866
+ }
867
+ function decodeCBORSourceIgnoreFrom(dec) {
868
+ const o = {};
869
+ const n = dec.readMapHeader();
870
+ for (let i = 0; i < n; i++) {
871
+ const k = dec.readText();
872
+ switch (k) {
873
+ case "patterns":
874
+ o["patterns"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
875
+ a.push(dec.readText());
876
+ } return a; })();
877
+ break;
878
+ case "files":
879
+ o["files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
880
+ a.push(dec.readText());
881
+ } return a; })();
882
+ break;
883
+ default: dec.skip();
884
+ }
885
+ }
886
+ return o;
887
+ }
888
+ function encodeCBORInputKinds(v) {
889
+ const out = [];
890
+ appendCBORInputKinds(out, v);
891
+ return new Uint8Array(out);
892
+ }
893
+ function appendCBORInputKinds(out, v) {
894
+ let n = 3;
895
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
896
+ (0, cbor_gen_ts_1.writeText)(out, "sourced");
897
+ (0, cbor_gen_ts_1.writeBool)(out, v.sourced);
898
+ (0, cbor_gen_ts_1.writeText)(out, "synthesized");
899
+ (0, cbor_gen_ts_1.writeBool)(out, v.synthesized);
900
+ (0, cbor_gen_ts_1.writeText)(out, "artifacts_standalone");
901
+ (0, cbor_gen_ts_1.writeBool)(out, v.artifacts_standalone);
902
+ }
903
+ function decodeCBORInputKinds(data) {
904
+ const dec = new cbor_gen_ts_1.CborDec(data);
905
+ return decodeCBORInputKindsFrom(dec);
906
+ }
907
+ function decodeCBORInputKindsFrom(dec) {
908
+ const o = {};
909
+ const n = dec.readMapHeader();
910
+ for (let i = 0; i < n; i++) {
911
+ const k = dec.readText();
912
+ switch (k) {
913
+ case "sourced":
914
+ o["sourced"] = dec.readBool();
915
+ break;
916
+ case "synthesized":
917
+ o["synthesized"] = dec.readBool();
918
+ break;
919
+ case "artifacts_standalone":
920
+ o["artifacts_standalone"] = dec.readBool();
921
+ break;
922
+ default: dec.skip();
923
+ }
924
+ }
925
+ return o;
926
+ }
927
+ function encodeCBORArtifactDelimiters(v) {
928
+ const out = [];
929
+ appendCBORArtifactDelimiters(out, v);
930
+ return new Uint8Array(out);
931
+ }
932
+ function appendCBORArtifactDelimiters(out, v) {
933
+ let n = 2;
934
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
935
+ (0, cbor_gen_ts_1.writeText)(out, "left");
936
+ (0, cbor_gen_ts_1.writeText)(out, v.left);
937
+ (0, cbor_gen_ts_1.writeText)(out, "right");
938
+ (0, cbor_gen_ts_1.writeText)(out, v.right);
939
+ }
940
+ function decodeCBORArtifactDelimiters(data) {
941
+ const dec = new cbor_gen_ts_1.CborDec(data);
942
+ return decodeCBORArtifactDelimitersFrom(dec);
943
+ }
944
+ function decodeCBORArtifactDelimitersFrom(dec) {
945
+ const o = {};
946
+ const n = dec.readMapHeader();
947
+ for (let i = 0; i < n; i++) {
948
+ const k = dec.readText();
949
+ switch (k) {
950
+ case "left":
951
+ o["left"] = dec.readText();
952
+ break;
953
+ case "right":
954
+ o["right"] = dec.readText();
955
+ break;
956
+ default: dec.skip();
957
+ }
958
+ }
959
+ return o;
960
+ }
961
+ function encodeCBORAssemblyNameAnnotation(v) {
962
+ const out = [];
963
+ appendCBORAssemblyNameAnnotation(out, v);
964
+ return new Uint8Array(out);
965
+ }
966
+ function appendCBORAssemblyNameAnnotation(out, v) {
967
+ let n = 1;
968
+ if (v.require_unique !== undefined && v.require_unique !== false)
969
+ n++;
970
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
971
+ (0, cbor_gen_ts_1.writeText)(out, "annotation");
972
+ (0, cbor_gen_ts_1.writeText)(out, v.annotation);
973
+ if (v.require_unique !== undefined && v.require_unique !== false) {
974
+ (0, cbor_gen_ts_1.writeText)(out, "require_unique");
975
+ (0, cbor_gen_ts_1.writeBool)(out, v.require_unique);
976
+ }
977
+ }
978
+ function decodeCBORAssemblyNameAnnotation(data) {
979
+ const dec = new cbor_gen_ts_1.CborDec(data);
980
+ return decodeCBORAssemblyNameAnnotationFrom(dec);
981
+ }
982
+ function decodeCBORAssemblyNameAnnotationFrom(dec) {
983
+ const o = {};
984
+ const n = dec.readMapHeader();
985
+ for (let i = 0; i < n; i++) {
986
+ const k = dec.readText();
987
+ switch (k) {
988
+ case "annotation":
989
+ o["annotation"] = dec.readText();
990
+ break;
991
+ case "require_unique":
992
+ o["require_unique"] = dec.readBool();
993
+ break;
994
+ default: dec.skip();
995
+ }
996
+ }
997
+ return o;
998
+ }
999
+ function encodeCBORImporterContract(v) {
1000
+ const out = [];
1001
+ appendCBORImporterContract(out, v);
1002
+ return new Uint8Array(out);
1003
+ }
1004
+ function appendCBORImporterContract(out, v) {
1005
+ let n = 0;
1006
+ if (v.detect !== undefined && v.detect.length > 0)
1007
+ n++;
1008
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1009
+ if (v.detect !== undefined && v.detect.length > 0) {
1010
+ (0, cbor_gen_ts_1.writeText)(out, "detect");
1011
+ {
1012
+ const a0 = v.detect;
1013
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1014
+ for (const ee0 of a0) {
1015
+ appendCBORDetectSignature(out, ee0);
1016
+ }
1017
+ }
1018
+ }
1019
+ }
1020
+ function decodeCBORImporterContract(data) {
1021
+ const dec = new cbor_gen_ts_1.CborDec(data);
1022
+ return decodeCBORImporterContractFrom(dec);
1023
+ }
1024
+ function decodeCBORImporterContractFrom(dec) {
1025
+ const o = {};
1026
+ const n = dec.readMapHeader();
1027
+ for (let i = 0; i < n; i++) {
1028
+ const k = dec.readText();
1029
+ switch (k) {
1030
+ case "detect":
1031
+ o["detect"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1032
+ a.push(decodeCBORDetectSignatureFrom(dec));
1033
+ } return a; })();
1034
+ break;
1035
+ default: dec.skip();
1036
+ }
1037
+ }
1038
+ return o;
1039
+ }
1040
+ function encodeCBORDetectSignature(v) {
1041
+ const out = [];
1042
+ appendCBORDetectSignature(out, v);
1043
+ return new Uint8Array(out);
1044
+ }
1045
+ function appendCBORDetectSignature(out, v) {
1046
+ let n = 1;
1047
+ if (v.files !== undefined && v.files.length > 0)
1048
+ n++;
1049
+ if (v.match !== undefined && v.match.length > 0)
1050
+ n++;
1051
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1052
+ if (v.files !== undefined && v.files.length > 0) {
1053
+ (0, cbor_gen_ts_1.writeText)(out, "files");
1054
+ {
1055
+ const a0 = v.files;
1056
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1057
+ for (const ee0 of a0) {
1058
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
1059
+ }
1060
+ }
1061
+ }
1062
+ if (v.match !== undefined && v.match.length > 0) {
1063
+ (0, cbor_gen_ts_1.writeText)(out, "match");
1064
+ {
1065
+ const a0 = v.match;
1066
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
1067
+ for (const ee0 of a0) {
1068
+ appendCBORPathMatch(out, ee0);
1069
+ }
1070
+ }
1071
+ }
1072
+ (0, cbor_gen_ts_1.writeText)(out, "syntax");
1073
+ (0, cbor_gen_ts_1.writeText)(out, v.syntax);
1074
+ }
1075
+ function decodeCBORDetectSignature(data) {
1076
+ const dec = new cbor_gen_ts_1.CborDec(data);
1077
+ return decodeCBORDetectSignatureFrom(dec);
1078
+ }
1079
+ function decodeCBORDetectSignatureFrom(dec) {
1080
+ const o = {};
1081
+ const n = dec.readMapHeader();
1082
+ for (let i = 0; i < n; i++) {
1083
+ const k = dec.readText();
1084
+ switch (k) {
1085
+ case "syntax":
1086
+ o["syntax"] = dec.readText();
1087
+ break;
1088
+ case "files":
1089
+ o["files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1090
+ a.push(dec.readText());
1091
+ } return a; })();
1092
+ break;
1093
+ case "match":
1094
+ o["match"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
1095
+ a.push(decodeCBORPathMatchFrom(dec));
1096
+ } return a; })();
1097
+ break;
1098
+ default: dec.skip();
1099
+ }
1100
+ }
1101
+ return o;
1102
+ }
1103
+ function encodeCBORPathMatch(v) {
1104
+ const out = [];
1105
+ appendCBORPathMatch(out, v);
1106
+ return new Uint8Array(out);
1107
+ }
1108
+ function appendCBORPathMatch(out, v) {
1109
+ let n = 2;
1110
+ if (v.equals !== undefined && v.equals !== "")
1111
+ n++;
1112
+ if (v.prefix !== undefined && v.prefix !== "")
1113
+ n++;
1114
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
1115
+ (0, cbor_gen_ts_1.writeText)(out, "is");
1116
+ (0, cbor_gen_ts_1.writeText)(out, v.is);
1117
+ (0, cbor_gen_ts_1.writeText)(out, "path");
1118
+ (0, cbor_gen_ts_1.writeText)(out, v.path);
1119
+ if (v.equals !== undefined && v.equals !== "") {
1120
+ (0, cbor_gen_ts_1.writeText)(out, "equals");
1121
+ (0, cbor_gen_ts_1.writeText)(out, v.equals);
1122
+ }
1123
+ if (v.prefix !== undefined && v.prefix !== "") {
1124
+ (0, cbor_gen_ts_1.writeText)(out, "prefix");
1125
+ (0, cbor_gen_ts_1.writeText)(out, v.prefix);
1126
+ }
1127
+ }
1128
+ function decodeCBORPathMatch(data) {
1129
+ const dec = new cbor_gen_ts_1.CborDec(data);
1130
+ return decodeCBORPathMatchFrom(dec);
1131
+ }
1132
+ function decodeCBORPathMatchFrom(dec) {
1133
+ const o = {};
1134
+ const n = dec.readMapHeader();
1135
+ for (let i = 0; i < n; i++) {
1136
+ const k = dec.readText();
1137
+ switch (k) {
1138
+ case "path":
1139
+ o["path"] = dec.readText();
1140
+ break;
1141
+ case "is":
1142
+ o["is"] = dec.readText();
1143
+ break;
1144
+ case "equals":
1145
+ o["equals"] = dec.readText();
1146
+ break;
1147
+ case "prefix":
1148
+ o["prefix"] = dec.readText();
1149
+ break;
1150
+ default: dec.skip();
1151
+ }
1152
+ }
1153
+ return o;
1154
+ }