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