@getchomp/mcp 0.2.44 → 0.2.45

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.
@@ -29,7 +29,7 @@ import { type DesignSystemBaselineSnapshot, type FindingRecord, type WorkingTree
29
29
  import { type DesignSystemConfig } from "./designSystem/config.js";
30
30
  import { type AnalyzeDesignSystemOptions } from "./designSystem/topology.js";
31
31
  import { type DerivedTokenProposal } from "./designSystem/valueClusters.js";
32
- import type { AgentExtendabilitySection, AtomicConsolidationCandidate, AtomicHierarchySummary, BypassedAtomFinding, CallSiteOverrideFinding, ComponentDesignProfile, ComposabilityIssue, CompositeTypeTuple, ContextualStyleOverrideFinding, ContrastAuditItem, CoverageSection, DesignSystemAnalysisReport, DesignSystemSourceInfo, DuplicateTokenDiagnostic, InvariantViolation, NestedInteractiveFinding, ParallelTwinGroup, PropApiDriftGroup, RouteCompositionItem, SiblingAtomOverlapFinding, StructuralJsxCloneGroup, StylingConvention, ThemeSymmetryFinding, TokenRegistryEntry, TokenTier, TypographyRoleCluster, UnbackedSemanticTokenDiagnostic, UndefinedCssClassDiagnostic, UndefinedTokenDiagnostic, UnextractedUiShapeFinding } from "./designSystem/types.js";
32
+ import type { AgentExtendabilityMeasures, AgentExtendabilitySection, AtomicConsolidationCandidate, AtomicHierarchySummary, AtomicTier, BypassedAtomFinding, CallSiteOverrideFinding, ComponentDesignProfile, ComposabilityIssue, CompositeTypeTuple, ContextualStyleOverrideFinding, ContrastAuditItem, CoverageSection, DesignSystemAnalysisReport, DesignSystemSourceInfo, DuplicateTokenDiagnostic, InvariantViolation, NestedInteractiveFinding, ParallelTwinGroup, PropApiDriftGroup, RouteCompositionItem, SiblingAtomOverlapFinding, StructuralJsxCloneGroup, StylingConvention, ThemeSymmetryFinding, TokenRegistryEntry, TokenTier, TypographyRoleCluster, UnbackedSemanticTokenDiagnostic, UndefinedCssClassDiagnostic, UndefinedTokenDiagnostic, UnextractedUiShapeFinding } from "./designSystem/types.js";
33
33
  export * from "./designSystem/types.js";
34
34
  export { classifyTokenTier, parseCssStylesheet, type ParseCssOptions, type ParsedCssRule, type ParsedCssStylesheet, } from "./designSystem/cssParser.js";
35
35
  export { computeRelativeLuminance, computeWcagContrastRatio, evaluateContrast, evaluateThemeContrastPairs, parseCssColorString, type ContrastEvaluation, type ContrastEvaluationOptions, type RgbaColor, type TailwindClassPairCandidate, } from "./designSystem/contrast.js";
@@ -227,6 +227,268 @@ export declare function auditDesignSystem(options: AuditDesignSystemOptions): Pr
227
227
  recommendedHighlightNodeIds: string[];
228
228
  agentGuidance: string[];
229
229
  }>;
230
+ export declare function formatCompactDesignSystemAudit(report: Awaited<ReturnType<typeof auditDesignSystem>>, options?: {
231
+ verbose?: boolean;
232
+ hasSearchTerm?: boolean;
233
+ maxSemanticTokens?: number;
234
+ }): {
235
+ plugin: {
236
+ name: string;
237
+ version: string;
238
+ layer: import("@getchomp/db").OverlayLayer;
239
+ runId: string;
240
+ overlaysPersisted: number;
241
+ durationMs: number;
242
+ };
243
+ system: DesignSystemSourceInfo;
244
+ coverage: CoverageSection;
245
+ baseline: DesignSystemBaselineStatus;
246
+ summary: {
247
+ cssFilesScanned: number;
248
+ componentFilesScanned: number;
249
+ componentsProfiled: number;
250
+ routeCount: number;
251
+ templateCount: number;
252
+ organismCount: number;
253
+ moleculeCount: number;
254
+ atomCount: number;
255
+ utilityCount: number;
256
+ structuralJsxCloneCount: number;
257
+ bypassedAtomCount: number;
258
+ siblingAtomOverlapCount: number;
259
+ nestedInteractiveCount: number;
260
+ unextractedShapeCount: number;
261
+ parallelTwinGroupCount: number;
262
+ callSiteOverrideCount: number;
263
+ propApiDriftGroupCount: number;
264
+ agentExtendabilityScore: number | null;
265
+ agentExtendabilityGrade: "A" | "B" | "C" | "D" | "F" | "N/A";
266
+ totalDefinedTokens: number;
267
+ primitiveTokenCount: number;
268
+ semanticTokenCount: number;
269
+ componentTokenCount: number;
270
+ themeBridgeTokenCount: number;
271
+ unbackedSemanticTokenCount: number;
272
+ themeSymmetryIssueCount: number;
273
+ undefinedTokenCount: number;
274
+ undefinedCssClassCount: number;
275
+ duplicateTokenCount: number;
276
+ forkedTokenCount: number;
277
+ unusedTokenCount: number;
278
+ contrastPairsAudited: number;
279
+ contrastCandidateCount: number;
280
+ contrastFailureCount: number;
281
+ contrastPairsUnresolved: number;
282
+ hardcodedLiteralCount: number;
283
+ derivedTokenProposalCount: number;
284
+ invariantViolationCount: number;
285
+ composabilityIssueCount: number;
286
+ frontendPackageCount: number;
287
+ unsupportedFileCount: number;
288
+ arbitraryTailwindCount: number;
289
+ magicSpacingCount: number;
290
+ primitiveScaleSkipCount: number;
291
+ inlineStyleLiteralCount: number;
292
+ canvasCssSlotCount: number;
293
+ canvasTsConstSlotCount: number;
294
+ canvasLiteralSlotCount: number;
295
+ rawDomPrimitiveCount: number;
296
+ atomicConsolidationGroupCount: number;
297
+ dynamicClassPrefixCount: number;
298
+ unusedCssSelectorCount: number;
299
+ typographyTupleCount: number;
300
+ typographyDriftRoleCount: number;
301
+ contextualOverrideCount: number;
302
+ conventionBreakdown: Record<StylingConvention, number>;
303
+ };
304
+ routeComposition: RouteCompositionItem[];
305
+ atomicHierarchy: AtomicHierarchySummary;
306
+ alignmentAudit: {
307
+ bypassedAtoms: BypassedAtomFinding[];
308
+ siblingAtomOverlaps: SiblingAtomOverlapFinding[];
309
+ nestedInteractive: NestedInteractiveFinding[];
310
+ unextractedShapes: UnextractedUiShapeFinding[];
311
+ parallelTwins: ParallelTwinGroup[];
312
+ callSiteOverrides: CallSiteOverrideFinding[];
313
+ propApiDrift: PropApiDriftGroup[];
314
+ invariantViolations: InvariantViolation[];
315
+ composabilityIssues: ComposabilityIssue[];
316
+ };
317
+ dryAudit: {
318
+ structuralJsxClones: StructuralJsxCloneGroup[];
319
+ atomicConsolidation: AtomicConsolidationCandidate[];
320
+ duplicateCssTokens: DuplicateTokenDiagnostic[];
321
+ };
322
+ derivedTokens: DerivedTokenProposal[];
323
+ agentExtendability: AgentExtendabilitySection;
324
+ tokenCatalog: {
325
+ primitive: string[];
326
+ semantic: string[];
327
+ component: string[];
328
+ themeBridge: string[];
329
+ };
330
+ tokenRegistry: TokenRegistryEntry[];
331
+ mergeDecisions: import("./designSystem/merges.js").DesignSystemMergeDecision[];
332
+ atomicConsolidation: AtomicConsolidationCandidate[];
333
+ diagnostics: {
334
+ undefinedTokens: UndefinedTokenDiagnostic[];
335
+ undefinedCssClasses: UndefinedCssClassDiagnostic[];
336
+ duplicateTokens: DuplicateTokenDiagnostic[];
337
+ unusedTokens: {
338
+ name: string;
339
+ tier: TokenTier;
340
+ filePath: string;
341
+ lineNumber: number;
342
+ }[];
343
+ unbackedSemanticTokens: UnbackedSemanticTokenDiagnostic[];
344
+ themeSymmetryIssues: ThemeSymmetryFinding[];
345
+ typographyTuples: CompositeTypeTuple[];
346
+ typographyRoleClusters: TypographyRoleCluster[];
347
+ contextualStyleOverrides: ContextualStyleOverrideFinding[];
348
+ contrastFailures: ContrastAuditItem[];
349
+ contrastAudits: ContrastAuditItem[];
350
+ dynamicClassPrefixes: string[];
351
+ unusedCssSelectors: {
352
+ selector: string;
353
+ filePath: string;
354
+ lineNumber: number;
355
+ }[];
356
+ hardcodedCssLiteralCount: number;
357
+ };
358
+ components: ComponentDesignProfile[];
359
+ recommendedHighlightNodeIds: string[];
360
+ agentGuidance: string[];
361
+ } | {
362
+ plugin: {
363
+ name: string;
364
+ version: string;
365
+ layer: import("@getchomp/db").OverlayLayer;
366
+ runId: string;
367
+ overlaysPersisted: number;
368
+ durationMs: number;
369
+ };
370
+ system: DesignSystemSourceInfo;
371
+ baseline: DesignSystemBaselineStatus;
372
+ summary: {
373
+ cssFilesScanned: number;
374
+ componentFilesScanned: number;
375
+ componentsProfiled: number;
376
+ routeCount: number;
377
+ templateCount: number;
378
+ organismCount: number;
379
+ moleculeCount: number;
380
+ atomCount: number;
381
+ utilityCount: number;
382
+ structuralJsxCloneCount: number;
383
+ bypassedAtomCount: number;
384
+ siblingAtomOverlapCount: number;
385
+ nestedInteractiveCount: number;
386
+ unextractedShapeCount: number;
387
+ parallelTwinGroupCount: number;
388
+ callSiteOverrideCount: number;
389
+ propApiDriftGroupCount: number;
390
+ agentExtendabilityScore: number | null;
391
+ agentExtendabilityGrade: "A" | "B" | "C" | "D" | "F" | "N/A";
392
+ totalDefinedTokens: number;
393
+ primitiveTokenCount: number;
394
+ semanticTokenCount: number;
395
+ componentTokenCount: number;
396
+ themeBridgeTokenCount: number;
397
+ unbackedSemanticTokenCount: number;
398
+ themeSymmetryIssueCount: number;
399
+ undefinedTokenCount: number;
400
+ undefinedCssClassCount: number;
401
+ duplicateTokenCount: number;
402
+ forkedTokenCount: number;
403
+ unusedTokenCount: number;
404
+ contrastPairsAudited: number;
405
+ contrastCandidateCount: number;
406
+ contrastFailureCount: number;
407
+ contrastPairsUnresolved: number;
408
+ hardcodedLiteralCount: number;
409
+ derivedTokenProposalCount: number;
410
+ invariantViolationCount: number;
411
+ composabilityIssueCount: number;
412
+ frontendPackageCount: number;
413
+ unsupportedFileCount: number;
414
+ arbitraryTailwindCount: number;
415
+ magicSpacingCount: number;
416
+ primitiveScaleSkipCount: number;
417
+ inlineStyleLiteralCount: number;
418
+ canvasCssSlotCount: number;
419
+ canvasTsConstSlotCount: number;
420
+ canvasLiteralSlotCount: number;
421
+ rawDomPrimitiveCount: number;
422
+ atomicConsolidationGroupCount: number;
423
+ dynamicClassPrefixCount: number;
424
+ unusedCssSelectorCount: number;
425
+ typographyTupleCount: number;
426
+ typographyDriftRoleCount: number;
427
+ contextualOverrideCount: number;
428
+ conventionBreakdown: Record<StylingConvention, number>;
429
+ };
430
+ agentExtendability: {
431
+ score: number | null;
432
+ overallScore: number | null;
433
+ grade: "A" | "B" | "C" | "D" | "F" | "N/A";
434
+ measures: AgentExtendabilityMeasures;
435
+ pavedRoadBlueprint: {
436
+ canonicalTokensByRole: {
437
+ surfaces: string[];
438
+ text: string[];
439
+ borders: string[];
440
+ accents: string[];
441
+ states: string[];
442
+ };
443
+ reusableBuildingBlocks: Array<{
444
+ entityId: string;
445
+ label: string;
446
+ atomicTier: AtomicTier;
447
+ filePath: string;
448
+ rendersInDegree: number;
449
+ propSignature: string;
450
+ }>;
451
+ missingPrimitivesToExtract: string[];
452
+ extensionRules: string[];
453
+ };
454
+ };
455
+ atomicConsolidation: {
456
+ consolidationGuidance: string;
457
+ sampleInstances: {
458
+ componentName: string;
459
+ filePath: string;
460
+ lineNumber: number;
461
+ }[];
462
+ existingSharedComponent?: {
463
+ name: string;
464
+ filePath: string;
465
+ lineNumber?: number;
466
+ } | undefined;
467
+ atomName: string;
468
+ description: string;
469
+ instanceCount: number;
470
+ adopterCount: number;
471
+ adoptionRate: number | null;
472
+ }[];
473
+ semanticTokens: {
474
+ name: string;
475
+ value: string;
476
+ }[];
477
+ components: {
478
+ entityId: string;
479
+ label: string;
480
+ filePath: string;
481
+ atomicTier: AtomicTier;
482
+ uiKind: import("./designSystem/types.js").ComponentUiKind;
483
+ stylingConventions: StylingConvention[];
484
+ }[];
485
+ topIssuesSummary: Record<string, {
486
+ count: number;
487
+ examples: any[];
488
+ }>;
489
+ recommendedHighlightNodeIds: string[];
490
+ agentGuidance: string[];
491
+ };
230
492
  export interface DiffDesignSystemOptions {
231
493
  repoPath: string;
232
494
  repoId?: string;
@@ -4487,6 +4487,199 @@ export async function auditDesignSystem(options) {
4487
4487
  ],
4488
4488
  };
4489
4489
  }
4490
+ export function formatCompactDesignSystemAudit(report, options) {
4491
+ if (options?.verbose) {
4492
+ return report;
4493
+ }
4494
+ const maxSemanticTokens = options?.maxSemanticTokens ?? 60;
4495
+ const hasSearchTerm = Boolean(options?.hasSearchTerm);
4496
+ const valueByTokenName = new Map();
4497
+ for (const entry of report.tokenRegistry) {
4498
+ const val = entry.declarations[0]?.value ??
4499
+ entry.valuesByTheme.root?.raw ??
4500
+ entry.valuesByTheme.dark?.raw ??
4501
+ entry.valuesByTheme.light?.raw ??
4502
+ entry.valuesByTheme.themeBridge?.raw ??
4503
+ "";
4504
+ if (!valueByTokenName.has(entry.name)) {
4505
+ valueByTokenName.set(entry.name, val);
4506
+ }
4507
+ }
4508
+ const seenTokens = new Set();
4509
+ const semanticTokens = [];
4510
+ for (const name of [
4511
+ ...report.tokenCatalog.semantic,
4512
+ ...report.tokenCatalog.themeBridge,
4513
+ ]) {
4514
+ if (seenTokens.has(name))
4515
+ continue;
4516
+ seenTokens.add(name);
4517
+ semanticTokens.push({ name, value: valueByTokenName.get(name) ?? "" });
4518
+ if (semanticTokens.length >= maxSemanticTokens)
4519
+ break;
4520
+ }
4521
+ const stripSnippet = (item) => {
4522
+ if (!item || typeof item !== "object")
4523
+ return item;
4524
+ if (Array.isArray(item))
4525
+ return item.slice(0, 3).map(stripSnippet);
4526
+ const { snippet: _snippet, occurrences, instances, declarations, styleVectorDeltas: _deltas, ...rest } = item;
4527
+ return {
4528
+ ...rest,
4529
+ ...(Array.isArray(occurrences)
4530
+ ? { occurrences: occurrences.slice(0, 2).map(stripSnippet) }
4531
+ : {}),
4532
+ ...(Array.isArray(instances)
4533
+ ? { instances: instances.slice(0, 2).map(stripSnippet) }
4534
+ : {}),
4535
+ ...(Array.isArray(declarations)
4536
+ ? { declarations: declarations.slice(0, 2).map(stripSnippet) }
4537
+ : {}),
4538
+ };
4539
+ };
4540
+ const issueBuckets = [
4541
+ [
4542
+ "bypassedAtoms",
4543
+ report.summary.bypassedAtomCount,
4544
+ report.alignmentAudit.bypassedAtoms,
4545
+ ],
4546
+ [
4547
+ "siblingAtomOverlaps",
4548
+ report.summary.siblingAtomOverlapCount,
4549
+ report.alignmentAudit.siblingAtomOverlaps,
4550
+ ],
4551
+ [
4552
+ "nestedInteractive",
4553
+ report.summary.nestedInteractiveCount,
4554
+ report.alignmentAudit.nestedInteractive,
4555
+ ],
4556
+ [
4557
+ "unextractedShapes",
4558
+ report.summary.unextractedShapeCount,
4559
+ report.alignmentAudit.unextractedShapes,
4560
+ ],
4561
+ [
4562
+ "parallelTwins",
4563
+ report.summary.parallelTwinGroupCount,
4564
+ report.alignmentAudit.parallelTwins,
4565
+ ],
4566
+ [
4567
+ "callSiteOverrides",
4568
+ report.summary.callSiteOverrideCount,
4569
+ report.alignmentAudit.callSiteOverrides,
4570
+ ],
4571
+ [
4572
+ "invariantViolations",
4573
+ report.summary.invariantViolationCount,
4574
+ report.alignmentAudit.invariantViolations,
4575
+ ],
4576
+ [
4577
+ "composabilityIssues",
4578
+ report.summary.composabilityIssueCount,
4579
+ report.alignmentAudit.composabilityIssues,
4580
+ ],
4581
+ [
4582
+ "structuralJsxClones",
4583
+ report.summary.structuralJsxCloneCount,
4584
+ report.dryAudit.structuralJsxClones,
4585
+ ],
4586
+ [
4587
+ "undefinedTokens",
4588
+ report.summary.undefinedTokenCount,
4589
+ report.diagnostics.undefinedTokens,
4590
+ ],
4591
+ [
4592
+ "undefinedCssClasses",
4593
+ report.summary.undefinedCssClassCount,
4594
+ report.diagnostics.undefinedCssClasses,
4595
+ ],
4596
+ [
4597
+ "unbackedSemanticTokens",
4598
+ report.summary.unbackedSemanticTokenCount,
4599
+ report.diagnostics.unbackedSemanticTokens,
4600
+ ],
4601
+ [
4602
+ "themeSymmetryIssues",
4603
+ report.summary.themeSymmetryIssueCount,
4604
+ report.diagnostics.themeSymmetryIssues,
4605
+ ],
4606
+ [
4607
+ "contrastFailures",
4608
+ report.summary.contrastFailureCount,
4609
+ report.diagnostics.contrastFailures,
4610
+ ],
4611
+ ];
4612
+ const topIssuesSummary = {};
4613
+ for (const [key, totalCount, items] of issueBuckets) {
4614
+ if (items.length === 0 && totalCount === 0)
4615
+ continue;
4616
+ topIssuesSummary[key] = {
4617
+ count: Math.max(totalCount, items.length),
4618
+ examples: items.slice(0, 3).map(stripSnippet),
4619
+ };
4620
+ }
4621
+ const compactAtomicConsolidation = report.atomicConsolidation.map((cand) => ({
4622
+ atomName: cand.atomName,
4623
+ description: cand.description,
4624
+ instanceCount: cand.instanceCount,
4625
+ adopterCount: cand.adopterCount,
4626
+ adoptionRate: cand.adoptionRate,
4627
+ ...(cand.existingSharedComponent
4628
+ ? { existingSharedComponent: cand.existingSharedComponent }
4629
+ : {}),
4630
+ consolidationGuidance: cand.consolidationGuidance,
4631
+ sampleInstances: cand.instances.slice(0, 3).map((inst) => ({
4632
+ componentName: inst.componentName,
4633
+ filePath: inst.filePath,
4634
+ lineNumber: inst.lineNumber,
4635
+ })),
4636
+ }));
4637
+ const compactComponents = hasSearchTerm
4638
+ ? report.components.map((c) => ({
4639
+ entityId: c.entityId,
4640
+ label: c.label,
4641
+ filePath: c.filePath,
4642
+ ...(c.lineNumber ? { lineNumber: c.lineNumber } : {}),
4643
+ atomicTier: c.atomicTier,
4644
+ uiKind: c.uiKind,
4645
+ stylingConventions: c.stylingConventions,
4646
+ propContract: c.propContract,
4647
+ tokensConsumed: c.tokensConsumed,
4648
+ renderedComponents: c.renderedComponents,
4649
+ variantAxes: c.variantAxes,
4650
+ arbitraryTailwind: c.arbitraryTailwind.slice(0, 5).map(stripSnippet),
4651
+ rawDomPrimitives: c.rawDomPrimitives.slice(0, 5).map(stripSnippet),
4652
+ inlineStyleLiterals: c.inlineStyleLiterals.slice(0, 5).map(stripSnippet),
4653
+ health: c.health,
4654
+ }))
4655
+ : report.components.map((c) => ({
4656
+ entityId: c.entityId,
4657
+ label: c.label,
4658
+ filePath: c.filePath,
4659
+ atomicTier: c.atomicTier,
4660
+ uiKind: c.uiKind,
4661
+ stylingConventions: c.stylingConventions,
4662
+ }));
4663
+ return {
4664
+ plugin: report.plugin,
4665
+ system: report.system,
4666
+ baseline: report.baseline,
4667
+ summary: report.summary,
4668
+ agentExtendability: {
4669
+ score: report.agentExtendability.overallScore,
4670
+ overallScore: report.agentExtendability.overallScore,
4671
+ grade: report.agentExtendability.grade,
4672
+ measures: report.agentExtendability.measures,
4673
+ pavedRoadBlueprint: report.agentExtendability.pavedRoadBlueprint,
4674
+ },
4675
+ atomicConsolidation: compactAtomicConsolidation,
4676
+ semanticTokens,
4677
+ components: compactComponents,
4678
+ topIssuesSummary,
4679
+ recommendedHighlightNodeIds: report.recommendedHighlightNodeIds,
4680
+ agentGuidance: report.agentGuidance,
4681
+ };
4682
+ }
4490
4683
  /** Short labels (scope stripped) of the frontend packages in a report's scope. */
4491
4684
  export function frontendPackageLabels(report) {
4492
4685
  return report.system.packages
package/dist/index.d.ts CHANGED
@@ -45,7 +45,9 @@ export declare function loadActiveGraphWithShims(repoPath: string, dbPath: strin
45
45
  * `baseGraph.commitSha` when available) and the live working tree (`analyzeTarget` + active plugin projections).
46
46
  * Checks staleness (`[PAT-DB-03]`, Principle of Incomplete Truth) before reporting a delta.
47
47
  */
48
- export declare function computeGraphDeltaWithShims(repoPath: string, dbPath: string, repoId: string, storageFactory?: (dbPath: string) => ChompStorage): Promise<GraphDelta>;
48
+ export declare function computeGraphDeltaWithShims(repoPath: string, dbPath: string, repoId: string, storageFactory?: (dbPath: string) => ChompStorage): Promise<GraphDelta & {
49
+ architecturalGate?: ArchitecturalDiffGate;
50
+ }>;
49
51
  export declare function computeGitRefDeltaWithShims(repoPath: string, options?: {
50
52
  baseRef?: string;
51
53
  targetRef?: string;
@@ -55,6 +57,37 @@ export declare function computeGitRefDeltaWithShims(repoPath: string, options?:
55
57
  targetRef: string;
56
58
  isWorkingTreeSnapshot: boolean;
57
59
  snapshotAt?: string;
60
+ architecturalGate?: ArchitecturalDiffGate;
61
+ }>;
62
+ export interface ArchitecturalDiffGate {
63
+ gateStatus: "PASS" | "WARN";
64
+ summary: {
65
+ newPassThroughWrapperCount: number;
66
+ newDuplicateFlowCount: number;
67
+ newDuplicateSymbolCount: number;
68
+ newBoundaryViolationCount: number;
69
+ newCycleCount: number;
70
+ };
71
+ newPassThroughWrappers: Array<any>;
72
+ newDuplicateFlows: Array<any>;
73
+ newDuplicateSymbols: Array<any>;
74
+ newBoundaryViolations: Array<any>;
75
+ newCycles: {
76
+ packageCycles: Array<any>;
77
+ contractCycles: Array<any>;
78
+ };
79
+ }
80
+ export declare function computeArchitecturalDiffGate(baseGraph: RepresentationGraph, targetGraph: RepresentationGraph, options?: {
81
+ repoPath?: string;
82
+ packageName?: string;
83
+ limit?: number;
84
+ }): ArchitecturalDiffGate;
85
+ export declare function resolveLiveAndBaseGraphsForMcp(repoPath: string, dbPath: string, repoId: string, options?: {
86
+ needBaseGraph?: boolean;
87
+ }): Promise<{
88
+ targetGraph: RepresentationGraph;
89
+ baseGraph: RepresentationGraph | null;
90
+ evaluatedSource: "WORKING_TREE" | "COMMITTED_HEAD";
58
91
  }>;
59
92
  /**
60
93
  * Wraps an MCP tool handler so uncaught errors return a structured
@@ -62,4 +95,92 @@ export declare function computeGitRefDeltaWithShims(repoPath: string, options?:
62
95
  * crashing the stdio transport or leaking resources.
63
96
  */
64
97
  export declare function withMcpToolErrorBoundary<A>(handler: (args: A) => Promise<any>): (args: A) => Promise<any>;
98
+ export declare function formatCompactMcpDiff(delta: GraphDelta & {
99
+ baseRef?: string;
100
+ targetRef?: string;
101
+ isWorkingTreeSnapshot?: boolean;
102
+ snapshotAt?: string;
103
+ architecturalGate?: ArchitecturalDiffGate;
104
+ }, options?: {
105
+ includeLexicalShift?: boolean;
106
+ includeUnchanged?: boolean;
107
+ verbose?: boolean;
108
+ maxEdges?: number;
109
+ }): {
110
+ nodes: Record<string, import("@getchomp/core").DiffNode>;
111
+ edges: Record<string, import("@getchomp/core").DiffEdge>;
112
+ summary: {
113
+ nodes: {
114
+ ADDED: number;
115
+ MODIFIED: number;
116
+ REMOVED: number;
117
+ LEXICAL_SHIFT: number;
118
+ UNCHANGED: number;
119
+ };
120
+ edges: {
121
+ ADDED: number;
122
+ MODIFIED: number;
123
+ REMOVED: number;
124
+ LEXICAL_SHIFT: number;
125
+ UNCHANGED: number;
126
+ };
127
+ };
128
+ architecturalGate?: ArchitecturalDiffGate | undefined;
129
+ baseExtractorVersion: string | undefined;
130
+ targetExtractorVersion: string | undefined;
131
+ snapshotAt?: string | undefined;
132
+ isWorkingTreeSnapshot?: boolean | undefined;
133
+ targetCommitSha: string | undefined;
134
+ headCommitSha: string | undefined;
135
+ targetRef?: string | undefined;
136
+ baseCommitSha: string | undefined;
137
+ baseRef?: string | undefined;
138
+ baseStatus: "FRESH" | "STALE";
139
+ } | {
140
+ summary: {
141
+ omittedNoise: {
142
+ modifiedDeploymentUnits: number;
143
+ modifiedExternalPackageImports: number;
144
+ modifiedSameEndpointEdges: number;
145
+ externalPackageCallEdges: number;
146
+ builtinOrDynamicEdges: number;
147
+ truncatedEdges: number;
148
+ };
149
+ nodes: {
150
+ ADDED: number;
151
+ MODIFIED: number;
152
+ REMOVED: number;
153
+ LEXICAL_SHIFT: number;
154
+ UNCHANGED: number;
155
+ };
156
+ edges: {
157
+ ADDED: number;
158
+ MODIFIED: number;
159
+ REMOVED: number;
160
+ LEXICAL_SHIFT: number;
161
+ UNCHANGED: number;
162
+ };
163
+ };
164
+ nodes: Record<string, any>;
165
+ edges: Record<string, any>;
166
+ architecturalGate?: ArchitecturalDiffGate | undefined;
167
+ baseExtractorVersion: string | undefined;
168
+ targetExtractorVersion: string | undefined;
169
+ snapshotAt?: string | undefined;
170
+ isWorkingTreeSnapshot?: boolean | undefined;
171
+ targetCommitSha: string | undefined;
172
+ headCommitSha: string | undefined;
173
+ targetRef?: string | undefined;
174
+ baseCommitSha: string | undefined;
175
+ baseRef?: string | undefined;
176
+ baseStatus: "FRESH" | "STALE";
177
+ };
178
+ export declare function formatCompactMcpNodes(nodes: Array<Record<string, any>>, options?: {
179
+ verbose?: boolean;
180
+ limit?: number;
181
+ }): Array<Record<string, any>>;
182
+ export declare function formatCompactMcpEdges(edges: Array<Record<string, any>>, options?: {
183
+ verbose?: boolean;
184
+ includeBuiltins?: boolean;
185
+ }): Array<Record<string, any>>;
65
186
  export declare function runMcpServer(targetPath?: string): Promise<void>;