@angular-modernizer/adapter-mcp 0.2.0 → 1.0.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 +188 -235
- package/dist/cli.js +77 -27
- package/dist/index.d.ts +11 -3
- package/dist/index.js +10 -2
- package/dist/mcp-watcher.d.ts +6 -1
- package/dist/mcp-watcher.js +14 -10
- package/dist/server/limited-stdio-transport.d.ts +68 -0
- package/dist/server/limited-stdio-transport.js +115 -0
- package/dist/server/mcp-server.d.ts +41 -12
- package/dist/server/mcp-server.js +113 -94
- package/dist/server/package-version.d.ts +16 -0
- package/dist/server/package-version.js +37 -0
- package/dist/server/sdk-server.d.ts +70 -0
- package/dist/server/sdk-server.js +113 -0
- package/dist/server/stdio-guard.d.ts +20 -0
- package/dist/server/stdio-guard.js +48 -0
- package/dist/server/tool-registry.d.ts +3 -2
- package/dist/server/tool-registry.js +5 -5
- package/dist/tools/analyze-build-impact.d.ts +346 -14
- package/dist/tools/analyze-build-impact.js +315 -31
- package/dist/tools/analyze-core-to-shared.d.ts +134 -4
- package/dist/tools/analyze-core-to-shared.js +113 -9
- package/dist/tools/analyze-parser-performance.d.ts +200 -7
- package/dist/tools/analyze-parser-performance.js +108 -47
- package/dist/tools/analyze-project.d.ts +267 -5
- package/dist/tools/analyze-project.js +196 -8
- package/dist/tools/check-incremental-compatibility.d.ts +61 -1
- package/dist/tools/check-incremental-compatibility.js +58 -2
- package/dist/tools/collect-feedback.d.ts +199 -10
- package/dist/tools/collect-feedback.js +171 -99
- package/dist/tools/compare-health.d.ts +356 -0
- package/dist/tools/compare-health.js +472 -0
- package/dist/tools/extract-libraries.d.ts +156 -4
- package/dist/tools/extract-libraries.js +115 -10
- package/dist/tools/find-angular-symbol.d.ts +98 -9
- package/dist/tools/find-angular-symbol.js +104 -12
- package/dist/tools/find-component-hosts.d.ts +684 -0
- package/dist/tools/find-component-hosts.js +441 -0
- package/dist/tools/find-usages.d.ts +99 -4
- package/dist/tools/find-usages.js +131 -11
- package/dist/tools/get-bootstrap-execution.d.ts +258 -0
- package/dist/tools/get-bootstrap-execution.js +324 -0
- package/dist/tools/get-call-graph.d.ts +139 -4
- package/dist/tools/get-call-graph.js +123 -13
- package/dist/tools/get-operation-progress-tool.d.ts +114 -2
- package/dist/tools/get-operation-progress-tool.js +114 -7
- package/dist/tools/get-operation-progress.d.ts +1 -1
- package/dist/tools/get-operation-progress.js +5 -5
- package/dist/tools/helpers/analysis-output.d.ts +177 -0
- package/dist/tools/helpers/analysis-output.js +165 -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 +61 -0
- package/dist/tools/helpers/compact-output.js +83 -0
- 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 +86 -0
- package/dist/tools/helpers/health-delta.js +239 -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 +184 -0
- package/dist/tools/helpers/project-cache.js +331 -0
- 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 +72 -0
- package/dist/tools/helpers/rule-runner.js +131 -0
- package/dist/tools/helpers/scan-cache.d.ts +22 -0
- package/dist/tools/helpers/scan-cache.js +34 -0
- package/dist/tools/helpers/scan-plan.d.ts +48 -0
- package/dist/tools/helpers/scan-plan.js +166 -0
- package/dist/tools/helpers/scope-paths.d.ts +17 -0
- package/dist/tools/helpers/scope-paths.js +32 -0
- package/dist/tools/helpers/stack-frame-file-index.d.ts +10 -0
- package/dist/tools/helpers/stack-frame-file-index.js +71 -0
- package/dist/tools/helpers/tool-context.d.ts +60 -0
- package/dist/tools/helpers/tool-context.js +82 -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 +324 -0
- package/dist/tools/inspect-form-group.js +279 -0
- package/dist/tools/inspect-i18n.d.ts +466 -0
- package/dist/tools/inspect-i18n.js +400 -0
- package/dist/tools/inspect-template.d.ts +320 -0
- package/dist/tools/inspect-template.js +324 -0
- package/dist/tools/learn-patterns.d.ts +122 -1
- package/dist/tools/learn-patterns.js +97 -2
- package/dist/tools/list-imports.d.ts +128 -11
- package/dist/tools/list-imports.js +128 -8
- package/dist/tools/orchestrate-migration.d.ts +129 -5
- package/dist/tools/orchestrate-migration.js +166 -12
- package/dist/tools/parse-stack-trace.d.ts +59 -2
- package/dist/tools/parse-stack-trace.js +52 -4
- package/dist/tools/plan-migration.d.ts +418 -1
- package/dist/tools/plan-migration.js +355 -8
- package/dist/tools/resolve-type.d.ts +42 -1
- package/dist/tools/resolve-type.js +37 -4
- package/dist/tools/review-feedback.d.ts +206 -11
- package/dist/tools/review-feedback.js +132 -51
- package/dist/tools/rollback-changes.d.ts +79 -2
- package/dist/tools/rollback-changes.js +66 -14
- package/dist/tools/run-angular-cli.d.ts +45 -2
- package/dist/tools/run-angular-cli.js +67 -7
- package/dist/tools/run-build.d.ts +114 -2
- package/dist/tools/run-build.js +117 -8
- package/dist/tools/run-schematic.d.ts +70 -2
- package/dist/tools/run-schematic.js +104 -10
- package/dist/tools/scan-all.d.ts +24 -16
- package/dist/tools/scan-all.js +145 -137
- package/dist/tools/scan-angular.d.ts +20 -11
- package/dist/tools/scan-angular.js +52 -24
- package/dist/tools/scan-architecture.d.ts +42 -14
- package/dist/tools/scan-architecture.js +206 -163
- package/dist/tools/scan-solid.d.ts +20 -11
- package/dist/tools/scan-solid.js +52 -24
- package/dist/tools/search-codebase.d.ts +85 -1
- package/dist/tools/search-codebase.js +61 -4
- package/dist/tools/server-status.d.ts +370 -0
- package/dist/tools/server-status.js +369 -0
- package/dist/tools/suggest-improvements.d.ts +97 -5
- package/dist/tools/suggest-improvements.js +80 -44
- package/dist/tools/trace-output-flow.d.ts +791 -0
- package/dist/tools/trace-output-flow.js +668 -0
- 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 +335 -12
- package/dist/tools/transform-code.js +649 -608
- package/dist/tools/validate-before-transform.d.ts +116 -2
- package/dist/tools/validate-before-transform.js +55 -2
- package/dist/tools/validate-project-compatibility.d.ts +64 -2
- package/dist/tools/validate-project-compatibility.js +67 -4
- package/dist/tools/validate-transformation.d.ts +220 -2
- package/dist/tools/validate-transformation.js +113 -15
- package/dist/tools/verify-citations.d.ts +181 -0
- package/dist/tools/verify-citations.js +218 -0
- package/dist/types.d.ts +45 -1
- package/dist/utils/format-tool-response.d.ts +22 -59
- package/dist/utils/format-tool-response.js +25 -134
- package/package.json +30 -13
- 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 -57
- package/dist/server/json-rpc-handler.d.ts.map +0 -1
- package/dist/server/json-rpc-handler.js +0 -222
- 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/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-usages.d.ts.map +0 -1
- package/dist/tools/find-usages.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/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/rule-matcher.d.ts.map +0 -1
- package/dist/tools/helpers/rule-matcher.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/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/shared/scan-types.d.ts.map +0 -1
- 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/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,472 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @angular-modernizer/adapter-mcp - Compare Health Tool
|
|
3
|
+
*
|
|
4
|
+
* MCP tool that runs the scan-all scan and compares it with the previous run:
|
|
5
|
+
* which violations are new, fixed or unchanged, per rule and per file.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* scan-all returns a window of `maxResults` violations and sums only that
|
|
9
|
+
* window, so a comparison of two scan-all answers would compare two windows.
|
|
10
|
+
* This tool takes the complete result, stores it as a snapshot in the target
|
|
11
|
+
* project (default `.angular-modernizer-cache/health/last-run.json`, ignored
|
|
12
|
+
* like the cache) and compares the next run against it. Matching and snapshot
|
|
13
|
+
* format live in `helpers/health-delta.ts`.
|
|
14
|
+
*
|
|
15
|
+
* The snapshot is replaced after every comparison unless `updateSnapshot` is
|
|
16
|
+
* false. When the stored run used another scope (rules, include or exclude
|
|
17
|
+
* patterns) or the file cannot be read, nothing is compared and the file is
|
|
18
|
+
* kept unless `updateSnapshot` is explicitly true.
|
|
19
|
+
*/
|
|
20
|
+
import { isAbsolute, relative, resolve } from 'node:path';
|
|
21
|
+
import { RealFileSystemAdapter, } from '@angular-modernizer/core';
|
|
22
|
+
import { COMPACT_OUTPUT_SCHEMA, limitList, parseCompactOptions, } from './helpers/compact-output.js';
|
|
23
|
+
import { DEFAULT_HEALTH_SNAPSHOT_PATH, HEALTH_SNAPSHOT_VERSION, compareHealth, compareViolations, parseHealthSnapshot, scopeDifferences, serializeHealthSnapshot, } from './helpers/health-delta.js';
|
|
24
|
+
import { ScanAllTool } from './scan-all.js';
|
|
25
|
+
/** Violations spelled out per list in the summary; the rest is in the lists. */
|
|
26
|
+
const SUMMARY_LINES = 15;
|
|
27
|
+
const STRING_LIST = { type: 'array', items: { type: 'string' } };
|
|
28
|
+
const VIOLATION_SCHEMA = {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
ruleId: { type: 'string' },
|
|
32
|
+
filePath: { type: 'string' },
|
|
33
|
+
message: { type: 'string' },
|
|
34
|
+
severity: { type: 'string' },
|
|
35
|
+
category: { type: 'string' },
|
|
36
|
+
line: { type: 'integer' },
|
|
37
|
+
},
|
|
38
|
+
required: ['ruleId', 'filePath', 'message', 'severity', 'category'],
|
|
39
|
+
};
|
|
40
|
+
const RUN_SCHEMA = {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
createdAt: { type: 'string' },
|
|
44
|
+
analyzedFiles: { type: 'integer' },
|
|
45
|
+
totalViolations: { type: 'integer' },
|
|
46
|
+
},
|
|
47
|
+
required: ['createdAt', 'analyzedFiles', 'totalViolations'],
|
|
48
|
+
};
|
|
49
|
+
const COUNTS_SCHEMA = {
|
|
50
|
+
type: 'object',
|
|
51
|
+
additionalProperties: { type: 'integer' },
|
|
52
|
+
};
|
|
53
|
+
export class CompareHealthTool {
|
|
54
|
+
scan;
|
|
55
|
+
fileSystem;
|
|
56
|
+
now;
|
|
57
|
+
name = 'compare-health';
|
|
58
|
+
title = 'Compare Health With Last Run';
|
|
59
|
+
description = 'Run the full scan-all scan (all violations, no result window) and compare it with the previous run ' +
|
|
60
|
+
'stored in the project: new, fixed and unchanged violations, per rule (byRule) and per changed file ' +
|
|
61
|
+
'(byFile), plus the lists newViolations and fixedViolations. Violations match by rule, file and message ' +
|
|
62
|
+
'with digits ignored, not by line, so code moving up or down stays unchanged. The first run writes the ' +
|
|
63
|
+
'baseline (status baseline-created). After a comparison the snapshot is replaced by the current run ' +
|
|
64
|
+
'unless updateSnapshot is false. A snapshot taken with other rules or include/exclude patterns is not ' +
|
|
65
|
+
'compared (status scope-mismatch) and is only replaced with updateSnapshot: true. currentRun.bySeverity ' +
|
|
66
|
+
'and byCategory count all violations. Writes only the snapshot file.';
|
|
67
|
+
annotations = {
|
|
68
|
+
readOnlyHint: false,
|
|
69
|
+
destructiveHint: false,
|
|
70
|
+
idempotentHint: false,
|
|
71
|
+
openWorldHint: false,
|
|
72
|
+
};
|
|
73
|
+
inputSchema = {
|
|
74
|
+
type: 'object',
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
properties: {
|
|
77
|
+
rootPath: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: 'Root path of the project to scan',
|
|
80
|
+
},
|
|
81
|
+
rules: {
|
|
82
|
+
...STRING_LIST,
|
|
83
|
+
description: 'Rule IDs to compare (optional, all 52 if not specified). Part of the snapshot scope.',
|
|
84
|
+
},
|
|
85
|
+
includePatterns: {
|
|
86
|
+
...STRING_LIST,
|
|
87
|
+
description: 'File patterns to include, as in scan-all. Part of the snapshot scope.',
|
|
88
|
+
},
|
|
89
|
+
excludePatterns: {
|
|
90
|
+
...STRING_LIST,
|
|
91
|
+
description: 'File patterns to exclude, as in scan-all. Part of the snapshot scope.',
|
|
92
|
+
},
|
|
93
|
+
maxFiles: {
|
|
94
|
+
type: 'number',
|
|
95
|
+
description: 'Batch size for processing files, as in scan-all.',
|
|
96
|
+
},
|
|
97
|
+
snapshotPath: {
|
|
98
|
+
type: 'string',
|
|
99
|
+
description: `Snapshot file, absolute or relative to rootPath. Default: ${DEFAULT_HEALTH_SNAPSHOT_PATH}.`,
|
|
100
|
+
},
|
|
101
|
+
updateSnapshot: {
|
|
102
|
+
type: 'boolean',
|
|
103
|
+
description: 'false: compare only, keep the stored snapshot. true: also replace a snapshot with another scope or ' +
|
|
104
|
+
'an unreadable one. Default: replace after a comparison and write the first baseline.',
|
|
105
|
+
},
|
|
106
|
+
...COMPACT_OUTPUT_SCHEMA,
|
|
107
|
+
},
|
|
108
|
+
required: ['rootPath'],
|
|
109
|
+
};
|
|
110
|
+
outputSchema = {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
status: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
enum: [
|
|
116
|
+
'compared',
|
|
117
|
+
'baseline-created',
|
|
118
|
+
'no-baseline',
|
|
119
|
+
'scope-mismatch',
|
|
120
|
+
'invalid-snapshot',
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
projectRoot: { type: 'string' },
|
|
124
|
+
snapshotPath: { type: 'string' },
|
|
125
|
+
snapshotWritten: { type: 'boolean' },
|
|
126
|
+
previousRun: RUN_SCHEMA,
|
|
127
|
+
currentRun: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {
|
|
130
|
+
...RUN_SCHEMA.properties,
|
|
131
|
+
bySeverity: COUNTS_SCHEMA,
|
|
132
|
+
byCategory: COUNTS_SCHEMA,
|
|
133
|
+
},
|
|
134
|
+
required: [...RUN_SCHEMA.required, 'bySeverity', 'byCategory'],
|
|
135
|
+
},
|
|
136
|
+
totals: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
new: { type: 'integer' },
|
|
140
|
+
fixed: { type: 'integer' },
|
|
141
|
+
unchanged: { type: 'integer' },
|
|
142
|
+
},
|
|
143
|
+
required: ['new', 'fixed', 'unchanged'],
|
|
144
|
+
},
|
|
145
|
+
byRule: {
|
|
146
|
+
type: 'array',
|
|
147
|
+
items: {
|
|
148
|
+
type: 'object',
|
|
149
|
+
properties: {
|
|
150
|
+
ruleId: { type: 'string' },
|
|
151
|
+
previous: { type: 'integer' },
|
|
152
|
+
current: { type: 'integer' },
|
|
153
|
+
new: { type: 'integer' },
|
|
154
|
+
fixed: { type: 'integer' },
|
|
155
|
+
unchanged: { type: 'integer' },
|
|
156
|
+
},
|
|
157
|
+
required: [
|
|
158
|
+
'ruleId',
|
|
159
|
+
'previous',
|
|
160
|
+
'current',
|
|
161
|
+
'new',
|
|
162
|
+
'fixed',
|
|
163
|
+
'unchanged',
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
byFile: {
|
|
168
|
+
type: 'array',
|
|
169
|
+
items: {
|
|
170
|
+
type: 'object',
|
|
171
|
+
properties: {
|
|
172
|
+
filePath: { type: 'string' },
|
|
173
|
+
previous: { type: 'integer' },
|
|
174
|
+
current: { type: 'integer' },
|
|
175
|
+
new: { type: 'integer' },
|
|
176
|
+
fixed: { type: 'integer' },
|
|
177
|
+
},
|
|
178
|
+
required: ['filePath', 'previous', 'current', 'new', 'fixed'],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
newViolations: { type: 'array', items: VIOLATION_SCHEMA },
|
|
182
|
+
fixedViolations: { type: 'array', items: VIOLATION_SCHEMA },
|
|
183
|
+
rulesAdded: STRING_LIST,
|
|
184
|
+
rulesRemoved: STRING_LIST,
|
|
185
|
+
scopeDifferences: STRING_LIST,
|
|
186
|
+
truncated: { type: 'boolean' },
|
|
187
|
+
summary: { type: 'string' },
|
|
188
|
+
},
|
|
189
|
+
required: [
|
|
190
|
+
'status',
|
|
191
|
+
'projectRoot',
|
|
192
|
+
'snapshotPath',
|
|
193
|
+
'snapshotWritten',
|
|
194
|
+
'currentRun',
|
|
195
|
+
'byRule',
|
|
196
|
+
'rulesAdded',
|
|
197
|
+
'rulesRemoved',
|
|
198
|
+
'scopeDifferences',
|
|
199
|
+
'truncated',
|
|
200
|
+
'summary',
|
|
201
|
+
],
|
|
202
|
+
};
|
|
203
|
+
constructor(scan = (args, ctx) => new ScanAllTool().execute(args, ctx), fileSystem = new RealFileSystemAdapter(), now = () => new Date()) {
|
|
204
|
+
this.scan = scan;
|
|
205
|
+
this.fileSystem = fileSystem;
|
|
206
|
+
this.now = now;
|
|
207
|
+
}
|
|
208
|
+
async execute(args, ctx = {}) {
|
|
209
|
+
const input = parseInput(args);
|
|
210
|
+
const compact = parseCompactOptions(args);
|
|
211
|
+
const root = resolve(input.rootPath);
|
|
212
|
+
const snapshotFile = isAbsolute(input.snapshotPath)
|
|
213
|
+
? input.snapshotPath
|
|
214
|
+
: resolve(root, input.snapshotPath);
|
|
215
|
+
const snapshotLabel = relative(root, snapshotFile).startsWith('..')
|
|
216
|
+
? snapshotFile
|
|
217
|
+
: relative(root, snapshotFile);
|
|
218
|
+
const scanResult = await this.scan(scanArguments(root, input), ctx);
|
|
219
|
+
// A cancelled scan covers only part of the project: comparing it would
|
|
220
|
+
// report the rest as fixed, and writing it would replace the baseline
|
|
221
|
+
if (scanResult.execution?.stopReason === 'cancelled') {
|
|
222
|
+
throw new Error('Scan cancelled; snapshot not compared or written.');
|
|
223
|
+
}
|
|
224
|
+
const current = {
|
|
225
|
+
version: HEALTH_SNAPSHOT_VERSION,
|
|
226
|
+
createdAt: this.now().toISOString(),
|
|
227
|
+
scope: input.scope,
|
|
228
|
+
rulesExecuted: [...scanResult.metadata.rulesExecuted].sort(),
|
|
229
|
+
analyzedFiles: scanResult.counts.analyzedFiles,
|
|
230
|
+
violations: scanResult.violations
|
|
231
|
+
.map(toHealthViolation)
|
|
232
|
+
.sort(compareViolations),
|
|
233
|
+
};
|
|
234
|
+
const stored = await this.readSnapshot(snapshotFile);
|
|
235
|
+
const previous = stored.snapshot;
|
|
236
|
+
const differences = previous === undefined
|
|
237
|
+
? []
|
|
238
|
+
: scopeDifferences(previous.scope, current.scope);
|
|
239
|
+
const status = decideStatus(stored, differences);
|
|
240
|
+
const write = input.updateSnapshot === true ||
|
|
241
|
+
(input.updateSnapshot === undefined &&
|
|
242
|
+
(status === 'compared' || status === 'baseline-created'));
|
|
243
|
+
if (write) {
|
|
244
|
+
await this.fileSystem.writeFile(snapshotFile, serializeHealthSnapshot(current));
|
|
245
|
+
}
|
|
246
|
+
const output = buildOutput({
|
|
247
|
+
status,
|
|
248
|
+
root,
|
|
249
|
+
snapshotLabel,
|
|
250
|
+
written: write,
|
|
251
|
+
previous,
|
|
252
|
+
current,
|
|
253
|
+
differences,
|
|
254
|
+
compact,
|
|
255
|
+
});
|
|
256
|
+
return output;
|
|
257
|
+
}
|
|
258
|
+
async readSnapshot(path) {
|
|
259
|
+
if (!(await this.fileSystem.exists(path))) {
|
|
260
|
+
return { exists: false, snapshot: undefined };
|
|
261
|
+
}
|
|
262
|
+
const text = await this.fileSystem.readFile(path);
|
|
263
|
+
return { exists: true, snapshot: parseHealthSnapshot(text) };
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function parseInput(args) {
|
|
267
|
+
const { rootPath, maxFiles, snapshotPath, updateSnapshot } = args;
|
|
268
|
+
if (typeof rootPath !== 'string' || rootPath === '') {
|
|
269
|
+
throw new Error('rootPath is required');
|
|
270
|
+
}
|
|
271
|
+
if (maxFiles !== undefined &&
|
|
272
|
+
(typeof maxFiles !== 'number' ||
|
|
273
|
+
!Number.isInteger(maxFiles) ||
|
|
274
|
+
maxFiles < 1)) {
|
|
275
|
+
throw new Error('maxFiles must be a positive integer');
|
|
276
|
+
}
|
|
277
|
+
if (snapshotPath !== undefined &&
|
|
278
|
+
(typeof snapshotPath !== 'string' || snapshotPath === '')) {
|
|
279
|
+
throw new Error('snapshotPath must be a non-empty string');
|
|
280
|
+
}
|
|
281
|
+
if (updateSnapshot !== undefined && typeof updateSnapshot !== 'boolean') {
|
|
282
|
+
throw new Error('updateSnapshot must be a boolean');
|
|
283
|
+
}
|
|
284
|
+
return {
|
|
285
|
+
rootPath,
|
|
286
|
+
scope: {
|
|
287
|
+
rules: stringList(args, 'rules'),
|
|
288
|
+
includePatterns: stringList(args, 'includePatterns'),
|
|
289
|
+
excludePatterns: stringList(args, 'excludePatterns'),
|
|
290
|
+
},
|
|
291
|
+
maxFiles,
|
|
292
|
+
snapshotPath: snapshotPath ?? DEFAULT_HEALTH_SNAPSHOT_PATH,
|
|
293
|
+
updateSnapshot,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
function stringList(args, key) {
|
|
297
|
+
const value = args[key];
|
|
298
|
+
if (value === undefined) {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
if (!Array.isArray(value) || !value.every((x) => typeof x === 'string')) {
|
|
302
|
+
throw new Error(`${key} must be an array of strings`);
|
|
303
|
+
}
|
|
304
|
+
return [...value].sort();
|
|
305
|
+
}
|
|
306
|
+
/** scan-all arguments for the complete result; unset keys stay unset so the project config applies. */
|
|
307
|
+
function scanArguments(root, input) {
|
|
308
|
+
const { rules, includePatterns, excludePatterns } = input.scope;
|
|
309
|
+
return {
|
|
310
|
+
rootPath: root,
|
|
311
|
+
includeAutoFixes: false,
|
|
312
|
+
maxResults: Number.MAX_SAFE_INTEGER,
|
|
313
|
+
resultOffset: 0,
|
|
314
|
+
...(rules === null ? {} : { rules }),
|
|
315
|
+
...(includePatterns === null ? {} : { includePatterns }),
|
|
316
|
+
...(excludePatterns === null ? {} : { excludePatterns }),
|
|
317
|
+
...(input.maxFiles === undefined ? {} : { maxFiles: input.maxFiles }),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
function toHealthViolation(v) {
|
|
321
|
+
return {
|
|
322
|
+
ruleId: v.ruleId,
|
|
323
|
+
filePath: v.filePath,
|
|
324
|
+
message: v.message,
|
|
325
|
+
severity: v.severity,
|
|
326
|
+
category: v.category,
|
|
327
|
+
...(v.line === undefined ? {} : { line: v.line }),
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function decideStatus(stored, differences) {
|
|
331
|
+
if (!stored.exists) {
|
|
332
|
+
return 'baseline-created';
|
|
333
|
+
}
|
|
334
|
+
if (stored.snapshot === undefined) {
|
|
335
|
+
return 'invalid-snapshot';
|
|
336
|
+
}
|
|
337
|
+
return differences.length > 0 ? 'scope-mismatch' : 'compared';
|
|
338
|
+
}
|
|
339
|
+
function buildOutput(parts) {
|
|
340
|
+
const { root, snapshotLabel, written, previous, current, differences, compact, } = parts;
|
|
341
|
+
const status = parts.status === 'baseline-created' && !written
|
|
342
|
+
? 'no-baseline'
|
|
343
|
+
: parts.status;
|
|
344
|
+
const previousRules = new Set(previous?.rulesExecuted ?? []);
|
|
345
|
+
const currentRules = new Set(current.rulesExecuted);
|
|
346
|
+
const base = {
|
|
347
|
+
status,
|
|
348
|
+
projectRoot: root,
|
|
349
|
+
snapshotPath: snapshotLabel,
|
|
350
|
+
snapshotWritten: written,
|
|
351
|
+
...(previous === undefined ? {} : { previousRun: runInfo(previous) }),
|
|
352
|
+
currentRun: {
|
|
353
|
+
...runInfo(current),
|
|
354
|
+
bySeverity: countBy(current.violations, (v) => v.severity),
|
|
355
|
+
byCategory: countBy(current.violations, (v) => v.category),
|
|
356
|
+
},
|
|
357
|
+
rulesAdded: previous === undefined
|
|
358
|
+
? []
|
|
359
|
+
: current.rulesExecuted.filter((r) => !previousRules.has(r)),
|
|
360
|
+
rulesRemoved: previous === undefined
|
|
361
|
+
? []
|
|
362
|
+
: previous.rulesExecuted.filter((r) => !currentRules.has(r)),
|
|
363
|
+
scopeDifferences: differences,
|
|
364
|
+
};
|
|
365
|
+
if (status !== 'compared' || previous === undefined) {
|
|
366
|
+
const byRule = compareHealth([], current.violations).byRule.map((r) => ({
|
|
367
|
+
...r,
|
|
368
|
+
new: 0,
|
|
369
|
+
}));
|
|
370
|
+
return {
|
|
371
|
+
...base,
|
|
372
|
+
byRule,
|
|
373
|
+
truncated: false,
|
|
374
|
+
summary: describeOther(status, snapshotLabel, previous, current, differences, written),
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
const delta = compareHealth(previous.violations, current.violations);
|
|
378
|
+
const totals = {
|
|
379
|
+
new: delta.newViolations.length,
|
|
380
|
+
fixed: delta.fixedViolations.length,
|
|
381
|
+
unchanged: delta.unchanged,
|
|
382
|
+
};
|
|
383
|
+
const summary = describeComparison(previous, current, totals, delta.byRule, delta.newViolations, delta.fixedViolations, base.rulesAdded, snapshotLabel, written);
|
|
384
|
+
if (compact.summaryOnly) {
|
|
385
|
+
return { ...base, totals, byRule: delta.byRule, truncated: false, summary };
|
|
386
|
+
}
|
|
387
|
+
const byFile = limitList(delta.byFile, compact.maxResults);
|
|
388
|
+
const added = limitList(delta.newViolations, compact.maxResults);
|
|
389
|
+
const fixed = limitList(delta.fixedViolations, compact.maxResults);
|
|
390
|
+
return {
|
|
391
|
+
...base,
|
|
392
|
+
totals,
|
|
393
|
+
byRule: delta.byRule,
|
|
394
|
+
byFile: byFile.items,
|
|
395
|
+
newViolations: added.items,
|
|
396
|
+
fixedViolations: fixed.items,
|
|
397
|
+
truncated: byFile.truncated || added.truncated || fixed.truncated,
|
|
398
|
+
summary,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function runInfo(snapshot) {
|
|
402
|
+
return {
|
|
403
|
+
createdAt: snapshot.createdAt,
|
|
404
|
+
analyzedFiles: snapshot.analyzedFiles,
|
|
405
|
+
totalViolations: snapshot.violations.length,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
function countBy(violations, key) {
|
|
409
|
+
const counts = {};
|
|
410
|
+
for (const v of violations) {
|
|
411
|
+
counts[key(v)] = (counts[key(v)] ?? 0) + 1;
|
|
412
|
+
}
|
|
413
|
+
return counts;
|
|
414
|
+
}
|
|
415
|
+
function describeViolation(v) {
|
|
416
|
+
const where = v.line === undefined ? v.filePath : `${v.filePath}:${v.line}`;
|
|
417
|
+
return `${where} ${v.ruleId}: ${v.message}`;
|
|
418
|
+
}
|
|
419
|
+
function listLines(label, violations) {
|
|
420
|
+
if (violations.length === 0) {
|
|
421
|
+
return [];
|
|
422
|
+
}
|
|
423
|
+
const lines = [
|
|
424
|
+
`${label}:`,
|
|
425
|
+
...violations
|
|
426
|
+
.slice(0, SUMMARY_LINES)
|
|
427
|
+
.map((v) => `- ${describeViolation(v)}`),
|
|
428
|
+
];
|
|
429
|
+
if (violations.length > SUMMARY_LINES) {
|
|
430
|
+
lines.push(`... and ${violations.length - SUMMARY_LINES} more.`);
|
|
431
|
+
}
|
|
432
|
+
return lines;
|
|
433
|
+
}
|
|
434
|
+
function describeComparison(previous, current, totals, byRule, added, fixed, rulesAdded, snapshotLabel, written) {
|
|
435
|
+
const lines = [
|
|
436
|
+
`Compared with the run of ${previous.createdAt}: ${totals.new} new, ${totals.fixed} fixed, ` +
|
|
437
|
+
`${totals.unchanged} unchanged (${previous.violations.length} -> ${current.violations.length} ` +
|
|
438
|
+
`violations, ${current.analyzedFiles} files).`,
|
|
439
|
+
];
|
|
440
|
+
const changedRules = byRule.filter((r) => r.new + r.fixed > 0);
|
|
441
|
+
if (changedRules.length > 0) {
|
|
442
|
+
lines.push('By rule:', ...changedRules.map((r) => `- ${r.ruleId}: +${r.new} / -${r.fixed} (${r.previous} -> ${r.current})`));
|
|
443
|
+
}
|
|
444
|
+
if (rulesAdded.length > 0) {
|
|
445
|
+
lines.push(`Rules new since the previous run (their findings count as new): ${rulesAdded.join(', ')}.`);
|
|
446
|
+
}
|
|
447
|
+
lines.push(...listLines('New', added), ...listLines('Fixed', fixed));
|
|
448
|
+
lines.push(written
|
|
449
|
+
? `Snapshot ${snapshotLabel} now holds this run.`
|
|
450
|
+
: `Snapshot ${snapshotLabel} kept (updateSnapshot: false).`);
|
|
451
|
+
return lines.join('\n');
|
|
452
|
+
}
|
|
453
|
+
function describeOther(status, snapshotLabel, previous, current, differences, written) {
|
|
454
|
+
const run = `${current.violations.length} violations in ${current.analyzedFiles} files`;
|
|
455
|
+
const replaced = written
|
|
456
|
+
? ` Replaced by this run (updateSnapshot: true): ${run}.`
|
|
457
|
+
: ' Kept; pass updateSnapshot: true to replace it with this run, or another snapshotPath to keep both.';
|
|
458
|
+
switch (status) {
|
|
459
|
+
case 'baseline-created':
|
|
460
|
+
return `No previous run at ${snapshotLabel}. Baseline written: ${run}. The next run reports new, fixed and unchanged violations.`;
|
|
461
|
+
case 'no-baseline':
|
|
462
|
+
return `No previous run at ${snapshotLabel}; updateSnapshot is false, so no baseline was written. Current run: ${run}.`;
|
|
463
|
+
case 'scope-mismatch':
|
|
464
|
+
return (`The previous run (${previous?.createdAt ?? '?'}) used another scope, so nothing was compared: ` +
|
|
465
|
+
`${differences.join('; ')}.${replaced}`);
|
|
466
|
+
case 'invalid-snapshot':
|
|
467
|
+
return `${snapshotLabel} is not a readable health snapshot (version ${HEALTH_SNAPSHOT_VERSION}); nothing was compared.${replaced}`;
|
|
468
|
+
case 'compared':
|
|
469
|
+
return `Current run: ${run}.`;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
//# sourceMappingURL=compare-health.js.map
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 2. Extraction: pass an opportunity's artifacts to transform-code with
|
|
10
10
|
* transformation: 'library-extraction' to execute the actual migration
|
|
11
11
|
*/
|
|
12
|
-
import type { MCPTool } from '../types.js';
|
|
12
|
+
import type { MCPTool, ToolAnnotations } from '../types.js';
|
|
13
13
|
/**
|
|
14
14
|
* A single library extraction opportunity.
|
|
15
15
|
*/
|
|
@@ -40,8 +40,8 @@ interface ExtractionOpportunity {
|
|
|
40
40
|
interface ExtractLibrariesResult {
|
|
41
41
|
/** Detected extraction opportunities. */
|
|
42
42
|
opportunities: ExtractionOpportunity[];
|
|
43
|
-
/**
|
|
44
|
-
|
|
43
|
+
/** Counts over all opportunities, independent of the page. */
|
|
44
|
+
counts: {
|
|
45
45
|
totalOpportunities: number;
|
|
46
46
|
analyzedFiles: number;
|
|
47
47
|
byCategory: Record<string, number>;
|
|
@@ -50,6 +50,8 @@ interface ExtractLibrariesResult {
|
|
|
50
50
|
byKind: Record<string, number>;
|
|
51
51
|
totalArtifacts: number;
|
|
52
52
|
};
|
|
53
|
+
/** Human-readable summary for LLM consumption. */
|
|
54
|
+
summary: string;
|
|
53
55
|
/** Suggested next step instructions for the LLM. */
|
|
54
56
|
nextSteps: string[];
|
|
55
57
|
/** Analysis metadata. */
|
|
@@ -72,9 +74,12 @@ interface ExtractLibrariesResult {
|
|
|
72
74
|
*/
|
|
73
75
|
export declare class ExtractLibrariesTool implements MCPTool {
|
|
74
76
|
readonly name = "extract-libraries";
|
|
75
|
-
readonly
|
|
77
|
+
readonly title = "Detect Library Candidates";
|
|
78
|
+
readonly annotations: ToolAnnotations;
|
|
79
|
+
readonly description = "Detect Angular artifacts in shared folders that qualify for extraction into dedicated libraries with secondary entry points. Returns opportunities with cohesion/reusability scores and suggested library names; counts cover all of them, summary is a short text.";
|
|
76
80
|
readonly inputSchema: {
|
|
77
81
|
type: string;
|
|
82
|
+
additionalProperties: boolean;
|
|
78
83
|
properties: {
|
|
79
84
|
rootPath: {
|
|
80
85
|
type: string;
|
|
@@ -117,6 +122,153 @@ export declare class ExtractLibrariesTool implements MCPTool {
|
|
|
117
122
|
};
|
|
118
123
|
required: string[];
|
|
119
124
|
};
|
|
125
|
+
readonly outputSchema: {
|
|
126
|
+
type: string;
|
|
127
|
+
properties: {
|
|
128
|
+
opportunities: {
|
|
129
|
+
type: string;
|
|
130
|
+
items: {
|
|
131
|
+
type: string;
|
|
132
|
+
properties: {
|
|
133
|
+
ruleId: {
|
|
134
|
+
type: string;
|
|
135
|
+
};
|
|
136
|
+
message: {
|
|
137
|
+
type: string;
|
|
138
|
+
};
|
|
139
|
+
filePath: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
suggestedLibraryName: {
|
|
143
|
+
type: string;
|
|
144
|
+
};
|
|
145
|
+
category: {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
artifacts: {
|
|
149
|
+
readonly type: "array";
|
|
150
|
+
readonly items: {
|
|
151
|
+
readonly type: "string";
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
secondaryEntryPoints: {
|
|
155
|
+
readonly type: "array";
|
|
156
|
+
readonly items: {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
cohesionScore: {
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
163
|
+
reusabilityScore: {
|
|
164
|
+
type: string;
|
|
165
|
+
};
|
|
166
|
+
migrationComplexity: {
|
|
167
|
+
type: string;
|
|
168
|
+
};
|
|
169
|
+
estimatedEffort: {
|
|
170
|
+
type: string;
|
|
171
|
+
properties: {
|
|
172
|
+
value: {
|
|
173
|
+
type: string;
|
|
174
|
+
};
|
|
175
|
+
unit: {
|
|
176
|
+
type: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
required: string[];
|
|
180
|
+
};
|
|
181
|
+
dependencies: {
|
|
182
|
+
readonly type: "array";
|
|
183
|
+
readonly items: {
|
|
184
|
+
readonly type: "string";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
circularDependencies: {
|
|
188
|
+
readonly type: "array";
|
|
189
|
+
readonly items: {
|
|
190
|
+
readonly type: "string";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
candidateKind: {
|
|
194
|
+
type: string;
|
|
195
|
+
};
|
|
196
|
+
metadata: {
|
|
197
|
+
type: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
required: string[];
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
counts: {
|
|
204
|
+
type: string;
|
|
205
|
+
properties: {
|
|
206
|
+
totalOpportunities: {
|
|
207
|
+
type: string;
|
|
208
|
+
};
|
|
209
|
+
analyzedFiles: {
|
|
210
|
+
type: string;
|
|
211
|
+
};
|
|
212
|
+
byCategory: {
|
|
213
|
+
readonly type: "object";
|
|
214
|
+
readonly additionalProperties: {
|
|
215
|
+
readonly type: "integer";
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
byComplexity: {
|
|
219
|
+
readonly type: "object";
|
|
220
|
+
readonly additionalProperties: {
|
|
221
|
+
readonly type: "integer";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
byKind: {
|
|
225
|
+
readonly type: "object";
|
|
226
|
+
readonly additionalProperties: {
|
|
227
|
+
readonly type: "integer";
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
totalArtifacts: {
|
|
231
|
+
type: string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
required: string[];
|
|
235
|
+
};
|
|
236
|
+
summary: {
|
|
237
|
+
type: string;
|
|
238
|
+
};
|
|
239
|
+
nextSteps: {
|
|
240
|
+
readonly type: "array";
|
|
241
|
+
readonly items: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
metadata: {
|
|
246
|
+
type: string;
|
|
247
|
+
properties: {
|
|
248
|
+
duration: {
|
|
249
|
+
type: string;
|
|
250
|
+
};
|
|
251
|
+
projectRoot: {
|
|
252
|
+
type: string;
|
|
253
|
+
};
|
|
254
|
+
targetFolders: {
|
|
255
|
+
readonly type: "array";
|
|
256
|
+
readonly items: {
|
|
257
|
+
readonly type: "string";
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
minReusabilityScore: {
|
|
261
|
+
type: string;
|
|
262
|
+
};
|
|
263
|
+
minCohesionScore: {
|
|
264
|
+
type: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
required: string[];
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
required: string[];
|
|
271
|
+
};
|
|
120
272
|
execute(args: Record<string, unknown>): Promise<ExtractLibrariesResult>;
|
|
121
273
|
private emptyResult;
|
|
122
274
|
private buildNextSteps;
|