@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
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { type FileSystemAdapter } from '@angular-modernizer/core';
|
|
2
|
+
import { type MCPTool, type ToolAnnotations, type ToolContext } from '../types.js';
|
|
3
|
+
import { type FileDelta, type HealthViolation, type RuleDelta } from './helpers/health-delta.js';
|
|
4
|
+
/** The part of a scan-all result the comparison needs. */
|
|
5
|
+
export interface HealthScanResult {
|
|
6
|
+
/** All violations of the scan. */
|
|
7
|
+
violations: readonly {
|
|
8
|
+
/** Rule that reported the violation. */
|
|
9
|
+
ruleId: string;
|
|
10
|
+
/** Severity of the violation. */
|
|
11
|
+
severity: string;
|
|
12
|
+
/** Rule message. */
|
|
13
|
+
message: string;
|
|
14
|
+
/** File path relative to the project root. */
|
|
15
|
+
filePath: string;
|
|
16
|
+
/** 1-based line, when the rule reports one. */
|
|
17
|
+
line?: number;
|
|
18
|
+
/** Rule category. */
|
|
19
|
+
category: string;
|
|
20
|
+
}[];
|
|
21
|
+
/** Scan counts. */
|
|
22
|
+
counts: {
|
|
23
|
+
/** Number of analyzed files. */
|
|
24
|
+
analyzedFiles: number;
|
|
25
|
+
};
|
|
26
|
+
/** Scan metadata. */
|
|
27
|
+
metadata: {
|
|
28
|
+
/** Ids of the rules that ran. */
|
|
29
|
+
rulesExecuted: string[];
|
|
30
|
+
};
|
|
31
|
+
/** Set by scan-all when the client cancelled the scan. */
|
|
32
|
+
execution?: {
|
|
33
|
+
/** `cancelled` when the client cancelled the scan. */
|
|
34
|
+
stopReason?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Runs the scan with scan-all arguments. */
|
|
38
|
+
export type HealthScan = (args: Record<string, unknown>, ctx?: ToolContext) => Promise<HealthScanResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Outcome of a compare-health run:
|
|
41
|
+
* - `compared`: the run was compared with the stored snapshot.
|
|
42
|
+
* - `baseline-created`: no snapshot existed; the current run was stored.
|
|
43
|
+
* - `no-baseline`: no snapshot existed and `updateSnapshot` was `false`.
|
|
44
|
+
* - `scope-mismatch`: the snapshot used other rules or include/exclude
|
|
45
|
+
* patterns; nothing was compared.
|
|
46
|
+
* - `invalid-snapshot`: the snapshot could not be read; nothing was compared.
|
|
47
|
+
*/
|
|
48
|
+
export type CompareHealthStatus = 'compared' | 'baseline-created' | 'no-baseline' | 'scope-mismatch' | 'invalid-snapshot';
|
|
49
|
+
/** Counts of one run. */
|
|
50
|
+
export interface HealthRunInfo {
|
|
51
|
+
/** Time of the run (ISO 8601). */
|
|
52
|
+
createdAt: string;
|
|
53
|
+
/** Number of analyzed files. */
|
|
54
|
+
analyzedFiles: number;
|
|
55
|
+
/** Number of all violations. */
|
|
56
|
+
totalViolations: number;
|
|
57
|
+
}
|
|
58
|
+
/** Output of the compare-health tool. */
|
|
59
|
+
export interface CompareHealthOutput {
|
|
60
|
+
/** Outcome of the run. */
|
|
61
|
+
status: CompareHealthStatus;
|
|
62
|
+
/** Absolute project root. */
|
|
63
|
+
projectRoot: string;
|
|
64
|
+
/** Relative to `projectRoot` when inside it. */
|
|
65
|
+
snapshotPath: string;
|
|
66
|
+
/** Whether the current run was written as the new snapshot. */
|
|
67
|
+
snapshotWritten: boolean;
|
|
68
|
+
/** Counts of the stored run, when a readable snapshot exists. */
|
|
69
|
+
previousRun?: HealthRunInfo;
|
|
70
|
+
/** Counts of the current run. */
|
|
71
|
+
currentRun: HealthRunInfo & {
|
|
72
|
+
/** Violations per severity, over all violations. */
|
|
73
|
+
bySeverity: Record<string, number>;
|
|
74
|
+
/** Violations per category, over all violations. */
|
|
75
|
+
byCategory: Record<string, number>;
|
|
76
|
+
};
|
|
77
|
+
/** Only for status `compared`. */
|
|
78
|
+
totals?: {
|
|
79
|
+
/** Violations only in the current run. */
|
|
80
|
+
new: number;
|
|
81
|
+
/** Violations only in the previous run. */
|
|
82
|
+
fixed: number;
|
|
83
|
+
/** Violations in both runs. */
|
|
84
|
+
unchanged: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Status `compared`: every rule with violations in either run. Other
|
|
88
|
+
* statuses: current counts only (`previous` and the deltas are 0).
|
|
89
|
+
*/
|
|
90
|
+
byRule: RuleDelta[];
|
|
91
|
+
/**
|
|
92
|
+
* Changed files; only for status `compared`, dropped with `summaryOnly`,
|
|
93
|
+
* capped by `maxResults`.
|
|
94
|
+
*/
|
|
95
|
+
byFile?: FileDelta[];
|
|
96
|
+
/**
|
|
97
|
+
* Violations only in the current run; only for status `compared`, dropped
|
|
98
|
+
* with `summaryOnly`, capped by `maxResults`.
|
|
99
|
+
*/
|
|
100
|
+
newViolations?: HealthViolation[];
|
|
101
|
+
/**
|
|
102
|
+
* Violations only in the previous run; only for status `compared`, dropped
|
|
103
|
+
* with `summaryOnly`, capped by `maxResults`.
|
|
104
|
+
*/
|
|
105
|
+
fixedViolations?: HealthViolation[];
|
|
106
|
+
/** Rules that ran now but not in the previous run; their findings count as new. */
|
|
107
|
+
rulesAdded: string[];
|
|
108
|
+
/** Rules that ran in the previous run but not now. */
|
|
109
|
+
rulesRemoved: string[];
|
|
110
|
+
/** Scope keys that differ from the snapshot, as `key: previous -> current`. */
|
|
111
|
+
scopeDifferences: string[];
|
|
112
|
+
/** `true` when `maxResults` cut one of the lists. */
|
|
113
|
+
truncated: boolean;
|
|
114
|
+
/** Human-readable summary for LLM consumption. */
|
|
115
|
+
summary: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* MCP tool `compare-health`: runs the scan-all scan and compares it with the
|
|
119
|
+
* previous run: which violations are new, fixed or unchanged, per rule and
|
|
120
|
+
* per file.
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* scan-all returns a window of `maxResults` violations and sums only that
|
|
124
|
+
* window, so a comparison of two scan-all answers would compare two windows.
|
|
125
|
+
* This tool takes the complete result, stores it as a snapshot in the target
|
|
126
|
+
* project (default `.angular-modernizer-cache/health/last-run.json`, ignored
|
|
127
|
+
* like the cache) and compares the next run against it.
|
|
128
|
+
*
|
|
129
|
+
* The snapshot is replaced after every comparison unless `updateSnapshot` is
|
|
130
|
+
* false. When the stored run used another scope (rules, include or exclude
|
|
131
|
+
* patterns) or the file cannot be read, nothing is compared and the file is
|
|
132
|
+
* kept unless `updateSnapshot` is explicitly true. A cancelled scan throws
|
|
133
|
+
* instead of comparing or writing a partial snapshot.
|
|
134
|
+
*/
|
|
135
|
+
export declare class CompareHealthTool implements MCPTool {
|
|
136
|
+
private readonly scan;
|
|
137
|
+
private readonly fileSystem;
|
|
138
|
+
private readonly now;
|
|
139
|
+
readonly name = "compare-health";
|
|
140
|
+
readonly title = "Compare Health With Last Run";
|
|
141
|
+
readonly description: string;
|
|
142
|
+
readonly annotations: ToolAnnotations;
|
|
143
|
+
/**
|
|
144
|
+
* JSON Schema of the tool arguments.
|
|
145
|
+
* @hidden
|
|
146
|
+
*/
|
|
147
|
+
readonly inputSchema: {
|
|
148
|
+
type: string;
|
|
149
|
+
additionalProperties: boolean;
|
|
150
|
+
properties: {
|
|
151
|
+
summaryOnly: {
|
|
152
|
+
readonly type: "boolean";
|
|
153
|
+
readonly description: "Return counts and the text summary only, without the result list. Default: false.";
|
|
154
|
+
readonly default: false;
|
|
155
|
+
};
|
|
156
|
+
maxResults: {
|
|
157
|
+
readonly type: "number";
|
|
158
|
+
readonly description: string;
|
|
159
|
+
};
|
|
160
|
+
rootPath: {
|
|
161
|
+
type: string;
|
|
162
|
+
description: string;
|
|
163
|
+
};
|
|
164
|
+
rules: {
|
|
165
|
+
description: string;
|
|
166
|
+
type: "array";
|
|
167
|
+
items: {
|
|
168
|
+
readonly type: "string";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
includePatterns: {
|
|
172
|
+
description: string;
|
|
173
|
+
type: "array";
|
|
174
|
+
items: {
|
|
175
|
+
readonly type: "string";
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
excludePatterns: {
|
|
179
|
+
description: string;
|
|
180
|
+
type: "array";
|
|
181
|
+
items: {
|
|
182
|
+
readonly type: "string";
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
maxFiles: {
|
|
186
|
+
type: string;
|
|
187
|
+
description: string;
|
|
188
|
+
};
|
|
189
|
+
snapshotPath: {
|
|
190
|
+
type: string;
|
|
191
|
+
description: string;
|
|
192
|
+
};
|
|
193
|
+
updateSnapshot: {
|
|
194
|
+
type: string;
|
|
195
|
+
description: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
required: string[];
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
202
|
+
* @hidden
|
|
203
|
+
*/
|
|
204
|
+
readonly outputSchema: {
|
|
205
|
+
type: string;
|
|
206
|
+
properties: {
|
|
207
|
+
status: {
|
|
208
|
+
type: string;
|
|
209
|
+
enum: string[];
|
|
210
|
+
};
|
|
211
|
+
projectRoot: {
|
|
212
|
+
type: string;
|
|
213
|
+
};
|
|
214
|
+
snapshotPath: {
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
snapshotWritten: {
|
|
218
|
+
type: string;
|
|
219
|
+
};
|
|
220
|
+
previousRun: {
|
|
221
|
+
readonly type: "object";
|
|
222
|
+
readonly properties: {
|
|
223
|
+
readonly createdAt: {
|
|
224
|
+
readonly type: "string";
|
|
225
|
+
};
|
|
226
|
+
readonly analyzedFiles: {
|
|
227
|
+
readonly type: "integer";
|
|
228
|
+
};
|
|
229
|
+
readonly totalViolations: {
|
|
230
|
+
readonly type: "integer";
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
readonly required: readonly ["createdAt", "analyzedFiles", "totalViolations"];
|
|
234
|
+
};
|
|
235
|
+
currentRun: {
|
|
236
|
+
type: string;
|
|
237
|
+
properties: {
|
|
238
|
+
bySeverity: {
|
|
239
|
+
readonly type: "object";
|
|
240
|
+
readonly additionalProperties: {
|
|
241
|
+
readonly type: "integer";
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
byCategory: {
|
|
245
|
+
readonly type: "object";
|
|
246
|
+
readonly additionalProperties: {
|
|
247
|
+
readonly type: "integer";
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
createdAt: {
|
|
251
|
+
readonly type: "string";
|
|
252
|
+
};
|
|
253
|
+
analyzedFiles: {
|
|
254
|
+
readonly type: "integer";
|
|
255
|
+
};
|
|
256
|
+
totalViolations: {
|
|
257
|
+
readonly type: "integer";
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
required: string[];
|
|
261
|
+
};
|
|
262
|
+
totals: {
|
|
263
|
+
type: string;
|
|
264
|
+
properties: {
|
|
265
|
+
new: {
|
|
266
|
+
type: string;
|
|
267
|
+
};
|
|
268
|
+
fixed: {
|
|
269
|
+
type: string;
|
|
270
|
+
};
|
|
271
|
+
unchanged: {
|
|
272
|
+
type: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
required: string[];
|
|
276
|
+
};
|
|
277
|
+
byRule: {
|
|
278
|
+
type: string;
|
|
279
|
+
items: {
|
|
280
|
+
type: string;
|
|
281
|
+
properties: {
|
|
282
|
+
ruleId: {
|
|
283
|
+
type: string;
|
|
284
|
+
};
|
|
285
|
+
previous: {
|
|
286
|
+
type: string;
|
|
287
|
+
};
|
|
288
|
+
current: {
|
|
289
|
+
type: string;
|
|
290
|
+
};
|
|
291
|
+
new: {
|
|
292
|
+
type: string;
|
|
293
|
+
};
|
|
294
|
+
fixed: {
|
|
295
|
+
type: string;
|
|
296
|
+
};
|
|
297
|
+
unchanged: {
|
|
298
|
+
type: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
required: string[];
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
byFile: {
|
|
305
|
+
type: string;
|
|
306
|
+
items: {
|
|
307
|
+
type: string;
|
|
308
|
+
properties: {
|
|
309
|
+
filePath: {
|
|
310
|
+
type: string;
|
|
311
|
+
};
|
|
312
|
+
previous: {
|
|
313
|
+
type: string;
|
|
314
|
+
};
|
|
315
|
+
current: {
|
|
316
|
+
type: string;
|
|
317
|
+
};
|
|
318
|
+
new: {
|
|
319
|
+
type: string;
|
|
320
|
+
};
|
|
321
|
+
fixed: {
|
|
322
|
+
type: string;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
required: string[];
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
newViolations: {
|
|
329
|
+
type: string;
|
|
330
|
+
items: {
|
|
331
|
+
readonly type: "object";
|
|
332
|
+
readonly properties: {
|
|
333
|
+
readonly ruleId: {
|
|
334
|
+
readonly type: "string";
|
|
335
|
+
};
|
|
336
|
+
readonly filePath: {
|
|
337
|
+
readonly type: "string";
|
|
338
|
+
};
|
|
339
|
+
readonly message: {
|
|
340
|
+
readonly type: "string";
|
|
341
|
+
};
|
|
342
|
+
readonly severity: {
|
|
343
|
+
readonly type: "string";
|
|
344
|
+
};
|
|
345
|
+
readonly category: {
|
|
346
|
+
readonly type: "string";
|
|
347
|
+
};
|
|
348
|
+
readonly line: {
|
|
349
|
+
readonly type: "integer";
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
readonly required: readonly ["ruleId", "filePath", "message", "severity", "category"];
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
fixedViolations: {
|
|
356
|
+
type: string;
|
|
357
|
+
items: {
|
|
358
|
+
readonly type: "object";
|
|
359
|
+
readonly properties: {
|
|
360
|
+
readonly ruleId: {
|
|
361
|
+
readonly type: "string";
|
|
362
|
+
};
|
|
363
|
+
readonly filePath: {
|
|
364
|
+
readonly type: "string";
|
|
365
|
+
};
|
|
366
|
+
readonly message: {
|
|
367
|
+
readonly type: "string";
|
|
368
|
+
};
|
|
369
|
+
readonly severity: {
|
|
370
|
+
readonly type: "string";
|
|
371
|
+
};
|
|
372
|
+
readonly category: {
|
|
373
|
+
readonly type: "string";
|
|
374
|
+
};
|
|
375
|
+
readonly line: {
|
|
376
|
+
readonly type: "integer";
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
readonly required: readonly ["ruleId", "filePath", "message", "severity", "category"];
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
rulesAdded: {
|
|
383
|
+
readonly type: "array";
|
|
384
|
+
readonly items: {
|
|
385
|
+
readonly type: "string";
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
rulesRemoved: {
|
|
389
|
+
readonly type: "array";
|
|
390
|
+
readonly items: {
|
|
391
|
+
readonly type: "string";
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
scopeDifferences: {
|
|
395
|
+
readonly type: "array";
|
|
396
|
+
readonly items: {
|
|
397
|
+
readonly type: "string";
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
truncated: {
|
|
401
|
+
type: string;
|
|
402
|
+
};
|
|
403
|
+
summary: {
|
|
404
|
+
type: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
required: string[];
|
|
408
|
+
};
|
|
409
|
+
constructor(scan?: HealthScan, fileSystem?: FileSystemAdapter, now?: () => Date);
|
|
410
|
+
execute(args: Record<string, unknown>, ctx?: ToolContext): Promise<CompareHealthOutput>;
|
|
411
|
+
private readSnapshot;
|
|
412
|
+
}
|
|
413
|
+
//# sourceMappingURL=compare-health.d.ts.map
|