@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,413 @@
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.CborDec = void 0;
6
+ exports.writeHead = writeHead;
7
+ exports.writeInt = writeInt;
8
+ exports.utf8Encode = utf8Encode;
9
+ exports.utf8Decode = utf8Decode;
10
+ exports.writeText = writeText;
11
+ exports.writeBytes = writeBytes;
12
+ exports.writeBool = writeBool;
13
+ exports.writeFloat = writeFloat;
14
+ exports.sortKeys = sortKeys;
15
+ exports.duplicateKeyError = duplicateKeyError;
16
+ exports.b64decode = b64decode;
17
+ exports.b64encode = b64encode;
18
+ const B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
19
+ // writeHead appends a CBOR head: the major type in the top three bits and the
20
+ // shortest length/argument encoding. arg is a non-negative integer within the
21
+ // safe-integer range (socket lengths and values never exceed it).
22
+ function writeHead(out, major, arg) {
23
+ const mb = major << 5;
24
+ if (arg < 24) {
25
+ out.push(mb | arg);
26
+ }
27
+ else if (arg < 0x100) {
28
+ out.push(mb | 24, arg & 0xff);
29
+ }
30
+ else if (arg < 0x10000) {
31
+ out.push(mb | 25, (arg >> 8) & 0xff, arg & 0xff);
32
+ }
33
+ else if (arg < 0x100000000) {
34
+ out.push(mb | 26, (arg / 0x1000000) & 0xff, (arg >> 16) & 0xff, (arg >> 8) & 0xff, arg & 0xff);
35
+ }
36
+ else {
37
+ const hi = Math.floor(arg / 0x100000000);
38
+ const lo = arg >>> 0;
39
+ out.push(mb | 27, (hi >> 24) & 0xff, (hi >> 16) & 0xff, (hi >> 8) & 0xff, hi & 0xff, (lo >>> 24) & 0xff, (lo >> 16) & 0xff, (lo >> 8) & 0xff, lo & 0xff);
40
+ }
41
+ }
42
+ // writeInt appends a signed integer as CBOR major type 0 (non-negative) or 1
43
+ // (negative), shortest head.
44
+ function writeInt(out, i) {
45
+ if (i < 0) {
46
+ writeHead(out, 1, -1 - i);
47
+ }
48
+ else {
49
+ writeHead(out, 0, i);
50
+ }
51
+ }
52
+ const TE = new TextEncoder();
53
+ const TD = new TextDecoder();
54
+ function utf8Encode(s) {
55
+ return TE.encode(s);
56
+ }
57
+ function utf8Decode(b) {
58
+ return TD.decode(b instanceof Uint8Array ? b : new Uint8Array(b));
59
+ }
60
+ // writeText appends a text string (major 3): shortest length head then the UTF-8
61
+ // bytes. The length head is the byte length, not the JS string length.
62
+ function writeText(out, s) {
63
+ const b = utf8Encode(s);
64
+ writeHead(out, 3, b.length);
65
+ for (const x of b)
66
+ out.push(x);
67
+ }
68
+ // writeBytes appends a byte string (major 2): shortest length head then bytes.
69
+ function writeBytes(out, b) {
70
+ writeHead(out, 2, b.length);
71
+ for (const x of b)
72
+ out.push(x);
73
+ }
74
+ // writeBool appends the fixed single-byte CBOR bool.
75
+ function writeBool(out, v) {
76
+ out.push(v ? 0xf5 : 0xf4);
77
+ }
78
+ const f32buf = new ArrayBuffer(4);
79
+ const f32dv = new DataView(f32buf);
80
+ const f64buf = new ArrayBuffer(8);
81
+ const f64dv = new DataView(f64buf);
82
+ function f32Bits(f) {
83
+ f32dv.setFloat32(0, f);
84
+ return f32dv.getUint32(0);
85
+ }
86
+ // writeFloat appends f as a canonical CBOR float per CBOR CDE §4.2: the shortest
87
+ // of float16/float32/float64 that round-trips to the exact value, with NaN
88
+ // canonicalized to 0xf97e00, ±Inf to the float16 infinities, and ±0 preserved by
89
+ // sign. No numeric reduction: an integer-valued float stays a float.
90
+ function writeFloat(out, f) {
91
+ if (Number.isNaN(f)) {
92
+ out.push(0xf9, 0x7e, 0x00);
93
+ return;
94
+ }
95
+ if (f === Infinity) {
96
+ out.push(0xf9, 0x7c, 0x00);
97
+ return;
98
+ }
99
+ if (f === -Infinity) {
100
+ out.push(0xf9, 0xfc, 0x00);
101
+ return;
102
+ }
103
+ const f32 = Math.fround(f);
104
+ if (f32 === f && Object.is(Math.fround(f), f)) {
105
+ const bits32 = f32Bits(f32);
106
+ const h = f32ToF16Exact(bits32);
107
+ if (h !== null) {
108
+ out.push(0xf9, (h >> 8) & 0xff, h & 0xff);
109
+ return;
110
+ }
111
+ out.push(0xfa, (bits32 >>> 24) & 0xff, (bits32 >> 16) & 0xff, (bits32 >> 8) & 0xff, bits32 & 0xff);
112
+ return;
113
+ }
114
+ f64dv.setFloat64(0, f);
115
+ out.push(0xfb, f64dv.getUint8(0), f64dv.getUint8(1), f64dv.getUint8(2), f64dv.getUint8(3), f64dv.getUint8(4), f64dv.getUint8(5), f64dv.getUint8(6), f64dv.getUint8(7));
116
+ }
117
+ // f32ToF16Exact converts float32 bits to a float16 if the value is EXACTLY
118
+ // representable (no rounding), returning the 16-bit encoding or null. ±0
119
+ // preserves its sign; Inf/NaN are handled by the caller.
120
+ function f32ToF16Exact(b) {
121
+ const sign = (b >>> 16) & 0x8000;
122
+ const exp = (b >>> 23) & 0xff;
123
+ const mant = b & 0x7fffff;
124
+ if (exp === 0) {
125
+ if (mant === 0)
126
+ return sign; // ±0
127
+ return null; // float32 subnormal: not float16-exact
128
+ }
129
+ if (exp === 0xff)
130
+ return null; // Inf/NaN: handled by the caller
131
+ const e = exp - 127;
132
+ if (e >= -14 && e <= 15) {
133
+ if ((mant & 0x1fff) !== 0)
134
+ return null; // low mantissa bits would be lost
135
+ return sign | ((e + 15) << 10) | (mant >> 13);
136
+ }
137
+ if (e >= -24 && e <= -15) {
138
+ const full = mant | 0x800000; // implicit leading 1
139
+ const shift = -(e + 1);
140
+ if ((full & ((1 << shift) - 1)) !== 0)
141
+ return null; // low bits would be lost
142
+ const hm = full >>> shift;
143
+ if (hm === 0 || hm > 0x3ff)
144
+ return null;
145
+ return sign | hm;
146
+ }
147
+ return null;
148
+ }
149
+ // float16ToNumber expands a CBOR half-precision float to a JS number.
150
+ function float16ToNumber(h) {
151
+ const sign = (h & 0x8000) << 16;
152
+ const exp = (h >> 10) & 0x1f;
153
+ let mant = h & 0x3ff;
154
+ if (exp === 0) {
155
+ if (mant === 0) {
156
+ f32dv.setUint32(0, sign >>> 0);
157
+ return f32dv.getFloat32(0); // ±0
158
+ }
159
+ let e = 0;
160
+ while ((mant & 0x400) === 0) {
161
+ mant <<= 1;
162
+ e++;
163
+ }
164
+ mant &= 0x3ff;
165
+ const exp32 = 127 - 15 - e + 1;
166
+ f32dv.setUint32(0, (sign | (exp32 << 23) | (mant << 13)) >>> 0);
167
+ return f32dv.getFloat32(0);
168
+ }
169
+ if (exp === 0x1f) {
170
+ if (mant === 0) {
171
+ f32dv.setUint32(0, (sign | 0x7f800000) >>> 0);
172
+ return f32dv.getFloat32(0); // ±Inf
173
+ }
174
+ f32dv.setUint32(0, (sign | 0x7f800000 | (mant << 13)) >>> 0);
175
+ return f32dv.getFloat32(0); // NaN
176
+ }
177
+ const exp32 = exp + 127 - 15;
178
+ f32dv.setUint32(0, (sign | (exp32 << 23) | (mant << 13)) >>> 0);
179
+ return f32dv.getFloat32(0);
180
+ }
181
+ // sortKeys sorts map keys into canonical CBOR order: by their encoded text-key
182
+ // bytes (UTF-8 byte length first, then the UTF-8 bytes), matching the Go and Rust
183
+ // codecs — not JS string order, which compares UTF-16 code units.
184
+ function sortKeys(keys) {
185
+ const enc = new Map();
186
+ const b = (k) => {
187
+ let e = enc.get(k);
188
+ if (e === undefined) {
189
+ e = utf8Encode(k);
190
+ enc.set(k, e);
191
+ }
192
+ return e;
193
+ };
194
+ keys.sort((x, y) => {
195
+ const bx = b(x);
196
+ const by = b(y);
197
+ if (bx.length !== by.length)
198
+ return bx.length - by.length;
199
+ for (let i = 0; i < bx.length; i++) {
200
+ if (bx[i] !== by[i])
201
+ return bx[i] - by[i];
202
+ }
203
+ return 0;
204
+ });
205
+ }
206
+ // duplicateKeyError is the refusal of an order-preserving map's array form that
207
+ // repeats a key, naming the key.
208
+ function duplicateKeyError(k) {
209
+ return new Error("cbor: duplicate key " + JSON.stringify(k));
210
+ }
211
+ function b64Val(c) {
212
+ if (c >= 65 && c <= 90)
213
+ return c - 65;
214
+ if (c >= 97 && c <= 122)
215
+ return c - 97 + 26;
216
+ if (c >= 48 && c <= 57)
217
+ return c - 48 + 52;
218
+ if (c === 43)
219
+ return 62;
220
+ if (c === 47)
221
+ return 63;
222
+ throw new Error("cbor: invalid base64 byte " + c);
223
+ }
224
+ // b64decode decodes standard (padded) base64 into raw bytes, matching
225
+ // encoding/json's []byte wire form.
226
+ function b64decode(s) {
227
+ const out = [];
228
+ let i = 0;
229
+ while (i < s.length) {
230
+ if (s.length - i < 4)
231
+ throw new Error("cbor: truncated base64");
232
+ const c0 = b64Val(s.charCodeAt(i));
233
+ const c1 = b64Val(s.charCodeAt(i + 1));
234
+ const p2 = s.charCodeAt(i + 2) === 61;
235
+ const p3 = s.charCodeAt(i + 3) === 61;
236
+ const c2 = p2 ? 0 : b64Val(s.charCodeAt(i + 2));
237
+ const c3 = p3 ? 0 : b64Val(s.charCodeAt(i + 3));
238
+ const nn = (c0 << 18) | (c1 << 12) | (c2 << 6) | c3;
239
+ out.push((nn >> 16) & 0xff);
240
+ if (!p2)
241
+ out.push((nn >> 8) & 0xff);
242
+ if (!p3)
243
+ out.push(nn & 0xff);
244
+ i += 4;
245
+ }
246
+ return out;
247
+ }
248
+ // b64encode encodes raw bytes as standard (padded) base64.
249
+ function b64encode(data) {
250
+ let out = "";
251
+ for (let i = 0; i < data.length; i += 3) {
252
+ const b0 = data[i];
253
+ const b1 = i + 1 < data.length ? data[i + 1] : 0;
254
+ const b2 = i + 2 < data.length ? data[i + 2] : 0;
255
+ const nn = (b0 << 16) | (b1 << 8) | b2;
256
+ out += B64[(nn >> 18) & 0x3f];
257
+ out += B64[(nn >> 12) & 0x3f];
258
+ out += i + 1 < data.length ? B64[(nn >> 6) & 0x3f] : "=";
259
+ out += i + 2 < data.length ? B64[nn & 0x3f] : "=";
260
+ }
261
+ return out;
262
+ }
263
+ // CborDec is a minimal canonical-CBOR reader over a byte array. It reads only the
264
+ // definite-length items the codec produces; indefinite lengths and unsupported
265
+ // majors are rejected loudly.
266
+ class CborDec {
267
+ data;
268
+ pos = 0;
269
+ constructor(data) {
270
+ this.data = data;
271
+ }
272
+ readHead() {
273
+ if (this.pos >= this.data.length)
274
+ throw new Error("cbor: unexpected end of input");
275
+ const ib = this.data[this.pos];
276
+ this.pos++;
277
+ const major = ib >> 5;
278
+ const ai = ib & 0x1f;
279
+ if (ai < 24)
280
+ return [major, ai, ai];
281
+ if (ai === 24) {
282
+ this.need(1);
283
+ const v = this.data[this.pos];
284
+ this.pos += 1;
285
+ return [major, ai, v];
286
+ }
287
+ if (ai === 25) {
288
+ this.need(2);
289
+ const v = (this.data[this.pos] << 8) | this.data[this.pos + 1];
290
+ this.pos += 2;
291
+ return [major, ai, v];
292
+ }
293
+ if (ai === 26) {
294
+ this.need(4);
295
+ const v = this.data[this.pos] * 0x1000000 +
296
+ (this.data[this.pos + 1] << 16) +
297
+ (this.data[this.pos + 2] << 8) +
298
+ this.data[this.pos + 3];
299
+ this.pos += 4;
300
+ return [major, ai, v];
301
+ }
302
+ if (ai === 27) {
303
+ this.need(8);
304
+ let v = 0;
305
+ for (let k = 0; k < 8; k++)
306
+ v = v * 256 + this.data[this.pos + k];
307
+ this.pos += 8;
308
+ return [major, ai, v];
309
+ }
310
+ throw new Error("cbor: reserved additional info " + ai);
311
+ }
312
+ need(n) {
313
+ if (this.pos + n > this.data.length)
314
+ throw new Error("cbor: truncated argument");
315
+ }
316
+ readMapHeader() {
317
+ const [major, , arg] = this.readHead();
318
+ if (major !== 5)
319
+ throw new Error("cbor: expected map, got major " + major);
320
+ return arg;
321
+ }
322
+ readArrayHeader() {
323
+ const [major, , arg] = this.readHead();
324
+ if (major !== 4)
325
+ throw new Error("cbor: expected array, got major " + major);
326
+ return arg;
327
+ }
328
+ // readEntryKey reads the start of one entry of an order-preserving map's array
329
+ // form — a two-element array whose first element is the text-string key — and
330
+ // returns the key, leaving the value as the next item. An entry of any other
331
+ // shape is refused.
332
+ readEntryKey() {
333
+ const n = this.readArrayHeader();
334
+ if (n !== 2)
335
+ throw new Error("cbor: an order-preserving map entry holds " + n + " items, want 2");
336
+ return this.readText();
337
+ }
338
+ readText() {
339
+ const [major, , arg] = this.readHead();
340
+ if (major !== 3)
341
+ throw new Error("cbor: expected text string, got major " + major);
342
+ this.need(arg);
343
+ const s = utf8Decode(this.data.subarray(this.pos, this.pos + arg));
344
+ this.pos += arg;
345
+ return s;
346
+ }
347
+ readBytes() {
348
+ const [major, , arg] = this.readHead();
349
+ if (major !== 2)
350
+ throw new Error("cbor: expected byte string, got major " + major);
351
+ this.need(arg);
352
+ const out = Array.from(this.data.subarray(this.pos, this.pos + arg));
353
+ this.pos += arg;
354
+ return out;
355
+ }
356
+ readInt() {
357
+ const [major, , arg] = this.readHead();
358
+ if (major === 0)
359
+ return arg;
360
+ if (major === 1)
361
+ return -1 - arg;
362
+ throw new Error("cbor: expected integer, got major " + major);
363
+ }
364
+ readFloat() {
365
+ const [major, ai, arg] = this.readHead();
366
+ if (major !== 7)
367
+ throw new Error("cbor: expected float, got major " + major);
368
+ if (ai === 25)
369
+ return float16ToNumber(arg);
370
+ if (ai === 26) {
371
+ f32dv.setUint32(0, arg >>> 0);
372
+ return f32dv.getFloat32(0);
373
+ }
374
+ if (ai === 27) {
375
+ for (let k = 0; k < 8; k++)
376
+ f64dv.setUint8(k, (this.data[this.pos - 8 + k]));
377
+ return f64dv.getFloat64(0);
378
+ }
379
+ throw new Error("cbor: expected float, got additional info " + ai);
380
+ }
381
+ readBool() {
382
+ const [major, ai] = this.readHead();
383
+ if (major !== 7 || (ai !== 20 && ai !== 21))
384
+ throw new Error("cbor: expected bool");
385
+ return ai === 21;
386
+ }
387
+ // skip consumes exactly one CBOR item (recursively for arrays and maps).
388
+ skip() {
389
+ const [major, , arg] = this.readHead();
390
+ switch (major) {
391
+ case 0:
392
+ case 1:
393
+ case 7:
394
+ return;
395
+ case 2:
396
+ case 3:
397
+ this.need(arg);
398
+ this.pos += arg;
399
+ return;
400
+ case 4:
401
+ for (let k = 0; k < arg; k++)
402
+ this.skip();
403
+ return;
404
+ case 5:
405
+ for (let k = 0; k < arg * 2; k++)
406
+ this.skip();
407
+ return;
408
+ default:
409
+ throw new Error("cbor: cannot skip major " + major);
410
+ }
411
+ }
412
+ }
413
+ exports.CborDec = CborDec;
@@ -0,0 +1,11 @@
1
+ import { CborDec } from "./cbor_gen.ts";
2
+ export interface CLIRunInput {
3
+ command: string;
4
+ args: string[];
5
+ }
6
+ export declare function encodeCLIRunInput(v: CLIRunInput): string;
7
+ export declare function decodeCLIRunInput(data: string): CLIRunInput;
8
+ export declare function encodeCBORCLIRunInput(v: CLIRunInput): Uint8Array;
9
+ export declare function appendCBORCLIRunInput(out: number[], v: CLIRunInput): void;
10
+ export declare function decodeCBORCLIRunInput(data: Uint8Array): CLIRunInput;
11
+ export declare function decodeCBORCLIRunInputFrom(dec: CborDec): CLIRunInput;
@@ -0,0 +1,75 @@
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.encodeCLIRunInput = encodeCLIRunInput;
6
+ exports.decodeCLIRunInput = decodeCLIRunInput;
7
+ exports.encodeCBORCLIRunInput = encodeCBORCLIRunInput;
8
+ exports.appendCBORCLIRunInput = appendCBORCLIRunInput;
9
+ exports.decodeCBORCLIRunInput = decodeCBORCLIRunInput;
10
+ exports.decodeCBORCLIRunInputFrom = decodeCBORCLIRunInputFrom;
11
+ // Code generated by internal/tools/typegen from
12
+ // aggrega-schemas/json/wasm-cli-v1beta1.schema.json. DO NOT EDIT.
13
+ // Regenerate with `go generate ./internal/tools/typegen` from the
14
+ // aggrega-cli checkout.
15
+ const cbor_gen_ts_1 = require("./cbor_gen.js");
16
+ function jstr(s) {
17
+ return JSON.stringify(s);
18
+ }
19
+ // encodeOpaque carries an opaque (`any` / RawMessage) value VERBATIM: the
20
+ // key order from JSON.parse is preserved, matching the Go and Rust codecs'
21
+ // byte-carry of opaque values. Opaque values are never sorted.
22
+ function encodeOpaque(v) {
23
+ return JSON.stringify(v);
24
+ }
25
+ function encodeCLIRunInput(v) {
26
+ const parts = [];
27
+ parts.push(`${jstr("command")}:${jstr(v.command)}`);
28
+ parts.push(`${jstr("args")}:${`[${v.args.map((e0) => jstr(e0)).join(",")}]`}`);
29
+ return `{${parts.join(",")}}`;
30
+ }
31
+ function decodeCLIRunInput(data) {
32
+ return JSON.parse(data);
33
+ }
34
+ function encodeCBORCLIRunInput(v) {
35
+ const out = [];
36
+ appendCBORCLIRunInput(out, v);
37
+ return new Uint8Array(out);
38
+ }
39
+ function appendCBORCLIRunInput(out, v) {
40
+ let n = 2;
41
+ (0, cbor_gen_ts_1.writeHead)(out, 5, n);
42
+ (0, cbor_gen_ts_1.writeText)(out, "args");
43
+ {
44
+ const a0 = v.args;
45
+ (0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
46
+ for (const ee0 of a0) {
47
+ (0, cbor_gen_ts_1.writeText)(out, ee0);
48
+ }
49
+ }
50
+ (0, cbor_gen_ts_1.writeText)(out, "command");
51
+ (0, cbor_gen_ts_1.writeText)(out, v.command);
52
+ }
53
+ function decodeCBORCLIRunInput(data) {
54
+ const dec = new cbor_gen_ts_1.CborDec(data);
55
+ return decodeCBORCLIRunInputFrom(dec);
56
+ }
57
+ function decodeCBORCLIRunInputFrom(dec) {
58
+ const o = {};
59
+ const n = dec.readMapHeader();
60
+ for (let i = 0; i < n; i++) {
61
+ const k = dec.readText();
62
+ switch (k) {
63
+ case "command":
64
+ o["command"] = dec.readText();
65
+ break;
66
+ case "args":
67
+ o["args"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
68
+ a.push(dec.readText());
69
+ } return a; })();
70
+ break;
71
+ default: dec.skip();
72
+ }
73
+ }
74
+ return o;
75
+ }
@@ -0,0 +1,165 @@
1
+ import { CborDec } from "./cbor_gen.ts";
2
+ export interface PluginDescriptor {
3
+ abi_version: string;
4
+ plugin_type: string;
5
+ capabilities?: string[];
6
+ exports: PluginExport[];
7
+ contract?: ProviderContract;
8
+ importer?: ImporterContract;
9
+ description?: string;
10
+ commands?: PluginCLICommand[];
11
+ settings_schema?: unknown;
12
+ metadata?: PluginDescriptorMeta;
13
+ }
14
+ export interface PluginExport {
15
+ name: string;
16
+ input_pattern?: string;
17
+ host_functions?: string[];
18
+ description?: string;
19
+ stability?: string;
20
+ operates?: string;
21
+ scope?: string;
22
+ selector?: string;
23
+ input?: unknown;
24
+ output?: unknown;
25
+ }
26
+ export interface PluginCLICommand {
27
+ name: string;
28
+ description?: string;
29
+ flags?: PluginCommandFlag[];
30
+ }
31
+ export interface PluginCommandFlag {
32
+ name: string;
33
+ shorthand?: string;
34
+ description?: string;
35
+ type?: string;
36
+ default?: string;
37
+ }
38
+ export interface PluginDescriptorMeta {
39
+ author?: string;
40
+ repository?: string;
41
+ license?: string;
42
+ version?: string;
43
+ commit?: string;
44
+ }
45
+ export interface ProviderContract {
46
+ input_kinds: InputKinds;
47
+ boundary_assembly: string;
48
+ artifact_delimiters?: ArtifactDelimiters;
49
+ assembly_name_annotation?: AssemblyNameAnnotation;
50
+ reusable_instance?: boolean;
51
+ cross_boundary_linking?: boolean;
52
+ omits?: boolean;
53
+ boundary_artifacts?: boolean;
54
+ nest_segment?: string;
55
+ source_ignore?: SourceIgnore;
56
+ }
57
+ export interface SourceIgnore {
58
+ patterns?: string[];
59
+ files?: string[];
60
+ }
61
+ export interface InputKinds {
62
+ sourced: boolean;
63
+ synthesized: boolean;
64
+ artifacts_standalone: boolean;
65
+ }
66
+ export interface ArtifactDelimiters {
67
+ left: string;
68
+ right: string;
69
+ }
70
+ export interface AssemblyNameAnnotation {
71
+ annotation: string;
72
+ require_unique?: boolean;
73
+ }
74
+ export interface ImporterContract {
75
+ detect?: DetectSignature[];
76
+ }
77
+ export interface DetectSignature {
78
+ syntax: string;
79
+ files?: string[];
80
+ match?: PathMatch[];
81
+ }
82
+ export interface PathMatch {
83
+ path: string;
84
+ is: string;
85
+ equals?: string;
86
+ prefix?: string;
87
+ }
88
+ export declare function encodePluginDescriptor(v: PluginDescriptor): string;
89
+ export declare function decodePluginDescriptor(data: string): PluginDescriptor;
90
+ export declare function encodePluginExport(v: PluginExport): string;
91
+ export declare function decodePluginExport(data: string): PluginExport;
92
+ export declare function encodePluginCLICommand(v: PluginCLICommand): string;
93
+ export declare function decodePluginCLICommand(data: string): PluginCLICommand;
94
+ export declare function encodePluginCommandFlag(v: PluginCommandFlag): string;
95
+ export declare function decodePluginCommandFlag(data: string): PluginCommandFlag;
96
+ export declare function encodePluginDescriptorMeta(v: PluginDescriptorMeta): string;
97
+ export declare function decodePluginDescriptorMeta(data: string): PluginDescriptorMeta;
98
+ export declare function encodeProviderContract(v: ProviderContract): string;
99
+ export declare function decodeProviderContract(data: string): ProviderContract;
100
+ export declare function encodeSourceIgnore(v: SourceIgnore): string;
101
+ export declare function decodeSourceIgnore(data: string): SourceIgnore;
102
+ export declare function encodeInputKinds(v: InputKinds): string;
103
+ export declare function decodeInputKinds(data: string): InputKinds;
104
+ export declare function encodeArtifactDelimiters(v: ArtifactDelimiters): string;
105
+ export declare function decodeArtifactDelimiters(data: string): ArtifactDelimiters;
106
+ export declare function encodeAssemblyNameAnnotation(v: AssemblyNameAnnotation): string;
107
+ export declare function decodeAssemblyNameAnnotation(data: string): AssemblyNameAnnotation;
108
+ export declare function encodeImporterContract(v: ImporterContract): string;
109
+ export declare function decodeImporterContract(data: string): ImporterContract;
110
+ export declare function encodeDetectSignature(v: DetectSignature): string;
111
+ export declare function decodeDetectSignature(data: string): DetectSignature;
112
+ export declare function encodePathMatch(v: PathMatch): string;
113
+ export declare function decodePathMatch(data: string): PathMatch;
114
+ export declare function encodeCBORPluginDescriptor(v: PluginDescriptor): Uint8Array;
115
+ export declare function appendCBORPluginDescriptor(out: number[], v: PluginDescriptor): void;
116
+ export declare function decodeCBORPluginDescriptor(data: Uint8Array): PluginDescriptor;
117
+ export declare function decodeCBORPluginDescriptorFrom(dec: CborDec): PluginDescriptor;
118
+ export declare function encodeCBORPluginExport(v: PluginExport): Uint8Array;
119
+ export declare function appendCBORPluginExport(out: number[], v: PluginExport): void;
120
+ export declare function decodeCBORPluginExport(data: Uint8Array): PluginExport;
121
+ export declare function decodeCBORPluginExportFrom(dec: CborDec): PluginExport;
122
+ export declare function encodeCBORPluginCLICommand(v: PluginCLICommand): Uint8Array;
123
+ export declare function appendCBORPluginCLICommand(out: number[], v: PluginCLICommand): void;
124
+ export declare function decodeCBORPluginCLICommand(data: Uint8Array): PluginCLICommand;
125
+ export declare function decodeCBORPluginCLICommandFrom(dec: CborDec): PluginCLICommand;
126
+ export declare function encodeCBORPluginCommandFlag(v: PluginCommandFlag): Uint8Array;
127
+ export declare function appendCBORPluginCommandFlag(out: number[], v: PluginCommandFlag): void;
128
+ export declare function decodeCBORPluginCommandFlag(data: Uint8Array): PluginCommandFlag;
129
+ export declare function decodeCBORPluginCommandFlagFrom(dec: CborDec): PluginCommandFlag;
130
+ export declare function encodeCBORPluginDescriptorMeta(v: PluginDescriptorMeta): Uint8Array;
131
+ export declare function appendCBORPluginDescriptorMeta(out: number[], v: PluginDescriptorMeta): void;
132
+ export declare function decodeCBORPluginDescriptorMeta(data: Uint8Array): PluginDescriptorMeta;
133
+ export declare function decodeCBORPluginDescriptorMetaFrom(dec: CborDec): PluginDescriptorMeta;
134
+ export declare function encodeCBORProviderContract(v: ProviderContract): Uint8Array;
135
+ export declare function appendCBORProviderContract(out: number[], v: ProviderContract): void;
136
+ export declare function decodeCBORProviderContract(data: Uint8Array): ProviderContract;
137
+ export declare function decodeCBORProviderContractFrom(dec: CborDec): ProviderContract;
138
+ export declare function encodeCBORSourceIgnore(v: SourceIgnore): Uint8Array;
139
+ export declare function appendCBORSourceIgnore(out: number[], v: SourceIgnore): void;
140
+ export declare function decodeCBORSourceIgnore(data: Uint8Array): SourceIgnore;
141
+ export declare function decodeCBORSourceIgnoreFrom(dec: CborDec): SourceIgnore;
142
+ export declare function encodeCBORInputKinds(v: InputKinds): Uint8Array;
143
+ export declare function appendCBORInputKinds(out: number[], v: InputKinds): void;
144
+ export declare function decodeCBORInputKinds(data: Uint8Array): InputKinds;
145
+ export declare function decodeCBORInputKindsFrom(dec: CborDec): InputKinds;
146
+ export declare function encodeCBORArtifactDelimiters(v: ArtifactDelimiters): Uint8Array;
147
+ export declare function appendCBORArtifactDelimiters(out: number[], v: ArtifactDelimiters): void;
148
+ export declare function decodeCBORArtifactDelimiters(data: Uint8Array): ArtifactDelimiters;
149
+ export declare function decodeCBORArtifactDelimitersFrom(dec: CborDec): ArtifactDelimiters;
150
+ export declare function encodeCBORAssemblyNameAnnotation(v: AssemblyNameAnnotation): Uint8Array;
151
+ export declare function appendCBORAssemblyNameAnnotation(out: number[], v: AssemblyNameAnnotation): void;
152
+ export declare function decodeCBORAssemblyNameAnnotation(data: Uint8Array): AssemblyNameAnnotation;
153
+ export declare function decodeCBORAssemblyNameAnnotationFrom(dec: CborDec): AssemblyNameAnnotation;
154
+ export declare function encodeCBORImporterContract(v: ImporterContract): Uint8Array;
155
+ export declare function appendCBORImporterContract(out: number[], v: ImporterContract): void;
156
+ export declare function decodeCBORImporterContract(data: Uint8Array): ImporterContract;
157
+ export declare function decodeCBORImporterContractFrom(dec: CborDec): ImporterContract;
158
+ export declare function encodeCBORDetectSignature(v: DetectSignature): Uint8Array;
159
+ export declare function appendCBORDetectSignature(out: number[], v: DetectSignature): void;
160
+ export declare function decodeCBORDetectSignature(data: Uint8Array): DetectSignature;
161
+ export declare function decodeCBORDetectSignatureFrom(dec: CborDec): DetectSignature;
162
+ export declare function encodeCBORPathMatch(v: PathMatch): Uint8Array;
163
+ export declare function appendCBORPathMatch(out: number[], v: PathMatch): void;
164
+ export declare function decodeCBORPathMatch(data: Uint8Array): PathMatch;
165
+ export declare function decodeCBORPathMatchFrom(dec: CborDec): PathMatch;