@c4a/extract-rush 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 +603 -0
  2. package/package.json +5 -3
package/index.d.ts ADDED
@@ -0,0 +1,603 @@
1
+ import { z } from 'zod';
2
+
3
+ export interface RushSubspaceIndex {
4
+ name: string;
5
+ registered: boolean;
6
+ projectNames: string[];
7
+ }
8
+ export interface RushBuildPhaseImplementation {
9
+ packageName: string;
10
+ scriptDefined: boolean;
11
+ scriptDigest: string | null;
12
+ }
13
+ export interface RushBuildPhaseIndex {
14
+ name: string;
15
+ selfDependencies: string[];
16
+ upstreamDependencies: string[];
17
+ ignoreMissingScript: boolean;
18
+ allowWarningsOnSuccess: boolean;
19
+ projectImplementations: RushBuildPhaseImplementation[];
20
+ }
21
+ export interface RushBuildCommandIndex {
22
+ name: string;
23
+ commandKind: "bulk" | "global" | "phased";
24
+ phases: string[];
25
+ usesShellCommand: boolean;
26
+ shellCommandDigest: string | null;
27
+ ignoreDependencyOrder: boolean;
28
+ ignoreMissingScript: boolean;
29
+ enableParallelism: boolean;
30
+ incremental: boolean;
31
+ }
32
+ export interface RushReleaseUnitIndex {
33
+ unitRef: string;
34
+ mode: "lock-step" | "individual" | "standalone";
35
+ policyName: string | null;
36
+ definitionName: "lockStepVersion" | "individualVersion" | null;
37
+ mainProject: string | null;
38
+ projectNames: string[];
39
+ }
40
+ export interface RushWorkspaceFactDiagnostic {
41
+ code: "rush-subspace-unregistered" | "rush-version-policy-unresolved";
42
+ projectName: string;
43
+ value: string;
44
+ }
45
+ declare const indexerEvidenceAdapterResultSchema: z.ZodEffects<z.ZodObject<{
46
+ protocol: z.ZodLiteral<"context.indexer.evidence-adapter-result/v1">;
47
+ adapter: z.ZodObject<{
48
+ id: z.ZodEffects<z.ZodString, string, string>;
49
+ package: z.ZodString;
50
+ export: z.ZodString;
51
+ version: z.ZodString;
52
+ digest: z.ZodString;
53
+ }, "strict", z.ZodTypeAny, {
54
+ package: string;
55
+ id: string;
56
+ version: string;
57
+ digest: string;
58
+ export: string;
59
+ }, {
60
+ package: string;
61
+ id: string;
62
+ version: string;
63
+ digest: string;
64
+ export: string;
65
+ }>;
66
+ authorized_scope: z.ZodObject<{
67
+ source_ref: z.ZodString;
68
+ module_refs: z.ZodArray<z.ZodString, "many">;
69
+ scope_digest: z.ZodString;
70
+ }, "strict", z.ZodTypeAny, {
71
+ source_ref: string;
72
+ module_refs: string[];
73
+ scope_digest: string;
74
+ }, {
75
+ source_ref: string;
76
+ module_refs: string[];
77
+ scope_digest: string;
78
+ }>;
79
+ input_digest: z.ZodString;
80
+ precedence: z.ZodNumber;
81
+ files: z.ZodArray<z.ZodEffects<z.ZodObject<{
82
+ file_ref: z.ZodString;
83
+ source_ref: z.ZodString;
84
+ module_ref: z.ZodNullable<z.ZodString>;
85
+ normalized_path: z.ZodEffects<z.ZodString, string, string>;
86
+ role: z.ZodEnum<[
87
+ "primary-owner",
88
+ "enricher"
89
+ ]>;
90
+ coverage_tier: z.ZodEnum<[
91
+ "ast-catalog",
92
+ "lightweight-evidence"
93
+ ]>;
94
+ disposition: z.ZodEnum<[
95
+ "analyzed",
96
+ "unsupported",
97
+ "excluded"
98
+ ]>;
99
+ facts: z.ZodArray<z.ZodObject<{
100
+ fact_ref: z.ZodString;
101
+ kind: z.ZodEffects<z.ZodString, string, string>;
102
+ locator: z.ZodObject<{
103
+ source_ref: z.ZodString;
104
+ module_ref: z.ZodNullable<z.ZodString>;
105
+ normalized_path: z.ZodEffects<z.ZodString, string, string>;
106
+ qualified_item_path: z.ZodString;
107
+ signature_digest: z.ZodString;
108
+ }, "strict", z.ZodTypeAny, {
109
+ source_ref: string;
110
+ module_ref: string | null;
111
+ normalized_path: string;
112
+ qualified_item_path: string;
113
+ signature_digest: string;
114
+ }, {
115
+ source_ref: string;
116
+ module_ref: string | null;
117
+ normalized_path: string;
118
+ qualified_item_path: string;
119
+ signature_digest: string;
120
+ }>;
121
+ payload_digest: z.ZodString;
122
+ denominator: z.ZodEnum<[
123
+ "none",
124
+ "eligible-file",
125
+ "loc",
126
+ "symbol",
127
+ "protocol-item"
128
+ ]>;
129
+ }, "strict", z.ZodTypeAny, {
130
+ kind: string;
131
+ fact_ref: string;
132
+ locator: {
133
+ source_ref: string;
134
+ module_ref: string | null;
135
+ normalized_path: string;
136
+ qualified_item_path: string;
137
+ signature_digest: string;
138
+ };
139
+ payload_digest: string;
140
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
141
+ }, {
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
+ }>, "many">;
154
+ }, "strict", z.ZodTypeAny, {
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
+ }>, {
197
+ source_ref: string;
198
+ module_ref: string | null;
199
+ normalized_path: string;
200
+ file_ref: string;
201
+ role: "primary-owner" | "enricher";
202
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
203
+ disposition: "analyzed" | "unsupported" | "excluded";
204
+ facts: {
205
+ kind: string;
206
+ fact_ref: string;
207
+ locator: {
208
+ source_ref: string;
209
+ module_ref: string | null;
210
+ normalized_path: string;
211
+ qualified_item_path: string;
212
+ signature_digest: string;
213
+ };
214
+ payload_digest: string;
215
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
216
+ }[];
217
+ }, {
218
+ source_ref: string;
219
+ module_ref: string | null;
220
+ normalized_path: string;
221
+ file_ref: string;
222
+ role: "primary-owner" | "enricher";
223
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
224
+ disposition: "analyzed" | "unsupported" | "excluded";
225
+ facts: {
226
+ kind: string;
227
+ fact_ref: string;
228
+ locator: {
229
+ source_ref: string;
230
+ module_ref: string | null;
231
+ normalized_path: string;
232
+ qualified_item_path: string;
233
+ signature_digest: string;
234
+ };
235
+ payload_digest: string;
236
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
237
+ }[];
238
+ }>, "many">;
239
+ diagnostics: z.ZodArray<z.ZodObject<{
240
+ code: z.ZodEffects<z.ZodString, string, string>;
241
+ fact_ref: z.ZodOptional<z.ZodString>;
242
+ severity: z.ZodEnum<[
243
+ "info",
244
+ "warning",
245
+ "error"
246
+ ]>;
247
+ detail_digest: z.ZodString;
248
+ }, "strict", z.ZodTypeAny, {
249
+ code: string;
250
+ severity: "warning" | "info" | "error";
251
+ detail_digest: string;
252
+ fact_ref?: string | undefined;
253
+ }, {
254
+ code: string;
255
+ severity: "warning" | "info" | "error";
256
+ detail_digest: string;
257
+ fact_ref?: string | undefined;
258
+ }>, "many">;
259
+ toolchain: z.ZodArray<z.ZodEffects<z.ZodObject<{
260
+ step: z.ZodEffects<z.ZodString, string, string>;
261
+ package: z.ZodString;
262
+ export: z.ZodString;
263
+ version: z.ZodString;
264
+ digest: z.ZodString;
265
+ capabilities: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
266
+ input_digest: z.ZodString;
267
+ output_digest: z.ZodString;
268
+ }, "strict", z.ZodTypeAny, {
269
+ package: string;
270
+ version: string;
271
+ digest: string;
272
+ export: string;
273
+ step: string;
274
+ capabilities: string[];
275
+ input_digest: string;
276
+ output_digest: string;
277
+ }, {
278
+ package: string;
279
+ version: string;
280
+ digest: string;
281
+ export: string;
282
+ step: string;
283
+ capabilities: string[];
284
+ input_digest: string;
285
+ output_digest: string;
286
+ }>, {
287
+ package: string;
288
+ version: string;
289
+ digest: string;
290
+ export: string;
291
+ step: string;
292
+ capabilities: string[];
293
+ input_digest: string;
294
+ output_digest: string;
295
+ }, {
296
+ package: string;
297
+ version: string;
298
+ digest: string;
299
+ export: string;
300
+ step: string;
301
+ capabilities: string[];
302
+ input_digest: string;
303
+ output_digest: string;
304
+ }>, "many">;
305
+ output_digest: z.ZodString;
306
+ }, "strict", z.ZodTypeAny, {
307
+ diagnostics: {
308
+ code: string;
309
+ severity: "warning" | "info" | "error";
310
+ detail_digest: string;
311
+ fact_ref?: string | undefined;
312
+ }[];
313
+ input_digest: string;
314
+ output_digest: string;
315
+ protocol: "context.indexer.evidence-adapter-result/v1";
316
+ adapter: {
317
+ package: string;
318
+ id: string;
319
+ version: string;
320
+ digest: string;
321
+ export: string;
322
+ };
323
+ authorized_scope: {
324
+ source_ref: string;
325
+ module_refs: string[];
326
+ scope_digest: string;
327
+ };
328
+ precedence: number;
329
+ files: {
330
+ source_ref: string;
331
+ module_ref: string | null;
332
+ normalized_path: string;
333
+ file_ref: string;
334
+ role: "primary-owner" | "enricher";
335
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
336
+ disposition: "analyzed" | "unsupported" | "excluded";
337
+ facts: {
338
+ kind: string;
339
+ fact_ref: string;
340
+ locator: {
341
+ source_ref: string;
342
+ module_ref: string | null;
343
+ normalized_path: string;
344
+ qualified_item_path: string;
345
+ signature_digest: string;
346
+ };
347
+ payload_digest: string;
348
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
349
+ }[];
350
+ }[];
351
+ toolchain: {
352
+ package: string;
353
+ version: string;
354
+ digest: string;
355
+ export: string;
356
+ step: string;
357
+ capabilities: string[];
358
+ input_digest: string;
359
+ output_digest: string;
360
+ }[];
361
+ }, {
362
+ diagnostics: {
363
+ code: string;
364
+ severity: "warning" | "info" | "error";
365
+ detail_digest: string;
366
+ fact_ref?: string | undefined;
367
+ }[];
368
+ input_digest: string;
369
+ output_digest: string;
370
+ protocol: "context.indexer.evidence-adapter-result/v1";
371
+ adapter: {
372
+ package: string;
373
+ id: string;
374
+ version: string;
375
+ digest: string;
376
+ export: string;
377
+ };
378
+ authorized_scope: {
379
+ source_ref: string;
380
+ module_refs: string[];
381
+ scope_digest: string;
382
+ };
383
+ precedence: number;
384
+ files: {
385
+ source_ref: string;
386
+ module_ref: string | null;
387
+ normalized_path: string;
388
+ file_ref: string;
389
+ role: "primary-owner" | "enricher";
390
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
391
+ disposition: "analyzed" | "unsupported" | "excluded";
392
+ facts: {
393
+ kind: string;
394
+ fact_ref: string;
395
+ locator: {
396
+ source_ref: string;
397
+ module_ref: string | null;
398
+ normalized_path: string;
399
+ qualified_item_path: string;
400
+ signature_digest: string;
401
+ };
402
+ payload_digest: string;
403
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
404
+ }[];
405
+ }[];
406
+ toolchain: {
407
+ package: string;
408
+ version: string;
409
+ digest: string;
410
+ export: string;
411
+ step: string;
412
+ capabilities: string[];
413
+ input_digest: string;
414
+ output_digest: string;
415
+ }[];
416
+ }>, {
417
+ diagnostics: {
418
+ code: string;
419
+ severity: "warning" | "info" | "error";
420
+ detail_digest: string;
421
+ fact_ref?: string | undefined;
422
+ }[];
423
+ input_digest: string;
424
+ output_digest: string;
425
+ protocol: "context.indexer.evidence-adapter-result/v1";
426
+ adapter: {
427
+ package: string;
428
+ id: string;
429
+ version: string;
430
+ digest: string;
431
+ export: string;
432
+ };
433
+ authorized_scope: {
434
+ source_ref: string;
435
+ module_refs: string[];
436
+ scope_digest: string;
437
+ };
438
+ precedence: number;
439
+ files: {
440
+ source_ref: string;
441
+ module_ref: string | null;
442
+ normalized_path: string;
443
+ file_ref: string;
444
+ role: "primary-owner" | "enricher";
445
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
446
+ disposition: "analyzed" | "unsupported" | "excluded";
447
+ facts: {
448
+ kind: string;
449
+ fact_ref: string;
450
+ locator: {
451
+ source_ref: string;
452
+ module_ref: string | null;
453
+ normalized_path: string;
454
+ qualified_item_path: string;
455
+ signature_digest: string;
456
+ };
457
+ payload_digest: string;
458
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
459
+ }[];
460
+ }[];
461
+ toolchain: {
462
+ package: string;
463
+ version: string;
464
+ digest: string;
465
+ export: string;
466
+ step: string;
467
+ capabilities: string[];
468
+ input_digest: string;
469
+ output_digest: string;
470
+ }[];
471
+ }, {
472
+ diagnostics: {
473
+ code: string;
474
+ severity: "warning" | "info" | "error";
475
+ detail_digest: string;
476
+ fact_ref?: string | undefined;
477
+ }[];
478
+ input_digest: string;
479
+ output_digest: string;
480
+ protocol: "context.indexer.evidence-adapter-result/v1";
481
+ adapter: {
482
+ package: string;
483
+ id: string;
484
+ version: string;
485
+ digest: string;
486
+ export: string;
487
+ };
488
+ authorized_scope: {
489
+ source_ref: string;
490
+ module_refs: string[];
491
+ scope_digest: string;
492
+ };
493
+ precedence: number;
494
+ files: {
495
+ source_ref: string;
496
+ module_ref: string | null;
497
+ normalized_path: string;
498
+ file_ref: string;
499
+ role: "primary-owner" | "enricher";
500
+ coverage_tier: "ast-catalog" | "lightweight-evidence";
501
+ disposition: "analyzed" | "unsupported" | "excluded";
502
+ facts: {
503
+ kind: string;
504
+ fact_ref: string;
505
+ locator: {
506
+ source_ref: string;
507
+ module_ref: string | null;
508
+ normalized_path: string;
509
+ qualified_item_path: string;
510
+ signature_digest: string;
511
+ };
512
+ payload_digest: string;
513
+ denominator: "symbol" | "none" | "eligible-file" | "loc" | "protocol-item";
514
+ }[];
515
+ }[];
516
+ toolchain: {
517
+ package: string;
518
+ version: string;
519
+ digest: string;
520
+ export: string;
521
+ step: string;
522
+ capabilities: string[];
523
+ input_digest: string;
524
+ output_digest: string;
525
+ }[];
526
+ }>;
527
+ type IndexerEvidenceAdapterResult = z.infer<typeof indexerEvidenceAdapterResultSchema>;
528
+ type IndexerEvidenceAdapterFactPayloadValue = null | boolean | number | string | IndexerEvidenceAdapterFactPayloadValue[] | {
529
+ [key: string]: IndexerEvidenceAdapterFactPayloadValue;
530
+ };
531
+ interface IndexerEvidenceAdapterFactPayload {
532
+ fact_ref: string;
533
+ payload: IndexerEvidenceAdapterFactPayloadValue;
534
+ }
535
+ interface IndexerEvidenceAdapterMaterialization {
536
+ result: IndexerEvidenceAdapterResult;
537
+ fact_payloads: IndexerEvidenceAdapterFactPayload[];
538
+ }
539
+ export interface RushEvidenceAdapterInvocation {
540
+ adapter: IndexerEvidenceAdapterResult["adapter"];
541
+ authorized_scope: IndexerEvidenceAdapterResult["authorized_scope"];
542
+ input_digest: string;
543
+ precedence: number;
544
+ workspace_module_ref: string | null;
545
+ project_module_refs: Readonly<Record<string, string>>;
546
+ role?: "primary-owner" | "enricher";
547
+ }
548
+ /** Converts the Rush structural catalog into the same ABI used by language parsers. */
549
+ export declare function rushWorkspaceIndexToEvidenceAdapterResult(index: RushWorkspaceIndex, invocation: RushEvidenceAdapterInvocation): IndexerEvidenceAdapterResult;
550
+ /** Builds the Rush wire result and its process-local structured fact sidecar. */
551
+ export declare function rushWorkspaceIndexToEvidenceAdapterMaterialization(index: RushWorkspaceIndex, invocation: RushEvidenceAdapterInvocation): IndexerEvidenceAdapterMaterialization;
552
+ export interface RushWorkspaceDependency {
553
+ packageName: string;
554
+ kinds: string[];
555
+ specifiers: string[];
556
+ decoupled: boolean;
557
+ }
558
+ export interface RushOwnerBoundary {
559
+ file: string;
560
+ reviewers: string[];
561
+ }
562
+ export interface RushProjectIndex {
563
+ packageName: string;
564
+ packageNameMatches: boolean;
565
+ projectFolder: string;
566
+ subspaceName: string;
567
+ tags: string[];
568
+ shouldPublish: boolean;
569
+ entrySignals: string[];
570
+ workspaceDependencies: RushWorkspaceDependency[];
571
+ workspaceDependents: string[];
572
+ owner: RushOwnerBoundary | null;
573
+ packageJsonFile: string | null;
574
+ versionPolicyName: string | null;
575
+ publishFolder: string | null;
576
+ releaseUnitRef: string | null;
577
+ }
578
+ export interface RushWorkspaceIndex {
579
+ rushFile: string;
580
+ rushVersion: string;
581
+ pnpmVersion: string | null;
582
+ nodeSupportedVersionRange: string | null;
583
+ selectedTags: string[];
584
+ projects: RushProjectIndex[];
585
+ ownerBoundaries: RushOwnerBoundary[];
586
+ subspacesFile: string | null;
587
+ subspacesEnabled: boolean;
588
+ preventSelectingAllSubspaces: boolean;
589
+ subspaces: RushSubspaceIndex[];
590
+ commandLineFile: string | null;
591
+ buildPhases: RushBuildPhaseIndex[];
592
+ buildCommands: RushBuildCommandIndex[];
593
+ versionPoliciesFile: string | null;
594
+ releaseUnits: RushReleaseUnitIndex[];
595
+ diagnostics: RushWorkspaceFactDiagnostic[];
596
+ }
597
+ export interface RushIndexOptions {
598
+ tags?: readonly string[];
599
+ includeAll?: boolean;
600
+ }
601
+ export declare function indexRushWorkspace(repositoryRoot: string, options?: RushIndexOptions): Promise<RushWorkspaceIndex>;
602
+
603
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/extract-rush",
3
- "version": "0.7.9",
3
+ "version": "0.7.10-alpha.2",
4
4
  "type": "module",
5
5
  "description": "Rush workspace structural index for Context",
6
6
  "license": "MIT",
@@ -21,7 +21,9 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "typescript": "^5.5.4",
24
- "yaml": "^2.5.1"
24
+ "yaml": "^2.5.1",
25
+ "zod": "^3.23.8"
25
26
  },
26
- "main": "./index.js"
27
+ "main": "./index.js",
28
+ "types": "./index.d.ts"
27
29
  }