@angular-modernizer/adapter-mcp 0.3.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 (275) hide show
  1. package/README.md +103 -218
  2. package/dist/cli.js +13 -13
  3. package/dist/index.d.ts +4 -3
  4. package/dist/index.js +3 -2
  5. package/dist/mcp-watcher.d.ts +6 -1
  6. package/dist/mcp-watcher.js +11 -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 +12 -14
  10. package/dist/server/mcp-server.js +41 -75
  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/tool-registry.d.ts +3 -2
  16. package/dist/server/tool-registry.js +5 -5
  17. package/dist/tools/analyze-build-impact.d.ts +220 -1
  18. package/dist/tools/analyze-build-impact.js +145 -3
  19. package/dist/tools/analyze-core-to-shared.d.ts +134 -4
  20. package/dist/tools/analyze-core-to-shared.js +113 -9
  21. package/dist/tools/analyze-parser-performance.d.ts +200 -7
  22. package/dist/tools/analyze-parser-performance.js +108 -47
  23. package/dist/tools/analyze-project.d.ts +267 -5
  24. package/dist/tools/analyze-project.js +196 -8
  25. package/dist/tools/check-incremental-compatibility.d.ts +61 -1
  26. package/dist/tools/check-incremental-compatibility.js +58 -2
  27. package/dist/tools/collect-feedback.d.ts +199 -10
  28. package/dist/tools/collect-feedback.js +171 -99
  29. package/dist/tools/compare-health.d.ts +356 -0
  30. package/dist/tools/compare-health.js +472 -0
  31. package/dist/tools/extract-libraries.d.ts +156 -4
  32. package/dist/tools/extract-libraries.js +115 -10
  33. package/dist/tools/find-angular-symbol.d.ts +69 -3
  34. package/dist/tools/find-angular-symbol.js +55 -8
  35. package/dist/tools/find-component-hosts.d.ts +572 -2
  36. package/dist/tools/find-component-hosts.js +207 -6
  37. package/dist/tools/find-usages.d.ts +79 -1
  38. package/dist/tools/find-usages.js +64 -7
  39. package/dist/tools/get-bootstrap-execution.d.ts +151 -1
  40. package/dist/tools/get-bootstrap-execution.js +84 -3
  41. package/dist/tools/get-call-graph.d.ts +111 -1
  42. package/dist/tools/get-call-graph.js +72 -10
  43. package/dist/tools/get-operation-progress-tool.d.ts +114 -2
  44. package/dist/tools/get-operation-progress-tool.js +114 -7
  45. package/dist/tools/get-operation-progress.d.ts +1 -1
  46. package/dist/tools/get-operation-progress.js +5 -5
  47. package/dist/tools/helpers/analysis-output.d.ts +177 -0
  48. package/dist/tools/helpers/analysis-output.js +165 -0
  49. package/dist/tools/helpers/build-schemas.d.ts +36 -0
  50. package/dist/tools/helpers/build-schemas.js +23 -0
  51. package/dist/tools/helpers/citation-file-source.d.ts +10 -0
  52. package/dist/tools/helpers/citation-file-source.js +82 -0
  53. package/dist/tools/helpers/finding-window.d.ts +43 -0
  54. package/dist/tools/helpers/finding-window.js +64 -0
  55. package/dist/tools/helpers/health-delta.d.ts +86 -0
  56. package/dist/tools/helpers/health-delta.js +239 -0
  57. package/dist/tools/helpers/investigation-schemas.d.ts +93 -0
  58. package/dist/tools/helpers/investigation-schemas.js +48 -0
  59. package/dist/tools/helpers/library-imports.d.ts +57 -0
  60. package/dist/tools/helpers/library-imports.js +151 -0
  61. package/dist/tools/helpers/load-source-files.d.ts +30 -0
  62. package/dist/tools/helpers/load-source-files.js +34 -0
  63. package/dist/tools/helpers/output-contract.d.ts +32 -0
  64. package/dist/tools/helpers/output-contract.js +32 -0
  65. package/dist/tools/helpers/platform-root-resolver.d.ts +55 -25
  66. package/dist/tools/helpers/platform-root-resolver.js +75 -48
  67. package/dist/tools/helpers/process-output.d.ts +19 -0
  68. package/dist/tools/helpers/process-output.js +31 -0
  69. package/dist/tools/helpers/project-cache.d.ts +11 -4
  70. package/dist/tools/helpers/project-cache.js +22 -4
  71. package/dist/tools/helpers/project-decorators.d.ts +14 -0
  72. package/dist/tools/helpers/project-decorators.js +22 -0
  73. package/dist/tools/helpers/rule-matcher.js +5 -0
  74. package/dist/tools/helpers/rule-runner.d.ts +9 -4
  75. package/dist/tools/helpers/rule-runner.js +28 -14
  76. package/dist/tools/helpers/scan-cache.d.ts +22 -0
  77. package/dist/tools/helpers/scan-cache.js +34 -0
  78. package/dist/tools/helpers/scan-plan.d.ts +5 -2
  79. package/dist/tools/helpers/scan-plan.js +18 -3
  80. package/dist/tools/helpers/scope-paths.d.ts +17 -0
  81. package/dist/tools/helpers/scope-paths.js +32 -0
  82. package/dist/tools/helpers/tool-context.d.ts +60 -0
  83. package/dist/tools/helpers/tool-context.js +82 -0
  84. package/dist/tools/helpers/transform-safety.d.ts +40 -0
  85. package/dist/tools/helpers/transform-safety.js +87 -0
  86. package/dist/tools/helpers/validation-output.d.ts +53 -0
  87. package/dist/tools/helpers/validation-output.js +48 -0
  88. package/dist/tools/inspect-form-group.d.ts +232 -1
  89. package/dist/tools/inspect-form-group.js +120 -2
  90. package/dist/tools/inspect-i18n.d.ts +382 -1
  91. package/dist/tools/inspect-i18n.js +199 -2
  92. package/dist/tools/inspect-template.d.ts +232 -1
  93. package/dist/tools/inspect-template.js +160 -2
  94. package/dist/tools/learn-patterns.d.ts +122 -1
  95. package/dist/tools/learn-patterns.js +97 -2
  96. package/dist/tools/list-imports.d.ts +111 -10
  97. package/dist/tools/list-imports.js +110 -7
  98. package/dist/tools/orchestrate-migration.d.ts +128 -5
  99. package/dist/tools/orchestrate-migration.js +135 -13
  100. package/dist/tools/parse-stack-trace.d.ts +56 -1
  101. package/dist/tools/parse-stack-trace.js +34 -0
  102. package/dist/tools/plan-migration.d.ts +330 -1
  103. package/dist/tools/plan-migration.js +154 -3
  104. package/dist/tools/resolve-type.d.ts +39 -1
  105. package/dist/tools/resolve-type.js +31 -2
  106. package/dist/tools/review-feedback.d.ts +206 -11
  107. package/dist/tools/review-feedback.js +132 -51
  108. package/dist/tools/rollback-changes.d.ts +79 -2
  109. package/dist/tools/rollback-changes.js +66 -14
  110. package/dist/tools/run-angular-cli.d.ts +45 -2
  111. package/dist/tools/run-angular-cli.js +67 -7
  112. package/dist/tools/run-build.d.ts +114 -2
  113. package/dist/tools/run-build.js +117 -8
  114. package/dist/tools/run-schematic.d.ts +70 -2
  115. package/dist/tools/run-schematic.js +104 -10
  116. package/dist/tools/scan-all.d.ts +19 -11
  117. package/dist/tools/scan-all.js +139 -131
  118. package/dist/tools/scan-angular.d.ts +19 -10
  119. package/dist/tools/scan-angular.js +51 -23
  120. package/dist/tools/scan-architecture.d.ts +17 -10
  121. package/dist/tools/scan-architecture.js +93 -31
  122. package/dist/tools/scan-solid.d.ts +19 -10
  123. package/dist/tools/scan-solid.js +51 -23
  124. package/dist/tools/search-codebase.d.ts +82 -1
  125. package/dist/tools/search-codebase.js +55 -2
  126. package/dist/tools/server-status.d.ts +279 -5
  127. package/dist/tools/server-status.js +179 -5
  128. package/dist/tools/suggest-improvements.d.ts +97 -5
  129. package/dist/tools/suggest-improvements.js +80 -44
  130. package/dist/tools/trace-output-flow.d.ts +682 -2
  131. package/dist/tools/trace-output-flow.js +375 -15
  132. package/dist/tools/transform-code-batch.d.ts +3 -0
  133. package/dist/tools/transform-code-batch.js +10 -5
  134. package/dist/tools/transform-code.d.ts +335 -12
  135. package/dist/tools/transform-code.js +649 -608
  136. package/dist/tools/validate-before-transform.d.ts +116 -2
  137. package/dist/tools/validate-before-transform.js +55 -2
  138. package/dist/tools/validate-project-compatibility.d.ts +64 -2
  139. package/dist/tools/validate-project-compatibility.js +67 -4
  140. package/dist/tools/validate-transformation.d.ts +220 -2
  141. package/dist/tools/validate-transformation.js +113 -15
  142. package/dist/tools/verify-citations.d.ts +181 -0
  143. package/dist/tools/verify-citations.js +218 -0
  144. package/dist/types.d.ts +38 -1
  145. package/dist/utils/format-tool-response.d.ts +22 -59
  146. package/dist/utils/format-tool-response.js +25 -134
  147. package/package.json +30 -13
  148. package/dist/cli.d.ts.map +0 -1
  149. package/dist/cli.js.map +0 -1
  150. package/dist/core/project-analyzer.d.ts.map +0 -1
  151. package/dist/core/project-analyzer.js.map +0 -1
  152. package/dist/index.d.ts.map +0 -1
  153. package/dist/index.js.map +0 -1
  154. package/dist/mcp-watcher.d.ts.map +0 -1
  155. package/dist/mcp-watcher.js.map +0 -1
  156. package/dist/server/json-rpc-handler.d.ts +0 -98
  157. package/dist/server/json-rpc-handler.d.ts.map +0 -1
  158. package/dist/server/json-rpc-handler.js +0 -301
  159. package/dist/server/json-rpc-handler.js.map +0 -1
  160. package/dist/server/mcp-server.d.ts.map +0 -1
  161. package/dist/server/mcp-server.js.map +0 -1
  162. package/dist/server/stdio-guard.d.ts.map +0 -1
  163. package/dist/server/stdio-guard.js.map +0 -1
  164. package/dist/server/tool-registry.d.ts.map +0 -1
  165. package/dist/server/tool-registry.js.map +0 -1
  166. package/dist/streaming/progress-store.d.ts.map +0 -1
  167. package/dist/streaming/progress-store.js.map +0 -1
  168. package/dist/tools/analyze-build-impact.d.ts.map +0 -1
  169. package/dist/tools/analyze-build-impact.js.map +0 -1
  170. package/dist/tools/analyze-core-to-shared.d.ts.map +0 -1
  171. package/dist/tools/analyze-core-to-shared.js.map +0 -1
  172. package/dist/tools/analyze-parser-performance.d.ts.map +0 -1
  173. package/dist/tools/analyze-parser-performance.js.map +0 -1
  174. package/dist/tools/analyze-project.d.ts.map +0 -1
  175. package/dist/tools/analyze-project.js.map +0 -1
  176. package/dist/tools/check-incremental-compatibility.d.ts.map +0 -1
  177. package/dist/tools/check-incremental-compatibility.js.map +0 -1
  178. package/dist/tools/collect-feedback.d.ts.map +0 -1
  179. package/dist/tools/collect-feedback.js.map +0 -1
  180. package/dist/tools/extract-libraries.d.ts.map +0 -1
  181. package/dist/tools/extract-libraries.js.map +0 -1
  182. package/dist/tools/find-angular-symbol.d.ts.map +0 -1
  183. package/dist/tools/find-angular-symbol.js.map +0 -1
  184. package/dist/tools/find-component-hosts.d.ts.map +0 -1
  185. package/dist/tools/find-component-hosts.js.map +0 -1
  186. package/dist/tools/find-usages.d.ts.map +0 -1
  187. package/dist/tools/find-usages.js.map +0 -1
  188. package/dist/tools/get-bootstrap-execution.d.ts.map +0 -1
  189. package/dist/tools/get-bootstrap-execution.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/compact-output.d.ts.map +0 -1
  197. package/dist/tools/helpers/compact-output.js.map +0 -1
  198. package/dist/tools/helpers/feedback-analyzer.d.ts.map +0 -1
  199. package/dist/tools/helpers/feedback-analyzer.js.map +0 -1
  200. package/dist/tools/helpers/find-ts-config.d.ts.map +0 -1
  201. package/dist/tools/helpers/find-ts-config.js.map +0 -1
  202. package/dist/tools/helpers/platform-root-resolver.d.ts.map +0 -1
  203. package/dist/tools/helpers/platform-root-resolver.js.map +0 -1
  204. package/dist/tools/helpers/project-cache.d.ts.map +0 -1
  205. package/dist/tools/helpers/project-cache.js.map +0 -1
  206. package/dist/tools/helpers/rule-matcher.d.ts.map +0 -1
  207. package/dist/tools/helpers/rule-matcher.js.map +0 -1
  208. package/dist/tools/helpers/rule-runner.d.ts.map +0 -1
  209. package/dist/tools/helpers/rule-runner.js.map +0 -1
  210. package/dist/tools/helpers/scan-plan.d.ts.map +0 -1
  211. package/dist/tools/helpers/scan-plan.js.map +0 -1
  212. package/dist/tools/helpers/stack-frame-file-index.d.ts.map +0 -1
  213. package/dist/tools/helpers/stack-frame-file-index.js.map +0 -1
  214. package/dist/tools/helpers/suggestion-generator.d.ts.map +0 -1
  215. package/dist/tools/helpers/suggestion-generator.js.map +0 -1
  216. package/dist/tools/inspect-form-group.d.ts.map +0 -1
  217. package/dist/tools/inspect-form-group.js.map +0 -1
  218. package/dist/tools/inspect-i18n.d.ts.map +0 -1
  219. package/dist/tools/inspect-i18n.js.map +0 -1
  220. package/dist/tools/inspect-template.d.ts.map +0 -1
  221. package/dist/tools/inspect-template.js.map +0 -1
  222. package/dist/tools/learn-patterns.d.ts.map +0 -1
  223. package/dist/tools/learn-patterns.js.map +0 -1
  224. package/dist/tools/list-imports.d.ts.map +0 -1
  225. package/dist/tools/list-imports.js.map +0 -1
  226. package/dist/tools/orchestrate-migration.d.ts.map +0 -1
  227. package/dist/tools/orchestrate-migration.js.map +0 -1
  228. package/dist/tools/parse-stack-trace.d.ts.map +0 -1
  229. package/dist/tools/parse-stack-trace.js.map +0 -1
  230. package/dist/tools/plan-migration.d.ts.map +0 -1
  231. package/dist/tools/plan-migration.js.map +0 -1
  232. package/dist/tools/resolve-type.d.ts.map +0 -1
  233. package/dist/tools/resolve-type.js.map +0 -1
  234. package/dist/tools/review-feedback.d.ts.map +0 -1
  235. package/dist/tools/review-feedback.js.map +0 -1
  236. package/dist/tools/rollback-changes.d.ts.map +0 -1
  237. package/dist/tools/rollback-changes.js.map +0 -1
  238. package/dist/tools/run-angular-cli.d.ts.map +0 -1
  239. package/dist/tools/run-angular-cli.js.map +0 -1
  240. package/dist/tools/run-build.d.ts.map +0 -1
  241. package/dist/tools/run-build.js.map +0 -1
  242. package/dist/tools/run-schematic.d.ts.map +0 -1
  243. package/dist/tools/run-schematic.js.map +0 -1
  244. package/dist/tools/scan-all.d.ts.map +0 -1
  245. package/dist/tools/scan-all.js.map +0 -1
  246. package/dist/tools/scan-angular.d.ts.map +0 -1
  247. package/dist/tools/scan-angular.js.map +0 -1
  248. package/dist/tools/scan-architecture.d.ts.map +0 -1
  249. package/dist/tools/scan-architecture.js.map +0 -1
  250. package/dist/tools/scan-solid.d.ts.map +0 -1
  251. package/dist/tools/scan-solid.js.map +0 -1
  252. package/dist/tools/search-codebase.d.ts.map +0 -1
  253. package/dist/tools/search-codebase.js.map +0 -1
  254. package/dist/tools/server-status.d.ts.map +0 -1
  255. package/dist/tools/server-status.js.map +0 -1
  256. package/dist/tools/shared/scan-types.d.ts.map +0 -1
  257. package/dist/tools/shared/scan-types.js.map +0 -1
  258. package/dist/tools/suggest-improvements.d.ts.map +0 -1
  259. package/dist/tools/suggest-improvements.js.map +0 -1
  260. package/dist/tools/trace-output-flow.d.ts.map +0 -1
  261. package/dist/tools/trace-output-flow.js.map +0 -1
  262. package/dist/tools/transform-code-batch.d.ts.map +0 -1
  263. package/dist/tools/transform-code-batch.js.map +0 -1
  264. package/dist/tools/transform-code.d.ts.map +0 -1
  265. package/dist/tools/transform-code.js.map +0 -1
  266. package/dist/tools/validate-before-transform.d.ts.map +0 -1
  267. package/dist/tools/validate-before-transform.js.map +0 -1
  268. package/dist/tools/validate-project-compatibility.d.ts.map +0 -1
  269. package/dist/tools/validate-project-compatibility.js.map +0 -1
  270. package/dist/tools/validate-transformation.d.ts.map +0 -1
  271. package/dist/tools/validate-transformation.js.map +0 -1
  272. package/dist/types.d.ts.map +0 -1
  273. package/dist/types.js.map +0 -1
  274. package/dist/utils/format-tool-response.d.ts.map +0 -1
  275. package/dist/utils/format-tool-response.js.map +0 -1
@@ -16,7 +16,7 @@
16
16
  * kept together (core `buildViolationPlan`). Otherwise the strategy templates
17
17
  * decide the roadmap as before.
18
18
  */
19
- import { type MCPTool } from '../types.js';
19
+ import { type MCPTool, type ToolAnnotations } from '../types.js';
20
20
  import { type ProjectCache } from './helpers/project-cache.js';
21
21
  import type { PlannedFile, PlannedPhase, ViolationPlan } from '@angular-modernizer/core';
22
22
  /**
@@ -193,6 +193,15 @@ interface PlanMigrationResult {
193
193
  alignsWithStyle: boolean;
194
194
  styleWarnings: string[];
195
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[];
196
205
  }
197
206
  /**
198
207
  * File-level plan in the tool output.
@@ -224,9 +233,12 @@ export declare class PlanMigrationTool implements MCPTool {
224
233
  */
225
234
  constructor(projects?: ProjectCache | undefined);
226
235
  name: string;
236
+ title: string;
237
+ annotations: ToolAnnotations;
227
238
  description: string;
228
239
  inputSchema: {
229
240
  type: string;
241
+ additionalProperties: boolean;
230
242
  properties: {
231
243
  violations: {
232
244
  type: string;
@@ -420,6 +432,323 @@ export declare class PlanMigrationTool implements MCPTool {
420
432
  };
421
433
  required: never[];
422
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
+ };
750
+ required: string[];
751
+ };
423
752
  execute(args: Record<string, unknown>): Promise<PlanMigrationResult>;
424
753
  /**
425
754
  * Inline violations plus the ones from scanResultFile.
@@ -17,6 +17,9 @@
17
17
  * decide the roadmap as before.
18
18
  */
19
19
  import { isAbsolute, resolve } from 'node:path';
20
+ import { nameList } from './helpers/analysis-output.js';
21
+ import { STRING_ARRAY } from './helpers/investigation-schemas.js';
22
+ import { WARNINGS_OUTPUT_SCHEMA, withWarnings } from './helpers/output-contract.js';
20
23
  import { COMPACT_OUTPUT_SCHEMA, limitList, parseCompactOptions, } from './helpers/compact-output.js';
21
24
  import { buildScanPlan, readScanResultFile, } from './helpers/scan-plan.js';
22
25
  /**
@@ -33,6 +36,63 @@ const SCAN_SEVERITY_TO_PLAN = {
33
36
  high: 'high',
34
37
  critical: 'critical',
35
38
  };
39
+ const MIGRATION_STEP_SCHEMA = {
40
+ type: 'object',
41
+ properties: {
42
+ name: { type: 'string' },
43
+ action: { type: 'string' },
44
+ validation: { type: 'string' },
45
+ effort: { type: 'number' },
46
+ risk: { type: 'string' },
47
+ },
48
+ required: ['name', 'action', 'validation', 'effort', 'risk'],
49
+ };
50
+ const MIGRATION_STRATEGY_SCHEMA = {
51
+ type: 'object',
52
+ properties: {
53
+ id: { type: 'string' },
54
+ name: { type: 'string' },
55
+ description: { type: 'string' },
56
+ applicableArchitectures: STRING_ARRAY,
57
+ complexity: { type: 'string' },
58
+ successRate: { type: 'number' },
59
+ steps: { type: 'array', items: MIGRATION_STEP_SCHEMA },
60
+ prerequisites: STRING_ARRAY,
61
+ risks: STRING_ARRAY,
62
+ totalEffort: { type: 'number' },
63
+ overallRisk: { type: 'string' },
64
+ },
65
+ required: ['id', 'name', 'complexity', 'successRate', 'steps', 'totalEffort', 'overallRisk'],
66
+ };
67
+ /** Alternatives and phases named in the summary. */
68
+ const SUMMARY_NAMES = 10;
69
+ /**
70
+ * Text summary of a plan: strategy, alternatives, roadmap, the scan-based
71
+ * plan's own summary and the notes.
72
+ */
73
+ function describePlan(plan) {
74
+ const strategy = plan.recommendedStrategy;
75
+ const lines = [
76
+ `Recommended strategy: ${strategy.name} (${strategy.id}; complexity ${strategy.complexity}, ` +
77
+ `risk ${strategy.overallRisk}, effort ${strategy.totalEffort}, ` +
78
+ `success rate ${Math.round(strategy.successRate * 100)}%).`,
79
+ ];
80
+ const alternatives = nameList(plan.alternativeStrategies.map((s) => s.id), SUMMARY_NAMES);
81
+ if (alternatives !== undefined) {
82
+ lines.push(`Alternatives: ${alternatives}.`);
83
+ }
84
+ const phases = nameList(plan.roadmap.phases.map((p) => p.name), SUMMARY_NAMES);
85
+ lines.push(`Roadmap (${plan.planSource}, ${plan.roadmap.totalDuration})` +
86
+ (phases === undefined ? '.' : `: ${phases}.`));
87
+ if (plan.scanPlan !== undefined) {
88
+ lines.push(plan.scanPlan.summary);
89
+ }
90
+ if (plan.styleAlignmentScore !== undefined) {
91
+ lines.push(`Style alignment: ${plan.styleAlignmentScore}.`);
92
+ }
93
+ lines.push(...(plan.notes ?? []));
94
+ return lines.join('\n');
95
+ }
36
96
  /**
37
97
  * MCP tool for planning migrations.
38
98
  */
@@ -46,13 +106,21 @@ export class PlanMigrationTool {
46
106
  this.projects = projects;
47
107
  }
48
108
  name = 'plan-migration';
109
+ title = 'Plan Migration';
110
+ annotations = {
111
+ readOnlyHint: true,
112
+ destructiveHint: false,
113
+ idempotentHint: true,
114
+ openWorldHint: false,
115
+ };
49
116
  description = 'Generate comprehensive, style-aware migration plans for architectural improvements. ' +
50
117
  'With projectRoot and file-level violations (filePath, e.g. from scan-architecture, inline or via ' +
51
118
  'scanResultFile) the roadmap names concrete files: grouped per file and layer, ordered dependencies ' +
52
119
  'first along the import graph, import cycles kept together (planSource "scan"). Without file paths ' +
53
- 'the strategy templates decide the roadmap (planSource "template").';
120
+ 'the strategy templates decide the roadmap (planSource "template"). summary is a short text of strategy and roadmap.';
54
121
  inputSchema = {
55
122
  type: 'object',
123
+ additionalProperties: false,
56
124
  properties: {
57
125
  violations: {
58
126
  type: 'array',
@@ -212,6 +280,76 @@ export class PlanMigrationTool {
212
280
  // (scanResultFile or violations with filePath); checked in execute()
213
281
  required: [],
214
282
  };
283
+ outputSchema = {
284
+ type: 'object',
285
+ properties: {
286
+ recommendedStrategy: MIGRATION_STRATEGY_SCHEMA,
287
+ alternativeStrategies: { type: 'array', items: MIGRATION_STRATEGY_SCHEMA },
288
+ reasoning: {
289
+ type: 'object',
290
+ properties: {
291
+ primaryFactors: STRING_ARRAY,
292
+ constraintImpact: STRING_ARRAY,
293
+ riskAssessment: { type: 'string' },
294
+ },
295
+ required: ['primaryFactors', 'constraintImpact', 'riskAssessment'],
296
+ },
297
+ roadmap: {
298
+ type: 'object',
299
+ properties: {
300
+ phases: {
301
+ type: 'array',
302
+ items: {
303
+ type: 'object',
304
+ properties: {
305
+ name: { type: 'string' },
306
+ duration: { type: 'string' },
307
+ steps: { type: 'array', items: MIGRATION_STEP_SCHEMA },
308
+ deliverables: STRING_ARRAY,
309
+ },
310
+ required: ['name', 'duration', 'steps', 'deliverables'],
311
+ },
312
+ },
313
+ totalDuration: { type: 'string' },
314
+ milestones: STRING_ARRAY,
315
+ },
316
+ required: ['phases', 'totalDuration', 'milestones'],
317
+ },
318
+ successMetrics: STRING_ARRAY,
319
+ planSource: { type: 'string', enum: ['scan', 'template'] },
320
+ scanPlan: {
321
+ type: 'object',
322
+ properties: {
323
+ summary: { type: 'string' },
324
+ maxResults: { type: 'integer' },
325
+ layerSource: { type: 'string' },
326
+ graphFiles: { type: 'integer' },
327
+ stats: { type: 'object' },
328
+ cycles: { type: 'array', items: { type: 'object' } },
329
+ phases: { type: 'array', items: { type: 'object' } },
330
+ warnings: STRING_ARRAY,
331
+ },
332
+ required: ['summary', 'layerSource', 'graphFiles', 'stats', 'cycles', 'phases', 'warnings'],
333
+ },
334
+ notes: STRING_ARRAY,
335
+ styleAwareRiskAssessment: { type: 'object' },
336
+ styleConflictingSteps: { type: 'array', items: { type: 'object' } },
337
+ styleRecommendations: { type: 'array', items: { type: 'object' } },
338
+ styleAlignmentScore: { type: 'number' },
339
+ stepsWithStyleAnalysis: { type: 'array', items: { type: 'object' } },
340
+ summary: { type: 'string' },
341
+ ...WARNINGS_OUTPUT_SCHEMA,
342
+ },
343
+ required: [
344
+ 'recommendedStrategy',
345
+ 'alternativeStrategies',
346
+ 'reasoning',
347
+ 'roadmap',
348
+ 'successMetrics',
349
+ 'planSource',
350
+ 'summary',
351
+ ],
352
+ };
215
353
  async execute(args) {
216
354
  const params = args;
217
355
  const compact = parseCompactOptions(args);
@@ -272,14 +410,26 @@ export class PlanMigrationTool {
272
410
  // Create implementation roadmap: from the files when possible
273
411
  const notes = [];
274
412
  let scanPlan;
413
+ let loadWarnings = [];
275
414
  if (isScanBased && projectRoot) {
276
415
  const projects = this.projects;
416
+ let cachedTsConfig;
277
417
  const built = await buildScanPlan({
278
418
  projectRoot,
279
419
  violations: scanInput,
280
420
  ...(typeof params.maxPhases === 'number' ? { maxPhases: params.maxPhases } : {}),
281
- ...(projects ? { loadProject: (path) => projects.get(path) } : {}),
421
+ ...(projects
422
+ ? {
423
+ loadProject: (path) => {
424
+ cachedTsConfig = path;
425
+ return projects.get(path);
426
+ },
427
+ }
428
+ : {}),
282
429
  });
430
+ if (projects !== undefined && cachedTsConfig !== undefined) {
431
+ loadWarnings = projects.warnings(cachedTsConfig);
432
+ }
283
433
  const effective = {
284
434
  summaryOnly: compact.summaryOnly,
285
435
  maxResults: compact.maxResults ?? SCAN_PLAN_DEFAULT_MAX_RESULTS,
@@ -294,7 +444,7 @@ export class PlanMigrationTool {
294
444
  : this.createImplementationRoadmap(recommendedStrategy, constraints);
295
445
  // Generate reasoning
296
446
  const reasoning = this.generateReasoning(recommendedStrategy, violations, constraints);
297
- return {
447
+ const plan = {
298
448
  recommendedStrategy,
299
449
  alternativeStrategies,
300
450
  reasoning,
@@ -310,6 +460,7 @@ export class PlanMigrationTool {
310
460
  styleAlignmentScore,
311
461
  stepsWithStyleAnalysis,
312
462
  };
463
+ return withWarnings({ ...plan, summary: describePlan(plan) }, loadWarnings);
313
464
  }
314
465
  // ========================================================================
315
466
  // Scan-Based Planning
@@ -16,7 +16,7 @@
16
16
  * // args: { file: '/project/src/app/user.service.ts', line: 42, column: 15, projectRoot: '/project' }
17
17
  * ```
18
18
  */
19
- import { type MCPTool } from '../types.js';
19
+ import { type MCPTool, type ToolAnnotations } from '../types.js';
20
20
  import { type ResolvedTypeInfo } from '@angular-modernizer/api';
21
21
  import { ProjectCache } from './helpers/project-cache.js';
22
22
  /**
@@ -25,10 +25,13 @@ import { ProjectCache } from './helpers/project-cache.js';
25
25
  export declare class ResolveTypeTool implements MCPTool {
26
26
  private readonly projects;
27
27
  readonly name = "resolve-type";
28
+ readonly title = "Resolve Type";
29
+ readonly annotations: ToolAnnotations;
28
30
  constructor(projects?: ProjectCache);
29
31
  readonly description: string;
30
32
  readonly inputSchema: {
31
33
  type: string;
34
+ additionalProperties: boolean;
32
35
  properties: {
33
36
  file: {
34
37
  type: string;
@@ -49,8 +52,43 @@ export declare class ResolveTypeTool implements MCPTool {
49
52
  };
50
53
  required: string[];
51
54
  };
55
+ readonly outputSchema: {
56
+ type: string;
57
+ properties: {
58
+ warnings: {
59
+ readonly type: "array";
60
+ readonly items: {
61
+ readonly type: "string";
62
+ };
63
+ readonly description: "Conditions that can make the result incomplete, e.g. library imports that do not resolve because node_modules is missing.";
64
+ };
65
+ typeString: {
66
+ type: string;
67
+ };
68
+ genericParams: {
69
+ type: string;
70
+ items: {
71
+ type: string;
72
+ };
73
+ };
74
+ declaredIn: {
75
+ type: string;
76
+ };
77
+ isNullable: {
78
+ type: string;
79
+ };
80
+ isAsync: {
81
+ type: string;
82
+ };
83
+ summary: {
84
+ type: string;
85
+ };
86
+ };
87
+ required: string[];
88
+ };
52
89
  execute(args: Record<string, unknown>): Promise<ResolvedTypeInfo & {
53
90
  summary: string;
91
+ warnings?: string[];
54
92
  }>;
55
93
  private buildSummary;
56
94
  }