@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
package/dist/tools/scan-all.js
CHANGED
|
@@ -1,31 +1,46 @@
|
|
|
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
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
12
1
|
import { findTsConfig } from './helpers/find-ts-config.js';
|
|
13
|
-
import {
|
|
14
|
-
import { SolidPlugin } from '@angular-modernizer/plugin-solid';
|
|
15
|
-
import { AngularPlugin } from '@angular-modernizer/plugin-angular';
|
|
16
|
-
import { ArchitecturePlugin } from '@angular-modernizer/plugin-architecture';
|
|
17
|
-
import { ContextFactory } from '@angular-modernizer/plugin-system';
|
|
18
|
-
import { createPublicApi } from '@angular-modernizer/api';
|
|
2
|
+
import { MultiCacheFallbackManager, RealFileSystemAdapter, createMultiCacheConfig, loadConfig, } from '@angular-modernizer/core';
|
|
19
3
|
import { glob } from 'glob';
|
|
20
4
|
import { relative } from 'node:path';
|
|
5
|
+
import { statSync } from 'node:fs';
|
|
6
|
+
import { FindingWindow } from './helpers/finding-window.js';
|
|
7
|
+
import { cancelledExecution, fileProgressMessage, } from './helpers/tool-context.js';
|
|
8
|
+
import { runScan } from '../scan-host/scan-host.js';
|
|
9
|
+
import { describeScan, SCAN_EXECUTION_SCHEMA, scanOutputSchema, } from './helpers/analysis-output.js';
|
|
10
|
+
import { dependenciesUnchanged } from './helpers/scan-cache.js';
|
|
21
11
|
/**
|
|
22
|
-
*
|
|
12
|
+
* Version of the cache entries scan-all writes. Entries from before the
|
|
13
|
+
* per-analyzed-file layout (findings filed under their template, files without
|
|
14
|
+
* findings missing) would read as complete; the version invalidates them.
|
|
15
|
+
*/
|
|
16
|
+
const SCAN_ALL_CACHE_VERSION = 'scan-all-2';
|
|
17
|
+
/**
|
|
18
|
+
* MCP tool `scan-all`: one scan with all analysis plugins (52 rules total).
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Plugins and rules:
|
|
22
|
+
* - SolidPlugin (7 rules): SOLID principles
|
|
23
|
+
* - AngularPlugin (28 rules): Angular best practices
|
|
24
|
+
* - ArchitecturePlugin (17 rules): architectural issues
|
|
23
25
|
*/
|
|
24
26
|
export class ScanAllTool {
|
|
25
27
|
name = 'scan-all';
|
|
26
|
-
|
|
28
|
+
title = 'Scan All Rules';
|
|
29
|
+
annotations = {
|
|
30
|
+
readOnlyHint: true,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
idempotentHint: true,
|
|
33
|
+
openWorldHint: false,
|
|
34
|
+
};
|
|
35
|
+
description = 'Comprehensive code quality scan with all plugins (SOLID 7, Angular 28, Architecture 17: 52 rules total). ' +
|
|
36
|
+
'maxResults (default 1000) and resultOffset page the violations; counts cover all of them, summary is a short text.';
|
|
37
|
+
/**
|
|
38
|
+
* JSON Schema of the tool arguments.
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
27
41
|
inputSchema = {
|
|
28
42
|
type: 'object',
|
|
43
|
+
additionalProperties: false,
|
|
29
44
|
properties: {
|
|
30
45
|
rootPath: {
|
|
31
46
|
type: 'string',
|
|
@@ -95,7 +110,15 @@ export class ScanAllTool {
|
|
|
95
110
|
},
|
|
96
111
|
required: ['rootPath'],
|
|
97
112
|
};
|
|
98
|
-
|
|
113
|
+
/**
|
|
114
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
115
|
+
* @hidden
|
|
116
|
+
*/
|
|
117
|
+
outputSchema = scanOutputSchema({
|
|
118
|
+
cache: { type: 'object' },
|
|
119
|
+
execution: SCAN_EXECUTION_SCHEMA,
|
|
120
|
+
});
|
|
121
|
+
async execute(args, ctx = {}) {
|
|
99
122
|
const params = args;
|
|
100
123
|
const config = this.loadConfig(params.rootPath);
|
|
101
124
|
const mergedParams = { ...config, ...params };
|
|
@@ -108,21 +131,6 @@ export class ScanAllTool {
|
|
|
108
131
|
if (!tsConfigPath) {
|
|
109
132
|
throw new Error('Could not find tsconfig.json');
|
|
110
133
|
}
|
|
111
|
-
// Initialize kernel with all plugins and caching
|
|
112
|
-
// IMPORTANT: skipAddingFilesFromTsConfig prevents loading dist/, e2e/, etc.
|
|
113
|
-
const kernel = new Kernel({
|
|
114
|
-
tsConfigPath,
|
|
115
|
-
plugins: [
|
|
116
|
-
new SolidPlugin(),
|
|
117
|
-
new AngularPlugin(),
|
|
118
|
-
new ArchitecturePlugin(),
|
|
119
|
-
],
|
|
120
|
-
fileSystem: undefined,
|
|
121
|
-
projectOptions: {
|
|
122
|
-
skipAddingFilesFromTsConfig: true, // We'll add filtered files manually
|
|
123
|
-
},
|
|
124
|
-
cacheConfig: createToolCacheConfig(mergedParams.rootPath, 'all'),
|
|
125
|
-
});
|
|
126
134
|
// Find files to analyze
|
|
127
135
|
const includePatterns = mergedParams.includePatterns ?? ['**/*.{ts,tsx}'];
|
|
128
136
|
const excludePatterns = mergedParams.excludePatterns ?? [
|
|
@@ -144,57 +152,39 @@ export class ScanAllTool {
|
|
|
144
152
|
});
|
|
145
153
|
allFiles.push(...files);
|
|
146
154
|
}
|
|
147
|
-
|
|
155
|
+
// glob returns files in a different order on every call; sorted, the batches
|
|
156
|
+
// and with them the findings of rules that look across files are the same
|
|
157
|
+
// in every cold run.
|
|
158
|
+
const uniqueFiles = Array.from(new Set(allFiles)).sort();
|
|
148
159
|
const filesToAnalyze = uniqueFiles; // Analyze ALL files found (batch processing prevents memory issues)
|
|
149
160
|
const maxFiles = mergedParams.maxFiles ?? 100; // Batch size (default 100)
|
|
150
|
-
// Initialize kernel
|
|
151
|
-
await kernel.initialize();
|
|
152
|
-
// Reuse the already-initialized plugin instances from the kernel so that
|
|
153
|
-
// ruleConfigs loaded from .angular-modernizer.json are applied correctly.
|
|
154
|
-
const allRules = kernel
|
|
155
|
-
.getAllPlugins()
|
|
156
|
-
.flatMap((p) => p.getAnalysisRules());
|
|
157
161
|
// ============================================================================
|
|
158
|
-
//
|
|
162
|
+
// CACHE READ
|
|
159
163
|
// ============================================================================
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
// 1. .angular-modernizer-cache/all/ (primary cache for scan-all)
|
|
165
|
-
// 2. .angular-modernizer-cache/solid/ (fallback to SOLID scan cache)
|
|
166
|
-
// 3. .angular-modernizer-cache/angular/ (fallback to Angular scan cache)
|
|
167
|
-
// 4. .angular-modernizer-cache/architecture/ (fallback to Architecture scan cache)
|
|
168
|
-
//
|
|
169
|
-
// Performance benefits (Phase 3):
|
|
170
|
-
// - Before: scan-solid (63s) + scan-architecture (203s) + scan-all (360s) = 626s
|
|
171
|
-
// - After: scan-solid (63s) + scan-architecture (203s) + scan-all (~5s) = 271s
|
|
172
|
-
// - Savings: 355 seconds (57% time reduction)
|
|
173
|
-
//
|
|
174
|
-
// Performance (when only scan-all cache exists):
|
|
175
|
-
// - First run: 359.8s (analyzes all files, writes cache)
|
|
176
|
-
// - Second run: 24.2s (14.9x speedup, 93.3% faster, reads from cache)
|
|
177
|
-
//
|
|
178
|
-
// UNIDIRECTIONAL: Only scan-all reads from individual caches, not vice versa.
|
|
179
|
-
// Individual scans remain independent and focused on their specific rule categories.
|
|
164
|
+
// scan-all reads only its own cache (.angular-modernizer-cache/all/). The
|
|
165
|
+
// caches of scan-solid, scan-angular and scan-architecture hold only their
|
|
166
|
+
// plugin's findings and a different cache version: opening them here
|
|
167
|
+
// returned no hits and invalidated (deleted) their entries.
|
|
180
168
|
// ============================================================================
|
|
181
169
|
const fileSystem = new RealFileSystemAdapter();
|
|
182
|
-
const multiCacheManager = new MultiCacheFallbackManager(fileSystem, ['all'
|
|
183
|
-
|
|
170
|
+
const multiCacheManager = new MultiCacheFallbackManager(fileSystem, ['all'], {
|
|
171
|
+
...createMultiCacheConfig(mergedParams.rootPath),
|
|
172
|
+
version: SCAN_ALL_CACHE_VERSION,
|
|
173
|
+
});
|
|
184
174
|
await multiCacheManager.initialize();
|
|
185
|
-
// Load rules config from .angular-modernizer.json for per-rule overrides (BUG-3)
|
|
186
|
-
const fullConfig = loadConfig(mergedParams.rootPath);
|
|
187
|
-
const rulesConfig = fullConfig.rules;
|
|
188
175
|
const cachedResults = []; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
189
176
|
const filesToProcess = [];
|
|
190
177
|
const cacheHitsBySource = {};
|
|
178
|
+
// The cache holds every rule's findings per analyzed file, so an entry
|
|
179
|
+
// without findings is a hit as well.
|
|
180
|
+
const ownCache = multiCacheManager.getAllCaches()[0].manager;
|
|
191
181
|
for (const filePath of filesToAnalyze) {
|
|
192
|
-
const cached = await
|
|
193
|
-
if (cached
|
|
182
|
+
const cached = await readCachedFindings(filePath, ownCache);
|
|
183
|
+
if (cached !== null) {
|
|
194
184
|
// File is cached in one of the cache directories
|
|
195
185
|
cachedResults.push(...cached.results);
|
|
196
186
|
// Track which cache was used for logging
|
|
197
|
-
const source = cached.source
|
|
187
|
+
const source = cached.source;
|
|
198
188
|
cacheHitsBySource[source] = (cacheHitsBySource[source] ?? 0) + 1;
|
|
199
189
|
}
|
|
200
190
|
else {
|
|
@@ -228,86 +218,59 @@ export class ScanAllTool {
|
|
|
228
218
|
const totalBatches = Math.ceil(totalFiles / batchSize);
|
|
229
219
|
console.info(`\nProcessing ${totalFiles} files in ${totalBatches} batch(es) of ${batchSize} files each`);
|
|
230
220
|
// Separate arrays for two concerns:
|
|
231
|
-
// -
|
|
232
|
-
// -
|
|
233
|
-
// PERF-1: heap is bounded because
|
|
221
|
+
// - entriesForCache: per newly-analyzed file its violations (also those on its template) and template files
|
|
222
|
+
// - window: rule filter, totals and the requested page of cached and new violations
|
|
223
|
+
// PERF-1: heap is bounded because the page holds at most maxResults entries.
|
|
234
224
|
const paginationOffset = mergedParams.resultOffset ?? 0;
|
|
235
225
|
const paginationLimit = mergedParams.maxResults ?? 1000;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
//
|
|
239
|
-
const
|
|
226
|
+
const entriesForCache = new Map();
|
|
227
|
+
// Cached and newly analyzed findings go through the same window: rule
|
|
228
|
+
// filter, summary totals, then the requested page.
|
|
229
|
+
const window = new FindingWindow(mergedParams.rules, paginationOffset, paginationLimit);
|
|
230
|
+
for (const cached of cachedResults) {
|
|
231
|
+
window.add(cached);
|
|
232
|
+
}
|
|
240
233
|
let filesAnalyzed = cachedResults.length;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
//
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
const api = createPublicApi(project); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
268
|
-
// Analyze files in this batch
|
|
269
|
-
let batchViolationCount = 0;
|
|
270
|
-
for (const sourceFile of project.getSourceFiles()) {
|
|
271
|
-
for (const rule of allRules) {
|
|
272
|
-
try {
|
|
273
|
-
const ruleResults = await rule.analyze(ContextFactory.createAnalysisContext({
|
|
274
|
-
sourceFile,
|
|
275
|
-
project,
|
|
276
|
-
api,
|
|
277
|
-
config: rulesConfig,
|
|
278
|
-
}));
|
|
279
|
-
for (const result of ruleResults) {
|
|
280
|
-
const entry = {
|
|
281
|
-
ruleId: result.ruleId,
|
|
282
|
-
severity: rule.severity,
|
|
283
|
-
message: result.message,
|
|
284
|
-
filePath: result.filePath,
|
|
285
|
-
line: result.line,
|
|
286
|
-
column: result.column,
|
|
287
|
-
category: rule.category,
|
|
288
|
-
suggestedFix: result.suggestedFix,
|
|
289
|
-
metadata: result.metadata,
|
|
290
|
-
};
|
|
291
|
-
// Always accumulate for cache writes.
|
|
292
|
-
allResultsForCache.push(entry);
|
|
293
|
-
// Only store in the paginated return array if inside the requested window.
|
|
294
|
-
totalViolationCount++;
|
|
295
|
-
if (totalViolationCount > paginationOffset &&
|
|
296
|
-
results.length < paginationOffset + paginationLimit) {
|
|
297
|
-
results.push(entry);
|
|
298
|
-
}
|
|
299
|
-
batchViolationCount++;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
catch (error) {
|
|
303
|
-
console.warn(`Failed to analyze with rule ${rule.id}:`, error);
|
|
304
|
-
}
|
|
234
|
+
const progressTotal = cachedResults.length + totalFiles;
|
|
235
|
+
// Kernel, batches and rules run in a scan worker (scan-host), so the
|
|
236
|
+
// server keeps reading stdin while the type checker is built. Files that
|
|
237
|
+
// failed to load count as analyzed once their batch is done, as before.
|
|
238
|
+
let batchFilesAnalyzed = 0;
|
|
239
|
+
if (totalFiles > 0) {
|
|
240
|
+
ctx.progress?.(filesAnalyzed, progressTotal, `loading project, ${totalFiles} files to analyze`);
|
|
241
|
+
}
|
|
242
|
+
const engine = await runScan({
|
|
243
|
+
tool: this.name,
|
|
244
|
+
plugins: 'all',
|
|
245
|
+
tsConfigPath,
|
|
246
|
+
rootPath: mergedParams.rootPath,
|
|
247
|
+
files: filesToProcess,
|
|
248
|
+
mode: 'batches',
|
|
249
|
+
batchSize,
|
|
250
|
+
templateDependencies: true,
|
|
251
|
+
}, {
|
|
252
|
+
file: (event) => {
|
|
253
|
+
// Always accumulate for cache writes, also files without findings
|
|
254
|
+
entriesForCache.set(event.filePath, {
|
|
255
|
+
results: event.findings,
|
|
256
|
+
dependencies: event.dependencies ?? [],
|
|
257
|
+
});
|
|
258
|
+
for (const finding of event.findings) {
|
|
259
|
+
window.add(finding);
|
|
305
260
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
261
|
+
batchFilesAnalyzed++;
|
|
262
|
+
ctx.progress?.(filesAnalyzed + batchFilesAnalyzed, progressTotal, fileProgressMessage(filesAnalyzed + batchFilesAnalyzed, progressTotal, window.getTotals().totalViolations));
|
|
263
|
+
},
|
|
264
|
+
batchDone: (files) => {
|
|
265
|
+
filesAnalyzed += files;
|
|
266
|
+
batchFilesAnalyzed = 0;
|
|
267
|
+
},
|
|
268
|
+
}, { signal: ctx.signal });
|
|
269
|
+
const cancelled = engine.cancelled;
|
|
270
|
+
if (cancelled) {
|
|
271
|
+
filesAnalyzed += batchFilesAnalyzed;
|
|
309
272
|
}
|
|
310
|
-
console.info(`\nBatch processing complete: ${totalBatches} batch(es), ${filesAnalyzed} total files analyzed, ${
|
|
273
|
+
console.info(`\nBatch processing complete: ${totalBatches} batch(es), ${filesAnalyzed} total files analyzed, ${window.getTotals().totalViolations} total violations`);
|
|
311
274
|
// ============================================================================
|
|
312
275
|
// CACHE WRITE SYSTEM (Enhanced with MultiCacheFallbackManager)
|
|
313
276
|
// ============================================================================
|
|
@@ -330,32 +293,22 @@ export class ScanAllTool {
|
|
|
330
293
|
// - Each file analyzed with ALL rules = most expensive analysis
|
|
331
294
|
// - Cache hit eliminates analysis for ALL 35 rules per file
|
|
332
295
|
// - 93.3% time saved on second run (359.8s → 24.2s)
|
|
333
|
-
//
|
|
334
|
-
// Enhancement: Cache can now be read from individual tool caches
|
|
335
|
-
// when running scan-all after individual scans (57% time reduction overall).
|
|
336
296
|
// ============================================================================
|
|
337
|
-
//
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
resultsByFile.get(filePath).push(result);
|
|
345
|
-
}
|
|
346
|
-
// Write each file's results to PRIMARY cache only (multiCacheManager writes to first cache)
|
|
347
|
-
for (const [filePath, fileResults] of resultsByFile.entries()) {
|
|
348
|
-
await multiCacheManager.setAnalysisResult(filePath, fileResults);
|
|
297
|
+
// One entry per analyzed file, also without findings, so a warm run does not
|
|
298
|
+
// analyze it again in a different batch. Findings on a template stay with the
|
|
299
|
+
// component file that produced them; the template is a dependency.
|
|
300
|
+
// Writes go to the PRIMARY cache only (multiCacheManager writes to first cache).
|
|
301
|
+
for (const [filePath, entry] of entriesForCache) {
|
|
302
|
+
await multiCacheManager.setAnalysisResult(filePath, entry.results, entry.dependencies);
|
|
349
303
|
}
|
|
350
304
|
// Log cache effectiveness
|
|
351
305
|
const writeStats = multiCacheManager.getStats();
|
|
352
|
-
console.info(`Cached ${
|
|
353
|
-
//
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
.filter((r) => r.ruleId && r.filePath)
|
|
306
|
+
console.info(`Cached ${entriesForCache.size} files to primary cache (hit rate: ${writeStats.hitRate.toFixed(1)}%)`);
|
|
307
|
+
// The window holds only the requested page of the filtered findings.
|
|
308
|
+
const paginatedViolations = window
|
|
309
|
+
.getPage()
|
|
357
310
|
.map((r, index) => ({
|
|
358
|
-
id: `all-${index}`,
|
|
311
|
+
id: `all-${paginationOffset + index}`,
|
|
359
312
|
ruleId: r.ruleId,
|
|
360
313
|
severity: r.severity,
|
|
361
314
|
message: r.message,
|
|
@@ -368,23 +321,28 @@ export class ScanAllTool {
|
|
|
368
321
|
: undefined,
|
|
369
322
|
metadata: r.metadata,
|
|
370
323
|
}));
|
|
371
|
-
if (mergedParams.rules?.length) {
|
|
372
|
-
paginatedViolations = paginatedViolations.filter((v) => mergedParams.rules.includes(v.ruleId));
|
|
373
|
-
}
|
|
374
324
|
const offset = paginationOffset;
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
325
|
+
const totals = window.getTotals();
|
|
326
|
+
const counts = {
|
|
327
|
+
...totals,
|
|
328
|
+
analyzedFiles: cancelled ? filesAnalyzed : filesToAnalyze.length,
|
|
329
|
+
};
|
|
330
|
+
const execution = cancelled
|
|
331
|
+
? cancelledExecution(filesAnalyzed, filesToAnalyze.length - filesAnalyzed)
|
|
332
|
+
: undefined;
|
|
333
|
+
const pagination = {
|
|
334
|
+
totalResults: totals.totalViolations,
|
|
335
|
+
returnedResults: paginatedViolations.length,
|
|
336
|
+
offset,
|
|
337
|
+
hasMore: window.hasMore(),
|
|
338
|
+
};
|
|
380
339
|
const duration = Date.now() - startTime;
|
|
381
|
-
|
|
382
|
-
const allRuleIds = allRules.map((r) => r.id);
|
|
340
|
+
const allRuleIds = engine.ruleIds;
|
|
383
341
|
// Get final cache statistics (Phase 3)
|
|
384
342
|
const finalStats = multiCacheManager.getStats();
|
|
385
343
|
return {
|
|
386
344
|
violations: paginatedViolations,
|
|
387
|
-
|
|
345
|
+
counts,
|
|
388
346
|
metadata: {
|
|
389
347
|
rulesExecuted: allRuleIds,
|
|
390
348
|
duration,
|
|
@@ -399,23 +357,7 @@ export class ScanAllTool {
|
|
|
399
357
|
},
|
|
400
358
|
},
|
|
401
359
|
// Cache statistics with source breakdown
|
|
402
|
-
//
|
|
403
|
-
// IMPORTANT: Understanding cache statistics
|
|
404
|
-
// ==========================================
|
|
405
|
-
// - hitRate: Shows PRIMARY cache hit rate (first cache directory: /all/)
|
|
406
|
-
// - hitsBySource: Shows FALLBACK cache hits (solid/angular/architecture)
|
|
407
|
-
//
|
|
408
|
-
// Why hitRate can be 0% while hitsBySource has values:
|
|
409
|
-
// - If /all/ cache is deleted/empty, hitRate = 0% (primary cache empty)
|
|
410
|
-
// - But fallback caches (solid/angular/architecture) can provide cached results
|
|
411
|
-
// - hitsBySource tracks which fallback caches were used
|
|
412
|
-
//
|
|
413
|
-
// Example Test 3 scenario:
|
|
414
|
-
// - Delete /all/ cache → hitRate: 0% (primary cache empty)
|
|
415
|
-
// - But hitsBySource: {"solid": 630, "architecture": 10} (640 fallback hits!)
|
|
416
|
-
// - Result: Only 2,118 files analyzed (not 2,758) = Phase 3 working! ✅
|
|
417
|
-
//
|
|
418
|
-
// This is CORRECT Phase 3 behavior - fallback system saved 640 file analyses.
|
|
360
|
+
// hitRate and hitsBySource refer to the own cache (/all/) only.
|
|
419
361
|
cache: {
|
|
420
362
|
totalFilesChecked: filesToAnalyze.length,
|
|
421
363
|
filesFromCache: cachedResults.length,
|
|
@@ -435,12 +377,9 @@ export class ScanAllTool {
|
|
|
435
377
|
throughput: filesToAnalyze.length / (duration / 1000),
|
|
436
378
|
}
|
|
437
379
|
: undefined,
|
|
438
|
-
pagination
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
offset,
|
|
442
|
-
hasMore: offset + maxResults < totalViolations,
|
|
443
|
-
},
|
|
380
|
+
pagination,
|
|
381
|
+
...(execution === undefined ? {} : { execution }),
|
|
382
|
+
summary: describeScan(counts, paginatedViolations, pagination, execution === undefined ? [] : [execution.note]),
|
|
444
383
|
};
|
|
445
384
|
}
|
|
446
385
|
/**
|
|
@@ -463,24 +402,26 @@ export class ScanAllTool {
|
|
|
463
402
|
}
|
|
464
403
|
return {};
|
|
465
404
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Cached findings of one file, or `null` when it must be analyzed. An own
|
|
408
|
+
* entry is authoritative even without findings, but stale once one of its
|
|
409
|
+
* template dependencies changed.
|
|
410
|
+
*/
|
|
411
|
+
async function readCachedFindings(filePath, ownCache) {
|
|
412
|
+
const own = await ownCache.getAnalysisResult(filePath);
|
|
413
|
+
if (own === null) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
const fresh = dependenciesUnchanged(own.dependencies, own.metadata.cachedAt, modifiedAt);
|
|
417
|
+
return fresh ? { results: own.results, source: 'all' } : null;
|
|
418
|
+
}
|
|
419
|
+
function modifiedAt(path) {
|
|
420
|
+
try {
|
|
421
|
+
return statSync(path).mtimeMs;
|
|
422
|
+
}
|
|
423
|
+
catch {
|
|
424
|
+
return undefined;
|
|
484
425
|
}
|
|
485
426
|
}
|
|
486
427
|
//# sourceMappingURL=scan-all.js.map
|
|
@@ -1,59 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
import type { MCPTool } from '../types.js';
|
|
8
|
-
interface ScanAngularResult {
|
|
1
|
+
import type { MCPTool, ToolAnnotations, ToolContext } from '../types.js';
|
|
2
|
+
import { type ScanCounts } from './helpers/analysis-output.js';
|
|
3
|
+
import { type CancelledExecution } from './helpers/tool-context.js';
|
|
4
|
+
/** Result of the scan-angular tool. */
|
|
5
|
+
export interface ScanAngularResult {
|
|
6
|
+
/** The requested page of violations (`maxResults`, `resultOffset`). */
|
|
9
7
|
violations: {
|
|
8
|
+
/** Index-based id of the violation (`angular-<index>`). */
|
|
10
9
|
id: string;
|
|
10
|
+
/** Rule that reported the violation. */
|
|
11
11
|
ruleId: string;
|
|
12
|
+
/** Severity reported by the rule. */
|
|
12
13
|
severity: 'error' | 'warning' | 'info';
|
|
14
|
+
/** Rule message. */
|
|
13
15
|
message: string;
|
|
16
|
+
/** File path relative to `rootPath`. */
|
|
14
17
|
filePath: string;
|
|
18
|
+
/** 1-based line of the finding, when the rule reports one. */
|
|
15
19
|
line?: number;
|
|
20
|
+
/** Column of the finding, when the rule reports one. */
|
|
16
21
|
column?: number;
|
|
22
|
+
/** Rule category; `Angular` when the rule sets none. */
|
|
17
23
|
category: string;
|
|
24
|
+
/** Fix suggested by the rule; only with `includeAutoFixes`. */
|
|
18
25
|
suggestedFix?: string;
|
|
26
|
+
/** Rule-specific details. */
|
|
19
27
|
metadata?: Record<string, unknown>;
|
|
20
28
|
}[];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
/** Counts over all violations, independent of the page. */
|
|
30
|
+
counts: ScanCounts;
|
|
31
|
+
/** Human-readable summary for LLM consumption. */
|
|
32
|
+
summary: string;
|
|
33
|
+
/** Set when the client cancelled the scan; counts cover the analyzed files. */
|
|
34
|
+
execution?: CancelledExecution;
|
|
35
|
+
/** Scan metadata. */
|
|
28
36
|
metadata: {
|
|
37
|
+
/** Ids of the rules that ran. */
|
|
29
38
|
rulesExecuted: string[];
|
|
39
|
+
/** Duration of the scan in milliseconds. */
|
|
30
40
|
duration: number;
|
|
41
|
+
/** Root path of the scanned project. */
|
|
31
42
|
projectRoot: string;
|
|
32
43
|
};
|
|
44
|
+
/** Orchestration figures; set only when `orchestration.useWorkerThreads` is set. */
|
|
33
45
|
orchestration?: {
|
|
46
|
+
/** Whether the scan ran in parallel. */
|
|
34
47
|
parallel: boolean;
|
|
48
|
+
/** Whether only changed files were analyzed (always `false` here). */
|
|
35
49
|
incremental: boolean;
|
|
50
|
+
/** Files selected for the scan. */
|
|
36
51
|
filesAnalyzed: number;
|
|
52
|
+
/** Files skipped (always 0 here). */
|
|
37
53
|
filesSkipped: number;
|
|
54
|
+
/** Cache hit rate (always 0 here). */
|
|
38
55
|
cacheHitRate: number;
|
|
56
|
+
/** Duration of the scan in milliseconds. */
|
|
39
57
|
duration: number;
|
|
58
|
+
/** Files per second. */
|
|
40
59
|
throughput: number;
|
|
41
60
|
};
|
|
61
|
+
/** What the page covers of all violations. */
|
|
42
62
|
pagination?: {
|
|
63
|
+
/** Number of all violations. */
|
|
43
64
|
totalResults: number;
|
|
65
|
+
/** Number of violations in this page. */
|
|
44
66
|
returnedResults: number;
|
|
67
|
+
/** Offset of the page (`resultOffset`). */
|
|
45
68
|
offset: number;
|
|
69
|
+
/** Whether violations follow after this page. */
|
|
46
70
|
hasMore: boolean;
|
|
47
71
|
};
|
|
48
72
|
}
|
|
49
73
|
/**
|
|
50
|
-
*
|
|
74
|
+
* MCP tool `scan-angular`: scans for Angular-specific best practice
|
|
75
|
+
* violations. Runs only the AngularPlugin (28 rules: OnPush, TrackBy,
|
|
76
|
+
* performance, RxJS and others).
|
|
51
77
|
*/
|
|
52
78
|
export declare class ScanAngularTool implements MCPTool {
|
|
53
79
|
readonly name = "scan-angular";
|
|
54
|
-
readonly
|
|
80
|
+
readonly title = "Scan Angular Patterns";
|
|
81
|
+
readonly annotations: ToolAnnotations;
|
|
82
|
+
readonly description: string;
|
|
83
|
+
/**
|
|
84
|
+
* JSON Schema of the tool arguments.
|
|
85
|
+
* @hidden
|
|
86
|
+
*/
|
|
55
87
|
readonly inputSchema: {
|
|
56
88
|
type: string;
|
|
89
|
+
additionalProperties: boolean;
|
|
57
90
|
properties: {
|
|
58
91
|
rootPath: {
|
|
59
92
|
type: string;
|
|
@@ -120,7 +153,16 @@ export declare class ScanAngularTool implements MCPTool {
|
|
|
120
153
|
};
|
|
121
154
|
required: string[];
|
|
122
155
|
};
|
|
123
|
-
|
|
156
|
+
/**
|
|
157
|
+
* JSON Schema of the tool result (`structuredContent`).
|
|
158
|
+
* @hidden
|
|
159
|
+
*/
|
|
160
|
+
readonly outputSchema: {
|
|
161
|
+
type: "object";
|
|
162
|
+
properties: Record<string, unknown>;
|
|
163
|
+
required: string[];
|
|
164
|
+
};
|
|
165
|
+
execute(args: Record<string, unknown>, ctx?: ToolContext): Promise<ScanAngularResult>;
|
|
124
166
|
/**
|
|
125
167
|
* Load configuration from .angular-modernizer.json file.
|
|
126
168
|
* Only loads from the provided root path to avoid cache directory issues.
|
|
@@ -128,5 +170,4 @@ export declare class ScanAngularTool implements MCPTool {
|
|
|
128
170
|
private loadConfig;
|
|
129
171
|
private calculateSummary;
|
|
130
172
|
}
|
|
131
|
-
export {};
|
|
132
173
|
//# sourceMappingURL=scan-angular.d.ts.map
|