@angular-modernizer/adapter-mcp 0.3.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 +103 -218
- package/dist/cli.js +13 -13
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -2
- package/dist/mcp-watcher.d.ts +6 -1
- package/dist/mcp-watcher.js +11 -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 +12 -14
- package/dist/server/mcp-server.js +41 -75
- 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/tool-registry.d.ts +3 -2
- package/dist/server/tool-registry.js +5 -5
- package/dist/tools/analyze-build-impact.d.ts +220 -1
- package/dist/tools/analyze-build-impact.js +145 -3
- 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 +69 -3
- package/dist/tools/find-angular-symbol.js +55 -8
- package/dist/tools/find-component-hosts.d.ts +572 -2
- package/dist/tools/find-component-hosts.js +207 -6
- package/dist/tools/find-usages.d.ts +79 -1
- package/dist/tools/find-usages.js +64 -7
- package/dist/tools/get-bootstrap-execution.d.ts +151 -1
- package/dist/tools/get-bootstrap-execution.js +84 -3
- package/dist/tools/get-call-graph.d.ts +111 -1
- package/dist/tools/get-call-graph.js +72 -10
- 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/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 +11 -4
- package/dist/tools/helpers/project-cache.js +22 -4
- 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 +9 -4
- package/dist/tools/helpers/rule-runner.js +28 -14
- 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 +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/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 +232 -1
- package/dist/tools/inspect-form-group.js +120 -2
- package/dist/tools/inspect-i18n.d.ts +382 -1
- package/dist/tools/inspect-i18n.js +199 -2
- package/dist/tools/inspect-template.d.ts +232 -1
- package/dist/tools/inspect-template.js +160 -2
- package/dist/tools/learn-patterns.d.ts +122 -1
- package/dist/tools/learn-patterns.js +97 -2
- package/dist/tools/list-imports.d.ts +111 -10
- package/dist/tools/list-imports.js +110 -7
- package/dist/tools/orchestrate-migration.d.ts +128 -5
- package/dist/tools/orchestrate-migration.js +135 -13
- package/dist/tools/parse-stack-trace.d.ts +56 -1
- package/dist/tools/parse-stack-trace.js +34 -0
- package/dist/tools/plan-migration.d.ts +330 -1
- package/dist/tools/plan-migration.js +154 -3
- package/dist/tools/resolve-type.d.ts +39 -1
- package/dist/tools/resolve-type.js +31 -2
- 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 +19 -11
- package/dist/tools/scan-all.js +139 -131
- package/dist/tools/scan-angular.d.ts +19 -10
- package/dist/tools/scan-angular.js +51 -23
- package/dist/tools/scan-architecture.d.ts +17 -10
- package/dist/tools/scan-architecture.js +93 -31
- package/dist/tools/scan-solid.d.ts +19 -10
- package/dist/tools/scan-solid.js +51 -23
- package/dist/tools/search-codebase.d.ts +82 -1
- package/dist/tools/search-codebase.js +55 -2
- package/dist/tools/server-status.d.ts +279 -5
- package/dist/tools/server-status.js +179 -5
- 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 +682 -2
- package/dist/tools/trace-output-flow.js +375 -15
- 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 +38 -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 -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.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/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,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @angular-modernizer/adapter-mcp - Validation issues in summaries
|
|
3
|
+
*
|
|
4
|
+
* validate-before-transform and validate-transformation return an `issues`
|
|
5
|
+
* list with a severity each; their summaries count the issues per severity
|
|
6
|
+
* and spell out the first ones, errors first.
|
|
7
|
+
*/
|
|
8
|
+
/** Issues spelled out in a summary; the rest is in `issues`. */
|
|
9
|
+
export declare const SUMMARY_ISSUES = 10;
|
|
10
|
+
/** The part of a validation issue a summary shows. */
|
|
11
|
+
export interface SummaryIssue {
|
|
12
|
+
type: string;
|
|
13
|
+
severity: 'error' | 'warning' | 'info';
|
|
14
|
+
message: string;
|
|
15
|
+
line?: number;
|
|
16
|
+
}
|
|
17
|
+
/** `N issue(s) (error 2, warning 1)` */
|
|
18
|
+
export declare function issueCount(issues: readonly SummaryIssue[]): string;
|
|
19
|
+
/** One `- severity type line N: message` line per issue, errors first, at most `max`. */
|
|
20
|
+
export declare function issueLines(issues: readonly SummaryIssue[], max?: number): string[];
|
|
21
|
+
/** Output schema of a validation issue list. */
|
|
22
|
+
export declare const VALIDATION_ISSUES_SCHEMA: {
|
|
23
|
+
readonly type: "array";
|
|
24
|
+
readonly items: {
|
|
25
|
+
readonly type: "object";
|
|
26
|
+
readonly properties: {
|
|
27
|
+
readonly type: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
};
|
|
30
|
+
readonly severity: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
readonly enum: readonly ["error", "warning", "info"];
|
|
33
|
+
};
|
|
34
|
+
readonly message: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
};
|
|
37
|
+
readonly filePath: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
};
|
|
40
|
+
readonly line: {
|
|
41
|
+
readonly type: "integer";
|
|
42
|
+
};
|
|
43
|
+
readonly column: {
|
|
44
|
+
readonly type: "integer";
|
|
45
|
+
};
|
|
46
|
+
readonly details: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly required: readonly ["type", "severity", "message"];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=validation-output.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @angular-modernizer/adapter-mcp - Validation issues in summaries
|
|
3
|
+
*
|
|
4
|
+
* validate-before-transform and validate-transformation return an `issues`
|
|
5
|
+
* list with a severity each; their summaries count the issues per severity
|
|
6
|
+
* and spell out the first ones, errors first.
|
|
7
|
+
*/
|
|
8
|
+
import { countList } from './analysis-output.js';
|
|
9
|
+
/** Issues spelled out in a summary; the rest is in `issues`. */
|
|
10
|
+
export const SUMMARY_ISSUES = 10;
|
|
11
|
+
const SEVERITY_RANK = { error: 0, warning: 1, info: 2 };
|
|
12
|
+
/** `N issue(s) (error 2, warning 1)` */
|
|
13
|
+
export function issueCount(issues) {
|
|
14
|
+
const bySeverity = {};
|
|
15
|
+
for (const issue of issues) {
|
|
16
|
+
bySeverity[issue.severity] = (bySeverity[issue.severity] ?? 0) + 1;
|
|
17
|
+
}
|
|
18
|
+
const counts = countList(bySeverity, 3);
|
|
19
|
+
return `${issues.length} issue(s)${counts === undefined ? '' : ` (${counts})`}`;
|
|
20
|
+
}
|
|
21
|
+
/** One `- severity type line N: message` line per issue, errors first, at most `max`. */
|
|
22
|
+
export function issueLines(issues, max = SUMMARY_ISSUES) {
|
|
23
|
+
return [...issues]
|
|
24
|
+
.sort((a, b) => SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity])
|
|
25
|
+
.slice(0, max)
|
|
26
|
+
.map((issue) => {
|
|
27
|
+
const where = issue.line === undefined ? '' : ` line ${issue.line}`;
|
|
28
|
+
return `- ${issue.severity} ${issue.type}${where}: ${issue.message}`;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** Output schema of a validation issue list. */
|
|
32
|
+
export const VALIDATION_ISSUES_SCHEMA = {
|
|
33
|
+
type: 'array',
|
|
34
|
+
items: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
properties: {
|
|
37
|
+
type: { type: 'string' },
|
|
38
|
+
severity: { type: 'string', enum: ['error', 'warning', 'info'] },
|
|
39
|
+
message: { type: 'string' },
|
|
40
|
+
filePath: { type: 'string' },
|
|
41
|
+
line: { type: 'integer' },
|
|
42
|
+
column: { type: 'integer' },
|
|
43
|
+
details: { type: 'string' },
|
|
44
|
+
},
|
|
45
|
+
required: ['type', 'severity', 'message'],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=validation-output.js.map
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* // args: { file: 'src/app/edit/edit.component.ts', projectRoot: '/project' }
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
import { type MCPTool } from '../types.js';
|
|
21
|
+
import { type MCPTool, type ToolAnnotations } from '../types.js';
|
|
22
22
|
import { type InspectedForm, type InspectedFormControl } from '@angular-modernizer/api';
|
|
23
23
|
import { ProjectCache } from './helpers/project-cache.js';
|
|
24
24
|
/** A control with the cascade optionally dropped. */
|
|
@@ -35,6 +35,8 @@ interface InspectFormGroupOutput {
|
|
|
35
35
|
forms: FormOutput[];
|
|
36
36
|
summary: string;
|
|
37
37
|
tsConfigPath: string;
|
|
38
|
+
/** Conditions that can make the result incomplete (unresolved library imports). */
|
|
39
|
+
warnings?: string[];
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* MCP tool that inspects Reactive Forms in a file.
|
|
@@ -42,10 +44,13 @@ interface InspectFormGroupOutput {
|
|
|
42
44
|
export declare class InspectFormGroupTool implements MCPTool {
|
|
43
45
|
private readonly projects;
|
|
44
46
|
readonly name = "inspect-form-group";
|
|
47
|
+
readonly title = "Inspect Form Group";
|
|
48
|
+
readonly annotations: ToolAnnotations;
|
|
45
49
|
constructor(projects?: ProjectCache);
|
|
46
50
|
readonly description: string;
|
|
47
51
|
readonly inputSchema: {
|
|
48
52
|
type: string;
|
|
53
|
+
additionalProperties: boolean;
|
|
49
54
|
properties: {
|
|
50
55
|
summaryOnly: {
|
|
51
56
|
readonly type: "boolean";
|
|
@@ -85,6 +90,232 @@ export declare class InspectFormGroupTool implements MCPTool {
|
|
|
85
90
|
};
|
|
86
91
|
required: string[];
|
|
87
92
|
};
|
|
93
|
+
readonly outputSchema: {
|
|
94
|
+
type: string;
|
|
95
|
+
properties: {
|
|
96
|
+
warnings: {
|
|
97
|
+
readonly type: "array";
|
|
98
|
+
readonly items: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
};
|
|
101
|
+
readonly description: "Conditions that can make the result incomplete, e.g. library imports that do not resolve because node_modules is missing.";
|
|
102
|
+
};
|
|
103
|
+
forms: {
|
|
104
|
+
type: string;
|
|
105
|
+
items: {
|
|
106
|
+
readonly type: "object";
|
|
107
|
+
readonly properties: {
|
|
108
|
+
readonly className: {
|
|
109
|
+
readonly type: "string";
|
|
110
|
+
};
|
|
111
|
+
readonly property: {
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
};
|
|
114
|
+
readonly file: {
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
};
|
|
117
|
+
readonly definedAt: {
|
|
118
|
+
readonly type: "array";
|
|
119
|
+
readonly items: {
|
|
120
|
+
readonly type: "integer";
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
readonly kind: {
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
};
|
|
126
|
+
readonly validators: {
|
|
127
|
+
readonly type: "array";
|
|
128
|
+
readonly items: {
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly controls: {
|
|
133
|
+
readonly type: "array";
|
|
134
|
+
readonly items: {
|
|
135
|
+
readonly type: "object";
|
|
136
|
+
readonly properties: {
|
|
137
|
+
readonly path: {
|
|
138
|
+
readonly type: "string";
|
|
139
|
+
};
|
|
140
|
+
readonly kind: {
|
|
141
|
+
readonly type: "string";
|
|
142
|
+
};
|
|
143
|
+
readonly line: {
|
|
144
|
+
readonly type: "integer";
|
|
145
|
+
};
|
|
146
|
+
readonly disabledInitially: {
|
|
147
|
+
readonly type: "boolean";
|
|
148
|
+
};
|
|
149
|
+
readonly validators: {
|
|
150
|
+
readonly type: "array";
|
|
151
|
+
readonly items: {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly asyncValidators: {
|
|
156
|
+
readonly type: "array";
|
|
157
|
+
readonly items: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
readonly addedAt: {
|
|
162
|
+
readonly type: "integer";
|
|
163
|
+
};
|
|
164
|
+
readonly operations: {
|
|
165
|
+
readonly type: "array";
|
|
166
|
+
readonly items: {
|
|
167
|
+
readonly type: "object";
|
|
168
|
+
readonly properties: {
|
|
169
|
+
readonly op: {
|
|
170
|
+
readonly type: "string";
|
|
171
|
+
};
|
|
172
|
+
readonly line: {
|
|
173
|
+
readonly type: "integer";
|
|
174
|
+
};
|
|
175
|
+
readonly args: {
|
|
176
|
+
readonly type: "string";
|
|
177
|
+
};
|
|
178
|
+
readonly in: {
|
|
179
|
+
readonly type: "string";
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
readonly required: readonly ["op", "line", "in"];
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
readonly cascade: {
|
|
186
|
+
readonly type: "array";
|
|
187
|
+
readonly items: {
|
|
188
|
+
readonly type: "object";
|
|
189
|
+
readonly properties: {
|
|
190
|
+
readonly op: {
|
|
191
|
+
readonly type: "string";
|
|
192
|
+
};
|
|
193
|
+
readonly from: {
|
|
194
|
+
readonly type: "string";
|
|
195
|
+
};
|
|
196
|
+
readonly line: {
|
|
197
|
+
readonly type: "integer";
|
|
198
|
+
};
|
|
199
|
+
readonly in: {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly required: readonly ["op", "from", "line", "in"];
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
readonly reEnabledBy: {
|
|
207
|
+
readonly type: "array";
|
|
208
|
+
readonly items: {
|
|
209
|
+
readonly type: "object";
|
|
210
|
+
readonly properties: {
|
|
211
|
+
readonly op: {
|
|
212
|
+
readonly type: "string";
|
|
213
|
+
};
|
|
214
|
+
readonly from: {
|
|
215
|
+
readonly type: "string";
|
|
216
|
+
};
|
|
217
|
+
readonly line: {
|
|
218
|
+
readonly type: "integer";
|
|
219
|
+
};
|
|
220
|
+
readonly in: {
|
|
221
|
+
readonly type: "string";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
readonly required: readonly ["op", "from", "line", "in"];
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
readonly required: readonly ["path", "kind", "line", "disabledInitially", "validators", "asyncValidators", "operations"];
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
readonly operations: {
|
|
232
|
+
readonly type: "array";
|
|
233
|
+
readonly items: {
|
|
234
|
+
readonly type: "object";
|
|
235
|
+
readonly properties: {
|
|
236
|
+
readonly op: {
|
|
237
|
+
readonly type: "string";
|
|
238
|
+
};
|
|
239
|
+
readonly line: {
|
|
240
|
+
readonly type: "integer";
|
|
241
|
+
};
|
|
242
|
+
readonly args: {
|
|
243
|
+
readonly type: "string";
|
|
244
|
+
};
|
|
245
|
+
readonly in: {
|
|
246
|
+
readonly type: "string";
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
readonly required: readonly ["op", "line", "in"];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly unknownPaths: {
|
|
253
|
+
readonly type: "array";
|
|
254
|
+
readonly items: {
|
|
255
|
+
readonly type: "object";
|
|
256
|
+
readonly properties: {
|
|
257
|
+
readonly path: {
|
|
258
|
+
readonly type: "string";
|
|
259
|
+
};
|
|
260
|
+
readonly op: {
|
|
261
|
+
readonly type: "string";
|
|
262
|
+
};
|
|
263
|
+
readonly line: {
|
|
264
|
+
readonly type: "integer";
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
readonly required: readonly ["path", "op", "line"];
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
readonly dynamicOperations: {
|
|
271
|
+
readonly type: "array";
|
|
272
|
+
readonly items: {
|
|
273
|
+
readonly type: "object";
|
|
274
|
+
readonly properties: {
|
|
275
|
+
readonly path: {
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
};
|
|
278
|
+
readonly op: {
|
|
279
|
+
readonly type: "string";
|
|
280
|
+
};
|
|
281
|
+
readonly line: {
|
|
282
|
+
readonly type: "integer";
|
|
283
|
+
};
|
|
284
|
+
readonly args: {
|
|
285
|
+
readonly type: "string";
|
|
286
|
+
};
|
|
287
|
+
readonly in: {
|
|
288
|
+
readonly type: "string";
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
readonly required: readonly ["op", "line", "in", "path"];
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
readonly counts: {
|
|
295
|
+
readonly type: "object";
|
|
296
|
+
readonly properties: {
|
|
297
|
+
[k: string]: {
|
|
298
|
+
type: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
readonly required: readonly ["controls", "validated", "disabledInitially", "operations", "unknownPaths", "dynamicOperations", "reEnabledByAncestor"];
|
|
302
|
+
};
|
|
303
|
+
readonly truncated: {
|
|
304
|
+
readonly type: "boolean";
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
readonly required: readonly ["className", "property", "file", "definedAt", "kind", "validators", "operations", "unknownPaths", "dynamicOperations", "counts", "truncated"];
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
summary: {
|
|
311
|
+
type: string;
|
|
312
|
+
};
|
|
313
|
+
tsConfigPath: {
|
|
314
|
+
type: string;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
required: string[];
|
|
318
|
+
};
|
|
88
319
|
execute(args: Record<string, unknown>): Promise<InspectFormGroupOutput>;
|
|
89
320
|
private shape;
|
|
90
321
|
private buildSummary;
|
|
@@ -24,12 +24,119 @@ import { isAbsolute, resolve } from 'node:path';
|
|
|
24
24
|
import { findTsConfig } from './helpers/find-ts-config.js';
|
|
25
25
|
import { ProjectCache } from './helpers/project-cache.js';
|
|
26
26
|
import { COMPACT_OUTPUT_SCHEMA, limitList, parseCompactOptions, } from './helpers/compact-output.js';
|
|
27
|
+
import { WARNINGS_OUTPUT_SCHEMA, withWarnings, } from './helpers/output-contract.js';
|
|
28
|
+
import { STRING_ARRAY } from './helpers/investigation-schemas.js';
|
|
29
|
+
const OPERATION_FIELDS = {
|
|
30
|
+
op: { type: 'string' },
|
|
31
|
+
line: { type: 'integer' },
|
|
32
|
+
args: { type: 'string' },
|
|
33
|
+
in: { type: 'string' },
|
|
34
|
+
};
|
|
35
|
+
const OPERATIONS_SCHEMA = {
|
|
36
|
+
type: 'array',
|
|
37
|
+
items: { type: 'object', properties: OPERATION_FIELDS, required: ['op', 'line', 'in'] },
|
|
38
|
+
};
|
|
39
|
+
const CASCADE_SCHEMA = {
|
|
40
|
+
type: 'array',
|
|
41
|
+
items: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
op: { type: 'string' },
|
|
45
|
+
from: { type: 'string' },
|
|
46
|
+
line: { type: 'integer' },
|
|
47
|
+
in: { type: 'string' },
|
|
48
|
+
},
|
|
49
|
+
required: ['op', 'from', 'line', 'in'],
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const FORM_COUNT_KEYS = [
|
|
53
|
+
'controls',
|
|
54
|
+
'validated',
|
|
55
|
+
'disabledInitially',
|
|
56
|
+
'operations',
|
|
57
|
+
'unknownPaths',
|
|
58
|
+
'dynamicOperations',
|
|
59
|
+
'reEnabledByAncestor',
|
|
60
|
+
];
|
|
61
|
+
const FORM_SCHEMA = {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
className: { type: 'string' },
|
|
65
|
+
property: { type: 'string' },
|
|
66
|
+
file: { type: 'string' },
|
|
67
|
+
definedAt: { type: 'array', items: { type: 'integer' } },
|
|
68
|
+
kind: { type: 'string' },
|
|
69
|
+
validators: STRING_ARRAY,
|
|
70
|
+
controls: {
|
|
71
|
+
type: 'array',
|
|
72
|
+
items: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
path: { type: 'string' },
|
|
76
|
+
kind: { type: 'string' },
|
|
77
|
+
line: { type: 'integer' },
|
|
78
|
+
disabledInitially: { type: 'boolean' },
|
|
79
|
+
validators: STRING_ARRAY,
|
|
80
|
+
asyncValidators: STRING_ARRAY,
|
|
81
|
+
addedAt: { type: 'integer' },
|
|
82
|
+
operations: OPERATIONS_SCHEMA,
|
|
83
|
+
cascade: CASCADE_SCHEMA,
|
|
84
|
+
reEnabledBy: CASCADE_SCHEMA,
|
|
85
|
+
},
|
|
86
|
+
required: ['path', 'kind', 'line', 'disabledInitially', 'validators', 'asyncValidators', 'operations'],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
operations: OPERATIONS_SCHEMA,
|
|
90
|
+
unknownPaths: {
|
|
91
|
+
type: 'array',
|
|
92
|
+
items: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: { path: { type: 'string' }, op: { type: 'string' }, line: { type: 'integer' } },
|
|
95
|
+
required: ['path', 'op', 'line'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
dynamicOperations: {
|
|
99
|
+
type: 'array',
|
|
100
|
+
items: {
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: { ...OPERATION_FIELDS, path: { type: 'string' } },
|
|
103
|
+
required: ['op', 'line', 'in', 'path'],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
counts: {
|
|
107
|
+
type: 'object',
|
|
108
|
+
properties: Object.fromEntries(FORM_COUNT_KEYS.map((k) => [k, { type: 'integer' }])),
|
|
109
|
+
required: [...FORM_COUNT_KEYS],
|
|
110
|
+
},
|
|
111
|
+
truncated: { type: 'boolean' },
|
|
112
|
+
},
|
|
113
|
+
required: [
|
|
114
|
+
'className',
|
|
115
|
+
'property',
|
|
116
|
+
'file',
|
|
117
|
+
'definedAt',
|
|
118
|
+
'kind',
|
|
119
|
+
'validators',
|
|
120
|
+
'operations',
|
|
121
|
+
'unknownPaths',
|
|
122
|
+
'dynamicOperations',
|
|
123
|
+
'counts',
|
|
124
|
+
'truncated',
|
|
125
|
+
],
|
|
126
|
+
};
|
|
27
127
|
/**
|
|
28
128
|
* MCP tool that inspects Reactive Forms in a file.
|
|
29
129
|
*/
|
|
30
130
|
export class InspectFormGroupTool {
|
|
31
131
|
projects;
|
|
32
132
|
name = 'inspect-form-group';
|
|
133
|
+
title = 'Inspect Form Group';
|
|
134
|
+
annotations = {
|
|
135
|
+
readOnlyHint: true,
|
|
136
|
+
destructiveHint: false,
|
|
137
|
+
idempotentHint: true,
|
|
138
|
+
openWorldHint: false,
|
|
139
|
+
};
|
|
33
140
|
constructor(projects = new ProjectCache()) {
|
|
34
141
|
this.projects = projects;
|
|
35
142
|
}
|
|
@@ -45,6 +152,7 @@ export class InspectFormGroupTool {
|
|
|
45
152
|
'drops the control lists, maxResults caps them.';
|
|
46
153
|
inputSchema = {
|
|
47
154
|
type: 'object',
|
|
155
|
+
additionalProperties: false,
|
|
48
156
|
properties: {
|
|
49
157
|
file: {
|
|
50
158
|
type: 'string',
|
|
@@ -76,6 +184,16 @@ export class InspectFormGroupTool {
|
|
|
76
184
|
},
|
|
77
185
|
required: ['file', 'projectRoot'],
|
|
78
186
|
};
|
|
187
|
+
outputSchema = {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
forms: { type: 'array', items: FORM_SCHEMA },
|
|
191
|
+
summary: { type: 'string' },
|
|
192
|
+
tsConfigPath: { type: 'string' },
|
|
193
|
+
...WARNINGS_OUTPUT_SCHEMA,
|
|
194
|
+
},
|
|
195
|
+
required: ['forms', 'summary', 'tsConfigPath'],
|
|
196
|
+
};
|
|
79
197
|
async execute(args) {
|
|
80
198
|
const params = args;
|
|
81
199
|
if (!params.file || typeof params.file !== 'string') {
|
|
@@ -106,11 +224,11 @@ export class InspectFormGroupTool {
|
|
|
106
224
|
includeValueOperations: params.includeValueOperations === true,
|
|
107
225
|
});
|
|
108
226
|
const includeCascade = params.includeCascade !== false;
|
|
109
|
-
return {
|
|
227
|
+
return withWarnings({
|
|
110
228
|
forms: forms.map((f) => this.shape(f, compact.summaryOnly, compact.maxResults, includeCascade)),
|
|
111
229
|
summary: this.buildSummary(filePath, forms),
|
|
112
230
|
tsConfigPath,
|
|
113
|
-
};
|
|
231
|
+
}, this.projects.warnings(tsConfigPath));
|
|
114
232
|
}
|
|
115
233
|
shape(form, summaryOnly, maxResults, includeCascade) {
|
|
116
234
|
const { controls, ...rest } = form;
|