@angular/cli 21.1.0-next.1 → 21.1.0-next.2
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/lib/code-examples.db +0 -0
- package/package.json +16 -16
- package/src/commands/add/cli.js +129 -87
- package/src/commands/add/cli.js.map +1 -1
- package/src/commands/mcp/cli.js +4 -1
- package/src/commands/mcp/cli.js.map +1 -1
- package/src/commands/mcp/{dev-server.d.ts → devserver.d.ts} +4 -4
- package/src/commands/mcp/{dev-server.js → devserver.js} +14 -14
- package/src/commands/mcp/devserver.js.map +1 -0
- package/src/commands/mcp/mcp-server.d.ts +30 -0
- package/src/commands/mcp/mcp-server.js +22 -7
- package/src/commands/mcp/mcp-server.js.map +1 -1
- package/src/commands/mcp/tools/best-practices.js.map +1 -1
- package/src/commands/mcp/tools/build.js +2 -2
- package/src/commands/mcp/tools/build.js.map +1 -1
- package/src/commands/mcp/tools/devserver/{start-devserver.d.ts → devserver-start.d.ts} +6 -7
- package/src/commands/mcp/tools/devserver/{start-devserver.js → devserver-start.js} +26 -27
- package/src/commands/mcp/tools/devserver/devserver-start.js.map +1 -0
- package/src/commands/mcp/tools/devserver/{stop-devserver.d.ts → devserver-stop.d.ts} +6 -6
- package/src/commands/mcp/tools/devserver/{stop-devserver.js → devserver-stop.js} +13 -13
- package/src/commands/mcp/tools/devserver/{stop-devserver.js.map → devserver-stop.js.map} +1 -1
- package/src/commands/mcp/tools/devserver/{wait-for-devserver-build.d.ts → devserver-wait-for-build.d.ts} +6 -6
- package/src/commands/mcp/tools/devserver/{wait-for-devserver-build.js → devserver-wait-for-build.js} +16 -16
- package/src/commands/mcp/tools/devserver/{wait-for-devserver-build.js.map → devserver-wait-for-build.js.map} +1 -1
- package/src/commands/mcp/tools/modernize.js +1 -1
- package/src/commands/mcp/tools/modernize.js.map +1 -1
- package/src/commands/mcp/tools/tool-registry.d.ts +2 -2
- package/src/commands/mcp/tools/tool-registry.js.map +1 -1
- package/src/commands/update/cli.d.ts +0 -24
- package/src/commands/update/cli.js +39 -447
- package/src/commands/update/cli.js.map +1 -1
- package/src/commands/update/utilities/cli-version.d.ts +48 -0
- package/src/commands/update/utilities/cli-version.js +196 -0
- package/src/commands/update/utilities/cli-version.js.map +1 -0
- package/src/commands/update/utilities/constants.d.ts +12 -0
- package/src/commands/update/utilities/constants.js +16 -0
- package/src/commands/update/utilities/constants.js.map +1 -0
- package/src/commands/update/utilities/git.d.ts +34 -0
- package/src/commands/update/utilities/git.js +115 -0
- package/src/commands/update/utilities/git.js.map +1 -0
- package/src/commands/update/utilities/migration.d.ts +32 -0
- package/src/commands/update/utilities/migration.js +257 -0
- package/src/commands/update/utilities/migration.js.map +1 -0
- package/src/package-managers/error.d.ts +12 -0
- package/src/package-managers/host.js +7 -3
- package/src/package-managers/host.js.map +1 -1
- package/src/package-managers/package-manager-descriptor.d.ts +28 -4
- package/src/package-managers/package-manager-descriptor.js +24 -4
- package/src/package-managers/package-manager-descriptor.js.map +1 -1
- package/src/package-managers/package-manager.js +61 -7
- package/src/package-managers/package-manager.js.map +1 -1
- package/src/package-managers/parsers.d.ts +69 -4
- package/src/package-managers/parsers.js +231 -32
- package/src/package-managers/parsers.js.map +1 -1
- package/src/utilities/version.js +1 -1
- package/src/commands/mcp/dev-server.js.map +0 -1
- package/src/commands/mcp/tools/devserver/start-devserver.js.map +0 -1
|
@@ -8,6 +8,36 @@
|
|
|
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
|
+
};
|
|
11
41
|
/**
|
|
12
42
|
* The set of tools that are available but not enabled by default.
|
|
13
43
|
* These tools are considered experimental and may have limitations.
|
|
@@ -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.EXPERIMENTAL_TOOLS = void 0;
|
|
10
|
+
exports.EXPERIMENTAL_TOOLS = exports.EXPERIMENTAL_TOOL_GROUPS = void 0;
|
|
11
11
|
exports.createMcpServer = createMcpServer;
|
|
12
12
|
exports.assembleToolDeclarations = assembleToolDeclarations;
|
|
13
13
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
@@ -18,9 +18,9 @@ const instructions_1 = require("./resources/instructions");
|
|
|
18
18
|
const ai_tutor_1 = require("./tools/ai-tutor");
|
|
19
19
|
const best_practices_1 = require("./tools/best-practices");
|
|
20
20
|
const build_1 = require("./tools/build");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
21
|
+
const devserver_start_1 = require("./tools/devserver/devserver-start");
|
|
22
|
+
const devserver_stop_1 = require("./tools/devserver/devserver-stop");
|
|
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
25
|
const index_1 = require("./tools/examples/index");
|
|
26
26
|
const modernize_1 = require("./tools/modernize");
|
|
@@ -30,7 +30,15 @@ const tool_registry_1 = require("./tools/tool-registry");
|
|
|
30
30
|
/**
|
|
31
31
|
* Tools to manage devservers. Should be bundled together, then added to experimental or stable as a group.
|
|
32
32
|
*/
|
|
33
|
-
const
|
|
33
|
+
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
|
+
};
|
|
34
42
|
/**
|
|
35
43
|
* The set of tools that are enabled by default for the MCP server.
|
|
36
44
|
* These tools are considered stable and suitable for general use.
|
|
@@ -47,7 +55,7 @@ const STABLE_TOOLS = [
|
|
|
47
55
|
* The set of tools that are available but not enabled by default.
|
|
48
56
|
* These tools are considered experimental and may have limitations.
|
|
49
57
|
*/
|
|
50
|
-
exports.EXPERIMENTAL_TOOLS = [build_1.BUILD_TOOL, modernize_1.MODERNIZE_TOOL, ...
|
|
58
|
+
exports.EXPERIMENTAL_TOOLS = [build_1.BUILD_TOOL, modernize_1.MODERNIZE_TOOL, ...DEVSERVER_TOOLS];
|
|
51
59
|
async function createMcpServer(options, logger) {
|
|
52
60
|
const server = new mcp_js_1.McpServer({
|
|
53
61
|
name: 'angular-cli-server',
|
|
@@ -97,7 +105,7 @@ equivalent actions.
|
|
|
97
105
|
workspace: options.workspace,
|
|
98
106
|
logger,
|
|
99
107
|
exampleDatabasePath: (0, node_path_1.join)(__dirname, '../../../lib/code-examples.db'),
|
|
100
|
-
|
|
108
|
+
devservers: new Map(),
|
|
101
109
|
host: host_1.LocalWorkspaceHost,
|
|
102
110
|
}, toolDeclarations);
|
|
103
111
|
return server;
|
|
@@ -114,6 +122,13 @@ function assembleToolDeclarations(stableDeclarations, experimentalDeclarations,
|
|
|
114
122
|
if (process.env['NG_MCP_CODE_EXAMPLES'] === '1') {
|
|
115
123
|
enabledExperimentalTools.add('find_examples');
|
|
116
124
|
}
|
|
125
|
+
for (const [toolGroupName, toolGroup] of Object.entries(exports.EXPERIMENTAL_TOOL_GROUPS)) {
|
|
126
|
+
if (enabledExperimentalTools.delete(toolGroupName)) {
|
|
127
|
+
for (const tool of toolGroup) {
|
|
128
|
+
enabledExperimentalTools.add(tool.name);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
117
132
|
if (enabledExperimentalTools.size > 0) {
|
|
118
133
|
const experimentalToolsMap = new Map(experimentalDeclarations.map((tool) => [tool.name, tool]));
|
|
119
134
|
for (const toolName of enabledExperimentalTools) {
|
|
@@ -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;;;AAuDH,0CAwEC;AAED,4DA8CC;AA7KD,oEAAoE;AACpE,yCAAiC;AAEjC,qDAAkD;AAElD,iCAA4C;AAC5C,2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AAC;IAE1C,OAAO,KAAK,EAAE,KAAyB,EAAE,EAAE;QACzC,IAAI,OAA2B,CAAC;QAChC,IAAI,MAA0B,CAAC;QAE/B,gDAAgD;QAChD,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,eAAe,GAAG,MAAM,+BAA+B,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YAC3F,IAAI,eAAe,EAAE,CAAC;gBACpB,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC;gBAClC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;YAClC,CAAC;QACH,CAAC;QAED,gGAAgG;QAChG,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,GAAG,MAAM,CAAC,oBAAoB,KAAK,uBAAuB,EAAE,CAAC,CAAC;YACrE,MAAM,GAAG,iBAAiB,iBAAO,CAAC,IAAI,GAAG,CAAC;QAC5C,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE;wBACX,QAAQ,EAAE,CAAC,WAAoB,CAAC;wBAChC,QAAQ,EAAE,GAAG;wBACb,MAAM;qBACP;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -82,7 +82,7 @@ Perform a one-off, non-watched build using "ng build". Use this tool whenever th
|
|
|
82
82
|
</Use Cases>
|
|
83
83
|
<Operational Notes>
|
|
84
84
|
* 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 "
|
|
85
|
+
* If you want a watched build which updates as files are changed, use "devserver/start" instead, which also serves the app.
|
|
86
86
|
* 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
87
|
* This tool defaults to a development environment while a regular "ng build" defaults to a production environment. An unexpected build
|
|
88
88
|
failure might suggest the project is not configured for the requested environment.
|
|
@@ -92,6 +92,6 @@ Perform a one-off, non-watched build using "ng build". Use this tool whenever th
|
|
|
92
92
|
isLocalOnly: true,
|
|
93
93
|
inputSchema: buildToolInputSchema.shape,
|
|
94
94
|
outputSchema: buildToolOutputSchema.shape,
|
|
95
|
-
factory: () => (input) => runBuild(input,
|
|
95
|
+
factory: (context) => (input) => runBuild(input, context.host),
|
|
96
96
|
});
|
|
97
97
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmCH,4BAwCC;AAzED,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmCH,4BAwCC;AAzED,6BAAwB;AACxB,kCAAkD;AAClD,oCAAyD;AACzD,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,C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AM,iBAAiB,GAAoB;QACzC,MAAM;QACN,IAAI;QACJ,IAAI,EAAE,UAAU;KACjB,CAAC;IAEF,OAAO,IAAA,qCAA6B,EAAC,iBAAiB,CAAC,CAAC;AAC1D,CAAC;AAEY,QAAA,UAAU,GAGnB,IAAA,2BAAW,EAAC;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,YAAY;IACnB,WAAW,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"}
|
|
@@ -6,18 +6,17 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { type Host } from '../../host';
|
|
10
9
|
import { type McpToolContext, type McpToolDeclaration } from '../tool-registry';
|
|
11
|
-
declare const
|
|
10
|
+
declare const devserverStartToolInputSchema: z.ZodObject<{
|
|
12
11
|
project: z.ZodOptional<z.ZodString>;
|
|
13
12
|
}, z.core.$strip>;
|
|
14
|
-
export type
|
|
15
|
-
declare const
|
|
13
|
+
export type DevserverStartToolInput = z.infer<typeof devserverStartToolInputSchema>;
|
|
14
|
+
declare const devserverStartToolOutputSchema: z.ZodObject<{
|
|
16
15
|
message: z.ZodString;
|
|
17
16
|
address: z.ZodOptional<z.ZodString>;
|
|
18
17
|
}, z.core.$strip>;
|
|
19
|
-
export type
|
|
20
|
-
export declare function
|
|
18
|
+
export type DevserverStartToolOutput = z.infer<typeof devserverStartToolOutputSchema>;
|
|
19
|
+
export declare function startDevserver(input: DevserverStartToolInput, context: McpToolContext): Promise<{
|
|
21
20
|
content: {
|
|
22
21
|
type: "text";
|
|
23
22
|
text: string;
|
|
@@ -27,5 +26,5 @@ export declare function startDevServer(input: StartDevserverToolInput, context:
|
|
|
27
26
|
address: string;
|
|
28
27
|
};
|
|
29
28
|
}>;
|
|
30
|
-
export declare const
|
|
29
|
+
export declare const DEVSERVER_START_TOOL: McpToolDeclaration<typeof devserverStartToolInputSchema.shape, typeof devserverStartToolOutputSchema.shape>;
|
|
31
30
|
export {};
|
|
@@ -7,20 +7,19 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
10
|
+
exports.DEVSERVER_START_TOOL = void 0;
|
|
11
|
+
exports.startDevserver = startDevserver;
|
|
12
12
|
const zod_1 = require("zod");
|
|
13
|
-
const
|
|
14
|
-
const host_1 = require("../../host");
|
|
13
|
+
const devserver_1 = require("../../devserver");
|
|
15
14
|
const utils_1 = require("../../utils");
|
|
16
15
|
const tool_registry_1 = require("../tool-registry");
|
|
17
|
-
const
|
|
16
|
+
const devserverStartToolInputSchema = zod_1.z.object({
|
|
18
17
|
project: zod_1.z
|
|
19
18
|
.string()
|
|
20
19
|
.optional()
|
|
21
20
|
.describe('Which project to serve in a monorepo context. If not provided, serves the default project.'),
|
|
22
21
|
});
|
|
23
|
-
const
|
|
22
|
+
const devserverStartToolOutputSchema = zod_1.z.object({
|
|
24
23
|
message: zod_1.z.string().describe('A message indicating the result of the operation.'),
|
|
25
24
|
address: zod_1.z
|
|
26
25
|
.string()
|
|
@@ -30,53 +29,53 @@ const startDevServerToolOutputSchema = zod_1.z.object({
|
|
|
30
29
|
function localhostAddress(port) {
|
|
31
30
|
return `http://localhost:${port}/`;
|
|
32
31
|
}
|
|
33
|
-
async function
|
|
34
|
-
const projectKey = (0,
|
|
35
|
-
let
|
|
36
|
-
if (
|
|
32
|
+
async function startDevserver(input, context) {
|
|
33
|
+
const projectKey = (0, devserver_1.devserverKey)(input.project);
|
|
34
|
+
let devserver = context.devservers.get(projectKey);
|
|
35
|
+
if (devserver) {
|
|
37
36
|
return (0, utils_1.createStructuredContentOutput)({
|
|
38
37
|
message: `Development server for project '${projectKey}' is already running.`,
|
|
39
|
-
address: localhostAddress(
|
|
38
|
+
address: localhostAddress(devserver.port),
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
|
-
const port = await host.getAvailablePort();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
context.
|
|
41
|
+
const port = await context.host.getAvailablePort();
|
|
42
|
+
devserver = new devserver_1.LocalDevserver({ host: context.host, project: input.project, port });
|
|
43
|
+
devserver.start();
|
|
44
|
+
context.devservers.set(projectKey, devserver);
|
|
46
45
|
return (0, utils_1.createStructuredContentOutput)({
|
|
47
46
|
message: `Development server for project '${projectKey}' started and watching for workspace changes.`,
|
|
48
47
|
address: localhostAddress(port),
|
|
49
48
|
});
|
|
50
49
|
}
|
|
51
|
-
exports.
|
|
52
|
-
name: '
|
|
50
|
+
exports.DEVSERVER_START_TOOL = (0, tool_registry_1.declareTool)({
|
|
51
|
+
name: 'devserver/start',
|
|
53
52
|
title: 'Start Development Server',
|
|
54
53
|
description: `
|
|
55
54
|
<Purpose>
|
|
56
|
-
Starts the Angular development server ("ng serve") as a background process. Follow this up with "
|
|
55
|
+
Starts the Angular development server ("ng serve") as a background process. Follow this up with "devserver/wait_for_build" to wait until
|
|
57
56
|
the first build completes.
|
|
58
57
|
</Purpose>
|
|
59
58
|
<Use Cases>
|
|
60
59
|
* **Starting the Server:** Use this tool to begin serving the application. The tool will return immediately while the server runs in the
|
|
61
60
|
background.
|
|
62
|
-
* **Get Initial Build Logs:** Once a dev server has started, use the "
|
|
63
|
-
build errors, "
|
|
64
|
-
* **Get Updated Build Logs:** Important: as long as a devserver is alive (i.e. "
|
|
65
|
-
change to the workspace, re-run "
|
|
61
|
+
* **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
|
|
62
|
+
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.
|
|
63
|
+
* **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
|
|
64
|
+
change to the workspace, re-run "devserver/wait_for_build" to see whether the change was successfully built and wait for the devserver to
|
|
66
65
|
be updated.
|
|
67
66
|
</Use Cases>
|
|
68
67
|
<Operational Notes>
|
|
69
68
|
* This tool manages development servers by itself. It maintains at most a single dev server instance for each project in the monorepo.
|
|
70
69
|
* This is an asynchronous operation. Subsequent commands can be ran while the server is active.
|
|
71
|
-
* Use '
|
|
70
|
+
* Use 'devserver/stop' to gracefully shut down the server and access the full log output.
|
|
72
71
|
</Operational Notes>
|
|
73
72
|
`,
|
|
74
73
|
isReadOnly: true,
|
|
75
74
|
isLocalOnly: true,
|
|
76
|
-
inputSchema:
|
|
77
|
-
outputSchema:
|
|
75
|
+
inputSchema: devserverStartToolInputSchema.shape,
|
|
76
|
+
outputSchema: devserverStartToolOutputSchema.shape,
|
|
78
77
|
factory: (context) => (input) => {
|
|
79
|
-
return
|
|
78
|
+
return startDevserver(input, context);
|
|
80
79
|
},
|
|
81
80
|
});
|
|
82
|
-
//# sourceMappingURL=start
|
|
81
|
+
//# sourceMappingURL=devserver-start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devserver-start.js","sourceRoot":"","sources":["devserver-start.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAkCH,wCAsBC;AAtDD,6BAAwB;AACxB,+CAA+D;AAC/D,uCAA4D;AAC5D,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,CA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A0B;IACjC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;CAmBd;IACC,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,6BAA6B,CAAC,KAAK;IAChD,YAAY,EAAE,8BAA8B,CAAC,KAAK;IAClD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,OAAO,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { type McpToolContext, type McpToolDeclaration } from '../tool-registry';
|
|
10
|
-
declare const
|
|
10
|
+
declare const devserverStopToolInputSchema: z.ZodObject<{
|
|
11
11
|
project: z.ZodOptional<z.ZodString>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
-
export type
|
|
14
|
-
declare const
|
|
13
|
+
export type DevserverStopToolInput = z.infer<typeof devserverStopToolInputSchema>;
|
|
14
|
+
declare const devserverStopToolOutputSchema: z.ZodObject<{
|
|
15
15
|
message: z.ZodString;
|
|
16
16
|
logs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
17
|
}, z.core.$strip>;
|
|
18
|
-
export type
|
|
19
|
-
export declare function stopDevserver(input:
|
|
18
|
+
export type DevserverStopToolOutput = z.infer<typeof devserverStopToolOutputSchema>;
|
|
19
|
+
export declare function stopDevserver(input: DevserverStopToolInput, context: McpToolContext): {
|
|
20
20
|
content: {
|
|
21
21
|
type: "text";
|
|
22
22
|
text: string;
|
|
@@ -35,5 +35,5 @@ export declare function stopDevserver(input: StopDevserverToolInput, context: Mc
|
|
|
35
35
|
logs: string[];
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
export declare const
|
|
38
|
+
export declare const DEVSERVER_STOP_TOOL: McpToolDeclaration<typeof devserverStopToolInputSchema.shape, typeof devserverStopToolOutputSchema.shape>;
|
|
39
39
|
export {};
|
|
@@ -7,25 +7,25 @@
|
|
|
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.DEVSERVER_STOP_TOOL = void 0;
|
|
11
11
|
exports.stopDevserver = stopDevserver;
|
|
12
12
|
const zod_1 = require("zod");
|
|
13
|
-
const
|
|
13
|
+
const devserver_1 = require("../../devserver");
|
|
14
14
|
const utils_1 = require("../../utils");
|
|
15
15
|
const tool_registry_1 = require("../tool-registry");
|
|
16
|
-
const
|
|
16
|
+
const devserverStopToolInputSchema = zod_1.z.object({
|
|
17
17
|
project: zod_1.z
|
|
18
18
|
.string()
|
|
19
19
|
.optional()
|
|
20
20
|
.describe('Which project to stop serving in a monorepo context. If not provided, stops the default project server.'),
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const devserverStopToolOutputSchema = zod_1.z.object({
|
|
23
23
|
message: zod_1.z.string().describe('A message indicating the result of the operation.'),
|
|
24
24
|
logs: zod_1.z.array(zod_1.z.string()).optional().describe('The full logs from the dev server.'),
|
|
25
25
|
});
|
|
26
26
|
function stopDevserver(input, context) {
|
|
27
|
-
const projectKey = (0,
|
|
28
|
-
const devServer = context.
|
|
27
|
+
const projectKey = (0, devserver_1.devserverKey)(input.project);
|
|
28
|
+
const devServer = context.devservers.get(projectKey);
|
|
29
29
|
if (!devServer) {
|
|
30
30
|
return (0, utils_1.createStructuredContentOutput)({
|
|
31
31
|
message: `Development server for project '${projectKey}' was not running.`,
|
|
@@ -33,18 +33,18 @@ function stopDevserver(input, context) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
devServer.stop();
|
|
36
|
-
context.
|
|
36
|
+
context.devservers.delete(projectKey);
|
|
37
37
|
return (0, utils_1.createStructuredContentOutput)({
|
|
38
38
|
message: `Development server for project '${projectKey}' stopped.`,
|
|
39
39
|
logs: devServer.getServerLogs(),
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
exports.
|
|
43
|
-
name: '
|
|
42
|
+
exports.DEVSERVER_STOP_TOOL = (0, tool_registry_1.declareTool)({
|
|
43
|
+
name: 'devserver/stop',
|
|
44
44
|
title: 'Stop Development Server',
|
|
45
45
|
description: `
|
|
46
46
|
<Purpose>
|
|
47
|
-
Stops a running Angular development server ("ng serve") that was started with the "
|
|
47
|
+
Stops a running Angular development server ("ng serve") that was started with the "devserver/start" tool.
|
|
48
48
|
</Purpose>
|
|
49
49
|
<Use Cases>
|
|
50
50
|
* **Stopping the Server:** Use this tool to terminate a running development server and retrieve the logs.
|
|
@@ -57,10 +57,10 @@ Stops a running Angular development server ("ng serve") that was started with th
|
|
|
57
57
|
`,
|
|
58
58
|
isReadOnly: true,
|
|
59
59
|
isLocalOnly: true,
|
|
60
|
-
inputSchema:
|
|
61
|
-
outputSchema:
|
|
60
|
+
inputSchema: devserverStopToolInputSchema.shape,
|
|
61
|
+
outputSchema: devserverStopToolOutputSchema.shape,
|
|
62
62
|
factory: (context) => (input) => {
|
|
63
63
|
return stopDevserver(input, context);
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
|
-
//# sourceMappingURL=stop
|
|
66
|
+
//# sourceMappingURL=devserver-stop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop
|
|
1
|
+
{"version":3,"file":"devserver-stop.js","sourceRoot":"","sources":["devserver-stop.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAyBH,sCAkBC;AAzCD,6BAAwB;AACxB,+CAA+C;AAC/C,uCAA4D;AAC5D,oDAA6F;AAE7F,MAAM,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yGAAyG,CAC1G;CACJ,CAAC,CAAC;AAIH,MAAM,6BAA6B,GAAG,OAAC,CAAC,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CACF,CAAC,CAAC"}
|
|
@@ -11,12 +11,12 @@ import { type McpToolContext, type McpToolDeclaration } from '../tool-registry';
|
|
|
11
11
|
* How long to wait to give "ng serve" time to identify whether the watched workspace has changed.
|
|
12
12
|
*/
|
|
13
13
|
export declare const WATCH_DELAY = 1000;
|
|
14
|
-
declare const
|
|
14
|
+
declare const devserverWaitForBuildToolInputSchema: z.ZodObject<{
|
|
15
15
|
project: z.ZodOptional<z.ZodString>;
|
|
16
16
|
timeout: z.ZodDefault<z.ZodNumber>;
|
|
17
17
|
}, z.core.$strip>;
|
|
18
|
-
export type
|
|
19
|
-
declare const
|
|
18
|
+
export type DevserverWaitForBuildToolInput = z.infer<typeof devserverWaitForBuildToolInputSchema>;
|
|
19
|
+
declare const devserverWaitForBuildToolOutputSchema: z.ZodObject<{
|
|
20
20
|
status: z.ZodEnum<{
|
|
21
21
|
success: "success";
|
|
22
22
|
timeout: "timeout";
|
|
@@ -26,8 +26,8 @@ declare const waitForDevserverBuildToolOutputSchema: z.ZodObject<{
|
|
|
26
26
|
}>;
|
|
27
27
|
logs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
|
-
export type
|
|
30
|
-
export declare function waitForDevserverBuild(input:
|
|
29
|
+
export type DevserverWaitForBuildToolOutput = z.infer<typeof devserverWaitForBuildToolOutputSchema>;
|
|
30
|
+
export declare function waitForDevserverBuild(input: DevserverWaitForBuildToolInput, context: McpToolContext): Promise<{
|
|
31
31
|
content: {
|
|
32
32
|
type: "text";
|
|
33
33
|
text: string;
|
|
@@ -37,5 +37,5 @@ export declare function waitForDevserverBuild(input: WaitForDevserverBuildToolIn
|
|
|
37
37
|
logs?: string[] | undefined;
|
|
38
38
|
};
|
|
39
39
|
}>;
|
|
40
|
-
export declare const
|
|
40
|
+
export declare const DEVSERVER_WAIT_FOR_BUILD_TOOL: McpToolDeclaration<typeof devserverWaitForBuildToolInputSchema.shape, typeof devserverWaitForBuildToolOutputSchema.shape>;
|
|
41
41
|
export {};
|
package/src/commands/mcp/tools/devserver/{wait-for-devserver-build.js → devserver-wait-for-build.js}
RENAMED
|
@@ -7,10 +7,10 @@
|
|
|
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.DEVSERVER_WAIT_FOR_BUILD_TOOL = exports.WATCH_DELAY = void 0;
|
|
11
11
|
exports.waitForDevserverBuild = waitForDevserverBuild;
|
|
12
12
|
const zod_1 = require("zod");
|
|
13
|
-
const
|
|
13
|
+
const devserver_1 = require("../../devserver");
|
|
14
14
|
const utils_1 = require("../../utils");
|
|
15
15
|
const tool_registry_1 = require("../tool-registry");
|
|
16
16
|
/**
|
|
@@ -21,7 +21,7 @@ exports.WATCH_DELAY = 1000;
|
|
|
21
21
|
* Default timeout for waiting for the build to complete.
|
|
22
22
|
*/
|
|
23
23
|
const DEFAULT_TIMEOUT = 180_000; // In milliseconds
|
|
24
|
-
const
|
|
24
|
+
const devserverWaitForBuildToolInputSchema = zod_1.z.object({
|
|
25
25
|
project: zod_1.z
|
|
26
26
|
.string()
|
|
27
27
|
.optional()
|
|
@@ -31,7 +31,7 @@ const waitForDevserverBuildToolInputSchema = zod_1.z.object({
|
|
|
31
31
|
.default(DEFAULT_TIMEOUT)
|
|
32
32
|
.describe(`The maximum time to wait for the build to complete, in milliseconds. This can't be lower than ${exports.WATCH_DELAY}.`),
|
|
33
33
|
});
|
|
34
|
-
const
|
|
34
|
+
const devserverWaitForBuildToolOutputSchema = zod_1.z.object({
|
|
35
35
|
status: zod_1.z
|
|
36
36
|
.enum(['success', 'failure', 'unknown', 'timeout', 'no_devserver_found'])
|
|
37
37
|
.describe("The status of the build if it's complete, or a status indicating why the wait operation failed."),
|
|
@@ -44,8 +44,8 @@ function wait(ms) {
|
|
|
44
44
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
45
45
|
}
|
|
46
46
|
async function waitForDevserverBuild(input, context) {
|
|
47
|
-
const projectKey = (0,
|
|
48
|
-
const devServer = context.
|
|
47
|
+
const projectKey = (0, devserver_1.devserverKey)(input.project);
|
|
48
|
+
const devServer = context.devservers.get(projectKey);
|
|
49
49
|
const deadline = Date.now() + input.timeout;
|
|
50
50
|
if (!devServer) {
|
|
51
51
|
return (0, utils_1.createStructuredContentOutput)({
|
|
@@ -65,36 +65,36 @@ async function waitForDevserverBuild(input, context) {
|
|
|
65
65
|
...devServer.getMostRecentBuild(),
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
exports.
|
|
69
|
-
name: '
|
|
68
|
+
exports.DEVSERVER_WAIT_FOR_BUILD_TOOL = (0, tool_registry_1.declareTool)({
|
|
69
|
+
name: 'devserver/wait_for_build',
|
|
70
70
|
title: 'Wait for Devserver Build',
|
|
71
71
|
description: `
|
|
72
72
|
<Purpose>
|
|
73
|
-
Waits for a dev server that was started with the "
|
|
73
|
+
Waits for a dev server that was started with the "devserver/start" tool to complete its build, then reports the build logs from its most
|
|
74
74
|
recent build.
|
|
75
75
|
</Purpose>
|
|
76
76
|
<Use Cases>
|
|
77
|
-
* **Waiting for a build:** As long as a devserver is alive ("
|
|
77
|
+
* **Waiting for a build:** As long as a devserver is alive ("devserver/start" was called for this project and "devserver_stop" wasn't
|
|
78
78
|
called yet), then if you're making a file change and want to ensure it was successfully built, call this tool instead of any other build
|
|
79
79
|
tool or command. When it retuns you'll get build logs back **and** you'll know the user's devserver is up-to-date with the latest changes.
|
|
80
80
|
</Use Cases>
|
|
81
81
|
<Operational Notes>
|
|
82
|
-
* This tool expects that a dev server was launched on the same project with the "
|
|
82
|
+
* This tool expects that a dev server was launched on the same project with the "devserver/start" tool, otherwise a "no_devserver_found"
|
|
83
83
|
status will be returned.
|
|
84
84
|
* This tool will block until the build is complete or the timeout is reached. If you expect a long build process, consider increasing the
|
|
85
|
-
timeout. Timeouts on initial run (right after "
|
|
85
|
+
timeout. Timeouts on initial run (right after "devserver/start" calls) or after a big change are not necessarily indicative of an error.
|
|
86
86
|
* If you encountered a timeout and it might be reasonable, just call this tool again.
|
|
87
87
|
* If the dev server is not building, it will return quickly, with the logs from the last build.
|
|
88
|
-
* A 'no_devserver_found' status can indicate the underlying server was stopped for some reason. Try first to call the "
|
|
88
|
+
* A 'no_devserver_found' status can indicate the underlying server was stopped for some reason. Try first to call the "devserver/start"
|
|
89
89
|
tool again, before giving up.
|
|
90
90
|
</Operational Notes>
|
|
91
91
|
`,
|
|
92
92
|
isReadOnly: true,
|
|
93
93
|
isLocalOnly: true,
|
|
94
|
-
inputSchema:
|
|
95
|
-
outputSchema:
|
|
94
|
+
inputSchema: devserverWaitForBuildToolInputSchema.shape,
|
|
95
|
+
outputSchema: devserverWaitForBuildToolOutputSchema.shape,
|
|
96
96
|
factory: (context) => (input) => {
|
|
97
97
|
return waitForDevserverBuild(input, context);
|
|
98
98
|
},
|
|
99
99
|
});
|
|
100
|
-
//# sourceMappingURL=wait-for-
|
|
100
|
+
//# sourceMappingURL=devserver-wait-for-build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-
|
|
1
|
+
{"version":3,"file":"devserver-wait-for-build.js","sourceRoot":"","sources":["devserver-wait-for-build.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAoDH,sDA2BC;AA7ED,6BAAwB;AACxB,+CAA+C;AAC/C,uCAA4D;AAC5D,oDAA6F;AAE7F;;GAEG;AACU,QAAA,WAAW,GAAG,IAAI,CAAC;AAEhC;;GAEG;AACH,MAAM,eAAe,GAAG,OAAO,CAAC,CAAC,kBAAkB;AAEnD,MAAM,oCAAoC,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yGAAyG,CAC1G;IACH,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,OAAO,CAAC,eAAe,CAAC;SACxB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W,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,IAAA,qCAA6B,EAAkC;QACpE,GAAG,SAAS,CAAC,kBAAkB,EAAE;KAClC,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,6BAA6B,GAGtC,IAAA,2BAAW,EAAC;IACd,IAAI,EAAE,0BAA0B;IAChC,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;CAoBd;IACC,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,oCAAoC,CAAC,KAAK;IACvD,YAAY,EAAE,qCAAqC,CAAC,KAAK;IACzD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,OAAO,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -173,6 +173,6 @@ ${TRANSFORMATIONS.map((t) => ` * ${t.name}: ${t.description}`).join('\n')}
|
|
|
173
173
|
outputSchema: modernizeOutputSchema.shape,
|
|
174
174
|
isLocalOnly: true,
|
|
175
175
|
isReadOnly: false,
|
|
176
|
-
factory: () => (input) => runModernization(input,
|
|
176
|
+
factory: (context) => (input) => runModernization(input, context.host),
|
|
177
177
|
});
|
|
178
178
|
//# sourceMappingURL=modernize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modernize.js","sourceRoot":"","sources":["modernize.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAyFH,4CA2EC;AAlKD,+BAA+C;AAC/C,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"modernize.js","sourceRoot":"","sources":["modernize.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAyFH,4CA2EC;AAlKD,+BAA+C;AAC/C,6BAAwB;AACxB,kCAAkD;AAClD,oCAA6E;AAC7E,mDAAuE;AASvE,MAAM,eAAe,GAA0B;IAC7C;QACE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ChB,CAAC;oBACD,IAAI,CAAC,IAAI,CAAE,CAAW,CAAC,OAAO,CAAC,CAAC;oBAChC,YAAY,CAAC,IAAI,CACf,aAAa,cAAc,CAAC,IAAI,iBAAiB,YAAY,UAAU,CACxE,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAA,qCAA6B,EAAC;QACnC,YAAY,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;QAChE,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,cAAc,GAGvB,IAAA,2BAAW,EAAC;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;EAuBb,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;qBACrD;IACnB,WAAW,EAAE,oBAAoB,CAAC,KAAK;IACvC,YAAY,EAAE,qBAAqB,CAAC,KAAK;IACzC,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC;CACvE,CAAC,CAAC"}
|
|
@@ -9,7 +9,7 @@ import type { McpServer, ToolCallback } from '@modelcontextprotocol/sdk/server/m
|
|
|
9
9
|
import type { ToolAnnotations } from '@modelcontextprotocol/sdk/types';
|
|
10
10
|
import type { ZodRawShape } from 'zod';
|
|
11
11
|
import type { AngularWorkspace } from '../../../utilities/config';
|
|
12
|
-
import type {
|
|
12
|
+
import type { Devserver } from '../devserver';
|
|
13
13
|
import type { Host } from '../host';
|
|
14
14
|
export interface McpToolContext {
|
|
15
15
|
server: McpServer;
|
|
@@ -18,7 +18,7 @@ export interface McpToolContext {
|
|
|
18
18
|
warn(text: string): void;
|
|
19
19
|
};
|
|
20
20
|
exampleDatabasePath?: string;
|
|
21
|
-
|
|
21
|
+
devservers: Map<string, Devserver>;
|
|
22
22
|
host: Host;
|
|
23
23
|
}
|
|
24
24
|
export type McpToolFactory<TInput extends ZodRawShape> = (context: McpToolContext) => ToolCallback<TInput> | Promise<ToolCallback<TInput>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["tool-registry.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;
|
|
1
|
+
{"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["tool-registry.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAwCH,kCAIC;AAED,sCA2BC;AAjCD,SAAgB,WAAW,CACzB,WAAgD;IAEhD,OAAO,WAAW,CAAC;AACrB,CAAC;AAEM,KAAK,UAAU,aAAa,CACjC,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"}
|