@angular-modernizer/adapter-mcp 0.3.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 (298) hide show
  1. package/README.md +181 -282
  2. package/dist/cli.js +21 -13
  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 +122 -6
  6. package/dist/index.js +49 -5
  7. package/dist/mcp-watcher.d.ts +32 -7
  8. package/dist/mcp-watcher.js +16 -15
  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 +75 -0
  16. package/dist/server/limited-stdio-transport.js +115 -0
  17. package/dist/server/mcp-server.d.ts +20 -18
  18. package/dist/server/mcp-server.js +42 -79
  19. package/dist/server/package-version.d.ts +16 -0
  20. package/dist/server/package-version.js +37 -0
  21. package/dist/server/sdk-server.d.ts +71 -0
  22. package/dist/server/sdk-server.js +113 -0
  23. package/dist/server/tool-registry.d.ts +6 -9
  24. package/dist/server/tool-registry.js +6 -12
  25. package/dist/streaming/progress-store.d.ts +22 -5
  26. package/dist/streaming/progress-store.js +9 -5
  27. package/dist/tools/analyze-build-impact.d.ts +276 -35
  28. package/dist/tools/analyze-build-impact.js +175 -28
  29. package/dist/tools/analyze-core-to-shared.d.ts +176 -16
  30. package/dist/tools/analyze-core-to-shared.js +124 -19
  31. package/dist/tools/analyze-parser-performance.d.ts +209 -15
  32. package/dist/tools/analyze-parser-performance.js +119 -56
  33. package/dist/tools/analyze-project.d.ts +349 -17
  34. package/dist/tools/analyze-project.js +282 -97
  35. package/dist/tools/check-incremental-compatibility.d.ts +74 -12
  36. package/dist/tools/check-incremental-compatibility.js +69 -10
  37. package/dist/tools/collect-feedback.d.ts +225 -21
  38. package/dist/tools/collect-feedback.js +199 -118
  39. package/dist/tools/compare-health.d.ts +413 -0
  40. package/dist/tools/compare-health.js +479 -0
  41. package/dist/tools/extract-libraries.d.ts +200 -24
  42. package/dist/tools/extract-libraries.js +131 -27
  43. package/dist/tools/find-angular-symbol.d.ts +92 -24
  44. package/dist/tools/find-angular-symbol.js +70 -20
  45. package/dist/tools/find-component-hosts.d.ts +603 -27
  46. package/dist/tools/find-component-hosts.js +223 -19
  47. package/dist/tools/find-usages.d.ts +102 -22
  48. package/dist/tools/find-usages.js +81 -21
  49. package/dist/tools/get-bootstrap-execution.d.ts +183 -25
  50. package/dist/tools/get-bootstrap-execution.js +109 -25
  51. package/dist/tools/get-call-graph.d.ts +127 -12
  52. package/dist/tools/get-call-graph.js +84 -19
  53. package/dist/tools/get-operation-progress-tool.d.ts +126 -8
  54. package/dist/tools/get-operation-progress-tool.js +124 -12
  55. package/dist/tools/get-operation-progress.d.ts +27 -1
  56. package/dist/tools/get-operation-progress.js +5 -5
  57. package/dist/tools/helpers/analysis-output.d.ts +182 -0
  58. package/dist/tools/helpers/analysis-output.js +165 -0
  59. package/dist/tools/helpers/batch-kernel.d.ts +14 -0
  60. package/dist/tools/helpers/batch-kernel.js +12 -0
  61. package/dist/tools/helpers/build-schemas.d.ts +36 -0
  62. package/dist/tools/helpers/build-schemas.js +23 -0
  63. package/dist/tools/helpers/citation-file-source.d.ts +10 -0
  64. package/dist/tools/helpers/citation-file-source.js +82 -0
  65. package/dist/tools/helpers/compact-output.d.ts +2 -1
  66. package/dist/tools/helpers/compact-output.js +2 -1
  67. package/dist/tools/helpers/finding-window.d.ts +43 -0
  68. package/dist/tools/helpers/finding-window.js +64 -0
  69. package/dist/tools/helpers/health-delta.d.ts +99 -0
  70. package/dist/tools/helpers/health-delta.js +236 -0
  71. package/dist/tools/helpers/investigation-schemas.d.ts +93 -0
  72. package/dist/tools/helpers/investigation-schemas.js +48 -0
  73. package/dist/tools/helpers/library-imports.d.ts +57 -0
  74. package/dist/tools/helpers/library-imports.js +151 -0
  75. package/dist/tools/helpers/load-source-files.d.ts +30 -0
  76. package/dist/tools/helpers/load-source-files.js +34 -0
  77. package/dist/tools/helpers/output-contract.d.ts +32 -0
  78. package/dist/tools/helpers/output-contract.js +32 -0
  79. package/dist/tools/helpers/platform-root-resolver.d.ts +55 -25
  80. package/dist/tools/helpers/platform-root-resolver.js +75 -48
  81. package/dist/tools/helpers/process-output.d.ts +19 -0
  82. package/dist/tools/helpers/process-output.js +31 -0
  83. package/dist/tools/helpers/project-cache.d.ts +60 -37
  84. package/dist/tools/helpers/project-cache.js +54 -37
  85. package/dist/tools/helpers/project-decorators.d.ts +14 -0
  86. package/dist/tools/helpers/project-decorators.js +22 -0
  87. package/dist/tools/helpers/rule-matcher.js +5 -0
  88. package/dist/tools/helpers/rule-runner.d.ts +25 -13
  89. package/dist/tools/helpers/rule-runner.js +45 -24
  90. package/dist/tools/helpers/scan-cache.d.ts +22 -0
  91. package/dist/tools/helpers/scan-cache.js +34 -0
  92. package/dist/tools/helpers/scan-engine.d.ts +107 -0
  93. package/dist/tools/helpers/scan-engine.js +197 -0
  94. package/dist/tools/helpers/scan-plan.d.ts +5 -2
  95. package/dist/tools/helpers/scan-plan.js +18 -3
  96. package/dist/tools/helpers/scope-paths.d.ts +17 -0
  97. package/dist/tools/helpers/scope-paths.js +32 -0
  98. package/dist/tools/helpers/suggestion-generator.d.ts +9 -13
  99. package/dist/tools/helpers/suggestion-generator.js +0 -12
  100. package/dist/tools/helpers/tool-cache.d.ts +11 -0
  101. package/dist/tools/helpers/tool-cache.js +15 -0
  102. package/dist/tools/helpers/tool-context.d.ts +63 -0
  103. package/dist/tools/helpers/tool-context.js +79 -0
  104. package/dist/tools/helpers/transform-safety.d.ts +40 -0
  105. package/dist/tools/helpers/transform-safety.js +87 -0
  106. package/dist/tools/helpers/validation-output.d.ts +53 -0
  107. package/dist/tools/helpers/validation-output.js +48 -0
  108. package/dist/tools/inspect-form-group.d.ts +262 -24
  109. package/dist/tools/inspect-form-group.js +134 -13
  110. package/dist/tools/inspect-i18n.d.ts +410 -23
  111. package/dist/tools/inspect-i18n.js +213 -13
  112. package/dist/tools/inspect-template.d.ts +260 -22
  113. package/dist/tools/inspect-template.js +174 -13
  114. package/dist/tools/learn-patterns.d.ts +210 -13
  115. package/dist/tools/learn-patterns.js +113 -12
  116. package/dist/tools/list-imports.d.ts +152 -34
  117. package/dist/tools/list-imports.js +124 -18
  118. package/dist/tools/orchestrate-migration.d.ts +159 -14
  119. package/dist/tools/orchestrate-migration.js +147 -20
  120. package/dist/tools/parse-stack-trace.d.ts +78 -21
  121. package/dist/tools/parse-stack-trace.js +44 -7
  122. package/dist/tools/plan-migration.d.ts +395 -26
  123. package/dist/tools/plan-migration.js +173 -22
  124. package/dist/tools/resolve-type.d.ts +57 -9
  125. package/dist/tools/resolve-type.js +49 -12
  126. package/dist/tools/review-feedback.d.ts +214 -16
  127. package/dist/tools/review-feedback.js +142 -57
  128. package/dist/tools/rollback-changes.d.ts +88 -7
  129. package/dist/tools/rollback-changes.js +74 -19
  130. package/dist/tools/run-angular-cli.d.ts +57 -12
  131. package/dist/tools/run-angular-cli.js +76 -13
  132. package/dist/tools/run-build.d.ts +127 -13
  133. package/dist/tools/run-build.js +128 -16
  134. package/dist/tools/run-schematic.d.ts +82 -12
  135. package/dist/tools/run-schematic.js +115 -18
  136. package/dist/tools/scan-all.d.ts +88 -23
  137. package/dist/tools/scan-all.js +161 -220
  138. package/dist/tools/scan-angular.d.ts +60 -19
  139. package/dist/tools/scan-angular.js +100 -141
  140. package/dist/tools/scan-architecture.d.ts +92 -24
  141. package/dist/tools/scan-architecture.js +268 -211
  142. package/dist/tools/scan-solid.d.ts +59 -19
  143. package/dist/tools/scan-solid.js +98 -139
  144. package/dist/tools/search-codebase.d.ts +110 -23
  145. package/dist/tools/search-codebase.js +67 -11
  146. package/dist/tools/server-status.d.ts +392 -26
  147. package/dist/tools/server-status.js +260 -27
  148. package/dist/tools/suggest-improvements.d.ts +105 -10
  149. package/dist/tools/suggest-improvements.js +91 -51
  150. package/dist/tools/trace-output-flow.d.ts +713 -26
  151. package/dist/tools/trace-output-flow.js +396 -33
  152. package/dist/tools/transform-code-batch.d.ts +3 -0
  153. package/dist/tools/transform-code-batch.js +10 -5
  154. package/dist/tools/transform-code.d.ts +402 -18
  155. package/dist/tools/transform-code.js +708 -649
  156. package/dist/tools/validate-before-transform.d.ts +136 -7
  157. package/dist/tools/validate-before-transform.js +65 -9
  158. package/dist/tools/validate-project-compatibility.d.ts +82 -15
  159. package/dist/tools/validate-project-compatibility.js +84 -15
  160. package/dist/tools/validate-transformation.d.ts +243 -8
  161. package/dist/tools/validate-transformation.js +127 -23
  162. package/dist/tools/verify-citations.d.ts +202 -0
  163. package/dist/tools/verify-citations.js +221 -0
  164. package/dist/types.d.ts +78 -11
  165. package/dist/types.js +0 -5
  166. package/dist/utils/format-tool-response.d.ts +22 -59
  167. package/dist/utils/format-tool-response.js +25 -134
  168. package/package.json +31 -20
  169. package/dist/cli.d.ts.map +0 -1
  170. package/dist/cli.js.map +0 -1
  171. package/dist/core/project-analyzer.d.ts.map +0 -1
  172. package/dist/core/project-analyzer.js.map +0 -1
  173. package/dist/index.d.ts.map +0 -1
  174. package/dist/index.js.map +0 -1
  175. package/dist/mcp-watcher.d.ts.map +0 -1
  176. package/dist/mcp-watcher.js.map +0 -1
  177. package/dist/server/json-rpc-handler.d.ts +0 -98
  178. package/dist/server/json-rpc-handler.d.ts.map +0 -1
  179. package/dist/server/json-rpc-handler.js +0 -301
  180. package/dist/server/json-rpc-handler.js.map +0 -1
  181. package/dist/server/mcp-server.d.ts.map +0 -1
  182. package/dist/server/mcp-server.js.map +0 -1
  183. package/dist/server/stdio-guard.d.ts.map +0 -1
  184. package/dist/server/stdio-guard.js.map +0 -1
  185. package/dist/server/tool-registry.d.ts.map +0 -1
  186. package/dist/server/tool-registry.js.map +0 -1
  187. package/dist/streaming/progress-store.d.ts.map +0 -1
  188. package/dist/streaming/progress-store.js.map +0 -1
  189. package/dist/tools/analyze-build-impact.d.ts.map +0 -1
  190. package/dist/tools/analyze-build-impact.js.map +0 -1
  191. package/dist/tools/analyze-core-to-shared.d.ts.map +0 -1
  192. package/dist/tools/analyze-core-to-shared.js.map +0 -1
  193. package/dist/tools/analyze-parser-performance.d.ts.map +0 -1
  194. package/dist/tools/analyze-parser-performance.js.map +0 -1
  195. package/dist/tools/analyze-project.d.ts.map +0 -1
  196. package/dist/tools/analyze-project.js.map +0 -1
  197. package/dist/tools/check-incremental-compatibility.d.ts.map +0 -1
  198. package/dist/tools/check-incremental-compatibility.js.map +0 -1
  199. package/dist/tools/collect-feedback.d.ts.map +0 -1
  200. package/dist/tools/collect-feedback.js.map +0 -1
  201. package/dist/tools/extract-libraries.d.ts.map +0 -1
  202. package/dist/tools/extract-libraries.js.map +0 -1
  203. package/dist/tools/find-angular-symbol.d.ts.map +0 -1
  204. package/dist/tools/find-angular-symbol.js.map +0 -1
  205. package/dist/tools/find-component-hosts.d.ts.map +0 -1
  206. package/dist/tools/find-component-hosts.js.map +0 -1
  207. package/dist/tools/find-usages.d.ts.map +0 -1
  208. package/dist/tools/find-usages.js.map +0 -1
  209. package/dist/tools/get-bootstrap-execution.d.ts.map +0 -1
  210. package/dist/tools/get-bootstrap-execution.js.map +0 -1
  211. package/dist/tools/get-call-graph.d.ts.map +0 -1
  212. package/dist/tools/get-call-graph.js.map +0 -1
  213. package/dist/tools/get-operation-progress-tool.d.ts.map +0 -1
  214. package/dist/tools/get-operation-progress-tool.js.map +0 -1
  215. package/dist/tools/get-operation-progress.d.ts.map +0 -1
  216. package/dist/tools/get-operation-progress.js.map +0 -1
  217. package/dist/tools/helpers/compact-output.d.ts.map +0 -1
  218. package/dist/tools/helpers/compact-output.js.map +0 -1
  219. package/dist/tools/helpers/feedback-analyzer.d.ts.map +0 -1
  220. package/dist/tools/helpers/feedback-analyzer.js.map +0 -1
  221. package/dist/tools/helpers/find-ts-config.d.ts.map +0 -1
  222. package/dist/tools/helpers/find-ts-config.js.map +0 -1
  223. package/dist/tools/helpers/platform-root-resolver.d.ts.map +0 -1
  224. package/dist/tools/helpers/platform-root-resolver.js.map +0 -1
  225. package/dist/tools/helpers/project-cache.d.ts.map +0 -1
  226. package/dist/tools/helpers/project-cache.js.map +0 -1
  227. package/dist/tools/helpers/rule-matcher.d.ts.map +0 -1
  228. package/dist/tools/helpers/rule-matcher.js.map +0 -1
  229. package/dist/tools/helpers/rule-runner.d.ts.map +0 -1
  230. package/dist/tools/helpers/rule-runner.js.map +0 -1
  231. package/dist/tools/helpers/scan-plan.d.ts.map +0 -1
  232. package/dist/tools/helpers/scan-plan.js.map +0 -1
  233. package/dist/tools/helpers/stack-frame-file-index.d.ts.map +0 -1
  234. package/dist/tools/helpers/stack-frame-file-index.js.map +0 -1
  235. package/dist/tools/helpers/suggestion-generator.d.ts.map +0 -1
  236. package/dist/tools/helpers/suggestion-generator.js.map +0 -1
  237. package/dist/tools/inspect-form-group.d.ts.map +0 -1
  238. package/dist/tools/inspect-form-group.js.map +0 -1
  239. package/dist/tools/inspect-i18n.d.ts.map +0 -1
  240. package/dist/tools/inspect-i18n.js.map +0 -1
  241. package/dist/tools/inspect-template.d.ts.map +0 -1
  242. package/dist/tools/inspect-template.js.map +0 -1
  243. package/dist/tools/learn-patterns.d.ts.map +0 -1
  244. package/dist/tools/learn-patterns.js.map +0 -1
  245. package/dist/tools/list-imports.d.ts.map +0 -1
  246. package/dist/tools/list-imports.js.map +0 -1
  247. package/dist/tools/orchestrate-migration.d.ts.map +0 -1
  248. package/dist/tools/orchestrate-migration.js.map +0 -1
  249. package/dist/tools/parse-stack-trace.d.ts.map +0 -1
  250. package/dist/tools/parse-stack-trace.js.map +0 -1
  251. package/dist/tools/plan-migration.d.ts.map +0 -1
  252. package/dist/tools/plan-migration.js.map +0 -1
  253. package/dist/tools/resolve-type.d.ts.map +0 -1
  254. package/dist/tools/resolve-type.js.map +0 -1
  255. package/dist/tools/review-feedback.d.ts.map +0 -1
  256. package/dist/tools/review-feedback.js.map +0 -1
  257. package/dist/tools/rollback-changes.d.ts.map +0 -1
  258. package/dist/tools/rollback-changes.js.map +0 -1
  259. package/dist/tools/run-angular-cli.d.ts.map +0 -1
  260. package/dist/tools/run-angular-cli.js.map +0 -1
  261. package/dist/tools/run-build.d.ts.map +0 -1
  262. package/dist/tools/run-build.js.map +0 -1
  263. package/dist/tools/run-schematic.d.ts.map +0 -1
  264. package/dist/tools/run-schematic.js.map +0 -1
  265. package/dist/tools/scan-all.d.ts.map +0 -1
  266. package/dist/tools/scan-all.js.map +0 -1
  267. package/dist/tools/scan-angular.d.ts.map +0 -1
  268. package/dist/tools/scan-angular.js.map +0 -1
  269. package/dist/tools/scan-architecture.d.ts.map +0 -1
  270. package/dist/tools/scan-architecture.js.map +0 -1
  271. package/dist/tools/scan-solid.d.ts.map +0 -1
  272. package/dist/tools/scan-solid.js.map +0 -1
  273. package/dist/tools/search-codebase.d.ts.map +0 -1
  274. package/dist/tools/search-codebase.js.map +0 -1
  275. package/dist/tools/server-status.d.ts.map +0 -1
  276. package/dist/tools/server-status.js.map +0 -1
  277. package/dist/tools/shared/scan-types.d.ts +0 -200
  278. package/dist/tools/shared/scan-types.d.ts.map +0 -1
  279. package/dist/tools/shared/scan-types.js +0 -7
  280. package/dist/tools/shared/scan-types.js.map +0 -1
  281. package/dist/tools/suggest-improvements.d.ts.map +0 -1
  282. package/dist/tools/suggest-improvements.js.map +0 -1
  283. package/dist/tools/trace-output-flow.d.ts.map +0 -1
  284. package/dist/tools/trace-output-flow.js.map +0 -1
  285. package/dist/tools/transform-code-batch.d.ts.map +0 -1
  286. package/dist/tools/transform-code-batch.js.map +0 -1
  287. package/dist/tools/transform-code.d.ts.map +0 -1
  288. package/dist/tools/transform-code.js.map +0 -1
  289. package/dist/tools/validate-before-transform.d.ts.map +0 -1
  290. package/dist/tools/validate-before-transform.js.map +0 -1
  291. package/dist/tools/validate-project-compatibility.d.ts.map +0 -1
  292. package/dist/tools/validate-project-compatibility.js.map +0 -1
  293. package/dist/tools/validate-transformation.d.ts.map +0 -1
  294. package/dist/tools/validate-transformation.js.map +0 -1
  295. package/dist/types.d.ts.map +0 -1
  296. package/dist/types.js.map +0 -1
  297. package/dist/utils/format-tool-response.d.ts.map +0 -1
  298. package/dist/utils/format-tool-response.js.map +0 -1
@@ -1,6 +1,31 @@
1
+ import { type MCPTool, type ToolAnnotations } from '../types.js';
2
+ import { type BootstrapExecutionResult, type BootstrapRoot, type BootstrapTiming, type BootstrapWatchHit } from '@angular-modernizer/api';
3
+ import { ProjectCache } from './helpers/project-cache.js';
4
+ /** A root with its reached list optionally dropped or capped. */
5
+ export type RootOutput = Omit<BootstrapRoot, 'reached'> & Partial<Pick<BootstrapRoot, 'reached'>> & {
6
+ /** Number of nodes reached from the root, also when the list is dropped or capped. */
7
+ reachedCount: number;
8
+ };
9
+ /**
10
+ * Output of the get-bootstrap-execution tool.
11
+ */
12
+ export interface GetBootstrapExecutionOutput {
13
+ /** Startup roots with what they reach; omitted with `summaryOnly`. */
14
+ roots?: RootOutput[];
15
+ /** Reads and writes of the watched expressions, capped by `maxResults`; omitted with `summaryOnly`. */
16
+ watchHits?: BootstrapWatchHit[];
17
+ /** Counts over the full result. */
18
+ counts: BootstrapExecutionResult['counts'];
19
+ /** `true` when `maxResults` cut a reached list or the watch hits. */
20
+ truncated: boolean;
21
+ /** Short text: roots, counts and watch hits. */
22
+ summary: string;
23
+ /** The tsconfig whose program was analyzed. */
24
+ tsConfigPath: string;
25
+ /** Conditions that can make the result incomplete (unresolved library imports). */
26
+ warnings?: string[];
27
+ }
1
28
  /**
2
- * @angular-modernizer/adapter-mcp - Get Bootstrap Execution Tool
3
- *
4
29
  * MCP tool that lists what an Angular app runs at startup (initializers,
5
30
  * bootstrap component/module), on the first HTTP request (interceptors) and
6
31
  * on first injection (provider factories), including everything reached
@@ -19,35 +44,20 @@
19
44
  * // args: { projectRoot: '/project', watch: ['AppConfig.settings'], summaryOnly: true }
20
45
  * ```
21
46
  */
22
- import { type MCPTool } from '../types.js';
23
- import { type BootstrapExecutionResult, type BootstrapRoot, type BootstrapTiming, type BootstrapWatchHit } from '@angular-modernizer/api';
24
- import { ProjectCache } from './helpers/project-cache.js';
25
- /** A root with its reached list optionally dropped or capped. */
26
- type RootOutput = Omit<BootstrapRoot, 'reached'> & Partial<Pick<BootstrapRoot, 'reached'>> & {
27
- reachedCount: number;
28
- };
29
- /**
30
- * Output of the get-bootstrap-execution tool.
31
- */
32
- interface GetBootstrapExecutionOutput {
33
- roots?: RootOutput[];
34
- watchHits?: BootstrapWatchHit[];
35
- counts: BootstrapExecutionResult['counts'];
36
- /** `true` when `maxResults` cut a reached list or the watch hits. */
37
- truncated: boolean;
38
- summary: string;
39
- tsConfigPath: string;
40
- }
41
- /**
42
- * MCP tool that reports what runs at application startup.
43
- */
44
47
  export declare class GetBootstrapExecutionTool implements MCPTool {
45
48
  private readonly projects;
46
49
  readonly name = "get-bootstrap-execution";
50
+ readonly title = "Get Bootstrap Execution";
51
+ readonly annotations: ToolAnnotations;
47
52
  constructor(projects?: ProjectCache);
48
53
  readonly description: string;
54
+ /**
55
+ * JSON Schema of the tool arguments.
56
+ * @hidden
57
+ */
49
58
  readonly inputSchema: {
50
59
  type: string;
60
+ additionalProperties: boolean;
51
61
  properties: {
52
62
  summaryOnly: {
53
63
  readonly type: "boolean";
@@ -101,8 +111,156 @@ export declare class GetBootstrapExecutionTool implements MCPTool {
101
111
  };
102
112
  required: string[];
103
113
  };
114
+ /**
115
+ * JSON Schema of the tool result (`structuredContent`).
116
+ * @hidden
117
+ */
118
+ readonly outputSchema: {
119
+ type: string;
120
+ properties: {
121
+ warnings: {
122
+ readonly type: "array";
123
+ readonly items: {
124
+ readonly type: "string";
125
+ };
126
+ readonly description: "Conditions that can make the result incomplete, e.g. library imports that do not resolve because node_modules is missing.";
127
+ };
128
+ roots: {
129
+ type: string;
130
+ items: {
131
+ type: string;
132
+ properties: {
133
+ kind: {
134
+ type: string;
135
+ };
136
+ timing: {
137
+ type: string;
138
+ };
139
+ label: {
140
+ type: string;
141
+ };
142
+ file: {
143
+ type: string;
144
+ };
145
+ line: {
146
+ type: string;
147
+ };
148
+ unresolvedInjections: {
149
+ readonly type: "array";
150
+ readonly items: {
151
+ readonly type: "string";
152
+ };
153
+ };
154
+ truncated: {
155
+ type: string;
156
+ };
157
+ reached: {
158
+ type: string;
159
+ items: {
160
+ type: string;
161
+ properties: {
162
+ name: {
163
+ type: string;
164
+ };
165
+ kind: {
166
+ type: string;
167
+ };
168
+ file: {
169
+ type: string;
170
+ };
171
+ line: {
172
+ type: string;
173
+ };
174
+ depth: {
175
+ type: string;
176
+ };
177
+ via: {
178
+ type: string;
179
+ };
180
+ };
181
+ required: string[];
182
+ };
183
+ };
184
+ reachedCount: {
185
+ type: string;
186
+ };
187
+ };
188
+ required: string[];
189
+ };
190
+ };
191
+ watchHits: {
192
+ type: string;
193
+ items: {
194
+ type: string;
195
+ properties: {
196
+ watch: {
197
+ type: string;
198
+ };
199
+ access: {
200
+ type: string;
201
+ };
202
+ root: {
203
+ type: string;
204
+ };
205
+ timing: {
206
+ type: string;
207
+ };
208
+ path: {
209
+ readonly type: "array";
210
+ readonly items: {
211
+ readonly type: "string";
212
+ };
213
+ };
214
+ file: {
215
+ type: string;
216
+ };
217
+ line: {
218
+ type: string;
219
+ };
220
+ snippet: {
221
+ type: string;
222
+ };
223
+ };
224
+ required: string[];
225
+ };
226
+ };
227
+ counts: {
228
+ type: string;
229
+ properties: {
230
+ roots: {
231
+ type: string;
232
+ };
233
+ rootsByTiming: {
234
+ readonly type: "object";
235
+ readonly additionalProperties: {
236
+ readonly type: "integer";
237
+ };
238
+ };
239
+ reached: {
240
+ type: string;
241
+ };
242
+ watchHits: {
243
+ type: string;
244
+ };
245
+ truncatedRoots: {
246
+ type: string;
247
+ };
248
+ };
249
+ required: string[];
250
+ };
251
+ truncated: {
252
+ type: string;
253
+ };
254
+ summary: {
255
+ type: string;
256
+ };
257
+ tsConfigPath: {
258
+ type: string;
259
+ };
260
+ };
261
+ required: string[];
262
+ };
104
263
  execute(args: Record<string, unknown>): Promise<GetBootstrapExecutionOutput>;
105
264
  private buildSummary;
106
265
  }
107
- export {};
108
266
  //# sourceMappingURL=get-bootstrap-execution.d.ts.map
@@ -1,30 +1,11 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Get Bootstrap Execution Tool
3
- *
4
- * MCP tool that lists what an Angular app runs at startup (initializers,
5
- * bootstrap component/module), on the first HTTP request (interceptors) and
6
- * on first injection (provider factories), including everything reached
7
- * through calls and dependency injection, and where a watched expression
8
- * such as `AppConfig.settings` is read or written on the way.
9
- *
10
- * @remarks
11
- * Logic lives in `BootstrapExecutionAnalyzer` (`@angular-modernizer/api`);
12
- * this tool resolves the project, validates arguments and applies the
13
- * compact output contract.
14
- *
15
- * @example
16
- * ```typescript
17
- * // Via MCP:
18
- * // tool: get-bootstrap-execution
19
- * // args: { projectRoot: '/project', watch: ['AppConfig.settings'], summaryOnly: true }
20
- * ```
21
- */
22
1
  import { BootstrapExecutionAnalyzer, normalizeWatchExpression, } from '@angular-modernizer/api';
23
2
  import { existsSync } from 'node:fs';
24
3
  import { isAbsolute, relative, resolve } from 'node:path';
25
4
  import { findTsConfig } from './helpers/find-ts-config.js';
26
5
  import { ProjectCache } from './helpers/project-cache.js';
27
6
  import { COMPACT_OUTPUT_SCHEMA, limitList, parseCompactOptions, } from './helpers/compact-output.js';
7
+ import { WARNINGS_OUTPUT_SCHEMA, withWarnings, } from './helpers/output-contract.js';
8
+ import { COUNT_OBJECT, STRING_ARRAY } from './helpers/investigation-schemas.js';
28
9
  const TIMINGS = [
29
10
  'initializer',
30
11
  'bootstrap',
@@ -68,11 +49,34 @@ function stringList(value, name) {
68
49
  return value;
69
50
  }
70
51
  /**
71
- * MCP tool that reports what runs at application startup.
52
+ * MCP tool that lists what an Angular app runs at startup (initializers,
53
+ * bootstrap component/module), on the first HTTP request (interceptors) and
54
+ * on first injection (provider factories), including everything reached
55
+ * through calls and dependency injection, and where a watched expression
56
+ * such as `AppConfig.settings` is read or written on the way.
57
+ *
58
+ * @remarks
59
+ * Logic lives in `BootstrapExecutionAnalyzer` (`@angular-modernizer/api`);
60
+ * this tool resolves the project, validates arguments and applies the
61
+ * compact output contract.
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * // Via MCP:
66
+ * // tool: get-bootstrap-execution
67
+ * // args: { projectRoot: '/project', watch: ['AppConfig.settings'], summaryOnly: true }
68
+ * ```
72
69
  */
73
70
  export class GetBootstrapExecutionTool {
74
71
  projects;
75
72
  name = 'get-bootstrap-execution';
73
+ title = 'Get Bootstrap Execution';
74
+ annotations = {
75
+ readOnlyHint: true,
76
+ destructiveHint: false,
77
+ idempotentHint: true,
78
+ openWorldHint: false,
79
+ };
76
80
  constructor(projects = new ProjectCache()) {
77
81
  this.projects = projects;
78
82
  }
@@ -88,8 +92,13 @@ export class GetBootstrapExecutionTool {
88
92
  'from one callable instead (e.g. "AuthInterceptor.constructor"). Roots are found by scanning source files, ' +
89
93
  'not by evaluating which providers are registered; spec files are skipped. Start with summaryOnly; ' +
90
94
  'maxResults caps the reached list per root and the watch hits.';
95
+ /**
96
+ * JSON Schema of the tool arguments.
97
+ * @hidden
98
+ */
91
99
  inputSchema = {
92
100
  type: 'object',
101
+ additionalProperties: false,
93
102
  properties: {
94
103
  projectRoot: {
95
104
  type: 'string',
@@ -130,6 +139,80 @@ export class GetBootstrapExecutionTool {
130
139
  },
131
140
  required: ['projectRoot'],
132
141
  };
142
+ /**
143
+ * JSON Schema of the tool result (`structuredContent`).
144
+ * @hidden
145
+ */
146
+ outputSchema = {
147
+ type: 'object',
148
+ properties: {
149
+ roots: {
150
+ type: 'array',
151
+ items: {
152
+ type: 'object',
153
+ properties: {
154
+ kind: { type: 'string' },
155
+ timing: { type: 'string' },
156
+ label: { type: 'string' },
157
+ file: { type: 'string' },
158
+ line: { type: 'integer' },
159
+ unresolvedInjections: STRING_ARRAY,
160
+ truncated: { type: 'boolean' },
161
+ reached: {
162
+ type: 'array',
163
+ items: {
164
+ type: 'object',
165
+ properties: {
166
+ name: { type: 'string' },
167
+ kind: { type: 'string' },
168
+ file: { type: 'string' },
169
+ line: { type: 'integer' },
170
+ depth: { type: 'integer' },
171
+ via: { type: 'string' },
172
+ },
173
+ required: ['name', 'kind', 'file', 'line', 'depth', 'via'],
174
+ },
175
+ },
176
+ reachedCount: { type: 'integer' },
177
+ },
178
+ required: ['kind', 'timing', 'label', 'file', 'line', 'unresolvedInjections', 'truncated', 'reachedCount'],
179
+ },
180
+ },
181
+ watchHits: {
182
+ type: 'array',
183
+ items: {
184
+ type: 'object',
185
+ properties: {
186
+ watch: { type: 'string' },
187
+ access: { type: 'string' },
188
+ root: { type: 'string' },
189
+ timing: { type: 'string' },
190
+ path: STRING_ARRAY,
191
+ file: { type: 'string' },
192
+ line: { type: 'integer' },
193
+ snippet: { type: 'string' },
194
+ },
195
+ required: ['watch', 'access', 'root', 'timing', 'path', 'file', 'line', 'snippet'],
196
+ },
197
+ },
198
+ counts: {
199
+ type: 'object',
200
+ properties: {
201
+ roots: { type: 'integer' },
202
+ rootsByTiming: COUNT_OBJECT,
203
+ reached: { type: 'integer' },
204
+ watchHits: { type: 'integer' },
205
+ truncatedRoots: { type: 'integer' },
206
+ },
207
+ required: ['roots', 'rootsByTiming', 'reached', 'watchHits', 'truncatedRoots'],
208
+ },
209
+ truncated: { type: 'boolean' },
210
+ summary: { type: 'string' },
211
+ tsConfigPath: { type: 'string' },
212
+ ...WARNINGS_OUTPUT_SCHEMA,
213
+ },
214
+ required: ['counts', 'truncated', 'summary', 'tsConfigPath'],
215
+ };
133
216
  async execute(args) {
134
217
  const params = args;
135
218
  if (!params.projectRoot) {
@@ -166,8 +249,9 @@ export class GetBootstrapExecutionTool {
166
249
  ...(maxNodes === undefined ? {} : { maxNodes }),
167
250
  });
168
251
  const summary = this.buildSummary(result, params.projectRoot, watch ?? [], params.method);
252
+ const warnings = this.projects.warnings(tsConfigPath);
169
253
  if (compact.summaryOnly) {
170
- return { counts: result.counts, truncated: false, summary, tsConfigPath };
254
+ return withWarnings({ counts: result.counts, truncated: false, summary, tsConfigPath }, warnings);
171
255
  }
172
256
  const includeReached = params.includeReached !== false;
173
257
  let truncated = false;
@@ -182,14 +266,14 @@ export class GetBootstrapExecutionTool {
182
266
  });
183
267
  const hits = limitList(result.watchHits, compact.maxResults);
184
268
  truncated ||= hits.truncated;
185
- return {
269
+ return withWarnings({
186
270
  roots,
187
271
  watchHits: hits.items,
188
272
  counts: result.counts,
189
273
  truncated,
190
274
  summary,
191
275
  tsConfigPath,
192
- };
276
+ }, warnings);
193
277
  }
194
278
  buildSummary(result, projectRoot, watch, method) {
195
279
  if (result.roots.length === 0) {
@@ -1,6 +1,14 @@
1
+ import { type MCPTool, type ToolAnnotations } from '../types.js';
2
+ import { type CallGraphResult } from '@angular-modernizer/api';
3
+ import { ProjectCache } from './helpers/project-cache.js';
4
+ /** Tool output: the call graph (trees omitted with `summaryOnly`) plus a text summary. */
5
+ export type GetCallGraphOutput = Omit<CallGraphResult, 'callers' | 'callees'> & Partial<Pick<CallGraphResult, 'callers' | 'callees'>> & {
6
+ /** Short text summary with the direct callers and callees. */
7
+ summary: string;
8
+ /** Conditions that can make the result incomplete (unresolved library imports). */
9
+ warnings?: string[];
10
+ };
1
11
  /**
2
- * @angular-modernizer/adapter-mcp - Get Call Graph Tool
3
- *
4
12
  * MCP tool for building a caller/callee graph for a named method, function,
5
13
  * constructor, get/set accessor or arrow-function property.
6
14
  * Supports configurable traversal direction and depth.
@@ -24,23 +32,20 @@
24
32
  * // projectRoot: '/project', direction: 'down', depth: 4 }
25
33
  * ```
26
34
  */
27
- import { type MCPTool } from '../types.js';
28
- import { type CallGraphResult } from '@angular-modernizer/api';
29
- import { ProjectCache } from './helpers/project-cache.js';
30
- /** Tool output: the call graph (trees omitted with `summaryOnly`) plus a text summary. */
31
- export type GetCallGraphOutput = Omit<CallGraphResult, 'callers' | 'callees'> & Partial<Pick<CallGraphResult, 'callers' | 'callees'>> & {
32
- summary: string;
33
- };
34
- /**
35
- * MCP tool that builds a call graph for a named method or function.
36
- */
37
35
  export declare class GetCallGraphTool implements MCPTool {
38
36
  private readonly projects;
39
37
  readonly name = "get-call-graph";
38
+ readonly title = "Get Call Graph";
39
+ readonly annotations: ToolAnnotations;
40
40
  constructor(projects?: ProjectCache);
41
41
  readonly description: string;
42
+ /**
43
+ * JSON Schema of the tool arguments.
44
+ * @hidden
45
+ */
42
46
  readonly inputSchema: {
43
47
  type: string;
48
+ additionalProperties: boolean;
44
49
  properties: {
45
50
  method: {
46
51
  type: string;
@@ -83,8 +88,118 @@ export declare class GetCallGraphTool implements MCPTool {
83
88
  };
84
89
  required: string[];
85
90
  };
91
+ /**
92
+ * JSON Schema of the tool result (`structuredContent`).
93
+ * @hidden
94
+ */
95
+ readonly outputSchema: {
96
+ type: string;
97
+ $defs: {
98
+ callNode: {
99
+ type: string;
100
+ properties: {
101
+ children: {
102
+ type: string;
103
+ items: {
104
+ $ref: string;
105
+ };
106
+ };
107
+ name: {
108
+ readonly type: "string";
109
+ };
110
+ file: {
111
+ readonly type: "string";
112
+ };
113
+ line: {
114
+ readonly type: "integer";
115
+ };
116
+ kind: {
117
+ readonly type: "string";
118
+ };
119
+ className: {
120
+ readonly type: "string";
121
+ };
122
+ snippet: {
123
+ readonly type: "string";
124
+ };
125
+ inheritedFrom: {
126
+ readonly type: "string";
127
+ };
128
+ };
129
+ required: string[];
130
+ };
131
+ };
132
+ properties: {
133
+ warnings: {
134
+ readonly type: "array";
135
+ readonly items: {
136
+ readonly type: "string";
137
+ };
138
+ readonly description: "Conditions that can make the result incomplete, e.g. library imports that do not resolve because node_modules is missing.";
139
+ };
140
+ target: {
141
+ type: string[];
142
+ properties: {
143
+ readonly name: {
144
+ readonly type: "string";
145
+ };
146
+ readonly file: {
147
+ readonly type: "string";
148
+ };
149
+ readonly line: {
150
+ readonly type: "integer";
151
+ };
152
+ readonly kind: {
153
+ readonly type: "string";
154
+ };
155
+ readonly className: {
156
+ readonly type: "string";
157
+ };
158
+ readonly snippet: {
159
+ readonly type: "string";
160
+ };
161
+ readonly inheritedFrom: {
162
+ readonly type: "string";
163
+ };
164
+ };
165
+ required: string[];
166
+ };
167
+ callers: {
168
+ type: string;
169
+ items: {
170
+ $ref: string;
171
+ };
172
+ };
173
+ callees: {
174
+ type: string;
175
+ items: {
176
+ $ref: string;
177
+ };
178
+ };
179
+ nodeCount: {
180
+ type: string;
181
+ };
182
+ truncated: {
183
+ type: string;
184
+ };
185
+ truncatedAt: {
186
+ type: string;
187
+ };
188
+ summary: {
189
+ type: string;
190
+ };
191
+ };
192
+ required: string[];
193
+ };
86
194
  execute(args: Record<string, unknown>): Promise<GetCallGraphOutput>;
87
195
  private buildSummary;
196
+ /**
197
+ * Summary lines for the direct callers or callees, at most
198
+ * {@link SUMMARY_MAX_NODES}: a wide fan-in (500 callers on a large app)
199
+ * made the summary about as large as the tree itself, and the summary is
200
+ * sent as text next to `structuredContent`.
201
+ */
202
+ private listNodes;
88
203
  private label;
89
204
  }
90
205
  //# sourceMappingURL=get-call-graph.d.ts.map