@c4a/extract-proto 0.7.10-alpha.1 → 0.7.10-alpha.2

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 (2) hide show
  1. package/index.d.ts +586 -0
  2. package/package.json +6 -2
package/index.d.ts ADDED
@@ -0,0 +1,586 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const indexerEvidenceAdapterResultSchema: z.ZodEffects<z.ZodObject<{
4
+ protocol: z.ZodLiteral<"context.indexer.evidence-adapter-result/v1">;
5
+ adapter: z.ZodObject<{
6
+ id: z.ZodEffects<z.ZodString, string, string>;
7
+ package: z.ZodString;
8
+ export: z.ZodString;
9
+ version: z.ZodString;
10
+ digest: z.ZodString;
11
+ }, "strict", z.ZodTypeAny, {
12
+ package: string;
13
+ id: string;
14
+ version: string;
15
+ digest: string;
16
+ export: string;
17
+ }, {
18
+ package: string;
19
+ id: string;
20
+ version: string;
21
+ digest: string;
22
+ export: string;
23
+ }>;
24
+ authorized_scope: z.ZodObject<{
25
+ source_ref: z.ZodString;
26
+ module_refs: z.ZodArray<z.ZodString, "many">;
27
+ scope_digest: z.ZodString;
28
+ }, "strict", z.ZodTypeAny, {
29
+ source_ref: string;
30
+ module_refs: string[];
31
+ scope_digest: string;
32
+ }, {
33
+ source_ref: string;
34
+ module_refs: string[];
35
+ scope_digest: string;
36
+ }>;
37
+ input_digest: z.ZodString;
38
+ precedence: z.ZodNumber;
39
+ files: z.ZodArray<z.ZodEffects<z.ZodObject<{
40
+ file_ref: z.ZodString;
41
+ source_ref: z.ZodString;
42
+ module_ref: z.ZodNullable<z.ZodString>;
43
+ normalized_path: z.ZodEffects<z.ZodString, string, string>;
44
+ role: z.ZodEnum<[
45
+ "primary-owner",
46
+ "enricher"
47
+ ]>;
48
+ coverage_tier: z.ZodEnum<[
49
+ "ast-catalog",
50
+ "lightweight-evidence"
51
+ ]>;
52
+ disposition: z.ZodEnum<[
53
+ "analyzed",
54
+ "unsupported",
55
+ "excluded"
56
+ ]>;
57
+ facts: z.ZodArray<z.ZodObject<{
58
+ fact_ref: z.ZodString;
59
+ kind: z.ZodEffects<z.ZodString, string, string>;
60
+ locator: z.ZodObject<{
61
+ source_ref: z.ZodString;
62
+ module_ref: z.ZodNullable<z.ZodString>;
63
+ normalized_path: z.ZodEffects<z.ZodString, string, string>;
64
+ qualified_item_path: z.ZodString;
65
+ signature_digest: z.ZodString;
66
+ }, "strict", z.ZodTypeAny, {
67
+ source_ref: string;
68
+ module_ref: string | null;
69
+ normalized_path: string;
70
+ qualified_item_path: string;
71
+ signature_digest: string;
72
+ }, {
73
+ source_ref: string;
74
+ module_ref: string | null;
75
+ normalized_path: string;
76
+ qualified_item_path: string;
77
+ signature_digest: string;
78
+ }>;
79
+ payload_digest: z.ZodString;
80
+ denominator: z.ZodEnum<[
81
+ "none",
82
+ "eligible-file",
83
+ "loc",
84
+ "symbol",
85
+ "protocol-item"
86
+ ]>;
87
+ }, "strict", z.ZodTypeAny, {
88
+ kind: string;
89
+ fact_ref: string;
90
+ locator: {
91
+ source_ref: string;
92
+ module_ref: string | null;
93
+ normalized_path: string;
94
+ qualified_item_path: string;
95
+ signature_digest: string;
96
+ };
97
+ payload_digest: string;
98
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
99
+ }, {
100
+ kind: string;
101
+ fact_ref: string;
102
+ locator: {
103
+ source_ref: string;
104
+ module_ref: string | null;
105
+ normalized_path: string;
106
+ qualified_item_path: string;
107
+ signature_digest: string;
108
+ };
109
+ payload_digest: string;
110
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
111
+ }>, "many">;
112
+ }, "strict", z.ZodTypeAny, {
113
+ source_ref: string;
114
+ module_ref: string | null;
115
+ normalized_path: string;
116
+ file_ref: string;
117
+ role: "primary-owner" | "enricher";
118
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
119
+ disposition: "analyzed" | "unsupported" | "excluded";
120
+ facts: {
121
+ kind: string;
122
+ fact_ref: string;
123
+ locator: {
124
+ source_ref: string;
125
+ module_ref: string | null;
126
+ normalized_path: string;
127
+ qualified_item_path: string;
128
+ signature_digest: string;
129
+ };
130
+ payload_digest: string;
131
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
132
+ }[];
133
+ }, {
134
+ source_ref: string;
135
+ module_ref: string | null;
136
+ normalized_path: string;
137
+ file_ref: string;
138
+ role: "primary-owner" | "enricher";
139
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
140
+ disposition: "analyzed" | "unsupported" | "excluded";
141
+ facts: {
142
+ kind: string;
143
+ fact_ref: string;
144
+ locator: {
145
+ source_ref: string;
146
+ module_ref: string | null;
147
+ normalized_path: string;
148
+ qualified_item_path: string;
149
+ signature_digest: string;
150
+ };
151
+ payload_digest: string;
152
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
153
+ }[];
154
+ }>, {
155
+ source_ref: string;
156
+ module_ref: string | null;
157
+ normalized_path: string;
158
+ file_ref: string;
159
+ role: "primary-owner" | "enricher";
160
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
161
+ disposition: "analyzed" | "unsupported" | "excluded";
162
+ facts: {
163
+ kind: string;
164
+ fact_ref: string;
165
+ locator: {
166
+ source_ref: string;
167
+ module_ref: string | null;
168
+ normalized_path: string;
169
+ qualified_item_path: string;
170
+ signature_digest: string;
171
+ };
172
+ payload_digest: string;
173
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
174
+ }[];
175
+ }, {
176
+ source_ref: string;
177
+ module_ref: string | null;
178
+ normalized_path: string;
179
+ file_ref: string;
180
+ role: "primary-owner" | "enricher";
181
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
182
+ disposition: "analyzed" | "unsupported" | "excluded";
183
+ facts: {
184
+ kind: string;
185
+ fact_ref: string;
186
+ locator: {
187
+ source_ref: string;
188
+ module_ref: string | null;
189
+ normalized_path: string;
190
+ qualified_item_path: string;
191
+ signature_digest: string;
192
+ };
193
+ payload_digest: string;
194
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
195
+ }[];
196
+ }>, "many">;
197
+ diagnostics: z.ZodArray<z.ZodObject<{
198
+ code: z.ZodEffects<z.ZodString, string, string>;
199
+ fact_ref: z.ZodOptional<z.ZodString>;
200
+ severity: z.ZodEnum<[
201
+ "info",
202
+ "warning",
203
+ "error"
204
+ ]>;
205
+ detail_digest: z.ZodString;
206
+ }, "strict", z.ZodTypeAny, {
207
+ code: string;
208
+ severity: "warning" | "info" | "error";
209
+ detail_digest: string;
210
+ fact_ref?: string | undefined;
211
+ }, {
212
+ code: string;
213
+ severity: "warning" | "info" | "error";
214
+ detail_digest: string;
215
+ fact_ref?: string | undefined;
216
+ }>, "many">;
217
+ toolchain: z.ZodArray<z.ZodEffects<z.ZodObject<{
218
+ step: z.ZodEffects<z.ZodString, string, string>;
219
+ package: z.ZodString;
220
+ export: z.ZodString;
221
+ version: z.ZodString;
222
+ digest: z.ZodString;
223
+ capabilities: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
224
+ input_digest: z.ZodString;
225
+ output_digest: z.ZodString;
226
+ }, "strict", z.ZodTypeAny, {
227
+ package: string;
228
+ version: string;
229
+ digest: string;
230
+ export: string;
231
+ step: string;
232
+ capabilities: string[];
233
+ input_digest: string;
234
+ output_digest: string;
235
+ }, {
236
+ package: string;
237
+ version: string;
238
+ digest: string;
239
+ export: string;
240
+ step: string;
241
+ capabilities: string[];
242
+ input_digest: string;
243
+ output_digest: string;
244
+ }>, {
245
+ package: string;
246
+ version: string;
247
+ digest: string;
248
+ export: string;
249
+ step: string;
250
+ capabilities: string[];
251
+ input_digest: string;
252
+ output_digest: string;
253
+ }, {
254
+ package: string;
255
+ version: string;
256
+ digest: string;
257
+ export: string;
258
+ step: string;
259
+ capabilities: string[];
260
+ input_digest: string;
261
+ output_digest: string;
262
+ }>, "many">;
263
+ output_digest: z.ZodString;
264
+ }, "strict", z.ZodTypeAny, {
265
+ input_digest: string;
266
+ output_digest: string;
267
+ protocol: "context.indexer.evidence-adapter-result/v1";
268
+ adapter: {
269
+ package: string;
270
+ id: string;
271
+ version: string;
272
+ digest: string;
273
+ export: string;
274
+ };
275
+ authorized_scope: {
276
+ source_ref: string;
277
+ module_refs: string[];
278
+ scope_digest: string;
279
+ };
280
+ precedence: number;
281
+ files: {
282
+ source_ref: string;
283
+ module_ref: string | null;
284
+ normalized_path: string;
285
+ file_ref: string;
286
+ role: "primary-owner" | "enricher";
287
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
288
+ disposition: "analyzed" | "unsupported" | "excluded";
289
+ facts: {
290
+ kind: string;
291
+ fact_ref: string;
292
+ locator: {
293
+ source_ref: string;
294
+ module_ref: string | null;
295
+ normalized_path: string;
296
+ qualified_item_path: string;
297
+ signature_digest: string;
298
+ };
299
+ payload_digest: string;
300
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
301
+ }[];
302
+ }[];
303
+ diagnostics: {
304
+ code: string;
305
+ severity: "warning" | "info" | "error";
306
+ detail_digest: string;
307
+ fact_ref?: string | undefined;
308
+ }[];
309
+ toolchain: {
310
+ package: string;
311
+ version: string;
312
+ digest: string;
313
+ export: string;
314
+ step: string;
315
+ capabilities: string[];
316
+ input_digest: string;
317
+ output_digest: string;
318
+ }[];
319
+ }, {
320
+ input_digest: string;
321
+ output_digest: string;
322
+ protocol: "context.indexer.evidence-adapter-result/v1";
323
+ adapter: {
324
+ package: string;
325
+ id: string;
326
+ version: string;
327
+ digest: string;
328
+ export: string;
329
+ };
330
+ authorized_scope: {
331
+ source_ref: string;
332
+ module_refs: string[];
333
+ scope_digest: string;
334
+ };
335
+ precedence: number;
336
+ files: {
337
+ source_ref: string;
338
+ module_ref: string | null;
339
+ normalized_path: string;
340
+ file_ref: string;
341
+ role: "primary-owner" | "enricher";
342
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
343
+ disposition: "analyzed" | "unsupported" | "excluded";
344
+ facts: {
345
+ kind: string;
346
+ fact_ref: string;
347
+ locator: {
348
+ source_ref: string;
349
+ module_ref: string | null;
350
+ normalized_path: string;
351
+ qualified_item_path: string;
352
+ signature_digest: string;
353
+ };
354
+ payload_digest: string;
355
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
356
+ }[];
357
+ }[];
358
+ diagnostics: {
359
+ code: string;
360
+ severity: "warning" | "info" | "error";
361
+ detail_digest: string;
362
+ fact_ref?: string | undefined;
363
+ }[];
364
+ toolchain: {
365
+ package: string;
366
+ version: string;
367
+ digest: string;
368
+ export: string;
369
+ step: string;
370
+ capabilities: string[];
371
+ input_digest: string;
372
+ output_digest: string;
373
+ }[];
374
+ }>, {
375
+ input_digest: string;
376
+ output_digest: string;
377
+ protocol: "context.indexer.evidence-adapter-result/v1";
378
+ adapter: {
379
+ package: string;
380
+ id: string;
381
+ version: string;
382
+ digest: string;
383
+ export: string;
384
+ };
385
+ authorized_scope: {
386
+ source_ref: string;
387
+ module_refs: string[];
388
+ scope_digest: string;
389
+ };
390
+ precedence: number;
391
+ files: {
392
+ source_ref: string;
393
+ module_ref: string | null;
394
+ normalized_path: string;
395
+ file_ref: string;
396
+ role: "primary-owner" | "enricher";
397
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
398
+ disposition: "analyzed" | "unsupported" | "excluded";
399
+ facts: {
400
+ kind: string;
401
+ fact_ref: string;
402
+ locator: {
403
+ source_ref: string;
404
+ module_ref: string | null;
405
+ normalized_path: string;
406
+ qualified_item_path: string;
407
+ signature_digest: string;
408
+ };
409
+ payload_digest: string;
410
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
411
+ }[];
412
+ }[];
413
+ diagnostics: {
414
+ code: string;
415
+ severity: "warning" | "info" | "error";
416
+ detail_digest: string;
417
+ fact_ref?: string | undefined;
418
+ }[];
419
+ toolchain: {
420
+ package: string;
421
+ version: string;
422
+ digest: string;
423
+ export: string;
424
+ step: string;
425
+ capabilities: string[];
426
+ input_digest: string;
427
+ output_digest: string;
428
+ }[];
429
+ }, {
430
+ input_digest: string;
431
+ output_digest: string;
432
+ protocol: "context.indexer.evidence-adapter-result/v1";
433
+ adapter: {
434
+ package: string;
435
+ id: string;
436
+ version: string;
437
+ digest: string;
438
+ export: string;
439
+ };
440
+ authorized_scope: {
441
+ source_ref: string;
442
+ module_refs: string[];
443
+ scope_digest: string;
444
+ };
445
+ precedence: number;
446
+ files: {
447
+ source_ref: string;
448
+ module_ref: string | null;
449
+ normalized_path: string;
450
+ file_ref: string;
451
+ role: "primary-owner" | "enricher";
452
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
453
+ disposition: "analyzed" | "unsupported" | "excluded";
454
+ facts: {
455
+ kind: string;
456
+ fact_ref: string;
457
+ locator: {
458
+ source_ref: string;
459
+ module_ref: string | null;
460
+ normalized_path: string;
461
+ qualified_item_path: string;
462
+ signature_digest: string;
463
+ };
464
+ payload_digest: string;
465
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
466
+ }[];
467
+ }[];
468
+ diagnostics: {
469
+ code: string;
470
+ severity: "warning" | "info" | "error";
471
+ detail_digest: string;
472
+ fact_ref?: string | undefined;
473
+ }[];
474
+ toolchain: {
475
+ package: string;
476
+ version: string;
477
+ digest: string;
478
+ export: string;
479
+ step: string;
480
+ capabilities: string[];
481
+ input_digest: string;
482
+ output_digest: string;
483
+ }[];
484
+ }>;
485
+ type IndexerEvidenceAdapterResult = z.infer<typeof indexerEvidenceAdapterResultSchema>;
486
+ type IndexerEvidenceAdapterFactPayloadValue = null | boolean | number | string | IndexerEvidenceAdapterFactPayloadValue[] | {
487
+ [key: string]: IndexerEvidenceAdapterFactPayloadValue;
488
+ };
489
+ interface IndexerEvidenceAdapterFactPayload {
490
+ fact_ref: string;
491
+ payload: IndexerEvidenceAdapterFactPayloadValue;
492
+ }
493
+ interface IndexerEvidenceAdapterMaterialization {
494
+ result: IndexerEvidenceAdapterResult;
495
+ fact_payloads: IndexerEvidenceAdapterFactPayload[];
496
+ }
497
+ export interface ProtoToken {
498
+ kind: "identifier" | "string" | "number" | "symbol";
499
+ value: string;
500
+ line: number;
501
+ column: number;
502
+ }
503
+ export declare class ProtoSyntaxError extends Error {
504
+ readonly line: number;
505
+ readonly column: number;
506
+ constructor(message: string, line: number, column: number);
507
+ }
508
+ export declare function lexProto(source: string): ProtoToken[];
509
+ interface ProtoField {
510
+ name: string;
511
+ type: string;
512
+ number: string;
513
+ optional?: boolean;
514
+ repeated: boolean;
515
+ oneof?: string;
516
+ defaultValue?: string;
517
+ location: {
518
+ line: number;
519
+ column: number;
520
+ };
521
+ }
522
+ export interface ProtoLocator {
523
+ path: string;
524
+ line: number;
525
+ column: number;
526
+ }
527
+ export interface ProtoImport {
528
+ path: string;
529
+ resolved_path: string;
530
+ modifier: "normal" | "public" | "weak" | "option";
531
+ locator: ProtoLocator;
532
+ }
533
+ export interface ProtoOption {
534
+ owner: string;
535
+ name: string;
536
+ locator: ProtoLocator;
537
+ }
538
+ export interface ProtoType {
539
+ kind: "message" | "enum";
540
+ name: string;
541
+ qualified_name: string;
542
+ fields?: ProtoField[];
543
+ locator: ProtoLocator;
544
+ }
545
+ export interface ProtoMethod {
546
+ name: string;
547
+ input_type: string;
548
+ output_type: string;
549
+ client_streaming: boolean;
550
+ server_streaming: boolean;
551
+ locator: ProtoLocator;
552
+ }
553
+ export interface ProtoService {
554
+ name: string;
555
+ methods: ProtoMethod[];
556
+ locator: ProtoLocator;
557
+ }
558
+ export interface ProtoDocument {
559
+ path: string;
560
+ disposition: "analyzed" | "unsupported" | "excluded";
561
+ syntax: string | null;
562
+ package: string | null;
563
+ imports: ProtoImport[];
564
+ options: ProtoOption[];
565
+ types: ProtoType[];
566
+ services: ProtoService[];
567
+ diagnostic: string | null;
568
+ }
569
+ export declare function parseProtoSources(files: Readonly<Record<string, string>>, options?: {
570
+ import_roots?: readonly string[];
571
+ }): ProtoDocument[];
572
+ export declare const PROTO_EVIDENCE_ADAPTER_EXPORT = "protoSourcesToEvidenceAdapterMaterialization";
573
+ export interface ProtoEvidenceAdapterInvocation {
574
+ adapter: IndexerEvidenceAdapterResult["adapter"];
575
+ authorized_scope: IndexerEvidenceAdapterResult["authorized_scope"];
576
+ input_digest: string;
577
+ precedence: number;
578
+ import_roots?: readonly string[];
579
+ module_refs?: Readonly<Record<string, string | null>>;
580
+ role?: "primary-owner" | "enricher";
581
+ }
582
+ /** Parses only the caller-provided source map and converts it to the common Evidence ABI. */
583
+ export declare function protoSourcesToEvidenceAdapterResult(files: Readonly<Record<string, string>>, invocation: ProtoEvidenceAdapterInvocation): IndexerEvidenceAdapterResult;
584
+ export declare function protoSourcesToEvidenceAdapterMaterialization(files: Readonly<Record<string, string>>, invocation: ProtoEvidenceAdapterInvocation): IndexerEvidenceAdapterMaterialization;
585
+
586
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/extract-proto",
3
- "version": "0.7.10-alpha.1",
3
+ "version": "0.7.10-alpha.2",
4
4
  "type": "module",
5
5
  "description": "Protocol Buffers IDL catalog parser for Context",
6
6
  "license": "MIT",
@@ -18,5 +18,9 @@
18
18
  "engines": {
19
19
  "node": ">=20"
20
20
  },
21
- "main": "./index.js"
21
+ "dependencies": {
22
+ "zod": "^3.23.8"
23
+ },
24
+ "main": "./index.js",
25
+ "types": "./index.d.ts"
22
26
  }