@codingame/monaco-vscode-extensions-service-override 36.2.7 → 37.1.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/package.json +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
- package/vscode/src/vs/platform/telemetry/common/assignmentContext.d.ts +4 -0
- package/vscode/src/vs/platform/telemetry/common/assignmentContext.js +13 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.js +14 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +9 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +56 -39
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +6 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +5 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +7 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +8 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.d.ts +17 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +130 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +2 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.d.ts +2 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +8 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +9 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +42 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +42 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +2 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.d.ts +19 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +14 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +12 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +5 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +5 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +39 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +6 -6
|
@@ -111,7 +111,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
111
111
|
this._notificationService.notify({
|
|
112
112
|
severity: Severity.Error,
|
|
113
113
|
message: ( localize(
|
|
114
|
-
|
|
114
|
+
2983,
|
|
115
115
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",
|
|
116
116
|
extName,
|
|
117
117
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -119,7 +119,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
119
119
|
actions: {
|
|
120
120
|
primary: [toAction({
|
|
121
121
|
id: "reload",
|
|
122
|
-
label: ( localize(
|
|
122
|
+
label: ( localize(2984, "Reload Window")),
|
|
123
123
|
run: () => this._hostService.reload()
|
|
124
124
|
})]
|
|
125
125
|
}
|
|
@@ -130,7 +130,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
130
130
|
this._notificationService.notify({
|
|
131
131
|
severity: Severity.Error,
|
|
132
132
|
message: ( localize(
|
|
133
|
-
|
|
133
|
+
2985,
|
|
134
134
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",
|
|
135
135
|
extName,
|
|
136
136
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -140,7 +140,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
140
140
|
this._notificationService.notify({
|
|
141
141
|
severity: Severity.Error,
|
|
142
142
|
message: ( localize(
|
|
143
|
-
|
|
143
|
+
2986,
|
|
144
144
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",
|
|
145
145
|
extName,
|
|
146
146
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -148,7 +148,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
148
148
|
actions: {
|
|
149
149
|
primary: [toAction({
|
|
150
150
|
id: "manageWorkspaceTrust",
|
|
151
|
-
label: ( localize(
|
|
151
|
+
label: ( localize(2987, "Manage Workspace Trust")),
|
|
152
152
|
run: () => this._commandService.executeCommand("workbench.trust.manage")
|
|
153
153
|
})]
|
|
154
154
|
}
|
|
@@ -157,7 +157,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
157
157
|
this._notificationService.notify({
|
|
158
158
|
severity: Severity.Error,
|
|
159
159
|
message: ( localize(
|
|
160
|
-
|
|
160
|
+
2988,
|
|
161
161
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",
|
|
162
162
|
extName,
|
|
163
163
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -165,7 +165,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
165
165
|
actions: {
|
|
166
166
|
primary: [toAction({
|
|
167
167
|
id: "enable",
|
|
168
|
-
label: ( localize(
|
|
168
|
+
label: ( localize(2989, "Enable and Reload")),
|
|
169
169
|
enabled: true,
|
|
170
170
|
run: () => this._extensionEnablementService.setEnablement(
|
|
171
171
|
[missingInstalledDependency],
|
|
@@ -178,7 +178,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
178
178
|
this._notificationService.notify({
|
|
179
179
|
severity: Severity.Error,
|
|
180
180
|
message: ( localize(
|
|
181
|
-
|
|
181
|
+
2990,
|
|
182
182
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",
|
|
183
183
|
extName,
|
|
184
184
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -199,7 +199,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
199
199
|
this._notificationService.notify({
|
|
200
200
|
severity: Severity.Error,
|
|
201
201
|
message: ( localize(
|
|
202
|
-
|
|
202
|
+
2991,
|
|
203
203
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",
|
|
204
204
|
extName,
|
|
205
205
|
dependencyExtension.displayName,
|
|
@@ -208,14 +208,14 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
208
208
|
actions: {
|
|
209
209
|
primary: [toAction({
|
|
210
210
|
id: "install",
|
|
211
|
-
label: ( localize(
|
|
211
|
+
label: ( localize(2992, "Install and Reload")),
|
|
212
212
|
run: () => this._extensionsWorkbenchService.install(dependencyExtension).then(() => this._hostService.reload(), e => this._notificationService.error(e))
|
|
213
213
|
})]
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
} else {
|
|
217
217
|
this._notificationService.error(( localize(
|
|
218
|
-
|
|
218
|
+
2993,
|
|
219
219
|
"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",
|
|
220
220
|
extName,
|
|
221
221
|
missingDependency
|
|
@@ -94,25 +94,25 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
94
94
|
if (data.extensionNames.length === 1) {
|
|
95
95
|
if (operation === FileOperation.CREATE) {
|
|
96
96
|
message = ( localize(
|
|
97
|
-
|
|
97
|
+
2994,
|
|
98
98
|
"Extension '{0}' wants to make refactoring changes with this file creation",
|
|
99
99
|
data.extensionNames[0]
|
|
100
100
|
));
|
|
101
101
|
} else if (operation === FileOperation.COPY) {
|
|
102
102
|
message = ( localize(
|
|
103
|
-
|
|
103
|
+
2995,
|
|
104
104
|
"Extension '{0}' wants to make refactoring changes with this file copy",
|
|
105
105
|
data.extensionNames[0]
|
|
106
106
|
));
|
|
107
107
|
} else if (operation === FileOperation.MOVE) {
|
|
108
108
|
message = ( localize(
|
|
109
|
-
|
|
109
|
+
2996,
|
|
110
110
|
"Extension '{0}' wants to make refactoring changes with this file move",
|
|
111
111
|
data.extensionNames[0]
|
|
112
112
|
));
|
|
113
113
|
} else {
|
|
114
114
|
message = ( localize(
|
|
115
|
-
|
|
115
|
+
2997,
|
|
116
116
|
"Extension '{0}' wants to make refactoring changes with this file deletion",
|
|
117
117
|
data.extensionNames[0]
|
|
118
118
|
));
|
|
@@ -120,25 +120,25 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
120
120
|
} else {
|
|
121
121
|
if (operation === FileOperation.CREATE) {
|
|
122
122
|
message = ( localize(
|
|
123
|
-
|
|
123
|
+
2998,
|
|
124
124
|
"{0} extensions want to make refactoring changes with this file creation",
|
|
125
125
|
data.extensionNames.length
|
|
126
126
|
));
|
|
127
127
|
} else if (operation === FileOperation.COPY) {
|
|
128
128
|
message = ( localize(
|
|
129
|
-
|
|
129
|
+
2999,
|
|
130
130
|
"{0} extensions want to make refactoring changes with this file copy",
|
|
131
131
|
data.extensionNames.length
|
|
132
132
|
));
|
|
133
133
|
} else if (operation === FileOperation.MOVE) {
|
|
134
134
|
message = ( localize(
|
|
135
|
-
|
|
135
|
+
3000,
|
|
136
136
|
"{0} extensions want to make refactoring changes with this file move",
|
|
137
137
|
data.extensionNames.length
|
|
138
138
|
));
|
|
139
139
|
} else {
|
|
140
140
|
message = ( localize(
|
|
141
|
-
|
|
141
|
+
3001,
|
|
142
142
|
"{0} extensions want to make refactoring changes with this file deletion",
|
|
143
143
|
data.extensionNames.length
|
|
144
144
|
));
|
|
@@ -150,8 +150,8 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
150
150
|
} = await dialogService.confirm({
|
|
151
151
|
type: Severity.Info,
|
|
152
152
|
message,
|
|
153
|
-
primaryButton: ( localize(
|
|
154
|
-
cancelButton: ( localize(
|
|
153
|
+
primaryButton: ( localize(3002, "Show &&Preview")),
|
|
154
|
+
cancelButton: ( localize(3003, "Skip Changes"))
|
|
155
155
|
});
|
|
156
156
|
showPreview = true;
|
|
157
157
|
if (!confirmed) {
|
|
@@ -171,18 +171,18 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
171
171
|
type: Severity.Info,
|
|
172
172
|
message,
|
|
173
173
|
buttons: [{
|
|
174
|
-
label: ( localize(
|
|
174
|
+
label: ( localize(3004, "&&OK")),
|
|
175
175
|
run: () => Choice.OK
|
|
176
176
|
}, {
|
|
177
|
-
label: ( localize(
|
|
177
|
+
label: ( localize(3002, "Show &&Preview")),
|
|
178
178
|
run: () => Choice.Preview
|
|
179
179
|
}],
|
|
180
180
|
cancelButton: {
|
|
181
|
-
label: ( localize(
|
|
181
|
+
label: ( localize(3003, "Skip Changes")),
|
|
182
182
|
run: () => Choice.Cancel
|
|
183
183
|
},
|
|
184
184
|
checkbox: {
|
|
185
|
-
label: ( localize(
|
|
185
|
+
label: ( localize(3005, "Do not ask me again"))
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
if (result === Choice.Cancel) {
|
|
@@ -211,15 +211,15 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
211
211
|
_progressLabel(operation) {
|
|
212
212
|
switch (operation) {
|
|
213
213
|
case FileOperation.CREATE:
|
|
214
|
-
return localize(
|
|
214
|
+
return localize(3006, "Running 'File Create' participants...");
|
|
215
215
|
case FileOperation.MOVE:
|
|
216
|
-
return localize(
|
|
216
|
+
return localize(3007, "Running 'File Rename' participants...");
|
|
217
217
|
case FileOperation.COPY:
|
|
218
|
-
return localize(
|
|
218
|
+
return localize(3008, "Running 'File Copy' participants...");
|
|
219
219
|
case FileOperation.DELETE:
|
|
220
|
-
return localize(
|
|
220
|
+
return localize(3009, "Running 'File Delete' participants...");
|
|
221
221
|
case FileOperation.WRITE:
|
|
222
|
-
return localize(
|
|
222
|
+
return localize(3010, "Running 'File Write' participants...");
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
})();
|
|
@@ -307,7 +307,7 @@ registerAction2(class ResetMemento extends Action2 {
|
|
|
307
307
|
super({
|
|
308
308
|
id: "files.participants.resetChoice",
|
|
309
309
|
title: {
|
|
310
|
-
value: ( localize(
|
|
310
|
+
value: ( localize(3011, "Reset choice for 'File operation needs preview'")),
|
|
311
311
|
original: `Reset choice for 'File operation needs preview'`
|
|
312
312
|
},
|
|
313
313
|
f1: true
|
|
@@ -10,7 +10,7 @@ export declare class MainThreadGitExtensionService extends Disposable implements
|
|
|
10
10
|
private readonly _proxy;
|
|
11
11
|
private readonly _openRepositorySequencer;
|
|
12
12
|
private _repositoryHandles;
|
|
13
|
-
private _repositories;
|
|
13
|
+
private readonly _repositories;
|
|
14
14
|
get repositories(): Iterable<IGitRepository>;
|
|
15
15
|
constructor(extHostContext: IExtHostContext, gitService: IGitService);
|
|
16
16
|
private _initializeDelegate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Sequencer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { Disposable, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
6
6
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
7
7
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -76,7 +76,7 @@ let MainThreadGitExtensionService = class MainThreadGitExtensionService extends
|
|
|
76
76
|
this.gitService = gitService;
|
|
77
77
|
this._openRepositorySequencer = ( new Sequencer());
|
|
78
78
|
this._repositoryHandles = ( new ResourceMap());
|
|
79
|
-
this._repositories = ( new
|
|
79
|
+
this._repositories = this._register(( new DisposableMap()));
|
|
80
80
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostGitExtension));
|
|
81
81
|
this._initializeDelegate();
|
|
82
82
|
}
|
|
@@ -1385,6 +1385,7 @@ let ExtensionBackedInlineCompletionsProvider = class ExtensionBackedInlineComple
|
|
|
1385
1385
|
editKind: lifetimeSummary.editKind,
|
|
1386
1386
|
longDistanceHintVisible: lifetimeSummary.longDistanceHintVisible,
|
|
1387
1387
|
longDistanceHintDistance: lifetimeSummary.longDistanceHintDistance,
|
|
1388
|
+
isForAnotherDocument: lifetimeSummary.isForAnotherDocument,
|
|
1388
1389
|
...forwardToChannelIf(isCopilotLikeExtension(this.providerId.extensionId))
|
|
1389
1390
|
};
|
|
1390
1391
|
const dataChannelForwardingTelemetryService = this._instantiationService.createInstance(DataChannelForwardingTelemetryService);
|
|
@@ -248,7 +248,7 @@ let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
|
248
248
|
if (this._authenticationService.getProviderIds().includes(authProviderId)) {
|
|
249
249
|
return Disposable.None;
|
|
250
250
|
}
|
|
251
|
-
const accountLabel = auth.accountLabel ?? ( localize(
|
|
251
|
+
const accountLabel = auth.accountLabel ?? ( localize(3012, "Language Models"));
|
|
252
252
|
const disposables = ( new DisposableStore());
|
|
253
253
|
const provider = ( new LanguageModelAccessAuthProvider(authProviderId, auth.providerLabel, accountLabel));
|
|
254
254
|
this._authenticationService.registerAuthenticationProvider(authProviderId, provider);
|
|
@@ -331,7 +331,7 @@ class LanguageModelAccessAuthProvider {
|
|
|
331
331
|
}
|
|
332
332
|
confirmation(extensionName, _recreatingSession) {
|
|
333
333
|
return localize(
|
|
334
|
-
|
|
334
|
+
3013,
|
|
335
335
|
"The extension '{0}' wants to access the language models provided by {1}.",
|
|
336
336
|
extensionName,
|
|
337
337
|
this.label
|
|
@@ -64,3 +64,45 @@ export declare class MainThreadMcp extends Disposable implements MainThreadMcpSh
|
|
|
64
64
|
private loginPrompt;
|
|
65
65
|
dispose(): void;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* The context needed to re-acquire a token for a tracked MCP server, captured when the
|
|
69
|
+
* session was first established. The tracker holds this opaquely and replays it verbatim on
|
|
70
|
+
* re-validation so the silent token request targets the same authority / resource / audience
|
|
71
|
+
* that the original sign-in used. Dropping the authorization server here would let the provider
|
|
72
|
+
* fall back to a default authority (e.g. the Microsoft provider's `organizations` tenant) and
|
|
73
|
+
* request a token against the wrong tenant.
|
|
74
|
+
*/
|
|
75
|
+
export interface IMcpServerAuthContext {
|
|
76
|
+
readonly authorizationServer?: URI;
|
|
77
|
+
readonly clientId?: string;
|
|
78
|
+
readonly resource?: string;
|
|
79
|
+
readonly audience?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Tracks which MCP servers are using which authentication providers.
|
|
83
|
+
* Organized by provider ID for efficient lookup when auth sessions change.
|
|
84
|
+
*/
|
|
85
|
+
export declare class McpServerAuthTracker {
|
|
86
|
+
private readonly _tracking;
|
|
87
|
+
/**
|
|
88
|
+
* Track authentication for a server with a specific provider.
|
|
89
|
+
* Replaces any existing tracking for this server/provider combination.
|
|
90
|
+
*/
|
|
91
|
+
track(providerId: string, serverId: number, scopes: string[], context: IMcpServerAuthContext): void;
|
|
92
|
+
/**
|
|
93
|
+
* Remove all authentication tracking for a server across all providers.
|
|
94
|
+
*/
|
|
95
|
+
untrack(serverId: number): void;
|
|
96
|
+
/**
|
|
97
|
+
* Get all servers using a specific authentication provider.
|
|
98
|
+
*/
|
|
99
|
+
get(providerId: string): ReadonlyArray<{
|
|
100
|
+
serverId: number;
|
|
101
|
+
scopes: string[];
|
|
102
|
+
context: IMcpServerAuthContext;
|
|
103
|
+
}> | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Clear all tracking data.
|
|
106
|
+
*/
|
|
107
|
+
clear(): void;
|
|
108
|
+
}
|
|
@@ -20,7 +20,7 @@ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platfo
|
|
|
20
20
|
import { ISecretStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service';
|
|
21
21
|
import { IWorkbenchMcpGatewayService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService.service';
|
|
22
22
|
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
23
|
-
import { McpServerLaunch, McpServerTransportType, McpServerDefinition, McpServerTrust, McpCollectionSortOrder, extensionPrefixedIdentifier, McpConnectionState, mcpOAuthClientSecretStorageKey, UserInteractionRequiredError } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
23
|
+
import { McpServerLaunch, McpServerTransportType, McpServerDefinition, McpServerTrust, McpCollectionSortOrder, McpCollectionProvenance, extensionPrefixedIdentifier, McpConnectionState, mcpOAuthClientSecretStorageKey, UserInteractionRequiredError } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
24
24
|
import { mcpEnterpriseManagedAuthIdpSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
|
|
25
25
|
import { IAuthenticationMcpAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpAccessService.service';
|
|
26
26
|
import { IAuthenticationMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpService.service';
|
|
@@ -108,7 +108,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
108
108
|
this._serverDefinitions.set(id, serverDefiniton);
|
|
109
109
|
proxy.$startMcp(id, {
|
|
110
110
|
launch: resolveLaunch,
|
|
111
|
-
defaultCwd: serverDefiniton.variableReplacement?.folder?.uri,
|
|
111
|
+
defaultCwd: serverDefiniton.defaultCwd ?? serverDefiniton.variableReplacement?.folder?.uri,
|
|
112
112
|
errorOnUserInteraction: options?.errorOnUserInteraction
|
|
113
113
|
});
|
|
114
114
|
return launch;
|
|
@@ -150,6 +150,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
150
150
|
const register = () => {
|
|
151
151
|
handle.value ??= this._mcpRegistry.registerCollection({
|
|
152
152
|
...collection,
|
|
153
|
+
provenance: McpCollectionProvenance.Extension,
|
|
153
154
|
source: extensionId,
|
|
154
155
|
order: McpCollectionSortOrder.Extension,
|
|
155
156
|
resolveServerLanch: collection.canResolveLaunch ? (async def => {
|
|
@@ -246,7 +247,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
246
247
|
const resource = authDetails.resourceMetadata?.resource;
|
|
247
248
|
if (!resource) {
|
|
248
249
|
throw ( new Error(( localize(
|
|
249
|
-
|
|
250
|
+
3014,
|
|
250
251
|
"The enterprise-managed MCP server '{0}' did not advertise a protected-resource metadata document with a 'resource' identifier.",
|
|
251
252
|
server.label
|
|
252
253
|
))));
|
|
@@ -255,7 +256,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
255
256
|
const audience = resourceAuthServers[0];
|
|
256
257
|
if (!audience) {
|
|
257
258
|
throw ( new Error(( localize(
|
|
258
|
-
|
|
259
|
+
3015,
|
|
259
260
|
"The enterprise-managed MCP server '{0}' did not advertise an `authorization_servers` entry in its protected-resource metadata.",
|
|
260
261
|
server.label
|
|
261
262
|
))));
|
|
@@ -342,7 +343,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
342
343
|
const configuredIssuer = config.issuer?.trim();
|
|
343
344
|
if (!configuredIssuer) {
|
|
344
345
|
throw ( new Error(( localize(
|
|
345
|
-
|
|
346
|
+
3016,
|
|
346
347
|
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to be configured. Set it via enterprise policy (Windows Group Policy / macOS managed preferences / Linux `/etc/vscode/policy.json`) or, for local testing, by hand-editing `settings.json`."
|
|
347
348
|
))));
|
|
348
349
|
}
|
|
@@ -351,14 +352,14 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
351
352
|
parsed = ( URI.parse(configuredIssuer));
|
|
352
353
|
} catch {
|
|
353
354
|
throw ( new Error(( localize(
|
|
354
|
-
|
|
355
|
+
3017,
|
|
355
356
|
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to be a valid URL; got '{0}'.",
|
|
356
357
|
configuredIssuer
|
|
357
358
|
))));
|
|
358
359
|
}
|
|
359
360
|
if (parsed.scheme !== "https" && parsed.scheme !== "http") {
|
|
360
361
|
throw ( new Error(( localize(
|
|
361
|
-
|
|
362
|
+
3018,
|
|
362
363
|
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to use the `https` or `http` scheme; got '{0}'.",
|
|
363
364
|
configuredIssuer
|
|
364
365
|
))));
|
|
@@ -377,6 +378,12 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
377
378
|
audience,
|
|
378
379
|
clientSecret
|
|
379
380
|
) {
|
|
381
|
+
const authContext = {
|
|
382
|
+
authorizationServer,
|
|
383
|
+
clientId,
|
|
384
|
+
resource,
|
|
385
|
+
audience
|
|
386
|
+
};
|
|
380
387
|
const sessions = await this._authenticationService.getSessions(providerId, scopes, {
|
|
381
388
|
authorizationServer,
|
|
382
389
|
clientId,
|
|
@@ -409,12 +416,12 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
409
416
|
server.id,
|
|
410
417
|
server.label
|
|
411
418
|
);
|
|
412
|
-
this._serverAuthTracking.track(providerId, serverId, scopes);
|
|
419
|
+
this._serverAuthTracking.track(providerId, serverId, scopes, authContext);
|
|
413
420
|
return matchingAccountPreferenceSession.accessToken;
|
|
414
421
|
}
|
|
415
422
|
if (!provider.supportsMultipleAccounts && this.authenticationMCPServerAccessService.isAccessAllowedForUrl(providerId, sessions[0].account.label, server.id, mcpServerUrl)) {
|
|
416
423
|
this.authenticationMCPServerUsageService.addAccountUsage(providerId, sessions[0].account.label, scopes, server.id, server.label);
|
|
417
|
-
this._serverAuthTracking.track(providerId, serverId, scopes);
|
|
424
|
+
this._serverAuthTracking.track(providerId, serverId, scopes, authContext);
|
|
418
425
|
return sessions[0].accessToken;
|
|
419
426
|
}
|
|
420
427
|
}
|
|
@@ -455,14 +462,14 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
455
462
|
}]);
|
|
456
463
|
this.authenticationMcpServersService.updateAccountPreference(server.id, providerId, session.account);
|
|
457
464
|
this.authenticationMCPServerUsageService.addAccountUsage(providerId, session.account.label, scopes, server.id, server.label);
|
|
458
|
-
this._serverAuthTracking.track(providerId, serverId, scopes);
|
|
465
|
+
this._serverAuthTracking.track(providerId, serverId, scopes, authContext);
|
|
459
466
|
return session.accessToken;
|
|
460
467
|
}
|
|
461
468
|
async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
|
|
462
469
|
const result = await this.dialogService.prompt({
|
|
463
|
-
message: ( localize(
|
|
470
|
+
message: ( localize(3019, "Incorrect account detected")),
|
|
464
471
|
detail: ( localize(
|
|
465
|
-
|
|
472
|
+
3020,
|
|
466
473
|
"The chosen account, {0}, does not match the requested account, {1}.",
|
|
467
474
|
chosenAccountLabel,
|
|
468
475
|
requestedAccountLabel
|
|
@@ -470,10 +477,10 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
470
477
|
type: Severity.Warning,
|
|
471
478
|
cancelButton: true,
|
|
472
479
|
buttons: [{
|
|
473
|
-
label: ( localize(
|
|
480
|
+
label: ( localize(3021, "Keep {0}", chosenAccountLabel)),
|
|
474
481
|
run: () => chosenAccountLabel
|
|
475
482
|
}, {
|
|
476
|
-
label: ( localize(
|
|
483
|
+
label: ( localize(3022, "Login with {0}", requestedAccountLabel)),
|
|
477
484
|
run: () => requestedAccountLabel
|
|
478
485
|
}]
|
|
479
486
|
});
|
|
@@ -489,7 +496,8 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
489
496
|
}
|
|
490
497
|
for (const {
|
|
491
498
|
serverId,
|
|
492
|
-
scopes
|
|
499
|
+
scopes,
|
|
500
|
+
context
|
|
493
501
|
} of serversUsingProvider) {
|
|
494
502
|
const server = this._servers.get(serverId);
|
|
495
503
|
const serverDefinition = this._serverDefinitions.get(serverId);
|
|
@@ -501,11 +509,21 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
501
509
|
continue;
|
|
502
510
|
}
|
|
503
511
|
try {
|
|
504
|
-
await this._getSessionForProvider(
|
|
512
|
+
await this._getSessionForProvider(
|
|
513
|
+
serverId,
|
|
514
|
+
serverDefinition,
|
|
515
|
+
providerId,
|
|
516
|
+
scopes,
|
|
517
|
+
context.authorizationServer,
|
|
518
|
+
true,
|
|
519
|
+
context.clientId,
|
|
520
|
+
context.resource,
|
|
521
|
+
context.audience
|
|
522
|
+
);
|
|
505
523
|
} catch (e) {
|
|
506
524
|
if (UserInteractionRequiredError.is(e)) {
|
|
507
525
|
server.pushLog(LogLevel.Warning, ( localize(
|
|
508
|
-
|
|
526
|
+
3023,
|
|
509
527
|
"Authentication session for {0} removed, stopping server",
|
|
510
528
|
providerLabel
|
|
511
529
|
)));
|
|
@@ -552,18 +570,18 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
552
570
|
}
|
|
553
571
|
async loginPrompt(mcpLabel, providerLabel, recreatingSession) {
|
|
554
572
|
const message = recreatingSession ? ( localize(
|
|
555
|
-
|
|
573
|
+
3024,
|
|
556
574
|
"The MCP Server Definition '{0}' wants you to authenticate to {1}.",
|
|
557
575
|
mcpLabel,
|
|
558
576
|
providerLabel
|
|
559
577
|
)) : ( localize(
|
|
560
|
-
|
|
578
|
+
3025,
|
|
561
579
|
"The MCP Server Definition '{0}' wants to authenticate to {1}.",
|
|
562
580
|
mcpLabel,
|
|
563
581
|
providerLabel
|
|
564
582
|
));
|
|
565
583
|
const buttons = [{
|
|
566
|
-
label: ( localize(
|
|
584
|
+
label: ( localize(3026, "&&Allow")),
|
|
567
585
|
run() {
|
|
568
586
|
return true;
|
|
569
587
|
}
|
|
@@ -649,12 +667,13 @@ class McpServerAuthTracker {
|
|
|
649
667
|
constructor() {
|
|
650
668
|
this._tracking = ( new Map());
|
|
651
669
|
}
|
|
652
|
-
track(providerId, serverId, scopes) {
|
|
670
|
+
track(providerId, serverId, scopes, context) {
|
|
653
671
|
const servers = this._tracking.get(providerId) || [];
|
|
654
672
|
const filtered = servers.filter(s => s.serverId !== serverId);
|
|
655
673
|
filtered.push({
|
|
656
674
|
serverId,
|
|
657
|
-
scopes
|
|
675
|
+
scopes,
|
|
676
|
+
context
|
|
658
677
|
});
|
|
659
678
|
this._tracking.set(providerId, filtered);
|
|
660
679
|
}
|
|
@@ -676,4 +695,4 @@ class McpServerAuthTracker {
|
|
|
676
695
|
}
|
|
677
696
|
}
|
|
678
697
|
|
|
679
|
-
export { MainThreadMcp };
|
|
698
|
+
export { MainThreadMcp, McpServerAuthTracker };
|
|
@@ -66,13 +66,13 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
66
66
|
sourceIsUrgent = MainThreadMessageService_1.URGENT_NOTIFICATION_SOURCES.includes(source.id);
|
|
67
67
|
}
|
|
68
68
|
if (!source) {
|
|
69
|
-
source = ( localize(
|
|
69
|
+
source = ( localize(3027, "Extension"));
|
|
70
70
|
}
|
|
71
71
|
const secondaryActions = [];
|
|
72
72
|
if (options.source) {
|
|
73
73
|
secondaryActions.push(toAction({
|
|
74
74
|
id: options.source.identifier.value,
|
|
75
|
-
label: ( localize(
|
|
75
|
+
label: ( localize(3028, "Manage Extension")),
|
|
76
76
|
run: () => {
|
|
77
77
|
return this._commandService.executeCommand("_extensions.manage", options.source.identifier.value);
|
|
78
78
|
}
|
|
@@ -111,12 +111,12 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
111
111
|
if (!cancelButton) {
|
|
112
112
|
if (buttons.length > 0) {
|
|
113
113
|
cancelButton = {
|
|
114
|
-
label: ( localize(
|
|
114
|
+
label: ( localize(3029, "Cancel")),
|
|
115
115
|
run: () => undefined
|
|
116
116
|
};
|
|
117
117
|
} else {
|
|
118
118
|
cancelButton = {
|
|
119
|
-
label: ( localize(
|
|
119
|
+
label: ( localize(3030, "&&OK")),
|
|
120
120
|
run: () => undefined
|
|
121
121
|
};
|
|
122
122
|
}
|
|
@@ -33,6 +33,8 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
33
33
|
dispose() {
|
|
34
34
|
this._disposables.dispose();
|
|
35
35
|
dispose(( this._notebookSerializer.values()));
|
|
36
|
+
dispose(( this._notebookCellStatusBarRegistrations.values()));
|
|
37
|
+
this._notebookCellStatusBarRegistrations.clear();
|
|
36
38
|
}
|
|
37
39
|
$registerNotebookSerializer(handle, extension, viewType, options, data) {
|
|
38
40
|
const disposables = ( new DisposableStore());
|
|
@@ -18,7 +18,7 @@ class ExtHostNotebookDocumentSaveParticipant {
|
|
|
18
18
|
}
|
|
19
19
|
let _warningTimeout;
|
|
20
20
|
const p = ( new Promise((resolve, reject) => {
|
|
21
|
-
_warningTimeout = setTimeout(() => reject(( new Error(( localize(
|
|
21
|
+
_warningTimeout = setTimeout(() => reject(( new Error(( localize(3031, "Aborted onWillSaveNotebookDocument-event after 1750ms"))))), 1750);
|
|
22
22
|
this._proxy.$participateInSave(workingCopy.resource, context.reason, token).then(_ => {
|
|
23
23
|
clearTimeout(_warningTimeout);
|
|
24
24
|
return undefined;
|
|
@@ -94,11 +94,11 @@ let MainThreadOutputService = class MainThreadOutputService extends Disposable {
|
|
|
94
94
|
}
|
|
95
95
|
_showChannelQuietly(channel) {
|
|
96
96
|
const statusProperties = {
|
|
97
|
-
name: ( localize(
|
|
97
|
+
name: ( localize(3032, "Show Output")),
|
|
98
98
|
text: "$(output)",
|
|
99
|
-
ariaLabel: ( localize(
|
|
99
|
+
ariaLabel: ( localize(3033, "Show {0} Output Channel", channel.label)),
|
|
100
100
|
command: `workbench.action.output.show.${channel.id}`,
|
|
101
|
-
tooltip: ( localize(
|
|
101
|
+
tooltip: ( localize(3034, "Show {0} Output Channel", channel.label)),
|
|
102
102
|
kind: "prominent"
|
|
103
103
|
};
|
|
104
104
|
if (!this._outputStatusItem.value) {
|
|
@@ -38,7 +38,7 @@ let MainThreadProgress = class MainThreadProgress {
|
|
|
38
38
|
location: ProgressLocation.Notification,
|
|
39
39
|
secondaryActions: [toAction({
|
|
40
40
|
id: extensionId,
|
|
41
|
-
label: ( localize(
|
|
41
|
+
label: ( localize(3035, "Manage Extension")),
|
|
42
42
|
run: () => this._commandService.executeCommand("_extensions.manage", extensionId)
|
|
43
43
|
})]
|
|
44
44
|
};
|
|
@@ -17,7 +17,7 @@ class ExtHostSaveParticipant {
|
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
19
|
const p = ( new Promise((resolve, reject) => {
|
|
20
|
-
setTimeout(() => reject(( new Error(( localize(
|
|
20
|
+
setTimeout(() => reject(( new Error(( localize(3036, "Aborted onWillSaveTextDocument-event after 1750ms"))))), 1750);
|
|
21
21
|
this._proxy.$participateInSave(editorModel.resource, context.reason).then(values => {
|
|
22
22
|
if (!values.every(success => success)) {
|
|
23
23
|
return Promise.reject(( new Error("listener failed")));
|
|
@@ -397,7 +397,7 @@ var TaskDTO;
|
|
|
397
397
|
}
|
|
398
398
|
command.presentation = TaskPresentationOptionsDTO.to(task.presentationOptions);
|
|
399
399
|
const source = TaskSourceDTO.to(task.source, workspace);
|
|
400
|
-
const label = ( localize(
|
|
400
|
+
const label = ( localize(3037, "{0}: {1}", source.label, task.name));
|
|
401
401
|
const definition = TaskDefinitionDTO.to(task.definition, executeOnly);
|
|
402
402
|
const id = (CustomExecutionDTO.is(task.execution) && task._id) ? task._id : `${task.source.extensionId}.${definition._key}`;
|
|
403
403
|
const result = ( new ContributedTask(
|