@angular/cli 21.1.0-next.0 → 21.1.0-next.1

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 (55) hide show
  1. package/lib/code-examples.db +0 -0
  2. package/package.json +16 -16
  3. package/src/commands/mcp/host.d.ts +27 -0
  4. package/src/commands/mcp/host.js +8 -0
  5. package/src/commands/mcp/host.js.map +1 -1
  6. package/src/commands/mcp/mcp-server.d.ts +20 -9
  7. package/src/commands/mcp/mcp-server.js +4 -2
  8. package/src/commands/mcp/mcp-server.js.map +1 -1
  9. package/src/commands/mcp/resources/ai-tutor.md +199 -3
  10. package/src/commands/mcp/tools/ai-tutor.d.ts +5 -1
  11. package/src/commands/mcp/tools/best-practices.d.ts +3 -1
  12. package/src/commands/mcp/tools/build.d.ts +8 -19
  13. package/src/commands/mcp/tools/devserver/start-devserver.d.ts +2 -12
  14. package/src/commands/mcp/tools/devserver/stop-devserver.d.ts +3 -13
  15. package/src/commands/mcp/tools/devserver/wait-for-devserver-build.d.ts +10 -16
  16. package/src/commands/mcp/tools/doc-search.d.ts +1 -11
  17. package/src/commands/mcp/tools/examples/database-discovery.d.ts +34 -0
  18. package/src/commands/mcp/tools/examples/database-discovery.js +87 -0
  19. package/src/commands/mcp/tools/examples/database-discovery.js.map +1 -0
  20. package/src/commands/mcp/tools/examples/database.d.ts +35 -0
  21. package/src/commands/mcp/tools/examples/database.js +125 -0
  22. package/src/commands/mcp/tools/examples/database.js.map +1 -0
  23. package/src/commands/mcp/tools/examples/index.d.ts +26 -0
  24. package/src/commands/mcp/tools/examples/index.js +149 -0
  25. package/src/commands/mcp/tools/examples/index.js.map +1 -0
  26. package/src/commands/mcp/tools/examples/query-escaper.d.ts +20 -0
  27. package/src/commands/mcp/tools/examples/query-escaper.js +68 -0
  28. package/src/commands/mcp/tools/examples/query-escaper.js.map +1 -0
  29. package/src/commands/mcp/tools/examples/runtime-database.d.ts +10 -0
  30. package/src/commands/mcp/tools/examples/runtime-database.js +192 -0
  31. package/src/commands/mcp/tools/examples/runtime-database.js.map +1 -0
  32. package/src/commands/mcp/tools/examples/schemas.d.ts +29 -0
  33. package/src/commands/mcp/tools/examples/schemas.js +101 -0
  34. package/src/commands/mcp/tools/examples/schemas.js.map +1 -0
  35. package/src/commands/mcp/tools/examples/utils.d.ts +14 -0
  36. package/src/commands/mcp/tools/examples/utils.js +31 -0
  37. package/src/commands/mcp/tools/examples/utils.js.map +1 -0
  38. package/src/commands/mcp/tools/modernize.d.ts +8 -18
  39. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +3 -1
  40. package/src/commands/mcp/tools/projects.d.ts +23 -64
  41. package/src/commands/mcp/tools/tool-registry.d.ts +4 -3
  42. package/src/commands/mcp/tools/tool-registry.js.map +1 -1
  43. package/src/package-managers/host.d.ts +6 -0
  44. package/src/package-managers/host.js +1 -0
  45. package/src/package-managers/host.js.map +1 -1
  46. package/src/package-managers/package-manager-descriptor.d.ts +6 -6
  47. package/src/package-managers/package-manager-descriptor.js +5 -5
  48. package/src/package-managers/package-manager-descriptor.js.map +1 -1
  49. package/src/package-managers/package-manager.d.ts +21 -3
  50. package/src/package-managers/package-manager.js +74 -5
  51. package/src/package-managers/package-manager.js.map +1 -1
  52. package/src/utilities/version.js +1 -1
  53. package/src/commands/mcp/tools/examples.d.ts +0 -58
  54. package/src/commands/mcp/tools/examples.js +0 -654
  55. package/src/commands/mcp/tools/examples.js.map +0 -1
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.setupRuntimeExamples = setupRuntimeExamples;
44
+ const node_path_1 = require("node:path");
45
+ const zod_1 = require("zod");
46
+ /**
47
+ * A simple YAML front matter parser.
48
+ *
49
+ * This function extracts the YAML block enclosed by `---` at the beginning of a string
50
+ * and parses it into a JavaScript object. It is not a full YAML parser and only
51
+ * supports simple key-value pairs and string arrays.
52
+ *
53
+ * @param content The string content to parse.
54
+ * @returns A record containing the parsed front matter data.
55
+ */
56
+ function parseFrontmatter(content) {
57
+ const match = content.match(/^---\r?\n(.*?)\r?\n---/s);
58
+ if (!match) {
59
+ return {};
60
+ }
61
+ const frontmatter = match[1];
62
+ const data = {};
63
+ const lines = frontmatter.split(/\r?\n/);
64
+ let currentKey = '';
65
+ let isArray = false;
66
+ const arrayValues = [];
67
+ for (const line of lines) {
68
+ const keyValueMatch = line.match(/^([^:]+):\s*(.*)/);
69
+ if (keyValueMatch) {
70
+ if (currentKey && isArray) {
71
+ data[currentKey] = arrayValues.slice();
72
+ arrayValues.length = 0;
73
+ }
74
+ const [, key, value] = keyValueMatch;
75
+ currentKey = key.trim();
76
+ isArray = value.trim() === '';
77
+ if (!isArray) {
78
+ const trimmedValue = value.trim();
79
+ if (trimmedValue === 'true') {
80
+ data[currentKey] = true;
81
+ }
82
+ else if (trimmedValue === 'false') {
83
+ data[currentKey] = false;
84
+ }
85
+ else {
86
+ data[currentKey] = trimmedValue;
87
+ }
88
+ }
89
+ }
90
+ else {
91
+ const arrayItemMatch = line.match(/^\s*-\s*(.*)/);
92
+ if (arrayItemMatch && currentKey && isArray) {
93
+ let value = arrayItemMatch[1].trim();
94
+ // Unquote if the value is quoted.
95
+ if ((value.startsWith("'") && value.endsWith("'")) ||
96
+ (value.startsWith('"') && value.endsWith('"'))) {
97
+ value = value.slice(1, -1);
98
+ }
99
+ arrayValues.push(value);
100
+ }
101
+ }
102
+ }
103
+ if (currentKey && isArray) {
104
+ data[currentKey] = arrayValues;
105
+ }
106
+ return data;
107
+ }
108
+ async function setupRuntimeExamples(examplesPath, host) {
109
+ const { DatabaseSync } = await Promise.resolve().then(() => __importStar(require('node:sqlite')));
110
+ const db = new DatabaseSync(':memory:');
111
+ // Create a relational table to store the structured example data.
112
+ db.exec(`
113
+ CREATE TABLE metadata (
114
+ key TEXT PRIMARY KEY NOT NULL,
115
+ value TEXT NOT NULL
116
+ );
117
+ `);
118
+ db.exec(`
119
+ INSERT INTO metadata (key, value) VALUES
120
+ ('schema_version', '1'),
121
+ ('created_at', '${new Date().toISOString()}');
122
+ `);
123
+ db.exec(`
124
+ CREATE TABLE examples (
125
+ id INTEGER PRIMARY KEY,
126
+ title TEXT NOT NULL,
127
+ summary TEXT NOT NULL,
128
+ keywords TEXT,
129
+ required_packages TEXT,
130
+ related_concepts TEXT,
131
+ related_tools TEXT,
132
+ experimental INTEGER NOT NULL DEFAULT 0,
133
+ content TEXT NOT NULL
134
+ );
135
+ `);
136
+ // Create an FTS5 virtual table to provide full-text search capabilities.
137
+ db.exec(`
138
+ CREATE VIRTUAL TABLE examples_fts USING fts5(
139
+ title,
140
+ summary,
141
+ keywords,
142
+ required_packages,
143
+ related_concepts,
144
+ related_tools,
145
+ content,
146
+ content='examples',
147
+ content_rowid='id',
148
+ tokenize = 'porter ascii'
149
+ );
150
+ `);
151
+ // Create triggers to keep the FTS table synchronized with the examples table.
152
+ db.exec(`
153
+ CREATE TRIGGER examples_after_insert AFTER INSERT ON examples BEGIN
154
+ INSERT INTO examples_fts(rowid, title, summary, keywords, required_packages, related_concepts, related_tools, content)
155
+ VALUES (
156
+ new.id, new.title, new.summary, new.keywords, new.required_packages, new.related_concepts,
157
+ new.related_tools, new.content
158
+ );
159
+ END;
160
+ `);
161
+ const insertStatement = db.prepare('INSERT INTO examples(' +
162
+ 'title, summary, keywords, required_packages, related_concepts, related_tools, experimental, content' +
163
+ ') VALUES(?, ?, ?, ?, ?, ?, ?, ?);');
164
+ const frontmatterSchema = zod_1.z.object({
165
+ title: zod_1.z.string(),
166
+ summary: zod_1.z.string(),
167
+ keywords: zod_1.z.array(zod_1.z.string()).optional(),
168
+ required_packages: zod_1.z.array(zod_1.z.string()).optional(),
169
+ related_concepts: zod_1.z.array(zod_1.z.string()).optional(),
170
+ related_tools: zod_1.z.array(zod_1.z.string()).optional(),
171
+ experimental: zod_1.z.boolean().optional(),
172
+ });
173
+ db.exec('BEGIN TRANSACTION');
174
+ for await (const entry of host.glob('**/*.md', { cwd: examplesPath })) {
175
+ if (!entry.isFile()) {
176
+ continue;
177
+ }
178
+ const content = await host.readFile((0, node_path_1.join)(entry.parentPath, entry.name), 'utf-8');
179
+ const frontmatter = parseFrontmatter(content);
180
+ const validation = frontmatterSchema.safeParse(frontmatter);
181
+ if (!validation.success) {
182
+ // eslint-disable-next-line no-console
183
+ console.warn(`Skipping invalid example file ${entry.name}:`, validation.error.issues);
184
+ continue;
185
+ }
186
+ const { title, summary, keywords, required_packages, related_concepts, related_tools, experimental, } = validation.data;
187
+ insertStatement.run(title, summary, JSON.stringify(keywords ?? []), JSON.stringify(required_packages ?? []), JSON.stringify(related_concepts ?? []), JSON.stringify(related_tools ?? []), experimental ? 1 : 0, content);
188
+ }
189
+ db.exec('END TRANSACTION');
190
+ return db;
191
+ }
192
+ //# sourceMappingURL=runtime-database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-database.js","sourceRoot":"","sources":["runtime-database.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EH,oDAsHC;AAhMD,yCAAiC;AAEjC,6BAAwB;AAGxB;;;;;;;;;GASG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACvD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEzC,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACrD,IAAI,aAAa,EAAE,CAAC;YAClB,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;gBAC1B,IAAI,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC,KAAK,EAAE,CAAC;gBACvC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;YACzB,CAAC;YAED,MAAM,CAAC,EAAE,GAAG,E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,CAAC,CAAC,CAAC,EACpB,OAAO,CACR,CAAC;IACJ,CAAC;IACD,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAE3B,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { z } from 'zod';
9
+ export declare const findExampleInputSchema: z.ZodObject<{
10
+ workspacePath: z.ZodOptional<z.ZodString>;
11
+ query: z.ZodString;
12
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
+ required_packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ related_concepts: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
+ includeExperimental: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
16
+ }, z.core.$strip>;
17
+ export type FindExampleInput = z.infer<typeof findExampleInputSchema>;
18
+ export declare const findExampleOutputSchema: z.ZodObject<{
19
+ examples: z.ZodArray<z.ZodObject<{
20
+ title: z.ZodString;
21
+ summary: z.ZodString;
22
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ required_packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ related_concepts: z.ZodOptional<z.ZodArray<z.ZodString>>;
25
+ related_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
+ content: z.ZodString;
27
+ snippet: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>>;
29
+ }, z.core.$strip>;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.findExampleOutputSchema = exports.findExampleInputSchema = void 0;
11
+ const zod_1 = require("zod");
12
+ exports.findExampleInputSchema = zod_1.z.object({
13
+ workspacePath: zod_1.z
14
+ .string()
15
+ .optional()
16
+ .describe('The absolute path to the `angular.json` file for the workspace. This is used to find the ' +
17
+ 'version-specific code examples that correspond to the installed version of the ' +
18
+ 'Angular framework. You **MUST** get this path from the `list_projects` tool. ' +
19
+ 'If omitted, the tool will search the generic code examples bundled with the CLI.'),
20
+ query: zod_1.z
21
+ .string()
22
+ .describe("The primary, conceptual search query. This should capture the user's main goal or question " +
23
+ "(e.g., 'lazy loading a route' or 'how to use signal inputs'). The query will be processed " +
24
+ 'by a powerful full-text search engine.\n\n' +
25
+ 'Key Syntax Features (see https://www.sqlite.org/fts5.html for full documentation):\n' +
26
+ ' - AND (default): Space-separated terms are combined with AND.\n' +
27
+ ' - Example: \'standalone component\' (finds results with both "standalone" and "component")\n' +
28
+ ' - OR: Use the OR operator to find results with either term.\n' +
29
+ " - Example: 'validation OR validator'\n" +
30
+ ' - NOT: Use the NOT operator to exclude terms.\n' +
31
+ " - Example: 'forms NOT reactive'\n" +
32
+ ' - Grouping: Use parentheses () to group expressions.\n' +
33
+ " - Example: '(validation OR validator) AND forms'\n" +
34
+ ' - Phrase Search: Use double quotes "" for exact phrases.\n' +
35
+ ' - Example: \'"template-driven forms"\'\n' +
36
+ ' - Prefix Search: Use an asterisk * for prefix matching.\n' +
37
+ ' - Example: \'rout*\' (matches "route", "router", "routing")'),
38
+ keywords: zod_1.z
39
+ .array(zod_1.z.string())
40
+ .optional()
41
+ .describe('A list of specific, exact keywords to narrow the search. Use this for precise terms like '),
42
+ required_packages: zod_1.z
43
+ .array(zod_1.z.string())
44
+ .optional()
45
+ .describe("A list of NPM packages that an example must use. Use this when the user's request is " +
46
+ 'specific to a feature within a certain package (e.g., if the user asks about `ngModel`, ' +
47
+ 'you should filter by `@angular/forms`).'),
48
+ related_concepts: zod_1.z
49
+ .array(zod_1.z.string())
50
+ .optional()
51
+ .describe('A list of high-level concepts to filter by. Use this to find examples related to broader ' +
52
+ 'architectural ideas or patterns (e.g., `signals`, `dependency injection`, `routing`).'),
53
+ includeExperimental: zod_1.z
54
+ .boolean()
55
+ .optional()
56
+ .default(false)
57
+ .describe('By default, this tool returns only production-safe examples. Set this to `true` **only if** ' +
58
+ 'the user explicitly asks for a bleeding-edge feature or if a stable solution to their ' +
59
+ 'problem cannot be found. If you set this to `true`, you **MUST** preface your answer by ' +
60
+ 'warning the user that the example uses experimental APIs that are not suitable for production.'),
61
+ });
62
+ exports.findExampleOutputSchema = zod_1.z.object({
63
+ examples: zod_1.z.array(zod_1.z.object({
64
+ title: zod_1.z
65
+ .string()
66
+ .describe('The title of the example. Use this as a heading when presenting the example to the user.'),
67
+ summary: zod_1.z
68
+ .string()
69
+ .describe("A one-sentence summary of the example's purpose. Use this to help the user decide " +
70
+ 'if the example is relevant to them.'),
71
+ keywords: zod_1.z
72
+ .array(zod_1.z.string())
73
+ .optional()
74
+ .describe('A list of keywords for the example. You can use these to explain why this example ' +
75
+ "was a good match for the user's query."),
76
+ required_packages: zod_1.z
77
+ .array(zod_1.z.string())
78
+ .optional()
79
+ .describe('A list of NPM packages required for the example to work. Before presenting the code, ' +
80
+ 'you should inform the user if any of these packages need to be installed.'),
81
+ related_concepts: zod_1.z
82
+ .array(zod_1.z.string())
83
+ .optional()
84
+ .describe('A list of related concepts. You can suggest these to the user as topics for ' +
85
+ 'follow-up questions.'),
86
+ related_tools: zod_1.z
87
+ .array(zod_1.z.string())
88
+ .optional()
89
+ .describe('A list of related MCP tools. You can suggest these as potential next steps for the user.'),
90
+ content: zod_1.z
91
+ .string()
92
+ .describe('A complete, self-contained Angular code example in Markdown format. This should be ' +
93
+ 'presented to the user inside a markdown code block.'),
94
+ snippet: zod_1.z
95
+ .string()
96
+ .optional()
97
+ .describe('A contextual snippet from the content showing the matched search term. This field is ' +
98
+ 'critical for efficiently evaluating a result`s relevance. It enables two primary '),
99
+ })),
100
+ });
101
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1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,CAAC;IAC9C,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,OAAC;aACL,MAAM,EAAE;aACR,QAAQ,CACP,0FAA0F,CAC3F;QACH,OAAO,EAAE,OAAC;aACP,MAAM,EAAE;aACR,QAAQ,CACP,oFAAoF;YAClF,qCAAqC,CACxC;QACH,QAAQ,EAAE,OAAC;aACR,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,oFAAoF;YAClF,wCAAwC,CAC3C;QACH,iBAAiB,EAAE,OAAC;aACjB,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,uFAAuF;YACrF,2EAA2E,CAC9E;QACH,gBAAgB,EAAE,OAAC;aAChB,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,8EAA8E;YAC5E,sBAAsB,CACzB;QACH,aAAa,EAAE,OAAC;aACb,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,0FAA0F,CAC3F;QACH,OAAO,EAAE,OAAC;aACP,MAAM,EAAE;aACR,QAAQ,CACP,qFAAqF;YACnF,qDAAqD,CACxD;QACH,OAAO,EAAE,OAAC;aACP,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uFAAuF;YACrF,mFAAmF,CACtF;KACJ,CAAC,CACH;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ /**
9
+ * Suppresses the experimental warning emitted by Node.js for the `node:sqlite` module.
10
+ *
11
+ * This is a workaround to prevent the console from being cluttered with warnings
12
+ * about the experimental status of the SQLite module, which is used by this tool.
13
+ */
14
+ export declare function suppressSqliteWarning(): void;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.suppressSqliteWarning = suppressSqliteWarning;
11
+ /**
12
+ * Suppresses the experimental warning emitted by Node.js for the `node:sqlite` module.
13
+ *
14
+ * This is a workaround to prevent the console from being cluttered with warnings
15
+ * about the experimental status of the SQLite module, which is used by this tool.
16
+ */
17
+ function suppressSqliteWarning() {
18
+ const originalProcessEmit = process.emit;
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ process.emit = function (event, error) {
21
+ if (event === 'warning' &&
22
+ error instanceof Error &&
23
+ error.name === 'ExperimentalWarning' &&
24
+ error.message.includes('SQLite')) {
25
+ return false;
26
+ }
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, prefer-rest-params
28
+ return originalProcessEmit.apply(process, arguments);
29
+ };
30
+ }
31
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAQH,sDAgBC;AAtBD;;;;;GAKG;AACH,SAAgB,qBAAqB;IACnC,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IACzC,8DAA8D;IAC9D,OAAO,CAAC,IAAI,GAAG,UAAU,KAAa,EAAE,KAAe;QACrD,IACE,KAAK,KAAK,SAAS;YACnB,KAAK,YAAY,KAAK;YACtB,KAAK,CAAC,IAAI,KAAK,qBAAqB;YACpC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAChC,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,kFAAkF;QAClF,OAAO,mBAAmB,CAAC,KAAK,CAAC,OAAO,EAAE,SAAgB,CAAC,CAAC;IAC9D,CAAC,CAAC;AACJ,CAAC"}
@@ -9,25 +9,15 @@ import { z } from 'zod';
9
9
  import { type Host } from '../host';
10
10
  import { type McpToolDeclaration } from './tool-registry';
11
11
  declare const modernizeInputSchema: z.ZodObject<{
12
- directories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
- transformations: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
14
- }, "strip", z.ZodTypeAny, {
15
- directories?: string[] | undefined;
16
- transformations?: string[] | undefined;
17
- }, {
18
- directories?: string[] | undefined;
19
- transformations?: string[] | undefined;
20
- }>;
12
+ directories: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
+ transformations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
14
+ [x: string]: string;
15
+ }>>>;
16
+ }, z.core.$strip>;
21
17
  declare const modernizeOutputSchema: z.ZodObject<{
22
- instructions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
- logs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
- }, "strip", z.ZodTypeAny, {
25
- logs?: string[] | undefined;
26
- instructions?: string[] | undefined;
27
- }, {
28
- logs?: string[] | undefined;
29
- instructions?: string[] | undefined;
30
- }>;
18
+ instructions: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ logs: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ }, z.core.$strip>;
31
21
  export type ModernizeInput = z.infer<typeof modernizeInputSchema>;
32
22
  export type ModernizeOutput = z.infer<typeof modernizeOutputSchema>;
33
23
  export declare function runModernization(input: ModernizeInput, host: Host): Promise<{
@@ -10,5 +10,7 @@ import type { ServerNotification, ServerRequest } from '@modelcontextprotocol/sd
10
10
  import { z } from 'zod';
11
11
  export declare const ZONELESS_MIGRATION_TOOL: import("../tool-registry").McpToolDeclaration<{
12
12
  fileOrDirPath: z.ZodString;
13
- }, z.ZodRawShape>;
13
+ }, Readonly<{
14
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
15
+ }>>;
14
16
  export declare function registerZonelessMigrationTool(fileOrDirPath: string, extras: RequestHandlerExtra<ServerRequest, ServerNotification>): Promise<import("./types").MigrationResponse>;
@@ -6,83 +6,42 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { z } from 'zod';
9
- export declare const LIST_PROJECTS_TOOL: import("./tool-registry").McpToolDeclaration<z.ZodRawShape, {
9
+ export declare const LIST_PROJECTS_TOOL: import("./tool-registry").McpToolDeclaration<Readonly<{
10
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
11
+ }>, {
10
12
  workspaces: z.ZodArray<z.ZodObject<{
11
13
  path: z.ZodString;
12
14
  frameworkVersion: z.ZodOptional<z.ZodString>;
13
15
  projects: z.ZodArray<z.ZodObject<{
14
16
  name: z.ZodString;
15
- type: z.ZodOptional<z.ZodEnum<["application", "library"]>>;
17
+ type: z.ZodOptional<z.ZodEnum<{
18
+ application: "application";
19
+ library: "library";
20
+ }>>;
16
21
  builder: z.ZodOptional<z.ZodString>;
17
22
  root: z.ZodString;
18
23
  sourceRoot: z.ZodString;
19
24
  selectorPrefix: z.ZodOptional<z.ZodString>;
20
- unitTestFramework: z.ZodOptional<z.ZodEnum<["jasmine", "jest", "vitest", "unknown"]>>;
21
- styleLanguage: z.ZodOptional<z.ZodEnum<["css", "scss", "sass", "less"]>>;
22
- }, "strip", z.ZodTypeAny, {
23
- name: string;
24
- root: string;
25
- sourceRoot: string;
26
- type?: "application" | "library" | undefined;
27
- builder?: string | undefined;
28
- selectorPrefix?: string | undefined;
29
- unitTestFramework?: "vitest" | "unknown" | "jasmine" | "jest" | undefined;
30
- styleLanguage?: "css" | "less" | "sass" | "scss" | undefined;
31
- }, {
32
- name: string;
33
- root: string;
34
- sourceRoot: string;
35
- type?: "application" | "library" | undefined;
36
- builder?: string | undefined;
37
- selectorPrefix?: string | undefined;
38
- unitTestFramework?: "vitest" | "unknown" | "jasmine" | "jest" | undefined;
39
- styleLanguage?: "css" | "less" | "sass" | "scss" | undefined;
40
- }>, "many">;
41
- }, "strip", z.ZodTypeAny, {
42
- path: string;
43
- projects: {
44
- name: string;
45
- root: string;
46
- sourceRoot: string;
47
- type?: "application" | "library" | undefined;
48
- builder?: string | undefined;
49
- selectorPrefix?: string | undefined;
50
- unitTestFramework?: "vitest" | "unknown" | "jasmine" | "jest" | undefined;
51
- styleLanguage?: "css" | "less" | "sass" | "scss" | undefined;
52
- }[];
53
- frameworkVersion?: string | undefined;
54
- }, {
55
- path: string;
56
- projects: {
57
- name: string;
58
- root: string;
59
- sourceRoot: string;
60
- type?: "application" | "library" | undefined;
61
- builder?: string | undefined;
62
- selectorPrefix?: string | undefined;
63
- unitTestFramework?: "vitest" | "unknown" | "jasmine" | "jest" | undefined;
64
- styleLanguage?: "css" | "less" | "sass" | "scss" | undefined;
65
- }[];
66
- frameworkVersion?: string | undefined;
67
- }>, "many">;
25
+ unitTestFramework: z.ZodOptional<z.ZodEnum<{
26
+ vitest: "vitest";
27
+ unknown: "unknown";
28
+ jasmine: "jasmine";
29
+ jest: "jest";
30
+ }>>;
31
+ styleLanguage: z.ZodOptional<z.ZodEnum<{
32
+ css: "css";
33
+ less: "less";
34
+ sass: "sass";
35
+ scss: "scss";
36
+ }>>;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>>;
68
39
  parsingErrors: z.ZodDefault<z.ZodArray<z.ZodObject<{
69
40
  filePath: z.ZodString;
70
41
  message: z.ZodString;
71
- }, "strip", z.ZodTypeAny, {
72
- message: string;
73
- filePath: string;
74
- }, {
75
- message: string;
76
- filePath: string;
77
- }>, "many">>;
42
+ }, z.core.$strip>>>;
78
43
  versioningErrors: z.ZodDefault<z.ZodArray<z.ZodObject<{
79
44
  filePath: z.ZodString;
80
45
  message: z.ZodString;
81
- }, "strip", z.ZodTypeAny, {
82
- message: string;
83
- filePath: string;
84
- }, {
85
- message: string;
86
- filePath: string;
87
- }>, "many">>;
46
+ }, z.core.$strip>>>;
88
47
  }>;
@@ -6,10 +6,11 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import type { McpServer, ToolCallback } from '@modelcontextprotocol/sdk/server/mcp.js';
9
+ import type { ToolAnnotations } from '@modelcontextprotocol/sdk/types';
9
10
  import type { ZodRawShape } from 'zod';
10
11
  import type { AngularWorkspace } from '../../../utilities/config';
11
12
  import type { DevServer } from '../dev-server';
12
- type ToolConfig = Parameters<McpServer['registerTool']>[1];
13
+ import type { Host } from '../host';
13
14
  export interface McpToolContext {
14
15
  server: McpServer;
15
16
  workspace?: AngularWorkspace;
@@ -18,13 +19,14 @@ export interface McpToolContext {
18
19
  };
19
20
  exampleDatabasePath?: string;
20
21
  devServers: Map<string, DevServer>;
22
+ host: Host;
21
23
  }
22
24
  export type McpToolFactory<TInput extends ZodRawShape> = (context: McpToolContext) => ToolCallback<TInput> | Promise<ToolCallback<TInput>>;
23
25
  export interface McpToolDeclaration<TInput extends ZodRawShape, TOutput extends ZodRawShape> {
24
26
  name: string;
25
27
  title?: string;
26
28
  description: string;
27
- annotations?: ToolConfig['annotations'];
29
+ annotations?: ToolAnnotations;
28
30
  inputSchema?: TInput;
29
31
  outputSchema?: TOutput;
30
32
  factory: McpToolFactory<TInput>;
@@ -35,4 +37,3 @@ export interface McpToolDeclaration<TInput extends ZodRawShape, TOutput extends
35
37
  export type AnyMcpToolDeclaration = McpToolDeclaration<any, any>;
36
38
  export declare function declareTool<TInput extends ZodRawShape, TOutput extends ZodRawShape>(declaration: McpToolDeclaration<TInput, TOutput>): McpToolDeclaration<TInput, TOutput>;
37
39
  export declare function registerTools(server: McpServer, context: Omit<McpToolContext, 'server'>, declarations: AnyMcpToolDeclaration[]): Promise<void>;
38
- export {};
@@ -1 +1 @@
1
- {"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["tool-registry.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MAAiB,EACjB,OAAuC,EACvC,YAAqC;IAErC,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,WAAW,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC;QAC3C,IAAI,WAAW,CAAC,cAAc,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;YACnF,SAAS;QACX,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC;QAE1F,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;QAE3C,iDAAiD;QACjD,MAAM,CAAC,WAAW,KAAK,EAAE,CAAC;QAC1B,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,CAAC,WAAW,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/C,CAAC;QACD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,wCAAwC;YACxC,MAAM,CAAC,WAAW,CAAC,aAAa,GAAG,CAAC,WAAW,CAAC;QAClD,CAAC;QAED,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -22,6 +22,12 @@ export interface Host {
22
22
  * @returns A promise that resolves to an array of file and directory names.
23
23
  */
24
24
  readdir(path: string): Promise<string[]>;
25
+ /**
26
+ * Reads the content of a file.
27
+ * @param path The path to the file.
28
+ * @returns A promise that resolves to the file content as a string.
29
+ */
30
+ readFile(path: string): Promise<string>;
25
31
  /**
26
32
  * Creates a new, unique temporary directory.
27
33
  * @returns A promise that resolves to the absolute path of the created directory.
@@ -25,6 +25,7 @@ const error_1 = require("./error");
25
25
  exports.NodeJS_HOST = {
26
26
  stat: promises_1.stat,
27
27
  readdir: promises_1.readdir,
28
+ readFile: (path) => (0, promises_1.readFile)(path, { encoding: 'utf8' }),
28
29
  writeFile: promises_1.writeFile,
29
30
  createTempDirectory: () => (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'angular-cli-')),
30
31
  deleteDirectory: (path) => (0, promises_1.rm)(path, { recursive: true, force: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;;GAKG;AAEH,2DAA2C;AAE3C,+CAAyE;AACzE,qCAAiC;AACjC,yCAAiC;AACjC,mCAA8C;AA6D9C;;GAEG;AACU,QAAA,WAAW,GAAS;IAC/B,IAAI,EAAJ,eAAI;IACJ,OAAO,EAAP,kBAAO;IACP,SAAS,EAAT,oBAAS;IACT,mBAAmB,EAAE,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,IAAA,gBAAI,EAAC,IAAA,gBAAM,GAAE,EAAE,cAAc,CAAC,CAAC;IAClE,eAAe,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAA,aAAE,EAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC7E,UAAU,EAAE,KAAK,EACf,OAAe,EACf,IAAuB,EACvB,UAKI,EAAE,EACuC,EAAE;QAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAElF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,YAAY,GAAG,IAAA,0BAAK,EAAC,OAAO,EAAE,IAAI,EAAE;gBACxC,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,MAAM;gBAC9B,MAAM;gBACN,GAAG,EAAE,OAAO,CAAC,GAAG;g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