@azure-devops/mcp 2.10.0-nightly.20260909 → 2.10.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/dist/auth.js +0 -0
- package/dist/index.js +0 -0
- package/dist/logger.js +0 -0
- package/dist/org-tenants.js +0 -0
- package/dist/prompts.js +0 -0
- package/dist/shared/command.js +34 -0
- package/dist/tools.js +0 -0
- package/dist/useragent.js +0 -0
- package/dist/utils.js +0 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/logger.js
CHANGED
|
File without changes
|
package/dist/org-tenants.js
CHANGED
|
File without changes
|
package/dist/prompts.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/** Builds an error `CallToolResult`. */
|
|
4
|
+
export const errorResult = (text) => ({ content: [{ type: "text", text }], isError: true });
|
|
5
|
+
/**
|
|
6
|
+
* Routes a validated, action-carrying args object to the matching command.
|
|
7
|
+
*
|
|
8
|
+
* This is what removes long positional parameter lists from grouped ("action")
|
|
9
|
+
* tools: instead of destructuring every possible field, the whole typed args
|
|
10
|
+
* object is forwarded to the single command keyed by `args.action`, coupling
|
|
11
|
+
* each action to exactly one command.
|
|
12
|
+
*
|
|
13
|
+
* - Unknown actions short-circuit with an "Unknown action" error and never
|
|
14
|
+
* touch the context (so no connection is opened).
|
|
15
|
+
* - Errors thrown by a command are caught and formatted using the optional
|
|
16
|
+
* per-action `errorPrefixes` map (falling back to a generic message).
|
|
17
|
+
* - Errors returned by a command (e.g. validation `errorResult`s) pass through
|
|
18
|
+
* unchanged.
|
|
19
|
+
*/
|
|
20
|
+
export async function dispatchAction(commands, context, args, errorPrefixes) {
|
|
21
|
+
const command = commands[args.action];
|
|
22
|
+
if (!command) {
|
|
23
|
+
const supportedActions = Object.keys(commands).sort().join(", ");
|
|
24
|
+
return errorResult(`Unknown action: ${args.action}. Supported actions: ${supportedActions}`);
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
return await command.execute(context, args);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
const message = error instanceof Error ? error.message : "Unknown error occurred";
|
|
31
|
+
const prefix = errorPrefixes?.[args.action];
|
|
32
|
+
return errorResult(prefix ? `${prefix}${message}` : `Error: ${message}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
package/dist/tools.js
CHANGED
|
File without changes
|
package/dist/useragent.js
CHANGED
|
File without changes
|
package/dist/utils.js
CHANGED
|
File without changes
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.10.0
|
|
1
|
+
export const packageVersion = "2.10.0";
|