@angular-modernizer/adapter-mcp 0.2.0 → 1.0.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 (255) hide show
  1. package/README.md +188 -235
  2. package/dist/cli.js +77 -27
  3. package/dist/index.d.ts +11 -3
  4. package/dist/index.js +10 -2
  5. package/dist/mcp-watcher.d.ts +6 -1
  6. package/dist/mcp-watcher.js +14 -10
  7. package/dist/server/limited-stdio-transport.d.ts +68 -0
  8. package/dist/server/limited-stdio-transport.js +115 -0
  9. package/dist/server/mcp-server.d.ts +41 -12
  10. package/dist/server/mcp-server.js +113 -94
  11. package/dist/server/package-version.d.ts +16 -0
  12. package/dist/server/package-version.js +37 -0
  13. package/dist/server/sdk-server.d.ts +70 -0
  14. package/dist/server/sdk-server.js +113 -0
  15. package/dist/server/stdio-guard.d.ts +20 -0
  16. package/dist/server/stdio-guard.js +48 -0
  17. package/dist/server/tool-registry.d.ts +3 -2
  18. package/dist/server/tool-registry.js +5 -5
  19. package/dist/tools/analyze-build-impact.d.ts +346 -14
  20. package/dist/tools/analyze-build-impact.js +315 -31
  21. package/dist/tools/analyze-core-to-shared.d.ts +134 -4
  22. package/dist/tools/analyze-core-to-shared.js +113 -9
  23. package/dist/tools/analyze-parser-performance.d.ts +200 -7
  24. package/dist/tools/analyze-parser-performance.js +108 -47
  25. package/dist/tools/analyze-project.d.ts +267 -5
  26. package/dist/tools/analyze-project.js +196 -8
  27. package/dist/tools/check-incremental-compatibility.d.ts +61 -1
  28. package/dist/tools/check-incremental-compatibility.js +58 -2
  29. package/dist/tools/collect-feedback.d.ts +199 -10
  30. package/dist/tools/collect-feedback.js +171 -99
  31. package/dist/tools/compare-health.d.ts +356 -0
  32. package/dist/tools/compare-health.js +472 -0
  33. package/dist/tools/extract-libraries.d.ts +156 -4
  34. package/dist/tools/extract-libraries.js +115 -10
  35. package/dist/tools/find-angular-symbol.d.ts +98 -9
  36. package/dist/tools/find-angular-symbol.js +104 -12
  37. package/dist/tools/find-component-hosts.d.ts +684 -0
  38. package/dist/tools/find-component-hosts.js +441 -0
  39. package/dist/tools/find-usages.d.ts +99 -4
  40. package/dist/tools/find-usages.js +131 -11
  41. package/dist/tools/get-bootstrap-execution.d.ts +258 -0
  42. package/dist/tools/get-bootstrap-execution.js +324 -0
  43. package/dist/tools/get-call-graph.d.ts +139 -4
  44. package/dist/tools/get-call-graph.js +123 -13
  45. package/dist/tools/get-operation-progress-tool.d.ts +114 -2
  46. package/dist/tools/get-operation-progress-tool.js +114 -7
  47. package/dist/tools/get-operation-progress.d.ts +1 -1
  48. package/dist/tools/get-operation-progress.js +5 -5
  49. package/dist/tools/helpers/analysis-output.d.ts +177 -0
  50. package/dist/tools/helpers/analysis-output.js +165 -0
  51. package/dist/tools/helpers/build-schemas.d.ts +36 -0
  52. package/dist/tools/helpers/build-schemas.js +23 -0
  53. package/dist/tools/helpers/citation-file-source.d.ts +10 -0
  54. package/dist/tools/helpers/citation-file-source.js +82 -0
  55. package/dist/tools/helpers/compact-output.d.ts +61 -0
  56. package/dist/tools/helpers/compact-output.js +83 -0
  57. package/dist/tools/helpers/finding-window.d.ts +43 -0
  58. package/dist/tools/helpers/finding-window.js +64 -0
  59. package/dist/tools/helpers/health-delta.d.ts +86 -0
  60. package/dist/tools/helpers/health-delta.js +239 -0
  61. package/dist/tools/helpers/investigation-schemas.d.ts +93 -0
  62. package/dist/tools/helpers/investigation-schemas.js +48 -0
  63. package/dist/tools/helpers/library-imports.d.ts +57 -0
  64. package/dist/tools/helpers/library-imports.js +151 -0
  65. package/dist/tools/helpers/load-source-files.d.ts +30 -0
  66. package/dist/tools/helpers/load-source-files.js +34 -0
  67. package/dist/tools/helpers/output-contract.d.ts +32 -0
  68. package/dist/tools/helpers/output-contract.js +32 -0
  69. package/dist/tools/helpers/platform-root-resolver.d.ts +55 -25
  70. package/dist/tools/helpers/platform-root-resolver.js +75 -48
  71. package/dist/tools/helpers/process-output.d.ts +19 -0
  72. package/dist/tools/helpers/process-output.js +31 -0
  73. package/dist/tools/helpers/project-cache.d.ts +184 -0
  74. package/dist/tools/helpers/project-cache.js +331 -0
  75. package/dist/tools/helpers/project-decorators.d.ts +14 -0
  76. package/dist/tools/helpers/project-decorators.js +22 -0
  77. package/dist/tools/helpers/rule-matcher.js +5 -0
  78. package/dist/tools/helpers/rule-runner.d.ts +72 -0
  79. package/dist/tools/helpers/rule-runner.js +131 -0
  80. package/dist/tools/helpers/scan-cache.d.ts +22 -0
  81. package/dist/tools/helpers/scan-cache.js +34 -0
  82. package/dist/tools/helpers/scan-plan.d.ts +48 -0
  83. package/dist/tools/helpers/scan-plan.js +166 -0
  84. package/dist/tools/helpers/scope-paths.d.ts +17 -0
  85. package/dist/tools/helpers/scope-paths.js +32 -0
  86. package/dist/tools/helpers/stack-frame-file-index.d.ts +10 -0
  87. package/dist/tools/helpers/stack-frame-file-index.js +71 -0
  88. package/dist/tools/helpers/tool-context.d.ts +60 -0
  89. package/dist/tools/helpers/tool-context.js +82 -0
  90. package/dist/tools/helpers/transform-safety.d.ts +40 -0
  91. package/dist/tools/helpers/transform-safety.js +87 -0
  92. package/dist/tools/helpers/validation-output.d.ts +53 -0
  93. package/dist/tools/helpers/validation-output.js +48 -0
  94. package/dist/tools/inspect-form-group.d.ts +324 -0
  95. package/dist/tools/inspect-form-group.js +279 -0
  96. package/dist/tools/inspect-i18n.d.ts +466 -0
  97. package/dist/tools/inspect-i18n.js +400 -0
  98. package/dist/tools/inspect-template.d.ts +320 -0
  99. package/dist/tools/inspect-template.js +324 -0
  100. package/dist/tools/learn-patterns.d.ts +122 -1
  101. package/dist/tools/learn-patterns.js +97 -2
  102. package/dist/tools/list-imports.d.ts +128 -11
  103. package/dist/tools/list-imports.js +128 -8
  104. package/dist/tools/orchestrate-migration.d.ts +129 -5
  105. package/dist/tools/orchestrate-migration.js +166 -12
  106. package/dist/tools/parse-stack-trace.d.ts +59 -2
  107. package/dist/tools/parse-stack-trace.js +52 -4
  108. package/dist/tools/plan-migration.d.ts +418 -1
  109. package/dist/tools/plan-migration.js +355 -8
  110. package/dist/tools/resolve-type.d.ts +42 -1
  111. package/dist/tools/resolve-type.js +37 -4
  112. package/dist/tools/review-feedback.d.ts +206 -11
  113. package/dist/tools/review-feedback.js +132 -51
  114. package/dist/tools/rollback-changes.d.ts +79 -2
  115. package/dist/tools/rollback-changes.js +66 -14
  116. package/dist/tools/run-angular-cli.d.ts +45 -2
  117. package/dist/tools/run-angular-cli.js +67 -7
  118. package/dist/tools/run-build.d.ts +114 -2
  119. package/dist/tools/run-build.js +117 -8
  120. package/dist/tools/run-schematic.d.ts +70 -2
  121. package/dist/tools/run-schematic.js +104 -10
  122. package/dist/tools/scan-all.d.ts +24 -16
  123. package/dist/tools/scan-all.js +145 -137
  124. package/dist/tools/scan-angular.d.ts +20 -11
  125. package/dist/tools/scan-angular.js +52 -24
  126. package/dist/tools/scan-architecture.d.ts +42 -14
  127. package/dist/tools/scan-architecture.js +206 -163
  128. package/dist/tools/scan-solid.d.ts +20 -11
  129. package/dist/tools/scan-solid.js +52 -24
  130. package/dist/tools/search-codebase.d.ts +85 -1
  131. package/dist/tools/search-codebase.js +61 -4
  132. package/dist/tools/server-status.d.ts +370 -0
  133. package/dist/tools/server-status.js +369 -0
  134. package/dist/tools/suggest-improvements.d.ts +97 -5
  135. package/dist/tools/suggest-improvements.js +80 -44
  136. package/dist/tools/trace-output-flow.d.ts +791 -0
  137. package/dist/tools/trace-output-flow.js +668 -0
  138. package/dist/tools/transform-code-batch.d.ts +3 -0
  139. package/dist/tools/transform-code-batch.js +10 -5
  140. package/dist/tools/transform-code.d.ts +335 -12
  141. package/dist/tools/transform-code.js +649 -608
  142. package/dist/tools/validate-before-transform.d.ts +116 -2
  143. package/dist/tools/validate-before-transform.js +55 -2
  144. package/dist/tools/validate-project-compatibility.d.ts +64 -2
  145. package/dist/tools/validate-project-compatibility.js +67 -4
  146. package/dist/tools/validate-transformation.d.ts +220 -2
  147. package/dist/tools/validate-transformation.js +113 -15
  148. package/dist/tools/verify-citations.d.ts +181 -0
  149. package/dist/tools/verify-citations.js +218 -0
  150. package/dist/types.d.ts +45 -1
  151. package/dist/utils/format-tool-response.d.ts +22 -59
  152. package/dist/utils/format-tool-response.js +25 -134
  153. package/package.json +30 -13
  154. package/dist/cli.d.ts.map +0 -1
  155. package/dist/cli.js.map +0 -1
  156. package/dist/core/project-analyzer.d.ts.map +0 -1
  157. package/dist/core/project-analyzer.js.map +0 -1
  158. package/dist/index.d.ts.map +0 -1
  159. package/dist/index.js.map +0 -1
  160. package/dist/mcp-watcher.d.ts.map +0 -1
  161. package/dist/mcp-watcher.js.map +0 -1
  162. package/dist/server/json-rpc-handler.d.ts +0 -57
  163. package/dist/server/json-rpc-handler.d.ts.map +0 -1
  164. package/dist/server/json-rpc-handler.js +0 -222
  165. package/dist/server/json-rpc-handler.js.map +0 -1
  166. package/dist/server/mcp-server.d.ts.map +0 -1
  167. package/dist/server/mcp-server.js.map +0 -1
  168. package/dist/server/tool-registry.d.ts.map +0 -1
  169. package/dist/server/tool-registry.js.map +0 -1
  170. package/dist/streaming/progress-store.d.ts.map +0 -1
  171. package/dist/streaming/progress-store.js.map +0 -1
  172. package/dist/tools/analyze-build-impact.d.ts.map +0 -1
  173. package/dist/tools/analyze-build-impact.js.map +0 -1
  174. package/dist/tools/analyze-core-to-shared.d.ts.map +0 -1
  175. package/dist/tools/analyze-core-to-shared.js.map +0 -1
  176. package/dist/tools/analyze-parser-performance.d.ts.map +0 -1
  177. package/dist/tools/analyze-parser-performance.js.map +0 -1
  178. package/dist/tools/analyze-project.d.ts.map +0 -1
  179. package/dist/tools/analyze-project.js.map +0 -1
  180. package/dist/tools/check-incremental-compatibility.d.ts.map +0 -1
  181. package/dist/tools/check-incremental-compatibility.js.map +0 -1
  182. package/dist/tools/collect-feedback.d.ts.map +0 -1
  183. package/dist/tools/collect-feedback.js.map +0 -1
  184. package/dist/tools/extract-libraries.d.ts.map +0 -1
  185. package/dist/tools/extract-libraries.js.map +0 -1
  186. package/dist/tools/find-angular-symbol.d.ts.map +0 -1
  187. package/dist/tools/find-angular-symbol.js.map +0 -1
  188. package/dist/tools/find-usages.d.ts.map +0 -1
  189. package/dist/tools/find-usages.js.map +0 -1
  190. package/dist/tools/get-call-graph.d.ts.map +0 -1
  191. package/dist/tools/get-call-graph.js.map +0 -1
  192. package/dist/tools/get-operation-progress-tool.d.ts.map +0 -1
  193. package/dist/tools/get-operation-progress-tool.js.map +0 -1
  194. package/dist/tools/get-operation-progress.d.ts.map +0 -1
  195. package/dist/tools/get-operation-progress.js.map +0 -1
  196. package/dist/tools/helpers/feedback-analyzer.d.ts.map +0 -1
  197. package/dist/tools/helpers/feedback-analyzer.js.map +0 -1
  198. package/dist/tools/helpers/find-ts-config.d.ts.map +0 -1
  199. package/dist/tools/helpers/find-ts-config.js.map +0 -1
  200. package/dist/tools/helpers/platform-root-resolver.d.ts.map +0 -1
  201. package/dist/tools/helpers/platform-root-resolver.js.map +0 -1
  202. package/dist/tools/helpers/rule-matcher.d.ts.map +0 -1
  203. package/dist/tools/helpers/rule-matcher.js.map +0 -1
  204. package/dist/tools/helpers/suggestion-generator.d.ts.map +0 -1
  205. package/dist/tools/helpers/suggestion-generator.js.map +0 -1
  206. package/dist/tools/learn-patterns.d.ts.map +0 -1
  207. package/dist/tools/learn-patterns.js.map +0 -1
  208. package/dist/tools/list-imports.d.ts.map +0 -1
  209. package/dist/tools/list-imports.js.map +0 -1
  210. package/dist/tools/orchestrate-migration.d.ts.map +0 -1
  211. package/dist/tools/orchestrate-migration.js.map +0 -1
  212. package/dist/tools/parse-stack-trace.d.ts.map +0 -1
  213. package/dist/tools/parse-stack-trace.js.map +0 -1
  214. package/dist/tools/plan-migration.d.ts.map +0 -1
  215. package/dist/tools/plan-migration.js.map +0 -1
  216. package/dist/tools/resolve-type.d.ts.map +0 -1
  217. package/dist/tools/resolve-type.js.map +0 -1
  218. package/dist/tools/review-feedback.d.ts.map +0 -1
  219. package/dist/tools/review-feedback.js.map +0 -1
  220. package/dist/tools/rollback-changes.d.ts.map +0 -1
  221. package/dist/tools/rollback-changes.js.map +0 -1
  222. package/dist/tools/run-angular-cli.d.ts.map +0 -1
  223. package/dist/tools/run-angular-cli.js.map +0 -1
  224. package/dist/tools/run-build.d.ts.map +0 -1
  225. package/dist/tools/run-build.js.map +0 -1
  226. package/dist/tools/run-schematic.d.ts.map +0 -1
  227. package/dist/tools/run-schematic.js.map +0 -1
  228. package/dist/tools/scan-all.d.ts.map +0 -1
  229. package/dist/tools/scan-all.js.map +0 -1
  230. package/dist/tools/scan-angular.d.ts.map +0 -1
  231. package/dist/tools/scan-angular.js.map +0 -1
  232. package/dist/tools/scan-architecture.d.ts.map +0 -1
  233. package/dist/tools/scan-architecture.js.map +0 -1
  234. package/dist/tools/scan-solid.d.ts.map +0 -1
  235. package/dist/tools/scan-solid.js.map +0 -1
  236. package/dist/tools/search-codebase.d.ts.map +0 -1
  237. package/dist/tools/search-codebase.js.map +0 -1
  238. package/dist/tools/shared/scan-types.d.ts.map +0 -1
  239. package/dist/tools/shared/scan-types.js.map +0 -1
  240. package/dist/tools/suggest-improvements.d.ts.map +0 -1
  241. package/dist/tools/suggest-improvements.js.map +0 -1
  242. package/dist/tools/transform-code-batch.d.ts.map +0 -1
  243. package/dist/tools/transform-code-batch.js.map +0 -1
  244. package/dist/tools/transform-code.d.ts.map +0 -1
  245. package/dist/tools/transform-code.js.map +0 -1
  246. package/dist/tools/validate-before-transform.d.ts.map +0 -1
  247. package/dist/tools/validate-before-transform.js.map +0 -1
  248. package/dist/tools/validate-project-compatibility.d.ts.map +0 -1
  249. package/dist/tools/validate-project-compatibility.js.map +0 -1
  250. package/dist/tools/validate-transformation.d.ts.map +0 -1
  251. package/dist/tools/validate-transformation.js.map +0 -1
  252. package/dist/types.d.ts.map +0 -1
  253. package/dist/types.js.map +0 -1
  254. package/dist/utils/format-tool-response.d.ts.map +0 -1
  255. package/dist/utils/format-tool-response.js.map +0 -1
@@ -8,8 +8,17 @@
8
8
  *
9
9
  * Enhancement: Style-aware migration planning that respects
10
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.
11
18
  */
12
- import { type MCPTool } from '../types.js';
19
+ import { type MCPTool, type ToolAnnotations } from '../types.js';
20
+ import { type ProjectCache } from './helpers/project-cache.js';
21
+ import type { PlannedFile, PlannedPhase, ViolationPlan } from '@angular-modernizer/core';
13
22
  /**
14
23
  * Style-aware risk assessment result
15
24
  */
@@ -136,6 +145,19 @@ interface PlanMigrationResult {
136
145
  * Success metrics.
137
146
  */
138
147
  successMetrics: string[];
148
+ /**
149
+ * `scan` when the roadmap was built from file-level violations, `template`
150
+ * when it comes from the strategy templates.
151
+ */
152
+ planSource: 'scan' | 'template';
153
+ /**
154
+ * File-level plan (scan-based planning only).
155
+ */
156
+ scanPlan?: ScanPlanOutput;
157
+ /**
158
+ * Why the scan-based plan was not built although violations had files.
159
+ */
160
+ notes?: string[];
139
161
  /**
140
162
  * Style-aware risk assessment (when styleProfile is provided).
141
163
  */
@@ -171,15 +193,52 @@ interface PlanMigrationResult {
171
193
  alignsWithStyle: boolean;
172
194
  styleWarnings: string[];
173
195
  }[];
196
+ /**
197
+ * Human-readable summary for LLM consumption.
198
+ */
199
+ summary: string;
200
+ /**
201
+ * Conditions that can make the scan-based plan incomplete (unresolved
202
+ * library imports).
203
+ */
204
+ warnings?: string[];
205
+ }
206
+ /**
207
+ * File-level plan in the tool output.
208
+ */
209
+ interface ScanPlanOutput {
210
+ summary: string;
211
+ /** List cap in effect (files per phase, violations per file); absent with summaryOnly. */
212
+ maxResults?: number;
213
+ layerSource: 'layersSource' | 'layers' | 'none';
214
+ graphFiles: number;
215
+ stats: ViolationPlan['stats'];
216
+ cycles: ViolationPlan['cycles'];
217
+ phases: (Omit<PlannedPhase, 'files'> & {
218
+ files?: (PlannedFile & {
219
+ violationsTruncated?: boolean;
220
+ })[];
221
+ truncated?: boolean;
222
+ })[];
223
+ warnings: string[];
174
224
  }
175
225
  /**
176
226
  * MCP tool for planning migrations.
177
227
  */
178
228
  export declare class PlanMigrationTool implements MCPTool {
229
+ private readonly projects?;
230
+ /**
231
+ * @param projects - Shared project cache for the scan-based plan; without
232
+ * it every call parses the workspace anew.
233
+ */
234
+ constructor(projects?: ProjectCache | undefined);
179
235
  name: string;
236
+ title: string;
237
+ annotations: ToolAnnotations;
180
238
  description: string;
181
239
  inputSchema: {
182
240
  type: string;
241
+ additionalProperties: boolean;
183
242
  properties: {
184
243
  violations: {
185
244
  type: string;
@@ -197,10 +256,41 @@ export declare class PlanMigrationTool implements MCPTool {
197
256
  category: {
198
257
  type: string;
199
258
  };
259
+ filePath: {
260
+ type: string;
261
+ description: string;
262
+ };
263
+ line: {
264
+ type: string;
265
+ };
266
+ message: {
267
+ type: string;
268
+ };
200
269
  };
201
270
  required: string[];
202
271
  };
203
272
  };
273
+ projectRoot: {
274
+ type: string;
275
+ description: string;
276
+ };
277
+ scanResultFile: {
278
+ type: string;
279
+ description: string;
280
+ };
281
+ maxResults: {
282
+ type: string;
283
+ description: string;
284
+ };
285
+ maxPhases: {
286
+ type: string;
287
+ description: string;
288
+ };
289
+ summaryOnly: {
290
+ readonly type: "boolean";
291
+ readonly description: "Return counts and the text summary only, without the result list. Default: false.";
292
+ readonly default: false;
293
+ };
204
294
  architecture: {
205
295
  type: string;
206
296
  description: string;
@@ -340,9 +430,336 @@ export declare class PlanMigrationTool implements MCPTool {
340
430
  default: boolean;
341
431
  };
342
432
  };
433
+ required: never[];
434
+ };
435
+ outputSchema: {
436
+ type: string;
437
+ properties: {
438
+ warnings: {
439
+ readonly type: "array";
440
+ readonly items: {
441
+ readonly type: "string";
442
+ };
443
+ readonly description: "Conditions that can make the result incomplete, e.g. library imports that do not resolve because node_modules is missing.";
444
+ };
445
+ recommendedStrategy: {
446
+ readonly type: "object";
447
+ readonly properties: {
448
+ readonly id: {
449
+ readonly type: "string";
450
+ };
451
+ readonly name: {
452
+ readonly type: "string";
453
+ };
454
+ readonly description: {
455
+ readonly type: "string";
456
+ };
457
+ readonly applicableArchitectures: {
458
+ readonly type: "array";
459
+ readonly items: {
460
+ readonly type: "string";
461
+ };
462
+ };
463
+ readonly complexity: {
464
+ readonly type: "string";
465
+ };
466
+ readonly successRate: {
467
+ readonly type: "number";
468
+ };
469
+ readonly steps: {
470
+ readonly type: "array";
471
+ readonly items: {
472
+ readonly type: "object";
473
+ readonly properties: {
474
+ readonly name: {
475
+ readonly type: "string";
476
+ };
477
+ readonly action: {
478
+ readonly type: "string";
479
+ };
480
+ readonly validation: {
481
+ readonly type: "string";
482
+ };
483
+ readonly effort: {
484
+ readonly type: "number";
485
+ };
486
+ readonly risk: {
487
+ readonly type: "string";
488
+ };
489
+ };
490
+ readonly required: readonly ["name", "action", "validation", "effort", "risk"];
491
+ };
492
+ };
493
+ readonly prerequisites: {
494
+ readonly type: "array";
495
+ readonly items: {
496
+ readonly type: "string";
497
+ };
498
+ };
499
+ readonly risks: {
500
+ readonly type: "array";
501
+ readonly items: {
502
+ readonly type: "string";
503
+ };
504
+ };
505
+ readonly totalEffort: {
506
+ readonly type: "number";
507
+ };
508
+ readonly overallRisk: {
509
+ readonly type: "string";
510
+ };
511
+ };
512
+ readonly required: readonly ["id", "name", "complexity", "successRate", "steps", "totalEffort", "overallRisk"];
513
+ };
514
+ alternativeStrategies: {
515
+ type: string;
516
+ items: {
517
+ readonly type: "object";
518
+ readonly properties: {
519
+ readonly id: {
520
+ readonly type: "string";
521
+ };
522
+ readonly name: {
523
+ readonly type: "string";
524
+ };
525
+ readonly description: {
526
+ readonly type: "string";
527
+ };
528
+ readonly applicableArchitectures: {
529
+ readonly type: "array";
530
+ readonly items: {
531
+ readonly type: "string";
532
+ };
533
+ };
534
+ readonly complexity: {
535
+ readonly type: "string";
536
+ };
537
+ readonly successRate: {
538
+ readonly type: "number";
539
+ };
540
+ readonly steps: {
541
+ readonly type: "array";
542
+ readonly items: {
543
+ readonly type: "object";
544
+ readonly properties: {
545
+ readonly name: {
546
+ readonly type: "string";
547
+ };
548
+ readonly action: {
549
+ readonly type: "string";
550
+ };
551
+ readonly validation: {
552
+ readonly type: "string";
553
+ };
554
+ readonly effort: {
555
+ readonly type: "number";
556
+ };
557
+ readonly risk: {
558
+ readonly type: "string";
559
+ };
560
+ };
561
+ readonly required: readonly ["name", "action", "validation", "effort", "risk"];
562
+ };
563
+ };
564
+ readonly prerequisites: {
565
+ readonly type: "array";
566
+ readonly items: {
567
+ readonly type: "string";
568
+ };
569
+ };
570
+ readonly risks: {
571
+ readonly type: "array";
572
+ readonly items: {
573
+ readonly type: "string";
574
+ };
575
+ };
576
+ readonly totalEffort: {
577
+ readonly type: "number";
578
+ };
579
+ readonly overallRisk: {
580
+ readonly type: "string";
581
+ };
582
+ };
583
+ readonly required: readonly ["id", "name", "complexity", "successRate", "steps", "totalEffort", "overallRisk"];
584
+ };
585
+ };
586
+ reasoning: {
587
+ type: string;
588
+ properties: {
589
+ primaryFactors: {
590
+ readonly type: "array";
591
+ readonly items: {
592
+ readonly type: "string";
593
+ };
594
+ };
595
+ constraintImpact: {
596
+ readonly type: "array";
597
+ readonly items: {
598
+ readonly type: "string";
599
+ };
600
+ };
601
+ riskAssessment: {
602
+ type: string;
603
+ };
604
+ };
605
+ required: string[];
606
+ };
607
+ roadmap: {
608
+ type: string;
609
+ properties: {
610
+ phases: {
611
+ type: string;
612
+ items: {
613
+ type: string;
614
+ properties: {
615
+ name: {
616
+ type: string;
617
+ };
618
+ duration: {
619
+ type: string;
620
+ };
621
+ steps: {
622
+ type: string;
623
+ items: {
624
+ readonly type: "object";
625
+ readonly properties: {
626
+ readonly name: {
627
+ readonly type: "string";
628
+ };
629
+ readonly action: {
630
+ readonly type: "string";
631
+ };
632
+ readonly validation: {
633
+ readonly type: "string";
634
+ };
635
+ readonly effort: {
636
+ readonly type: "number";
637
+ };
638
+ readonly risk: {
639
+ readonly type: "string";
640
+ };
641
+ };
642
+ readonly required: readonly ["name", "action", "validation", "effort", "risk"];
643
+ };
644
+ };
645
+ deliverables: {
646
+ readonly type: "array";
647
+ readonly items: {
648
+ readonly type: "string";
649
+ };
650
+ };
651
+ };
652
+ required: string[];
653
+ };
654
+ };
655
+ totalDuration: {
656
+ type: string;
657
+ };
658
+ milestones: {
659
+ readonly type: "array";
660
+ readonly items: {
661
+ readonly type: "string";
662
+ };
663
+ };
664
+ };
665
+ required: string[];
666
+ };
667
+ successMetrics: {
668
+ readonly type: "array";
669
+ readonly items: {
670
+ readonly type: "string";
671
+ };
672
+ };
673
+ planSource: {
674
+ type: string;
675
+ enum: string[];
676
+ };
677
+ scanPlan: {
678
+ type: string;
679
+ properties: {
680
+ summary: {
681
+ type: string;
682
+ };
683
+ maxResults: {
684
+ type: string;
685
+ };
686
+ layerSource: {
687
+ type: string;
688
+ };
689
+ graphFiles: {
690
+ type: string;
691
+ };
692
+ stats: {
693
+ type: string;
694
+ };
695
+ cycles: {
696
+ type: string;
697
+ items: {
698
+ type: string;
699
+ };
700
+ };
701
+ phases: {
702
+ type: string;
703
+ items: {
704
+ type: string;
705
+ };
706
+ };
707
+ warnings: {
708
+ readonly type: "array";
709
+ readonly items: {
710
+ readonly type: "string";
711
+ };
712
+ };
713
+ };
714
+ required: string[];
715
+ };
716
+ notes: {
717
+ readonly type: "array";
718
+ readonly items: {
719
+ readonly type: "string";
720
+ };
721
+ };
722
+ styleAwareRiskAssessment: {
723
+ type: string;
724
+ };
725
+ styleConflictingSteps: {
726
+ type: string;
727
+ items: {
728
+ type: string;
729
+ };
730
+ };
731
+ styleRecommendations: {
732
+ type: string;
733
+ items: {
734
+ type: string;
735
+ };
736
+ };
737
+ styleAlignmentScore: {
738
+ type: string;
739
+ };
740
+ stepsWithStyleAnalysis: {
741
+ type: string;
742
+ items: {
743
+ type: string;
744
+ };
745
+ };
746
+ summary: {
747
+ type: string;
748
+ };
749
+ };
343
750
  required: string[];
344
751
  };
345
752
  execute(args: Record<string, unknown>): Promise<PlanMigrationResult>;
753
+ /**
754
+ * Inline violations plus the ones from scanResultFile.
755
+ */
756
+ private collectScanViolations;
757
+ private toScanPlanOutput;
758
+ /**
759
+ * Roadmap with one phase per scan-plan phase and one step per file.
760
+ */
761
+ private createScanRoadmap;
762
+ private fileToStep;
346
763
  /**
347
764
  * Analyze migration steps for style conflicts.
348
765
  */