ast-mcp-server 0.15.0 → 0.16.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.
@@ -41,6 +41,7 @@ const TemplateCoverageSchema = z.object({
41
41
  "size_exceeded",
42
42
  "work_exhausted",
43
43
  "inherited_member",
44
+ "cross_component",
44
45
  ])
45
46
  .optional(),
46
47
  templates: z.number().int().min(0).optional(),
@@ -68,7 +69,7 @@ const ReferenceOutputSchemas = {
68
69
  export function registerFindReferences(server) {
69
70
  server.registerTool(TOOL_NAME, {
70
71
  title: "Find semantic symbol references",
71
- description: "Finds type-resolved references and returns bounded project-relative locations, including declaration impact by default. When @angular/compiler resolves, it also reports Angular template usages tagged by origin with a template_coverage verdict; incomplete coverage does not prove absence, and template errors are not diagnosed.",
72
+ description: "Finds type-resolved references and returns bounded project-relative locations, including declaration impact by default. When @angular/compiler resolves, it also reports Angular template usages, including consumer templates, tagged by origin with a template_coverage verdict; completed covers templates inside the Project only, incomplete coverage does not prove absence, and template errors are not diagnosed.",
72
73
  inputSchema: AstFindReferencesInputSchema,
73
74
  annotations: {
74
75
  readOnlyHint: true,
@@ -21,7 +21,7 @@ const AstRenameSymbolInputSchema = z.object({
21
21
  export function registerRenameSymbol(server) {
22
22
  server.registerTool(TOOL_NAME, {
23
23
  title: "Prepare a project-wide structural rename",
24
- description: "Prepares an exact hash-bound rename plan without writing. Review the preview and apply its operation_id with ast_apply_operation. The plan also rewrites external Angular templates hash-bound to the workspace snapshot; diagnostics stay TypeScript-only.",
24
+ description: "Prepares an exact hash-bound rename plan without writing. Review the preview and apply its operation_id with ast_apply_operation. The plan also rewrites external Angular templates, including consumer templates when coverage is completed, hash-bound to the workspace snapshot; diagnostics stay TypeScript-only.",
25
25
  inputSchema: AstRenameSymbolInputSchema,
26
26
  outputSchema: PreparedOperationOutputSchema,
27
27
  annotations: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-mcp-server",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Structural code MCP server and batch CLI for compact TypeScript/JavaScript reads and hash-bound AST edits.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -110,7 +110,7 @@
110
110
  "zod": "^4.6.7"
111
111
  },
112
112
  "peerDependencies": {
113
- "@angular/compiler": ">=20.0.0 <23.0.0"
113
+ "@angular/compiler": ">=18.0.0 <23.0.0"
114
114
  },
115
115
  "peerDependenciesMeta": {
116
116
  "@angular/compiler": {
@@ -120,6 +120,8 @@
120
120
  "devDependencies": {
121
121
  "@eslint/js": "^10.0.1",
122
122
  "@types/node": "^26.6.5",
123
+ "angular-compiler-v18": "npm:@angular/compiler@18.2.14",
124
+ "angular-compiler-v19": "npm:@angular/compiler@19.2.15",
123
125
  "angular-compiler-v20": "npm:@angular/compiler@20.3.34",
124
126
  "angular-compiler-v21": "npm:@angular/compiler@21.2.25",
125
127
  "angular-compiler-v22": "npm:@angular/compiler@22.2.4",
@@ -133,5 +135,5 @@
133
135
  "vitest": "^5.0.5",
134
136
  "yaml": "^2.9.0"
135
137
  },
136
- "gitHead": "5b2d483001d21ef29a760a9c0ae538dc719f11ea"
138
+ "gitHead": "0f5a3f137703fdd673640d00a04087db3b2808af"
137
139
  }
@@ -4,7 +4,7 @@ description: "Trigger: navegar, analizar o editar TypeScript/JavaScript con el c
4
4
  license: "ISC"
5
5
  metadata:
6
6
  author: "yail"
7
- version: "4.6.0"
7
+ version: "4.7.0"
8
8
  hermes:
9
9
  tags: ["typescript", "javascript", "ast", "refactoring", "mcp"]
10
10
  homepage: "https://github.com/yailPeralta/ast-mcp-server"
@@ -45,17 +45,23 @@ For each dimension, `groups.length + omitted_group_count = total_group_count` an
45
45
 
46
46
  ## Angular templates
47
47
 
48
- In an Angular project (`@angular/core` resolvable from the tsconfig directory), `ast_find_references` also reports usages of a component member inside its external `templateUrl` template and inline `template`. Each item carries `origin` (`compiler`, `template_external` or `template_inline`), and the response adds `template_coverage` and `template_reference_count`. `reference_count` stays TypeScript-only; `total` counts both kinds.
48
+ In an Angular project (`@angular/core` resolvable from the tsconfig directory), `ast_find_references` also reports usages of a component member inside its external `templateUrl` template and inline `template`, and binding usages in consumer templates. Each item carries `origin` (`compiler`, `template_external` or `template_inline`), and the response adds `template_coverage` and `template_reference_count`. `reference_count` stays TypeScript-only; `total` counts both kinds.
49
49
 
50
- Read `template_coverage` before inferring absence. Only `completed` proves every template of the declaring component was examined. `unfinished` (for example `compiler_missing`, `compiler_unsupported`, `template_unresolved`, `template_parse_error`, `size_exceeded`) and `unsupported` (for example an inherited member) never prove that no template usage exists. `not_applicable` means the feature is off and the response is unchanged.
50
+ Read `template_coverage` before inferring absence. Only `completed` proves every template it covers was examined. `unfinished` (for example `compiler_missing`, `compiler_unsupported`, `template_unresolved`, `template_parse_error`, `size_exceeded`, `cross_component`, `work_exhausted`) and `unsupported` (for example an inherited member) never prove that no template usage exists. `not_applicable` means the feature is off and the response is unchanged.
51
51
 
52
- `ast_rename_symbol` updates external templates in the same reviewed plan and rewrites them only through `ast_apply_operation`. It fails closed: coverage `unfinished` or `unsupported` returns `INCOMPLETE_EVIDENCE`, and an inline template usage, a new name that collides with a template local, or `$any` returns `MUTATION_BLOCKED`. Pipe names, `#ref`/`let-` targets, child inputs and outputs, host bindings and `styleUrls` are not renamed. Apply is sequential, not globally atomic; rollback restores the owned templates.
52
+ Consumer templates: for a member bound through the selector (`@Input`, `@Output`, `input()`, `output()`, `model()`, a literal alias, or a literal entry of the `inputs` / `outputs` metadata), the binding keys `[x]`, `x="lit"`, `[(x)]`, `(y)` and `(xChange)` are listed with kinds `TemplateInputBinding` for `[x]`, `TemplateAttribute` for `x="lit"`, `TemplateTwoWayBinding` for `[(x)]` and `TemplateOutputBinding` for `(y)` and `(xChange)` in the templates of components whose resolved scope contains the declaring component (literal standalone `imports`, or NgModule `declarations` plus the `exports` of imported modules). For a `@Pipe` class with a literal `name`, and for its `transform` member, `| name` usages in in-scope templates are listed with kind `TemplatePipeName`. A same selector or pipe name outside that scope is ignored.
53
+
54
+ For these members, `completed` means template evidence inside the Project only: every component template of the Project (the tsconfig passed as `project_root`) was read and every match resolved. `hostDirectives`, `@Directive` inputs and outputs, and non-literal scopes, aliases, metadata or pipe names stay `unfinished` with `cross_component`. Runtime bindings (`setInput`, router input binding, `createComponent` and other dynamic component APIs) and consumers outside the Project (other tsconfigs, libraries, other applications) are never examined, so `completed` does not cover them.
55
+
56
+ `ast_rename_symbol` updates the declaring component's external templates and, for a selector-bound member with `completed` coverage, every external consumer template in the same reviewed plan; it rewrites them only through `ast_apply_operation`. Consumer rewrites keep `[`, `(`, `[(`, `bind-`, `on-`, `bindon-` and the values, a `model()` event key becomes `<name>Change`, and alias-keyed bindings stay. It fails closed: coverage `unfinished` or `unsupported`, `hostDirectives`, `@Directive` members, non-literal aliases and members listed in `inputs` / `outputs` metadata return `INCOMPLETE_EVIDENCE`. An inline template usage (own or consumer), `[(x)]` on a non-`model()` pair, a new name that collides with a template local, another input, output or alias of the directive (or its `Change` name) or a binding of another directive on the same element, `$any`, or a name in the directive's selector return `MUTATION_BLOCKED`. `#ref`/`let-` targets, host bindings and `styleUrls` are not renamed. Apply is sequential, not globally atomic; rollback restores the owned and consumer templates.
57
+
58
+ Pipes: renaming a `@Pipe` class applies with TypeScript edits only; the `name` literal and every `| name` usage stay unchanged. Renaming its `transform` member returns `INCOMPLETE_EVIDENCE`.
53
59
 
54
60
  Limits to state when reporting:
55
61
 
56
62
  - `ast_explore` is TypeScript-only: its references omit template usages. This is tracked in issue #380. Use `ast_find_references` for template evidence; rename still blocks independently.
57
- - Diagnostics stay TypeScript-only: `ast_get_diagnostics` and the post-apply delta do not detect template errors. A template-only breakage produces no diagnostic, so run the project's Angular build or tests after a rename.
58
- - Detection uses the user's own `@angular/compiler`, never a bundled one. It is an optional peer (`>=20.0.0 <23.0.0`) that the project already installs with Angular. If it is missing or out of range, coverage is `unfinished` and rename is blocked. Yarn PnP projects without `node_modules` resolve nothing and report `unfinished`.
63
+ - Diagnostics stay TypeScript-only: `ast_get_diagnostics` and the post-apply delta do not detect template errors, including in rewritten consumer templates. A template-only breakage produces no diagnostic, so run the project's Angular build or tests after a rename. Template type checking of rename plans is tracked in issue #421.
64
+ - Detection uses the user's own `@angular/compiler`, never a bundled one. It is an optional peer (`>=18.0.0 <23.0.0`) that the project already installs with Angular. If it is missing or out of range, coverage is `unfinished` and rename is blocked. Yarn PnP projects without `node_modules` resolve nothing and report `unfinished`.
59
65
 
60
66
  ## Contributor contract
61
67
 
@@ -22,9 +22,9 @@ Preferir `file_path` relativo; un suffix ambiguo debe devolver candidatos. `ast_
22
22
 
23
23
  ### Angular templates
24
24
 
25
- `ast_find_references` adds template usages (`origin: "template_external" | "template_inline"`, `template_coverage`, `template_reference_count`) only when `@angular/core` resolves; otherwise the response is unchanged. Treat `template_coverage.status` other than `completed` as not proving absence. `ast_explore` is TypeScript-only for references (tracked in issue #380), and diagnostics stay TypeScript-only, so template errors are never detected.
25
+ `ast_find_references` adds template usages (`origin: "template_external" | "template_inline"`, `template_coverage`, `template_reference_count`) only when `@angular/core` resolves; otherwise the response is unchanged. Treat `template_coverage.status` other than `completed` as not proving absence. Selector-bound members (`@Input`, `@Output`, `input()`, `output()`, `model()`, literal aliases, literal `inputs` / `outputs` metadata) also list their bindings in consumer templates (kinds `TemplateInputBinding` for `[x]`, `TemplateAttribute` for `x="lit"`, `TemplateTwoWayBinding` for `[(x)]` and `TemplateOutputBinding` for `(y)` and `(xChange)`), and `@Pipe` classes and their `transform` list `| name` usages (kind `TemplatePipeName`), for components whose resolved standalone or NgModule scope contains the declaring class. For them, `completed` covers templates inside the Project only. `hostDirectives`, `@Directive` inputs and outputs, and non-literal scopes, aliases or names stay `unfinished` with `cross_component`; runtime bindings (`setInput`, router input binding, `createComponent`) and consumers outside the Project are never examined. `ast_explore` is TypeScript-only for references (tracked in issue #380), and diagnostics stay TypeScript-only, so template errors are never detected; template type checking of rename plans is tracked in issue #421.
26
26
 
27
- `ast_rename_symbol` edits external templates and returns `INCOMPLETE_EVIDENCE` (coverage `unfinished` or `unsupported`) or `MUTATION_BLOCKED` (inline usage, template-local collision, `$any`). The user's `@angular/compiler` is an optional peer, never bundled; Yarn PnP projects without `node_modules` report `unfinished`. See the Angular templates section of `SKILL.md`.
27
+ `ast_rename_symbol` edits external templates, including consumer templates of a selector-bound member with `completed` coverage, and returns `INCOMPLETE_EVIDENCE` (coverage `unfinished` or `unsupported`, `hostDirectives`, `@Directive` members, metadata-listed members, non-literal aliases) or `MUTATION_BLOCKED` (inline usage, template-local or binding-name collision, `[(x)]` on a non-`model()` pair, `$any`, name in the selector). Renaming a `@Pipe` class applies TypeScript edits only and keeps the `name` literal and `| name` usages; renaming `transform` returns `INCOMPLETE_EVIDENCE`. The user's `@angular/compiler` is an optional peer, never bundled; Yarn PnP projects without `node_modules` report `unfinished`. See the Angular templates section of `SKILL.md`.
28
28
 
29
29
  ## Trust, freshness y ausencia
30
30
 
@@ -2,15 +2,15 @@
2
2
  "schema_version": 2,
3
3
  "algorithm": "sha256",
4
4
  "current": {
5
- "version": "4.6.0",
5
+ "version": "4.7.0",
6
6
  "files": [
7
7
  {
8
8
  "path": "SKILL.md",
9
- "sha256": "94ff4ce2a97d33cad56b7c1ed8057d0ff7ca22988aebd7923b21319326307c18"
9
+ "sha256": "2606e5fc607a3063789c7c02c49aaf8b3129824fa5527b8654e50e95ed2a8556"
10
10
  },
11
11
  {
12
12
  "path": "references/operations.md",
13
- "sha256": "ee5dd8138b4f4570ee256c820c69b94d650a3d454119fff80b1dc08a6297b380"
13
+ "sha256": "c744553832f55d0630d5ff64d3b5f201b8e87c323d6b7bfeb84eb1778e775b7d"
14
14
  }
15
15
  ]
16
16
  },
@@ -82,23 +82,115 @@
82
82
  },
83
83
  {
84
84
  "version": "4.5.0",
85
- "sha256": "be757e8bd98733c7ee952d63a2805dcd9877becf651b4fcb6ab63d20f6546f21",
85
+ "files": [
86
+ {
87
+ "path": "SKILL.md",
88
+ "sha256": "be757e8bd98733c7ee952d63a2805dcd9877becf651b4fcb6ab63d20f6546f21"
89
+ },
90
+ {
91
+ "path": "references/operations.md",
92
+ "sha256": "d52f01637e33e65ce523d19a810ce9488ab92228809768ec66a584120c24ad98"
93
+ }
94
+ ],
86
95
  "npm_versions": ["0.11.0"]
87
96
  },
88
97
  {
89
98
  "version": "4.5.0",
90
- "sha256": "2729b30ff6b7344e6680c7ee02ab540bc6db9774ad7111f091cd356f8cc9d4ce",
99
+ "files": [
100
+ {
101
+ "path": "SKILL.md",
102
+ "sha256": "2729b30ff6b7344e6680c7ee02ab540bc6db9774ad7111f091cd356f8cc9d4ce"
103
+ },
104
+ {
105
+ "path": "references/operations.md",
106
+ "sha256": "d52f01637e33e65ce523d19a810ce9488ab92228809768ec66a584120c24ad98"
107
+ }
108
+ ],
91
109
  "npm_versions": ["0.11.1"]
92
110
  },
93
111
  {
94
112
  "version": "4.5.0",
95
- "sha256": "18132b4b747d135e4ccfbca9e2190a9afb41e144cc06c31c5e6bc0f1571e11da",
113
+ "files": [
114
+ {
115
+ "path": "SKILL.md",
116
+ "sha256": "18132b4b747d135e4ccfbca9e2190a9afb41e144cc06c31c5e6bc0f1571e11da"
117
+ },
118
+ {
119
+ "path": "references/operations.md",
120
+ "sha256": "d52f01637e33e65ce523d19a810ce9488ab92228809768ec66a584120c24ad98"
121
+ }
122
+ ],
96
123
  "npm_versions": ["0.11.2"]
97
124
  },
98
125
  {
99
126
  "version": "4.6.0",
100
- "sha256": "d0048ffd9a585d00791540c6fa5e0bec91ff95b1448479678f85702e6b09be8a",
127
+ "files": [
128
+ {
129
+ "path": "SKILL.md",
130
+ "sha256": "d0048ffd9a585d00791540c6fa5e0bec91ff95b1448479678f85702e6b09be8a"
131
+ },
132
+ {
133
+ "path": "references/operations.md",
134
+ "sha256": "d52f01637e33e65ce523d19a810ce9488ab92228809768ec66a584120c24ad98"
135
+ }
136
+ ],
101
137
  "npm_versions": ["0.12.0"]
138
+ },
139
+ {
140
+ "version": "4.6.0",
141
+ "files": [
142
+ {
143
+ "path": "SKILL.md",
144
+ "sha256": "df2ebc3f3903cf5abf4eb6612da527cad97a92f29f1a9a475ea6e8b4cf47abfb"
145
+ },
146
+ {
147
+ "path": "references/operations.md",
148
+ "sha256": "d52f01637e33e65ce523d19a810ce9488ab92228809768ec66a584120c24ad98"
149
+ }
150
+ ],
151
+ "npm_versions": ["0.13.0", "0.13.1"]
152
+ },
153
+ {
154
+ "version": "4.6.0",
155
+ "files": [
156
+ {
157
+ "path": "SKILL.md",
158
+ "sha256": "33d0c6520c1ed54d42a502251a08baed86153bf9b6c275aed4525b2968f1553b"
159
+ },
160
+ {
161
+ "path": "references/operations.md",
162
+ "sha256": "d52f01637e33e65ce523d19a810ce9488ab92228809768ec66a584120c24ad98"
163
+ }
164
+ ],
165
+ "npm_versions": ["0.14.0", "0.14.1", "0.14.2", "0.14.3"]
166
+ },
167
+ {
168
+ "version": "4.6.0",
169
+ "files": [
170
+ {
171
+ "path": "SKILL.md",
172
+ "sha256": "94ff4ce2a97d33cad56b7c1ed8057d0ff7ca22988aebd7923b21319326307c18"
173
+ },
174
+ {
175
+ "path": "references/operations.md",
176
+ "sha256": "ee5dd8138b4f4570ee256c820c69b94d650a3d454119fff80b1dc08a6297b380"
177
+ }
178
+ ],
179
+ "npm_versions": ["0.15.0"]
180
+ },
181
+ {
182
+ "version": "4.6.0",
183
+ "files": [
184
+ {
185
+ "path": "SKILL.md",
186
+ "sha256": "afd054a923d9a4f825066e5c3fd2dfa7ae2269a8464819b032a5fbf19a9b14fd"
187
+ },
188
+ {
189
+ "path": "references/operations.md",
190
+ "sha256": "ee5dd8138b4f4570ee256c820c69b94d650a3d454119fff80b1dc08a6297b380"
191
+ }
192
+ ],
193
+ "npm_versions": ["0.15.1"]
102
194
  }
103
195
  ]
104
196
  }