@angular-modernizer/adapter-mcp 0.2.0 → 0.3.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.
- package/README.md +103 -35
- package/dist/cli.js +64 -14
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-watcher.d.ts.map +1 -1
- package/dist/mcp-watcher.js +3 -0
- package/dist/mcp-watcher.js.map +1 -1
- package/dist/server/json-rpc-handler.d.ts +41 -0
- package/dist/server/json-rpc-handler.d.ts.map +1 -1
- package/dist/server/json-rpc-handler.js +85 -6
- package/dist/server/json-rpc-handler.js.map +1 -1
- package/dist/server/mcp-server.d.ts +31 -0
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +76 -23
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/stdio-guard.d.ts +20 -0
- package/dist/server/stdio-guard.d.ts.map +1 -0
- package/dist/server/stdio-guard.js +48 -0
- package/dist/server/stdio-guard.js.map +1 -0
- package/dist/tools/analyze-build-impact.d.ts +126 -13
- package/dist/tools/analyze-build-impact.d.ts.map +1 -1
- package/dist/tools/analyze-build-impact.js +172 -30
- package/dist/tools/analyze-build-impact.js.map +1 -1
- package/dist/tools/find-angular-symbol.d.ts +29 -6
- package/dist/tools/find-angular-symbol.d.ts.map +1 -1
- package/dist/tools/find-angular-symbol.js +51 -6
- package/dist/tools/find-angular-symbol.js.map +1 -1
- package/dist/tools/find-component-hosts.d.ts +114 -0
- package/dist/tools/find-component-hosts.d.ts.map +1 -0
- package/dist/tools/find-component-hosts.js +240 -0
- package/dist/tools/find-component-hosts.js.map +1 -0
- package/dist/tools/find-usages.d.ts +20 -3
- package/dist/tools/find-usages.d.ts.map +1 -1
- package/dist/tools/find-usages.js +71 -8
- package/dist/tools/find-usages.js.map +1 -1
- package/dist/tools/get-bootstrap-execution.d.ts +108 -0
- package/dist/tools/get-bootstrap-execution.d.ts.map +1 -0
- package/dist/tools/get-bootstrap-execution.js +243 -0
- package/dist/tools/get-bootstrap-execution.js.map +1 -0
- package/dist/tools/get-call-graph.d.ts +28 -3
- package/dist/tools/get-call-graph.d.ts.map +1 -1
- package/dist/tools/get-call-graph.js +55 -7
- package/dist/tools/get-call-graph.js.map +1 -1
- package/dist/tools/helpers/compact-output.d.ts +61 -0
- package/dist/tools/helpers/compact-output.d.ts.map +1 -0
- package/dist/tools/helpers/compact-output.js +83 -0
- package/dist/tools/helpers/compact-output.js.map +1 -0
- package/dist/tools/helpers/project-cache.d.ts +177 -0
- package/dist/tools/helpers/project-cache.d.ts.map +1 -0
- package/dist/tools/helpers/project-cache.js +313 -0
- package/dist/tools/helpers/project-cache.js.map +1 -0
- package/dist/tools/helpers/rule-runner.d.ts +67 -0
- package/dist/tools/helpers/rule-runner.d.ts.map +1 -0
- package/dist/tools/helpers/rule-runner.js +117 -0
- package/dist/tools/helpers/rule-runner.js.map +1 -0
- package/dist/tools/helpers/scan-plan.d.ts +45 -0
- package/dist/tools/helpers/scan-plan.d.ts.map +1 -0
- package/dist/tools/helpers/scan-plan.js +151 -0
- package/dist/tools/helpers/scan-plan.js.map +1 -0
- package/dist/tools/helpers/stack-frame-file-index.d.ts +10 -0
- package/dist/tools/helpers/stack-frame-file-index.d.ts.map +1 -0
- package/dist/tools/helpers/stack-frame-file-index.js +71 -0
- package/dist/tools/helpers/stack-frame-file-index.js.map +1 -0
- package/dist/tools/inspect-form-group.d.ts +93 -0
- package/dist/tools/inspect-form-group.d.ts.map +1 -0
- package/dist/tools/inspect-form-group.js +161 -0
- package/dist/tools/inspect-form-group.js.map +1 -0
- package/dist/tools/inspect-i18n.d.ts +85 -0
- package/dist/tools/inspect-i18n.d.ts.map +1 -0
- package/dist/tools/inspect-i18n.js +203 -0
- package/dist/tools/inspect-i18n.js.map +1 -0
- package/dist/tools/inspect-template.d.ts +89 -0
- package/dist/tools/inspect-template.d.ts.map +1 -0
- package/dist/tools/inspect-template.js +166 -0
- package/dist/tools/inspect-template.js.map +1 -0
- package/dist/tools/list-imports.d.ts +17 -1
- package/dist/tools/list-imports.d.ts.map +1 -1
- package/dist/tools/list-imports.js +22 -5
- package/dist/tools/list-imports.js.map +1 -1
- package/dist/tools/orchestrate-migration.d.ts +1 -0
- package/dist/tools/orchestrate-migration.d.ts.map +1 -1
- package/dist/tools/orchestrate-migration.js +33 -1
- package/dist/tools/orchestrate-migration.js.map +1 -1
- package/dist/tools/parse-stack-trace.d.ts +3 -1
- package/dist/tools/parse-stack-trace.d.ts.map +1 -1
- package/dist/tools/parse-stack-trace.js +18 -4
- package/dist/tools/parse-stack-trace.js.map +1 -1
- package/dist/tools/plan-migration.d.ts +89 -1
- package/dist/tools/plan-migration.d.ts.map +1 -1
- package/dist/tools/plan-migration.js +203 -7
- package/dist/tools/plan-migration.js.map +1 -1
- package/dist/tools/resolve-type.d.ts +3 -0
- package/dist/tools/resolve-type.d.ts.map +1 -1
- package/dist/tools/resolve-type.js +6 -2
- package/dist/tools/resolve-type.js.map +1 -1
- package/dist/tools/scan-all.d.ts +6 -6
- package/dist/tools/scan-all.d.ts.map +1 -1
- package/dist/tools/scan-all.js +7 -7
- package/dist/tools/scan-all.js.map +1 -1
- package/dist/tools/scan-angular.d.ts +1 -1
- package/dist/tools/scan-angular.js +1 -1
- package/dist/tools/scan-architecture.d.ts +25 -4
- package/dist/tools/scan-architecture.d.ts.map +1 -1
- package/dist/tools/scan-architecture.js +115 -134
- package/dist/tools/scan-architecture.js.map +1 -1
- package/dist/tools/scan-solid.d.ts +1 -1
- package/dist/tools/scan-solid.js +1 -1
- package/dist/tools/search-codebase.d.ts +3 -0
- package/dist/tools/search-codebase.d.ts.map +1 -1
- package/dist/tools/search-codebase.js +6 -2
- package/dist/tools/search-codebase.js.map +1 -1
- package/dist/tools/server-status.d.ts +96 -0
- package/dist/tools/server-status.d.ts.map +1 -0
- package/dist/tools/server-status.js +195 -0
- package/dist/tools/server-status.js.map +1 -0
- package/dist/tools/trace-output-flow.d.ts +111 -0
- package/dist/tools/trace-output-flow.d.ts.map +1 -0
- package/dist/tools/trace-output-flow.js +308 -0
- package/dist/tools/trace-output-flow.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -11
|
@@ -8,9 +8,25 @@
|
|
|
8
8
|
* resolves tsconfig path aliases, splits value vs type-only dependents and
|
|
9
9
|
* does not let barrels inflate the radius. Optional `symbols` restrict the
|
|
10
10
|
* impact to consumers of specific exported symbols.
|
|
11
|
+
*
|
|
12
|
+
* External templates (`.html`) are not part of the TypeScript program; they
|
|
13
|
+
* are mapped to the component files that own them (`templateUrl`, then same
|
|
14
|
+
* basename) instead of failing. Such a component is recompiled, but its
|
|
15
|
+
* dependents are not counted, because a template edit does not change the
|
|
16
|
+
* component's TypeScript API. Files that cannot be mapped are listed in
|
|
17
|
+
* `unresolvedFiles`. `summaryOnly` and `maxResults` shorten the file lists;
|
|
18
|
+
* counts always describe the full result.
|
|
19
|
+
*
|
|
20
|
+
* Host components that use a changed component, directive or pipe only in
|
|
21
|
+
* their template (NgModule declarations, no import of the class) are listed
|
|
22
|
+
* as `templateDependentFiles` and, with the used classes, in `templateHosts`.
|
|
23
|
+
* They are recompiled and template type-checked; their own dependents are not
|
|
24
|
+
* counted.
|
|
11
25
|
*/
|
|
12
26
|
import { type MCPTool } from '../types.js';
|
|
13
27
|
import { type BuildScopeSymbolImpact } from '@angular-modernizer/core';
|
|
28
|
+
import { type TemplateEdge } from '@angular-modernizer/api';
|
|
29
|
+
import { type ProjectCache } from './helpers/project-cache.js';
|
|
14
30
|
/**
|
|
15
31
|
* Build scope strategy
|
|
16
32
|
*/
|
|
@@ -30,11 +46,11 @@ interface EstimatedBuildScope {
|
|
|
30
46
|
/**
|
|
31
47
|
* Files that depend on the changed files (transitive dependents)
|
|
32
48
|
*/
|
|
33
|
-
dependentFiles
|
|
49
|
+
dependentFiles?: string[];
|
|
34
50
|
/**
|
|
35
51
|
* Affected Angular modules
|
|
36
52
|
*/
|
|
37
|
-
affectedModules
|
|
53
|
+
affectedModules?: string[];
|
|
38
54
|
/**
|
|
39
55
|
* Estimated build time in seconds
|
|
40
56
|
*/
|
|
@@ -42,15 +58,19 @@ interface EstimatedBuildScope {
|
|
|
42
58
|
/**
|
|
43
59
|
* Dependents that use changed bindings as values (need JS rebuild)
|
|
44
60
|
*/
|
|
45
|
-
valueDependentFiles
|
|
61
|
+
valueDependentFiles?: string[];
|
|
46
62
|
/**
|
|
47
63
|
* Dependents that only import types from the changed files (type-check only)
|
|
48
64
|
*/
|
|
49
|
-
typeOnlyDependentFiles
|
|
65
|
+
typeOnlyDependentFiles?: string[];
|
|
50
66
|
/**
|
|
51
67
|
* Barrel / re-export files passed through
|
|
52
68
|
*/
|
|
53
|
-
reExportFiles
|
|
69
|
+
reExportFiles?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Host components that use changed classes only in their templates
|
|
72
|
+
*/
|
|
73
|
+
templateDependentFiles?: string[];
|
|
54
74
|
/**
|
|
55
75
|
* How the changed set was determined ('forced' = the requested files)
|
|
56
76
|
*/
|
|
@@ -76,6 +96,10 @@ interface DependencyInfo {
|
|
|
76
96
|
* Number of type-only dependents (type-check only), when known
|
|
77
97
|
*/
|
|
78
98
|
typeOnlyDependents?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Number of template hosts (recompile, template type-check), when known
|
|
101
|
+
*/
|
|
102
|
+
templateDependents?: number;
|
|
79
103
|
/**
|
|
80
104
|
* Whether this file is exported from a public API (index.ts)
|
|
81
105
|
*/
|
|
@@ -86,47 +110,125 @@ interface DependencyInfo {
|
|
|
86
110
|
affectedModule?: string;
|
|
87
111
|
}
|
|
88
112
|
/**
|
|
89
|
-
*
|
|
113
|
+
* Sizes of the full result, independent of `summaryOnly` / `maxResults`.
|
|
114
|
+
*/
|
|
115
|
+
interface BuildImpactCounts {
|
|
116
|
+
changedFiles: number;
|
|
117
|
+
dependentFiles: number;
|
|
118
|
+
valueDependentFiles: number;
|
|
119
|
+
typeOnlyDependentFiles: number;
|
|
120
|
+
templateDependentFiles: number;
|
|
121
|
+
reExportFiles: number;
|
|
122
|
+
affectedFiles: number;
|
|
123
|
+
affectedModules: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A host component that uses changed classes in its template only.
|
|
127
|
+
*/
|
|
128
|
+
interface TemplateHost {
|
|
129
|
+
/** Host component file. */
|
|
130
|
+
file: string;
|
|
131
|
+
component: string;
|
|
132
|
+
uses: {
|
|
133
|
+
className: string;
|
|
134
|
+
via: TemplateEdge['via'];
|
|
135
|
+
file: string;
|
|
136
|
+
templateFile: string;
|
|
137
|
+
}[];
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A requested non-TypeScript file mapped to the component files that own it.
|
|
141
|
+
*/
|
|
142
|
+
interface MappedFile {
|
|
143
|
+
file: string;
|
|
144
|
+
mappedTo: string[];
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A requested file that could not be placed in the TypeScript program.
|
|
148
|
+
*/
|
|
149
|
+
interface UnresolvedFile {
|
|
150
|
+
file: string;
|
|
151
|
+
reason: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Output result of build impact analysis. `recommendation` comes first so it
|
|
155
|
+
* is the first thing a reader of the JSON sees.
|
|
90
156
|
*/
|
|
91
157
|
interface AnalyzeBuildImpactOutput {
|
|
158
|
+
/**
|
|
159
|
+
* AI-friendly recommendation
|
|
160
|
+
*/
|
|
161
|
+
recommendation: string;
|
|
162
|
+
/**
|
|
163
|
+
* Sizes of the full result
|
|
164
|
+
*/
|
|
165
|
+
counts: BuildImpactCounts;
|
|
166
|
+
/**
|
|
167
|
+
* `true` when `maxResults` cut at least one file list
|
|
168
|
+
*/
|
|
169
|
+
truncated: boolean;
|
|
92
170
|
/**
|
|
93
171
|
* Estimated build scope with strategy and recommendations
|
|
94
172
|
*/
|
|
95
173
|
estimatedBuildScope: EstimatedBuildScope;
|
|
96
174
|
/**
|
|
97
|
-
* All affected files (changed + dependents)
|
|
175
|
+
* All affected files (changed + dependents); omitted with `summaryOnly`
|
|
98
176
|
*/
|
|
99
|
-
affectedFiles
|
|
177
|
+
affectedFiles?: string[];
|
|
100
178
|
/**
|
|
101
|
-
* Affected Angular module names
|
|
179
|
+
* Affected Angular module names; omitted with `summaryOnly`
|
|
102
180
|
*/
|
|
103
|
-
affectedModules
|
|
181
|
+
affectedModules?: string[];
|
|
104
182
|
/**
|
|
105
183
|
* Estimated build time in seconds
|
|
106
184
|
*/
|
|
107
185
|
estimatedBuildTime: number;
|
|
108
186
|
/**
|
|
109
|
-
*
|
|
187
|
+
* Requested `.html` files and the component files they were mapped to
|
|
110
188
|
*/
|
|
111
|
-
|
|
189
|
+
mappedFiles?: MappedFile[];
|
|
190
|
+
/**
|
|
191
|
+
* Requested files that are not in the program and could not be mapped
|
|
192
|
+
*/
|
|
193
|
+
unresolvedFiles?: UnresolvedFile[];
|
|
112
194
|
/**
|
|
113
195
|
* Detailed dependency information for each changed file
|
|
114
196
|
*/
|
|
115
197
|
dependencies: DependencyInfo[];
|
|
116
198
|
/**
|
|
117
|
-
* Symbol-level consumers (only when `symbols` was given)
|
|
199
|
+
* Symbol-level consumers (only when `symbols` was given; omitted with `summaryOnly`)
|
|
118
200
|
*/
|
|
119
201
|
symbolImpacts?: BuildScopeSymbolImpact[];
|
|
202
|
+
/**
|
|
203
|
+
* Template hosts with the classes they use (omitted with `summaryOnly`,
|
|
204
|
+
* capped by `maxResults`)
|
|
205
|
+
*/
|
|
206
|
+
templateHosts?: TemplateHost[];
|
|
120
207
|
}
|
|
121
208
|
/**
|
|
122
209
|
* MCP tool for analyzing build impact before transformations.
|
|
123
210
|
*/
|
|
124
211
|
export declare class AnalyzeBuildImpactTool implements MCPTool {
|
|
212
|
+
private readonly projects?;
|
|
213
|
+
/**
|
|
214
|
+
* @param projects - Shared project cache; without it every call parses the
|
|
215
|
+
* workspace anew.
|
|
216
|
+
*/
|
|
217
|
+
constructor(projects?: ProjectCache | undefined);
|
|
125
218
|
name: string;
|
|
126
219
|
description: string;
|
|
127
220
|
inputSchema: {
|
|
128
221
|
type: string;
|
|
129
222
|
properties: {
|
|
223
|
+
summaryOnly: {
|
|
224
|
+
readonly type: "boolean";
|
|
225
|
+
readonly description: "Return counts and the text summary only, without the result list. Default: false.";
|
|
226
|
+
readonly default: false;
|
|
227
|
+
};
|
|
228
|
+
maxResults: {
|
|
229
|
+
readonly type: "number";
|
|
230
|
+
readonly description: string;
|
|
231
|
+
};
|
|
130
232
|
projectPath: {
|
|
131
233
|
type: string;
|
|
132
234
|
description: string;
|
|
@@ -149,6 +251,17 @@ export declare class AnalyzeBuildImpactTool implements MCPTool {
|
|
|
149
251
|
required: string[];
|
|
150
252
|
};
|
|
151
253
|
execute(args: Record<string, unknown>): Promise<AnalyzeBuildImpactOutput>;
|
|
254
|
+
/**
|
|
255
|
+
* Splits the requested files into files of the TypeScript program, `.html`
|
|
256
|
+
* templates mapped to their component files, and files that fit neither.
|
|
257
|
+
* Components reached only through their template are returned as
|
|
258
|
+
* `templateOnlyFiles`: they are recompiled, their dependents are not.
|
|
259
|
+
*/
|
|
260
|
+
private resolveChangedFiles;
|
|
261
|
+
/**
|
|
262
|
+
* Applies `summaryOnly` (drop every list) or `maxResults` (cap each list).
|
|
263
|
+
*/
|
|
264
|
+
private compactLists;
|
|
152
265
|
/**
|
|
153
266
|
* Dependent counts for one changed file. Uses the per-file breakdown when
|
|
154
267
|
* available; with a single changed file all dependents belong to it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-build-impact.d.ts","sourceRoot":"","sources":["../../src/tools/analyze-build-impact.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"analyze-build-impact.d.ts","sourceRoot":"","sources":["../../src/tools/analyze-build-impact.ts"],"names":[],"mapp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C,EAAE,UAAU,EAAE,CAAC;IAE3B;;OAEG;IACH,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IAEnC;;OAEG;IACH,YAAY,EAAE,cAAc,EAAE,CAAC;IAE/B;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAEzC;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAcD;;GAEG;AACH,qBAAa,sBAAuB,YAAW,OAAO;IAKxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAJtC;;;OAGG;gBAC0B,QAAQ,CAAC,EAAE,YAAY,YAAA;IAEpD,IAAI,SAA0B;IAC9B,WAAW,SAK2D;IAEtE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA0BT;IAEI,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,wBAAwB,CAAC;IA2MpC;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAyC3B;;OAEG;IACH,OAAO,CAAC,YAAY;IAmBpB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IA4B1B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAsB9B;;OAEG;IACH,OAAO,CAAC,eAAe;IAkCvB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAiB1B"}
|
|
@@ -8,18 +8,57 @@
|
|
|
8
8
|
* resolves tsconfig path aliases, splits value vs type-only dependents and
|
|
9
9
|
* does not let barrels inflate the radius. Optional `symbols` restrict the
|
|
10
10
|
* impact to consumers of specific exported symbols.
|
|
11
|
+
*
|
|
12
|
+
* External templates (`.html`) are not part of the TypeScript program; they
|
|
13
|
+
* are mapped to the component files that own them (`templateUrl`, then same
|
|
14
|
+
* basename) instead of failing. Such a component is recompiled, but its
|
|
15
|
+
* dependents are not counted, because a template edit does not change the
|
|
16
|
+
* component's TypeScript API. Files that cannot be mapped are listed in
|
|
17
|
+
* `unresolvedFiles`. `summaryOnly` and `maxResults` shorten the file lists;
|
|
18
|
+
* counts always describe the full result.
|
|
19
|
+
*
|
|
20
|
+
* Host components that use a changed component, directive or pipe only in
|
|
21
|
+
* their template (NgModule declarations, no import of the class) are listed
|
|
22
|
+
* as `templateDependentFiles` and, with the used classes, in `templateHosts`.
|
|
23
|
+
* They are recompiled and template type-checked; their own dependents are not
|
|
24
|
+
* counted.
|
|
11
25
|
*/
|
|
12
26
|
import { Project } from 'ts-morph';
|
|
13
27
|
import { IncrementalAnalyzer, } from '@angular-modernizer/core';
|
|
28
|
+
import { findTemplateOwnerFiles, } from '@angular-modernizer/api';
|
|
14
29
|
import { existsSync } from 'node:fs';
|
|
15
30
|
import { join } from 'node:path';
|
|
16
31
|
import { findTsConfig } from './helpers/find-ts-config.js';
|
|
32
|
+
import { COMPACT_OUTPUT_SCHEMA, limitList, parseCompactOptions, } from './helpers/compact-output.js';
|
|
33
|
+
/** Groups template edges by host component file. */
|
|
34
|
+
function toTemplateHosts(edges) {
|
|
35
|
+
const hosts = new Map();
|
|
36
|
+
for (const edge of edges) {
|
|
37
|
+
const key = `${edge.from}\0${edge.hostClassName}`;
|
|
38
|
+
const host = hosts.get(key) ?? { file: edge.from, component: edge.hostClassName, uses: [] };
|
|
39
|
+
host.uses.push({ className: edge.className, via: edge.via, file: edge.to, templateFile: edge.templateFile });
|
|
40
|
+
hosts.set(key, host);
|
|
41
|
+
}
|
|
42
|
+
return [...hosts.values()];
|
|
43
|
+
}
|
|
17
44
|
/**
|
|
18
45
|
* MCP tool for analyzing build impact before transformations.
|
|
19
46
|
*/
|
|
20
47
|
export class AnalyzeBuildImpactTool {
|
|
48
|
+
projects;
|
|
49
|
+
/**
|
|
50
|
+
* @param projects - Shared project cache; without it every call parses the
|
|
51
|
+
* workspace anew.
|
|
52
|
+
*/
|
|
53
|
+
constructor(projects) {
|
|
54
|
+
this.projects = projects;
|
|
55
|
+
}
|
|
21
56
|
name = 'analyze-build-impact';
|
|
22
|
-
description = 'Analyze build impact before transformations. Estimates affected files, transitive dependents, Angular modules, build time, and provides clear recommendations for AI usage. Helps determine if a transformation is safe to proceed.'
|
|
57
|
+
description = 'Analyze build impact before transformations. Estimates affected files, transitive dependents, Angular modules, build time, and provides clear recommendations for AI usage. Helps determine if a transformation is safe to proceed. ' +
|
|
58
|
+
'External .html templates are mapped to their component files. Host components that use a changed component, ' +
|
|
59
|
+
'directive or pipe only in their template (NgModule declarations) are listed as templateHosts. ' +
|
|
60
|
+
'The recommendation and counts come first; ' +
|
|
61
|
+
'use summaryOnly to skip the file lists or maxResults to cap them.';
|
|
23
62
|
inputSchema = {
|
|
24
63
|
type: 'object',
|
|
25
64
|
properties: {
|
|
@@ -41,6 +80,7 @@ export class AnalyzeBuildImpactTool {
|
|
|
41
80
|
},
|
|
42
81
|
description: 'Optional exported symbol names of the changed files. When given, only consumers of exactly these symbols count as dependents, and symbolImpacts lists value / type-only consumers per symbol.',
|
|
43
82
|
},
|
|
83
|
+
...COMPACT_OUTPUT_SCHEMA,
|
|
44
84
|
},
|
|
45
85
|
required: ['projectPath', 'filesToChange'],
|
|
46
86
|
};
|
|
@@ -54,6 +94,7 @@ export class AnalyzeBuildImpactTool {
|
|
|
54
94
|
}
|
|
55
95
|
const projectPath = params.projectPath;
|
|
56
96
|
const filesToChange = params.filesToChange;
|
|
97
|
+
const compact = parseCompactOptions(args);
|
|
57
98
|
// Validate project path
|
|
58
99
|
if (!existsSync(projectPath)) {
|
|
59
100
|
throw new Error(`Project path does not exist: ${projectPath}`);
|
|
@@ -66,29 +107,31 @@ export class AnalyzeBuildImpactTool {
|
|
|
66
107
|
? params.symbols.filter((s) => typeof s === 'string')
|
|
67
108
|
: [];
|
|
68
109
|
// Initialize ts-morph project
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
110
|
+
// Shared cache in the server (one parse per workspace); a fresh Project otherwise
|
|
111
|
+
const project = this.projects?.get(tsConfigPath) ??
|
|
112
|
+
new Project({
|
|
113
|
+
tsConfigFilePath: tsConfigPath,
|
|
114
|
+
skipAddingFilesFromTsConfig: false,
|
|
115
|
+
});
|
|
73
116
|
// Normalize file paths to absolute paths
|
|
74
|
-
const
|
|
117
|
+
const requestedFiles = filesToChange.map((file) => {
|
|
75
118
|
if (file.startsWith('/')) {
|
|
76
119
|
return file;
|
|
77
120
|
}
|
|
78
121
|
return join(projectPath, file);
|
|
79
122
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
123
|
+
const { changedFiles: normalizedFiles, templateOnlyFiles, mappedFiles, unresolvedFiles, } = this.resolveChangedFiles(project, requestedFiles);
|
|
124
|
+
if (normalizedFiles.length === 0) {
|
|
125
|
+
throw new Error(`No requested file is part of the TypeScript program: ${unresolvedFiles
|
|
126
|
+
.map((u) => `${u.file} (${u.reason})`)
|
|
127
|
+
.join(', ')}`);
|
|
86
128
|
}
|
|
87
129
|
// Create IncrementalAnalyzer and get build scope using core infrastructure
|
|
88
130
|
const incrementalAnalyzer = new IncrementalAnalyzer(project);
|
|
89
131
|
// The requested files ARE the changed set (forceFiles)
|
|
90
132
|
const buildScope = await incrementalAnalyzer.getBuildScope({
|
|
91
133
|
forceFiles: normalizedFiles,
|
|
134
|
+
...(templateOnlyFiles.length > 0 ? { templateOnlyFiles } : {}),
|
|
92
135
|
...(symbols.length > 0 ? { symbols } : {}),
|
|
93
136
|
});
|
|
94
137
|
// Extract build scope information
|
|
@@ -98,6 +141,7 @@ export class AnalyzeBuildImpactTool {
|
|
|
98
141
|
const estimatedBuildTime = buildScope.estimatedBuildTime;
|
|
99
142
|
const valueDependentFiles = buildScope.valueDependentFiles ?? dependentFiles;
|
|
100
143
|
const typeOnlyDependentFiles = buildScope.typeOnlyDependentFiles ?? [];
|
|
144
|
+
const templateDependentFiles = buildScope.templateDependentFiles ?? [];
|
|
101
145
|
// Calculate detailed dependency info for each changed file
|
|
102
146
|
const dependencies = [];
|
|
103
147
|
for (const changedFile of normalizedFiles) {
|
|
@@ -118,35 +162,131 @@ export class AnalyzeBuildImpactTool {
|
|
|
118
162
|
// Generate recommendation
|
|
119
163
|
const totalAffectedFiles = normalizedFiles.length + dependentFiles.length;
|
|
120
164
|
const baseRecommendation = this.generateRecommendation(totalAffectedFiles, strategy, estimatedBuildTime, dependencies);
|
|
121
|
-
const
|
|
122
|
-
?
|
|
123
|
-
:
|
|
165
|
+
const typeOnlyNote = typeOnlyDependentFiles.length > 0
|
|
166
|
+
? ` ${typeOnlyDependentFiles.length} of the dependents import types only (type-check, no JS rebuild).`
|
|
167
|
+
: '';
|
|
168
|
+
const templateNote = templateDependentFiles.length > 0
|
|
169
|
+
? ` ${templateDependentFiles.length} host component(s) use the changed classes only in their templates (recompile and template type-check), see templateHosts.`
|
|
170
|
+
: '';
|
|
171
|
+
const unresolvedNote = unresolvedFiles.length > 0
|
|
172
|
+
? ` ${unresolvedFiles.length} requested file(s) could not be analyzed, see unresolvedFiles.`
|
|
173
|
+
: '';
|
|
174
|
+
const recommendation = `${baseRecommendation}${typeOnlyNote}${templateNote}${unresolvedNote}`;
|
|
175
|
+
const reExportFiles = buildScope.reExportFiles ?? [];
|
|
176
|
+
// All affected files (changed + dependents)
|
|
177
|
+
const affectedFiles = [...normalizedFiles, ...dependentFiles];
|
|
178
|
+
const counts = {
|
|
179
|
+
changedFiles: normalizedFiles.length,
|
|
180
|
+
dependentFiles: dependentFiles.length,
|
|
181
|
+
valueDependentFiles: valueDependentFiles.length,
|
|
182
|
+
typeOnlyDependentFiles: typeOnlyDependentFiles.length,
|
|
183
|
+
templateDependentFiles: templateDependentFiles.length,
|
|
184
|
+
reExportFiles: reExportFiles.length,
|
|
185
|
+
affectedFiles: affectedFiles.length,
|
|
186
|
+
affectedModules: affectedModules.length,
|
|
187
|
+
};
|
|
188
|
+
const lists = this.compactLists({
|
|
189
|
+
dependentFiles,
|
|
190
|
+
affectedModules,
|
|
191
|
+
valueDependentFiles,
|
|
192
|
+
typeOnlyDependentFiles,
|
|
193
|
+
templateDependentFiles,
|
|
194
|
+
reExportFiles,
|
|
195
|
+
affectedFiles,
|
|
196
|
+
}, compact);
|
|
197
|
+
const templateHosts = compact.summaryOnly
|
|
198
|
+
? undefined
|
|
199
|
+
: limitList(toTemplateHosts(buildScope.templateEdges ?? []), compact.maxResults);
|
|
124
200
|
// Build estimated scope
|
|
125
201
|
const estimatedBuildScope = {
|
|
126
202
|
strategy,
|
|
127
203
|
changedFiles: normalizedFiles,
|
|
128
|
-
dependentFiles,
|
|
129
|
-
affectedModules,
|
|
204
|
+
...(lists.dependentFiles ? { dependentFiles: lists.dependentFiles } : {}),
|
|
205
|
+
...(lists.affectedModules ? { affectedModules: lists.affectedModules } : {}),
|
|
130
206
|
estimatedBuildTime,
|
|
131
|
-
valueDependentFiles
|
|
132
|
-
|
|
133
|
-
|
|
207
|
+
...(lists.valueDependentFiles
|
|
208
|
+
? { valueDependentFiles: lists.valueDependentFiles }
|
|
209
|
+
: {}),
|
|
210
|
+
...(lists.typeOnlyDependentFiles
|
|
211
|
+
? { typeOnlyDependentFiles: lists.typeOnlyDependentFiles }
|
|
212
|
+
: {}),
|
|
213
|
+
...(lists.reExportFiles ? { reExportFiles: lists.reExportFiles } : {}),
|
|
214
|
+
...(lists.templateDependentFiles && lists.templateDependentFiles.length > 0
|
|
215
|
+
? { templateDependentFiles: lists.templateDependentFiles }
|
|
216
|
+
: {}),
|
|
134
217
|
changeSource: buildScope.changeSource ?? 'forced',
|
|
135
218
|
};
|
|
136
|
-
// All affected files (changed + dependents)
|
|
137
|
-
const affectedFiles = [...normalizedFiles, ...dependentFiles];
|
|
138
219
|
return {
|
|
220
|
+
recommendation,
|
|
221
|
+
counts,
|
|
222
|
+
truncated: lists.truncated || (templateHosts?.truncated ?? false),
|
|
139
223
|
estimatedBuildScope,
|
|
140
|
-
affectedFiles,
|
|
141
|
-
affectedModules,
|
|
224
|
+
...(lists.affectedFiles ? { affectedFiles: lists.affectedFiles } : {}),
|
|
225
|
+
...(lists.affectedModules ? { affectedModules: lists.affectedModules } : {}),
|
|
142
226
|
estimatedBuildTime,
|
|
143
|
-
|
|
227
|
+
...(mappedFiles.length > 0 ? { mappedFiles } : {}),
|
|
228
|
+
...(unresolvedFiles.length > 0 ? { unresolvedFiles } : {}),
|
|
144
229
|
dependencies,
|
|
145
|
-
...(buildScope.symbolImpacts
|
|
230
|
+
...(buildScope.symbolImpacts && !compact.summaryOnly
|
|
146
231
|
? { symbolImpacts: buildScope.symbolImpacts }
|
|
147
232
|
: {}),
|
|
233
|
+
...(templateHosts && templateHosts.items.length > 0
|
|
234
|
+
? { templateHosts: templateHosts.items }
|
|
235
|
+
: {}),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Splits the requested files into files of the TypeScript program, `.html`
|
|
240
|
+
* templates mapped to their component files, and files that fit neither.
|
|
241
|
+
* Components reached only through their template are returned as
|
|
242
|
+
* `templateOnlyFiles`: they are recompiled, their dependents are not.
|
|
243
|
+
*/
|
|
244
|
+
resolveChangedFiles(project, requestedFiles) {
|
|
245
|
+
const changed = new Set();
|
|
246
|
+
const direct = new Set();
|
|
247
|
+
const mappedFiles = [];
|
|
248
|
+
const unresolvedFiles = [];
|
|
249
|
+
for (const file of requestedFiles) {
|
|
250
|
+
if (project.getSourceFile(file)) {
|
|
251
|
+
changed.add(file);
|
|
252
|
+
direct.add(file);
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
if (!file.endsWith('.html')) {
|
|
256
|
+
unresolvedFiles.push({ file, reason: 'not in the TypeScript program' });
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
const owners = findTemplateOwnerFiles(project, file);
|
|
260
|
+
if (owners.length === 0) {
|
|
261
|
+
unresolvedFiles.push({ file, reason: 'no component references this template' });
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
mappedFiles.push({ file, mappedTo: owners });
|
|
265
|
+
owners.forEach((owner) => changed.add(owner));
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
changedFiles: [...changed],
|
|
269
|
+
templateOnlyFiles: [...changed].filter((file) => !direct.has(file)),
|
|
270
|
+
mappedFiles,
|
|
271
|
+
unresolvedFiles,
|
|
148
272
|
};
|
|
149
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* Applies `summaryOnly` (drop every list) or `maxResults` (cap each list).
|
|
276
|
+
*/
|
|
277
|
+
compactLists(lists, compact) {
|
|
278
|
+
if (compact.summaryOnly) {
|
|
279
|
+
return { truncated: false };
|
|
280
|
+
}
|
|
281
|
+
const result = {};
|
|
282
|
+
let truncated = false;
|
|
283
|
+
for (const key of Object.keys(lists)) {
|
|
284
|
+
const limited = limitList(lists[key], compact.maxResults);
|
|
285
|
+
result[key] = limited.items;
|
|
286
|
+
truncated ||= limited.truncated;
|
|
287
|
+
}
|
|
288
|
+
return { ...result, truncated };
|
|
289
|
+
}
|
|
150
290
|
/**
|
|
151
291
|
* Dependent counts for one changed file. Uses the per-file breakdown when
|
|
152
292
|
* available; with a single changed file all dependents belong to it.
|
|
@@ -156,10 +296,12 @@ export class AnalyzeBuildImpactTool {
|
|
|
156
296
|
if (fileImpact) {
|
|
157
297
|
const valueDependents = fileImpact.valueDependents.length;
|
|
158
298
|
const typeOnlyDependents = fileImpact.typeOnlyDependents.length;
|
|
299
|
+
const templateDependents = fileImpact.templateDependents?.length ?? 0;
|
|
159
300
|
return {
|
|
160
|
-
dependents: valueDependents + typeOnlyDependents,
|
|
301
|
+
dependents: valueDependents + typeOnlyDependents + templateDependents,
|
|
161
302
|
valueDependents,
|
|
162
303
|
typeOnlyDependents,
|
|
304
|
+
...(templateDependents > 0 ? { templateDependents } : {}),
|
|
163
305
|
};
|
|
164
306
|
}
|
|
165
307
|
if (changedFileCount === 1) {
|
|
@@ -177,13 +319,13 @@ export class AnalyzeBuildImpactTool {
|
|
|
177
319
|
return `Public API change detected (${totalAffectedFiles} files affected, ~${estimatedBuildTime}s build time). High impact - may affect many files. Consider smaller batch or review dependents carefully.`;
|
|
178
320
|
}
|
|
179
321
|
if (totalAffectedFiles <= 10) {
|
|
180
|
-
return `Safe to transform, minimal impact (${totalAffectedFiles} files affected, ~${estimatedBuildTime}s build time). Recommended strategy: ${strategy}
|
|
322
|
+
return `Safe to transform, minimal impact (${totalAffectedFiles} files affected, ~${estimatedBuildTime}s build time). Recommended strategy: ${strategy}.`;
|
|
181
323
|
}
|
|
182
324
|
else if (totalAffectedFiles <= 50) {
|
|
183
|
-
return `Medium impact (${totalAffectedFiles} files affected, ~${estimatedBuildTime}s build time). Incremental build recommended. Strategy: ${strategy}
|
|
325
|
+
return `Medium impact (${totalAffectedFiles} files affected, ~${estimatedBuildTime}s build time). Incremental build recommended. Strategy: ${strategy}.`;
|
|
184
326
|
}
|
|
185
327
|
else {
|
|
186
|
-
return `High impact (${totalAffectedFiles} files affected, ~${estimatedBuildTime}s build time). Consider smaller batch or use full build. Strategy: ${strategy}
|
|
328
|
+
return `High impact (${totalAffectedFiles} files affected, ~${estimatedBuildTime}s build time). Consider smaller batch or use full build. Strategy: ${strategy}.`;
|
|
187
329
|
}
|
|
188
330
|
}
|
|
189
331
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-build-impact.js","sourceRoot":"","sources":["../../src/tools/analyze-build-impact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EACL,mBAAmB,GAGpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AA0J3D;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACjC,IAAI,GAAG,sBAAsB,CAAC;IAC9B,WAAW,GACT,qOAAqO,CA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AI,OAAO,EAAE,CAAC;YAC1B,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YAChD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,GAAG,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC;YAC/B,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -19,16 +19,41 @@
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
import { type MCPTool } from '../types.js';
|
|
22
|
-
import { type AngularSymbolResult } from '@angular-modernizer/api';
|
|
22
|
+
import { type AngularSymbolResult, type AngularSymbolType } from '@angular-modernizer/api';
|
|
23
|
+
import { ProjectCache } from './helpers/project-cache.js';
|
|
24
|
+
/** Output of the find-angular-symbol tool. */
|
|
25
|
+
interface FindAngularSymbolOutput {
|
|
26
|
+
/** Matching symbols, cut to `maxResults`; omitted with `summaryOnly`. */
|
|
27
|
+
results?: AngularSymbolResult[];
|
|
28
|
+
/** Total number of matches (before `maxResults`). */
|
|
29
|
+
totalCount: number;
|
|
30
|
+
/** `true` when `maxResults` cut the result list. */
|
|
31
|
+
truncated: boolean;
|
|
32
|
+
/** Match counts per Angular symbol type. */
|
|
33
|
+
countsByType: Partial<Record<AngularSymbolType, number>>;
|
|
34
|
+
/** Human-readable summary for LLM consumption. */
|
|
35
|
+
summary: string;
|
|
36
|
+
}
|
|
23
37
|
/**
|
|
24
38
|
* MCP tool that finds Angular symbols by selector, pipe name, or class name.
|
|
25
39
|
*/
|
|
26
40
|
export declare class FindAngularSymbolTool implements MCPTool {
|
|
41
|
+
private readonly projects;
|
|
27
42
|
readonly name = "find-angular-symbol";
|
|
43
|
+
constructor(projects?: ProjectCache);
|
|
28
44
|
readonly description: string;
|
|
29
45
|
readonly inputSchema: {
|
|
30
46
|
type: string;
|
|
31
47
|
properties: {
|
|
48
|
+
summaryOnly: {
|
|
49
|
+
readonly type: "boolean";
|
|
50
|
+
readonly description: "Return counts and the text summary only, without the result list. Default: false.";
|
|
51
|
+
readonly default: false;
|
|
52
|
+
};
|
|
53
|
+
maxResults: {
|
|
54
|
+
readonly type: "number";
|
|
55
|
+
readonly description: string;
|
|
56
|
+
};
|
|
32
57
|
query: {
|
|
33
58
|
type: string;
|
|
34
59
|
description: string;
|
|
@@ -45,11 +70,9 @@ export declare class FindAngularSymbolTool implements MCPTool {
|
|
|
45
70
|
};
|
|
46
71
|
required: string[];
|
|
47
72
|
};
|
|
48
|
-
execute(args: Record<string, unknown>): Promise<
|
|
49
|
-
|
|
50
|
-
totalCount: number;
|
|
51
|
-
summary: string;
|
|
52
|
-
}>;
|
|
73
|
+
execute(args: Record<string, unknown>): Promise<FindAngularSymbolOutput>;
|
|
74
|
+
private buildCompactSummary;
|
|
53
75
|
private buildSummary;
|
|
54
76
|
}
|
|
77
|
+
export {};
|
|
55
78
|
//# sourceMappingURL=find-angular-symbol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-angular-symbol.d.ts","sourceRoot":"","sources":["../../src/tools/find-angular-symbol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"find-angular-symbol.d.ts","sourceRoot":"","sources":["../../src/tools/find-angular-symbol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AA+B1D,8CAA8C;AAC9C,UAAU,uBAAuB;IAC/B,yEAAyE;IACzE,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEhC,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IAEnB,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IAEnB,4CAA4C;IAC5C,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;IAEzD,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD;;GAEG;AACH,qBAAa,qBAAsB,YAAW,OAAO;IAGvC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAFrC,QAAQ,CAAC,IAAI,yBAAyB;gBAET,QAAQ,GAAE,YAAiC;IAExE,QAAQ,CAAC,WAAW,SAU6E;IAEjG,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkClB;IAEI,OAAO,CACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,uBAAuB,CAAC;IAqDnC,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,YAAY;CAwBrB"}
|