@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.
- package/README.md +181 -282
- package/dist/cli.js +21 -13
- package/dist/core/project-analyzer.d.ts +3 -12
- package/dist/core/project-analyzer.js +3 -12
- package/dist/index.d.ts +122 -6
- package/dist/index.js +49 -5
- package/dist/mcp-watcher.d.ts +32 -7
- package/dist/mcp-watcher.js +16 -15
- 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 +75 -0
- package/dist/server/limited-stdio-transport.js +115 -0
- package/dist/server/mcp-server.d.ts +20 -18
- package/dist/server/mcp-server.js +42 -79
- package/dist/server/package-version.d.ts +16 -0
- package/dist/server/package-version.js +37 -0
- package/dist/server/sdk-server.d.ts +71 -0
- package/dist/server/sdk-server.js +113 -0
- package/dist/server/tool-registry.d.ts +6 -9
- package/dist/server/tool-registry.js +6 -12
- 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 +276 -35
- package/dist/tools/analyze-build-impact.js +175 -28
- package/dist/tools/analyze-core-to-shared.d.ts +176 -16
- package/dist/tools/analyze-core-to-shared.js +124 -19
- package/dist/tools/analyze-parser-performance.d.ts +209 -15
- package/dist/tools/analyze-parser-performance.js +119 -56
- package/dist/tools/analyze-project.d.ts +349 -17
- package/dist/tools/analyze-project.js +282 -97
- package/dist/tools/check-incremental-compatibility.d.ts +74 -12
- package/dist/tools/check-incremental-compatibility.js +69 -10
- package/dist/tools/collect-feedback.d.ts +225 -21
- package/dist/tools/collect-feedback.js +199 -118
- package/dist/tools/compare-health.d.ts +413 -0
- package/dist/tools/compare-health.js +479 -0
- package/dist/tools/extract-libraries.d.ts +200 -24
- package/dist/tools/extract-libraries.js +131 -27
- package/dist/tools/find-angular-symbol.d.ts +92 -24
- package/dist/tools/find-angular-symbol.js +70 -20
- package/dist/tools/find-component-hosts.d.ts +603 -27
- package/dist/tools/find-component-hosts.js +223 -19
- package/dist/tools/find-usages.d.ts +102 -22
- package/dist/tools/find-usages.js +81 -21
- package/dist/tools/get-bootstrap-execution.d.ts +183 -25
- package/dist/tools/get-bootstrap-execution.js +109 -25
- package/dist/tools/get-call-graph.d.ts +127 -12
- package/dist/tools/get-call-graph.js +84 -19
- package/dist/tools/get-operation-progress-tool.d.ts +126 -8
- package/dist/tools/get-operation-progress-tool.js +124 -12
- package/dist/tools/get-operation-progress.d.ts +27 -1
- package/dist/tools/get-operation-progress.js +5 -5
- package/dist/tools/helpers/analysis-output.d.ts +182 -0
- package/dist/tools/helpers/analysis-output.js +165 -0
- package/dist/tools/helpers/batch-kernel.d.ts +14 -0
- package/dist/tools/helpers/batch-kernel.js +12 -0
- package/dist/tools/helpers/build-schemas.d.ts +36 -0
- package/dist/tools/helpers/build-schemas.js +23 -0
- package/dist/tools/helpers/citation-file-source.d.ts +10 -0
- package/dist/tools/helpers/citation-file-source.js +82 -0
- package/dist/tools/helpers/compact-output.d.ts +2 -1
- package/dist/tools/helpers/compact-output.js +2 -1
- package/dist/tools/helpers/finding-window.d.ts +43 -0
- package/dist/tools/helpers/finding-window.js +64 -0
- package/dist/tools/helpers/health-delta.d.ts +99 -0
- package/dist/tools/helpers/health-delta.js +236 -0
- package/dist/tools/helpers/investigation-schemas.d.ts +93 -0
- package/dist/tools/helpers/investigation-schemas.js +48 -0
- package/dist/tools/helpers/library-imports.d.ts +57 -0
- package/dist/tools/helpers/library-imports.js +151 -0
- package/dist/tools/helpers/load-source-files.d.ts +30 -0
- package/dist/tools/helpers/load-source-files.js +34 -0
- package/dist/tools/helpers/output-contract.d.ts +32 -0
- package/dist/tools/helpers/output-contract.js +32 -0
- package/dist/tools/helpers/platform-root-resolver.d.ts +55 -25
- package/dist/tools/helpers/platform-root-resolver.js +75 -48
- package/dist/tools/helpers/process-output.d.ts +19 -0
- package/dist/tools/helpers/process-output.js +31 -0
- package/dist/tools/helpers/project-cache.d.ts +60 -37
- package/dist/tools/helpers/project-cache.js +54 -37
- package/dist/tools/helpers/project-decorators.d.ts +14 -0
- package/dist/tools/helpers/project-decorators.js +22 -0
- package/dist/tools/helpers/rule-matcher.js +5 -0
- package/dist/tools/helpers/rule-runner.d.ts +25 -13
- package/dist/tools/helpers/rule-runner.js +45 -24
- package/dist/tools/helpers/scan-cache.d.ts +22 -0
- package/dist/tools/helpers/scan-cache.js +34 -0
- package/dist/tools/helpers/scan-engine.d.ts +107 -0
- package/dist/tools/helpers/scan-engine.js +197 -0
- package/dist/tools/helpers/scan-plan.d.ts +5 -2
- package/dist/tools/helpers/scan-plan.js +18 -3
- package/dist/tools/helpers/scope-paths.d.ts +17 -0
- package/dist/tools/helpers/scope-paths.js +32 -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 +63 -0
- package/dist/tools/helpers/tool-context.js +79 -0
- package/dist/tools/helpers/transform-safety.d.ts +40 -0
- package/dist/tools/helpers/transform-safety.js +87 -0
- package/dist/tools/helpers/validation-output.d.ts +53 -0
- package/dist/tools/helpers/validation-output.js +48 -0
- package/dist/tools/inspect-form-group.d.ts +262 -24
- package/dist/tools/inspect-form-group.js +134 -13
- package/dist/tools/inspect-i18n.d.ts +410 -23
- package/dist/tools/inspect-i18n.js +213 -13
- package/dist/tools/inspect-template.d.ts +260 -22
- package/dist/tools/inspect-template.js +174 -13
- package/dist/tools/learn-patterns.d.ts +210 -13
- package/dist/tools/learn-patterns.js +113 -12
- package/dist/tools/list-imports.d.ts +152 -34
- package/dist/tools/list-imports.js +124 -18
- package/dist/tools/orchestrate-migration.d.ts +159 -14
- package/dist/tools/orchestrate-migration.js +147 -20
- package/dist/tools/parse-stack-trace.d.ts +78 -21
- package/dist/tools/parse-stack-trace.js +44 -7
- package/dist/tools/plan-migration.d.ts +395 -26
- package/dist/tools/plan-migration.js +173 -22
- package/dist/tools/resolve-type.d.ts +57 -9
- package/dist/tools/resolve-type.js +49 -12
- package/dist/tools/review-feedback.d.ts +214 -16
- package/dist/tools/review-feedback.js +142 -57
- package/dist/tools/rollback-changes.d.ts +88 -7
- package/dist/tools/rollback-changes.js +74 -19
- package/dist/tools/run-angular-cli.d.ts +57 -12
- package/dist/tools/run-angular-cli.js +76 -13
- package/dist/tools/run-build.d.ts +127 -13
- package/dist/tools/run-build.js +128 -16
- package/dist/tools/run-schematic.d.ts +82 -12
- package/dist/tools/run-schematic.js +115 -18
- package/dist/tools/scan-all.d.ts +88 -23
- package/dist/tools/scan-all.js +161 -220
- package/dist/tools/scan-angular.d.ts +60 -19
- package/dist/tools/scan-angular.js +100 -141
- package/dist/tools/scan-architecture.d.ts +92 -24
- package/dist/tools/scan-architecture.js +268 -211
- package/dist/tools/scan-solid.d.ts +59 -19
- package/dist/tools/scan-solid.js +98 -139
- package/dist/tools/search-codebase.d.ts +110 -23
- package/dist/tools/search-codebase.js +67 -11
- package/dist/tools/server-status.d.ts +392 -26
- package/dist/tools/server-status.js +260 -27
- package/dist/tools/suggest-improvements.d.ts +105 -10
- package/dist/tools/suggest-improvements.js +91 -51
- package/dist/tools/trace-output-flow.d.ts +713 -26
- package/dist/tools/trace-output-flow.js +396 -33
- package/dist/tools/transform-code-batch.d.ts +3 -0
- package/dist/tools/transform-code-batch.js +10 -5
- package/dist/tools/transform-code.d.ts +402 -18
- package/dist/tools/transform-code.js +708 -649
- package/dist/tools/validate-before-transform.d.ts +136 -7
- package/dist/tools/validate-before-transform.js +65 -9
- package/dist/tools/validate-project-compatibility.d.ts +82 -15
- package/dist/tools/validate-project-compatibility.js +84 -15
- package/dist/tools/validate-transformation.d.ts +243 -8
- package/dist/tools/validate-transformation.js +127 -23
- package/dist/tools/verify-citations.d.ts +202 -0
- package/dist/tools/verify-citations.js +221 -0
- package/dist/types.d.ts +78 -11
- package/dist/types.js +0 -5
- package/dist/utils/format-tool-response.d.ts +22 -59
- package/dist/utils/format-tool-response.js +25 -134
- package/package.json +31 -20
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/core/project-analyzer.d.ts.map +0 -1
- package/dist/core/project-analyzer.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp-watcher.d.ts.map +0 -1
- package/dist/mcp-watcher.js.map +0 -1
- package/dist/server/json-rpc-handler.d.ts +0 -98
- package/dist/server/json-rpc-handler.d.ts.map +0 -1
- package/dist/server/json-rpc-handler.js +0 -301
- package/dist/server/json-rpc-handler.js.map +0 -1
- package/dist/server/mcp-server.d.ts.map +0 -1
- package/dist/server/mcp-server.js.map +0 -1
- package/dist/server/stdio-guard.d.ts.map +0 -1
- package/dist/server/stdio-guard.js.map +0 -1
- package/dist/server/tool-registry.d.ts.map +0 -1
- package/dist/server/tool-registry.js.map +0 -1
- package/dist/streaming/progress-store.d.ts.map +0 -1
- package/dist/streaming/progress-store.js.map +0 -1
- package/dist/tools/analyze-build-impact.d.ts.map +0 -1
- package/dist/tools/analyze-build-impact.js.map +0 -1
- package/dist/tools/analyze-core-to-shared.d.ts.map +0 -1
- package/dist/tools/analyze-core-to-shared.js.map +0 -1
- package/dist/tools/analyze-parser-performance.d.ts.map +0 -1
- package/dist/tools/analyze-parser-performance.js.map +0 -1
- package/dist/tools/analyze-project.d.ts.map +0 -1
- package/dist/tools/analyze-project.js.map +0 -1
- package/dist/tools/check-incremental-compatibility.d.ts.map +0 -1
- package/dist/tools/check-incremental-compatibility.js.map +0 -1
- package/dist/tools/collect-feedback.d.ts.map +0 -1
- package/dist/tools/collect-feedback.js.map +0 -1
- package/dist/tools/extract-libraries.d.ts.map +0 -1
- package/dist/tools/extract-libraries.js.map +0 -1
- package/dist/tools/find-angular-symbol.d.ts.map +0 -1
- package/dist/tools/find-angular-symbol.js.map +0 -1
- package/dist/tools/find-component-hosts.d.ts.map +0 -1
- package/dist/tools/find-component-hosts.js.map +0 -1
- package/dist/tools/find-usages.d.ts.map +0 -1
- package/dist/tools/find-usages.js.map +0 -1
- package/dist/tools/get-bootstrap-execution.d.ts.map +0 -1
- package/dist/tools/get-bootstrap-execution.js.map +0 -1
- package/dist/tools/get-call-graph.d.ts.map +0 -1
- package/dist/tools/get-call-graph.js.map +0 -1
- package/dist/tools/get-operation-progress-tool.d.ts.map +0 -1
- package/dist/tools/get-operation-progress-tool.js.map +0 -1
- package/dist/tools/get-operation-progress.d.ts.map +0 -1
- package/dist/tools/get-operation-progress.js.map +0 -1
- package/dist/tools/helpers/compact-output.d.ts.map +0 -1
- package/dist/tools/helpers/compact-output.js.map +0 -1
- package/dist/tools/helpers/feedback-analyzer.d.ts.map +0 -1
- package/dist/tools/helpers/feedback-analyzer.js.map +0 -1
- package/dist/tools/helpers/find-ts-config.d.ts.map +0 -1
- package/dist/tools/helpers/find-ts-config.js.map +0 -1
- package/dist/tools/helpers/platform-root-resolver.d.ts.map +0 -1
- package/dist/tools/helpers/platform-root-resolver.js.map +0 -1
- package/dist/tools/helpers/project-cache.d.ts.map +0 -1
- package/dist/tools/helpers/project-cache.js.map +0 -1
- package/dist/tools/helpers/rule-matcher.d.ts.map +0 -1
- package/dist/tools/helpers/rule-matcher.js.map +0 -1
- package/dist/tools/helpers/rule-runner.d.ts.map +0 -1
- package/dist/tools/helpers/rule-runner.js.map +0 -1
- package/dist/tools/helpers/scan-plan.d.ts.map +0 -1
- package/dist/tools/helpers/scan-plan.js.map +0 -1
- package/dist/tools/helpers/stack-frame-file-index.d.ts.map +0 -1
- package/dist/tools/helpers/stack-frame-file-index.js.map +0 -1
- package/dist/tools/helpers/suggestion-generator.d.ts.map +0 -1
- package/dist/tools/helpers/suggestion-generator.js.map +0 -1
- package/dist/tools/inspect-form-group.d.ts.map +0 -1
- package/dist/tools/inspect-form-group.js.map +0 -1
- package/dist/tools/inspect-i18n.d.ts.map +0 -1
- package/dist/tools/inspect-i18n.js.map +0 -1
- package/dist/tools/inspect-template.d.ts.map +0 -1
- package/dist/tools/inspect-template.js.map +0 -1
- package/dist/tools/learn-patterns.d.ts.map +0 -1
- package/dist/tools/learn-patterns.js.map +0 -1
- package/dist/tools/list-imports.d.ts.map +0 -1
- package/dist/tools/list-imports.js.map +0 -1
- package/dist/tools/orchestrate-migration.d.ts.map +0 -1
- package/dist/tools/orchestrate-migration.js.map +0 -1
- package/dist/tools/parse-stack-trace.d.ts.map +0 -1
- package/dist/tools/parse-stack-trace.js.map +0 -1
- package/dist/tools/plan-migration.d.ts.map +0 -1
- package/dist/tools/plan-migration.js.map +0 -1
- package/dist/tools/resolve-type.d.ts.map +0 -1
- package/dist/tools/resolve-type.js.map +0 -1
- package/dist/tools/review-feedback.d.ts.map +0 -1
- package/dist/tools/review-feedback.js.map +0 -1
- package/dist/tools/rollback-changes.d.ts.map +0 -1
- package/dist/tools/rollback-changes.js.map +0 -1
- package/dist/tools/run-angular-cli.d.ts.map +0 -1
- package/dist/tools/run-angular-cli.js.map +0 -1
- package/dist/tools/run-build.d.ts.map +0 -1
- package/dist/tools/run-build.js.map +0 -1
- package/dist/tools/run-schematic.d.ts.map +0 -1
- package/dist/tools/run-schematic.js.map +0 -1
- package/dist/tools/scan-all.d.ts.map +0 -1
- package/dist/tools/scan-all.js.map +0 -1
- package/dist/tools/scan-angular.d.ts.map +0 -1
- package/dist/tools/scan-angular.js.map +0 -1
- package/dist/tools/scan-architecture.d.ts.map +0 -1
- package/dist/tools/scan-architecture.js.map +0 -1
- package/dist/tools/scan-solid.d.ts.map +0 -1
- package/dist/tools/scan-solid.js.map +0 -1
- package/dist/tools/search-codebase.d.ts.map +0 -1
- package/dist/tools/search-codebase.js.map +0 -1
- package/dist/tools/server-status.d.ts.map +0 -1
- package/dist/tools/server-status.js.map +0 -1
- package/dist/tools/shared/scan-types.d.ts +0 -200
- package/dist/tools/shared/scan-types.d.ts.map +0 -1
- package/dist/tools/shared/scan-types.js +0 -7
- package/dist/tools/shared/scan-types.js.map +0 -1
- package/dist/tools/suggest-improvements.d.ts.map +0 -1
- package/dist/tools/suggest-improvements.js.map +0 -1
- package/dist/tools/trace-output-flow.d.ts.map +0 -1
- package/dist/tools/trace-output-flow.js.map +0 -1
- package/dist/tools/transform-code-batch.d.ts.map +0 -1
- package/dist/tools/transform-code-batch.js.map +0 -1
- package/dist/tools/transform-code.d.ts.map +0 -1
- package/dist/tools/transform-code.js.map +0 -1
- package/dist/tools/validate-before-transform.d.ts.map +0 -1
- package/dist/tools/validate-before-transform.js.map +0 -1
- package/dist/tools/validate-project-compatibility.d.ts.map +0 -1
- package/dist/tools/validate-project-compatibility.js.map +0 -1
- package/dist/tools/validate-transformation.d.ts.map +0 -1
- package/dist/tools/validate-transformation.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/format-tool-response.d.ts.map +0 -1
- package/dist/utils/format-tool-response.js.map +0 -1
|
@@ -1,43 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
* @angular-modernizer/adapter-mcp - Plan Migration Tool
|
|
3
|
-
*
|
|
4
|
-
* MCP tool for creating optimal migration strategies based on
|
|
5
|
-
* detected architectural issues, SOLID principle violations,
|
|
6
|
-
* and codebase style conventions. Integrates with the self-learning
|
|
7
|
-
* pattern infrastructure for style-aware migration planning.
|
|
8
|
-
*
|
|
9
|
-
* Enhancement: Style-aware migration planning that respects
|
|
10
|
-
* existing codebase conventions (RxJS patterns, DI style, etc.)
|
|
11
|
-
*
|
|
12
|
-
* Scan-based planning: when violations carry `filePath` (inline or from a
|
|
13
|
-
* saved scan-architecture result via `scanResultFile`) and `projectRoot` is
|
|
14
|
-
* set, the roadmap is built from the files themselves: grouped per file and
|
|
15
|
-
* layer, ordered dependencies first along the import graph, import cycles
|
|
16
|
-
* kept together (core `buildViolationPlan`). Otherwise the strategy templates
|
|
17
|
-
* decide the roadmap as before.
|
|
18
|
-
*/
|
|
19
|
-
import { type MCPTool } from '../types.js';
|
|
1
|
+
import { type MCPTool, type ToolAnnotations } from '../types.js';
|
|
20
2
|
import { type ProjectCache } from './helpers/project-cache.js';
|
|
21
3
|
import type { PlannedFile, PlannedPhase, ViolationPlan } from '@angular-modernizer/core';
|
|
22
4
|
/**
|
|
23
5
|
* Style-aware risk assessment result
|
|
24
6
|
*/
|
|
25
|
-
interface StyleAwareRiskAssessment {
|
|
7
|
+
export interface StyleAwareRiskAssessment {
|
|
8
|
+
/** Overall risk from 0 to 100: base risk, style deviation and team context. */
|
|
26
9
|
overallRisk: number;
|
|
10
|
+
/** Risk level of `overallRisk`: below 30 low, below 50 medium, below 70 high, else critical. */
|
|
27
11
|
riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
12
|
+
/** Average deviation of the steps from the codebase style, 0 to 100. */
|
|
28
13
|
styleDeviationScore: number;
|
|
14
|
+
/** Recommendations to keep the codebase style. */
|
|
29
15
|
styleRecommendations: string[];
|
|
16
|
+
/** Measures that lower the risk. */
|
|
30
17
|
mitigations: {
|
|
18
|
+
/** Area of the mitigation, e.g. `style` or `technical`. */
|
|
31
19
|
category: string;
|
|
20
|
+
/** What to do. */
|
|
32
21
|
description: string;
|
|
22
|
+
/** Expected risk reduction in points. */
|
|
33
23
|
riskReduction: number;
|
|
24
|
+
/** Effort of the mitigation. */
|
|
34
25
|
effort: 'low' | 'medium' | 'high';
|
|
35
26
|
}[];
|
|
36
27
|
}
|
|
37
28
|
/**
|
|
38
29
|
* Migration step definition.
|
|
39
30
|
*/
|
|
40
|
-
interface MigrationStep {
|
|
31
|
+
export interface MigrationStep {
|
|
41
32
|
/**
|
|
42
33
|
* Step name.
|
|
43
34
|
*/
|
|
@@ -62,7 +53,7 @@ interface MigrationStep {
|
|
|
62
53
|
/**
|
|
63
54
|
* Migration strategy definition.
|
|
64
55
|
*/
|
|
65
|
-
interface MigrationStrategy {
|
|
56
|
+
export interface MigrationStrategy {
|
|
66
57
|
/**
|
|
67
58
|
* Strategy ID.
|
|
68
59
|
*/
|
|
@@ -111,7 +102,7 @@ interface MigrationStrategy {
|
|
|
111
102
|
/**
|
|
112
103
|
* Plan migration tool result.
|
|
113
104
|
*/
|
|
114
|
-
interface PlanMigrationResult {
|
|
105
|
+
export interface PlanMigrationResult {
|
|
115
106
|
/**
|
|
116
107
|
* Recommended migration strategy.
|
|
117
108
|
*/
|
|
@@ -124,21 +115,31 @@ interface PlanMigrationResult {
|
|
|
124
115
|
* Strategy selection reasoning.
|
|
125
116
|
*/
|
|
126
117
|
reasoning: {
|
|
118
|
+
/** Main factors behind the choice. */
|
|
127
119
|
primaryFactors: string[];
|
|
120
|
+
/** How the constraints influenced the choice. */
|
|
128
121
|
constraintImpact: string[];
|
|
122
|
+
/** Risk assessment of the choice. */
|
|
129
123
|
riskAssessment: string;
|
|
130
124
|
};
|
|
131
125
|
/**
|
|
132
126
|
* Implementation roadmap.
|
|
133
127
|
*/
|
|
134
128
|
roadmap: {
|
|
129
|
+
/** Roadmap stages in execution order. */
|
|
135
130
|
phases: {
|
|
131
|
+
/** Stage name. */
|
|
136
132
|
name: string;
|
|
133
|
+
/** Estimated duration as text. */
|
|
137
134
|
duration: string;
|
|
135
|
+
/** Steps of the stage. */
|
|
138
136
|
steps: MigrationStep[];
|
|
137
|
+
/** Results of the stage. */
|
|
139
138
|
deliverables: string[];
|
|
140
139
|
}[];
|
|
140
|
+
/** Estimated total duration as text. */
|
|
141
141
|
totalDuration: string;
|
|
142
|
+
/** Milestones of the roadmap. */
|
|
142
143
|
milestones: string[];
|
|
143
144
|
};
|
|
144
145
|
/**
|
|
@@ -166,18 +167,26 @@ interface PlanMigrationResult {
|
|
|
166
167
|
* Steps that conflict with codebase style conventions.
|
|
167
168
|
*/
|
|
168
169
|
styleConflictingSteps?: {
|
|
170
|
+
/** Name of the conflicting step. */
|
|
169
171
|
stepName: string;
|
|
172
|
+
/** Why the step conflicts with the codebase style. */
|
|
170
173
|
conflictReason: string;
|
|
174
|
+
/** How to keep the style. */
|
|
171
175
|
styleRecommendation: string;
|
|
172
176
|
}[];
|
|
173
177
|
/**
|
|
174
178
|
* Style preservation recommendations.
|
|
175
179
|
*/
|
|
176
180
|
styleRecommendations?: {
|
|
181
|
+
/** Style area. */
|
|
177
182
|
category: 'rxjs' | 'di' | 'state-management' | 'naming' | 'architecture';
|
|
183
|
+
/** Current style of the codebase. */
|
|
178
184
|
currentStyle: string;
|
|
185
|
+
/** Recommendation. */
|
|
179
186
|
recommendation: string;
|
|
187
|
+
/** Why the recommendation applies. */
|
|
180
188
|
reasoning: string;
|
|
189
|
+
/** Names of the affected steps. */
|
|
181
190
|
affectedSteps: string[];
|
|
182
191
|
}[];
|
|
183
192
|
/**
|
|
@@ -188,33 +197,66 @@ interface PlanMigrationResult {
|
|
|
188
197
|
* Migration steps with style alignment scores.
|
|
189
198
|
*/
|
|
190
199
|
stepsWithStyleAnalysis?: {
|
|
200
|
+
/** The analyzed step. */
|
|
191
201
|
step: MigrationStep;
|
|
202
|
+
/** Style alignment score of the step. */
|
|
192
203
|
styleAlignmentScore: number;
|
|
204
|
+
/** `true` when the score reaches `styleAlignmentThreshold`. */
|
|
193
205
|
alignsWithStyle: boolean;
|
|
206
|
+
/** Style problems of the step. */
|
|
194
207
|
styleWarnings: string[];
|
|
195
208
|
}[];
|
|
209
|
+
/**
|
|
210
|
+
* Human-readable summary for LLM consumption.
|
|
211
|
+
*/
|
|
212
|
+
summary: string;
|
|
213
|
+
/**
|
|
214
|
+
* Conditions that can make the scan-based plan incomplete (unresolved
|
|
215
|
+
* library imports).
|
|
216
|
+
*/
|
|
217
|
+
warnings?: string[];
|
|
196
218
|
}
|
|
197
219
|
/**
|
|
198
220
|
* File-level plan in the tool output.
|
|
199
221
|
*/
|
|
200
|
-
interface ScanPlanOutput {
|
|
222
|
+
export interface ScanPlanOutput {
|
|
223
|
+
/** Short text of the file-level plan. */
|
|
201
224
|
summary: string;
|
|
202
225
|
/** List cap in effect (files per phase, violations per file); absent with summaryOnly. */
|
|
203
226
|
maxResults?: number;
|
|
227
|
+
/** Where the layers came from: `layersSource`, `layers` or none. */
|
|
204
228
|
layerSource: 'layersSource' | 'layers' | 'none';
|
|
229
|
+
/** Files of the import graph (size of the analyzed program). */
|
|
205
230
|
graphFiles: number;
|
|
231
|
+
/** Plan statistics from core `buildViolationPlan`. */
|
|
206
232
|
stats: ViolationPlan['stats'];
|
|
233
|
+
/** Import cycles kept together in the plan. */
|
|
207
234
|
cycles: ViolationPlan['cycles'];
|
|
235
|
+
/** Plan phases, one per dependency level, dependencies first. */
|
|
208
236
|
phases: (Omit<PlannedPhase, 'files'> & {
|
|
237
|
+
/** Files of the phase, cut to `maxResults`; absent with summaryOnly. */
|
|
209
238
|
files?: (PlannedFile & {
|
|
239
|
+
/** `true` when `maxResults` cut the violations of the file. */
|
|
210
240
|
violationsTruncated?: boolean;
|
|
211
241
|
})[];
|
|
242
|
+
/** `true` when `maxResults` cut the file list. */
|
|
212
243
|
truncated?: boolean;
|
|
213
244
|
})[];
|
|
245
|
+
/** Problems while building the plan, e.g. violation files outside the TypeScript program. */
|
|
214
246
|
warnings: string[];
|
|
215
247
|
}
|
|
216
248
|
/**
|
|
217
|
-
* MCP tool
|
|
249
|
+
* MCP tool `plan-migration`: builds a migration strategy and roadmap from
|
|
250
|
+
* detected architecture and SOLID violations and, with a style profile from
|
|
251
|
+
* learn-patterns, from the codebase conventions (RxJS patterns, DI style).
|
|
252
|
+
*
|
|
253
|
+
* @remarks
|
|
254
|
+
* Scan-based planning: when violations carry `filePath` (inline or from a
|
|
255
|
+
* saved scan-architecture result via `scanResultFile`) and `projectRoot` is
|
|
256
|
+
* set, the roadmap is built from the files themselves: grouped per file and
|
|
257
|
+
* layer, ordered dependencies first along the import graph, import cycles
|
|
258
|
+
* kept together (core `buildViolationPlan`, `planSource: 'scan'`). Otherwise
|
|
259
|
+
* the strategy templates decide the roadmap (`planSource: 'template'`).
|
|
218
260
|
*/
|
|
219
261
|
export declare class PlanMigrationTool implements MCPTool {
|
|
220
262
|
private readonly projects?;
|
|
@@ -224,9 +266,16 @@ export declare class PlanMigrationTool implements MCPTool {
|
|
|
224
266
|
*/
|
|
225
267
|
constructor(projects?: ProjectCache | undefined);
|
|
226
268
|
name: string;
|
|
269
|
+
title: string;
|
|
270
|
+
annotations: ToolAnnotations;
|
|
227
271
|
description: string;
|
|
272
|
+
/**
|
|
273
|
+
* JSON Schema of the tool arguments.
|
|
274
|
+
* @hidden
|
|
275
|
+
*/
|
|
228
276
|
inputSchema: {
|
|
229
277
|
type: string;
|
|
278
|
+
additionalProperties: boolean;
|
|
230
279
|
properties: {
|
|
231
280
|
violations: {
|
|
232
281
|
type: string;
|
|
@@ -420,6 +469,327 @@ export declare class PlanMigrationTool implements MCPTool {
|
|
|
420
469
|
};
|
|
421
470
|
required: never[];
|
|
422
471
|
};
|
|
472
|
+
/**
|
|
473
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
474
|
+
* @hidden
|
|
475
|
+
*/
|
|
476
|
+
outputSchema: {
|
|
477
|
+
type: string;
|
|
478
|
+
properties: {
|
|
479
|
+
warnings: {
|
|
480
|
+
readonly type: "array";
|
|
481
|
+
readonly items: {
|
|
482
|
+
readonly type: "string";
|
|
483
|
+
};
|
|
484
|
+
readonly description: "Conditions that can make the result incomplete, e.g. library imports that do not resolve because node_modules is missing.";
|
|
485
|
+
};
|
|
486
|
+
recommendedStrategy: {
|
|
487
|
+
readonly type: "object";
|
|
488
|
+
readonly properties: {
|
|
489
|
+
readonly id: {
|
|
490
|
+
readonly type: "string";
|
|
491
|
+
};
|
|
492
|
+
readonly name: {
|
|
493
|
+
readonly type: "string";
|
|
494
|
+
};
|
|
495
|
+
readonly description: {
|
|
496
|
+
readonly type: "string";
|
|
497
|
+
};
|
|
498
|
+
readonly applicableArchitectures: {
|
|
499
|
+
readonly type: "array";
|
|
500
|
+
readonly items: {
|
|
501
|
+
readonly type: "string";
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
readonly complexity: {
|
|
505
|
+
readonly type: "string";
|
|
506
|
+
};
|
|
507
|
+
readonly successRate: {
|
|
508
|
+
readonly type: "number";
|
|
509
|
+
};
|
|
510
|
+
readonly steps: {
|
|
511
|
+
readonly type: "array";
|
|
512
|
+
readonly items: {
|
|
513
|
+
readonly type: "object";
|
|
514
|
+
readonly properties: {
|
|
515
|
+
readonly name: {
|
|
516
|
+
readonly type: "string";
|
|
517
|
+
};
|
|
518
|
+
readonly action: {
|
|
519
|
+
readonly type: "string";
|
|
520
|
+
};
|
|
521
|
+
readonly validation: {
|
|
522
|
+
readonly type: "string";
|
|
523
|
+
};
|
|
524
|
+
readonly effort: {
|
|
525
|
+
readonly type: "number";
|
|
526
|
+
};
|
|
527
|
+
readonly risk: {
|
|
528
|
+
readonly type: "string";
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
readonly required: readonly ["name", "action", "validation", "effort", "risk"];
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
readonly prerequisites: {
|
|
535
|
+
readonly type: "array";
|
|
536
|
+
readonly items: {
|
|
537
|
+
readonly type: "string";
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
readonly risks: {
|
|
541
|
+
readonly type: "array";
|
|
542
|
+
readonly items: {
|
|
543
|
+
readonly type: "string";
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
readonly totalEffort: {
|
|
547
|
+
readonly type: "number";
|
|
548
|
+
};
|
|
549
|
+
readonly overallRisk: {
|
|
550
|
+
readonly type: "string";
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
readonly required: readonly ["id", "name", "complexity", "successRate", "steps", "totalEffort", "overallRisk"];
|
|
554
|
+
};
|
|
555
|
+
alternativeStrategies: {
|
|
556
|
+
type: string;
|
|
557
|
+
items: {
|
|
558
|
+
readonly type: "object";
|
|
559
|
+
readonly properties: {
|
|
560
|
+
readonly id: {
|
|
561
|
+
readonly type: "string";
|
|
562
|
+
};
|
|
563
|
+
readonly name: {
|
|
564
|
+
readonly type: "string";
|
|
565
|
+
};
|
|
566
|
+
readonly description: {
|
|
567
|
+
readonly type: "string";
|
|
568
|
+
};
|
|
569
|
+
readonly applicableArchitectures: {
|
|
570
|
+
readonly type: "array";
|
|
571
|
+
readonly items: {
|
|
572
|
+
readonly type: "string";
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
readonly complexity: {
|
|
576
|
+
readonly type: "string";
|
|
577
|
+
};
|
|
578
|
+
readonly successRate: {
|
|
579
|
+
readonly type: "number";
|
|
580
|
+
};
|
|
581
|
+
readonly steps: {
|
|
582
|
+
readonly type: "array";
|
|
583
|
+
readonly items: {
|
|
584
|
+
readonly type: "object";
|
|
585
|
+
readonly properties: {
|
|
586
|
+
readonly name: {
|
|
587
|
+
readonly type: "string";
|
|
588
|
+
};
|
|
589
|
+
readonly action: {
|
|
590
|
+
readonly type: "string";
|
|
591
|
+
};
|
|
592
|
+
readonly validation: {
|
|
593
|
+
readonly type: "string";
|
|
594
|
+
};
|
|
595
|
+
readonly effort: {
|
|
596
|
+
readonly type: "number";
|
|
597
|
+
};
|
|
598
|
+
readonly risk: {
|
|
599
|
+
readonly type: "string";
|
|
600
|
+
};
|
|
601
|
+
};
|
|
602
|
+
readonly required: readonly ["name", "action", "validation", "effort", "risk"];
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
readonly prerequisites: {
|
|
606
|
+
readonly type: "array";
|
|
607
|
+
readonly items: {
|
|
608
|
+
readonly type: "string";
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
readonly risks: {
|
|
612
|
+
readonly type: "array";
|
|
613
|
+
readonly items: {
|
|
614
|
+
readonly type: "string";
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
readonly totalEffort: {
|
|
618
|
+
readonly type: "number";
|
|
619
|
+
};
|
|
620
|
+
readonly overallRisk: {
|
|
621
|
+
readonly type: "string";
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
readonly required: readonly ["id", "name", "complexity", "successRate", "steps", "totalEffort", "overallRisk"];
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
reasoning: {
|
|
628
|
+
type: string;
|
|
629
|
+
properties: {
|
|
630
|
+
primaryFactors: {
|
|
631
|
+
readonly type: "array";
|
|
632
|
+
readonly items: {
|
|
633
|
+
readonly type: "string";
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
constraintImpact: {
|
|
637
|
+
readonly type: "array";
|
|
638
|
+
readonly items: {
|
|
639
|
+
readonly type: "string";
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
riskAssessment: {
|
|
643
|
+
type: string;
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
required: string[];
|
|
647
|
+
};
|
|
648
|
+
roadmap: {
|
|
649
|
+
type: string;
|
|
650
|
+
properties: {
|
|
651
|
+
phases: {
|
|
652
|
+
type: string;
|
|
653
|
+
items: {
|
|
654
|
+
type: string;
|
|
655
|
+
properties: {
|
|
656
|
+
name: {
|
|
657
|
+
type: string;
|
|
658
|
+
};
|
|
659
|
+
duration: {
|
|
660
|
+
type: string;
|
|
661
|
+
};
|
|
662
|
+
steps: {
|
|
663
|
+
type: string;
|
|
664
|
+
items: {
|
|
665
|
+
readonly type: "object";
|
|
666
|
+
readonly properties: {
|
|
667
|
+
readonly name: {
|
|
668
|
+
readonly type: "string";
|
|
669
|
+
};
|
|
670
|
+
readonly action: {
|
|
671
|
+
readonly type: "string";
|
|
672
|
+
};
|
|
673
|
+
readonly validation: {
|
|
674
|
+
readonly type: "string";
|
|
675
|
+
};
|
|
676
|
+
readonly effort: {
|
|
677
|
+
readonly type: "number";
|
|
678
|
+
};
|
|
679
|
+
readonly risk: {
|
|
680
|
+
readonly type: "string";
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
readonly required: readonly ["name", "action", "validation", "effort", "risk"];
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
deliverables: {
|
|
687
|
+
readonly type: "array";
|
|
688
|
+
readonly items: {
|
|
689
|
+
readonly type: "string";
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
required: string[];
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
totalDuration: {
|
|
697
|
+
type: string;
|
|
698
|
+
};
|
|
699
|
+
milestones: {
|
|
700
|
+
readonly type: "array";
|
|
701
|
+
readonly items: {
|
|
702
|
+
readonly type: "string";
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
required: string[];
|
|
707
|
+
};
|
|
708
|
+
successMetrics: {
|
|
709
|
+
readonly type: "array";
|
|
710
|
+
readonly items: {
|
|
711
|
+
readonly type: "string";
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
planSource: {
|
|
715
|
+
type: string;
|
|
716
|
+
enum: string[];
|
|
717
|
+
};
|
|
718
|
+
scanPlan: {
|
|
719
|
+
type: string;
|
|
720
|
+
properties: {
|
|
721
|
+
summary: {
|
|
722
|
+
type: string;
|
|
723
|
+
};
|
|
724
|
+
maxResults: {
|
|
725
|
+
type: string;
|
|
726
|
+
};
|
|
727
|
+
layerSource: {
|
|
728
|
+
type: string;
|
|
729
|
+
};
|
|
730
|
+
graphFiles: {
|
|
731
|
+
type: string;
|
|
732
|
+
};
|
|
733
|
+
stats: {
|
|
734
|
+
type: string;
|
|
735
|
+
};
|
|
736
|
+
cycles: {
|
|
737
|
+
type: string;
|
|
738
|
+
items: {
|
|
739
|
+
type: string;
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
phases: {
|
|
743
|
+
type: string;
|
|
744
|
+
items: {
|
|
745
|
+
type: string;
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
warnings: {
|
|
749
|
+
readonly type: "array";
|
|
750
|
+
readonly items: {
|
|
751
|
+
readonly type: "string";
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
required: string[];
|
|
756
|
+
};
|
|
757
|
+
notes: {
|
|
758
|
+
readonly type: "array";
|
|
759
|
+
readonly items: {
|
|
760
|
+
readonly type: "string";
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
styleAwareRiskAssessment: {
|
|
764
|
+
type: string;
|
|
765
|
+
};
|
|
766
|
+
styleConflictingSteps: {
|
|
767
|
+
type: string;
|
|
768
|
+
items: {
|
|
769
|
+
type: string;
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
styleRecommendations: {
|
|
773
|
+
type: string;
|
|
774
|
+
items: {
|
|
775
|
+
type: string;
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
styleAlignmentScore: {
|
|
779
|
+
type: string;
|
|
780
|
+
};
|
|
781
|
+
stepsWithStyleAnalysis: {
|
|
782
|
+
type: string;
|
|
783
|
+
items: {
|
|
784
|
+
type: string;
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
summary: {
|
|
788
|
+
type: string;
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
required: string[];
|
|
792
|
+
};
|
|
423
793
|
execute(args: Record<string, unknown>): Promise<PlanMigrationResult>;
|
|
424
794
|
/**
|
|
425
795
|
* Inline violations plus the ones from scanResultFile.
|
|
@@ -472,5 +842,4 @@ export declare class PlanMigrationTool implements MCPTool {
|
|
|
472
842
|
*/
|
|
473
843
|
private generateSuccessMetrics;
|
|
474
844
|
}
|
|
475
|
-
export {};
|
|
476
845
|
//# sourceMappingURL=plan-migration.d.ts.map
|