@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,385 @@
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.encodeAnnotationTransformInput = encodeAnnotationTransformInput;
6
+ exports.decodeAnnotationTransformInput = decodeAnnotationTransformInput;
7
+ exports.encodeAnnotationTransformOutput = encodeAnnotationTransformOutput;
8
+ exports.decodeAnnotationTransformOutput = decodeAnnotationTransformOutput;
9
+ exports.encodeAnnotationTarget = encodeAnnotationTarget;
10
+ exports.decodeAnnotationTarget = decodeAnnotationTarget;
11
+ exports.encodeAnnotationInjection = encodeAnnotationInjection;
12
+ exports.decodeAnnotationInjection = decodeAnnotationInjection;
13
+ exports.encodeAnnotationSource = encodeAnnotationSource;
14
+ exports.decodeAnnotationSource = decodeAnnotationSource;
15
+ exports.encodeCBORAnnotationTransformInput = encodeCBORAnnotationTransformInput;
16
+ exports.appendCBORAnnotationTransformInput = appendCBORAnnotationTransformInput;
17
+ exports.decodeCBORAnnotationTransformInput = decodeCBORAnnotationTransformInput;
18
+ exports.decodeCBORAnnotationTransformInputFrom = decodeCBORAnnotationTransformInputFrom;
19
+ exports.encodeCBORAnnotationTransformOutput = encodeCBORAnnotationTransformOutput;
20
+ exports.appendCBORAnnotationTransformOutput = appendCBORAnnotationTransformOutput;
21
+ exports.decodeCBORAnnotationTransformOutput = decodeCBORAnnotationTransformOutput;
22
+ exports.decodeCBORAnnotationTransformOutputFrom = decodeCBORAnnotationTransformOutputFrom;
23
+ exports.encodeCBORAnnotationTarget = encodeCBORAnnotationTarget;
24
+ exports.appendCBORAnnotationTarget = appendCBORAnnotationTarget;
25
+ exports.decodeCBORAnnotationTarget = decodeCBORAnnotationTarget;
26
+ exports.decodeCBORAnnotationTargetFrom = decodeCBORAnnotationTargetFrom;
27
+ exports.encodeCBORAnnotationInjection = encodeCBORAnnotationInjection;
28
+ exports.appendCBORAnnotationInjection = appendCBORAnnotationInjection;
29
+ exports.decodeCBORAnnotationInjection = decodeCBORAnnotationInjection;
30
+ exports.decodeCBORAnnotationInjectionFrom = decodeCBORAnnotationInjectionFrom;
31
+ exports.encodeCBORAnnotationSource = encodeCBORAnnotationSource;
32
+ exports.appendCBORAnnotationSource = appendCBORAnnotationSource;
33
+ exports.decodeCBORAnnotationSource = decodeCBORAnnotationSource;
34
+ exports.decodeCBORAnnotationSourceFrom = decodeCBORAnnotationSourceFrom;
35
+ // Code generated by internal/tools/typegen from
36
+ // aggrega-schemas/json/wasm-annotation-transform-v1beta1.schema.json. DO NOT EDIT.
37
+ // Regenerate with `go generate ./internal/tools/typegen` from the
38
+ // aggrega-cli checkout.
39
+ const orderedmap_gen_ts_1 = require("./orderedmap_gen.js");
40
+ const cbor_gen_ts_1 = require("./cbor_gen.js");
41
+ function jstr(s) {
42
+ return JSON.stringify(s);
43
+ }
44
+ // encodeOpaque carries an opaque (`any` / RawMessage) value VERBATIM: the
45
+ // key order from JSON.parse is preserved, matching the Go and Rust codecs'
46
+ // byte-carry of opaque values. Opaque values are never sorted.
47
+ function encodeOpaque(v) {
48
+ return JSON.stringify(v);
49
+ }
50
+ function encodeAnnotationTransformInput(v) {
51
+ const parts = [];
52
+ parts.push(`${jstr("targets")}:${`[${v.targets.map((e0) => encodeAnnotationTarget(e0)).join(",")}]`}`);
53
+ parts.push(`${jstr("binding_keys")}:${`[${v.binding_keys.map((e0) => jstr(e0)).join(",")}]`}`);
54
+ if (v.sources !== undefined && v.sources.length > 0)
55
+ parts.push(`${jstr("sources")}:${`[${v.sources.map((e0) => encodeAnnotationSource(e0)).join(",")}]`}`);
56
+ if (v.settings !== undefined && v.settings !== null)
57
+ parts.push(`${jstr("settings")}:${encodeOpaque(v.settings)}`);
58
+ return `{${parts.join(",")}}`;
59
+ }
60
+ function decodeAnnotationTransformInput(data) {
61
+ const o = {};
62
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
63
+ switch (k) {
64
+ case "targets":
65
+ o["targets"] = (0, orderedmap_gen_ts_1.readJSONArray)(raw, (r0) => decodeAnnotationTarget(r0));
66
+ break;
67
+ case "binding_keys":
68
+ o["binding_keys"] = JSON.parse(raw);
69
+ break;
70
+ case "sources":
71
+ o["sources"] = JSON.parse(raw);
72
+ break;
73
+ case "settings":
74
+ o["settings"] = JSON.parse(raw);
75
+ break;
76
+ }
77
+ });
78
+ return o;
79
+ }
80
+ function encodeAnnotationTransformOutput(v) {
81
+ const parts = [];
82
+ parts.push(`${jstr("injections")}:${`[${v.injections.map((e0) => encodeAnnotationInjection(e0)).join(",")}]`}`);
83
+ if (v.error !== undefined && v.error !== "")
84
+ parts.push(`${jstr("error")}:${jstr(v.error)}`);
85
+ return `{${parts.join(",")}}`;
86
+ }
87
+ function decodeAnnotationTransformOutput(data) {
88
+ return JSON.parse(data);
89
+ }
90
+ function encodeAnnotationTarget(v) {
91
+ const parts = [];
92
+ parts.push(`${jstr("boundary_path")}:${jstr(v.boundary_path)}`);
93
+ parts.push(`${jstr("component_name")}:${jstr(v.component_name)}`);
94
+ parts.push(`${jstr("annotations")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.annotations, (v0) => encodeOpaque(v0))}`);
95
+ return `{${parts.join(",")}}`;
96
+ }
97
+ function decodeAnnotationTarget(data) {
98
+ const o = {};
99
+ (0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
100
+ switch (k) {
101
+ case "boundary_path":
102
+ o["boundary_path"] = JSON.parse(raw);
103
+ break;
104
+ case "component_name":
105
+ o["component_name"] = JSON.parse(raw);
106
+ break;
107
+ case "annotations":
108
+ o["annotations"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
109
+ break;
110
+ }
111
+ });
112
+ return o;
113
+ }
114
+ function encodeAnnotationInjection(v) {
115
+ const parts = [];
116
+ parts.push(`${jstr("boundary_path")}:${jstr(v.boundary_path)}`);
117
+ parts.push(`${jstr("component_name")}:${jstr(v.component_name)}`);
118
+ parts.push(`${jstr("annotation_key")}:${jstr(v.annotation_key)}`);
119
+ parts.push(`${jstr("annotation_value")}:${encodeOpaque(v.annotation_value)}`);
120
+ return `{${parts.join(",")}}`;
121
+ }
122
+ function decodeAnnotationInjection(data) {
123
+ return JSON.parse(data);
124
+ }
125
+ function encodeAnnotationSource(v) {
126
+ const parts = [];
127
+ parts.push(`${jstr("path")}:${jstr(v.path)}`);
128
+ parts.push(`${jstr("content")}:${jstr(v.content)}`);
129
+ return `{${parts.join(",")}}`;
130
+ }
131
+ function decodeAnnotationSource(data) {
132
+ return JSON.parse(data);
133
+ }
134
+ function encodeCBORAnnotationTransformInput(v) {
135
+ const out = [];
136
+ appendCBORAnnotationTransformInput(out, v);
137
+ return new Uint8Array(out);
138
+ }
139
+ function appendCBORAnnotationTransformInput(out, v) {
140
+ let n = 2;
141
+ if (v.sources !== undefined && v.sources.length > 0)
142
+ n++;
143
+ if (v.settings !== undefined && v.settings !== null)
144
+ n++;
145
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
146
+ if (v.sources !== undefined && v.sources.length > 0) {
147
+ (0, cbor_gen_ts_1.writeText)(out, "sources");
148
+ {
149
+ const a0 = v.sources;
150
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
151
+ for (const ee0 of a0) {
152
+ appendCBORAnnotationSource(out, ee0);
153
+ }
154
+ }
155
+ }
156
+ (0, cbor_gen_ts_1.writeText)(out, "targets");
157
+ {
158
+ const a0 = v.targets;
159
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
160
+ for (const ee0 of a0) {
161
+ appendCBORAnnotationTarget(out, ee0);
162
+ }
163
+ }
164
+ if (v.settings !== undefined && v.settings !== null) {
165
+ (0, cbor_gen_ts_1.writeText)(out, "settings");
166
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.settings)));
167
+ }
168
+ (0, cbor_gen_ts_1.writeText)(out, "binding_keys");
169
+ {
170
+ const a0 = v.binding_keys;
171
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
172
+ for (const ee0 of a0) {
173
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
174
+ }
175
+ }
176
+ }
177
+ function decodeCBORAnnotationTransformInput(data) {
178
+ const dec = new cbor_gen_ts_1.CborDec(data);
179
+ return decodeCBORAnnotationTransformInputFrom(dec);
180
+ }
181
+ function decodeCBORAnnotationTransformInputFrom(dec) {
182
+ const o = {};
183
+ const n = dec.readMapHeader();
184
+ for (let i = 0; i < n; i++) {
185
+ const k = dec.readText();
186
+ switch (k) {
187
+ case "targets":
188
+ o["targets"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
189
+ a.push(decodeCBORAnnotationTargetFrom(dec));
190
+ } return a; })();
191
+ break;
192
+ case "binding_keys":
193
+ o["binding_keys"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
194
+ a.push(dec.readText());
195
+ } return a; })();
196
+ break;
197
+ case "sources":
198
+ o["sources"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
199
+ a.push(decodeCBORAnnotationSourceFrom(dec));
200
+ } return a; })();
201
+ break;
202
+ case "settings":
203
+ o["settings"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
204
+ break;
205
+ default: dec.skip();
206
+ }
207
+ }
208
+ return o;
209
+ }
210
+ function encodeCBORAnnotationTransformOutput(v) {
211
+ const out = [];
212
+ appendCBORAnnotationTransformOutput(out, v);
213
+ return new Uint8Array(out);
214
+ }
215
+ function appendCBORAnnotationTransformOutput(out, v) {
216
+ let n = 1;
217
+ if (v.error !== undefined && v.error !== "")
218
+ n++;
219
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
220
+ if (v.error !== undefined && v.error !== "") {
221
+ (0, cbor_gen_ts_1.writeText)(out, "error");
222
+ (0, cbor_gen_ts_1.writeText)(out, v.error);
223
+ }
224
+ (0, cbor_gen_ts_1.writeText)(out, "injections");
225
+ {
226
+ const a0 = v.injections;
227
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
228
+ for (const ee0 of a0) {
229
+ appendCBORAnnotationInjection(out, ee0);
230
+ }
231
+ }
232
+ }
233
+ function decodeCBORAnnotationTransformOutput(data) {
234
+ const dec = new cbor_gen_ts_1.CborDec(data);
235
+ return decodeCBORAnnotationTransformOutputFrom(dec);
236
+ }
237
+ function decodeCBORAnnotationTransformOutputFrom(dec) {
238
+ const o = {};
239
+ const n = dec.readMapHeader();
240
+ for (let i = 0; i < n; i++) {
241
+ const k = dec.readText();
242
+ switch (k) {
243
+ case "injections":
244
+ o["injections"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
245
+ a.push(decodeCBORAnnotationInjectionFrom(dec));
246
+ } return a; })();
247
+ break;
248
+ case "error":
249
+ o["error"] = dec.readText();
250
+ break;
251
+ default: dec.skip();
252
+ }
253
+ }
254
+ return o;
255
+ }
256
+ function encodeCBORAnnotationTarget(v) {
257
+ const out = [];
258
+ appendCBORAnnotationTarget(out, v);
259
+ return new Uint8Array(out);
260
+ }
261
+ function appendCBORAnnotationTarget(out, v) {
262
+ let n = 3;
263
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
264
+ (0, cbor_gen_ts_1.writeText)(out, "annotations");
265
+ {
266
+ const m0 = v.annotations;
267
+ (0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
268
+ for (const [kk0, vv0] of m0) {
269
+ (0, cbor_gen_ts_1.writeHead)(out, 4, 2);
270
+ (0, cbor_gen_ts_1.writeText)(out, kk0);
271
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
272
+ }
273
+ }
274
+ (0, cbor_gen_ts_1.writeText)(out, "boundary_path");
275
+ (0, cbor_gen_ts_1.writeText)(out, v.boundary_path);
276
+ (0, cbor_gen_ts_1.writeText)(out, "component_name");
277
+ (0, cbor_gen_ts_1.writeText)(out, v.component_name);
278
+ }
279
+ function decodeCBORAnnotationTarget(data) {
280
+ const dec = new cbor_gen_ts_1.CborDec(data);
281
+ return decodeCBORAnnotationTargetFrom(dec);
282
+ }
283
+ function decodeCBORAnnotationTargetFrom(dec) {
284
+ const o = {};
285
+ const n = dec.readMapHeader();
286
+ for (let i = 0; i < n; i++) {
287
+ const k = dec.readText();
288
+ switch (k) {
289
+ case "boundary_path":
290
+ o["boundary_path"] = dec.readText();
291
+ break;
292
+ case "component_name":
293
+ o["component_name"] = dec.readText();
294
+ break;
295
+ case "annotations":
296
+ o["annotations"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
297
+ const mk = dec.readEntryKey();
298
+ if (m.has(mk))
299
+ throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
300
+ m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
301
+ } return m; })();
302
+ break;
303
+ default: dec.skip();
304
+ }
305
+ }
306
+ return o;
307
+ }
308
+ function encodeCBORAnnotationInjection(v) {
309
+ const out = [];
310
+ appendCBORAnnotationInjection(out, v);
311
+ return new Uint8Array(out);
312
+ }
313
+ function appendCBORAnnotationInjection(out, v) {
314
+ let n = 4;
315
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
316
+ (0, cbor_gen_ts_1.writeText)(out, "boundary_path");
317
+ (0, cbor_gen_ts_1.writeText)(out, v.boundary_path);
318
+ (0, cbor_gen_ts_1.writeText)(out, "annotation_key");
319
+ (0, cbor_gen_ts_1.writeText)(out, v.annotation_key);
320
+ (0, cbor_gen_ts_1.writeText)(out, "component_name");
321
+ (0, cbor_gen_ts_1.writeText)(out, v.component_name);
322
+ (0, cbor_gen_ts_1.writeText)(out, "annotation_value");
323
+ (0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.annotation_value)));
324
+ }
325
+ function decodeCBORAnnotationInjection(data) {
326
+ const dec = new cbor_gen_ts_1.CborDec(data);
327
+ return decodeCBORAnnotationInjectionFrom(dec);
328
+ }
329
+ function decodeCBORAnnotationInjectionFrom(dec) {
330
+ const o = {};
331
+ const n = dec.readMapHeader();
332
+ for (let i = 0; i < n; i++) {
333
+ const k = dec.readText();
334
+ switch (k) {
335
+ case "boundary_path":
336
+ o["boundary_path"] = dec.readText();
337
+ break;
338
+ case "component_name":
339
+ o["component_name"] = dec.readText();
340
+ break;
341
+ case "annotation_key":
342
+ o["annotation_key"] = dec.readText();
343
+ break;
344
+ case "annotation_value":
345
+ o["annotation_value"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
346
+ break;
347
+ default: dec.skip();
348
+ }
349
+ }
350
+ return o;
351
+ }
352
+ function encodeCBORAnnotationSource(v) {
353
+ const out = [];
354
+ appendCBORAnnotationSource(out, v);
355
+ return new Uint8Array(out);
356
+ }
357
+ function appendCBORAnnotationSource(out, v) {
358
+ let n = 2;
359
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
360
+ (0, cbor_gen_ts_1.writeText)(out, "path");
361
+ (0, cbor_gen_ts_1.writeText)(out, v.path);
362
+ (0, cbor_gen_ts_1.writeText)(out, "content");
363
+ (0, cbor_gen_ts_1.writeText)(out, v.content);
364
+ }
365
+ function decodeCBORAnnotationSource(data) {
366
+ const dec = new cbor_gen_ts_1.CborDec(data);
367
+ return decodeCBORAnnotationSourceFrom(dec);
368
+ }
369
+ function decodeCBORAnnotationSourceFrom(dec) {
370
+ const o = {};
371
+ const n = dec.readMapHeader();
372
+ for (let i = 0; i < n; i++) {
373
+ const k = dec.readText();
374
+ switch (k) {
375
+ case "path":
376
+ o["path"] = dec.readText();
377
+ break;
378
+ case "content":
379
+ o["content"] = dec.readText();
380
+ break;
381
+ default: dec.skip();
382
+ }
383
+ }
384
+ return o;
385
+ }
@@ -0,0 +1,28 @@
1
+ export declare function writeHead(out: number[], major: number, arg: number): void;
2
+ export declare function writeInt(out: number[], i: number): void;
3
+ export declare function utf8Encode(s: string): Uint8Array;
4
+ export declare function utf8Decode(b: Uint8Array | number[]): string;
5
+ export declare function writeText(out: number[], s: string): void;
6
+ export declare function writeBytes(out: number[], b: Uint8Array | number[]): void;
7
+ export declare function writeBool(out: number[], v: boolean): void;
8
+ export declare function writeFloat(out: number[], f: number): void;
9
+ export declare function sortKeys(keys: string[]): void;
10
+ export declare function duplicateKeyError(k: string): Error;
11
+ export declare function b64decode(s: string): number[];
12
+ export declare function b64encode(data: number[] | Uint8Array): string;
13
+ export declare class CborDec {
14
+ private data;
15
+ private pos;
16
+ constructor(data: Uint8Array);
17
+ private readHead;
18
+ private need;
19
+ readMapHeader(): number;
20
+ readArrayHeader(): number;
21
+ readEntryKey(): string;
22
+ readText(): string;
23
+ readBytes(): number[];
24
+ readInt(): number;
25
+ readFloat(): number;
26
+ readBool(): boolean;
27
+ skip(): void;
28
+ }