@angular-modernizer/adapter-mcp 1.0.0 → 1.1.0

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 (129) hide show
  1. package/README.md +78 -64
  2. package/dist/cli.js +8 -0
  3. package/dist/core/project-analyzer.d.ts +3 -12
  4. package/dist/core/project-analyzer.js +3 -12
  5. package/dist/index.d.ts +118 -3
  6. package/dist/index.js +46 -3
  7. package/dist/mcp-watcher.d.ts +28 -8
  8. package/dist/mcp-watcher.js +7 -7
  9. package/dist/scan-host/scan-host.d.ts +119 -0
  10. package/dist/scan-host/scan-host.js +376 -0
  11. package/dist/scan-host/scan-protocol.d.ts +35 -0
  12. package/dist/scan-host/scan-protocol.js +6 -0
  13. package/dist/scan-host/scan-worker.d.ts +14 -0
  14. package/dist/scan-host/scan-worker.js +48 -0
  15. package/dist/server/limited-stdio-transport.d.ts +7 -0
  16. package/dist/server/mcp-server.d.ts +11 -7
  17. package/dist/server/mcp-server.js +4 -7
  18. package/dist/server/sdk-server.d.ts +1 -0
  19. package/dist/server/tool-registry.d.ts +3 -7
  20. package/dist/server/tool-registry.js +1 -7
  21. package/dist/streaming/progress-store.d.ts +22 -5
  22. package/dist/streaming/progress-store.js +9 -5
  23. package/dist/tools/analyze-build-impact.d.ts +56 -34
  24. package/dist/tools/analyze-build-impact.js +30 -25
  25. package/dist/tools/analyze-core-to-shared.d.ts +42 -12
  26. package/dist/tools/analyze-core-to-shared.js +11 -10
  27. package/dist/tools/analyze-parser-performance.d.ts +23 -22
  28. package/dist/tools/analyze-parser-performance.js +20 -18
  29. package/dist/tools/analyze-project.d.ts +82 -12
  30. package/dist/tools/analyze-project.js +98 -101
  31. package/dist/tools/check-incremental-compatibility.d.ts +13 -11
  32. package/dist/tools/check-incremental-compatibility.js +11 -8
  33. package/dist/tools/collect-feedback.d.ts +41 -26
  34. package/dist/tools/collect-feedback.js +32 -23
  35. package/dist/tools/compare-health.d.ts +76 -19
  36. package/dist/tools/compare-health.js +26 -19
  37. package/dist/tools/extract-libraries.d.ts +44 -20
  38. package/dist/tools/extract-libraries.js +16 -17
  39. package/dist/tools/find-angular-symbol.d.ts +25 -23
  40. package/dist/tools/find-angular-symbol.js +17 -14
  41. package/dist/tools/find-component-hosts.d.ts +31 -25
  42. package/dist/tools/find-component-hosts.js +24 -21
  43. package/dist/tools/find-usages.d.ts +23 -21
  44. package/dist/tools/find-usages.js +19 -16
  45. package/dist/tools/get-bootstrap-execution.d.ts +33 -25
  46. package/dist/tools/get-bootstrap-execution.js +25 -22
  47. package/dist/tools/get-call-graph.d.ts +18 -13
  48. package/dist/tools/get-call-graph.js +24 -21
  49. package/dist/tools/get-operation-progress-tool.d.ts +12 -6
  50. package/dist/tools/get-operation-progress-tool.js +11 -6
  51. package/dist/tools/get-operation-progress.d.ts +26 -0
  52. package/dist/tools/helpers/analysis-output.d.ts +5 -0
  53. package/dist/tools/helpers/batch-kernel.d.ts +14 -0
  54. package/dist/tools/helpers/batch-kernel.js +12 -0
  55. package/dist/tools/helpers/compact-output.d.ts +2 -1
  56. package/dist/tools/helpers/compact-output.js +2 -1
  57. package/dist/tools/helpers/health-delta.d.ts +27 -14
  58. package/dist/tools/helpers/health-delta.js +11 -14
  59. package/dist/tools/helpers/project-cache.d.ts +50 -34
  60. package/dist/tools/helpers/project-cache.js +33 -34
  61. package/dist/tools/helpers/rule-runner.d.ts +23 -16
  62. package/dist/tools/helpers/rule-runner.js +24 -17
  63. package/dist/tools/helpers/scan-engine.d.ts +107 -0
  64. package/dist/tools/helpers/scan-engine.js +197 -0
  65. package/dist/tools/helpers/suggestion-generator.d.ts +9 -13
  66. package/dist/tools/helpers/suggestion-generator.js +0 -12
  67. package/dist/tools/helpers/tool-cache.d.ts +11 -0
  68. package/dist/tools/helpers/tool-cache.js +15 -0
  69. package/dist/tools/helpers/tool-context.d.ts +11 -8
  70. package/dist/tools/helpers/tool-context.js +5 -8
  71. package/dist/tools/inspect-form-group.d.ts +32 -25
  72. package/dist/tools/inspect-form-group.js +24 -21
  73. package/dist/tools/inspect-i18n.d.ts +28 -22
  74. package/dist/tools/inspect-i18n.js +20 -17
  75. package/dist/tools/inspect-template.d.ts +31 -24
  76. package/dist/tools/inspect-template.js +23 -20
  77. package/dist/tools/learn-patterns.d.ts +88 -12
  78. package/dist/tools/learn-patterns.js +17 -11
  79. package/dist/tools/list-imports.d.ts +42 -25
  80. package/dist/tools/list-imports.js +23 -20
  81. package/dist/tools/orchestrate-migration.d.ts +31 -9
  82. package/dist/tools/orchestrate-migration.js +12 -7
  83. package/dist/tools/parse-stack-trace.d.ts +23 -21
  84. package/dist/tools/parse-stack-trace.js +10 -7
  85. package/dist/tools/plan-migration.d.ts +65 -25
  86. package/dist/tools/plan-migration.js +19 -19
  87. package/dist/tools/resolve-type.d.ts +19 -9
  88. package/dist/tools/resolve-type.js +19 -11
  89. package/dist/tools/review-feedback.d.ts +27 -24
  90. package/dist/tools/review-feedback.js +24 -20
  91. package/dist/tools/rollback-changes.d.ts +13 -9
  92. package/dist/tools/rollback-changes.js +10 -7
  93. package/dist/tools/run-angular-cli.d.ts +12 -10
  94. package/dist/tools/run-angular-cli.js +11 -8
  95. package/dist/tools/run-build.d.ts +13 -11
  96. package/dist/tools/run-build.js +11 -8
  97. package/dist/tools/run-schematic.d.ts +12 -10
  98. package/dist/tools/run-schematic.js +11 -8
  99. package/dist/tools/scan-all.d.ts +69 -12
  100. package/dist/tools/scan-all.js +55 -122
  101. package/dist/tools/scan-angular.d.ts +41 -9
  102. package/dist/tools/scan-angular.js +66 -135
  103. package/dist/tools/scan-architecture.d.ts +75 -14
  104. package/dist/tools/scan-architecture.js +180 -185
  105. package/dist/tools/scan-solid.d.ts +40 -9
  106. package/dist/tools/scan-solid.js +64 -133
  107. package/dist/tools/search-codebase.d.ts +30 -24
  108. package/dist/tools/search-codebase.js +13 -10
  109. package/dist/tools/server-status.d.ts +116 -24
  110. package/dist/tools/server-status.js +85 -26
  111. package/dist/tools/suggest-improvements.d.ts +22 -19
  112. package/dist/tools/suggest-improvements.js +21 -17
  113. package/dist/tools/trace-output-flow.d.ts +32 -25
  114. package/dist/tools/trace-output-flow.js +24 -21
  115. package/dist/tools/transform-code.d.ts +71 -10
  116. package/dist/tools/transform-code.js +60 -42
  117. package/dist/tools/validate-before-transform.d.ts +24 -9
  118. package/dist/tools/validate-before-transform.js +10 -7
  119. package/dist/tools/validate-project-compatibility.d.ts +18 -13
  120. package/dist/tools/validate-project-compatibility.js +17 -11
  121. package/dist/tools/validate-transformation.d.ts +28 -11
  122. package/dist/tools/validate-transformation.js +14 -8
  123. package/dist/tools/verify-citations.d.ts +37 -16
  124. package/dist/tools/verify-citations.js +19 -16
  125. package/dist/types.d.ts +40 -10
  126. package/dist/types.js +0 -5
  127. package/package.json +12 -18
  128. package/dist/tools/shared/scan-types.d.ts +0 -200
  129. package/dist/tools/shared/scan-types.js +0 -7
@@ -1,27 +1,9 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Parse Stack Trace Tool
3
- *
4
- * MCP tool for parsing Node.js/Angular/Zone.js/browser stack traces into structured frames.
5
- * Maps each frame to its source file and classifies it as a project file or external dependency.
6
- *
7
- * @remarks
8
- * Use this as the first step in bug investigation when a stack trace is available.
9
- * The structured output can be fed directly into `find-usages` or `get-call-graph`
10
- * to trace the root cause of an error.
11
- *
12
- * @example
13
- * ```typescript
14
- * // Via MCP:
15
- * // tool: parse-stack-trace
16
- * // args: { stackTrace: error.stack, projectRoot: '/my/project/src' }
17
- * ```
18
- */
19
1
  import { type MCPTool, type ToolAnnotations } from '../types.js';
20
2
  import { type StackFrame, type StackFrameFileIndex } from '@angular-modernizer/api';
21
3
  /**
22
4
  * Output of the parse-stack-trace tool.
23
5
  */
24
- interface ParseStackTraceOutput {
6
+ export interface ParseStackTraceOutput {
25
7
  /** All parsed frames (or only project frames when `projectFramesOnly` is true). */
26
8
  frames: StackFrame[];
27
9
  /** Number of frames that belong to the project. */
@@ -32,7 +14,20 @@ interface ParseStackTraceOutput {
32
14
  summary: string;
33
15
  }
34
16
  /**
35
- * MCP tool that parses stack traces into structured, LLM-consumable frames.
17
+ * MCP tool for parsing Node.js/Angular/Zone.js/browser stack traces into structured frames.
18
+ * Maps each frame to its source file and classifies it as a project file or external dependency.
19
+ *
20
+ * @remarks
21
+ * Use this as the first step in bug investigation when a stack trace is available.
22
+ * The structured output can be fed directly into `find-usages` or `get-call-graph`
23
+ * to trace the root cause of an error.
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * // Via MCP:
28
+ * // tool: parse-stack-trace
29
+ * // args: { stackTrace: error.stack, projectRoot: '/my/project/src' }
30
+ * ```
36
31
  */
37
32
  export declare class ParseStackTraceTool implements MCPTool {
38
33
  private readonly createFileIndex;
@@ -41,6 +36,10 @@ export declare class ParseStackTraceTool implements MCPTool {
41
36
  readonly annotations: ToolAnnotations;
42
37
  constructor(createFileIndex?: (projectRoot: string) => StackFrameFileIndex);
43
38
  readonly description: string;
39
+ /**
40
+ * JSON Schema of the tool arguments.
41
+ * @hidden
42
+ */
44
43
  readonly inputSchema: {
45
44
  type: string;
46
45
  additionalProperties: boolean;
@@ -61,6 +60,10 @@ export declare class ParseStackTraceTool implements MCPTool {
61
60
  };
62
61
  required: string[];
63
62
  };
63
+ /**
64
+ * JSON Schema of the tool result (`structuredContent`).
65
+ * @hidden
66
+ */
64
67
  readonly outputSchema: {
65
68
  type: string;
66
69
  properties: {
@@ -116,5 +119,4 @@ export declare class ParseStackTraceTool implements MCPTool {
116
119
  execute(args: Record<string, unknown>): Promise<ParseStackTraceOutput>;
117
120
  private buildSummary;
118
121
  }
119
- export {};
120
122
  //# sourceMappingURL=parse-stack-trace.d.ts.map
@@ -1,6 +1,6 @@
1
+ import { StackTraceParser, } from '@angular-modernizer/api';
2
+ import { createNodeStackFrameFileIndex } from './helpers/stack-frame-file-index.js';
1
3
  /**
2
- * @angular-modernizer/adapter-mcp - Parse Stack Trace Tool
3
- *
4
4
  * MCP tool for parsing Node.js/Angular/Zone.js/browser stack traces into structured frames.
5
5
  * Maps each frame to its source file and classifies it as a project file or external dependency.
6
6
  *
@@ -16,11 +16,6 @@
16
16
  * // args: { stackTrace: error.stack, projectRoot: '/my/project/src' }
17
17
  * ```
18
18
  */
19
- import { StackTraceParser, } from '@angular-modernizer/api';
20
- import { createNodeStackFrameFileIndex } from './helpers/stack-frame-file-index.js';
21
- /**
22
- * MCP tool that parses stack traces into structured, LLM-consumable frames.
23
- */
24
19
  export class ParseStackTraceTool {
25
20
  createFileIndex;
26
21
  name = 'parse-stack-trace';
@@ -40,6 +35,10 @@ export class ParseStackTraceTool {
40
35
  'Browser frames (http://host/src/..., webpack:///, ng:///, bare file names) are mapped ' +
41
36
  'onto project files via resolvedFile; an ambiguous file name lists candidates. ' +
42
37
  'Use as the first step in bug investigation when a stack trace is available.';
38
+ /**
39
+ * JSON Schema of the tool arguments.
40
+ * @hidden
41
+ */
43
42
  inputSchema = {
44
43
  type: 'object',
45
44
  additionalProperties: false,
@@ -60,6 +59,10 @@ export class ParseStackTraceTool {
60
59
  },
61
60
  required: ['stackTrace', 'projectRoot'],
62
61
  };
62
+ /**
63
+ * JSON Schema of the tool result (`structuredContent`).
64
+ * @hidden
65
+ */
63
66
  outputSchema = {
64
67
  type: 'object',
65
68
  properties: {
@@ -1,43 +1,34 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Plan Migration Tool
3
- *
4
- * MCP tool for creating optimal migration strategies based on
5
- * detected architectural issues, SOLID principle violations,
6
- * and codebase style conventions. Integrates with the self-learning
7
- * pattern infrastructure for style-aware migration planning.
8
- *
9
- * Enhancement: Style-aware migration planning that respects
10
- * existing codebase conventions (RxJS patterns, DI style, etc.)
11
- *
12
- * Scan-based planning: when violations carry `filePath` (inline or from a
13
- * saved scan-architecture result via `scanResultFile`) and `projectRoot` is
14
- * set, the roadmap is built from the files themselves: grouped per file and
15
- * layer, ordered dependencies first along the import graph, import cycles
16
- * kept together (core `buildViolationPlan`). Otherwise the strategy templates
17
- * decide the roadmap as before.
18
- */
19
1
  import { type MCPTool, type ToolAnnotations } from '../types.js';
20
2
  import { type ProjectCache } from './helpers/project-cache.js';
21
3
  import type { PlannedFile, PlannedPhase, ViolationPlan } from '@angular-modernizer/core';
22
4
  /**
23
5
  * Style-aware risk assessment result
24
6
  */
25
- interface StyleAwareRiskAssessment {
7
+ export interface StyleAwareRiskAssessment {
8
+ /** Overall risk from 0 to 100: base risk, style deviation and team context. */
26
9
  overallRisk: number;
10
+ /** Risk level of `overallRisk`: below 30 low, below 50 medium, below 70 high, else critical. */
27
11
  riskLevel: 'low' | 'medium' | 'high' | 'critical';
12
+ /** Average deviation of the steps from the codebase style, 0 to 100. */
28
13
  styleDeviationScore: number;
14
+ /** Recommendations to keep the codebase style. */
29
15
  styleRecommendations: string[];
16
+ /** Measures that lower the risk. */
30
17
  mitigations: {
18
+ /** Area of the mitigation, e.g. `style` or `technical`. */
31
19
  category: string;
20
+ /** What to do. */
32
21
  description: string;
22
+ /** Expected risk reduction in points. */
33
23
  riskReduction: number;
24
+ /** Effort of the mitigation. */
34
25
  effort: 'low' | 'medium' | 'high';
35
26
  }[];
36
27
  }
37
28
  /**
38
29
  * Migration step definition.
39
30
  */
40
- interface MigrationStep {
31
+ export interface MigrationStep {
41
32
  /**
42
33
  * Step name.
43
34
  */
@@ -62,7 +53,7 @@ interface MigrationStep {
62
53
  /**
63
54
  * Migration strategy definition.
64
55
  */
65
- interface MigrationStrategy {
56
+ export interface MigrationStrategy {
66
57
  /**
67
58
  * Strategy ID.
68
59
  */
@@ -111,7 +102,7 @@ interface MigrationStrategy {
111
102
  /**
112
103
  * Plan migration tool result.
113
104
  */
114
- interface PlanMigrationResult {
105
+ export interface PlanMigrationResult {
115
106
  /**
116
107
  * Recommended migration strategy.
117
108
  */
@@ -124,21 +115,31 @@ interface PlanMigrationResult {
124
115
  * Strategy selection reasoning.
125
116
  */
126
117
  reasoning: {
118
+ /** Main factors behind the choice. */
127
119
  primaryFactors: string[];
120
+ /** How the constraints influenced the choice. */
128
121
  constraintImpact: string[];
122
+ /** Risk assessment of the choice. */
129
123
  riskAssessment: string;
130
124
  };
131
125
  /**
132
126
  * Implementation roadmap.
133
127
  */
134
128
  roadmap: {
129
+ /** Roadmap stages in execution order. */
135
130
  phases: {
131
+ /** Stage name. */
136
132
  name: string;
133
+ /** Estimated duration as text. */
137
134
  duration: string;
135
+ /** Steps of the stage. */
138
136
  steps: MigrationStep[];
137
+ /** Results of the stage. */
139
138
  deliverables: string[];
140
139
  }[];
140
+ /** Estimated total duration as text. */
141
141
  totalDuration: string;
142
+ /** Milestones of the roadmap. */
142
143
  milestones: string[];
143
144
  };
144
145
  /**
@@ -166,18 +167,26 @@ interface PlanMigrationResult {
166
167
  * Steps that conflict with codebase style conventions.
167
168
  */
168
169
  styleConflictingSteps?: {
170
+ /** Name of the conflicting step. */
169
171
  stepName: string;
172
+ /** Why the step conflicts with the codebase style. */
170
173
  conflictReason: string;
174
+ /** How to keep the style. */
171
175
  styleRecommendation: string;
172
176
  }[];
173
177
  /**
174
178
  * Style preservation recommendations.
175
179
  */
176
180
  styleRecommendations?: {
181
+ /** Style area. */
177
182
  category: 'rxjs' | 'di' | 'state-management' | 'naming' | 'architecture';
183
+ /** Current style of the codebase. */
178
184
  currentStyle: string;
185
+ /** Recommendation. */
179
186
  recommendation: string;
187
+ /** Why the recommendation applies. */
180
188
  reasoning: string;
189
+ /** Names of the affected steps. */
181
190
  affectedSteps: string[];
182
191
  }[];
183
192
  /**
@@ -188,9 +197,13 @@ interface PlanMigrationResult {
188
197
  * Migration steps with style alignment scores.
189
198
  */
190
199
  stepsWithStyleAnalysis?: {
200
+ /** The analyzed step. */
191
201
  step: MigrationStep;
202
+ /** Style alignment score of the step. */
192
203
  styleAlignmentScore: number;
204
+ /** `true` when the score reaches `styleAlignmentThreshold`. */
193
205
  alignsWithStyle: boolean;
206
+ /** Style problems of the step. */
194
207
  styleWarnings: string[];
195
208
  }[];
196
209
  /**
@@ -206,24 +219,44 @@ interface PlanMigrationResult {
206
219
  /**
207
220
  * File-level plan in the tool output.
208
221
  */
209
- interface ScanPlanOutput {
222
+ export interface ScanPlanOutput {
223
+ /** Short text of the file-level plan. */
210
224
  summary: string;
211
225
  /** List cap in effect (files per phase, violations per file); absent with summaryOnly. */
212
226
  maxResults?: number;
227
+ /** Where the layers came from: `layersSource`, `layers` or none. */
213
228
  layerSource: 'layersSource' | 'layers' | 'none';
229
+ /** Files of the import graph (size of the analyzed program). */
214
230
  graphFiles: number;
231
+ /** Plan statistics from core `buildViolationPlan`. */
215
232
  stats: ViolationPlan['stats'];
233
+ /** Import cycles kept together in the plan. */
216
234
  cycles: ViolationPlan['cycles'];
235
+ /** Plan phases, one per dependency level, dependencies first. */
217
236
  phases: (Omit<PlannedPhase, 'files'> & {
237
+ /** Files of the phase, cut to `maxResults`; absent with summaryOnly. */
218
238
  files?: (PlannedFile & {
239
+ /** `true` when `maxResults` cut the violations of the file. */
219
240
  violationsTruncated?: boolean;
220
241
  })[];
242
+ /** `true` when `maxResults` cut the file list. */
221
243
  truncated?: boolean;
222
244
  })[];
245
+ /** Problems while building the plan, e.g. violation files outside the TypeScript program. */
223
246
  warnings: string[];
224
247
  }
225
248
  /**
226
- * MCP tool for planning migrations.
249
+ * MCP tool `plan-migration`: builds a migration strategy and roadmap from
250
+ * detected architecture and SOLID violations and, with a style profile from
251
+ * learn-patterns, from the codebase conventions (RxJS patterns, DI style).
252
+ *
253
+ * @remarks
254
+ * Scan-based planning: when violations carry `filePath` (inline or from a
255
+ * saved scan-architecture result via `scanResultFile`) and `projectRoot` is
256
+ * set, the roadmap is built from the files themselves: grouped per file and
257
+ * layer, ordered dependencies first along the import graph, import cycles
258
+ * kept together (core `buildViolationPlan`, `planSource: 'scan'`). Otherwise
259
+ * the strategy templates decide the roadmap (`planSource: 'template'`).
227
260
  */
228
261
  export declare class PlanMigrationTool implements MCPTool {
229
262
  private readonly projects?;
@@ -236,6 +269,10 @@ export declare class PlanMigrationTool implements MCPTool {
236
269
  title: string;
237
270
  annotations: ToolAnnotations;
238
271
  description: string;
272
+ /**
273
+ * JSON Schema of the tool arguments.
274
+ * @hidden
275
+ */
239
276
  inputSchema: {
240
277
  type: string;
241
278
  additionalProperties: boolean;
@@ -432,6 +469,10 @@ export declare class PlanMigrationTool implements MCPTool {
432
469
  };
433
470
  required: never[];
434
471
  };
472
+ /**
473
+ * JSON Schema of the tool result (`structuredContent`).
474
+ * @hidden
475
+ */
435
476
  outputSchema: {
436
477
  type: string;
437
478
  properties: {
@@ -801,5 +842,4 @@ export declare class PlanMigrationTool implements MCPTool {
801
842
  */
802
843
  private generateSuccessMetrics;
803
844
  }
804
- export {};
805
845
  //# sourceMappingURL=plan-migration.d.ts.map
@@ -1,21 +1,3 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Plan Migration Tool
3
- *
4
- * MCP tool for creating optimal migration strategies based on
5
- * detected architectural issues, SOLID principle violations,
6
- * and codebase style conventions. Integrates with the self-learning
7
- * pattern infrastructure for style-aware migration planning.
8
- *
9
- * Enhancement: Style-aware migration planning that respects
10
- * existing codebase conventions (RxJS patterns, DI style, etc.)
11
- *
12
- * Scan-based planning: when violations carry `filePath` (inline or from a
13
- * saved scan-architecture result via `scanResultFile`) and `projectRoot` is
14
- * set, the roadmap is built from the files themselves: grouped per file and
15
- * layer, ordered dependencies first along the import graph, import cycles
16
- * kept together (core `buildViolationPlan`). Otherwise the strategy templates
17
- * decide the roadmap as before.
18
- */
19
1
  import { isAbsolute, resolve } from 'node:path';
20
2
  import { nameList } from './helpers/analysis-output.js';
21
3
  import { STRING_ARRAY } from './helpers/investigation-schemas.js';
@@ -94,7 +76,17 @@ function describePlan(plan) {
94
76
  return lines.join('\n');
95
77
  }
96
78
  /**
97
- * MCP tool for planning migrations.
79
+ * MCP tool `plan-migration`: builds a migration strategy and roadmap from
80
+ * detected architecture and SOLID violations and, with a style profile from
81
+ * learn-patterns, from the codebase conventions (RxJS patterns, DI style).
82
+ *
83
+ * @remarks
84
+ * Scan-based planning: when violations carry `filePath` (inline or from a
85
+ * saved scan-architecture result via `scanResultFile`) and `projectRoot` is
86
+ * set, the roadmap is built from the files themselves: grouped per file and
87
+ * layer, ordered dependencies first along the import graph, import cycles
88
+ * kept together (core `buildViolationPlan`, `planSource: 'scan'`). Otherwise
89
+ * the strategy templates decide the roadmap (`planSource: 'template'`).
98
90
  */
99
91
  export class PlanMigrationTool {
100
92
  projects;
@@ -118,6 +110,10 @@ export class PlanMigrationTool {
118
110
  'scanResultFile) the roadmap names concrete files: grouped per file and layer, ordered dependencies ' +
119
111
  'first along the import graph, import cycles kept together (planSource "scan"). Without file paths ' +
120
112
  'the strategy templates decide the roadmap (planSource "template"). summary is a short text of strategy and roadmap.';
113
+ /**
114
+ * JSON Schema of the tool arguments.
115
+ * @hidden
116
+ */
121
117
  inputSchema = {
122
118
  type: 'object',
123
119
  additionalProperties: false,
@@ -280,6 +276,10 @@ export class PlanMigrationTool {
280
276
  // (scanResultFile or violations with filePath); checked in execute()
281
277
  required: [],
282
278
  };
279
+ /**
280
+ * JSON Schema of the tool result (`structuredContent`).
281
+ * @hidden
282
+ */
283
283
  outputSchema = {
284
284
  type: 'object',
285
285
  properties: {
@@ -1,12 +1,13 @@
1
+ import { type MCPTool, type ToolAnnotations } from '../types.js';
2
+ import { type ResolvedTypeInfo } from '@angular-modernizer/api';
3
+ import { ProjectCache } from './helpers/project-cache.js';
1
4
  /**
2
- * @angular-modernizer/adapter-mcp - Resolve Type Tool
3
- *
4
5
  * MCP tool for resolving the TypeScript type at a given source position.
5
6
  * Returns the type string, nullability, async status, and declaration origin.
6
7
  *
7
8
  * @remarks
8
9
  * Use during bug investigation to understand what type a variable or expression
9
- * holds at a specific line/column — especially useful for tracking down
10
+ * holds at a specific line/column - especially useful for tracking down
10
11
  * null-reference errors or incorrect generic type assumptions.
11
12
  *
12
13
  * @example
@@ -16,12 +17,6 @@
16
17
  * // args: { file: '/project/src/app/user.service.ts', line: 42, column: 15, projectRoot: '/project' }
17
18
  * ```
18
19
  */
19
- import { type MCPTool, type ToolAnnotations } from '../types.js';
20
- import { type ResolvedTypeInfo } from '@angular-modernizer/api';
21
- import { ProjectCache } from './helpers/project-cache.js';
22
- /**
23
- * MCP tool that resolves the TypeScript type at a given source position.
24
- */
25
20
  export declare class ResolveTypeTool implements MCPTool {
26
21
  private readonly projects;
27
22
  readonly name = "resolve-type";
@@ -29,6 +24,10 @@ export declare class ResolveTypeTool implements MCPTool {
29
24
  readonly annotations: ToolAnnotations;
30
25
  constructor(projects?: ProjectCache);
31
26
  readonly description: string;
27
+ /**
28
+ * JSON Schema of the tool arguments.
29
+ * @hidden
30
+ */
32
31
  readonly inputSchema: {
33
32
  type: string;
34
33
  additionalProperties: boolean;
@@ -52,6 +51,10 @@ export declare class ResolveTypeTool implements MCPTool {
52
51
  };
53
52
  required: string[];
54
53
  };
54
+ /**
55
+ * JSON Schema of the tool result (`structuredContent`).
56
+ * @hidden
57
+ */
55
58
  readonly outputSchema: {
56
59
  type: string;
57
60
  properties: {
@@ -86,8 +89,15 @@ export declare class ResolveTypeTool implements MCPTool {
86
89
  };
87
90
  required: string[];
88
91
  };
92
+ /**
93
+ * Resolves the type at `file`, `line` and `column`.
94
+ * @param args - Tool arguments validated against the input schema
95
+ * @returns The resolved type with a text summary
96
+ */
89
97
  execute(args: Record<string, unknown>): Promise<ResolvedTypeInfo & {
98
+ /** Short text summary of the resolved type. */
90
99
  summary: string;
100
+ /** Conditions that can make the result incomplete (unresolved library imports). */
91
101
  warnings?: string[];
92
102
  }>;
93
103
  private buildSummary;
@@ -1,12 +1,15 @@
1
+ import { TypeResolver } from '@angular-modernizer/api';
2
+ import { existsSync } from 'node:fs';
3
+ import { findTsConfig } from './helpers/find-ts-config.js';
4
+ import { ProjectCache } from './helpers/project-cache.js';
5
+ import { WARNINGS_OUTPUT_SCHEMA, withWarnings, } from './helpers/output-contract.js';
1
6
  /**
2
- * @angular-modernizer/adapter-mcp - Resolve Type Tool
3
- *
4
7
  * MCP tool for resolving the TypeScript type at a given source position.
5
8
  * Returns the type string, nullability, async status, and declaration origin.
6
9
  *
7
10
  * @remarks
8
11
  * Use during bug investigation to understand what type a variable or expression
9
- * holds at a specific line/column — especially useful for tracking down
12
+ * holds at a specific line/column - especially useful for tracking down
10
13
  * null-reference errors or incorrect generic type assumptions.
11
14
  *
12
15
  * @example
@@ -16,14 +19,6 @@
16
19
  * // args: { file: '/project/src/app/user.service.ts', line: 42, column: 15, projectRoot: '/project' }
17
20
  * ```
18
21
  */
19
- import { TypeResolver } from '@angular-modernizer/api';
20
- import { existsSync } from 'node:fs';
21
- import { findTsConfig } from './helpers/find-ts-config.js';
22
- import { ProjectCache } from './helpers/project-cache.js';
23
- import { WARNINGS_OUTPUT_SCHEMA, withWarnings, } from './helpers/output-contract.js';
24
- /**
25
- * MCP tool that resolves the TypeScript type at a given source position.
26
- */
27
22
  export class ResolveTypeTool {
28
23
  projects;
29
24
  name = 'resolve-type';
@@ -41,6 +36,10 @@ export class ResolveTypeTool {
41
36
  'Returns the full type string, nullability, whether it is async (Promise/Observable), ' +
42
37
  'and where the type is declared. Use during bug investigation to trace type mismatches ' +
43
38
  'and null-reference errors.';
39
+ /**
40
+ * JSON Schema of the tool arguments.
41
+ * @hidden
42
+ */
44
43
  inputSchema = {
45
44
  type: 'object',
46
45
  additionalProperties: false,
@@ -64,6 +63,10 @@ export class ResolveTypeTool {
64
63
  },
65
64
  required: ['file', 'line', 'column', 'projectRoot'],
66
65
  };
66
+ /**
67
+ * JSON Schema of the tool result (`structuredContent`).
68
+ * @hidden
69
+ */
67
70
  outputSchema = {
68
71
  type: 'object',
69
72
  properties: {
@@ -84,6 +87,11 @@ export class ResolveTypeTool {
84
87
  'summary',
85
88
  ],
86
89
  };
90
+ /**
91
+ * Resolves the type at `file`, `line` and `column`.
92
+ * @param args - Tool arguments validated against the input schema
93
+ * @returns The resolved type with a text summary
94
+ */
87
95
  async execute(args) {
88
96
  const params = args;
89
97
  if (!params.file) {
@@ -1,28 +1,9 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Review Feedback Tool
3
- *
4
- * MCP tool for reviewing collected feedback and extracting insights for AI learning.
5
- * Reads feedback from the user's project (`<projectRoot>/.claude-feedback`).
6
- *
7
- * Pattern Analysis:
8
- * - Success patterns: ≥3 occurrences, ≥80% success rate
9
- * - Failure patterns: ≥2 occurrences
10
- * - Quality trends: Identify degraded quality transformations
11
- * - Outlier detection: Exclude anomalous feedback from learning
12
- * - Analysis insights: kind 'analysis' records grouped by tool and category.
13
- * They use their own completeness score (tool, claimed, actual, evidence)
14
- * and never go through the duration/confidence outlier rules.
15
- *
16
- * Location Support:
17
- * - 'both' (default): the project, plus the platform store when ANGULAR_MODERNIZER_PLATFORM_ROOT is set
18
- * - Automatic session deduplication by sessionId
19
- */
20
1
  import { type MCPTool, type ToolAnnotations } from '../types.js';
21
2
  import { type AnalysisInsight } from '@angular-modernizer/core';
22
3
  /**
23
4
  * Output from review-feedback tool
24
5
  */
25
- interface ReviewFeedbackOutput {
6
+ export interface ReviewFeedbackOutput {
26
7
  /** Number of sessions analyzed */
27
8
  sessions: number;
28
9
  /** Total number of transformations analyzed */
@@ -45,7 +26,7 @@ interface ReviewFeedbackOutput {
45
26
  /**
46
27
  * Extracted feedback insight for AI learning
47
28
  */
48
- interface FeedbackInsight {
29
+ export interface FeedbackInsight {
49
30
  /** Type of insight */
50
31
  type: 'success-pattern' | 'failure-pattern' | 'quality-trend' | 'anti-pattern';
51
32
  /** Pattern description */
@@ -66,7 +47,7 @@ interface FeedbackInsight {
66
47
  /**
67
48
  * Quality warning about feedback data
68
49
  */
69
- interface QualityWarning {
50
+ export interface QualityWarning {
70
51
  /** Type of quality issue */
71
52
  type: 'low-completeness' | 'outlier' | 'validation-errors';
72
53
  /** Number of affected feedback records */
@@ -77,13 +58,32 @@ interface QualityWarning {
77
58
  message: string;
78
59
  }
79
60
  /**
80
- * Review transformation feedback and extract insights for AI learning
61
+ * MCP tool for reviewing collected feedback and extracting insights for AI learning.
62
+ * Reads feedback from the user's project (`<projectRoot>/.claude-feedback`).
63
+ *
64
+ * @remarks
65
+ * Pattern Analysis:
66
+ * - Success patterns: ≥3 occurrences, ≥80% success rate
67
+ * - Failure patterns: ≥2 occurrences
68
+ * - Quality trends: Identify degraded quality transformations
69
+ * - Outlier detection: Exclude anomalous feedback from learning
70
+ * - Analysis insights: kind 'analysis' records grouped by tool and category.
71
+ * They use their own completeness score (tool, claimed, actual, evidence)
72
+ * and never go through the duration/confidence outlier rules.
73
+ *
74
+ * Location Support:
75
+ * - 'both' (default): the project, plus the platform store when ANGULAR_MODERNIZER_PLATFORM_ROOT is set
76
+ * - Automatic session deduplication by sessionId
81
77
  */
82
78
  export declare class ReviewFeedbackTool implements MCPTool {
83
79
  name: string;
84
80
  title: string;
85
81
  annotations: ToolAnnotations;
86
82
  description: string;
83
+ /**
84
+ * JSON Schema of the tool arguments.
85
+ * @hidden
86
+ */
87
87
  inputSchema: {
88
88
  readonly type: "object";
89
89
  readonly additionalProperties: false;
@@ -138,6 +138,10 @@ export declare class ReviewFeedbackTool implements MCPTool {
138
138
  };
139
139
  readonly required: readonly ["analysisType"];
140
140
  };
141
+ /**
142
+ * JSON Schema of the tool result (`structuredContent`).
143
+ * @hidden
144
+ */
141
145
  outputSchema: {
142
146
  type: string;
143
147
  properties: {
@@ -322,5 +326,4 @@ export declare class ReviewFeedbackTool implements MCPTool {
322
326
  */
323
327
  execute(args: Record<string, unknown>): Promise<ReviewFeedbackOutput>;
324
328
  }
325
- export {};
326
329
  //# sourceMappingURL=review-feedback.d.ts.map