@angular-modernizer/adapter-mcp 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -64
- package/dist/cli.js +8 -0
- package/dist/core/project-analyzer.d.ts +3 -12
- package/dist/core/project-analyzer.js +3 -12
- package/dist/index.d.ts +118 -3
- package/dist/index.js +46 -3
- package/dist/mcp-watcher.d.ts +28 -8
- package/dist/mcp-watcher.js +7 -7
- package/dist/scan-host/scan-host.d.ts +119 -0
- package/dist/scan-host/scan-host.js +376 -0
- package/dist/scan-host/scan-protocol.d.ts +35 -0
- package/dist/scan-host/scan-protocol.js +6 -0
- package/dist/scan-host/scan-worker.d.ts +14 -0
- package/dist/scan-host/scan-worker.js +48 -0
- package/dist/server/limited-stdio-transport.d.ts +7 -0
- package/dist/server/mcp-server.d.ts +11 -7
- package/dist/server/mcp-server.js +4 -7
- package/dist/server/sdk-server.d.ts +1 -0
- package/dist/server/tool-registry.d.ts +3 -7
- package/dist/server/tool-registry.js +1 -7
- package/dist/streaming/progress-store.d.ts +22 -5
- package/dist/streaming/progress-store.js +9 -5
- package/dist/tools/analyze-build-impact.d.ts +56 -34
- package/dist/tools/analyze-build-impact.js +30 -25
- package/dist/tools/analyze-core-to-shared.d.ts +42 -12
- package/dist/tools/analyze-core-to-shared.js +11 -10
- package/dist/tools/analyze-parser-performance.d.ts +23 -22
- package/dist/tools/analyze-parser-performance.js +20 -18
- package/dist/tools/analyze-project.d.ts +82 -12
- package/dist/tools/analyze-project.js +98 -101
- package/dist/tools/check-incremental-compatibility.d.ts +13 -11
- package/dist/tools/check-incremental-compatibility.js +11 -8
- package/dist/tools/collect-feedback.d.ts +41 -26
- package/dist/tools/collect-feedback.js +32 -23
- package/dist/tools/compare-health.d.ts +76 -19
- package/dist/tools/compare-health.js +26 -19
- package/dist/tools/extract-libraries.d.ts +44 -20
- package/dist/tools/extract-libraries.js +16 -17
- package/dist/tools/find-angular-symbol.d.ts +25 -23
- package/dist/tools/find-angular-symbol.js +17 -14
- package/dist/tools/find-component-hosts.d.ts +31 -25
- package/dist/tools/find-component-hosts.js +24 -21
- package/dist/tools/find-usages.d.ts +23 -21
- package/dist/tools/find-usages.js +19 -16
- package/dist/tools/get-bootstrap-execution.d.ts +33 -25
- package/dist/tools/get-bootstrap-execution.js +25 -22
- package/dist/tools/get-call-graph.d.ts +18 -13
- package/dist/tools/get-call-graph.js +24 -21
- package/dist/tools/get-operation-progress-tool.d.ts +12 -6
- package/dist/tools/get-operation-progress-tool.js +11 -6
- package/dist/tools/get-operation-progress.d.ts +26 -0
- package/dist/tools/helpers/analysis-output.d.ts +5 -0
- package/dist/tools/helpers/batch-kernel.d.ts +14 -0
- package/dist/tools/helpers/batch-kernel.js +12 -0
- package/dist/tools/helpers/compact-output.d.ts +2 -1
- package/dist/tools/helpers/compact-output.js +2 -1
- package/dist/tools/helpers/health-delta.d.ts +27 -14
- package/dist/tools/helpers/health-delta.js +11 -14
- package/dist/tools/helpers/project-cache.d.ts +50 -34
- package/dist/tools/helpers/project-cache.js +33 -34
- package/dist/tools/helpers/rule-runner.d.ts +23 -16
- package/dist/tools/helpers/rule-runner.js +24 -17
- package/dist/tools/helpers/scan-engine.d.ts +107 -0
- package/dist/tools/helpers/scan-engine.js +197 -0
- package/dist/tools/helpers/suggestion-generator.d.ts +9 -13
- package/dist/tools/helpers/suggestion-generator.js +0 -12
- package/dist/tools/helpers/tool-cache.d.ts +11 -0
- package/dist/tools/helpers/tool-cache.js +15 -0
- package/dist/tools/helpers/tool-context.d.ts +11 -8
- package/dist/tools/helpers/tool-context.js +5 -8
- package/dist/tools/inspect-form-group.d.ts +32 -25
- package/dist/tools/inspect-form-group.js +24 -21
- package/dist/tools/inspect-i18n.d.ts +28 -22
- package/dist/tools/inspect-i18n.js +20 -17
- package/dist/tools/inspect-template.d.ts +31 -24
- package/dist/tools/inspect-template.js +23 -20
- package/dist/tools/learn-patterns.d.ts +88 -12
- package/dist/tools/learn-patterns.js +17 -11
- package/dist/tools/list-imports.d.ts +42 -25
- package/dist/tools/list-imports.js +23 -20
- package/dist/tools/orchestrate-migration.d.ts +31 -9
- package/dist/tools/orchestrate-migration.js +12 -7
- package/dist/tools/parse-stack-trace.d.ts +23 -21
- package/dist/tools/parse-stack-trace.js +10 -7
- package/dist/tools/plan-migration.d.ts +65 -25
- package/dist/tools/plan-migration.js +19 -19
- package/dist/tools/resolve-type.d.ts +19 -9
- package/dist/tools/resolve-type.js +19 -11
- package/dist/tools/review-feedback.d.ts +27 -24
- package/dist/tools/review-feedback.js +24 -20
- package/dist/tools/rollback-changes.d.ts +13 -9
- package/dist/tools/rollback-changes.js +10 -7
- package/dist/tools/run-angular-cli.d.ts +12 -10
- package/dist/tools/run-angular-cli.js +11 -8
- package/dist/tools/run-build.d.ts +13 -11
- package/dist/tools/run-build.js +11 -8
- package/dist/tools/run-schematic.d.ts +12 -10
- package/dist/tools/run-schematic.js +11 -8
- package/dist/tools/scan-all.d.ts +69 -12
- package/dist/tools/scan-all.js +55 -122
- package/dist/tools/scan-angular.d.ts +41 -9
- package/dist/tools/scan-angular.js +66 -135
- package/dist/tools/scan-architecture.d.ts +75 -14
- package/dist/tools/scan-architecture.js +180 -185
- package/dist/tools/scan-solid.d.ts +40 -9
- package/dist/tools/scan-solid.js +64 -133
- package/dist/tools/search-codebase.d.ts +30 -24
- package/dist/tools/search-codebase.js +13 -10
- package/dist/tools/server-status.d.ts +116 -24
- package/dist/tools/server-status.js +85 -26
- package/dist/tools/suggest-improvements.d.ts +22 -19
- package/dist/tools/suggest-improvements.js +21 -17
- package/dist/tools/trace-output-flow.d.ts +32 -25
- package/dist/tools/trace-output-flow.js +24 -21
- package/dist/tools/transform-code.d.ts +71 -10
- package/dist/tools/transform-code.js +60 -42
- package/dist/tools/validate-before-transform.d.ts +24 -9
- package/dist/tools/validate-before-transform.js +10 -7
- package/dist/tools/validate-project-compatibility.d.ts +18 -13
- package/dist/tools/validate-project-compatibility.js +17 -11
- package/dist/tools/validate-transformation.d.ts +28 -11
- package/dist/tools/validate-transformation.js +14 -8
- package/dist/tools/verify-citations.d.ts +37 -16
- package/dist/tools/verify-citations.js +19 -16
- package/dist/types.d.ts +40 -10
- package/dist/types.js +0 -5
- package/package.json +12 -18
- package/dist/tools/shared/scan-types.d.ts +0 -200
- package/dist/tools/shared/scan-types.js +0 -7
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Review Feedback Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for reviewing collected feedback and extracting insights for AI learning.
|
|
5
|
-
* Reads feedback from the user's project (`<projectRoot>/.claude-feedback`).
|
|
6
|
-
*
|
|
7
|
-
* Pattern Analysis:
|
|
8
|
-
* - Success patterns: ≥3 occurrences, ≥80% success rate
|
|
9
|
-
* - Failure patterns: ≥2 occurrences
|
|
10
|
-
* - Quality trends: Identify degraded quality transformations
|
|
11
|
-
* - Outlier detection: Exclude anomalous feedback from learning
|
|
12
|
-
* - Analysis insights: kind 'analysis' records grouped by tool and category.
|
|
13
|
-
* They use their own completeness score (tool, claimed, actual, evidence)
|
|
14
|
-
* and never go through the duration/confidence outlier rules.
|
|
15
|
-
*
|
|
16
|
-
* Location Support:
|
|
17
|
-
* - 'both' (default): the project, plus the platform store when ANGULAR_MODERNIZER_PLATFORM_ROOT is set
|
|
18
|
-
* - Automatic session deduplication by sessionId
|
|
19
|
-
*/
|
|
20
1
|
import { FeedbackStorage, OutlierDetector, loadConfig, fromLegacyAnalysisRecord, scoreAnalysisCompleteness, summarizeAnalysisFeedback, } from '@angular-modernizer/core';
|
|
21
2
|
import { feedbackSessionDirs, feedbackStorageConfig, resolveFeedbackRoots, } from './helpers/platform-root-resolver.js';
|
|
22
3
|
import { STRING_ARRAY } from './helpers/investigation-schemas.js';
|
|
@@ -42,7 +23,22 @@ function describeReview(output) {
|
|
|
42
23
|
return lines.join('\n');
|
|
43
24
|
}
|
|
44
25
|
/**
|
|
45
|
-
*
|
|
26
|
+
* MCP tool for reviewing collected feedback and extracting insights for AI learning.
|
|
27
|
+
* Reads feedback from the user's project (`<projectRoot>/.claude-feedback`).
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Pattern Analysis:
|
|
31
|
+
* - Success patterns: ≥3 occurrences, ≥80% success rate
|
|
32
|
+
* - Failure patterns: ≥2 occurrences
|
|
33
|
+
* - Quality trends: Identify degraded quality transformations
|
|
34
|
+
* - Outlier detection: Exclude anomalous feedback from learning
|
|
35
|
+
* - Analysis insights: kind 'analysis' records grouped by tool and category.
|
|
36
|
+
* They use their own completeness score (tool, claimed, actual, evidence)
|
|
37
|
+
* and never go through the duration/confidence outlier rules.
|
|
38
|
+
*
|
|
39
|
+
* Location Support:
|
|
40
|
+
* - 'both' (default): the project, plus the platform store when ANGULAR_MODERNIZER_PLATFORM_ROOT is set
|
|
41
|
+
* - Automatic session deduplication by sessionId
|
|
46
42
|
*/
|
|
47
43
|
export class ReviewFeedbackTool {
|
|
48
44
|
name = 'review-feedback';
|
|
@@ -57,6 +53,10 @@ export class ReviewFeedbackTool {
|
|
|
57
53
|
'Reads <projectRoot>/.claude-feedback, plus the platform store when ANGULAR_MODERNIZER_PLATFORM_ROOT is set. ' +
|
|
58
54
|
'Detects success patterns, failure patterns, quality trends, and outliers. ' +
|
|
59
55
|
'summary is a short text with the counts, the success rate, the top insights and the quality warnings.';
|
|
56
|
+
/**
|
|
57
|
+
* JSON Schema of the tool arguments.
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
60
|
inputSchema = {
|
|
61
61
|
type: 'object',
|
|
62
62
|
additionalProperties: false,
|
|
@@ -109,6 +109,10 @@ export class ReviewFeedbackTool {
|
|
|
109
109
|
},
|
|
110
110
|
required: ['analysisType'],
|
|
111
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
114
|
+
* @hidden
|
|
115
|
+
*/
|
|
112
116
|
outputSchema = {
|
|
113
117
|
type: 'object',
|
|
114
118
|
properties: {
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Rollback Changes Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for rolling back transformations if validation fails or
|
|
5
|
-
* changes are unsatisfactory. Uses either git stash or file-level backups.
|
|
6
|
-
*/
|
|
7
1
|
import { type MCPTool, type ToolAnnotations } from '../types.js';
|
|
8
2
|
/**
|
|
9
3
|
* Rollback result.
|
|
10
4
|
*/
|
|
11
|
-
interface RollbackResult {
|
|
5
|
+
export interface RollbackResult {
|
|
12
6
|
/**
|
|
13
7
|
* Whether rollback was successful.
|
|
14
8
|
*/
|
|
@@ -29,7 +23,9 @@ interface RollbackResult {
|
|
|
29
23
|
* Additional metadata.
|
|
30
24
|
*/
|
|
31
25
|
metadata?: {
|
|
26
|
+
/** Number of restored files. */
|
|
32
27
|
totalFiles: number;
|
|
28
|
+
/** Rollback duration in milliseconds. */
|
|
33
29
|
duration?: number;
|
|
34
30
|
};
|
|
35
31
|
/**
|
|
@@ -38,13 +34,18 @@ interface RollbackResult {
|
|
|
38
34
|
summary: string;
|
|
39
35
|
}
|
|
40
36
|
/**
|
|
41
|
-
* MCP tool for
|
|
37
|
+
* MCP tool for rolling back transformations if validation fails or
|
|
38
|
+
* changes are unsatisfactory. Uses either git stash or file-level backups.
|
|
42
39
|
*/
|
|
43
40
|
export declare class RollbackChangesTool implements MCPTool {
|
|
44
41
|
name: string;
|
|
45
42
|
title: string;
|
|
46
43
|
annotations: ToolAnnotations;
|
|
47
44
|
description: string;
|
|
45
|
+
/**
|
|
46
|
+
* JSON Schema of the tool arguments.
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
48
49
|
inputSchema: {
|
|
49
50
|
type: string;
|
|
50
51
|
additionalProperties: boolean;
|
|
@@ -76,6 +77,10 @@ export declare class RollbackChangesTool implements MCPTool {
|
|
|
76
77
|
};
|
|
77
78
|
};
|
|
78
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
82
|
+
* @hidden
|
|
83
|
+
*/
|
|
79
84
|
outputSchema: {
|
|
80
85
|
type: string;
|
|
81
86
|
properties: {
|
|
@@ -115,5 +120,4 @@ export declare class RollbackChangesTool implements MCPTool {
|
|
|
115
120
|
};
|
|
116
121
|
execute(args: Record<string, unknown>): Promise<RollbackResult>;
|
|
117
122
|
}
|
|
118
|
-
export {};
|
|
119
123
|
//# sourceMappingURL=rollback-changes.d.ts.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Rollback Changes Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for rolling back transformations if validation fails or
|
|
5
|
-
* changes are unsatisfactory. Uses either git stash or file-level backups.
|
|
6
|
-
*/
|
|
7
1
|
import { RollbackStrategy } from '@angular-modernizer/core';
|
|
8
2
|
import { createProjectRollbackManager, findProjectRootOf, } from './helpers/transform-safety.js';
|
|
9
3
|
import { STRING_ARRAY } from './helpers/investigation-schemas.js';
|
|
@@ -23,7 +17,8 @@ function describeRollback(result) {
|
|
|
23
17
|
return lines.join('\n');
|
|
24
18
|
}
|
|
25
19
|
/**
|
|
26
|
-
* MCP tool for
|
|
20
|
+
* MCP tool for rolling back transformations if validation fails or
|
|
21
|
+
* changes are unsatisfactory. Uses either git stash or file-level backups.
|
|
27
22
|
*/
|
|
28
23
|
export class RollbackChangesTool {
|
|
29
24
|
name = 'rollback-changes';
|
|
@@ -36,6 +31,10 @@ export class RollbackChangesTool {
|
|
|
36
31
|
};
|
|
37
32
|
description = 'Rollback transformations if validation fails or changes are unsatisfactory. Restores the backups transform-code wrote into <projectRoot>/.angular-modernizer-backups (file copies, plus a git snapshot inside a git repository); without files it restores the files of the last transform-code call. ' +
|
|
38
33
|
'summary is a short text with the outcome and the restored files.';
|
|
34
|
+
/**
|
|
35
|
+
* JSON Schema of the tool arguments.
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
39
38
|
inputSchema = {
|
|
40
39
|
type: 'object',
|
|
41
40
|
additionalProperties: false,
|
|
@@ -65,6 +64,10 @@ export class RollbackChangesTool {
|
|
|
65
64
|
},
|
|
66
65
|
},
|
|
67
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
69
|
+
* @hidden
|
|
70
|
+
*/
|
|
68
71
|
outputSchema = {
|
|
69
72
|
type: 'object',
|
|
70
73
|
properties: {
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Run Angular CLI Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for executing Angular CLI commands programmatically.
|
|
5
|
-
* Enables AI assistants to run ng commands for project management,
|
|
6
|
-
* code generation, and build operations.
|
|
7
|
-
*/
|
|
8
1
|
import { type MCPTool, type ToolAnnotations, type ToolContext } from '../types.js';
|
|
9
2
|
/**
|
|
10
3
|
* Result of Angular CLI command execution.
|
|
11
4
|
*/
|
|
12
|
-
interface AngularCliResult {
|
|
5
|
+
export interface AngularCliResult {
|
|
13
6
|
/**
|
|
14
7
|
* Whether the command executed successfully.
|
|
15
8
|
*/
|
|
@@ -52,13 +45,19 @@ interface AngularCliResult {
|
|
|
52
45
|
summary: string;
|
|
53
46
|
}
|
|
54
47
|
/**
|
|
55
|
-
* MCP tool for executing Angular CLI commands.
|
|
48
|
+
* MCP tool for executing Angular CLI commands programmatically.
|
|
49
|
+
* Enables AI assistants to run ng commands for project management,
|
|
50
|
+
* code generation, and build operations.
|
|
56
51
|
*/
|
|
57
52
|
export declare class RunAngularCliTool implements MCPTool {
|
|
58
53
|
name: string;
|
|
59
54
|
title: string;
|
|
60
55
|
annotations: ToolAnnotations;
|
|
61
56
|
description: string;
|
|
57
|
+
/**
|
|
58
|
+
* JSON Schema of the tool arguments.
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
62
61
|
inputSchema: {
|
|
63
62
|
type: string;
|
|
64
63
|
additionalProperties: boolean;
|
|
@@ -99,6 +98,10 @@ export declare class RunAngularCliTool implements MCPTool {
|
|
|
99
98
|
};
|
|
100
99
|
required: string[];
|
|
101
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
103
|
+
* @hidden
|
|
104
|
+
*/
|
|
102
105
|
outputSchema: {
|
|
103
106
|
type: string;
|
|
104
107
|
properties: {
|
|
@@ -141,5 +144,4 @@ export declare class RunAngularCliTool implements MCPTool {
|
|
|
141
144
|
*/
|
|
142
145
|
private executeCommand;
|
|
143
146
|
}
|
|
144
|
-
export {};
|
|
145
147
|
//# sourceMappingURL=run-angular-cli.d.ts.map
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Run Angular CLI Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for executing Angular CLI commands programmatically.
|
|
5
|
-
* Enables AI assistants to run ng commands for project management,
|
|
6
|
-
* code generation, and build operations.
|
|
7
|
-
*/
|
|
8
1
|
import { spawn } from 'node:child_process';
|
|
9
2
|
import { processGroupOptions, terminateOnAbort, terminateProcessTree, } from '@angular-modernizer/core';
|
|
10
3
|
import { outputTail, seconds } from './helpers/process-output.js';
|
|
@@ -24,7 +17,9 @@ function withSummary(result) {
|
|
|
24
17
|
return { ...result, summary: describeCliRun(result) };
|
|
25
18
|
}
|
|
26
19
|
/**
|
|
27
|
-
* MCP tool for executing Angular CLI commands.
|
|
20
|
+
* MCP tool for executing Angular CLI commands programmatically.
|
|
21
|
+
* Enables AI assistants to run ng commands for project management,
|
|
22
|
+
* code generation, and build operations.
|
|
28
23
|
*/
|
|
29
24
|
export class RunAngularCliTool {
|
|
30
25
|
name = 'run-angular-cli';
|
|
@@ -37,6 +32,10 @@ export class RunAngularCliTool {
|
|
|
37
32
|
};
|
|
38
33
|
description = 'Execute Angular CLI commands for project management and code generation. ' +
|
|
39
34
|
'The result has the full stdout and stderr; summary is a short text with the exit code and, on failure, the last output lines.';
|
|
35
|
+
/**
|
|
36
|
+
* JSON Schema of the tool arguments.
|
|
37
|
+
* @hidden
|
|
38
|
+
*/
|
|
40
39
|
inputSchema = {
|
|
41
40
|
type: 'object',
|
|
42
41
|
additionalProperties: false,
|
|
@@ -83,6 +82,10 @@ export class RunAngularCliTool {
|
|
|
83
82
|
},
|
|
84
83
|
required: ['command'],
|
|
85
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
86
89
|
outputSchema = {
|
|
87
90
|
type: 'object',
|
|
88
91
|
properties: {
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Run Build Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for executing build systems and validating code transformations.
|
|
5
|
-
* Supports Angular CLI, Nx, Webpack, Vite, and auto-detection.
|
|
6
|
-
* Includes incremental build mode for efficient validation.
|
|
7
|
-
*/
|
|
8
1
|
import { type MCPTool, type ToolAnnotations, type ToolContext } from '../types.js';
|
|
9
2
|
import { type IncompatibilityCheck } from '@angular-modernizer/core';
|
|
10
3
|
/**
|
|
11
4
|
* Incremental build metadata
|
|
12
5
|
*/
|
|
13
|
-
interface IncrementalMetadata {
|
|
6
|
+
export interface IncrementalMetadata {
|
|
14
7
|
/**
|
|
15
8
|
* Whether incremental mode was enabled
|
|
16
9
|
*/
|
|
@@ -43,7 +36,7 @@ interface IncrementalMetadata {
|
|
|
43
36
|
/**
|
|
44
37
|
* Build execution result.
|
|
45
38
|
*/
|
|
46
|
-
interface BuildResult {
|
|
39
|
+
export interface BuildResult {
|
|
47
40
|
/**
|
|
48
41
|
* Whether the build was successful.
|
|
49
42
|
*/
|
|
@@ -102,13 +95,19 @@ interface BuildResult {
|
|
|
102
95
|
summary: string;
|
|
103
96
|
}
|
|
104
97
|
/**
|
|
105
|
-
* MCP tool for executing build systems.
|
|
98
|
+
* MCP tool for executing build systems and validating code transformations.
|
|
99
|
+
* Supports Angular CLI, Nx, Webpack, Vite, and auto-detection.
|
|
100
|
+
* Includes incremental build mode for efficient validation.
|
|
106
101
|
*/
|
|
107
102
|
export declare class RunBuildTool implements MCPTool {
|
|
108
103
|
name: string;
|
|
109
104
|
title: string;
|
|
110
105
|
annotations: ToolAnnotations;
|
|
111
106
|
description: string;
|
|
107
|
+
/**
|
|
108
|
+
* JSON Schema of the tool arguments.
|
|
109
|
+
* @hidden
|
|
110
|
+
*/
|
|
112
111
|
inputSchema: {
|
|
113
112
|
type: string;
|
|
114
113
|
additionalProperties: boolean;
|
|
@@ -174,6 +173,10 @@ export declare class RunBuildTool implements MCPTool {
|
|
|
174
173
|
};
|
|
175
174
|
required: string[];
|
|
176
175
|
};
|
|
176
|
+
/**
|
|
177
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
178
|
+
* @hidden
|
|
179
|
+
*/
|
|
177
180
|
outputSchema: {
|
|
178
181
|
type: string;
|
|
179
182
|
properties: {
|
|
@@ -309,5 +312,4 @@ export declare class RunBuildTool implements MCPTool {
|
|
|
309
312
|
*/
|
|
310
313
|
private parseBuildOutput;
|
|
311
314
|
}
|
|
312
|
-
export {};
|
|
313
315
|
//# sourceMappingURL=run-build.d.ts.map
|
package/dist/tools/run-build.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Run Build Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for executing build systems and validating code transformations.
|
|
5
|
-
* Supports Angular CLI, Nx, Webpack, Vite, and auto-detection.
|
|
6
|
-
* Includes incremental build mode for efficient validation.
|
|
7
|
-
*/
|
|
8
1
|
import { spawn, execSync } from 'node:child_process';
|
|
9
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
10
3
|
import { join } from 'node:path';
|
|
@@ -47,7 +40,9 @@ function describeBuild(result) {
|
|
|
47
40
|
return lines.join('\n');
|
|
48
41
|
}
|
|
49
42
|
/**
|
|
50
|
-
* MCP tool for executing build systems.
|
|
43
|
+
* MCP tool for executing build systems and validating code transformations.
|
|
44
|
+
* Supports Angular CLI, Nx, Webpack, Vite, and auto-detection.
|
|
45
|
+
* Includes incremental build mode for efficient validation.
|
|
51
46
|
*/
|
|
52
47
|
export class RunBuildTool {
|
|
53
48
|
name = 'run-build';
|
|
@@ -60,6 +55,10 @@ export class RunBuildTool {
|
|
|
60
55
|
};
|
|
61
56
|
description = 'Execute build systems to validate code transformations. Supports incremental mode for 2-4x faster builds by validating only changed files and their dependencies. Automatically detects incompatibilities and falls back to full build when needed. ' +
|
|
62
57
|
'The result has the full build output; summary is a short text with the outcome, the build mode and, on failure, the last output lines.';
|
|
58
|
+
/**
|
|
59
|
+
* JSON Schema of the tool arguments.
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
63
62
|
inputSchema = {
|
|
64
63
|
type: 'object',
|
|
65
64
|
additionalProperties: false,
|
|
@@ -121,6 +120,10 @@ export class RunBuildTool {
|
|
|
121
120
|
},
|
|
122
121
|
required: ['rootPath'],
|
|
123
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
125
|
+
* @hidden
|
|
126
|
+
*/
|
|
124
127
|
outputSchema = {
|
|
125
128
|
type: 'object',
|
|
126
129
|
properties: {
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Run Schematic Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for executing Angular schematics programmatically.
|
|
5
|
-
* Enables AI assistants to run code generation and migration schematics
|
|
6
|
-
* from built-in Angular collections or custom schematic libraries.
|
|
7
|
-
*/
|
|
8
1
|
import { type MCPTool, type ToolAnnotations, type ToolContext } from '../types.js';
|
|
9
2
|
/**
|
|
10
3
|
* Result of schematic execution.
|
|
11
4
|
*/
|
|
12
|
-
interface SchematicResult {
|
|
5
|
+
export interface SchematicResult {
|
|
13
6
|
/**
|
|
14
7
|
* Whether the schematic executed successfully.
|
|
15
8
|
*/
|
|
@@ -72,13 +65,19 @@ interface SchematicResult {
|
|
|
72
65
|
summary: string;
|
|
73
66
|
}
|
|
74
67
|
/**
|
|
75
|
-
* MCP tool for executing Angular schematics.
|
|
68
|
+
* MCP tool for executing Angular schematics programmatically.
|
|
69
|
+
* Enables AI assistants to run code generation and migration schematics
|
|
70
|
+
* from built-in Angular collections or custom schematic libraries.
|
|
76
71
|
*/
|
|
77
72
|
export declare class RunSchematicTool implements MCPTool {
|
|
78
73
|
name: string;
|
|
79
74
|
title: string;
|
|
80
75
|
annotations: ToolAnnotations;
|
|
81
76
|
description: string;
|
|
77
|
+
/**
|
|
78
|
+
* JSON Schema of the tool arguments.
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
82
81
|
inputSchema: {
|
|
83
82
|
type: string;
|
|
84
83
|
additionalProperties: boolean;
|
|
@@ -138,6 +137,10 @@ export declare class RunSchematicTool implements MCPTool {
|
|
|
138
137
|
};
|
|
139
138
|
required: string[];
|
|
140
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
142
|
+
* @hidden
|
|
143
|
+
*/
|
|
141
144
|
outputSchema: {
|
|
142
145
|
type: string;
|
|
143
146
|
properties: {
|
|
@@ -237,5 +240,4 @@ export declare class RunSchematicTool implements MCPTool {
|
|
|
237
240
|
*/
|
|
238
241
|
private extractWarnings;
|
|
239
242
|
}
|
|
240
|
-
export {};
|
|
241
243
|
//# sourceMappingURL=run-schematic.d.ts.map
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Run Schematic Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for executing Angular schematics programmatically.
|
|
5
|
-
* Enables AI assistants to run code generation and migration schematics
|
|
6
|
-
* from built-in Angular collections or custom schematic libraries.
|
|
7
|
-
*/
|
|
8
1
|
import { spawn } from 'node:child_process';
|
|
9
2
|
import { processGroupOptions, terminateOnAbort, terminateProcessTree, } from '@angular-modernizer/core';
|
|
10
3
|
import { existsSync } from 'node:fs';
|
|
@@ -83,7 +76,9 @@ const SAFE_SCHEMATIC_OPTIONS = new Set([
|
|
|
83
76
|
'defaults',
|
|
84
77
|
]);
|
|
85
78
|
/**
|
|
86
|
-
* MCP tool for executing Angular schematics.
|
|
79
|
+
* MCP tool for executing Angular schematics programmatically.
|
|
80
|
+
* Enables AI assistants to run code generation and migration schematics
|
|
81
|
+
* from built-in Angular collections or custom schematic libraries.
|
|
87
82
|
*/
|
|
88
83
|
export class RunSchematicTool {
|
|
89
84
|
name = 'run-schematic';
|
|
@@ -96,6 +91,10 @@ export class RunSchematicTool {
|
|
|
96
91
|
};
|
|
97
92
|
description = 'Execute Angular schematics for code generation and automated migrations. ' +
|
|
98
93
|
'The result has the full stdout and stderr; summary is a short text with the outcome, the generated files and, on failure, the last output lines.';
|
|
94
|
+
/**
|
|
95
|
+
* JSON Schema of the tool arguments.
|
|
96
|
+
* @hidden
|
|
97
|
+
*/
|
|
99
98
|
inputSchema = {
|
|
100
99
|
type: 'object',
|
|
101
100
|
additionalProperties: false,
|
|
@@ -155,6 +154,10 @@ export class RunSchematicTool {
|
|
|
155
154
|
},
|
|
156
155
|
required: ['schematic', 'target'],
|
|
157
156
|
};
|
|
157
|
+
/**
|
|
158
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
158
161
|
outputSchema = {
|
|
159
162
|
type: 'object',
|
|
160
163
|
properties: {
|
package/dist/tools/scan-all.d.ts
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Comprehensive Scan Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for comprehensive scanning with all plugins:
|
|
5
|
-
* - SolidPlugin (7 rules): SOLID principles
|
|
6
|
-
* - AngularPlugin (28 rules): Angular best practices
|
|
7
|
-
* - ArchitecturePlugin (17 rules): Architectural issues
|
|
8
|
-
* Total: 52 rules
|
|
9
|
-
*/
|
|
10
1
|
import type { MCPTool, ToolAnnotations, ToolContext } from '../types.js';
|
|
11
2
|
import { type CancelledExecution } from './helpers/tool-context.js';
|
|
12
3
|
import { type ScanCounts } from './helpers/analysis-output.js';
|
|
13
|
-
|
|
4
|
+
/** Result of the scan-all tool. */
|
|
5
|
+
export interface ScanAllResult {
|
|
6
|
+
/** The requested page of violations (`maxResults`, `resultOffset`). */
|
|
14
7
|
violations: {
|
|
8
|
+
/** Position-based id of the violation in the full result (`all-<index>`). */
|
|
15
9
|
id: string;
|
|
10
|
+
/** Rule that reported the violation, e.g. `solid:circular-dependency`. */
|
|
16
11
|
ruleId: string;
|
|
12
|
+
/** Severity reported by the rule. */
|
|
17
13
|
severity: 'error' | 'warning' | 'info';
|
|
14
|
+
/** Rule message. */
|
|
18
15
|
message: string;
|
|
16
|
+
/** File path relative to `rootPath`. */
|
|
19
17
|
filePath: string;
|
|
18
|
+
/** 1-based line of the finding, when the rule reports one. */
|
|
20
19
|
line?: number;
|
|
20
|
+
/** Column of the finding, when the rule reports one. */
|
|
21
21
|
column?: number;
|
|
22
|
+
/** Rule category; `General` when the rule sets none. */
|
|
22
23
|
category: string;
|
|
24
|
+
/** Fix suggested by the rule; only with `includeAutoFixes`. */
|
|
23
25
|
suggestedFix?: string;
|
|
26
|
+
/** Rule-specific details. */
|
|
24
27
|
metadata?: Record<string, unknown>;
|
|
25
28
|
}[];
|
|
26
29
|
/** Counts over all violations, independent of the page. */
|
|
@@ -29,60 +32,111 @@ interface ScanAllResult {
|
|
|
29
32
|
summary: string;
|
|
30
33
|
/** Set when the client cancelled the scan; counts cover the analyzed files. */
|
|
31
34
|
execution?: CancelledExecution;
|
|
35
|
+
/** Scan metadata. */
|
|
32
36
|
metadata: {
|
|
37
|
+
/** Ids of the rules that ran. */
|
|
33
38
|
rulesExecuted: string[];
|
|
39
|
+
/** Duration of the scan in milliseconds. */
|
|
34
40
|
duration: number;
|
|
41
|
+
/** Root path of the scanned project. */
|
|
35
42
|
projectRoot: string;
|
|
43
|
+
/** Cache figures of this run; same values as {@link ScanAllResult.cache}. */
|
|
36
44
|
cacheStats?: {
|
|
45
|
+
/** Files selected for the scan. */
|
|
37
46
|
totalFilesChecked: number;
|
|
47
|
+
/** Files whose findings came from the cache. */
|
|
38
48
|
filesFromCache: number;
|
|
49
|
+
/** Files analyzed in this run. */
|
|
39
50
|
filesToProcess: number;
|
|
51
|
+
/** Hit rate of the scan-all cache in percent. */
|
|
40
52
|
hitRate: number;
|
|
53
|
+
/** Cache hits per cache source. */
|
|
41
54
|
hitsBySource: Record<string, number>;
|
|
42
55
|
};
|
|
43
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Cache figures of this run. scan-all reads and writes only its own cache
|
|
59
|
+
* (`.angular-modernizer-cache/all/`); `hitRate` and `hitsBySource` refer to it.
|
|
60
|
+
*/
|
|
44
61
|
cache?: {
|
|
62
|
+
/** Files selected for the scan. */
|
|
45
63
|
totalFilesChecked: number;
|
|
64
|
+
/** Files whose findings came from the cache. */
|
|
46
65
|
filesFromCache: number;
|
|
66
|
+
/** Files analyzed in this run. */
|
|
47
67
|
filesToProcess: number;
|
|
68
|
+
/** Hit rate of the scan-all cache in percent. */
|
|
48
69
|
hitRate: number;
|
|
70
|
+
/** Cache hits per cache source. */
|
|
49
71
|
hitsBySource: Record<string, number>;
|
|
72
|
+
/** Statistics of the cache manager. */
|
|
50
73
|
stats: {
|
|
74
|
+
/** Entries in the cache. */
|
|
51
75
|
totalEntries: number;
|
|
76
|
+
/** Size of the cache in bytes. */
|
|
52
77
|
totalSize: number;
|
|
78
|
+
/** Cache hits. */
|
|
53
79
|
hits: number;
|
|
80
|
+
/** Cache misses. */
|
|
54
81
|
misses: number;
|
|
82
|
+
/** Hit rate in percent. */
|
|
55
83
|
hitRate: number;
|
|
84
|
+
/** Entries per entry type. */
|
|
56
85
|
entriesByType: {
|
|
86
|
+
/** AST entries. */
|
|
57
87
|
ast: number;
|
|
88
|
+
/** Analysis result entries. */
|
|
58
89
|
analysis: number;
|
|
59
90
|
};
|
|
60
91
|
};
|
|
61
92
|
};
|
|
93
|
+
/** Orchestration figures; set only when `orchestration.useWorkerThreads` is set. */
|
|
62
94
|
orchestration?: {
|
|
95
|
+
/** Whether the scan ran in parallel. */
|
|
63
96
|
parallel: boolean;
|
|
97
|
+
/** Whether only changed files were analyzed (always `false` here). */
|
|
64
98
|
incremental: boolean;
|
|
99
|
+
/** Files selected for the scan. */
|
|
65
100
|
filesAnalyzed: number;
|
|
101
|
+
/** Files skipped (always 0 here). */
|
|
66
102
|
filesSkipped: number;
|
|
103
|
+
/** Hit rate of the cache in percent. */
|
|
67
104
|
cacheHitRate: number;
|
|
105
|
+
/** Duration of the scan in milliseconds. */
|
|
68
106
|
duration: number;
|
|
107
|
+
/** Files per second. */
|
|
69
108
|
throughput: number;
|
|
70
109
|
};
|
|
110
|
+
/** What the page covers of all violations. */
|
|
71
111
|
pagination?: {
|
|
112
|
+
/** Number of all violations. */
|
|
72
113
|
totalResults: number;
|
|
114
|
+
/** Number of violations in this page. */
|
|
73
115
|
returnedResults: number;
|
|
116
|
+
/** Offset of the page (`resultOffset`). */
|
|
74
117
|
offset: number;
|
|
118
|
+
/** Whether violations follow after this page. */
|
|
75
119
|
hasMore: boolean;
|
|
76
120
|
};
|
|
77
121
|
}
|
|
78
122
|
/**
|
|
79
|
-
*
|
|
123
|
+
* MCP tool `scan-all`: one scan with all analysis plugins (52 rules total).
|
|
124
|
+
*
|
|
125
|
+
* @remarks
|
|
126
|
+
* Plugins and rules:
|
|
127
|
+
* - SolidPlugin (7 rules): SOLID principles
|
|
128
|
+
* - AngularPlugin (28 rules): Angular best practices
|
|
129
|
+
* - ArchitecturePlugin (17 rules): architectural issues
|
|
80
130
|
*/
|
|
81
131
|
export declare class ScanAllTool implements MCPTool {
|
|
82
132
|
readonly name = "scan-all";
|
|
83
133
|
readonly title = "Scan All Rules";
|
|
84
134
|
readonly annotations: ToolAnnotations;
|
|
85
135
|
readonly description: string;
|
|
136
|
+
/**
|
|
137
|
+
* JSON Schema of the tool arguments.
|
|
138
|
+
* @hidden
|
|
139
|
+
*/
|
|
86
140
|
readonly inputSchema: {
|
|
87
141
|
type: string;
|
|
88
142
|
additionalProperties: boolean;
|
|
@@ -152,6 +206,10 @@ export declare class ScanAllTool implements MCPTool {
|
|
|
152
206
|
};
|
|
153
207
|
required: string[];
|
|
154
208
|
};
|
|
209
|
+
/**
|
|
210
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
211
|
+
* @hidden
|
|
212
|
+
*/
|
|
155
213
|
readonly outputSchema: {
|
|
156
214
|
type: "object";
|
|
157
215
|
properties: Record<string, unknown>;
|
|
@@ -164,5 +222,4 @@ export declare class ScanAllTool implements MCPTool {
|
|
|
164
222
|
*/
|
|
165
223
|
private loadConfig;
|
|
166
224
|
}
|
|
167
|
-
export {};
|
|
168
225
|
//# sourceMappingURL=scan-all.d.ts.map
|