@vm3jack/mcp-server-azure-devops 1.0.0 → 1.0.3
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/extension.d.ts +3 -0
- package/dist/extension.js +93 -0
- package/dist/extension.js.map +1 -0
- package/dist/features/pull-requests/schemas.d.ts +2 -2
- package/dist/features/work-items/schemas.d.ts +4 -4
- package/dist/index.js +127504 -83
- package/dist/setup.d.ts +6 -0
- package/dist/setup.js +124 -0
- package/dist/setup.js.map +1 -0
- package/package.json +56 -3
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.activate = activate;
|
|
37
|
+
exports.deactivate = deactivate;
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const vscode = __importStar(require("vscode"));
|
|
40
|
+
function activate(context) {
|
|
41
|
+
const emitter = new vscode.EventEmitter();
|
|
42
|
+
context.subscriptions.push(vscode.lm.registerMcpServerDefinitionProvider('azure-devops', {
|
|
43
|
+
onDidChangeMcpServerDefinitions: emitter.event,
|
|
44
|
+
provideMcpServerDefinitions() {
|
|
45
|
+
const cfg = vscode.workspace.getConfiguration('azureDevOps');
|
|
46
|
+
const organizationUrl = cfg.get('organizationUrl', '');
|
|
47
|
+
const authMethod = cfg.get('authMethod', 'pat');
|
|
48
|
+
const personalAccessToken = cfg.get('personalAccessToken', '');
|
|
49
|
+
const defaultProject = cfg.get('defaultProject', '');
|
|
50
|
+
const rejectUnauthorized = cfg.get('rejectUnauthorized', true);
|
|
51
|
+
if (!organizationUrl) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
if (authMethod === 'pat' && !personalAccessToken) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
const serverPath = context.asAbsolutePath(path.join('dist', 'index.js'));
|
|
58
|
+
const env = {
|
|
59
|
+
AZURE_DEVOPS_ORG_URL: organizationUrl,
|
|
60
|
+
AZURE_DEVOPS_AUTH_METHOD: authMethod,
|
|
61
|
+
};
|
|
62
|
+
if (personalAccessToken)
|
|
63
|
+
env.AZURE_DEVOPS_PAT = personalAccessToken;
|
|
64
|
+
if (defaultProject)
|
|
65
|
+
env.AZURE_DEVOPS_DEFAULT_PROJECT = defaultProject;
|
|
66
|
+
if (!rejectUnauthorized)
|
|
67
|
+
env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
68
|
+
return [
|
|
69
|
+
new vscode.McpStdioServerDefinition('Azure DevOps', process.execPath, [serverPath], env),
|
|
70
|
+
];
|
|
71
|
+
},
|
|
72
|
+
}));
|
|
73
|
+
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => {
|
|
74
|
+
if (e.affectsConfiguration('azureDevOps')) {
|
|
75
|
+
emitter.fire();
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
context.subscriptions.push(vscode.commands.registerCommand('azureDevOps.updateCredentials', async () => {
|
|
79
|
+
const cfg = vscode.workspace.getConfiguration('azureDevOps');
|
|
80
|
+
const pat = await vscode.window.showInputBox({
|
|
81
|
+
title: 'Azure DevOps: Update PAT',
|
|
82
|
+
prompt: 'Enter Personal Access Token',
|
|
83
|
+
password: true,
|
|
84
|
+
});
|
|
85
|
+
if (pat === undefined)
|
|
86
|
+
return;
|
|
87
|
+
await cfg.update('personalAccessToken', pat, vscode.ConfigurationTarget.Global);
|
|
88
|
+
vscode.window.showInformationMessage('Azure DevOps PAT updated.');
|
|
89
|
+
}));
|
|
90
|
+
context.subscriptions.push(emitter);
|
|
91
|
+
}
|
|
92
|
+
function deactivate() { }
|
|
93
|
+
//# sourceMappingURL=extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,4BAmEC;AAED,gCAAqC;AAxErC,2CAA6B;AAC7B,+CAAiC;AAEjC,SAAgB,QAAQ,CAAC,OAAgC;IACvD,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,YAAY,EAAQ,CAAC;IAEhD,OAAO,CAAC,aAAa,CAAC,IAAI,CACxB,MAAM,CAAC,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,QAAQ,EAChB,CAAC,UAAU,CAAC,EACZ,GAAG,CACJ;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CACH,CAAC;IAEF,OAAO,CAAC,aAAa,CAAC,IAAI,CACxB,MAAM,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE;QAC5C,IAAI,CAAC,CAAC,oBAAoB,CAAC,aAAa,CAAC,EAAE,CAAC;YAC1C,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,CAAC,aAAa,CAAC,IAAI,CACxB,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAE7D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YAC3C,KAAK,EAAE,0BAA0B;YACjC,MAAM,EAAE,6BAA6B;YACrC,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,IAAI,GAAG,KAAK,SAAS;YAAE,OAAO;QAE9B,MAAM,GAAG,CAAC,MAAM,CAAC,qBAAqB,EAAE,GAAG,EAAE,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAChF,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,2BAA2B,CAAC,CAAC;IACpE,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,UAAU,KAAU,CAAC"}
|
|
@@ -204,10 +204,10 @@ export declare const UpdatePullRequestSchema: z.ZodObject<{
|
|
|
204
204
|
}, "strip", z.ZodTypeAny, {
|
|
205
205
|
repositoryId: string;
|
|
206
206
|
pullRequestId: number;
|
|
207
|
+
title?: string | undefined;
|
|
207
208
|
status?: "active" | "completed" | "abandoned" | undefined;
|
|
208
209
|
projectId?: string | undefined;
|
|
209
210
|
organizationId?: string | undefined;
|
|
210
|
-
title?: string | undefined;
|
|
211
211
|
description?: string | undefined;
|
|
212
212
|
isDraft?: boolean | undefined;
|
|
213
213
|
additionalProperties?: Record<string, any> | undefined;
|
|
@@ -220,10 +220,10 @@ export declare const UpdatePullRequestSchema: z.ZodObject<{
|
|
|
220
220
|
}, {
|
|
221
221
|
repositoryId: string;
|
|
222
222
|
pullRequestId: number;
|
|
223
|
+
title?: string | undefined;
|
|
223
224
|
status?: "active" | "completed" | "abandoned" | undefined;
|
|
224
225
|
projectId?: string | undefined;
|
|
225
226
|
organizationId?: string | undefined;
|
|
226
|
-
title?: string | undefined;
|
|
227
227
|
description?: string | undefined;
|
|
228
228
|
isDraft?: boolean | undefined;
|
|
229
229
|
additionalProperties?: Record<string, any> | undefined;
|
|
@@ -56,8 +56,8 @@ export declare const CreateWorkItemSchema: z.ZodObject<{
|
|
|
56
56
|
parentId: z.ZodOptional<z.ZodNumber>;
|
|
57
57
|
additionalFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
58
58
|
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
workItemType: string;
|
|
60
59
|
title: string;
|
|
60
|
+
workItemType: string;
|
|
61
61
|
priority?: number | undefined;
|
|
62
62
|
projectId?: string | undefined;
|
|
63
63
|
organizationId?: string | undefined;
|
|
@@ -68,8 +68,8 @@ export declare const CreateWorkItemSchema: z.ZodObject<{
|
|
|
68
68
|
parentId?: number | undefined;
|
|
69
69
|
additionalFields?: Record<string, any> | undefined;
|
|
70
70
|
}, {
|
|
71
|
-
workItemType: string;
|
|
72
71
|
title: string;
|
|
72
|
+
workItemType: string;
|
|
73
73
|
priority?: number | undefined;
|
|
74
74
|
projectId?: string | undefined;
|
|
75
75
|
organizationId?: string | undefined;
|
|
@@ -95,8 +95,8 @@ export declare const UpdateWorkItemSchema: z.ZodObject<{
|
|
|
95
95
|
additionalFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
96
96
|
}, "strip", z.ZodTypeAny, {
|
|
97
97
|
workItemId: number;
|
|
98
|
-
priority?: number | undefined;
|
|
99
98
|
title?: string | undefined;
|
|
99
|
+
priority?: number | undefined;
|
|
100
100
|
description?: string | undefined;
|
|
101
101
|
assignedTo?: string | undefined;
|
|
102
102
|
areaPath?: string | undefined;
|
|
@@ -105,8 +105,8 @@ export declare const UpdateWorkItemSchema: z.ZodObject<{
|
|
|
105
105
|
state?: string | undefined;
|
|
106
106
|
}, {
|
|
107
107
|
workItemId: number;
|
|
108
|
-
priority?: number | undefined;
|
|
109
108
|
title?: string | undefined;
|
|
109
|
+
priority?: number | undefined;
|
|
110
110
|
description?: string | undefined;
|
|
111
111
|
assignedTo?: string | undefined;
|
|
112
112
|
areaPath?: string | undefined;
|