@codingame/monaco-vscode-mcp-service-override 17.2.0 → 18.0.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 (64) hide show
  1. package/index.js +20 -2
  2. package/package.json +14 -5
  3. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.d.ts +26 -0
  4. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +170 -0
  5. package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +35 -0
  6. package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +292 -0
  7. package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.d.ts +65 -0
  8. package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.js +9 -0
  9. package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +64 -5
  10. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.d.ts +12 -0
  11. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +76 -0
  12. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpDiscovery.js +2 -2
  13. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +73 -27
  14. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +106 -0
  15. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +423 -0
  16. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +61 -0
  17. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +542 -0
  18. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.d.ts +17 -0
  19. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +45 -0
  20. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +54 -0
  21. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +272 -0
  22. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +24 -0
  23. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +193 -0
  24. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +56 -0
  25. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +176 -0
  26. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/configMcpDiscovery.d.ts +3 -1
  27. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/configMcpDiscovery.js +27 -6
  28. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +8 -6
  29. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.d.ts +1 -1
  30. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +6 -4
  31. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.d.ts +1 -1
  32. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +2 -2
  33. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +4 -2
  34. package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfigPathsService.js +4 -4
  35. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.d.ts +23 -0
  36. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.js +89 -0
  37. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.d.ts +6 -0
  38. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.js +6 -0
  39. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.d.ts +8 -6
  40. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +30 -47
  41. package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.d.ts +35 -0
  42. package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.js +206 -0
  43. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.d.ts +26 -0
  44. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +110 -0
  45. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.d.ts +38 -0
  46. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +256 -0
  47. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +29 -13
  48. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +313 -116
  49. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.d.ts +2 -2
  50. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +15 -17
  51. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +16 -7
  52. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +58 -39
  53. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +1 -1
  54. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +109 -46
  55. package/vscode/src/vs/workbench/contrib/mcp/common/uriTemplate.d.ts +25 -0
  56. package/vscode/src/vs/workbench/contrib/mcp/common/uriTemplate.js +296 -0
  57. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.d.ts +27 -0
  58. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.js +73 -0
  59. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.d.ts +51 -0
  60. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +391 -0
  61. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.d.ts +27 -0
  62. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js +105 -0
  63. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.d.ts +0 -395
  64. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.js +0 -14
@@ -0,0 +1,423 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { ActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionViewItems';
4
+ import { Action, Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
5
+ import { disposeIfDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
+ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
7
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
8
+ import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
9
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
10
+ import { manageExtensionIcon } from '@codingame/monaco-vscode-93784a59-b4cf-520c-8339-f8104d3a4f3e-common/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons';
11
+ import { getDomNodePagePosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
12
+ import { McpConnectionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
13
+ import { IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
14
+ import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
15
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
16
+ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
17
+
18
+ var InstallAction_1, UninstallAction_1, ManageMcpServerAction_1, StartServerAction_1, StopServerAction_1, RestartServerAction_1, ShowServerOutputAction_1, ShowServerConfigurationAction_1;
19
+ class McpServerAction extends Action {
20
+ constructor() {
21
+ super(...arguments);
22
+ this._mcpServer = null;
23
+ }
24
+ static { this.EXTENSION_ACTION_CLASS = 'extension-action'; }
25
+ static { this.TEXT_ACTION_CLASS = `${McpServerAction.EXTENSION_ACTION_CLASS} text`; }
26
+ static { this.LABEL_ACTION_CLASS = `${McpServerAction.EXTENSION_ACTION_CLASS} label`; }
27
+ static { this.PROMINENT_LABEL_ACTION_CLASS = `${McpServerAction.LABEL_ACTION_CLASS} prominent`; }
28
+ static { this.ICON_ACTION_CLASS = `${McpServerAction.EXTENSION_ACTION_CLASS} icon`; }
29
+ get mcpServer() { return this._mcpServer; }
30
+ set mcpServer(mcpServer) { this._mcpServer = mcpServer; this.update(); }
31
+ }
32
+ let DropDownAction = class DropDownAction extends McpServerAction {
33
+ constructor(id, label, cssClass, enabled, instantiationService) {
34
+ super(id, label, cssClass, enabled);
35
+ this.instantiationService = instantiationService;
36
+ this._actionViewItem = null;
37
+ }
38
+ createActionViewItem(options) {
39
+ this._actionViewItem = this.instantiationService.createInstance(DropDownExtensionActionViewItem, this, options);
40
+ return this._actionViewItem;
41
+ }
42
+ run(actionGroups) {
43
+ this._actionViewItem?.showMenu(actionGroups);
44
+ return Promise.resolve();
45
+ }
46
+ };
47
+ DropDownAction = ( __decorate([
48
+ ( __param(4, IInstantiationService))
49
+ ], DropDownAction));
50
+ let DropDownExtensionActionViewItem = class DropDownExtensionActionViewItem extends ActionViewItem {
51
+ constructor(action, options, contextMenuService) {
52
+ super(null, action, { ...options, icon: true, label: true });
53
+ this.contextMenuService = contextMenuService;
54
+ }
55
+ showMenu(menuActionGroups) {
56
+ if (this.element) {
57
+ const actions = this.getActions(menuActionGroups);
58
+ const elementPosition = getDomNodePagePosition(this.element);
59
+ const anchor = { x: elementPosition.left, y: elementPosition.top + elementPosition.height + 10 };
60
+ this.contextMenuService.showContextMenu({
61
+ getAnchor: () => anchor,
62
+ getActions: () => actions,
63
+ actionRunner: this.actionRunner,
64
+ onHide: () => disposeIfDisposable(actions)
65
+ });
66
+ }
67
+ }
68
+ getActions(menuActionGroups) {
69
+ let actions = [];
70
+ for (const menuActions of menuActionGroups) {
71
+ actions = [...actions, ...menuActions, ( new Separator())];
72
+ }
73
+ return actions.length ? actions.slice(0, actions.length - 1) : actions;
74
+ }
75
+ };
76
+ DropDownExtensionActionViewItem = ( __decorate([
77
+ ( __param(2, IContextMenuService))
78
+ ], DropDownExtensionActionViewItem));
79
+ let InstallAction = class InstallAction extends McpServerAction {
80
+ static { InstallAction_1 = this; }
81
+ static { this.CLASS = `${this.LABEL_ACTION_CLASS} prominent install`; }
82
+ static { this.HIDE = `${this.CLASS} hide`; }
83
+ constructor(mcpWorkbenchService) {
84
+ super('extensions.install', ( localize(7891, "Install")), InstallAction_1.CLASS, false);
85
+ this.mcpWorkbenchService = mcpWorkbenchService;
86
+ this.update();
87
+ }
88
+ update() {
89
+ this.enabled = false;
90
+ this.class = InstallAction_1.HIDE;
91
+ if (!this.mcpServer?.gallery) {
92
+ return;
93
+ }
94
+ if (this.mcpServer.local) {
95
+ return;
96
+ }
97
+ this.class = InstallAction_1.CLASS;
98
+ this.enabled = true;
99
+ this.label = ( localize(7891, "Install"));
100
+ }
101
+ async run() {
102
+ if (!this.mcpServer) {
103
+ return;
104
+ }
105
+ await this.mcpWorkbenchService.install(this.mcpServer);
106
+ }
107
+ };
108
+ InstallAction = InstallAction_1 = ( __decorate([
109
+ ( __param(0, IMcpWorkbenchService))
110
+ ], InstallAction));
111
+ let UninstallAction = class UninstallAction extends McpServerAction {
112
+ static { UninstallAction_1 = this; }
113
+ static { this.CLASS = `${this.LABEL_ACTION_CLASS} prominent uninstall`; }
114
+ static { this.HIDE = `${this.CLASS} hide`; }
115
+ constructor(mcpWorkbenchService) {
116
+ super('extensions.uninstall', ( localize(7892, "Uninstall")), UninstallAction_1.CLASS, false);
117
+ this.mcpWorkbenchService = mcpWorkbenchService;
118
+ this.update();
119
+ }
120
+ update() {
121
+ this.enabled = false;
122
+ this.class = UninstallAction_1.HIDE;
123
+ if (!this.mcpServer) {
124
+ return;
125
+ }
126
+ if (!this.mcpServer.local) {
127
+ return;
128
+ }
129
+ this.class = UninstallAction_1.CLASS;
130
+ this.enabled = true;
131
+ this.label = ( localize(7892, "Uninstall"));
132
+ }
133
+ async run() {
134
+ if (!this.mcpServer) {
135
+ return;
136
+ }
137
+ await this.mcpWorkbenchService.uninstall(this.mcpServer);
138
+ }
139
+ };
140
+ UninstallAction = UninstallAction_1 = ( __decorate([
141
+ ( __param(0, IMcpWorkbenchService))
142
+ ], UninstallAction));
143
+ let ManageMcpServerAction = class ManageMcpServerAction extends DropDownAction {
144
+ static { ManageMcpServerAction_1 = this; }
145
+ static { this.ID = 'mcpServer.manage'; }
146
+ static { this.Class = `${McpServerAction.ICON_ACTION_CLASS} manage ` + ThemeIcon.asClassName(manageExtensionIcon); }
147
+ static { this.HideManageExtensionClass = `${this.Class} hide`; }
148
+ constructor(isEditorAction, instantiationService) {
149
+ super(ManageMcpServerAction_1.ID, '', '', true, instantiationService);
150
+ this.isEditorAction = isEditorAction;
151
+ this.tooltip = ( localize(7893, "Manage"));
152
+ this.update();
153
+ }
154
+ async getActionGroups() {
155
+ const groups = [];
156
+ groups.push([
157
+ this.instantiationService.createInstance(StartServerAction),
158
+ ]);
159
+ groups.push([
160
+ this.instantiationService.createInstance(StopServerAction),
161
+ this.instantiationService.createInstance(RestartServerAction),
162
+ ]);
163
+ groups.push([
164
+ this.instantiationService.createInstance(ShowServerOutputAction),
165
+ this.instantiationService.createInstance(ShowServerConfigurationAction),
166
+ ]);
167
+ if (!this.isEditorAction) {
168
+ groups.push([
169
+ this.instantiationService.createInstance(UninstallAction),
170
+ ]);
171
+ }
172
+ groups.forEach(group => group.forEach(extensionAction => {
173
+ if (extensionAction instanceof McpServerAction) {
174
+ extensionAction.mcpServer = this.mcpServer;
175
+ }
176
+ }));
177
+ return groups;
178
+ }
179
+ async run() {
180
+ return super.run(await this.getActionGroups());
181
+ }
182
+ update() {
183
+ this.class = ManageMcpServerAction_1.HideManageExtensionClass;
184
+ this.enabled = false;
185
+ if (this.mcpServer) {
186
+ this.enabled = !!this.mcpServer.local;
187
+ this.class = this.enabled ? ManageMcpServerAction_1.Class : ManageMcpServerAction_1.HideManageExtensionClass;
188
+ }
189
+ }
190
+ };
191
+ ManageMcpServerAction = ManageMcpServerAction_1 = ( __decorate([
192
+ ( __param(1, IInstantiationService))
193
+ ], ManageMcpServerAction));
194
+ let StartServerAction = class StartServerAction extends McpServerAction {
195
+ static { StartServerAction_1 = this; }
196
+ static { this.CLASS = `${this.LABEL_ACTION_CLASS} prominent start`; }
197
+ static { this.HIDE = `${this.CLASS} hide`; }
198
+ constructor(mcpService) {
199
+ super('extensions.start', ( localize(7894, "Start Server")), StartServerAction_1.CLASS, false);
200
+ this.mcpService = mcpService;
201
+ this.update();
202
+ }
203
+ update() {
204
+ this.enabled = false;
205
+ this.class = StartServerAction_1.HIDE;
206
+ const server = this.getServer();
207
+ if (!server) {
208
+ return;
209
+ }
210
+ const serverState = server.connectionState.get();
211
+ if (!McpConnectionState.canBeStarted(serverState.state)) {
212
+ return;
213
+ }
214
+ this.class = StartServerAction_1.CLASS;
215
+ this.enabled = true;
216
+ this.label = ( localize(7894, "Start Server"));
217
+ }
218
+ async run() {
219
+ const server = this.getServer();
220
+ if (!server) {
221
+ return;
222
+ }
223
+ await server.start({ isFromInteraction: true });
224
+ server.showOutput();
225
+ }
226
+ getServer() {
227
+ if (!this.mcpServer) {
228
+ return;
229
+ }
230
+ if (!this.mcpServer.local) {
231
+ return;
232
+ }
233
+ return this.mcpService.servers.get().find(s => s.definition.label === this.mcpServer?.name);
234
+ }
235
+ };
236
+ StartServerAction = StartServerAction_1 = ( __decorate([
237
+ ( __param(0, IMcpService))
238
+ ], StartServerAction));
239
+ let StopServerAction = class StopServerAction extends McpServerAction {
240
+ static { StopServerAction_1 = this; }
241
+ static { this.CLASS = `${this.LABEL_ACTION_CLASS} prominent stop`; }
242
+ static { this.HIDE = `${this.CLASS} hide`; }
243
+ constructor(mcpService) {
244
+ super('extensions.stop', ( localize(7895, "Stop Server")), StopServerAction_1.CLASS, false);
245
+ this.mcpService = mcpService;
246
+ this.update();
247
+ }
248
+ update() {
249
+ this.enabled = false;
250
+ this.class = StopServerAction_1.HIDE;
251
+ const server = this.getServer();
252
+ if (!server) {
253
+ return;
254
+ }
255
+ const serverState = server.connectionState.get();
256
+ if (McpConnectionState.canBeStarted(serverState.state)) {
257
+ return;
258
+ }
259
+ this.class = StopServerAction_1.CLASS;
260
+ this.enabled = true;
261
+ this.label = ( localize(7895, "Stop Server"));
262
+ }
263
+ async run() {
264
+ const server = this.getServer();
265
+ if (!server) {
266
+ return;
267
+ }
268
+ await server.stop();
269
+ }
270
+ getServer() {
271
+ if (!this.mcpServer) {
272
+ return;
273
+ }
274
+ if (!this.mcpServer.local) {
275
+ return;
276
+ }
277
+ return this.mcpService.servers.get().find(s => s.definition.label === this.mcpServer?.name);
278
+ }
279
+ };
280
+ StopServerAction = StopServerAction_1 = ( __decorate([
281
+ ( __param(0, IMcpService))
282
+ ], StopServerAction));
283
+ let RestartServerAction = class RestartServerAction extends McpServerAction {
284
+ static { RestartServerAction_1 = this; }
285
+ static { this.CLASS = `${this.LABEL_ACTION_CLASS} prominent restart`; }
286
+ static { this.HIDE = `${this.CLASS} hide`; }
287
+ constructor(mcpService) {
288
+ super('extensions.restart', ( localize(7896, "Restart Server")), RestartServerAction_1.CLASS, false);
289
+ this.mcpService = mcpService;
290
+ this.update();
291
+ }
292
+ update() {
293
+ this.enabled = false;
294
+ this.class = RestartServerAction_1.HIDE;
295
+ const server = this.getServer();
296
+ if (!server) {
297
+ return;
298
+ }
299
+ const serverState = server.connectionState.get();
300
+ if (McpConnectionState.canBeStarted(serverState.state)) {
301
+ return;
302
+ }
303
+ this.class = RestartServerAction_1.CLASS;
304
+ this.enabled = true;
305
+ this.label = ( localize(7896, "Restart Server"));
306
+ }
307
+ async run() {
308
+ const server = this.getServer();
309
+ if (!server) {
310
+ return;
311
+ }
312
+ await server.stop();
313
+ await server.start({ isFromInteraction: true });
314
+ server.showOutput();
315
+ }
316
+ getServer() {
317
+ if (!this.mcpServer) {
318
+ return;
319
+ }
320
+ if (!this.mcpServer.local) {
321
+ return;
322
+ }
323
+ return this.mcpService.servers.get().find(s => s.definition.label === this.mcpServer?.name);
324
+ }
325
+ };
326
+ RestartServerAction = RestartServerAction_1 = ( __decorate([
327
+ ( __param(0, IMcpService))
328
+ ], RestartServerAction));
329
+ let ShowServerOutputAction = class ShowServerOutputAction extends McpServerAction {
330
+ static { ShowServerOutputAction_1 = this; }
331
+ static { this.CLASS = `${this.LABEL_ACTION_CLASS} prominent output`; }
332
+ static { this.HIDE = `${this.CLASS} hide`; }
333
+ constructor(mcpService) {
334
+ super('extensions.output', ( localize(7897, "Show Output")), ShowServerOutputAction_1.CLASS, false);
335
+ this.mcpService = mcpService;
336
+ this.update();
337
+ }
338
+ update() {
339
+ this.enabled = false;
340
+ this.class = ShowServerOutputAction_1.HIDE;
341
+ const server = this.getServer();
342
+ if (!server) {
343
+ return;
344
+ }
345
+ this.class = ShowServerOutputAction_1.CLASS;
346
+ this.enabled = true;
347
+ this.label = ( localize(7897, "Show Output"));
348
+ }
349
+ async run() {
350
+ const server = this.getServer();
351
+ if (!server) {
352
+ return;
353
+ }
354
+ server.showOutput();
355
+ }
356
+ getServer() {
357
+ if (!this.mcpServer) {
358
+ return;
359
+ }
360
+ if (!this.mcpServer.local) {
361
+ return;
362
+ }
363
+ return this.mcpService.servers.get().find(s => s.definition.label === this.mcpServer?.name);
364
+ }
365
+ };
366
+ ShowServerOutputAction = ShowServerOutputAction_1 = ( __decorate([
367
+ ( __param(0, IMcpService))
368
+ ], ShowServerOutputAction));
369
+ let ShowServerConfigurationAction = class ShowServerConfigurationAction extends McpServerAction {
370
+ static { ShowServerConfigurationAction_1 = this; }
371
+ static { this.CLASS = `${this.LABEL_ACTION_CLASS} prominent config`; }
372
+ static { this.HIDE = `${this.CLASS} hide`; }
373
+ constructor(mcpService, mcpRegistry, editorService) {
374
+ super('extensions.config', ( localize(7898, "Show Configuration")), ShowServerConfigurationAction_1.CLASS, false);
375
+ this.mcpService = mcpService;
376
+ this.mcpRegistry = mcpRegistry;
377
+ this.editorService = editorService;
378
+ this.update();
379
+ }
380
+ update() {
381
+ this.enabled = false;
382
+ this.class = ShowServerConfigurationAction_1.HIDE;
383
+ const configurationTarget = this.getConfigurationTarget();
384
+ if (!configurationTarget) {
385
+ return;
386
+ }
387
+ this.class = ShowServerConfigurationAction_1.CLASS;
388
+ this.enabled = true;
389
+ this.label = ( localize(7898, "Show Configuration"));
390
+ }
391
+ async run() {
392
+ const configurationTarget = this.getConfigurationTarget();
393
+ if (!configurationTarget) {
394
+ return;
395
+ }
396
+ this.editorService.openEditor({
397
+ resource: URI.isUri(configurationTarget) ? configurationTarget : configurationTarget.uri,
398
+ options: { selection: URI.isUri(configurationTarget) ? undefined : configurationTarget.range }
399
+ });
400
+ }
401
+ getConfigurationTarget() {
402
+ if (!this.mcpServer) {
403
+ return;
404
+ }
405
+ if (!this.mcpServer.local) {
406
+ return;
407
+ }
408
+ const server = this.mcpService.servers.get().find(s => s.definition.label === this.mcpServer?.name);
409
+ if (!server) {
410
+ return;
411
+ }
412
+ const collection = this.mcpRegistry.collections.get().find(c => c.id === server.collection.id);
413
+ const serverDefinition = collection?.serverDefinitions.get().find(s => s.id === server.definition.id);
414
+ return serverDefinition?.presentation?.origin || collection?.presentation?.origin;
415
+ }
416
+ };
417
+ ShowServerConfigurationAction = ShowServerConfigurationAction_1 = ( __decorate([
418
+ ( __param(0, IMcpService)),
419
+ ( __param(1, IMcpRegistry)),
420
+ ( __param(2, IEditorService))
421
+ ], ShowServerConfigurationAction));
422
+
423
+ export { DropDownAction, DropDownExtensionActionViewItem, InstallAction, ManageMcpServerAction, McpServerAction, RestartServerAction, ShowServerConfigurationAction, ShowServerOutputAction, StartServerAction, StopServerAction, UninstallAction };
@@ -0,0 +1,61 @@
1
+ import { Dimension } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/dom";
2
+ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
3
+ import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
4
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
5
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
6
+ import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
7
+ import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
8
+ import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
9
+ import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
10
+ import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
11
+ import { EditorPane } from "@codingame/monaco-vscode-dcfc2191-2da1-54c7-8fb7-e92c5d11ecef-common/vscode/vs/workbench/browser/parts/editor/editorPane";
12
+ import { IEditorOpenContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
13
+ import { IWebview } from "@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/webview/browser/webview";
14
+ import { IWebviewService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview.service";
15
+ import { IEditorGroup } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService";
16
+ import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
17
+ import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
18
+ import { McpServerEditorInput } from "./mcpServerEditorInput.js";
19
+ import { IEditorOptions } from "@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor";
20
+ export declare class McpServerEditor extends EditorPane {
21
+ private readonly instantiationService;
22
+ private readonly notificationService;
23
+ private readonly openerService;
24
+ private readonly extensionService;
25
+ private readonly webviewService;
26
+ private readonly languageService;
27
+ private readonly contextKeyService;
28
+ private readonly hoverService;
29
+ static readonly ID: string;
30
+ private readonly _scopedContextKeyService;
31
+ private template;
32
+ private mcpServerReadme;
33
+ private initialScrollProgress;
34
+ private currentIdentifier;
35
+ private layoutParticipants;
36
+ private readonly contentDisposables;
37
+ private readonly transientDisposables;
38
+ private activeElement;
39
+ private dimension;
40
+ constructor(group: IEditorGroup, telemetryService: ITelemetryService, instantiationService: IInstantiationService, themeService: IThemeService, notificationService: INotificationService, openerService: IOpenerService, storageService: IStorageService, extensionService: IExtensionService, webviewService: IWebviewService, languageService: ILanguageService, contextKeyService: IContextKeyService, hoverService: IHoverService);
41
+ get scopedContextKeyService(): IContextKeyService | undefined;
42
+ protected createEditor(parent: HTMLElement): void;
43
+ setInput(input: McpServerEditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void>;
44
+ private render;
45
+ private renderNavbar;
46
+ clearInput(): void;
47
+ focus(): void;
48
+ showFind(): void;
49
+ runFindAction(previous: boolean): void;
50
+ get activeWebview(): IWebview | undefined;
51
+ private onNavbarChange;
52
+ private open;
53
+ private openMarkdown;
54
+ private renderMarkdown;
55
+ private renderBody;
56
+ private openDetails;
57
+ private renderAdditionalDetails;
58
+ private loadContents;
59
+ layout(dimension: Dimension): void;
60
+ private onError;
61
+ }