@c4a/extract-ts 0.7.9 → 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 +1218 -0
  2. package/package.json +5 -3
package/index.d.ts ADDED
@@ -0,0 +1,1218 @@
1
+ import { z } from 'zod';
2
+
3
+ declare enum PackageKind {
4
+ App = "app",
5
+ Service = "service",
6
+ Lib = "lib",
7
+ Cli = "cli"
8
+ }
9
+ declare enum SymbolKind {
10
+ Function = "function",
11
+ Class = "class",
12
+ Interface = "interface",
13
+ Variable = "variable",
14
+ Type = "type",
15
+ Enum = "enum",
16
+ Component = "component",
17
+ Prop = "prop",
18
+ Method = "method",
19
+ Endpoint = "endpoint",
20
+ Config = "config",
21
+ Hook = "hook",
22
+ Process = "process"
23
+ }
24
+ declare enum Grounding {
25
+ Code = "code",
26
+ Concept = "concept"
27
+ }
28
+ declare enum Visibility {
29
+ Exported = "exported",
30
+ Public = "public",
31
+ Protected = "protected",
32
+ Internal = "internal"
33
+ }
34
+ declare enum EdgeType {
35
+ Contains = "contains",
36
+ Imports = "imports",
37
+ ImportsType = "imports_type",
38
+ Calls = "calls",
39
+ Extends = "extends",
40
+ Implements = "implements",
41
+ ParamType = "param_type",
42
+ ReturnType = "return_type",
43
+ OfType = "of_type",
44
+ DependsOn = "depends_on",
45
+ RelatedTo = "related_to",
46
+ Corresponds = "corresponds",
47
+ Refines = "refines",
48
+ AnchoredTo = "anchored_to",
49
+ Supersedes = "supersedes",
50
+ Conflicts = "conflicts",
51
+ References = "references"
52
+ }
53
+ declare enum EdgeSource {
54
+ Ast = "ast",
55
+ Doc = "doc",
56
+ Manual = "manual"
57
+ }
58
+ declare const indexerEvidenceAdapterResultSchema: z.ZodEffects<z.ZodObject<{
59
+ protocol: z.ZodLiteral<"context.indexer.evidence-adapter-result/v1">;
60
+ adapter: z.ZodObject<{
61
+ id: z.ZodEffects<z.ZodString, string, string>;
62
+ package: z.ZodString;
63
+ export: z.ZodString;
64
+ version: z.ZodString;
65
+ digest: z.ZodString;
66
+ }, "strict", z.ZodTypeAny, {
67
+ package: string;
68
+ id: string;
69
+ version: string;
70
+ digest: string;
71
+ export: string;
72
+ }, {
73
+ package: string;
74
+ id: string;
75
+ version: string;
76
+ digest: string;
77
+ export: string;
78
+ }>;
79
+ authorized_scope: z.ZodObject<{
80
+ source_ref: z.ZodString;
81
+ module_refs: z.ZodArray<z.ZodString, "many">;
82
+ scope_digest: z.ZodString;
83
+ }, "strict", z.ZodTypeAny, {
84
+ source_ref: string;
85
+ module_refs: string[];
86
+ scope_digest: string;
87
+ }, {
88
+ source_ref: string;
89
+ module_refs: string[];
90
+ scope_digest: string;
91
+ }>;
92
+ input_digest: z.ZodString;
93
+ precedence: z.ZodNumber;
94
+ files: z.ZodArray<z.ZodEffects<z.ZodObject<{
95
+ file_ref: z.ZodString;
96
+ source_ref: z.ZodString;
97
+ module_ref: z.ZodNullable<z.ZodString>;
98
+ normalized_path: z.ZodEffects<z.ZodString, string, string>;
99
+ role: z.ZodEnum<[
100
+ "primary-owner",
101
+ "enricher"
102
+ ]>;
103
+ coverage_tier: z.ZodEnum<[
104
+ "ast-catalog",
105
+ "lightweight-evidence"
106
+ ]>;
107
+ disposition: z.ZodEnum<[
108
+ "analyzed",
109
+ "unsupported",
110
+ "excluded"
111
+ ]>;
112
+ facts: z.ZodArray<z.ZodObject<{
113
+ fact_ref: z.ZodString;
114
+ kind: z.ZodEffects<z.ZodString, string, string>;
115
+ locator: z.ZodObject<{
116
+ source_ref: z.ZodString;
117
+ module_ref: z.ZodNullable<z.ZodString>;
118
+ normalized_path: z.ZodEffects<z.ZodString, string, string>;
119
+ qualified_item_path: z.ZodString;
120
+ signature_digest: z.ZodString;
121
+ }, "strict", z.ZodTypeAny, {
122
+ source_ref: string;
123
+ module_ref: string | null;
124
+ normalized_path: string;
125
+ qualified_item_path: string;
126
+ signature_digest: string;
127
+ }, {
128
+ source_ref: string;
129
+ module_ref: string | null;
130
+ normalized_path: string;
131
+ qualified_item_path: string;
132
+ signature_digest: string;
133
+ }>;
134
+ payload_digest: z.ZodString;
135
+ denominator: z.ZodEnum<[
136
+ "none",
137
+ "eligible-file",
138
+ "loc",
139
+ "symbol",
140
+ "protocol-item"
141
+ ]>;
142
+ }, "strict", z.ZodTypeAny, {
143
+ kind: string;
144
+ fact_ref: string;
145
+ locator: {
146
+ source_ref: string;
147
+ module_ref: string | null;
148
+ normalized_path: string;
149
+ qualified_item_path: string;
150
+ signature_digest: string;
151
+ };
152
+ payload_digest: string;
153
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
154
+ }, {
155
+ kind: string;
156
+ fact_ref: string;
157
+ locator: {
158
+ source_ref: string;
159
+ module_ref: string | null;
160
+ normalized_path: string;
161
+ qualified_item_path: string;
162
+ signature_digest: string;
163
+ };
164
+ payload_digest: string;
165
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
166
+ }>, "many">;
167
+ }, "strict", z.ZodTypeAny, {
168
+ source_ref: string;
169
+ module_ref: string | null;
170
+ normalized_path: string;
171
+ file_ref: string;
172
+ role: "primary-owner" | "enricher";
173
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
174
+ disposition: "analyzed" | "unsupported" | "excluded";
175
+ facts: {
176
+ kind: string;
177
+ fact_ref: string;
178
+ locator: {
179
+ source_ref: string;
180
+ module_ref: string | null;
181
+ normalized_path: string;
182
+ qualified_item_path: string;
183
+ signature_digest: string;
184
+ };
185
+ payload_digest: string;
186
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
187
+ }[];
188
+ }, {
189
+ source_ref: string;
190
+ module_ref: string | null;
191
+ normalized_path: string;
192
+ file_ref: string;
193
+ role: "primary-owner" | "enricher";
194
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
195
+ disposition: "analyzed" | "unsupported" | "excluded";
196
+ facts: {
197
+ kind: string;
198
+ fact_ref: string;
199
+ locator: {
200
+ source_ref: string;
201
+ module_ref: string | null;
202
+ normalized_path: string;
203
+ qualified_item_path: string;
204
+ signature_digest: string;
205
+ };
206
+ payload_digest: string;
207
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
208
+ }[];
209
+ }>, {
210
+ source_ref: string;
211
+ module_ref: string | null;
212
+ normalized_path: string;
213
+ file_ref: string;
214
+ role: "primary-owner" | "enricher";
215
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
216
+ disposition: "analyzed" | "unsupported" | "excluded";
217
+ facts: {
218
+ kind: string;
219
+ fact_ref: string;
220
+ locator: {
221
+ source_ref: string;
222
+ module_ref: string | null;
223
+ normalized_path: string;
224
+ qualified_item_path: string;
225
+ signature_digest: string;
226
+ };
227
+ payload_digest: string;
228
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
229
+ }[];
230
+ }, {
231
+ source_ref: string;
232
+ module_ref: string | null;
233
+ normalized_path: string;
234
+ file_ref: string;
235
+ role: "primary-owner" | "enricher";
236
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
237
+ disposition: "analyzed" | "unsupported" | "excluded";
238
+ facts: {
239
+ kind: string;
240
+ fact_ref: string;
241
+ locator: {
242
+ source_ref: string;
243
+ module_ref: string | null;
244
+ normalized_path: string;
245
+ qualified_item_path: string;
246
+ signature_digest: string;
247
+ };
248
+ payload_digest: string;
249
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
250
+ }[];
251
+ }>, "many">;
252
+ diagnostics: z.ZodArray<z.ZodObject<{
253
+ code: z.ZodEffects<z.ZodString, string, string>;
254
+ fact_ref: z.ZodOptional<z.ZodString>;
255
+ severity: z.ZodEnum<[
256
+ "info",
257
+ "warning",
258
+ "error"
259
+ ]>;
260
+ detail_digest: z.ZodString;
261
+ }, "strict", z.ZodTypeAny, {
262
+ code: string;
263
+ severity: "warning" | "info" | "error";
264
+ detail_digest: string;
265
+ fact_ref?: string | undefined;
266
+ }, {
267
+ code: string;
268
+ severity: "warning" | "info" | "error";
269
+ detail_digest: string;
270
+ fact_ref?: string | undefined;
271
+ }>, "many">;
272
+ toolchain: z.ZodArray<z.ZodEffects<z.ZodObject<{
273
+ step: z.ZodEffects<z.ZodString, string, string>;
274
+ package: z.ZodString;
275
+ export: z.ZodString;
276
+ version: z.ZodString;
277
+ digest: z.ZodString;
278
+ capabilities: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
279
+ input_digest: z.ZodString;
280
+ output_digest: z.ZodString;
281
+ }, "strict", z.ZodTypeAny, {
282
+ package: string;
283
+ version: string;
284
+ digest: string;
285
+ export: string;
286
+ step: string;
287
+ capabilities: string[];
288
+ input_digest: string;
289
+ output_digest: string;
290
+ }, {
291
+ package: string;
292
+ version: string;
293
+ digest: string;
294
+ export: string;
295
+ step: string;
296
+ capabilities: string[];
297
+ input_digest: string;
298
+ output_digest: string;
299
+ }>, {
300
+ package: string;
301
+ version: string;
302
+ digest: string;
303
+ export: string;
304
+ step: string;
305
+ capabilities: string[];
306
+ input_digest: string;
307
+ output_digest: string;
308
+ }, {
309
+ package: string;
310
+ version: string;
311
+ digest: string;
312
+ export: string;
313
+ step: string;
314
+ capabilities: string[];
315
+ input_digest: string;
316
+ output_digest: string;
317
+ }>, "many">;
318
+ output_digest: z.ZodString;
319
+ }, "strict", z.ZodTypeAny, {
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
+ input_digest: string;
486
+ output_digest: string;
487
+ protocol: "context.indexer.evidence-adapter-result/v1";
488
+ adapter: {
489
+ package: string;
490
+ id: string;
491
+ version: string;
492
+ digest: string;
493
+ export: string;
494
+ };
495
+ authorized_scope: {
496
+ source_ref: string;
497
+ module_refs: string[];
498
+ scope_digest: string;
499
+ };
500
+ precedence: number;
501
+ files: {
502
+ source_ref: string;
503
+ module_ref: string | null;
504
+ normalized_path: string;
505
+ file_ref: string;
506
+ role: "primary-owner" | "enricher";
507
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
508
+ disposition: "analyzed" | "unsupported" | "excluded";
509
+ facts: {
510
+ kind: string;
511
+ fact_ref: string;
512
+ locator: {
513
+ source_ref: string;
514
+ module_ref: string | null;
515
+ normalized_path: string;
516
+ qualified_item_path: string;
517
+ signature_digest: string;
518
+ };
519
+ payload_digest: string;
520
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
521
+ }[];
522
+ }[];
523
+ diagnostics: {
524
+ code: string;
525
+ severity: "warning" | "info" | "error";
526
+ detail_digest: string;
527
+ fact_ref?: string | undefined;
528
+ }[];
529
+ toolchain: {
530
+ package: string;
531
+ version: string;
532
+ digest: string;
533
+ export: string;
534
+ step: string;
535
+ capabilities: string[];
536
+ input_digest: string;
537
+ output_digest: string;
538
+ }[];
539
+ }>;
540
+ type IndexerEvidenceAdapterResult = z.infer<typeof indexerEvidenceAdapterResultSchema>;
541
+ type IndexerEvidenceAdapterFactPayloadValue = null | boolean | number | string | IndexerEvidenceAdapterFactPayloadValue[] | {
542
+ [key: string]: IndexerEvidenceAdapterFactPayloadValue;
543
+ };
544
+ interface IndexerEvidenceAdapterFactPayload {
545
+ fact_ref: string;
546
+ payload: IndexerEvidenceAdapterFactPayloadValue;
547
+ }
548
+ interface IndexerEvidenceAdapterMaterialization {
549
+ result: IndexerEvidenceAdapterResult;
550
+ fact_payloads: IndexerEvidenceAdapterFactPayload[];
551
+ }
552
+ declare const symbolParamSchema: z.ZodObject<{
553
+ name: z.ZodString;
554
+ type: z.ZodNullable<z.ZodString>;
555
+ optional: z.ZodOptional<z.ZodBoolean>;
556
+ rest: z.ZodOptional<z.ZodBoolean>;
557
+ defaultValue: z.ZodOptional<z.ZodString>;
558
+ }, "strip", z.ZodTypeAny, {
559
+ type: string | null;
560
+ name: string;
561
+ optional?: boolean | undefined;
562
+ rest?: boolean | undefined;
563
+ defaultValue?: string | undefined;
564
+ }, {
565
+ type: string | null;
566
+ name: string;
567
+ optional?: boolean | undefined;
568
+ rest?: boolean | undefined;
569
+ defaultValue?: string | undefined;
570
+ }>;
571
+ declare const registrationSchema: z.ZodObject<{
572
+ kind: z.ZodEnum<[
573
+ "http",
574
+ "schedule",
575
+ "event"
576
+ ]>;
577
+ key: z.ZodString;
578
+ handler: z.ZodString;
579
+ method: z.ZodOptional<z.ZodString>;
580
+ middleware: z.ZodArray<z.ZodString, "many">;
581
+ }, "strip", z.ZodTypeAny, {
582
+ key: string;
583
+ kind: "http" | "schedule" | "event";
584
+ handler: string;
585
+ middleware: string[];
586
+ method?: string | undefined;
587
+ }, {
588
+ key: string;
589
+ kind: "http" | "schedule" | "event";
590
+ handler: string;
591
+ middleware: string[];
592
+ method?: string | undefined;
593
+ }>;
594
+ type SymbolInfo = {
595
+ name: string;
596
+ kind: SymbolKind;
597
+ visibility: Visibility;
598
+ file: string;
599
+ line: number;
600
+ endLine: number;
601
+ members?: SymbolInfo[] | undefined;
602
+ params?: z.infer<typeof symbolParamSchema>[] | undefined;
603
+ optional?: boolean | undefined;
604
+ readonly?: boolean | undefined;
605
+ defaultValue?: string | undefined;
606
+ typeParameters?: string | undefined;
607
+ overloads?: string[] | undefined;
608
+ publicEntrypoints?: string[] | undefined;
609
+ contractResolution?: "resolved" | "declaration-only" | undefined;
610
+ registration?: z.infer<typeof registrationSchema> | undefined;
611
+ returnType?: string | null | undefined;
612
+ typeAnnotation?: string | null | undefined;
613
+ extends?: string | null | undefined;
614
+ implements?: string[] | undefined;
615
+ doc?: string | null | undefined;
616
+ propsType?: string | null | undefined;
617
+ unionValues?: string[] | undefined;
618
+ initializer?: string | null | undefined;
619
+ signature?: string | null | undefined;
620
+ };
621
+ declare const extractionResultSchema: z.ZodObject<{
622
+ version: z.ZodLiteral<"2">;
623
+ meta: z.ZodObject<{
624
+ extractedAt: z.ZodString;
625
+ pluginId: z.ZodString;
626
+ commitHash: z.ZodNullable<z.ZodString>;
627
+ language: z.ZodString;
628
+ }, "strip", z.ZodTypeAny, {
629
+ language: string;
630
+ extractedAt: string;
631
+ pluginId: string;
632
+ commitHash: string | null;
633
+ }, {
634
+ language: string;
635
+ extractedAt: string;
636
+ pluginId: string;
637
+ commitHash: string | null;
638
+ }>;
639
+ package: z.ZodObject<{
640
+ name: z.ZodString;
641
+ kind: z.ZodEnum<[
642
+ PackageKind,
643
+ ...PackageKind[]
644
+ ]>;
645
+ language: z.ZodString;
646
+ version: z.ZodOptional<z.ZodString>;
647
+ }, "strip", z.ZodTypeAny, {
648
+ name: string;
649
+ kind: PackageKind;
650
+ language: string;
651
+ version?: string | undefined;
652
+ }, {
653
+ name: string;
654
+ kind: PackageKind;
655
+ language: string;
656
+ version?: string | undefined;
657
+ }>;
658
+ files: z.ZodArray<z.ZodObject<{
659
+ path: z.ZodString;
660
+ language: z.ZodString;
661
+ lines: z.ZodNumber;
662
+ }, "strip", z.ZodTypeAny, {
663
+ path: string;
664
+ language: string;
665
+ lines: number;
666
+ }, {
667
+ path: string;
668
+ language: string;
669
+ lines: number;
670
+ }>, "many">;
671
+ symbols: z.ZodArray<z.ZodType<SymbolInfo, z.ZodTypeDef, SymbolInfo>, "many">;
672
+ relations: z.ZodArray<z.ZodObject<{
673
+ type: z.ZodEnum<[
674
+ EdgeType.Imports,
675
+ EdgeType.ImportsType,
676
+ EdgeType.Calls,
677
+ EdgeType.Extends,
678
+ EdgeType.Implements,
679
+ EdgeType.ParamType,
680
+ EdgeType.ReturnType,
681
+ EdgeType.OfType,
682
+ EdgeType.DependsOn,
683
+ EdgeType.Contains
684
+ ]>;
685
+ from: z.ZodString;
686
+ to: z.ZodString;
687
+ file: z.ZodOptional<z.ZodString>;
688
+ isExternal: z.ZodBoolean;
689
+ grounding: z.ZodEnum<[
690
+ Grounding,
691
+ ...Grounding[]
692
+ ]>;
693
+ confidence: z.ZodNumber;
694
+ source: z.ZodEnum<[
695
+ EdgeSource.Ast,
696
+ EdgeSource.Doc,
697
+ EdgeSource.Manual
698
+ ]>;
699
+ line: z.ZodOptional<z.ZodNumber>;
700
+ }, "strip", z.ZodTypeAny, {
701
+ type: EdgeType.Contains | EdgeType.Imports | EdgeType.ImportsType | EdgeType.Calls | EdgeType.Extends | EdgeType.Implements | EdgeType.ParamType | EdgeType.ReturnType | EdgeType.OfType | EdgeType.DependsOn;
702
+ confidence: number;
703
+ from: string;
704
+ to: string;
705
+ grounding: Grounding;
706
+ source: EdgeSource;
707
+ isExternal: boolean;
708
+ file?: string | undefined;
709
+ line?: number | undefined;
710
+ }, {
711
+ type: EdgeType.Contains | EdgeType.Imports | EdgeType.ImportsType | EdgeType.Calls | EdgeType.Extends | EdgeType.Implements | EdgeType.ParamType | EdgeType.ReturnType | EdgeType.OfType | EdgeType.DependsOn;
712
+ confidence: number;
713
+ from: string;
714
+ to: string;
715
+ grounding: Grounding;
716
+ source: EdgeSource;
717
+ isExternal: boolean;
718
+ file?: string | undefined;
719
+ line?: number | undefined;
720
+ }>, "many">;
721
+ coverage: z.ZodOptional<z.ZodObject<{
722
+ tier: z.ZodEnum<[
723
+ "ast-catalog",
724
+ "lightweight-evidence"
725
+ ]>;
726
+ capabilities: z.ZodArray<z.ZodString, "many">;
727
+ files: z.ZodArray<z.ZodObject<{
728
+ path: z.ZodString;
729
+ disposition: z.ZodEnum<[
730
+ "analyzed",
731
+ "unsupported",
732
+ "excluded"
733
+ ]>;
734
+ diagnosticCodes: z.ZodArray<z.ZodString, "many">;
735
+ }, "strip", z.ZodTypeAny, {
736
+ path: string;
737
+ disposition: "analyzed" | "unsupported" | "excluded";
738
+ diagnosticCodes: string[];
739
+ }, {
740
+ path: string;
741
+ disposition: "analyzed" | "unsupported" | "excluded";
742
+ diagnosticCodes: string[];
743
+ }>, "many">;
744
+ diagnostics: z.ZodArray<z.ZodObject<{
745
+ code: z.ZodString;
746
+ severity: z.ZodEnum<[
747
+ "info",
748
+ "warning",
749
+ "error"
750
+ ]>;
751
+ file: z.ZodString;
752
+ line: z.ZodNumber;
753
+ column: z.ZodNumber;
754
+ }, "strip", z.ZodTypeAny, {
755
+ code: string;
756
+ severity: "warning" | "info" | "error";
757
+ file: string;
758
+ line: number;
759
+ column: number;
760
+ }, {
761
+ code: string;
762
+ severity: "warning" | "info" | "error";
763
+ file: string;
764
+ line: number;
765
+ column: number;
766
+ }>, "many">;
767
+ }, "strip", z.ZodTypeAny, {
768
+ capabilities: string[];
769
+ files: {
770
+ path: string;
771
+ disposition: "analyzed" | "unsupported" | "excluded";
772
+ diagnosticCodes: string[];
773
+ }[];
774
+ diagnostics: {
775
+ code: string;
776
+ severity: "warning" | "info" | "error";
777
+ file: string;
778
+ line: number;
779
+ column: number;
780
+ }[];
781
+ tier: "ast-catalog" | "lightweight-evidence";
782
+ }, {
783
+ capabilities: string[];
784
+ files: {
785
+ path: string;
786
+ disposition: "analyzed" | "unsupported" | "excluded";
787
+ diagnosticCodes: string[];
788
+ }[];
789
+ diagnostics: {
790
+ code: string;
791
+ severity: "warning" | "info" | "error";
792
+ file: string;
793
+ line: number;
794
+ column: number;
795
+ }[];
796
+ tier: "ast-catalog" | "lightweight-evidence";
797
+ }>>;
798
+ stats: z.ZodObject<{
799
+ files: z.ZodNumber;
800
+ lines: z.ZodNumber;
801
+ exportedSymbols: z.ZodNumber;
802
+ internalSymbols: z.ZodNumber;
803
+ relations: z.ZodNumber;
804
+ }, "strip", z.ZodTypeAny, {
805
+ relations: number;
806
+ files: number;
807
+ lines: number;
808
+ exportedSymbols: number;
809
+ internalSymbols: number;
810
+ }, {
811
+ relations: number;
812
+ files: number;
813
+ lines: number;
814
+ exportedSymbols: number;
815
+ internalSymbols: number;
816
+ }>;
817
+ }, "strip", z.ZodTypeAny, {
818
+ package: {
819
+ name: string;
820
+ kind: PackageKind;
821
+ language: string;
822
+ version?: string | undefined;
823
+ };
824
+ relations: {
825
+ type: EdgeType.Contains | EdgeType.Imports | EdgeType.ImportsType | EdgeType.Calls | EdgeType.Extends | EdgeType.Implements | EdgeType.ParamType | EdgeType.ReturnType | EdgeType.OfType | EdgeType.DependsOn;
826
+ confidence: number;
827
+ from: string;
828
+ to: string;
829
+ grounding: Grounding;
830
+ source: EdgeSource;
831
+ isExternal: boolean;
832
+ file?: string | undefined;
833
+ line?: number | undefined;
834
+ }[];
835
+ version: "2";
836
+ files: {
837
+ path: string;
838
+ language: string;
839
+ lines: number;
840
+ }[];
841
+ meta: {
842
+ language: string;
843
+ extractedAt: string;
844
+ pluginId: string;
845
+ commitHash: string | null;
846
+ };
847
+ symbols: SymbolInfo[];
848
+ stats: {
849
+ relations: number;
850
+ files: number;
851
+ lines: number;
852
+ exportedSymbols: number;
853
+ internalSymbols: number;
854
+ };
855
+ coverage?: {
856
+ capabilities: string[];
857
+ files: {
858
+ path: string;
859
+ disposition: "analyzed" | "unsupported" | "excluded";
860
+ diagnosticCodes: string[];
861
+ }[];
862
+ diagnostics: {
863
+ code: string;
864
+ severity: "warning" | "info" | "error";
865
+ file: string;
866
+ line: number;
867
+ column: number;
868
+ }[];
869
+ tier: "ast-catalog" | "lightweight-evidence";
870
+ } | undefined;
871
+ }, {
872
+ package: {
873
+ name: string;
874
+ kind: PackageKind;
875
+ language: string;
876
+ version?: string | undefined;
877
+ };
878
+ relations: {
879
+ type: EdgeType.Contains | EdgeType.Imports | EdgeType.ImportsType | EdgeType.Calls | EdgeType.Extends | EdgeType.Implements | EdgeType.ParamType | EdgeType.ReturnType | EdgeType.OfType | EdgeType.DependsOn;
880
+ confidence: number;
881
+ from: string;
882
+ to: string;
883
+ grounding: Grounding;
884
+ source: EdgeSource;
885
+ isExternal: boolean;
886
+ file?: string | undefined;
887
+ line?: number | undefined;
888
+ }[];
889
+ version: "2";
890
+ files: {
891
+ path: string;
892
+ language: string;
893
+ lines: number;
894
+ }[];
895
+ meta: {
896
+ language: string;
897
+ extractedAt: string;
898
+ pluginId: string;
899
+ commitHash: string | null;
900
+ };
901
+ symbols: SymbolInfo[];
902
+ stats: {
903
+ relations: number;
904
+ files: number;
905
+ lines: number;
906
+ exportedSymbols: number;
907
+ internalSymbols: number;
908
+ };
909
+ coverage?: {
910
+ capabilities: string[];
911
+ files: {
912
+ path: string;
913
+ disposition: "analyzed" | "unsupported" | "excluded";
914
+ diagnosticCodes: string[];
915
+ }[];
916
+ diagnostics: {
917
+ code: string;
918
+ severity: "warning" | "info" | "error";
919
+ file: string;
920
+ line: number;
921
+ column: number;
922
+ }[];
923
+ tier: "ast-catalog" | "lightweight-evidence";
924
+ } | undefined;
925
+ }>;
926
+ type ExtractionResult = z.infer<typeof extractionResultSchema>;
927
+ declare const entryFileSchema: z.ZodObject<{
928
+ path: z.ZodString;
929
+ subpath: z.ZodString;
930
+ type: z.ZodEnum<[
931
+ "library",
932
+ "cli",
933
+ "service",
934
+ "webapp"
935
+ ]>;
936
+ }, "strip", z.ZodTypeAny, {
937
+ type: "service" | "cli" | "library" | "webapp";
938
+ path: string;
939
+ subpath: string;
940
+ }, {
941
+ type: "service" | "cli" | "library" | "webapp";
942
+ path: string;
943
+ subpath: string;
944
+ }>;
945
+ declare const manifestInfoSchema: z.ZodObject<{
946
+ type: z.ZodEnum<[
947
+ "package.json",
948
+ "pyproject.toml",
949
+ "Cargo.toml",
950
+ "go.mod",
951
+ "pom.xml"
952
+ ]>;
953
+ path: z.ZodString;
954
+ content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
955
+ }, "strip", z.ZodTypeAny, {
956
+ type: "package.json" | "go.mod" | "pyproject.toml" | "Cargo.toml" | "pom.xml";
957
+ content: Record<string, unknown>;
958
+ path: string;
959
+ }, {
960
+ type: "package.json" | "go.mod" | "pyproject.toml" | "Cargo.toml" | "pom.xml";
961
+ content: Record<string, unknown>;
962
+ path: string;
963
+ }>;
964
+ declare const sourceInfoSchema: z.ZodObject<{
965
+ path: z.ZodString;
966
+ manifests: z.ZodArray<z.ZodObject<{
967
+ type: z.ZodEnum<[
968
+ "package.json",
969
+ "pyproject.toml",
970
+ "Cargo.toml",
971
+ "go.mod",
972
+ "pom.xml"
973
+ ]>;
974
+ path: z.ZodString;
975
+ content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
976
+ }, "strip", z.ZodTypeAny, {
977
+ type: "package.json" | "go.mod" | "pyproject.toml" | "Cargo.toml" | "pom.xml";
978
+ content: Record<string, unknown>;
979
+ path: string;
980
+ }, {
981
+ type: "package.json" | "go.mod" | "pyproject.toml" | "Cargo.toml" | "pom.xml";
982
+ content: Record<string, unknown>;
983
+ path: string;
984
+ }>, "many">;
985
+ language: z.ZodOptional<z.ZodString>;
986
+ }, "strip", z.ZodTypeAny, {
987
+ path: string;
988
+ manifests: {
989
+ type: "package.json" | "go.mod" | "pyproject.toml" | "Cargo.toml" | "pom.xml";
990
+ content: Record<string, unknown>;
991
+ path: string;
992
+ }[];
993
+ language?: string | undefined;
994
+ }, {
995
+ path: string;
996
+ manifests: {
997
+ type: "package.json" | "go.mod" | "pyproject.toml" | "Cargo.toml" | "pom.xml";
998
+ content: Record<string, unknown>;
999
+ path: string;
1000
+ }[];
1001
+ language?: string | undefined;
1002
+ }>;
1003
+ declare const patternDetectionResultSchema: z.ZodObject<{
1004
+ endpoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
1005
+ handler: z.ZodString;
1006
+ method: z.ZodString;
1007
+ path: z.ZodString;
1008
+ file: z.ZodString;
1009
+ line: z.ZodNumber;
1010
+ }, "strip", z.ZodTypeAny, {
1011
+ method: string;
1012
+ path: string;
1013
+ handler: string;
1014
+ file: string;
1015
+ line: number;
1016
+ }, {
1017
+ method: string;
1018
+ path: string;
1019
+ handler: string;
1020
+ file: string;
1021
+ line: number;
1022
+ }>, "many">>;
1023
+ implicitDeps: z.ZodOptional<z.ZodArray<z.ZodObject<{
1024
+ verb: z.ZodEnum<[
1025
+ "produce",
1026
+ "consume",
1027
+ "depends_on",
1028
+ "serve"
1029
+ ]>;
1030
+ target: z.ZodString;
1031
+ file: z.ZodString;
1032
+ line: z.ZodNumber;
1033
+ }, "strip", z.ZodTypeAny, {
1034
+ target: string;
1035
+ file: string;
1036
+ line: number;
1037
+ verb: "depends_on" | "produce" | "consume" | "serve";
1038
+ }, {
1039
+ target: string;
1040
+ file: string;
1041
+ line: number;
1042
+ verb: "depends_on" | "produce" | "consume" | "serve";
1043
+ }>, "many">>;
1044
+ configRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1045
+ key: z.ZodString;
1046
+ file: z.ZodString;
1047
+ line: z.ZodNumber;
1048
+ }, "strip", z.ZodTypeAny, {
1049
+ key: string;
1050
+ file: string;
1051
+ line: number;
1052
+ }, {
1053
+ key: string;
1054
+ file: string;
1055
+ line: number;
1056
+ }>, "many">>;
1057
+ }, "strip", z.ZodTypeAny, {
1058
+ endpoints?: {
1059
+ method: string;
1060
+ path: string;
1061
+ handler: string;
1062
+ file: string;
1063
+ line: number;
1064
+ }[] | undefined;
1065
+ implicitDeps?: {
1066
+ target: string;
1067
+ file: string;
1068
+ line: number;
1069
+ verb: "depends_on" | "produce" | "consume" | "serve";
1070
+ }[] | undefined;
1071
+ configRefs?: {
1072
+ key: string;
1073
+ file: string;
1074
+ line: number;
1075
+ }[] | undefined;
1076
+ }, {
1077
+ endpoints?: {
1078
+ method: string;
1079
+ path: string;
1080
+ handler: string;
1081
+ file: string;
1082
+ line: number;
1083
+ }[] | undefined;
1084
+ implicitDeps?: {
1085
+ target: string;
1086
+ file: string;
1087
+ line: number;
1088
+ verb: "depends_on" | "produce" | "consume" | "serve";
1089
+ }[] | undefined;
1090
+ configRefs?: {
1091
+ key: string;
1092
+ file: string;
1093
+ line: number;
1094
+ }[] | undefined;
1095
+ }>;
1096
+ type EntryFile = z.infer<typeof entryFileSchema>;
1097
+ type ManifestInfo = z.infer<typeof manifestInfoSchema>;
1098
+ type SourceInfo = z.infer<typeof sourceInfoSchema>;
1099
+ type EntryDetectionResult = {
1100
+ package: {
1101
+ name: string;
1102
+ kind: PackageKind;
1103
+ language: string;
1104
+ version?: string | undefined;
1105
+ };
1106
+ entries: EntryFile[];
1107
+ subPackages?: EntryDetectionResult[] | undefined;
1108
+ };
1109
+ type PatternDetectionResult = z.infer<typeof patternDetectionResultSchema>;
1110
+ interface FileSystem$1 {
1111
+ readFile(path: string): Promise<string>;
1112
+ readdir(path: string): Promise<string[]>;
1113
+ exists(path: string): Promise<boolean>;
1114
+ readJson<T = unknown>(path: string): Promise<T>;
1115
+ }
1116
+ interface ExtractionPlugin {
1117
+ id: string;
1118
+ languages: string[];
1119
+ packageManagers: string[];
1120
+ capabilities?: string[];
1121
+ coverageTier?: "ast-catalog" | "lightweight-evidence";
1122
+ manifestTypes?: ManifestInfo["type"][];
1123
+ canHandle(source: SourceInfo): boolean;
1124
+ detectEntries(manifest: ManifestInfo, fs: FileSystem$1): Promise<EntryDetectionResult>;
1125
+ extractSymbols(entries: EntryFile[], fs: FileSystem$1): Promise<ExtractionResult>;
1126
+ detectPatterns?(fs: FileSystem$1): Promise<PatternDetectionResult>;
1127
+ }
1128
+ interface ExtractionEvidenceAdapterInvocation {
1129
+ adapter: IndexerEvidenceAdapterResult["adapter"];
1130
+ authorized_scope: IndexerEvidenceAdapterResult["authorized_scope"];
1131
+ module_ref: string | null;
1132
+ input_digest: string;
1133
+ precedence: number;
1134
+ role?: "primary-owner" | "enricher";
1135
+ /** Already scoped source text; used only for physical file extents, never persisted. */
1136
+ source_files?: Readonly<Record<string, string>>;
1137
+ }
1138
+ export declare class TypeScriptPlugin implements ExtractionPlugin {
1139
+ #private;
1140
+ readonly id = "c4a-extract-ts";
1141
+ readonly languages: string[];
1142
+ readonly packageManagers: string[];
1143
+ readonly capabilities: string[];
1144
+ readonly coverageTier: "ast-catalog";
1145
+ readonly manifestTypes: ManifestInfo["type"][];
1146
+ canHandle(source: SourceInfo): boolean;
1147
+ detectEntries(manifest: ManifestInfo, fs: FileSystem$1): Promise<EntryDetectionResult>;
1148
+ extractSymbols(entries: EntryFile[], fs: FileSystem$1): Promise<ExtractionResult>;
1149
+ extractSymbolsInScope(entries: EntryFile[], analysisPaths: readonly string[], fs: FileSystem$1): Promise<ExtractionResult>;
1150
+ }
1151
+ export interface ReactRouterSourceLocation {
1152
+ path: string;
1153
+ startLine: number;
1154
+ startColumn: number;
1155
+ endLine: number;
1156
+ endColumn: number;
1157
+ }
1158
+ export type ReactRouterRouteKind = "page" | "group" | "redirect";
1159
+ export interface ReactRouterRoute {
1160
+ id: string;
1161
+ kind: ReactRouterRouteKind;
1162
+ relativePath: string;
1163
+ fullPath: string;
1164
+ index: boolean;
1165
+ component?: string;
1166
+ componentSource?: string;
1167
+ componentCandidates: string[];
1168
+ redirectTo?: string;
1169
+ conditions: string[];
1170
+ note?: string;
1171
+ location: ReactRouterSourceLocation;
1172
+ }
1173
+ interface ReactRouterExtractionOptions {
1174
+ routeIdPrefix?: string;
1175
+ mountPath?: string;
1176
+ ignoredComponentCandidates?: readonly string[];
1177
+ }
1178
+ export declare function extractReactRouterRoutes(source: string, filePath: string, options?: ReactRouterExtractionOptions): ReactRouterRoute[];
1179
+ declare const LANGUAGE_BY_EXTENSION: {
1180
+ readonly ".ts": "typescript";
1181
+ readonly ".tsx": "tsx";
1182
+ readonly ".mts": "typescript";
1183
+ readonly ".cts": "typescript";
1184
+ readonly ".js": "javascript";
1185
+ readonly ".jsx": "jsx";
1186
+ readonly ".mjs": "javascript";
1187
+ readonly ".cjs": "javascript";
1188
+ };
1189
+ export type EcmaScriptLanguage = typeof LANGUAGE_BY_EXTENSION[keyof typeof LANGUAGE_BY_EXTENSION];
1190
+ export declare const EXTRACT_TS_CAPABILITIES: string[];
1191
+ export declare const EXTRACT_TS_COVERAGE_TIER: "ast-catalog";
1192
+ export declare const ecmaScriptLanguage: (filePath: string) => EcmaScriptLanguage;
1193
+ export interface TypeScriptModuleExports {
1194
+ named: string[];
1195
+ wildcard: string[];
1196
+ targets: string[];
1197
+ }
1198
+ export interface EcmaScriptModuleExports extends TypeScriptModuleExports {
1199
+ coverageTier: typeof EXTRACT_TS_COVERAGE_TIER;
1200
+ capabilities: string[];
1201
+ disposition: "analyzed" | "unsupported";
1202
+ diagnostics: Array<{
1203
+ code: string;
1204
+ line: number;
1205
+ column: number;
1206
+ }>;
1207
+ }
1208
+ export declare function extractTypeScriptModuleExports(source: string, filePath?: string): TypeScriptModuleExports;
1209
+ export declare function extractEcmaScriptModuleExports(source: string, filePath?: string): EcmaScriptModuleExports;
1210
+ /** Converts TypeScript/JavaScript ExtractionResult v2 into the common Context Evidence ABI. */
1211
+ export declare function typeScriptExtractionToEvidenceAdapterResult(extraction: ExtractionResult, invocation: ExtractionEvidenceAdapterInvocation): IndexerEvidenceAdapterResult;
1212
+ /** Builds the TypeScript/JavaScript wire result and its process-local fact sidecar. */
1213
+ export declare function typeScriptExtractionToEvidenceAdapterMaterialization(extraction: ExtractionResult, invocation: ExtractionEvidenceAdapterInvocation): IndexerEvidenceAdapterMaterialization;
1214
+ export declare function componentPropsName(annotation: string): string | undefined;
1215
+ /** Parse retained parameter syntax; never execute initializer expressions. */
1216
+ export declare function componentBindingDefaults(pattern: string): Record<string, string>;
1217
+
1218
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/extract-ts",
3
- "version": "0.7.9",
3
+ "version": "0.7.10-alpha.2",
4
4
  "type": "module",
5
5
  "description": "TypeScript and JavaScript extraction plugin for the Context ExtractionResult v2 contract",
6
6
  "license": "MIT",
@@ -14,7 +14,9 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "typescript": "^5.5.4",
17
- "web-tree-sitter": "^0.20.8"
17
+ "web-tree-sitter": "^0.20.8",
18
+ "zod": "^3.23.8"
18
19
  },
19
- "main": "./index.js"
20
+ "main": "./index.js",
21
+ "types": "./index.d.ts"
20
22
  }