@angular/cli 21.0.1 → 21.1.0-next.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 (71) hide show
  1. package/lib/code-examples.db +0 -0
  2. package/package.json +19 -19
  3. package/src/commands/mcp/cli.d.ts +2 -2
  4. package/src/commands/mcp/cli.js.map +1 -1
  5. package/src/commands/mcp/dev-server.d.ts +71 -0
  6. package/src/commands/mcp/dev-server.js +96 -0
  7. package/src/commands/mcp/dev-server.js.map +1 -0
  8. package/src/commands/mcp/host.d.ts +20 -5
  9. package/src/commands/mcp/host.js +44 -13
  10. package/src/commands/mcp/host.js.map +1 -1
  11. package/src/commands/mcp/mcp-server.d.ts +26 -4
  12. package/src/commands/mcp/mcp-server.js +12 -6
  13. package/src/commands/mcp/mcp-server.js.map +1 -1
  14. package/src/commands/mcp/resources/instructions.d.ts +1 -1
  15. package/src/commands/mcp/resources/instructions.js +2 -5
  16. package/src/commands/mcp/resources/instructions.js.map +1 -1
  17. package/src/commands/mcp/tools/ai-tutor.js +2 -5
  18. package/src/commands/mcp/tools/ai-tutor.js.map +1 -1
  19. package/src/commands/mcp/tools/best-practices.js +6 -9
  20. package/src/commands/mcp/tools/best-practices.js.map +1 -1
  21. package/src/commands/mcp/tools/build.d.ts +48 -0
  22. package/src/commands/mcp/tools/build.js +97 -0
  23. package/src/commands/mcp/tools/build.js.map +1 -0
  24. package/src/commands/mcp/tools/devserver/start-devserver.d.ts +41 -0
  25. package/src/commands/mcp/tools/devserver/start-devserver.js +82 -0
  26. package/src/commands/mcp/tools/devserver/start-devserver.js.map +1 -0
  27. package/src/commands/mcp/tools/devserver/stop-devserver.d.ts +49 -0
  28. package/src/commands/mcp/tools/devserver/stop-devserver.js +66 -0
  29. package/src/commands/mcp/tools/devserver/stop-devserver.js.map +1 -0
  30. package/src/commands/mcp/tools/devserver/wait-for-devserver-build.d.ts +47 -0
  31. package/src/commands/mcp/tools/devserver/wait-for-devserver-build.js +100 -0
  32. package/src/commands/mcp/tools/devserver/wait-for-devserver-build.js.map +1 -0
  33. package/src/commands/mcp/tools/doc-search.js.map +1 -1
  34. package/src/commands/mcp/tools/examples.js +6 -9
  35. package/src/commands/mcp/tools/examples.js.map +1 -1
  36. package/src/commands/mcp/tools/modernize.d.ts +15 -11
  37. package/src/commands/mcp/tools/modernize.js +13 -45
  38. package/src/commands/mcp/tools/modernize.js.map +1 -1
  39. package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.d.ts → analyze-for-unsupported-zone-uses.d.ts} +1 -1
  40. package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.js → analyze-for-unsupported-zone-uses.js} +2 -2
  41. package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.js.map → analyze-for-unsupported-zone-uses.js.map} +1 -1
  42. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.d.ts → migrate-single-file.d.ts} +3 -3
  43. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.js → migrate-single-file.js} +5 -5
  44. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.js.map → migrate-single-file.js.map} +1 -1
  45. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_test_file.js → migrate-test-file.js} +6 -52
  46. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js.map +1 -0
  47. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +1 -1
  48. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +2 -2
  49. package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.d.ts → send-debug-message.d.ts} +2 -2
  50. package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.js → send-debug-message.js} +1 -1
  51. package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.js.map → send-debug-message.js.map} +1 -1
  52. package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.d.ts → ts-utils.d.ts} +3 -4
  53. package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.js → ts-utils.js} +3 -3
  54. package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.js.map → ts-utils.js.map} +1 -1
  55. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +2 -2
  56. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +67 -71
  57. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +1 -1
  58. package/src/commands/mcp/tools/projects.d.ts +1 -1
  59. package/src/commands/mcp/tools/projects.js +33 -33
  60. package/src/commands/mcp/tools/projects.js.map +1 -1
  61. package/src/commands/mcp/tools/tool-registry.d.ts +3 -1
  62. package/src/commands/mcp/tools/tool-registry.js.map +1 -1
  63. package/src/commands/mcp/utils.d.ts +33 -0
  64. package/src/commands/mcp/utils.js +55 -0
  65. package/src/commands/mcp/utils.js.map +1 -0
  66. package/src/utilities/version.js +1 -1
  67. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.js.map +0 -1
  68. package/src/package-managers/testing/mock-host.d.ts +0 -26
  69. package/src/package-managers/testing/mock-host.js +0 -53
  70. package/src/package-managers/testing/mock-host.js.map +0 -1
  71. /package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_test_file.d.ts → migrate-test-file.d.ts} +0 -0
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "21.0.1",
3
+ "version": "21.1.0-next.0",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,20 +25,20 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.2100.1",
29
- "@angular-devkit/core": "21.0.1",
30
- "@angular-devkit/schematics": "21.0.1",
31
- "@inquirer/prompts": "7.9.0",
28
+ "@angular-devkit/architect": "0.2101.0-next.0",
29
+ "@angular-devkit/core": "21.1.0-next.0",
30
+ "@angular-devkit/schematics": "21.1.0-next.0",
31
+ "@inquirer/prompts": "7.10.1",
32
32
  "@listr2/prompt-adapter-inquirer": "3.0.5",
33
- "@modelcontextprotocol/sdk": "1.20.1",
34
- "@schematics/angular": "21.0.1",
33
+ "@modelcontextprotocol/sdk": "1.22.0",
34
+ "@schematics/angular": "21.1.0-next.0",
35
35
  "@yarnpkg/lockfile": "1.1.0",
36
- "algoliasearch": "5.40.1",
37
- "ini": "5.0.0",
36
+ "algoliasearch": "5.45.0",
37
+ "ini": "6.0.0",
38
38
  "jsonc-parser": "3.3.1",
39
39
  "listr2": "9.0.5",
40
- "npm-package-arg": "13.0.1",
41
- "pacote": "21.0.3",
40
+ "npm-package-arg": "13.0.2",
41
+ "pacote": "21.0.4",
42
42
  "parse5-html-rewriting-stream": "8.0.0",
43
43
  "resolve": "1.22.11",
44
44
  "semver": "7.7.3",
@@ -48,14 +48,14 @@
48
48
  "ng-update": {
49
49
  "migrations": "@schematics/angular/migrations/migration-collection.json",
50
50
  "packageGroup": {
51
- "@angular/cli": "21.0.1",
52
- "@angular/build": "21.0.1",
53
- "@angular/ssr": "21.0.1",
54
- "@angular-devkit/architect": "0.2100.1",
55
- "@angular-devkit/build-angular": "21.0.1",
56
- "@angular-devkit/build-webpack": "0.2100.1",
57
- "@angular-devkit/core": "21.0.1",
58
- "@angular-devkit/schematics": "21.0.1"
51
+ "@angular/cli": "21.1.0-next.0",
52
+ "@angular/build": "21.1.0-next.0",
53
+ "@angular/ssr": "21.1.0-next.0",
54
+ "@angular-devkit/architect": "0.2101.0-next.0",
55
+ "@angular-devkit/build-angular": "21.1.0-next.0",
56
+ "@angular-devkit/build-webpack": "0.2101.0-next.0",
57
+ "@angular-devkit/core": "21.1.0-next.0",
58
+ "@angular-devkit/schematics": "21.1.0-next.0"
59
59
  }
60
60
  },
61
61
  "packageManager": "pnpm@10.23.0",
@@ -5,8 +5,8 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { Argv } from 'yargs';
9
- import { CommandModule, CommandModuleImplementation } from '../../command-builder/command-module';
8
+ import type { Argv } from 'yargs';
9
+ import { CommandModule, type CommandModuleImplementation } from '../../command-builder/command-module';
10
10
  export default class McpCommandModule extends CommandModule implements CommandModuleImplementation {
11
11
  command: string;
12
12
  describe: false;
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["cli.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,wEAAiF;AAEjF,yEAAkG;AAClG,6CAA4C;AAC5C,6CAAmE;AAEnE,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;CAe3B,CAAC;AAEF,MAAqB,gBAAiB,SAAQ,8BAAa;IACzD,OAAO,GAAG,KAAK,CAAC;IAChB,QAAQ,GAAG,KAAc,CAAC;IAC1B,mBAAmB,GAAG,SAAS,CAAC;IAEhC,OAAO,CAAC,UAAgB;QACtB,OAAO,UAAU;aACd,MAAM,CAAC,WAAW,EAAE;YACnB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,gCAAgC;SAC3C,CAAC;aACD,MAAM,CAAC,YAAY,EAAE;YACpB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,0DAA0D;SACrE,CAAC;aACD,MAAM,CAAC,mBAAmB,EAAE;YAC3B,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,8BAA8B;YACxC,OAAO,EAAE,+BAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;YACnD,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,OAIT;QACC,IAAI,IAAA,WAAK,GAAE,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AQ,EAAE,8BAA8B;YACxC,OAAO,EAAE,+BAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;YACnD,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,OAIT;QACC,IAAI,IAAA,WAAK,GAAE,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YAE9C,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAe,EAClC;YACE,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,iBAAiB,EAAE,OAAO,CAAC,gBAAgB;SAC5C,EACD,IAAI,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC;QACF,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;QAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;CACF;AAlDD,mCAkDC"}
@@ -0,0 +1,71 @@
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 type { Host } from './host';
9
+ export type BuildStatus = 'success' | 'failure' | 'unknown';
10
+ /**
11
+ * An Angular development server managed by the MCP server.
12
+ */
13
+ export interface DevServer {
14
+ /**
15
+ * Launches the dev server and returns immediately.
16
+ *
17
+ * Throws if this server is already running.
18
+ */
19
+ start(): void;
20
+ /**
21
+ * If the dev server is running, stops it.
22
+ */
23
+ stop(): void;
24
+ /**
25
+ * Gets all the server logs so far (stdout + stderr).
26
+ */
27
+ getServerLogs(): string[];
28
+ /**
29
+ * Gets all the server logs from the latest build.
30
+ */
31
+ getMostRecentBuild(): {
32
+ status: BuildStatus;
33
+ logs: string[];
34
+ };
35
+ /**
36
+ * Whether the dev server is currently being built, or is awaiting further changes.
37
+ */
38
+ isBuilding(): boolean;
39
+ /**
40
+ * `ng serve` port to use.
41
+ */
42
+ port: number;
43
+ }
44
+ export declare function devServerKey(project?: string): string;
45
+ /**
46
+ * A local Angular development server managed by the MCP server.
47
+ */
48
+ export declare class LocalDevServer implements DevServer {
49
+ readonly host: Host;
50
+ readonly port: number;
51
+ readonly project?: string;
52
+ private devServerProcess;
53
+ private serverLogs;
54
+ private buildInProgress;
55
+ private latestBuildLogStartIndex?;
56
+ private latestBuildStatus;
57
+ constructor({ host, port, project }: {
58
+ host: Host;
59
+ port: number;
60
+ project?: string;
61
+ });
62
+ start(): void;
63
+ private addLog;
64
+ stop(): void;
65
+ getServerLogs(): string[];
66
+ getMostRecentBuild(): {
67
+ status: BuildStatus;
68
+ logs: string[];
69
+ };
70
+ isBuilding(): boolean;
71
+ }
@@ -0,0 +1,96 @@
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.LocalDevServer = void 0;
11
+ exports.devServerKey = devServerKey;
12
+ // Log messages that we want to catch to identify the build status.
13
+ const BUILD_SUCCEEDED_MESSAGE = 'Application bundle generation complete.';
14
+ const BUILD_FAILED_MESSAGE = 'Application bundle generation failed.';
15
+ const WAITING_FOR_CHANGES_MESSAGE = 'Watch mode enabled. Watching for file changes...';
16
+ const CHANGES_DETECTED_START_MESSAGE = '❯ Changes detected. Rebuilding...';
17
+ const CHANGES_DETECTED_SUCCESS_MESSAGE = '✔ Changes detected. Rebuilding...';
18
+ const BUILD_START_MESSAGES = [CHANGES_DETECTED_START_MESSAGE];
19
+ const BUILD_END_MESSAGES = [
20
+ BUILD_SUCCEEDED_MESSAGE,
21
+ BUILD_FAILED_MESSAGE,
22
+ WAITING_FOR_CHANGES_MESSAGE,
23
+ CHANGES_DETECTED_SUCCESS_MESSAGE,
24
+ ];
25
+ function devServerKey(project) {
26
+ return project ?? '<default>';
27
+ }
28
+ /**
29
+ * A local Angular development server managed by the MCP server.
30
+ */
31
+ class LocalDevServer {
32
+ host;
33
+ port;
34
+ project;
35
+ devServerProcess = null;
36
+ serverLogs = [];
37
+ buildInProgress = false;
38
+ latestBuildLogStartIndex = undefined;
39
+ latestBuildStatus = 'unknown';
40
+ constructor({ host, port, project }) {
41
+ this.host = host;
42
+ this.project = project;
43
+ this.port = port;
44
+ }
45
+ start() {
46
+ if (this.devServerProcess) {
47
+ throw Error('Dev server already started.');
48
+ }
49
+ const args = ['serve'];
50
+ if (this.project) {
51
+ args.push(this.project);
52
+ }
53
+ args.push(`--port=${this.port}`);
54
+ this.devServerProcess = this.host.spawn('ng', args, { stdio: 'pipe' });
55
+ this.devServerProcess.stdout?.on('data', (data) => {
56
+ this.addLog(data.toString());
57
+ });
58
+ this.devServerProcess.stderr?.on('data', (data) => {
59
+ this.addLog(data.toString());
60
+ });
61
+ this.devServerProcess.stderr?.on('close', () => {
62
+ this.stop();
63
+ });
64
+ this.buildInProgress = true;
65
+ }
66
+ addLog(log) {
67
+ this.serverLogs.push(log);
68
+ if (BUILD_START_MESSAGES.some((message) => log.startsWith(message))) {
69
+ this.buildInProgress = true;
70
+ this.latestBuildLogStartIndex = this.serverLogs.length - 1;
71
+ }
72
+ else if (BUILD_END_MESSAGES.some((message) => log.startsWith(message))) {
73
+ this.buildInProgress = false;
74
+ // We consider everything except a specific failure message to be a success.
75
+ this.latestBuildStatus = log.startsWith(BUILD_FAILED_MESSAGE) ? 'failure' : 'success';
76
+ }
77
+ }
78
+ stop() {
79
+ this.devServerProcess?.kill();
80
+ this.devServerProcess = null;
81
+ }
82
+ getServerLogs() {
83
+ return [...this.serverLogs];
84
+ }
85
+ getMostRecentBuild() {
86
+ return {
87
+ status: this.latestBuildStatus,
88
+ logs: this.serverLogs.slice(this.latestBuildLogStartIndex),
89
+ };
90
+ }
91
+ isBuilding() {
92
+ return this.buildInProgress;
93
+ }
94
+ }
95
+ exports.LocalDevServer = LocalDevServer;
96
+ //# sourceMappingURL=dev-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-server.js","sourceRoot":"","sources":["dev-server.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA4DH,oCAEC;AAzDD,mEAAmE;AAEnE,MAAM,uBAAuB,GAAG,yCAAyC,CAAC;AAC1E,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AACrE,MAAM,2BAA2B,GAAG,kDAAkD,CAAC;AACvF,MAAM,8BAA8B,GAAG,mCAAmC,CAAC;AAC3E,MAAM,gCAAgC,GAAG,mCAAmC,CAAC;AAE7E,MAAM,oBAAoB,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAC9D,MAAM,kBAAkB,GAAG;IACzB,uBAAuB;IACvB,oBAAoB;IACpB,2BAA2B;IAC3B,gCAAgC;CACjC,CAAC;AAyCF,SAAgB,YAAY,CAAC,OAAgB;IAC3C,OAAO,OAAO,IAAI,WAAW,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAa,cAAc;IAChB,IAAI,CAAO;IACX,IAAI,CAAS;IACb,OAAO,CAAU;IAElB,gBAAgB,GAAwB,IAAI,CAAC;IAC7C,UAAU,GAAa,EAAE,CAAC;IAC1B,eAAe,GAAG,KAAK,CAAC;IACxB,wBAAwB,GAAY,SAAS,CAAC;IAC9C,iBAAiB,GAAgB,SAAS,CAAC;IAEnD,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAkD;QACjF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,KAAK;QACH,IA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AC;YACpE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,CAAC;aAAM,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YACzE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;YAC7B,4EAA4E;YAC5E,IAAI,CAAC,iBAAiB,GAAG,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QACxF,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,aAAa;QACX,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IAED,kBAAkB;QAChB,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,iBAAiB;YAC9B,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC;SAC3D,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;CACF;AA1ED,wCA0EC"}
@@ -5,15 +5,15 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
+ import { ChildProcess } from 'node:child_process';
8
9
  import { Stats } from 'node:fs';
9
10
  /**
10
11
  * An error thrown when a command fails to execute.
11
12
  */
12
13
  export declare class CommandError extends Error {
13
- readonly stdout: string;
14
- readonly stderr: string;
14
+ readonly logs: string[];
15
15
  readonly code: number | null;
16
- constructor(message: string, stdout: string, stderr: string, code: number | null);
16
+ constructor(message: string, logs: string[], code: number | null);
17
17
  }
18
18
  /**
19
19
  * An abstraction layer for operating-system or file-system operations.
@@ -45,9 +45,24 @@ export interface Host {
45
45
  cwd?: string;
46
46
  env?: Record<string, string>;
47
47
  }): Promise<{
48
- stdout: string;
49
- stderr: string;
48
+ logs: string[];
50
49
  }>;
50
+ /**
51
+ * Spawns a long-running child process and returns the `ChildProcess` object.
52
+ * @param command The command to run.
53
+ * @param args The arguments to pass to the command.
54
+ * @param options Options for the child process.
55
+ * @returns The spawned `ChildProcess` instance.
56
+ */
57
+ spawn(command: string, args: readonly string[], options?: {
58
+ stdio?: 'pipe' | 'ignore';
59
+ cwd?: string;
60
+ env?: Record<string, string>;
61
+ }): ChildProcess;
62
+ /**
63
+ * Finds an available TCP port on the system.
64
+ */
65
+ getAvailablePort(): Promise<number>;
51
66
  }
52
67
  /**
53
68
  * A concrete implementation of the `Host` interface that runs on a local workspace.
@@ -17,17 +17,16 @@ exports.LocalWorkspaceHost = exports.CommandError = void 0;
17
17
  const fs_1 = require("fs");
18
18
  const node_child_process_1 = require("node:child_process");
19
19
  const promises_1 = require("node:fs/promises");
20
+ const node_net_1 = require("node:net");
20
21
  /**
21
22
  * An error thrown when a command fails to execute.
22
23
  */
23
24
  class CommandError extends Error {
24
- stdout;
25
- stderr;
25
+ logs;
26
26
  code;
27
- constructor(message, stdout, stderr, code) {
27
+ constructor(message, logs, code) {
28
28
  super(message);
29
- this.stdout = stdout;
30
- this.stderr = stderr;
29
+ this.logs = logs;
31
30
  this.code = code;
32
31
  }
33
32
  }
@@ -51,27 +50,59 @@ exports.LocalWorkspaceHost = {
51
50
  ...options.env,
52
51
  },
53
52
  });
54
- let stdout = '';
55
- childProcess.stdout?.on('data', (data) => (stdout += data.toString()));
56
- let stderr = '';
57
- childProcess.stderr?.on('data', (data) => (stderr += data.toString()));
53
+ const logs = [];
54
+ childProcess.stdout?.on('data', (data) => logs.push(data.toString()));
55
+ childProcess.stderr?.on('data', (data) => logs.push(data.toString()));
58
56
  childProcess.on('close', (code) => {
59
57
  if (code === 0) {
60
- resolve({ stdout, stderr });
58
+ resolve({ logs });
61
59
  }
62
60
  else {
63
61
  const message = `Process exited with code ${code}.`;
64
- reject(new CommandError(message, stdout, stderr, code));
62
+ reject(new CommandError(message, logs, code));
65
63
  }
66
64
  });
67
65
  childProcess.on('error', (err) => {
68
66
  if (err.name === 'AbortError') {
69
67
  const message = `Process timed out.`;
70
- reject(new CommandError(message, stdout, stderr, null));
68
+ reject(new CommandError(message, logs, null));
71
69
  return;
72
70
  }
73
71
  const message = `Process failed with error: ${err.message}`;
74
- reject(new CommandError(message, stdout, stderr, null));
72
+ reject(new CommandError(message, logs, null));
73
+ });
74
+ });
75
+ },
76
+ spawn(command, args, options = {}) {
77
+ return (0, node_child_process_1.spawn)(command, args, {
78
+ shell: false,
79
+ stdio: options.stdio ?? 'pipe',
80
+ cwd: options.cwd,
81
+ env: {
82
+ ...process.env,
83
+ ...options.env,
84
+ },
85
+ });
86
+ },
87
+ getAvailablePort() {
88
+ return new Promise((resolve, reject) => {
89
+ // Create a new temporary server from Node's net library.
90
+ const server = (0, node_net_1.createServer)();
91
+ server.once('error', (err) => {
92
+ reject(err);
93
+ });
94
+ // Listen on port 0 to let the OS assign an available port.
95
+ server.listen(0, () => {
96
+ const address = server.address();
97
+ // Ensure address is an object with a port property.
98
+ if (address && typeof address === 'object') {
99
+ const port = address.port;
100
+ server.close();
101
+ resolve(port);
102
+ }
103
+ else {
104
+ reject(new Error('Unable to retrieve address information from server.'));
105
+ }
75
106
  });
76
107
  });
77
108
  },
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;;GAKG;AAEH,2BAAkD;AAClD,2DAA2C;AAE3C,+CAAwC;AAExC;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK;IAGnB;IACA;IACA;IAJlB,YACE,OAAe,EACC,MAAc,EACd,MAA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AAC;YAEH,2DAA2D;YAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE;gBACpB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;gBAEjC,oDAAoD;gBACpD,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;oBAE1B,MAAM,CAAC,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,IAAI,CAAC,CAAC;gBAChB,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAC;gBAC3E,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -7,19 +7,41 @@
7
7
  */
8
8
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
9
9
  import type { AngularWorkspace } from '../../utilities/config';
10
- import { AnyMcpToolDeclaration } from './tools/tool-registry';
10
+ import { type AnyMcpToolDeclaration } from './tools/tool-registry';
11
11
  /**
12
12
  * The set of tools that are available but not enabled by default.
13
13
  * These tools are considered experimental and may have limitations.
14
14
  */
15
15
  export declare const EXPERIMENTAL_TOOLS: readonly [import("./tools/tool-registry").McpToolDeclaration<{
16
+ project: import("zod").ZodOptional<import("zod").ZodString>;
17
+ configuration: import("zod").ZodOptional<import("zod").ZodString>;
18
+ }, {
19
+ status: import("zod").ZodEnum<["success", "failure"]>;
20
+ logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
21
+ path: import("zod").ZodOptional<import("zod").ZodString>;
22
+ }>, import("./tools/tool-registry").McpToolDeclaration<{
16
23
  directories: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
17
24
  transformations: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<[string, ...string[]]>, "many">>;
18
25
  }, {
19
26
  instructions: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
20
- stdout: import("zod").ZodOptional<import("zod").ZodString>;
21
- stderr: import("zod").ZodOptional<import("zod").ZodString>;
22
- }>];
27
+ logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
28
+ }>, ...(import("./tools/tool-registry").McpToolDeclaration<{
29
+ project: import("zod").ZodOptional<import("zod").ZodString>;
30
+ }, {
31
+ message: import("zod").ZodString;
32
+ address: import("zod").ZodOptional<import("zod").ZodString>;
33
+ }> | import("./tools/tool-registry").McpToolDeclaration<{
34
+ project: import("zod").ZodOptional<import("zod").ZodString>;
35
+ }, {
36
+ message: import("zod").ZodString;
37
+ logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
38
+ }> | import("./tools/tool-registry").McpToolDeclaration<{
39
+ project: import("zod").ZodOptional<import("zod").ZodString>;
40
+ timeout: import("zod").ZodDefault<import("zod").ZodNumber>;
41
+ }, {
42
+ status: import("zod").ZodEnum<["success", "failure", "unknown", "timeout", "no_devserver_found"]>;
43
+ logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
44
+ }>)[]];
23
45
  export declare function createMcpServer(options: {
24
46
  workspace?: AngularWorkspace;
25
47
  readOnly?: boolean;
@@ -6,25 +6,30 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  exports.EXPERIMENTAL_TOOLS = void 0;
14
11
  exports.createMcpServer = createMcpServer;
15
12
  exports.assembleToolDeclarations = assembleToolDeclarations;
16
13
  const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
17
- const node_path_1 = __importDefault(require("node:path"));
14
+ const node_path_1 = require("node:path");
18
15
  const version_1 = require("../../utilities/version");
19
16
  const instructions_1 = require("./resources/instructions");
20
17
  const ai_tutor_1 = require("./tools/ai-tutor");
21
18
  const best_practices_1 = require("./tools/best-practices");
19
+ const build_1 = require("./tools/build");
20
+ const start_devserver_1 = require("./tools/devserver/start-devserver");
21
+ const stop_devserver_1 = require("./tools/devserver/stop-devserver");
22
+ const wait_for_devserver_build_1 = require("./tools/devserver/wait-for-devserver-build");
22
23
  const doc_search_1 = require("./tools/doc-search");
23
24
  const examples_1 = require("./tools/examples");
24
25
  const modernize_1 = require("./tools/modernize");
25
26
  const zoneless_migration_1 = require("./tools/onpush-zoneless-migration/zoneless-migration");
26
27
  const projects_1 = require("./tools/projects");
27
28
  const tool_registry_1 = require("./tools/tool-registry");
29
+ /**
30
+ * Tools to manage devservers. Should be bundled together, then added to experimental or stable as a group.
31
+ */
32
+ const SERVE_TOOLS = [start_devserver_1.START_DEVSERVER_TOOL, stop_devserver_1.STOP_DEVSERVER_TOOL, wait_for_devserver_build_1.WAIT_FOR_DEVSERVER_BUILD_TOOL];
28
33
  /**
29
34
  * The set of tools that are enabled by default for the MCP server.
30
35
  * These tools are considered stable and suitable for general use.
@@ -41,7 +46,7 @@ const STABLE_TOOLS = [
41
46
  * The set of tools that are available but not enabled by default.
42
47
  * These tools are considered experimental and may have limitations.
43
48
  */
44
- exports.EXPERIMENTAL_TOOLS = [modernize_1.MODERNIZE_TOOL];
49
+ exports.EXPERIMENTAL_TOOLS = [build_1.BUILD_TOOL, modernize_1.MODERNIZE_TOOL, ...SERVE_TOOLS];
45
50
  async function createMcpServer(options, logger) {
46
51
  const server = new mcp_js_1.McpServer({
47
52
  name: 'angular-cli-server',
@@ -90,7 +95,8 @@ equivalent actions.
90
95
  await (0, tool_registry_1.registerTools)(server, {
91
96
  workspace: options.workspace,
92
97
  logger,
93
- exampleDatabasePath: node_path_1.default.join(__dirname, '../../../lib/code-examples.db'),
98
+ exampleDatabasePath: (0, node_path_1.join)(__dirname, '../../../lib/code-examples.db'),
99
+ devServers: new Map(),
94
100
  }, toolDeclarations);
95
101
  return server;
96
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["mcp-server.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAmCH,0CAsEC;AAED,4DAuCC;AAhJD,oEAAoE;AACpE,0DAA6B;AAE7B,qDAAkD;AAClD,2DAAwE;AACxE,+CAAiD;AACjD,2DAA6D;AAC7D,mDAAqD;AACrD,+CAAqD;AACrD,iDAAmD;AACnD,6FAA+F;AAC/F,+CAAsD;AACtD,yDAA6E;AAE7E;;;GAGG;AACH,MAAM,YAAY,GAAG;IACnB,wBAAa;IACb,oCAAmB;IACnB,4BAAe;IACf,4BAAiB;IACjB,6BAAkB;IAClB,4CAAuB;CACf,CAAC;AAEX;;;GAGG;AACU,QAAA,kBAAkB,GAAG,CAAC,0BAAc,CAAU,CAAC;AAErD,KAAK,UAAU,eAAe,CACnC,OAKC,EACD,MAAoC;IAEpC,MAAM,MAAM,GAAG,IAAI,kBAAS,CAC1B;QACE,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,iBAAO,CAAC,IAAI;KACtB,EACD;QACE,YAAY,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,EAAE;SACZ;QACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BnB;KACI,CACF,CAAC;IAEF,IAAA,2CAA4B,EAAC,MAAM,CAAC,CAAC;IAErC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,YAAY,EAAE,0BAAkB,EAAE;QAClF,GAAG,OAAO;QACV,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAa,EACjB,MAAM,EACN;QACE,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM;QACN,mBAAmB,EAAE,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,+BAA+B,CAAC;KAC3E,EACD,gBAAgB,CACjB,C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C,QAAQ,CAAC,CAAC;YAChD,IAAI,IAAI,EAAE,CAAC;gBACT,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
9
9
  export declare function registerInstructionsResource(server: McpServer): void;
@@ -6,13 +6,10 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  exports.registerInstructionsResource = registerInstructionsResource;
14
11
  const promises_1 = require("node:fs/promises");
15
- const node_path_1 = __importDefault(require("node:path"));
12
+ const node_path_1 = require("node:path");
16
13
  function registerInstructionsResource(server) {
17
14
  server.registerResource('instructions', 'instructions://best-practices', {
18
15
  title: 'Angular Best Practices and Code Generation Guide',
@@ -22,7 +19,7 @@ function registerInstructionsResource(server) {
22
19
  ' typed forms, modern control flow syntax, and other current conventions.',
23
20
  mimeType: 'text/markdown',
24
21
  }, async () => {
25
- const text = await (0, promises_1.readFile)(node_path_1.default.join(__dirname, 'best-practices.md'), 'utf-8');
22
+ const text = await (0, promises_1.readFile)((0, node_path_1.join)(__dirname, 'best-practices.md'), 'utf-8');
26
23
  return { contents: [{ uri: 'instructions://best-practices', text }] };
27
24
  });
28
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.js","sourceRoot":"","sources":["instructions.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAMH,oEAmBC;AAtBD,+CAA4C;AAC5C,0DAA6B;AAE7B,SAAgB,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,gBAAgB,CACrB,cAAc,EACd,+BAA+B,EAC/B;QACE,KAAK,EAAE,kDAAkD;QACzD,WAAW,EACT,+FAA+F;YAC/F,kFAAkF;YAClF,mFAAmF;YACnF,0EAA0E;QAC5E,QAAQ,EAAE,eAAe;KAC1B,EACD,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC;QAEhF,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,+BAA+B,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxE,CAAC,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["instructions.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAMH,oEAmBC;AAtBD,+CAA4C;AAC5C,yCAAiC;AAEjC,SAAgB,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,gBAAgB,CACrB,cAAc,EACd,+BAA+B,EAC/B;QACE,KAAK,EAAE,kDAAkD;QACzD,WAAW,EACT,+FAA+F;YAC/F,kFAAkF;YAClF,mFAAmF;YACnF,0EAA0E;QAC5E,QAAQ,EAAE,eAAe;KAC1B,EACD,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC;QAE3E,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,+BAA+B,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -6,13 +6,10 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  exports.AI_TUTOR_TOOL = void 0;
14
11
  const promises_1 = require("node:fs/promises");
15
- const node_path_1 = __importDefault(require("node:path"));
12
+ const node_path_1 = require("node:path");
16
13
  const tool_registry_1 = require("./tool-registry");
17
14
  exports.AI_TUTOR_TOOL = (0, tool_registry_1.declareTool)({
18
15
  name: 'ai_tutor',
@@ -43,7 +40,7 @@ with a new core identity and knowledge base.
43
40
  factory: () => {
44
41
  let aiTutorText;
45
42
  return async () => {
46
- aiTutorText ??= await (0, promises_1.readFile)(node_path_1.default.join(__dirname, '..', 'resources', 'ai-tutor.md'), 'utf-8');
43
+ aiTutorText ??= await (0, promises_1.readFile)((0, node_path_1.join)(__dirname, '../resources/ai-tutor.md'), 'utf-8');
47
44
  return {
48
45
  content: [
49
46
  {
@@ -1 +1 @@
1
- {"version":3,"file":"ai-tutor.js","sourceRoot":"","sources":["ai-tutor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAEH,+CAA4C;AAC5C,0DAA6B;AAC7B,mDAA8C;AAEjC,QAAA,aAAa,GAAG,IAAA,2BAAW,EAAC;IACvC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;CAoBd;IACC,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,WAAmB,CAAC;QAExB,OAAO,KAAK,IAAI,EAAE;YAChB,WAAW,KAAK,MAAM,IAAA,mBAAQ,EAC5B,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EA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