@angular-modernizer/adapter-mcp 1.0.0 → 1.2.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.
Files changed (131) hide show
  1. package/README.md +81 -65
  2. package/dist/cli.js +8 -0
  3. package/dist/core/project-analyzer.d.ts +3 -12
  4. package/dist/core/project-analyzer.js +3 -12
  5. package/dist/index.d.ts +118 -3
  6. package/dist/index.js +46 -3
  7. package/dist/mcp-watcher.d.ts +28 -8
  8. package/dist/mcp-watcher.js +7 -7
  9. package/dist/scan-host/scan-host.d.ts +119 -0
  10. package/dist/scan-host/scan-host.js +376 -0
  11. package/dist/scan-host/scan-protocol.d.ts +35 -0
  12. package/dist/scan-host/scan-protocol.js +6 -0
  13. package/dist/scan-host/scan-worker.d.ts +14 -0
  14. package/dist/scan-host/scan-worker.js +48 -0
  15. package/dist/server/limited-stdio-transport.d.ts +7 -0
  16. package/dist/server/mcp-server.d.ts +11 -7
  17. package/dist/server/mcp-server.js +4 -7
  18. package/dist/server/sdk-server.d.ts +1 -0
  19. package/dist/server/tool-registry.d.ts +3 -7
  20. package/dist/server/tool-registry.js +1 -7
  21. package/dist/streaming/progress-store.d.ts +22 -5
  22. package/dist/streaming/progress-store.js +9 -5
  23. package/dist/tools/analyze-build-impact.d.ts +58 -36
  24. package/dist/tools/analyze-build-impact.js +36 -29
  25. package/dist/tools/analyze-core-to-shared.d.ts +42 -12
  26. package/dist/tools/analyze-core-to-shared.js +11 -10
  27. package/dist/tools/analyze-parser-performance.d.ts +23 -22
  28. package/dist/tools/analyze-parser-performance.js +20 -18
  29. package/dist/tools/analyze-project.d.ts +87 -14
  30. package/dist/tools/analyze-project.js +140 -122
  31. package/dist/tools/check-incremental-compatibility.d.ts +13 -11
  32. package/dist/tools/check-incremental-compatibility.js +11 -8
  33. package/dist/tools/collect-feedback.d.ts +41 -26
  34. package/dist/tools/collect-feedback.js +32 -23
  35. package/dist/tools/compare-health.d.ts +76 -19
  36. package/dist/tools/compare-health.js +26 -19
  37. package/dist/tools/extract-libraries.d.ts +44 -20
  38. package/dist/tools/extract-libraries.js +16 -17
  39. package/dist/tools/find-angular-symbol.d.ts +27 -25
  40. package/dist/tools/find-angular-symbol.js +19 -16
  41. package/dist/tools/find-component-hosts.d.ts +33 -27
  42. package/dist/tools/find-component-hosts.js +27 -24
  43. package/dist/tools/find-usages.d.ts +25 -23
  44. package/dist/tools/find-usages.js +21 -18
  45. package/dist/tools/get-bootstrap-execution.d.ts +35 -27
  46. package/dist/tools/get-bootstrap-execution.js +28 -25
  47. package/dist/tools/get-call-graph.d.ts +19 -14
  48. package/dist/tools/get-call-graph.js +26 -23
  49. package/dist/tools/get-operation-progress-tool.d.ts +12 -6
  50. package/dist/tools/get-operation-progress-tool.js +11 -6
  51. package/dist/tools/get-operation-progress.d.ts +26 -0
  52. package/dist/tools/helpers/analysis-output.d.ts +5 -0
  53. package/dist/tools/helpers/batch-kernel.d.ts +14 -0
  54. package/dist/tools/helpers/batch-kernel.js +12 -0
  55. package/dist/tools/helpers/compact-output.d.ts +2 -1
  56. package/dist/tools/helpers/compact-output.js +2 -1
  57. package/dist/tools/helpers/health-delta.d.ts +27 -14
  58. package/dist/tools/helpers/health-delta.js +11 -14
  59. package/dist/tools/helpers/project-cache.d.ts +123 -36
  60. package/dist/tools/helpers/project-cache.js +227 -43
  61. package/dist/tools/helpers/rule-runner.d.ts +23 -16
  62. package/dist/tools/helpers/rule-runner.js +24 -17
  63. package/dist/tools/helpers/scan-engine.d.ts +107 -0
  64. package/dist/tools/helpers/scan-engine.js +197 -0
  65. package/dist/tools/helpers/scan-plan.d.ts +1 -1
  66. package/dist/tools/helpers/scan-plan.js +1 -1
  67. package/dist/tools/helpers/suggestion-generator.d.ts +9 -13
  68. package/dist/tools/helpers/suggestion-generator.js +0 -12
  69. package/dist/tools/helpers/tool-cache.d.ts +11 -0
  70. package/dist/tools/helpers/tool-cache.js +15 -0
  71. package/dist/tools/helpers/tool-context.d.ts +11 -8
  72. package/dist/tools/helpers/tool-context.js +5 -8
  73. package/dist/tools/inspect-form-group.d.ts +34 -27
  74. package/dist/tools/inspect-form-group.js +27 -24
  75. package/dist/tools/inspect-i18n.d.ts +31 -25
  76. package/dist/tools/inspect-i18n.js +23 -20
  77. package/dist/tools/inspect-template.d.ts +32 -25
  78. package/dist/tools/inspect-template.js +26 -23
  79. package/dist/tools/learn-patterns.d.ts +88 -12
  80. package/dist/tools/learn-patterns.js +17 -11
  81. package/dist/tools/list-imports.d.ts +45 -28
  82. package/dist/tools/list-imports.js +26 -23
  83. package/dist/tools/orchestrate-migration.d.ts +31 -9
  84. package/dist/tools/orchestrate-migration.js +12 -7
  85. package/dist/tools/parse-stack-trace.d.ts +23 -21
  86. package/dist/tools/parse-stack-trace.js +10 -7
  87. package/dist/tools/plan-migration.d.ts +67 -27
  88. package/dist/tools/plan-migration.js +22 -21
  89. package/dist/tools/resolve-type.d.ts +20 -10
  90. package/dist/tools/resolve-type.js +21 -13
  91. package/dist/tools/review-feedback.d.ts +27 -24
  92. package/dist/tools/review-feedback.js +24 -20
  93. package/dist/tools/rollback-changes.d.ts +13 -9
  94. package/dist/tools/rollback-changes.js +10 -7
  95. package/dist/tools/run-angular-cli.d.ts +12 -10
  96. package/dist/tools/run-angular-cli.js +11 -8
  97. package/dist/tools/run-build.d.ts +13 -11
  98. package/dist/tools/run-build.js +11 -8
  99. package/dist/tools/run-schematic.d.ts +12 -10
  100. package/dist/tools/run-schematic.js +11 -8
  101. package/dist/tools/scan-all.d.ts +69 -12
  102. package/dist/tools/scan-all.js +55 -122
  103. package/dist/tools/scan-angular.d.ts +41 -9
  104. package/dist/tools/scan-angular.js +66 -135
  105. package/dist/tools/scan-architecture.d.ts +75 -14
  106. package/dist/tools/scan-architecture.js +180 -185
  107. package/dist/tools/scan-solid.d.ts +40 -9
  108. package/dist/tools/scan-solid.js +64 -133
  109. package/dist/tools/search-codebase.d.ts +32 -26
  110. package/dist/tools/search-codebase.js +15 -12
  111. package/dist/tools/server-status.d.ts +116 -24
  112. package/dist/tools/server-status.js +85 -26
  113. package/dist/tools/suggest-improvements.d.ts +22 -19
  114. package/dist/tools/suggest-improvements.js +21 -17
  115. package/dist/tools/trace-output-flow.d.ts +34 -27
  116. package/dist/tools/trace-output-flow.js +27 -24
  117. package/dist/tools/transform-code.d.ts +71 -10
  118. package/dist/tools/transform-code.js +148 -54
  119. package/dist/tools/validate-before-transform.d.ts +24 -9
  120. package/dist/tools/validate-before-transform.js +10 -7
  121. package/dist/tools/validate-project-compatibility.d.ts +18 -13
  122. package/dist/tools/validate-project-compatibility.js +17 -11
  123. package/dist/tools/validate-transformation.d.ts +28 -11
  124. package/dist/tools/validate-transformation.js +14 -8
  125. package/dist/tools/verify-citations.d.ts +37 -16
  126. package/dist/tools/verify-citations.js +19 -16
  127. package/dist/types.d.ts +40 -10
  128. package/dist/types.js +0 -5
  129. package/package.json +12 -18
  130. package/dist/tools/shared/scan-types.d.ts +0 -200
  131. package/dist/tools/shared/scan-types.js +0 -7
@@ -1,16 +1,9 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Validate Project Compatibility Tool
3
- *
4
- * MCP tool for validating project compatibility with the parser before running transformations.
5
- * Detects incompatibility patterns such as external decorators, path aliases, and complex constructor
6
- * patterns that may cause parsing issues. Provides actionable recommendations for parser selection.
7
- */
8
1
  import { type MCPTool, type ToolAnnotations } from '../types.js';
9
2
  import { type CompatibilityCheck, type ProjectType, type OverallCompatibility, type RecommendedParser } from '@angular-modernizer/core';
10
3
  /**
11
4
  * Output result of project compatibility validation.
12
5
  */
13
- interface ValidateProjectCompatibilityOutput {
6
+ export interface ValidateProjectCompatibilityOutput {
14
7
  /**
15
8
  * Project type classification.
16
9
  */
@@ -49,23 +42,32 @@ interface ValidateProjectCompatibilityOutput {
49
42
  summary: string;
50
43
  }
51
44
  /**
52
- * MCP tool for validating project compatibility with the parser.
45
+ * MCP tool for validating project compatibility with the parser before
46
+ * running transformations. Detects incompatibility patterns such as external
47
+ * decorators, path aliases and complex constructor patterns that may cause
48
+ * parsing issues, and recommends a parser strategy.
53
49
  *
54
- * Performs Phase 0 validation to detect incompatibility patterns before running transformations:
50
+ * @remarks
51
+ * Checks:
55
52
  * - Detects custom decorators (any decorator outside the known frameworks)
56
53
  * - Detects path aliases (@shared/, @domain/, @features/, @core/, @lib/)
57
54
  * - Detects complex constructor patterns (importService variables, public params)
58
55
  * - Runs sample transformation test to verify actual compatibility
59
56
  * - Classifies project type and recommends parser strategy
60
57
  *
61
- * Prevents wasted effort on 35-transformation tests that will fail due to parser incompatibilities.
62
- * Completes validation in <5 seconds for typical projects.
58
+ * Avoids running transformations that would fail due to parser
59
+ * incompatibilities. Completes validation in under 5 seconds for typical
60
+ * projects.
63
61
  */
64
62
  export declare class ValidateProjectCompatibilityTool implements MCPTool {
65
63
  name: string;
66
64
  title: string;
67
65
  annotations: ToolAnnotations;
68
66
  description: string;
67
+ /**
68
+ * JSON Schema of the tool arguments.
69
+ * @hidden
70
+ */
69
71
  inputSchema: {
70
72
  type: string;
71
73
  additionalProperties: boolean;
@@ -96,6 +98,10 @@ export declare class ValidateProjectCompatibilityTool implements MCPTool {
96
98
  };
97
99
  required: string[];
98
100
  };
101
+ /**
102
+ * JSON Schema of the tool result (`structuredContent`).
103
+ * @hidden
104
+ */
99
105
  outputSchema: {
100
106
  type: string;
101
107
  properties: {
@@ -177,5 +183,4 @@ export declare class ValidateProjectCompatibilityTool implements MCPTool {
177
183
  */
178
184
  private getOverallRecommendation;
179
185
  }
180
- export {};
181
186
  //# sourceMappingURL=validate-project-compatibility.d.ts.map
@@ -1,10 +1,3 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Validate Project Compatibility Tool
3
- *
4
- * MCP tool for validating project compatibility with the parser before running transformations.
5
- * Detects incompatibility patterns such as external decorators, path aliases, and complex constructor
6
- * patterns that may cause parsing issues. Provides actionable recommendations for parser selection.
7
- */
8
1
  import { ProjectCompatibilityValidator, } from '@angular-modernizer/core';
9
2
  import { existsSync } from 'node:fs';
10
3
  /** Text summary: verdict, parser, success rate, sample size and one line per failed check. */
@@ -23,17 +16,22 @@ function describeProjectCompatibility(output) {
23
16
  return lines.join('\n');
24
17
  }
25
18
  /**
26
- * MCP tool for validating project compatibility with the parser.
19
+ * MCP tool for validating project compatibility with the parser before
20
+ * running transformations. Detects incompatibility patterns such as external
21
+ * decorators, path aliases and complex constructor patterns that may cause
22
+ * parsing issues, and recommends a parser strategy.
27
23
  *
28
- * Performs Phase 0 validation to detect incompatibility patterns before running transformations:
24
+ * @remarks
25
+ * Checks:
29
26
  * - Detects custom decorators (any decorator outside the known frameworks)
30
27
  * - Detects path aliases (@shared/, @domain/, @features/, @core/, @lib/)
31
28
  * - Detects complex constructor patterns (importService variables, public params)
32
29
  * - Runs sample transformation test to verify actual compatibility
33
30
  * - Classifies project type and recommends parser strategy
34
31
  *
35
- * Prevents wasted effort on 35-transformation tests that will fail due to parser incompatibilities.
36
- * Completes validation in <5 seconds for typical projects.
32
+ * Avoids running transformations that would fail due to parser
33
+ * incompatibilities. Completes validation in under 5 seconds for typical
34
+ * projects.
37
35
  */
38
36
  export class ValidateProjectCompatibilityTool {
39
37
  name = 'validate-project-compatibility';
@@ -46,6 +44,10 @@ export class ValidateProjectCompatibilityTool {
46
44
  };
47
45
  description = 'Validate project compatibility with the parser before running transformations. Detects incompatibility patterns such as external decorators, path aliases, and complex constructor patterns. Returns project type, compatibility status, recommended parser, estimated success rate, and actionable recommendations. Prevents wasted effort on transformation tests that will fail. Completes in <5 seconds. ' +
48
46
  'summary is a short text with the verdict, the parser and the failed checks.';
47
+ /**
48
+ * JSON Schema of the tool arguments.
49
+ * @hidden
50
+ */
49
51
  inputSchema = {
50
52
  type: 'object',
51
53
  additionalProperties: false,
@@ -76,6 +78,10 @@ export class ValidateProjectCompatibilityTool {
76
78
  },
77
79
  required: ['projectPath'],
78
80
  };
81
+ /**
82
+ * JSON Schema of the tool result (`structuredContent`).
83
+ * @hidden
84
+ */
79
85
  outputSchema = {
80
86
  type: 'object',
81
87
  properties: {
@@ -1,16 +1,9 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Validate Transformation Tool
3
- *
4
- * MCP tool for validating code after transformation to ensure changes
5
- * didn't break anything. Supports both legacy validation (PostTransformValidator)
6
- * and modern incremental build validation (IncrementalBuildValidator) for 2-4x speedup.
7
- */
8
1
  import { type MCPTool, type ToolAnnotations, type ToolContext } from '../types.js';
9
2
  import { type IncompatibilityCheck } from '@angular-modernizer/core';
10
3
  /**
11
4
  * Incremental build metadata
12
5
  */
13
- interface IncrementalMetadata {
6
+ export interface IncrementalMetadata {
14
7
  /**
15
8
  * Whether incremental mode was enabled
16
9
  */
@@ -47,7 +40,7 @@ interface IncrementalMetadata {
47
40
  /**
48
41
  * Validation result.
49
42
  */
50
- interface ValidationResult {
43
+ export interface ValidationResult {
51
44
  /**
52
45
  * Whether validation passed (no errors).
53
46
  */
@@ -56,12 +49,19 @@ interface ValidationResult {
56
49
  * Validation issues found.
57
50
  */
58
51
  issues: {
52
+ /** Check that reported the issue. */
59
53
  type: 'syntax' | 'build' | 'test' | 'lint';
54
+ /** Severity; only errors make the file not valid. */
60
55
  severity: 'error' | 'warning' | 'info';
56
+ /** Issue description. */
61
57
  message: string;
58
+ /** File the issue was found in. */
62
59
  filePath?: string;
60
+ /** Line of the issue (1-based). */
63
61
  line?: number;
62
+ /** Column of the issue. */
64
63
  column?: number;
64
+ /** Additional details of the issue. */
65
65
  details?: string;
66
66
  }[];
67
67
  /**
@@ -72,10 +72,15 @@ interface ValidationResult {
72
72
  * Metadata about validation.
73
73
  */
74
74
  metadata: {
75
+ /** Validated file. */
75
76
  filePath: string;
77
+ /** Whether build validation was requested. */
76
78
  buildValidation: boolean;
79
+ /** Whether test validation was requested. */
77
80
  testValidation: boolean;
81
+ /** Whether lint validation was requested. */
78
82
  lintValidation: boolean;
83
+ /** Project root the validation ran in. */
79
84
  cwd?: string;
80
85
  /** Build command that ran (legacy validation). */
81
86
  buildCommand?: string;
@@ -92,13 +97,22 @@ interface ValidationResult {
92
97
  summary: string;
93
98
  }
94
99
  /**
95
- * MCP tool for post-transformation validation with incremental build support.
100
+ * MCP tool for validating code after a transformation to make sure the
101
+ * changes did not break anything, with incremental build support.
102
+ *
103
+ * @remarks
104
+ * Supports legacy validation (`PostTransformValidator`) and incremental build
105
+ * validation (`IncrementalBuildValidator`), which is 2-4x faster.
96
106
  */
97
107
  export declare class ValidateTransformationTool implements MCPTool {
98
108
  name: string;
99
109
  title: string;
100
110
  annotations: ToolAnnotations;
101
111
  description: string;
112
+ /**
113
+ * JSON Schema of the tool arguments.
114
+ * @hidden
115
+ */
102
116
  inputSchema: {
103
117
  type: string;
104
118
  additionalProperties: boolean;
@@ -172,6 +186,10 @@ export declare class ValidateTransformationTool implements MCPTool {
172
186
  };
173
187
  required: string[];
174
188
  };
189
+ /**
190
+ * JSON Schema of the tool result (`structuredContent`).
191
+ * @hidden
192
+ */
175
193
  outputSchema: {
176
194
  type: string;
177
195
  properties: {
@@ -319,5 +337,4 @@ export declare class ValidateTransformationTool implements MCPTool {
319
337
  */
320
338
  private detectTransformedFiles;
321
339
  }
322
- export {};
323
340
  //# sourceMappingURL=validate-transformation.d.ts.map
@@ -1,10 +1,3 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Validate Transformation Tool
3
- *
4
- * MCP tool for validating code after transformation to ensure changes
5
- * didn't break anything. Supports both legacy validation (PostTransformValidator)
6
- * and modern incremental build validation (IncrementalBuildValidator) for 2-4x speedup.
7
- */
8
1
  import { PostTransformValidator, loadConfig, } from '@angular-modernizer/core';
9
2
  import { Project } from 'ts-morph';
10
3
  import { existsSync } from 'node:fs';
@@ -38,7 +31,12 @@ function describeTransformationValidation(result) {
38
31
  return lines.join('\n');
39
32
  }
40
33
  /**
41
- * MCP tool for post-transformation validation with incremental build support.
34
+ * MCP tool for validating code after a transformation to make sure the
35
+ * changes did not break anything, with incremental build support.
36
+ *
37
+ * @remarks
38
+ * Supports legacy validation (`PostTransformValidator`) and incremental build
39
+ * validation (`IncrementalBuildValidator`), which is 2-4x faster.
42
40
  */
43
41
  export class ValidateTransformationTool {
44
42
  name = 'validate-transformation';
@@ -51,6 +49,10 @@ export class ValidateTransformationTool {
51
49
  };
52
50
  description = 'Validate code after transformation to ensure changes did not break anything. Supports incremental build mode for 2-4x faster validation by checking only transformed files and their dependencies. Automatically detects project compatibility and falls back to full validation when needed. ' +
53
51
  'summary is a short text with the verdict, the validation mode, the issue counts and the first issues.';
52
+ /**
53
+ * JSON Schema of the tool arguments.
54
+ * @hidden
55
+ */
54
56
  inputSchema = {
55
57
  type: 'object',
56
58
  additionalProperties: false,
@@ -122,6 +124,10 @@ export class ValidateTransformationTool {
122
124
  },
123
125
  required: ['filePath'],
124
126
  };
127
+ /**
128
+ * JSON Schema of the tool result (`structuredContent`).
129
+ * @hidden
130
+ */
125
131
  outputSchema = {
126
132
  type: 'object',
127
133
  properties: {
@@ -1,58 +1,75 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Verify Citations Tool
3
- *
4
- * MCP tool that checks the `path:line` citations of Markdown plans against the
5
- * current code: does the cited file exist, is the line range still in the
6
- * file, and does the symbol named next to the citation still sit in the range?
7
- *
8
- * @remarks
9
- * Run it before executing a bug-fix or feature plan (stale line numbers make
10
- * edits land in the wrong place) and after writing one. Logic lives in the api
11
- * `CitationVerifier`; the claude-plugin script `verify-citations.mjs` is the
12
- * same check for sessions without this server.
13
- *
14
- * First tool on the structured output contract: `outputSchema`, `title` and
15
- * `annotations`, answered with `structuredContent`.
16
- */
17
1
  import { type CitationFileSource, type CitationStatus } from '@angular-modernizer/api';
18
2
  import { type MCPTool, type ToolAnnotations } from '../types.js';
19
3
  /** One checked citation in the tool output. */
20
4
  export interface VerifiedCitation {
21
5
  /** Plan file relative to `projectRoot`. */
22
6
  plan: string;
7
+ /** Line of the citation in the plan. */
23
8
  planLine: number;
24
9
  /** Citation as written, e.g. `x.ts:12-20`. */
25
10
  text: string;
11
+ /** Result of the check. */
26
12
  status: CitationStatus;
13
+ /** Resolved file relative to the root, when exactly one file matched. */
27
14
  file?: string;
15
+ /** Anchor that decided the status (`prefix` anchors end in `*`). */
28
16
  matched?: string;
17
+ /** For `moved`: lines where the anchor is now, nearest first, at most 5. */
29
18
  foundAt?: number[];
19
+ /** Current text of the first cited line, whitespace collapsed, at most 100 characters. */
30
20
  current?: string;
21
+ /** For `out-of-range`: number of lines of the file. */
31
22
  fileLength?: number;
23
+ /** For `missing-file`: files with the same name or stem; for `ambiguous`: the matches. */
32
24
  candidates?: string[];
33
25
  }
34
26
  /** Output of the verify-citations tool. */
35
27
  export interface VerifyCitationsOutput {
28
+ /** Absolute repository root the citations resolve from. */
36
29
  projectRoot: string;
30
+ /** Citation counts per plan. */
37
31
  plans: {
32
+ /** Plan file relative to `projectRoot`. */
38
33
  plan: string;
34
+ /** Number of citations in the plan. */
39
35
  citations: number;
36
+ /** Citations of the plan that need attention. */
40
37
  needsAttention: number;
41
38
  }[];
39
+ /** Number of citations in all plans. */
42
40
  total: number;
41
+ /** Citations with status moved, anchor-missing, out-of-range, missing-file or ambiguous. */
43
42
  needsAttention: number;
43
+ /** Number of citations per status. */
44
44
  counts: Record<CitationStatus, number>;
45
45
  /** Citations that need attention first, then the others, each in plan order. */
46
46
  citations?: VerifiedCitation[];
47
+ /** `true` when `maxResults` cut the citation list. */
47
48
  truncated: boolean;
49
+ /** Short text with the counts and the citations that need attention. */
48
50
  summary: string;
49
51
  }
52
+ /**
53
+ * MCP tool that checks the `path:line` citations of Markdown plans against the
54
+ * current code: does the cited file exist, is the line range still in the
55
+ * file, and does the symbol named next to the citation still sit in the range?
56
+ *
57
+ * @remarks
58
+ * Run it before executing a bug-fix or feature plan (stale line numbers make
59
+ * edits land in the wrong place) and after writing one. Logic lives in the api
60
+ * `CitationVerifier`; the claude-plugin script `verify-citations.mjs` is the
61
+ * same check for sessions without this server.
62
+ */
50
63
  export declare class VerifyCitationsTool implements MCPTool {
51
64
  private readonly createSource;
52
65
  readonly name = "verify-citations";
53
66
  readonly title = "Verify Plan Citations";
54
67
  readonly description: string;
55
68
  readonly annotations: ToolAnnotations;
69
+ /**
70
+ * JSON Schema of the tool arguments.
71
+ * @hidden
72
+ */
56
73
  readonly inputSchema: {
57
74
  type: string;
58
75
  additionalProperties: boolean;
@@ -81,6 +98,10 @@ export declare class VerifyCitationsTool implements MCPTool {
81
98
  };
82
99
  required: string[];
83
100
  };
101
+ /**
102
+ * JSON Schema of the tool result (`structuredContent`).
103
+ * @hidden
104
+ */
84
105
  readonly outputSchema: {
85
106
  type: string;
86
107
  properties: {
@@ -1,19 +1,3 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - Verify Citations Tool
3
- *
4
- * MCP tool that checks the `path:line` citations of Markdown plans against the
5
- * current code: does the cited file exist, is the line range still in the
6
- * file, and does the symbol named next to the citation still sit in the range?
7
- *
8
- * @remarks
9
- * Run it before executing a bug-fix or feature plan (stale line numbers make
10
- * edits land in the wrong place) and after writing one. Logic lives in the api
11
- * `CitationVerifier`; the claude-plugin script `verify-citations.mjs` is the
12
- * same check for sessions without this server.
13
- *
14
- * First tool on the structured output contract: `outputSchema`, `title` and
15
- * `annotations`, answered with `structuredContent`.
16
- */
17
1
  import { isAbsolute, relative, resolve } from 'node:path';
18
2
  import { CITATION_ATTENTION_STATUSES, CitationVerifier, } from '@angular-modernizer/api';
19
3
  import { createNodeCitationFileSource } from './helpers/citation-file-source.js';
@@ -45,6 +29,17 @@ const CITATION_SCHEMA = {
45
29
  },
46
30
  required: ['plan', 'planLine', 'text', 'status'],
47
31
  };
32
+ /**
33
+ * MCP tool that checks the `path:line` citations of Markdown plans against the
34
+ * current code: does the cited file exist, is the line range still in the
35
+ * file, and does the symbol named next to the citation still sit in the range?
36
+ *
37
+ * @remarks
38
+ * Run it before executing a bug-fix or feature plan (stale line numbers make
39
+ * edits land in the wrong place) and after writing one. Logic lives in the api
40
+ * `CitationVerifier`; the claude-plugin script `verify-citations.mjs` is the
41
+ * same check for sessions without this server.
42
+ */
48
43
  export class VerifyCitationsTool {
49
44
  createSource;
50
45
  name = 'verify-citations';
@@ -63,6 +58,10 @@ export class VerifyCitationsTool {
63
58
  idempotentHint: true,
64
59
  openWorldHint: false,
65
60
  };
61
+ /**
62
+ * JSON Schema of the tool arguments.
63
+ * @hidden
64
+ */
66
65
  inputSchema = {
67
66
  type: 'object',
68
67
  additionalProperties: false,
@@ -81,6 +80,10 @@ export class VerifyCitationsTool {
81
80
  },
82
81
  required: ['planPaths', 'projectRoot'],
83
82
  };
83
+ /**
84
+ * JSON Schema of the tool result (`structuredContent`).
85
+ * @hidden
86
+ */
84
87
  outputSchema = {
85
88
  type: 'object',
86
89
  properties: {
package/dist/types.d.ts CHANGED
@@ -1,11 +1,7 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - MCP Types
3
- *
4
- * TypeScript type definitions for MCP protocol and tools.
5
- */
6
1
  import type { ParallelOptions } from '@angular-modernizer/core';
7
2
  /**
8
- * MCP Tool interface as defined by the Model Context Protocol.
3
+ * MCP Tool interface as defined by the Model Context Protocol. Every tool
4
+ * class of this package implements it.
9
5
  */
10
6
  export interface MCPTool {
11
7
  /**
@@ -50,7 +46,9 @@ export type ProgressFn = (progress: number, total?: number, message?: string) =>
50
46
  * set only when the client asked for progress with a `progressToken`.
51
47
  */
52
48
  export interface ToolContext {
49
+ /** Aborted when the client cancels the request. */
53
50
  signal?: AbortSignal;
51
+ /** Sends progress notifications; set only with a `progressToken`. */
54
52
  progress?: ProgressFn;
55
53
  }
56
54
  /**
@@ -59,43 +57,69 @@ export interface ToolContext {
59
57
  * `destructiveHint` and `idempotentHint` only matter when it is not read-only.
60
58
  */
61
59
  export interface ToolAnnotations {
60
+ /** The tool does not change its environment. */
62
61
  readOnlyHint?: boolean;
62
+ /** The tool can overwrite or delete project files. */
63
63
  destructiveHint?: boolean;
64
+ /** Repeating a call with the same arguments has no further effect. */
64
65
  idempotentHint?: boolean;
66
+ /** The tool reaches outside the project (arbitrary commands or packages). */
65
67
  openWorldHint?: boolean;
66
68
  }
67
69
  /**
68
70
  * JSON-RPC 2.0 request message.
71
+ *
72
+ * @deprecated Not used since the server runs on the MCP TypeScript SDK; will be removed in 2.0.
69
73
  */
70
74
  export interface JsonRpcRequest {
75
+ /** Protocol version, always `'2.0'`. */
71
76
  jsonrpc: '2.0';
77
+ /** Request id, echoed in the response. */
72
78
  id: number | string;
79
+ /** Method name. */
73
80
  method: string;
81
+ /** Method parameters. */
74
82
  params?: Record<string, unknown>;
75
83
  }
76
84
  /**
77
85
  * JSON-RPC 2.0 response message.
86
+ *
87
+ * @deprecated Not used since the server runs on the MCP TypeScript SDK; will be removed in 2.0.
78
88
  */
79
89
  export interface JsonRpcResponse {
90
+ /** Protocol version, always `'2.0'`. */
80
91
  jsonrpc: '2.0';
92
+ /** Id of the request; `null` when it could not be read. */
81
93
  id: number | string | null;
94
+ /** Result on success. */
82
95
  result?: unknown;
96
+ /** Error on failure. */
83
97
  error?: JsonRpcError;
84
98
  }
85
99
  /**
86
100
  * JSON-RPC 2.0 error object.
101
+ *
102
+ * @deprecated Not used since the server runs on the MCP TypeScript SDK; will be removed in 2.0.
87
103
  */
88
104
  export interface JsonRpcError {
105
+ /** JSON-RPC error code, e.g. `-32602` for invalid params. */
89
106
  code: number;
107
+ /** Error message. */
90
108
  message: string;
109
+ /** Additional error details. */
91
110
  data?: unknown;
92
111
  }
93
112
  /**
94
113
  * JSON-RPC 2.0 notification message (no response expected).
114
+ *
115
+ * @deprecated Not used since the server runs on the MCP TypeScript SDK; will be removed in 2.0.
95
116
  */
96
117
  export interface JsonRpcNotification {
118
+ /** Protocol version, always `'2.0'`. */
97
119
  jsonrpc: '2.0';
120
+ /** Method name. */
98
121
  method: string;
122
+ /** Method parameters. */
99
123
  params?: Record<string, unknown>;
100
124
  }
101
125
  /**
@@ -103,15 +127,18 @@ export interface JsonRpcNotification {
103
127
  */
104
128
  export interface MCPServerConfig {
105
129
  /**
106
- * Port for HTTP transport (optional, defaults to stdio).
130
+ * Port for HTTP transport. Never read: the server speaks stdio only.
131
+ * @deprecated Will be removed in 2.0.
107
132
  */
108
133
  port?: number;
109
134
  /**
110
- * Tool execution timeout in milliseconds.
135
+ * Tool execution timeout in milliseconds. Not enforced by the server.
136
+ * @deprecated Will be removed in 2.0.
111
137
  */
112
138
  timeout?: number;
113
139
  /**
114
- * Maximum number of concurrent tool executions.
140
+ * Maximum number of concurrent tool executions. Not enforced by the server.
141
+ * @deprecated Will be removed in 2.0.
115
142
  */
116
143
  maxConcurrentTools?: number;
117
144
  /**
@@ -119,7 +146,8 @@ export interface MCPServerConfig {
119
146
  */
120
147
  logLevel?: 'debug' | 'info' | 'warn' | 'error';
121
148
  /**
122
- * Enable performance metrics collection.
149
+ * Enable performance metrics collection. Not read by the server.
150
+ * @deprecated Will be removed in 2.0.
123
151
  */
124
152
  enableMetrics?: boolean;
125
153
  /**
@@ -132,6 +160,8 @@ export interface MCPServerConfig {
132
160
  }
133
161
  /**
134
162
  * Tool execution context for tracking and metrics.
163
+ *
164
+ * @deprecated Not used since the server runs on the MCP TypeScript SDK; will be removed in 2.0.
135
165
  */
136
166
  export interface ToolExecutionContext {
137
167
  /**
package/dist/types.js CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @angular-modernizer/adapter-mcp - MCP Types
3
- *
4
- * TypeScript type definitions for MCP protocol and tools.
5
- */
6
1
  /**
7
2
  * Helper to convert MCP OrchestrationOptions to Core ParallelOptions.
8
3
  * Note: parallel/incremental/baseBranch are control flow params, not ParallelOptions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-modernizer/adapter-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "MCP Server to expose Angular Modernizer tools to an AI assistant.",
5
5
  "keywords": [
6
6
  "angular",
@@ -15,13 +15,7 @@
15
15
  ],
16
16
  "license": "MIT",
17
17
  "author": "Christian Weiss",
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/eiweiss/tsanalyzer.git",
21
- "directory": "packages/adapter-mcp"
22
- },
23
- "homepage": "https://github.com/eiweiss/tsanalyzer#readme",
24
- "bugs": "https://github.com/eiweiss/tsanalyzer/issues",
18
+ "homepage": "https://eiweiss.github.io/angular-modernizer-docs/",
25
19
  "type": "module",
26
20
  "bin": {
27
21
  "angular-modernizer-mcp": "dist/cli.js"
@@ -37,16 +31,16 @@
37
31
  "glob": "^11.0.3",
38
32
  "ts-morph": "^27.0.2",
39
33
  "zod": "^4.6.5",
40
- "@angular-modernizer/core": "1.0.0",
41
- "@angular-modernizer/api": "1.0.0",
42
- "@angular-modernizer/plugin-analyzer": "1.0.0",
43
- "@angular-modernizer/orchestration": "1.0.0",
44
- "@angular-modernizer/plugin-angular": "1.0.0",
45
- "@angular-modernizer/plugin-solid": "1.0.0",
46
- "@angular-modernizer/plugin-architecture": "1.0.0",
47
- "@angular-modernizer/plugin-standalone": "1.0.0",
48
- "@angular-modernizer/plugin-system": "1.0.0",
49
- "@angular-modernizer/worker": "1.0.0"
34
+ "@angular-modernizer/api": "1.2.0",
35
+ "@angular-modernizer/core": "1.2.0",
36
+ "@angular-modernizer/plugin-angular": "1.2.0",
37
+ "@angular-modernizer/orchestration": "1.2.0",
38
+ "@angular-modernizer/plugin-analyzer": "1.2.0",
39
+ "@angular-modernizer/plugin-architecture": "1.2.0",
40
+ "@angular-modernizer/plugin-standalone": "1.2.0",
41
+ "@angular-modernizer/plugin-system": "1.2.0",
42
+ "@angular-modernizer/plugin-solid": "1.2.0",
43
+ "@angular-modernizer/worker": "1.2.0"
50
44
  },
51
45
  "devDependencies": {
52
46
  "@types/express": "^4.17.13",