@angular/cli 21.1.0-next.2 → 21.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/lib/code-examples.db +0 -0
- package/lib/config/schema.json +1 -2
- package/package.json +17 -17
- package/src/commands/mcp/devserver.d.ts +0 -1
- package/src/commands/mcp/devserver.js +0 -4
- package/src/commands/mcp/devserver.js.map +1 -1
- package/src/commands/mcp/mcp-server.d.ts +105 -30
- package/src/commands/mcp/mcp-server.js +19 -10
- package/src/commands/mcp/mcp-server.js.map +1 -1
- package/src/commands/mcp/resources/ai-tutor.md +16 -15
- package/src/commands/mcp/tools/build.js +2 -11
- package/src/commands/mcp/tools/build.js.map +1 -1
- package/src/commands/mcp/tools/devserver/devserver-start.d.ts +8 -0
- package/src/commands/mcp/tools/devserver/devserver-start.js +17 -12
- package/src/commands/mcp/tools/devserver/devserver-start.js.map +1 -1
- package/src/commands/mcp/tools/devserver/devserver-stop.d.ts +9 -0
- package/src/commands/mcp/tools/devserver/devserver-stop.js +25 -8
- package/src/commands/mcp/tools/devserver/devserver-stop.js.map +1 -1
- package/src/commands/mcp/tools/devserver/devserver-wait-for-build.d.ts +9 -0
- package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js +29 -10
- package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js.map +1 -1
- package/src/commands/mcp/tools/e2e.d.ts +43 -0
- package/src/commands/mcp/tools/e2e.js +87 -0
- package/src/commands/mcp/tools/e2e.js.map +1 -0
- package/src/commands/mcp/tools/modernize.js +1 -5
- package/src/commands/mcp/tools/modernize.js.map +1 -1
- package/src/commands/mcp/tools/projects.js +47 -8
- package/src/commands/mcp/tools/projects.js.map +1 -1
- package/src/commands/mcp/tools/test.d.ts +35 -0
- package/src/commands/mcp/tools/test.js +78 -0
- package/src/commands/mcp/tools/test.js.map +1 -0
- package/src/commands/mcp/utils.d.ts +23 -0
- package/src/commands/mcp/utils.js +50 -4
- package/src/commands/mcp/utils.js.map +1 -1
- package/src/commands/update/cli.js +2 -2
- package/src/commands/update/cli.js.map +1 -1
- package/src/commands/update/schematic/index.js +0 -12
- package/src/commands/update/schematic/index.js.map +1 -1
- package/src/commands/update/utilities/git.d.ts +7 -5
- package/src/commands/update/utilities/git.js +54 -21
- package/src/commands/update/utilities/git.js.map +1 -1
- package/src/package-managers/package-manager-descriptor.d.ts +5 -1
- package/src/package-managers/package-manager-descriptor.js +5 -3
- package/src/package-managers/package-manager-descriptor.js.map +1 -1
- package/src/package-managers/package-manager.d.ts +1 -0
- package/src/package-managers/package-manager.js +11 -1
- package/src/package-managers/package-manager.js.map +1 -1
- package/src/package-managers/parsers.js +2 -1
- package/src/package-managers/parsers.js.map +1 -1
- package/src/utilities/version.js +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2026 Google LLC. https://angular.dev/license
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/lib/code-examples.db
CHANGED
|
Binary file
|
package/lib/config/schema.json
CHANGED
|
@@ -4409,8 +4409,7 @@
|
|
|
4409
4409
|
},
|
|
4410
4410
|
"ui": {
|
|
4411
4411
|
"type": "boolean",
|
|
4412
|
-
"description": "Enables the Vitest UI for interactive test execution. This option is only available for the Vitest runner."
|
|
4413
|
-
"default": false
|
|
4412
|
+
"description": "Enables the Vitest UI for interactive test execution. This option is only available for the Vitest runner."
|
|
4414
4413
|
},
|
|
4415
4414
|
"coverage": {
|
|
4416
4415
|
"type": "boolean",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "21.1.0-
|
|
3
|
+
"version": "21.1.0-rc.0",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.2101.0-
|
|
29
|
-
"@angular-devkit/core": "21.1.0-
|
|
30
|
-
"@angular-devkit/schematics": "21.1.0-
|
|
28
|
+
"@angular-devkit/architect": "0.2101.0-rc.0",
|
|
29
|
+
"@angular-devkit/core": "21.1.0-rc.0",
|
|
30
|
+
"@angular-devkit/schematics": "21.1.0-rc.0",
|
|
31
31
|
"@inquirer/prompts": "7.10.1",
|
|
32
32
|
"@listr2/prompt-adapter-inquirer": "3.0.5",
|
|
33
|
-
"@modelcontextprotocol/sdk": "1.
|
|
34
|
-
"@schematics/angular": "21.1.0-
|
|
33
|
+
"@modelcontextprotocol/sdk": "1.25.2",
|
|
34
|
+
"@schematics/angular": "21.1.0-rc.0",
|
|
35
35
|
"@yarnpkg/lockfile": "1.1.0",
|
|
36
|
-
"algoliasearch": "5.46.
|
|
36
|
+
"algoliasearch": "5.46.2",
|
|
37
37
|
"ini": "6.0.0",
|
|
38
38
|
"jsonc-parser": "3.3.1",
|
|
39
39
|
"listr2": "9.0.5",
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"resolve": "1.22.11",
|
|
44
44
|
"semver": "7.7.3",
|
|
45
45
|
"yargs": "18.0.0",
|
|
46
|
-
"zod": "4.
|
|
46
|
+
"zod": "4.3.5"
|
|
47
47
|
},
|
|
48
48
|
"ng-update": {
|
|
49
49
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
50
50
|
"packageGroup": {
|
|
51
|
-
"@angular/cli": "21.1.0-
|
|
52
|
-
"@angular/build": "21.1.0-
|
|
53
|
-
"@angular/ssr": "21.1.0-
|
|
54
|
-
"@angular-devkit/architect": "0.2101.0-
|
|
55
|
-
"@angular-devkit/build-angular": "21.1.0-
|
|
56
|
-
"@angular-devkit/build-webpack": "0.2101.0-
|
|
57
|
-
"@angular-devkit/core": "21.1.0-
|
|
58
|
-
"@angular-devkit/schematics": "21.1.0-
|
|
51
|
+
"@angular/cli": "21.1.0-rc.0",
|
|
52
|
+
"@angular/build": "21.1.0-rc.0",
|
|
53
|
+
"@angular/ssr": "21.1.0-rc.0",
|
|
54
|
+
"@angular-devkit/architect": "0.2101.0-rc.0",
|
|
55
|
+
"@angular-devkit/build-angular": "21.1.0-rc.0",
|
|
56
|
+
"@angular-devkit/build-webpack": "0.2101.0-rc.0",
|
|
57
|
+
"@angular-devkit/core": "21.1.0-rc.0",
|
|
58
|
+
"@angular-devkit/schematics": "21.1.0-rc.0"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
"packageManager": "pnpm@10.
|
|
61
|
+
"packageManager": "pnpm@10.27.0",
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
64
64
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.LocalDevserver = void 0;
|
|
11
|
-
exports.devserverKey = devserverKey;
|
|
12
11
|
// Log messages that we want to catch to identify the build status.
|
|
13
12
|
const BUILD_SUCCEEDED_MESSAGE = 'Application bundle generation complete.';
|
|
14
13
|
const BUILD_FAILED_MESSAGE = 'Application bundle generation failed.';
|
|
@@ -22,9 +21,6 @@ const BUILD_END_MESSAGES = [
|
|
|
22
21
|
WAITING_FOR_CHANGES_MESSAGE,
|
|
23
22
|
CHANGES_DETECTED_SUCCESS_MESSAGE,
|
|
24
23
|
];
|
|
25
|
-
function devserverKey(project) {
|
|
26
|
-
return project ?? '<default>';
|
|
27
|
-
}
|
|
28
24
|
/**
|
|
29
25
|
* A local Angular development server managed by the MCP server.
|
|
30
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devserver.js","sourceRoot":"","sources":["devserver.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"devserver.js","sourceRoot":"","sources":["devserver.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAKH,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;;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,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,MAAM,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI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E,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"}
|
|
@@ -8,36 +8,6 @@
|
|
|
8
8
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
9
|
import type { AngularWorkspace } from '../../utilities/config';
|
|
10
10
|
import { type AnyMcpToolDeclaration } from './tools/tool-registry';
|
|
11
|
-
/**
|
|
12
|
-
* Experimental tools that are grouped together under a single name.
|
|
13
|
-
*
|
|
14
|
-
* Used for enabling them as a group.
|
|
15
|
-
*/
|
|
16
|
-
export declare const EXPERIMENTAL_TOOL_GROUPS: {
|
|
17
|
-
devserver: (import("./tools/tool-registry").McpToolDeclaration<{
|
|
18
|
-
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
-
}, {
|
|
20
|
-
message: import("zod").ZodString;
|
|
21
|
-
address: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
-
}> | import("./tools/tool-registry").McpToolDeclaration<{
|
|
23
|
-
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
-
}, {
|
|
25
|
-
message: import("zod").ZodString;
|
|
26
|
-
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
27
|
-
}> | import("./tools/tool-registry").McpToolDeclaration<{
|
|
28
|
-
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
-
timeout: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
30
|
-
}, {
|
|
31
|
-
status: import("zod").ZodEnum<{
|
|
32
|
-
success: "success";
|
|
33
|
-
timeout: "timeout";
|
|
34
|
-
failure: "failure";
|
|
35
|
-
unknown: "unknown";
|
|
36
|
-
no_devserver_found: "no_devserver_found";
|
|
37
|
-
}>;
|
|
38
|
-
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
39
|
-
}>)[];
|
|
40
|
-
};
|
|
41
11
|
/**
|
|
42
12
|
* The set of tools that are available but not enabled by default.
|
|
43
13
|
* These tools are considered experimental and may have limitations.
|
|
@@ -52,6 +22,14 @@ export declare const EXPERIMENTAL_TOOLS: readonly [import("./tools/tool-registry
|
|
|
52
22
|
}>;
|
|
53
23
|
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
54
24
|
path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
|
+
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
26
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
27
|
+
}, {
|
|
28
|
+
status: import("zod").ZodEnum<{
|
|
29
|
+
success: "success";
|
|
30
|
+
failure: "failure";
|
|
31
|
+
}>;
|
|
32
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
55
33
|
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
56
34
|
directories: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
57
35
|
transformations: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
@@ -60,6 +38,15 @@ export declare const EXPERIMENTAL_TOOLS: readonly [import("./tools/tool-registry
|
|
|
60
38
|
}, {
|
|
61
39
|
instructions: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
62
40
|
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
41
|
+
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
42
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
43
|
+
filter: import("zod").ZodOptional<import("zod").ZodString>;
|
|
44
|
+
}, {
|
|
45
|
+
status: import("zod").ZodEnum<{
|
|
46
|
+
success: "success";
|
|
47
|
+
failure: "failure";
|
|
48
|
+
}>;
|
|
49
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
63
50
|
}>, ...(import("./tools/tool-registry").McpToolDeclaration<{
|
|
64
51
|
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
65
52
|
}, {
|
|
@@ -83,6 +70,94 @@ export declare const EXPERIMENTAL_TOOLS: readonly [import("./tools/tool-registry
|
|
|
83
70
|
}>;
|
|
84
71
|
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
85
72
|
}>)[]];
|
|
73
|
+
/**
|
|
74
|
+
* Experimental tools that are grouped together under a single name.
|
|
75
|
+
*
|
|
76
|
+
* Used for enabling them as a group.
|
|
77
|
+
*/
|
|
78
|
+
export declare const EXPERIMENTAL_TOOL_GROUPS: {
|
|
79
|
+
all: readonly [import("./tools/tool-registry").McpToolDeclaration<{
|
|
80
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
configuration: import("zod").ZodOptional<import("zod").ZodString>;
|
|
82
|
+
}, {
|
|
83
|
+
status: import("zod").ZodEnum<{
|
|
84
|
+
success: "success";
|
|
85
|
+
failure: "failure";
|
|
86
|
+
}>;
|
|
87
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
88
|
+
path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
89
|
+
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
90
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
}, {
|
|
92
|
+
status: import("zod").ZodEnum<{
|
|
93
|
+
success: "success";
|
|
94
|
+
failure: "failure";
|
|
95
|
+
}>;
|
|
96
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
97
|
+
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
98
|
+
directories: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
99
|
+
transformations: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
100
|
+
[x: string]: string;
|
|
101
|
+
}>>>;
|
|
102
|
+
}, {
|
|
103
|
+
instructions: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
104
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
105
|
+
}>, import("./tools/tool-registry").McpToolDeclaration<{
|
|
106
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
107
|
+
filter: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
}, {
|
|
109
|
+
status: import("zod").ZodEnum<{
|
|
110
|
+
success: "success";
|
|
111
|
+
failure: "failure";
|
|
112
|
+
}>;
|
|
113
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
114
|
+
}>, ...(import("./tools/tool-registry").McpToolDeclaration<{
|
|
115
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
116
|
+
}, {
|
|
117
|
+
message: import("zod").ZodString;
|
|
118
|
+
address: import("zod").ZodOptional<import("zod").ZodString>;
|
|
119
|
+
}> | import("./tools/tool-registry").McpToolDeclaration<{
|
|
120
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
121
|
+
}, {
|
|
122
|
+
message: import("zod").ZodString;
|
|
123
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
124
|
+
}> | import("./tools/tool-registry").McpToolDeclaration<{
|
|
125
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
126
|
+
timeout: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
127
|
+
}, {
|
|
128
|
+
status: import("zod").ZodEnum<{
|
|
129
|
+
success: "success";
|
|
130
|
+
timeout: "timeout";
|
|
131
|
+
failure: "failure";
|
|
132
|
+
unknown: "unknown";
|
|
133
|
+
no_devserver_found: "no_devserver_found";
|
|
134
|
+
}>;
|
|
135
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
136
|
+
}>)[]];
|
|
137
|
+
devserver: (import("./tools/tool-registry").McpToolDeclaration<{
|
|
138
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
139
|
+
}, {
|
|
140
|
+
message: import("zod").ZodString;
|
|
141
|
+
address: import("zod").ZodOptional<import("zod").ZodString>;
|
|
142
|
+
}> | import("./tools/tool-registry").McpToolDeclaration<{
|
|
143
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
144
|
+
}, {
|
|
145
|
+
message: import("zod").ZodString;
|
|
146
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
147
|
+
}> | import("./tools/tool-registry").McpToolDeclaration<{
|
|
148
|
+
project: import("zod").ZodOptional<import("zod").ZodString>;
|
|
149
|
+
timeout: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
150
|
+
}, {
|
|
151
|
+
status: import("zod").ZodEnum<{
|
|
152
|
+
success: "success";
|
|
153
|
+
timeout: "timeout";
|
|
154
|
+
failure: "failure";
|
|
155
|
+
unknown: "unknown";
|
|
156
|
+
no_devserver_found: "no_devserver_found";
|
|
157
|
+
}>;
|
|
158
|
+
logs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
159
|
+
}>)[];
|
|
160
|
+
};
|
|
86
161
|
export declare function createMcpServer(options: {
|
|
87
162
|
workspace?: AngularWorkspace;
|
|
88
163
|
readOnly?: boolean;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.EXPERIMENTAL_TOOL_GROUPS = exports.EXPERIMENTAL_TOOLS = void 0;
|
|
11
11
|
exports.createMcpServer = createMcpServer;
|
|
12
12
|
exports.assembleToolDeclarations = assembleToolDeclarations;
|
|
13
13
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
@@ -22,23 +22,17 @@ const devserver_start_1 = require("./tools/devserver/devserver-start");
|
|
|
22
22
|
const devserver_stop_1 = require("./tools/devserver/devserver-stop");
|
|
23
23
|
const devserver_wait_for_build_1 = require("./tools/devserver/devserver-wait-for-build");
|
|
24
24
|
const doc_search_1 = require("./tools/doc-search");
|
|
25
|
+
const e2e_1 = require("./tools/e2e");
|
|
25
26
|
const index_1 = require("./tools/examples/index");
|
|
26
27
|
const modernize_1 = require("./tools/modernize");
|
|
27
28
|
const zoneless_migration_1 = require("./tools/onpush-zoneless-migration/zoneless-migration");
|
|
28
29
|
const projects_1 = require("./tools/projects");
|
|
30
|
+
const test_1 = require("./tools/test");
|
|
29
31
|
const tool_registry_1 = require("./tools/tool-registry");
|
|
30
32
|
/**
|
|
31
33
|
* Tools to manage devservers. Should be bundled together, then added to experimental or stable as a group.
|
|
32
34
|
*/
|
|
33
35
|
const DEVSERVER_TOOLS = [devserver_start_1.DEVSERVER_START_TOOL, devserver_stop_1.DEVSERVER_STOP_TOOL, devserver_wait_for_build_1.DEVSERVER_WAIT_FOR_BUILD_TOOL];
|
|
34
|
-
/**
|
|
35
|
-
* Experimental tools that are grouped together under a single name.
|
|
36
|
-
*
|
|
37
|
-
* Used for enabling them as a group.
|
|
38
|
-
*/
|
|
39
|
-
exports.EXPERIMENTAL_TOOL_GROUPS = {
|
|
40
|
-
'devserver': DEVSERVER_TOOLS,
|
|
41
|
-
};
|
|
42
36
|
/**
|
|
43
37
|
* The set of tools that are enabled by default for the MCP server.
|
|
44
38
|
* These tools are considered stable and suitable for general use.
|
|
@@ -55,7 +49,22 @@ const STABLE_TOOLS = [
|
|
|
55
49
|
* The set of tools that are available but not enabled by default.
|
|
56
50
|
* These tools are considered experimental and may have limitations.
|
|
57
51
|
*/
|
|
58
|
-
exports.EXPERIMENTAL_TOOLS = [
|
|
52
|
+
exports.EXPERIMENTAL_TOOLS = [
|
|
53
|
+
build_1.BUILD_TOOL,
|
|
54
|
+
e2e_1.E2E_TOOL,
|
|
55
|
+
modernize_1.MODERNIZE_TOOL,
|
|
56
|
+
test_1.TEST_TOOL,
|
|
57
|
+
...DEVSERVER_TOOLS,
|
|
58
|
+
];
|
|
59
|
+
/**
|
|
60
|
+
* Experimental tools that are grouped together under a single name.
|
|
61
|
+
*
|
|
62
|
+
* Used for enabling them as a group.
|
|
63
|
+
*/
|
|
64
|
+
exports.EXPERIMENTAL_TOOL_GROUPS = {
|
|
65
|
+
'all': exports.EXPERIMENTAL_TOOLS,
|
|
66
|
+
'devserver': DEVSERVER_TOOLS,
|
|
67
|
+
};
|
|
59
68
|
async function createMcpServer(options, logger) {
|
|
60
69
|
const server = new mcp_js_1.McpServer({
|
|
61
70
|
name: 'angular-cli-server',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["mcp-server.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["mcp-server.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAgEH,0CAwEC;AAED,4DA8CC;AAtLD,oEAAoE;A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,IAAI,wBAAwB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAEhG,KAAK,MAAM,QAAQ,IAAI,wBAAwB,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,oBAAoB,CAAC,GAAG,CAAC,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"}
|
|
@@ -327,8 +327,9 @@ When teaching or generating code for Phase 5 (Signal Forms), you **must** strict
|
|
|
327
327
|
- Use the `[field]` directive to bind a form control to an input.
|
|
328
328
|
- **Correct Syntax**: `<input [field]="myForm.username">` (Note: `field` is lowercase here).
|
|
329
329
|
- **Submission Logic**:
|
|
330
|
-
- Use the `submit()` utility function inside
|
|
331
|
-
- **Syntax**: `submit(this.myForm, async () => { /* logic */ })
|
|
330
|
+
- Use the `submit()` utility function inside the form's `(submit)` event handler.
|
|
331
|
+
- **Syntax**: Add `(submit)="save($event)"` to the `<form>` element and use `submit(this.myForm, async () => { /* logic */ })` in the handler.
|
|
332
|
+
- The handler must call `event.preventDefault()` to prevent the default form submission behavior.
|
|
332
333
|
- **Resetting Logic**:
|
|
333
334
|
- To reset the form, you must perform two actions:
|
|
334
335
|
1. **Clear Interaction State**: Call `.reset()` on the form signal's value: `this.myForm().reset()`.
|
|
@@ -344,7 +345,7 @@ When teaching or generating code for Phase 5 (Signal Forms), you **must** strict
|
|
|
344
345
|
```html
|
|
345
346
|
@if (myForm.email().invalid()) {
|
|
346
347
|
<ul>
|
|
347
|
-
@for (error of myForm.email().errors(); track error) {
|
|
348
|
+
@for (error of myForm.email().errors(); track error.kind) {
|
|
348
349
|
<li>{{ error.message }}</li>
|
|
349
350
|
}
|
|
350
351
|
</ul>
|
|
@@ -363,14 +364,14 @@ When teaching or generating code for Phase 5 (Signal Forms), you **must** strict
|
|
|
363
364
|
standalone: true,
|
|
364
365
|
imports: [Field],
|
|
365
366
|
template: `
|
|
366
|
-
<form>
|
|
367
|
+
<form (submit)="save($event)">
|
|
367
368
|
<label>
|
|
368
369
|
Email
|
|
369
370
|
<input [field]="loginForm.email" />
|
|
370
371
|
</label>
|
|
371
372
|
@if (loginForm.email().touched() && loginForm.email().invalid()) {
|
|
372
373
|
<p class="error">
|
|
373
|
-
@for (error of loginForm.email().errors(); track
|
|
374
|
+
@for (error of loginForm.email().errors(); track error.kind) {
|
|
374
375
|
<span>{{ error.message }}</span>
|
|
375
376
|
}
|
|
376
377
|
</p>
|
|
@@ -378,7 +379,7 @@ When teaching or generating code for Phase 5 (Signal Forms), you **must** strict
|
|
|
378
379
|
|
|
379
380
|
<label>Password <input type="password" [field]="loginForm.password" /></label>
|
|
380
381
|
|
|
381
|
-
<button
|
|
382
|
+
<button type="submit">Log In</button>
|
|
382
383
|
</form>
|
|
383
384
|
`,
|
|
384
385
|
})
|
|
@@ -553,7 +554,6 @@ _(The LLM will need to interpret "project-specific" or "app-themed" below based
|
|
|
553
554
|
- **Module 20 (Validation in Signal Forms)**
|
|
554
555
|
- **20a**: The component imports validator functions (e.g., `required`, `email`) from `@angular/forms/signals`. `description`: "importing functional validators."
|
|
555
556
|
- **20b**: The `form()` definition uses a validation callback. `description`: "defining the validation schema."
|
|
556
|
-
- **20c**: The button uses `[disabled]` bound to `myForm.invalid()`. `description`: "disabling the button for invalid forms."
|
|
557
557
|
- **Module 21 (Field State & Error Messages)**
|
|
558
558
|
- **21a**: The template uses an `@if` block checking `field().invalid()` (e.g., `myForm.name().invalid()`). `description`: "checking field invalidity."
|
|
559
559
|
- **21b**: Inside the check, an `@for` loop iterates over `field().errors()`. `description`: "iterating over validation errors."
|
|
@@ -804,20 +804,21 @@ touch src/app/mock-recipes.ts
|
|
|
804
804
|
|
|
805
805
|
**Exercise**: Your goal is to create a new `AddRecipe` component that uses the modern `Signal Forms` API. Import `form` and `Field` from `@angular/forms/signals`. Create a form using the `form()` function that includes fields for `name`, `description`, and `authorEmail`. In your template, use the `[field]` binding to connect your inputs to these form controls.
|
|
806
806
|
|
|
807
|
-
- **Module 19**: **Submitting & Resetting**: Concept: Handling form submission and resetting state. **Exercise**: Inject the service into your `AddRecipe` component. Create a protected `save()` method triggered by
|
|
808
|
-
1.
|
|
809
|
-
2.
|
|
810
|
-
3.
|
|
811
|
-
4.
|
|
812
|
-
5. **
|
|
807
|
+
- **Module 19**: **Submitting & Resetting**: Concept: Handling form submission and resetting state. **Exercise**: Inject the service into your `AddRecipe` component. Create a protected `save()` method triggered by the form's `(submit)` event. Inside this method:
|
|
808
|
+
1. Call `event.preventDefault()` to prevent the default form submission.
|
|
809
|
+
2. Use the `submit(this.myForm, ...)` utility.
|
|
810
|
+
3. Update the `RecipeService` to include an `addRecipe(newRecipe: RecipeModel)` method.
|
|
811
|
+
4. Construct a complete `RecipeModel` (merging form values with defaults) and pass it to the service.
|
|
812
|
+
5. **Reset the form**: Call `this.myForm().reset()` to clear interaction flags.
|
|
813
|
+
6. **Clear the values**: Call `this.myModel.set(...)` to reset the inputs.
|
|
813
814
|
|
|
814
815
|
- **Module 20**: **Validation in Signal Forms**: Concept: Applying functional validators. **Exercise**: Import `required` and `email` from `@angular/forms/signals`. Modify your `form()` definition to add a validation callback enforcing:
|
|
815
816
|
- `name`: Required (Message: 'Recipe name is required.').
|
|
816
817
|
- `description`: Required (Message: 'Description is required.').
|
|
817
818
|
- `authorEmail`: Required (Message: 'Author email is required.') AND Email format (Message: 'Please enter a valid email address.').
|
|
818
|
-
**Finally,
|
|
819
|
+
**Finally, ensure your submit button has `type="submit"`. Note: the `submit()` utility automatically handles validation by marking all fields as touched when submission is attempted.**
|
|
819
820
|
|
|
820
821
|
- **Module 21**: **Field State & Error Messages**: Concept: Providing user feedback by accessing field state signals. **Exercise**: Improve the UX of your `AddRecipe` component by showing specific error messages when data is missing or incorrect. In your template, for the `name`, `description`, and `authorEmail` inputs:
|
|
821
822
|
1. Create an `@if` block that checks if the field is `invalid()` (e.g., `myForm.name().invalid()`).
|
|
822
|
-
2. Inside the block, use `@for` to iterate over the field's `.errors()
|
|
823
|
+
2. Inside the block, use `@for` to iterate over the field's `.errors()` (use `track error.kind` to identify each error by its type).
|
|
823
824
|
3. Display the `error.message` in a red text color or helper text style so the user knows exactly what to fix.
|
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.BUILD_TOOL = void 0;
|
|
11
11
|
exports.runBuild = runBuild;
|
|
12
12
|
const zod_1 = require("zod");
|
|
13
|
-
const host_1 = require("../host");
|
|
14
13
|
const utils_1 = require("../utils");
|
|
15
14
|
const tool_registry_1 = require("./tool-registry");
|
|
16
15
|
const DEFAULT_CONFIGURATION = 'development';
|
|
@@ -45,15 +44,7 @@ async function runBuild(input, host) {
|
|
|
45
44
|
}
|
|
46
45
|
catch (e) {
|
|
47
46
|
status = 'failure';
|
|
48
|
-
|
|
49
|
-
logs = e.logs;
|
|
50
|
-
}
|
|
51
|
-
else if (e instanceof Error) {
|
|
52
|
-
logs = [e.message];
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
logs = [String(e)];
|
|
56
|
-
}
|
|
47
|
+
logs = (0, utils_1.getCommandErrorLogs)(e);
|
|
57
48
|
}
|
|
58
49
|
for (const line of logs) {
|
|
59
50
|
const match = line.match(/Output location: (.*)/);
|
|
@@ -82,7 +73,7 @@ Perform a one-off, non-watched build using "ng build". Use this tool whenever th
|
|
|
82
73
|
</Use Cases>
|
|
83
74
|
<Operational Notes>
|
|
84
75
|
* This tool runs "ng build" so it expects to run within an Angular workspace.
|
|
85
|
-
* If you want a watched build which updates as files are changed, use "devserver
|
|
76
|
+
* If you want a watched build which updates as files are changed, use "devserver.start" instead, which also serves the app.
|
|
86
77
|
* You can provide a project instead of building the root one. The "list_projects" MCP tool could be used to obtain the list of projects.
|
|
87
78
|
* This tool defaults to a development environment while a regular "ng build" defaults to a production environment. An unexpected build
|
|
88
79
|
failure might suggest the project is not configured for the requested environment.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmCH,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmCH,4BAkCC;AAnED,6BAAwB;AAExB,oCAA8E;AAC9E,mDAAuE;AAEvE,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAE5C,MAAM,iBAAiB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAGzD,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,4FAA4F,CAC7F;IACH,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,8DAA8D,CAAC;CAC5E,CAAC,CAAC;AAIH,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,eAAe,CAAC;IACnD,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC7E,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ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AW,EAAE;;;;;;;;;;;;;;;CAed;IACC,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,oBAAoB,CAAC,KAAK;IACvC,YAAY,EAAE,qBAAqB,CAAC,KAAK;IACzC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC;CAC/D,CAAC,CAAC"}
|
|
@@ -17,6 +17,14 @@ declare const devserverStartToolOutputSchema: z.ZodObject<{
|
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
export type DevserverStartToolOutput = z.infer<typeof devserverStartToolOutputSchema>;
|
|
19
19
|
export declare function startDevserver(input: DevserverStartToolInput, context: McpToolContext): Promise<{
|
|
20
|
+
content: {
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
}[];
|
|
24
|
+
structuredContent: {
|
|
25
|
+
message: string[];
|
|
26
|
+
};
|
|
27
|
+
} | {
|
|
20
28
|
content: {
|
|
21
29
|
type: "text";
|
|
22
30
|
text: string;
|
|
@@ -30,44 +30,49 @@ function localhostAddress(port) {
|
|
|
30
30
|
return `http://localhost:${port}/`;
|
|
31
31
|
}
|
|
32
32
|
async function startDevserver(input, context) {
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const projectName = input.project ?? (0, utils_1.getDefaultProjectName)(context);
|
|
34
|
+
if (!projectName) {
|
|
35
|
+
return (0, utils_1.createStructuredContentOutput)({
|
|
36
|
+
message: ['Project name not provided, and no default project found.'],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
let devserver = context.devservers.get(projectName);
|
|
35
40
|
if (devserver) {
|
|
36
41
|
return (0, utils_1.createStructuredContentOutput)({
|
|
37
|
-
message: `Development server for project '${
|
|
42
|
+
message: `Development server for project '${projectName}' is already running.`,
|
|
38
43
|
address: localhostAddress(devserver.port),
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
46
|
const port = await context.host.getAvailablePort();
|
|
42
47
|
devserver = new devserver_1.LocalDevserver({ host: context.host, project: input.project, port });
|
|
43
48
|
devserver.start();
|
|
44
|
-
context.devservers.set(
|
|
49
|
+
context.devservers.set(projectName, devserver);
|
|
45
50
|
return (0, utils_1.createStructuredContentOutput)({
|
|
46
|
-
message: `Development server for project '${
|
|
51
|
+
message: `Development server for project '${projectName}' started and watching for workspace changes.`,
|
|
47
52
|
address: localhostAddress(port),
|
|
48
53
|
});
|
|
49
54
|
}
|
|
50
55
|
exports.DEVSERVER_START_TOOL = (0, tool_registry_1.declareTool)({
|
|
51
|
-
name: 'devserver
|
|
56
|
+
name: 'devserver.start',
|
|
52
57
|
title: 'Start Development Server',
|
|
53
58
|
description: `
|
|
54
59
|
<Purpose>
|
|
55
|
-
Starts the Angular development server ("ng serve") as a background process. Follow this up with "devserver
|
|
60
|
+
Starts the Angular development server ("ng serve") as a background process. Follow this up with "devserver.wait_for_build" to wait until
|
|
56
61
|
the first build completes.
|
|
57
62
|
</Purpose>
|
|
58
63
|
<Use Cases>
|
|
59
64
|
* **Starting the Server:** Use this tool to begin serving the application. The tool will return immediately while the server runs in the
|
|
60
65
|
background.
|
|
61
|
-
* **Get Initial Build Logs:** Once a dev server has started, use the "devserver
|
|
62
|
-
build errors, "devserver
|
|
63
|
-
* **Get Updated Build Logs:** Important: as long as a devserver is alive (i.e. "devserver
|
|
64
|
-
change to the workspace, re-run "devserver
|
|
66
|
+
* **Get Initial Build Logs:** Once a dev server has started, use the "devserver.wait_for_build" tool to ensure it's alive. If there are any
|
|
67
|
+
build errors, "devserver.wait_for_build" would provide them back and you can give them to the user or rely on them to propose a fix.
|
|
68
|
+
* **Get Updated Build Logs:** Important: as long as a devserver is alive (i.e. "devserver.stop" wasn't called), after every time you make a
|
|
69
|
+
change to the workspace, re-run "devserver.wait_for_build" to see whether the change was successfully built and wait for the devserver to
|
|
65
70
|
be updated.
|
|
66
71
|
</Use Cases>
|
|
67
72
|
<Operational Notes>
|
|
68
73
|
* This tool manages development servers by itself. It maintains at most a single dev server instance for each project in the monorepo.
|
|
69
74
|
* This is an asynchronous operation. Subsequent commands can be ran while the server is active.
|
|
70
|
-
* Use 'devserver
|
|
75
|
+
* Use 'devserver.stop' to gracefully shut down the server and access the full log output.
|
|
71
76
|
</Operational Notes>
|
|
72
77
|
`,
|
|
73
78
|
isReadOnly: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devserver-start.js","sourceRoot":"","sources":["devserver-start.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAkCH,
|
|
1
|
+
{"version":3,"file":"devserver-start.js","sourceRoot":"","sources":["devserver-start.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAkCH,wCA4BC;AA5DD,6BAAwB;AACxB,+CAAiD;AACjD,uCAAmF;AACnF,oDAA6F;AAE7F,MAAM,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,4FAA4F,CAC7F;CACJ,CAAC,CAAC;AAIH,MAAM,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;IACjF,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,4FAA4F,CAC7F;CACJ,CAAC,CAAC;AAIH,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,oBAAoB,IAAI,GAAG,CAAC;AACrC,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,KAA8B,EAAE,OAAuB;IAC1F,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,IAAI,IAAA,6BAAqB,EAAC,OAAO,CAAC,CAAC;IAEpE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAA,qC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AAC,CAAC"}
|
|
@@ -17,6 +17,15 @@ declare const devserverStopToolOutputSchema: z.ZodObject<{
|
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
export type DevserverStopToolOutput = z.infer<typeof devserverStopToolOutputSchema>;
|
|
19
19
|
export declare function stopDevserver(input: DevserverStopToolInput, context: McpToolContext): {
|
|
20
|
+
content: {
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
}[];
|
|
24
|
+
structuredContent: {
|
|
25
|
+
message: string[];
|
|
26
|
+
logs: undefined;
|
|
27
|
+
};
|
|
28
|
+
} | {
|
|
20
29
|
content: {
|
|
21
30
|
type: "text";
|
|
22
31
|
text: string;
|