@getchomp/mcp 0.0.0-stage → 0.2.43

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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -2
  3. package/dist/conventionsReference.d.ts +84 -0
  4. package/dist/conventionsReference.js +313 -0
  5. package/dist/designSystem/astScanner.d.ts +153 -0
  6. package/dist/designSystem/astScanner.js +2014 -0
  7. package/dist/designSystem/baseline.d.ts +65 -0
  8. package/dist/designSystem/baseline.js +136 -0
  9. package/dist/designSystem/color.d.ts +35 -0
  10. package/dist/designSystem/color.js +265 -0
  11. package/dist/designSystem/config.d.ts +183 -0
  12. package/dist/designSystem/config.js +469 -0
  13. package/dist/designSystem/contrast.d.ts +55 -0
  14. package/dist/designSystem/contrast.js +377 -0
  15. package/dist/designSystem/cssParser.d.ts +63 -0
  16. package/dist/designSystem/cssParser.js +469 -0
  17. package/dist/designSystem/merges.d.ts +57 -0
  18. package/dist/designSystem/merges.js +94 -0
  19. package/dist/designSystem/preprocessors.d.ts +46 -0
  20. package/dist/designSystem/preprocessors.js +1108 -0
  21. package/dist/designSystem/presentation.d.ts +45 -0
  22. package/dist/designSystem/presentation.js +796 -0
  23. package/dist/designSystem/styleVectors.d.ts +27 -0
  24. package/dist/designSystem/styleVectors.js +484 -0
  25. package/dist/designSystem/tokens.d.ts +39 -0
  26. package/dist/designSystem/tokens.js +409 -0
  27. package/dist/designSystem/topology.d.ts +64 -0
  28. package/dist/designSystem/topology.js +254 -0
  29. package/dist/designSystem/types.d.ts +857 -0
  30. package/dist/designSystem/types.js +113 -0
  31. package/dist/designSystem/typography.d.ts +25 -0
  32. package/dist/designSystem/typography.js +244 -0
  33. package/dist/designSystem/uiShapes.d.ts +74 -0
  34. package/dist/designSystem/uiShapes.js +285 -0
  35. package/dist/designSystem/valueClusters.d.ts +76 -0
  36. package/dist/designSystem/valueClusters.js +281 -0
  37. package/dist/designSystemPlugin.d.ts +321 -0
  38. package/dist/designSystemPlugin.js +4730 -0
  39. package/dist/enrichNodesPlugin.d.ts +160 -0
  40. package/dist/enrichNodesPlugin.js +957 -0
  41. package/dist/index.d.ts +65 -0
  42. package/dist/index.js +1298 -0
  43. package/dist/intelligence.d.ts +502 -0
  44. package/dist/intelligence.js +3058 -0
  45. package/dist/pluginRunner.d.ts +364 -0
  46. package/dist/pluginRunner.js +1096 -0
  47. package/dist/plugins/design-system/index.d.ts +14 -0
  48. package/dist/plugins/design-system/index.js +241 -0
  49. package/dist/plugins/enrich-nodes/index.d.ts +388 -0
  50. package/dist/plugins/enrich-nodes/index.js +697 -0
  51. package/dist/plugins/index.d.ts +15 -0
  52. package/dist/plugins/index.js +20 -0
  53. package/dist/plugins/local-shims/index.d.ts +121 -0
  54. package/dist/plugins/local-shims/index.js +237 -0
  55. package/dist/shimsPlugin.d.ts +134 -0
  56. package/dist/shimsPlugin.js +1392 -0
  57. package/package.json +39 -3
@@ -0,0 +1,502 @@
1
+ /**
2
+ * packages/mcp/src/intelligence.ts
3
+ *
4
+ * Architectural Intelligence, Pre-Edit Blast Radius & Pattern Alignment Engine
5
+ * Enforces [PAT-MCP-08] and [PAT-MCP-09].
6
+ *
7
+ * Operates purely on the deterministic RepresentationGraph from @getchomp/core
8
+ * with zero external runtime dependencies so every helper resolves cleanly
9
+ * on the Layer 0 structural graph.
10
+ */
11
+ import { type ContractPortValves, type PortOverlayLike, type RepresentationGraph, type StructuralNode } from "@getchomp/core";
12
+ export interface NodeSummaryRef {
13
+ id: string;
14
+ name: string;
15
+ label: string;
16
+ type: string;
17
+ entityType: string;
18
+ packageName: string;
19
+ filePath?: string;
20
+ lineNumber?: number;
21
+ }
22
+ export interface UnresolvedCallDiagnostic {
23
+ name: string;
24
+ confidence: "HIGH" | "MEDIUM" | "LOW";
25
+ filePath?: string;
26
+ lineNumber?: number;
27
+ snippet?: string;
28
+ reason: "opaque-body" | "unresolved-target";
29
+ /** Deterministic, identifier-free shape key recorded by the extractor (v5 Loop 1/3). */
30
+ shapeKey?: string;
31
+ }
32
+ export interface IsolatedDeploymentUnitsDiagnostic {
33
+ kind: "ISOLATED_DEPLOYMENT_UNITS";
34
+ ruleId: "ISOLATED_DEPLOYMENT_UNITS";
35
+ severity: "ADVISORY";
36
+ isolatedPackages: Array<{
37
+ packageName: string;
38
+ boundaryId: string;
39
+ packagePath?: string;
40
+ contractCount: number;
41
+ }>;
42
+ crossPackageLinkCount: number;
43
+ description: string;
44
+ agentReadinessOpportunity: string;
45
+ agentReadinessGuidance: string;
46
+ }
47
+ export interface UnstitchedServerRouteRef {
48
+ node: NodeSummaryRef;
49
+ method: string;
50
+ httpMethod: string;
51
+ declaredPath: string;
52
+ effectivePath: string;
53
+ mountPrefix?: string;
54
+ }
55
+ export interface ProxyRewriteRule {
56
+ source: string;
57
+ destination: string;
58
+ filePath?: string;
59
+ }
60
+ export interface UnstitchedProtocolSeamDiagnostic {
61
+ kind: "UNSTITCHED_PROTOCOL_SEAM";
62
+ ruleId: "UNSTITCHED_PROTOCOL_SEAM";
63
+ severity: "ADVISORY";
64
+ clientPackage: string;
65
+ serverPackage: string;
66
+ clientConnector: NodeSummaryRef;
67
+ clientConnectors: NodeSummaryRef[];
68
+ clientWrapper?: NodeSummaryRef;
69
+ clientWrappers: NodeSummaryRef[];
70
+ clientCallers: NodeSummaryRef[];
71
+ clientUrlPattern: string;
72
+ clientUrlPatterns: string[];
73
+ detectedClientBaseUrls: string[];
74
+ detectedProxyRewrites: ProxyRewriteRule[];
75
+ detectedServerMountPrefixes: string[];
76
+ detectedMechanisms: string[];
77
+ serverRoutes: UnstitchedServerRouteRef[];
78
+ uncalledServerRoutes: UnstitchedServerRouteRef[];
79
+ candidateServerRoutes: UnstitchedServerRouteRef[];
80
+ candidateBridge: string;
81
+ description: string;
82
+ agentReadinessOpportunity: string;
83
+ agentReadinessGuidance: string;
84
+ }
85
+ export interface InitBlockLeakedFileDetail {
86
+ filePath: string;
87
+ deadEndContracts: NodeSummaryRef[];
88
+ leakedCalls: Array<{
89
+ connectorId: string;
90
+ name: string;
91
+ entityType: string;
92
+ lineNumber?: number;
93
+ snippet?: string;
94
+ }>;
95
+ }
96
+ export interface InitBlockConnectorLeakDiagnostic {
97
+ kind: "INIT_BLOCK_CONNECTOR_LEAK";
98
+ ruleId: "INIT_BLOCK_CONNECTOR_LEAK";
99
+ severity: "ADVISORY";
100
+ packageName: string;
101
+ initBlockNode: NodeSummaryRef;
102
+ initConnectorEdgeCount: number;
103
+ totalPackageConnectorEdgeCount: number;
104
+ initConnectorSharePercent: number;
105
+ deadEndContractCount: number;
106
+ deadEndContracts: NodeSummaryRef[];
107
+ leakedConnectors: NodeSummaryRef[];
108
+ affectedFiles: string[];
109
+ fileBreakdown: InitBlockLeakedFileDetail[];
110
+ description: string;
111
+ agentReadinessOpportunity: string;
112
+ agentReadinessGuidance: string;
113
+ }
114
+ export interface ShadowedDbReceptorDiagnostic {
115
+ kind: "SHADOWED_DB_RECEPTOR";
116
+ ruleId: "SHADOWED_DB_RECEPTOR";
117
+ severity: "ADVISORY";
118
+ packageName: string;
119
+ driverPackageNode: NodeSummaryRef;
120
+ expectedReceptorLabel: string;
121
+ shadowedCallEdgeCount: number;
122
+ shadowedCallers: NodeSummaryRef[];
123
+ description: string;
124
+ agentReadinessOpportunity: string;
125
+ agentReadinessGuidance: string;
126
+ }
127
+ export type SeamDiagnostic = IsolatedDeploymentUnitsDiagnostic | UnstitchedProtocolSeamDiagnostic | InitBlockConnectorLeakDiagnostic | ShadowedDbReceptorDiagnostic;
128
+ /**
129
+ * Matches a node's resolved owning package (and optional path) against a user/agent
130
+ * `packageName` filter without leaking mid-word file-path substrings across packages
131
+ * (e.g., `"db"` must never match `apps/web/.../adapterSandbox.ts`).
132
+ */
133
+ export declare function packageMatchesFilter(nodePkg: string, nodePath: string | undefined, rawFilter: string): boolean;
134
+ /**
135
+ * Filters nodes in `chomp_get_nodes` with support for `search_term` and `packageName`
136
+ * fast-path resolution ([PAT-MCP-08]).
137
+ */
138
+ export declare function filterNodesForMcp(graph: RepresentationGraph, filters: {
139
+ type?: string;
140
+ entityType?: string;
141
+ parentBoundaryId?: string;
142
+ name?: string;
143
+ filePath?: string;
144
+ searchTerm?: string;
145
+ packageName?: string;
146
+ overlaysByEntityId?: Map<string, Array<{
147
+ layer: string;
148
+ payload?: Record<string, any>;
149
+ }>>;
150
+ }): StructuralNode[];
151
+ /**
152
+ * Selective MCP overlay hydration (`[PAT-DB-05]`).
153
+ * Prevents multi-plugin stores from bloating structural queries in `chomp_get_nodes`:
154
+ * - By default (`includeOverlays` omitted and `layers` omitted), returns pure structural nodes without `overlays`.
155
+ * - When `includeOverlays: true` or `layers` is specified, attaches matching `overlays` onto each node.
156
+ */
157
+ export declare function hydrateNodeOverlays<TNode extends {
158
+ id: string;
159
+ }, TOverlay extends {
160
+ entityId: string;
161
+ layer: string;
162
+ }>(nodes: TNode[], overlays: TOverlay[], options?: {
163
+ includeOverlays?: boolean;
164
+ layers?: string[];
165
+ }): Array<TNode & {
166
+ overlays?: TOverlay[];
167
+ }>;
168
+ /**
169
+ * Formats per-layer write counts for `chomp_enrich_nodes` (`[PAT-DB-05]`).
170
+ */
171
+ export declare function formatEnrichNodesSummary(layerCounts: Record<string, number>, rulesAddedOrUpdated: number): string;
172
+ export type ActiveViewLevel = "system" | "package";
173
+ export interface ResolvedViewTargetAltitude {
174
+ viewLevel: ActiveViewLevel;
175
+ packageName?: string;
176
+ affectedPackages: string[];
177
+ }
178
+ /**
179
+ * Resolves target node IDs for `chomp_create_view` combining explicit `highlightNodeIds`
180
+ * with optional `search_term` / `packageName` fast-path filters ([PAT-MCP-08]).
181
+ */
182
+ export declare function resolveViewNodeIds(graph: RepresentationGraph | null, explicitIds: string[], searchTerm?: string, packageName?: string): string[];
183
+ /**
184
+ * Determines the topological height (`"system"` Bird's-Eye Macro View vs `"package"`
185
+ * Circuit-Board View) and primary package for `chomp_create_view` ([PAT-MCP-03], [PAT-VIS-28]).
186
+ *
187
+ * - If `explicitViewLevel` is provided (`"system"` or `"package"`), honors it directly.
188
+ * - Otherwise defaults to `"system"` when highlighted nodes span multiple packages (or 0 packages),
189
+ * and `"package"` when all highlighted nodes reside within a single package.
190
+ */
191
+ export declare function resolveViewTargetAltitude(graph: RepresentationGraph | null, highlightNodeIds: string[], explicitViewLevel?: ActiveViewLevel, explicitPackageName?: string): ResolvedViewTargetAltitude;
192
+ /**
193
+ * Builds a one-click local deep-link URL for opening the Visualizer directly in
194
+ * Agent Spotlight mode at the selected topological height (`[PAT-MCP-03]`, `[PAT-VIS-28]`).
195
+ */
196
+ export declare function buildActiveViewUrl(options: {
197
+ baseUrl?: string;
198
+ viewLevel: ActiveViewLevel;
199
+ packageName?: string;
200
+ }): string;
201
+ /**
202
+ * `chomp_audit_health` implementation ([PAT-MCP-08], [PAT-MCP-09]).
203
+ *
204
+ * Synthesizes system & per-package health metrics, unreachable orphan contracts,
205
+ * dead-end ingress nodes, opaque contract bodies (`astCallCount > 0 && resolvedOutDegree === 0`),
206
+ * inter-package seam & "missing glue" diagnostics (`ISOLATED_DEPLOYMENT_UNITS`,
207
+ * `UNSTITCHED_PROTOCOL_SEAM`, `INIT_BLOCK_CONNECTOR_LEAK`),
208
+ * and unresolved call hotspots framed as Agent-Readiness / Map Visibility opportunities.
209
+ */
210
+ export declare function auditGraphHealth(graph: RepresentationGraph, options?: {
211
+ packageName?: string;
212
+ limit?: number;
213
+ repoPath?: string;
214
+ }): {
215
+ healthGate: {
216
+ orphanContractCount: number;
217
+ unlinkedImportedOrphanCount: number;
218
+ importedNeverInvokedOrphanCount: number;
219
+ unreferencedExportOrphanCount: number;
220
+ deadEndIngressCount: number;
221
+ opaqueContractCount: number;
222
+ unresolvedHotspotCount: number;
223
+ totalUnresolvedCalls: number;
224
+ darkFileCount: number;
225
+ unstitchedProtocolSeamCount: number;
226
+ initBlockConnectorLeakCount: number;
227
+ seamDiagnosticCount: number;
228
+ status: "PASS" | "WARN";
229
+ connectivityRate: number;
230
+ rawConnectivityRate: number;
231
+ knowableConnectivityRate: number;
232
+ unprovableFallbackCount: number;
233
+ knowableGapCount: number;
234
+ dynamicBoundaryCount: number;
235
+ platformPrimitiveCount: number;
236
+ entityTypeCoverage: number;
237
+ parentCoverage: number;
238
+ scopePurity: number;
239
+ totalBoundaries: number;
240
+ totalContracts: number;
241
+ totalRelationships: number;
242
+ totalOpenConnectors: number;
243
+ };
244
+ packages: Record<string, any>[];
245
+ /**
246
+ * Candidate pattern classes derived from deterministic shape keys (v5 Loop 1/3). A cluster is
247
+ * a hypothesis about a shared extractor gap, not a verdict: it becomes a ledger row only after
248
+ * a human/AI names and approves it. `unclassified` instances carry no shape key (unknown).
249
+ */
250
+ signalClusters: {
251
+ totalClusters: number;
252
+ clusters: import("@getchomp/core").SignalCluster[];
253
+ unclassified: {
254
+ instanceCount: number;
255
+ nodeCount: number;
256
+ };
257
+ };
258
+ lowConfidenceFallbacks: {
259
+ totalCount: number;
260
+ byShapeKey: {
261
+ shapeKey: string;
262
+ count: number;
263
+ }[];
264
+ };
265
+ darkFiles: string[];
266
+ canonicalPatterns: {
267
+ topContractPatterns: {
268
+ patternId: string;
269
+ count: number;
270
+ }[];
271
+ topEdgePatterns: {
272
+ patternId: string;
273
+ count: number;
274
+ }[];
275
+ note: string;
276
+ };
277
+ unstitchedProtocolSeams: UnstitchedProtocolSeamDiagnostic[];
278
+ initBlockConnectorLeaks: InitBlockConnectorLeakDiagnostic[];
279
+ seamDiagnostics: SeamDiagnostic[];
280
+ unresolvedHotspots: {
281
+ node: NodeSummaryRef;
282
+ resolvedOutDegree: number;
283
+ unresolvedCount: number;
284
+ unresolvedCalls: UnresolvedCallDiagnostic[];
285
+ agentReadinessOpportunity: string;
286
+ }[];
287
+ opaqueContracts: {
288
+ node: NodeSummaryRef;
289
+ astCallCount: number;
290
+ unresolvedCallCount: number;
291
+ unresolvedCalls: UnresolvedCallDiagnostic[];
292
+ agentReadinessOpportunity: string;
293
+ }[];
294
+ deadEndIngress: {
295
+ node: NodeSummaryRef;
296
+ agentReadinessOpportunity: string;
297
+ }[];
298
+ orphanContracts: {
299
+ node: NodeSummaryRef;
300
+ resolvedInDegree: number;
301
+ resolvedOutDegree: number;
302
+ classification: "UNLINKED_IMPORTED_TARGET" | "IMPORTED_BUT_NEVER_INVOKED" | "DISCONNECTED_SUBTREE_ROOT" | "UNREFERENCED_EXPORT";
303
+ unresolvedIncoming?: any[];
304
+ agentReadinessOpportunity: string;
305
+ }[];
306
+ recommendedHighlightNodeIds: string[];
307
+ };
308
+ /**
309
+ * `chomp_find_redundancies` implementation ([PAT-MCP-08], [PAT-MCP-09]).
310
+ *
311
+ * Detects pass-through middlemen, parallel/duplicate story sequences,
312
+ * duplicate contract names across files/packages, and outlier wiring patterns.
313
+ */
314
+ export declare function findGraphRedundancies(graph: RepresentationGraph, options?: {
315
+ packageName?: string;
316
+ limit?: number;
317
+ }): {
318
+ summary: {
319
+ passThroughMiddlemenCount: number;
320
+ duplicateStorySequenceGroups: number;
321
+ duplicateSymbolCount: number;
322
+ patternAlignmentOpportunityCount: number;
323
+ };
324
+ passThroughMiddlemen: {
325
+ middleman: NodeSummaryRef;
326
+ callers: NodeSummaryRef[];
327
+ singleTarget: NodeSummaryRef;
328
+ crossesPackageBoundary: boolean;
329
+ agentReadinessGuidance: string;
330
+ }[];
331
+ duplicateStorySequences: {
332
+ sharedCalleeCount: number;
333
+ samePackage: boolean;
334
+ parallelCallers: NodeSummaryRef[];
335
+ sharedTargets: NodeSummaryRef[];
336
+ patternAlignmentGuidance: string;
337
+ }[];
338
+ duplicateSymbols: {
339
+ symbolName: string;
340
+ instanceCount: number;
341
+ crossPackage: boolean;
342
+ instances: NodeSummaryRef[];
343
+ consolidationGuidance: string;
344
+ }[];
345
+ patternAlignmentOpportunities: {
346
+ packageName: string;
347
+ peerGroupType: string;
348
+ dominantPatternDescription: string;
349
+ outlierNode: NodeSummaryRef;
350
+ observedBehavior: string;
351
+ agentReadinessGuidance: string;
352
+ }[];
353
+ };
354
+ export interface CrossPkgEdgeDetail {
355
+ sourceNode: NodeSummaryRef;
356
+ targetNode: NodeSummaryRef;
357
+ edgeName: string;
358
+ edgeType: string;
359
+ filePath?: string;
360
+ lineNumber?: number;
361
+ }
362
+ /**
363
+ * `chomp_check_boundaries` implementation ([PAT-MCP-08], [PAT-MCP-09]).
364
+ *
365
+ * Evaluates package dependency directionality, topological tiers,
366
+ * package-level and contract-level circular dependencies, boundary isolation rules,
367
+ * and inter-package seam diagnostics (`ISOLATED_DEPLOYMENT_UNITS`,
368
+ * `UNSTITCHED_PROTOCOL_SEAM`, `INIT_BLOCK_CONNECTOR_LEAK`).
369
+ */
370
+ export declare function checkGraphBoundaries(graph: RepresentationGraph, options?: {
371
+ packageName?: string;
372
+ repoPath?: string;
373
+ }): {
374
+ status: "ADVISORY" | "VIOLATION" | "CLEAN";
375
+ summary: {
376
+ packageCount: number;
377
+ crossPackageLinkCount: number;
378
+ isolatedPackageCount: number;
379
+ packageCycleCount: number;
380
+ contractCycleCount: number;
381
+ selfLoopCount: number;
382
+ boundaryViolationCount: number;
383
+ boundaryAdvisoryCount: number;
384
+ unstitchedProtocolSeamCount: number;
385
+ initBlockConnectorLeakCount: number;
386
+ seamDiagnosticCount: number;
387
+ };
388
+ packageLayers: {
389
+ packageName: string;
390
+ boundaryId: string;
391
+ packagePath?: string;
392
+ architecturalTier: "ENTRY_APPLICATION" | "SERVICE_ORCHESTRATOR" | "INFRASTRUCTURE_ADAPTER" | "FOUNDATION_CORE" | "ISOLATED_PACKAGE";
393
+ tierRank: number;
394
+ dependsOnPackages: string[];
395
+ dependedOnByPackages: string[];
396
+ }[];
397
+ packageDependencies: {
398
+ sourcePackage: string;
399
+ targetPackage: string;
400
+ edgeCount: number;
401
+ distinctTargetContracts: number;
402
+ sampleEdges: CrossPkgEdgeDetail[];
403
+ }[];
404
+ circularDependencies: {
405
+ packageCycles: string[][];
406
+ contractCycles: {
407
+ cycleLength: number;
408
+ nodes: NodeSummaryRef[];
409
+ }[];
410
+ selfLoops: {
411
+ node: NodeSummaryRef;
412
+ edgeName: string;
413
+ filePath?: string;
414
+ lineNumber?: number;
415
+ }[];
416
+ };
417
+ boundaryViolations: {
418
+ ruleId: string;
419
+ severity: "VIOLATION" | "ADVISORY";
420
+ sourcePackage: string;
421
+ targetPackage: string;
422
+ description: string;
423
+ evidence: CrossPkgEdgeDetail[];
424
+ agentReadinessGuidance: string;
425
+ }[];
426
+ unstitchedProtocolSeams: UnstitchedProtocolSeamDiagnostic[];
427
+ initBlockConnectorLeaks: InitBlockConnectorLeakDiagnostic[];
428
+ seamDiagnostics: SeamDiagnostic[];
429
+ };
430
+ export interface ImpactHop {
431
+ depth: number;
432
+ node: NodeSummaryRef;
433
+ viaEdgeName: string;
434
+ viaEdgeType: string;
435
+ fromOrToNodeId: string;
436
+ crossesPackageBoundary: boolean;
437
+ isIngressEntry: boolean;
438
+ }
439
+ /**
440
+ * `chomp_get_blast_radius` implementation ([PAT-MCP-08], [PAT-MCP-09]).
441
+ *
442
+ * Computes the upstream caller tree, downstream dependency tree, external side-effects,
443
+ * affected INGRESS entry points, affected packages, Port Valve schemas, and
444
+ * `highlightNodeIds` for pre-edit impact analysis.
445
+ */
446
+ export declare function computeBlastRadius(graph: RepresentationGraph, options: {
447
+ nodeId?: string;
448
+ nodeIds?: string[];
449
+ searchTerm?: string;
450
+ packageName?: string;
451
+ maxDepth?: number;
452
+ overlays?: ReadonlyArray<PortOverlayLike & {
453
+ entityId: string;
454
+ }>;
455
+ }, overlaysArg?: ReadonlyArray<PortOverlayLike & {
456
+ entityId: string;
457
+ }>): {
458
+ found: boolean;
459
+ message: string;
460
+ targetNodes: never[];
461
+ portValves: never[];
462
+ upstreamCallers: never[];
463
+ downstreamDependencies: never[];
464
+ externalSideEffects: never[];
465
+ affectedEntryPoints: never[];
466
+ affectedPackages: never[];
467
+ highlightNodeIds: never[];
468
+ preEditGuidance: never[];
469
+ summary?: undefined;
470
+ } | {
471
+ found: boolean;
472
+ summary: {
473
+ riskLevel: "HIGH" | "MEDIUM" | "LOW";
474
+ targetCount: number;
475
+ directUpstreamCallerCount: number;
476
+ totalUpstreamCallerCount: number;
477
+ crossPackageCallerCount: number;
478
+ downstreamDependencyCount: number;
479
+ externalSideEffectCount: number;
480
+ affectedEntryPointCount: number;
481
+ portMismatchCount: number;
482
+ affectedPackages: string[];
483
+ };
484
+ targetNodes: NodeSummaryRef[];
485
+ portValves: (ContractPortValves & {
486
+ nodeId: string;
487
+ label: string;
488
+ })[];
489
+ affectedEntryPoints: NodeSummaryRef[];
490
+ upstreamCallers: ImpactHop[];
491
+ downstreamDependencies: ImpactHop[];
492
+ externalSideEffects: {
493
+ depth: number;
494
+ connector: NodeSummaryRef;
495
+ calledFromNodeId: string;
496
+ edgeName: string;
497
+ }[];
498
+ highlightNodeIds: string[];
499
+ preEditGuidance: string[];
500
+ message?: undefined;
501
+ affectedPackages?: undefined;
502
+ };