@codingame/monaco-vscode-extensions-service-override 33.0.9 → 34.0.1
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/index.js +1 -0
- package/package.json +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +6 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +92 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +9 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +9 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +4 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +2 -0
- 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/mainThreadLanguageModels.js +12 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +6 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +134 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- 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/mainThreadTerminalService.js +11 -33
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +2 -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.d.ts +1 -1
- 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/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 +5 -5
|
@@ -12,13 +12,16 @@ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common
|
|
|
12
12
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
13
13
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
14
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
15
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
15
16
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
16
17
|
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
17
18
|
import { LogLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log';
|
|
18
19
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
20
|
+
import { ISecretStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service';
|
|
19
21
|
import { IWorkbenchMcpGatewayService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService.service';
|
|
20
22
|
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
21
|
-
import { McpServerLaunch, McpServerTransportType, McpServerDefinition, McpServerTrust, McpCollectionSortOrder, extensionPrefixedIdentifier, McpConnectionState, UserInteractionRequiredError } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
23
|
+
import { McpServerLaunch, McpServerTransportType, McpServerDefinition, McpServerTrust, McpCollectionSortOrder, extensionPrefixedIdentifier, McpConnectionState, mcpOAuthClientSecretStorageKey, UserInteractionRequiredError } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
24
|
+
import { mcpEnterpriseManagedAuthIdpSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
|
|
22
25
|
import { IAuthenticationMcpAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpAccessService.service';
|
|
23
26
|
import { IAuthenticationMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpService.service';
|
|
24
27
|
import { IAuthenticationMcpUsageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpUsageService.service';
|
|
@@ -44,7 +47,9 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
44
47
|
_extensionService,
|
|
45
48
|
_contextKeyService,
|
|
46
49
|
_telemetryService,
|
|
47
|
-
_mcpGatewayService
|
|
50
|
+
_mcpGatewayService,
|
|
51
|
+
_configurationService,
|
|
52
|
+
_secretStorageService
|
|
48
53
|
) {
|
|
49
54
|
super();
|
|
50
55
|
this._extHostContext = _extHostContext;
|
|
@@ -59,6 +64,8 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
59
64
|
this._contextKeyService = _contextKeyService;
|
|
60
65
|
this._telemetryService = _telemetryService;
|
|
61
66
|
this._mcpGatewayService = _mcpGatewayService;
|
|
67
|
+
this._configurationService = _configurationService;
|
|
68
|
+
this._secretStorageService = _secretStorageService;
|
|
62
69
|
this._serverIdCounter = 0;
|
|
63
70
|
this._servers = ( new Map());
|
|
64
71
|
this._serverDefinitions = ( new Map());
|
|
@@ -235,7 +242,67 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
235
242
|
const authorizationServer = URI.revive(authDetails.authorizationServer);
|
|
236
243
|
const resourceServer = authDetails.resourceMetadata?.resource ? ( URI.parse(authDetails.resourceMetadata.resource)) : undefined;
|
|
237
244
|
const resolvedScopes = authDetails.scopes ?? authDetails.resourceMetadata?.scopes_supported ?? authDetails.authorizationServerMetadata.scopes_supported ?? [];
|
|
245
|
+
if (authDetails.enterpriseManaged) {
|
|
246
|
+
const resource = authDetails.resourceMetadata?.resource;
|
|
247
|
+
if (!resource) {
|
|
248
|
+
throw ( new Error(( localize(
|
|
249
|
+
2699,
|
|
250
|
+
"The enterprise-managed MCP server '{0}' did not advertise a protected-resource metadata document with a 'resource' identifier.",
|
|
251
|
+
server.label
|
|
252
|
+
))));
|
|
253
|
+
}
|
|
254
|
+
const resourceAuthServers = authDetails.resourceMetadata?.authorization_servers ?? [];
|
|
255
|
+
const audience = resourceAuthServers[0];
|
|
256
|
+
if (!audience) {
|
|
257
|
+
throw ( new Error(( localize(
|
|
258
|
+
2700,
|
|
259
|
+
"The enterprise-managed MCP server '{0}' did not advertise an `authorization_servers` entry in its protected-resource metadata.",
|
|
260
|
+
server.label
|
|
261
|
+
))));
|
|
262
|
+
}
|
|
263
|
+
const xaaScopes = authDetails.scopes ?? authDetails.resourceMetadata?.scopes_supported ?? [];
|
|
264
|
+
const issuer = this._ensureXaaIssuer();
|
|
265
|
+
const xaaProviderId = await this._authenticationService.createOrGetXaaProvider(issuer);
|
|
266
|
+
if (!xaaProviderId) {
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
const resourceClientId = clientId ?? authDetails.clientId;
|
|
270
|
+
let resourceClientSecret;
|
|
271
|
+
if (resourceClientId) {
|
|
272
|
+
try {
|
|
273
|
+
resourceClientSecret = await this._secretStorageService.get(mcpOAuthClientSecretStorageKey(resource, resourceClientId));
|
|
274
|
+
} catch {}
|
|
275
|
+
}
|
|
276
|
+
return this._getSessionForProvider(
|
|
277
|
+
id,
|
|
278
|
+
server,
|
|
279
|
+
xaaProviderId,
|
|
280
|
+
xaaScopes,
|
|
281
|
+
issuer,
|
|
282
|
+
errorOnUserInteraction,
|
|
283
|
+
resourceClientId,
|
|
284
|
+
resource,
|
|
285
|
+
audience,
|
|
286
|
+
resourceClientSecret
|
|
287
|
+
);
|
|
288
|
+
}
|
|
238
289
|
let providerId = await this._authenticationService.getOrActivateProviderIdForServer(authorizationServer, resourceServer);
|
|
290
|
+
const resolvedClientId = clientId ?? authDetails.clientId;
|
|
291
|
+
const mcpServerUrl = server.launch.type === McpServerTransportType.HTTP ? ( server.launch.uri.toString(true)) : undefined;
|
|
292
|
+
let clientSecret;
|
|
293
|
+
let didLookupClientSecret = false;
|
|
294
|
+
if (resolvedClientId && mcpServerUrl) {
|
|
295
|
+
try {
|
|
296
|
+
clientSecret = await this._secretStorageService.get(mcpOAuthClientSecretStorageKey(mcpServerUrl, resolvedClientId));
|
|
297
|
+
didLookupClientSecret = true;
|
|
298
|
+
} catch {}
|
|
299
|
+
}
|
|
300
|
+
if (didLookupClientSecret && providerId && !forceNewRegistration && this._authenticationService.isDynamicAuthenticationProvider(providerId)) {
|
|
301
|
+
const registered = await this._dynamicAuthenticationProviderStorageService.getClientRegistration(providerId);
|
|
302
|
+
if (registered && registered.clientSecret !== clientSecret) {
|
|
303
|
+
forceNewRegistration = true;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
239
306
|
if (forceNewRegistration && providerId) {
|
|
240
307
|
if (!this._authenticationService.isDynamicAuthenticationProvider(providerId)) {
|
|
241
308
|
throw ( new Error("Cannot force new registration for a non-dynamic authentication provider."));
|
|
@@ -249,7 +316,8 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
249
316
|
authorizationServer,
|
|
250
317
|
authDetails.authorizationServerMetadata,
|
|
251
318
|
authDetails.resourceMetadata,
|
|
252
|
-
|
|
319
|
+
resolvedClientId,
|
|
320
|
+
clientSecret
|
|
253
321
|
);
|
|
254
322
|
if (!provider) {
|
|
255
323
|
return undefined;
|
|
@@ -263,10 +331,40 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
263
331
|
resolvedScopes,
|
|
264
332
|
authorizationServer,
|
|
265
333
|
errorOnUserInteraction,
|
|
266
|
-
|
|
267
|
-
authDetails.resourceMetadata?.resource
|
|
334
|
+
resolvedClientId,
|
|
335
|
+
authDetails.resourceMetadata?.resource,
|
|
336
|
+
undefined,
|
|
337
|
+
clientSecret
|
|
268
338
|
);
|
|
269
339
|
}
|
|
340
|
+
_ensureXaaIssuer() {
|
|
341
|
+
const config = this._configurationService.getValue(mcpEnterpriseManagedAuthIdpSection) ?? {};
|
|
342
|
+
const configuredIssuer = config.issuer?.trim();
|
|
343
|
+
if (!configuredIssuer) {
|
|
344
|
+
throw ( new Error(( localize(
|
|
345
|
+
2701,
|
|
346
|
+
"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
|
+
}
|
|
349
|
+
let parsed;
|
|
350
|
+
try {
|
|
351
|
+
parsed = ( URI.parse(configuredIssuer));
|
|
352
|
+
} catch {
|
|
353
|
+
throw ( new Error(( localize(
|
|
354
|
+
2702,
|
|
355
|
+
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to be a valid URL; got '{0}'.",
|
|
356
|
+
configuredIssuer
|
|
357
|
+
))));
|
|
358
|
+
}
|
|
359
|
+
if (parsed.scheme !== "https" && parsed.scheme !== "http") {
|
|
360
|
+
throw ( new Error(( localize(
|
|
361
|
+
2703,
|
|
362
|
+
"Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to use the `https` or `http` scheme; got '{0}'.",
|
|
363
|
+
configuredIssuer
|
|
364
|
+
))));
|
|
365
|
+
}
|
|
366
|
+
return parsed;
|
|
367
|
+
}
|
|
270
368
|
async _getSessionForProvider(
|
|
271
369
|
serverId,
|
|
272
370
|
server,
|
|
@@ -275,13 +373,21 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
275
373
|
authorizationServer,
|
|
276
374
|
errorOnUserInteraction = false,
|
|
277
375
|
clientId,
|
|
278
|
-
resource
|
|
376
|
+
resource,
|
|
377
|
+
audience,
|
|
378
|
+
clientSecret
|
|
279
379
|
) {
|
|
280
380
|
const sessions = await this._authenticationService.getSessions(providerId, scopes, {
|
|
281
381
|
authorizationServer,
|
|
282
382
|
clientId,
|
|
283
|
-
|
|
383
|
+
clientSecret,
|
|
384
|
+
resource,
|
|
385
|
+
audience
|
|
284
386
|
}, true);
|
|
387
|
+
if (server.launch.type !== McpServerTransportType.HTTP) {
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
390
|
+
const mcpServerUrl = ( server.launch.uri.toString(true));
|
|
285
391
|
const accountNamePreference = this.authenticationMcpServersService.getAccountPreference(server.id, providerId);
|
|
286
392
|
let matchingAccountPreferenceSession;
|
|
287
393
|
if (accountNamePreference) {
|
|
@@ -290,7 +396,12 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
290
396
|
const provider = this._authenticationService.getProvider(providerId);
|
|
291
397
|
let session;
|
|
292
398
|
if (sessions.length) {
|
|
293
|
-
if (matchingAccountPreferenceSession && this.authenticationMCPServerAccessService.
|
|
399
|
+
if (matchingAccountPreferenceSession && this.authenticationMCPServerAccessService.isAccessAllowedForUrl(
|
|
400
|
+
providerId,
|
|
401
|
+
matchingAccountPreferenceSession.account.label,
|
|
402
|
+
server.id,
|
|
403
|
+
mcpServerUrl
|
|
404
|
+
)) {
|
|
294
405
|
this.authenticationMCPServerUsageService.addAccountUsage(
|
|
295
406
|
providerId,
|
|
296
407
|
matchingAccountPreferenceSession.account.label,
|
|
@@ -301,7 +412,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
301
412
|
this._serverAuthTracking.track(providerId, serverId, scopes);
|
|
302
413
|
return matchingAccountPreferenceSession.accessToken;
|
|
303
414
|
}
|
|
304
|
-
if (!provider.supportsMultipleAccounts && this.authenticationMCPServerAccessService.
|
|
415
|
+
if (!provider.supportsMultipleAccounts && this.authenticationMCPServerAccessService.isAccessAllowedForUrl(providerId, sessions[0].account.label, server.id, mcpServerUrl)) {
|
|
305
416
|
this.authenticationMCPServerUsageService.addAccountUsage(providerId, sessions[0].account.label, scopes, server.id, server.label);
|
|
306
417
|
this._serverAuthTracking.track(providerId, serverId, scopes);
|
|
307
418
|
return sessions[0].accessToken;
|
|
@@ -330,14 +441,17 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
330
441
|
account: accountToCreate,
|
|
331
442
|
authorizationServer,
|
|
332
443
|
clientId,
|
|
333
|
-
|
|
444
|
+
clientSecret,
|
|
445
|
+
resource,
|
|
446
|
+
audience
|
|
334
447
|
});
|
|
335
448
|
} while (accountToCreate && accountToCreate.label !== session.account.label && !(await this.continueWithIncorrectAccountPrompt(session.account.label, accountToCreate.label)));
|
|
336
449
|
}
|
|
337
450
|
this.authenticationMCPServerAccessService.updateAllowedMcpServers(providerId, session.account.label, [{
|
|
338
451
|
id: server.id,
|
|
339
452
|
name: server.label,
|
|
340
|
-
allowed: true
|
|
453
|
+
allowed: true,
|
|
454
|
+
url: mcpServerUrl
|
|
341
455
|
}]);
|
|
342
456
|
this.authenticationMcpServersService.updateAccountPreference(server.id, providerId, session.account);
|
|
343
457
|
this.authenticationMCPServerUsageService.addAccountUsage(providerId, session.account.label, scopes, server.id, server.label);
|
|
@@ -346,9 +460,9 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
346
460
|
}
|
|
347
461
|
async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
|
|
348
462
|
const result = await this.dialogService.prompt({
|
|
349
|
-
message: ( localize(
|
|
463
|
+
message: ( localize(2704, "Incorrect account detected")),
|
|
350
464
|
detail: ( localize(
|
|
351
|
-
|
|
465
|
+
2705,
|
|
352
466
|
"The chosen account, {0}, does not match the requested account, {1}.",
|
|
353
467
|
chosenAccountLabel,
|
|
354
468
|
requestedAccountLabel
|
|
@@ -356,10 +470,10 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
356
470
|
type: Severity.Warning,
|
|
357
471
|
cancelButton: true,
|
|
358
472
|
buttons: [{
|
|
359
|
-
label: ( localize(
|
|
473
|
+
label: ( localize(2706, "Keep {0}", chosenAccountLabel)),
|
|
360
474
|
run: () => chosenAccountLabel
|
|
361
475
|
}, {
|
|
362
|
-
label: ( localize(
|
|
476
|
+
label: ( localize(2707, "Login with {0}", requestedAccountLabel)),
|
|
363
477
|
run: () => requestedAccountLabel
|
|
364
478
|
}]
|
|
365
479
|
});
|
|
@@ -391,7 +505,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
391
505
|
} catch (e) {
|
|
392
506
|
if (UserInteractionRequiredError.is(e)) {
|
|
393
507
|
server.pushLog(LogLevel.Warning, ( localize(
|
|
394
|
-
|
|
508
|
+
2708,
|
|
395
509
|
"Authentication session for {0} removed, stopping server",
|
|
396
510
|
providerLabel
|
|
397
511
|
)));
|
|
@@ -438,18 +552,18 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
438
552
|
}
|
|
439
553
|
async loginPrompt(mcpLabel, providerLabel, recreatingSession) {
|
|
440
554
|
const message = recreatingSession ? ( localize(
|
|
441
|
-
|
|
555
|
+
2709,
|
|
442
556
|
"The MCP Server Definition '{0}' wants you to authenticate to {1}.",
|
|
443
557
|
mcpLabel,
|
|
444
558
|
providerLabel
|
|
445
559
|
)) : ( localize(
|
|
446
|
-
|
|
560
|
+
2710,
|
|
447
561
|
"The MCP Server Definition '{0}' wants to authenticate to {1}.",
|
|
448
562
|
mcpLabel,
|
|
449
563
|
providerLabel
|
|
450
564
|
));
|
|
451
565
|
const buttons = [{
|
|
452
|
-
label: ( localize(
|
|
566
|
+
label: ( localize(2711, "&&Allow")),
|
|
453
567
|
run() {
|
|
454
568
|
return true;
|
|
455
569
|
}
|
|
@@ -474,7 +588,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
474
588
|
super.dispose();
|
|
475
589
|
}
|
|
476
590
|
};
|
|
477
|
-
MainThreadMcp = __decorate([extHostNamedCustomer(MainContext.MainThreadMcp), ( __param(1, IMcpRegistry)), ( __param(2, IDialogService)), ( __param(3, IAuthenticationService)), ( __param(4, IAuthenticationMcpService)), ( __param(5, IAuthenticationMcpAccessService)), ( __param(6, IAuthenticationMcpUsageService)), ( __param(7, IDynamicAuthenticationProviderStorageService)), ( __param(8, IExtensionService)), ( __param(9, IContextKeyService)), ( __param(10, ITelemetryService)), ( __param(11, IWorkbenchMcpGatewayService))], MainThreadMcp);
|
|
591
|
+
MainThreadMcp = __decorate([extHostNamedCustomer(MainContext.MainThreadMcp), ( __param(1, IMcpRegistry)), ( __param(2, IDialogService)), ( __param(3, IAuthenticationService)), ( __param(4, IAuthenticationMcpService)), ( __param(5, IAuthenticationMcpAccessService)), ( __param(6, IAuthenticationMcpUsageService)), ( __param(7, IDynamicAuthenticationProviderStorageService)), ( __param(8, IExtensionService)), ( __param(9, IContextKeyService)), ( __param(10, ITelemetryService)), ( __param(11, IWorkbenchMcpGatewayService)), ( __param(12, IConfigurationService)), ( __param(13, ISecretStorageService))], MainThreadMcp);
|
|
478
592
|
class ExtHostMcpServerLaunch extends Disposable {
|
|
479
593
|
pushLog(level, message) {
|
|
480
594
|
this._onDidLog.fire({
|
|
@@ -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(2712, "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(2713, "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(2714, "Cancel")),
|
|
115
115
|
run: () => undefined
|
|
116
116
|
};
|
|
117
117
|
} else {
|
|
118
118
|
cancelButton = {
|
|
119
|
-
label: ( localize(
|
|
119
|
+
label: ( localize(2715, "&&OK")),
|
|
120
120
|
run: () => undefined
|
|
121
121
|
};
|
|
122
122
|
}
|
|
@@ -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(2716, "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(2717, "Show Output")),
|
|
98
98
|
text: "$(output)",
|
|
99
|
-
ariaLabel: ( localize(
|
|
99
|
+
ariaLabel: ( localize(2718, "Show {0} Output Channel", channel.label)),
|
|
100
100
|
command: `workbench.action.output.show.${channel.id}`,
|
|
101
|
-
tooltip: ( localize(
|
|
101
|
+
tooltip: ( localize(2719, "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(2720, "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(2721, "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(2722, "{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(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { Disposable,
|
|
3
|
+
import { Disposable, DisposableMap, MutableDisposable, combinedDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
5
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
6
6
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -55,10 +55,10 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
55
55
|
this._terminalCompletionService = _terminalCompletionService;
|
|
56
56
|
this._environmentService = _environmentService;
|
|
57
57
|
this._extHostTerminals = ( new Map());
|
|
58
|
-
this._terminalProcessProxies = ( new
|
|
59
|
-
this._profileProviders = ( new
|
|
60
|
-
this._completionProviders = ( new
|
|
61
|
-
this._quickFixProviders = ( new
|
|
58
|
+
this._terminalProcessProxies = this._register(( new DisposableMap()));
|
|
59
|
+
this._profileProviders = this._register(( new DisposableMap()));
|
|
60
|
+
this._completionProviders = this._register(( new DisposableMap()));
|
|
61
|
+
this._quickFixProviders = this._register(( new DisposableMap()));
|
|
62
62
|
this._dataEventTracker = this._register(( new MutableDisposable()));
|
|
63
63
|
this._sendCommandEventListener = this._register(( new MutableDisposable()));
|
|
64
64
|
this._linkProvider = this._register(( new MutableDisposable()));
|
|
@@ -116,13 +116,6 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
116
116
|
}));
|
|
117
117
|
this._proxy.$initEnvironmentVariableCollections(serializedCollections);
|
|
118
118
|
}
|
|
119
|
-
this._store.add(toDisposable(() => {
|
|
120
|
-
for (const e of ( this._terminalProcessProxies.values())) {
|
|
121
|
-
e.proxy.dispose();
|
|
122
|
-
e.store.dispose();
|
|
123
|
-
}
|
|
124
|
-
this._terminalProcessProxies.clear();
|
|
125
|
-
}));
|
|
126
119
|
remoteAgentService.getEnvironment().then(async env => {
|
|
127
120
|
this._os = env?.os || OS;
|
|
128
121
|
this._updateDefaultProfile();
|
|
@@ -130,14 +123,6 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
130
123
|
this._register(
|
|
131
124
|
this._terminalProfileService.onDidChangeAvailableProfiles(() => this._updateDefaultProfile())
|
|
132
125
|
);
|
|
133
|
-
this._register(toDisposable(() => {
|
|
134
|
-
for (const provider of ( this._profileProviders.values())) {
|
|
135
|
-
provider.dispose();
|
|
136
|
-
}
|
|
137
|
-
for (const provider of ( this._quickFixProviders.values())) {
|
|
138
|
-
provider.dispose();
|
|
139
|
-
}
|
|
140
|
-
}));
|
|
141
126
|
}
|
|
142
127
|
async _updateDefaultProfile() {
|
|
143
128
|
const remoteAuthority = this._environmentService.remoteAuthority;
|
|
@@ -319,8 +304,7 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
319
304
|
);
|
|
320
305
|
}
|
|
321
306
|
$unregisterCompletionProvider(id) {
|
|
322
|
-
this._completionProviders.
|
|
323
|
-
this._completionProviders.delete(id);
|
|
307
|
+
this._completionProviders.deleteAndDispose(id);
|
|
324
308
|
}
|
|
325
309
|
$registerProfileProvider(id, extensionIdentifier) {
|
|
326
310
|
this._profileProviders.set(
|
|
@@ -333,8 +317,7 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
333
317
|
);
|
|
334
318
|
}
|
|
335
319
|
$unregisterProfileProvider(id) {
|
|
336
|
-
this._profileProviders.
|
|
337
|
-
this._profileProviders.delete(id);
|
|
320
|
+
this._profileProviders.deleteAndDispose(id);
|
|
338
321
|
}
|
|
339
322
|
async $registerQuickFixProvider(id, extensionId) {
|
|
340
323
|
this._quickFixProviders.set(id, this._terminalQuickFixService.registerQuickFixProvider(id, {
|
|
@@ -376,8 +359,7 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
376
359
|
}));
|
|
377
360
|
}
|
|
378
361
|
$unregisterQuickFixProvider(id) {
|
|
379
|
-
this._quickFixProviders.
|
|
380
|
-
this._quickFixProviders.delete(id);
|
|
362
|
+
this._quickFixProviders.deleteAndDispose(id);
|
|
381
363
|
}
|
|
382
364
|
_onActiveTerminalChanged(terminalId) {
|
|
383
365
|
this._proxy.$acceptActiveTerminalChanged(terminalId);
|
|
@@ -403,12 +385,7 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
403
385
|
terminalInstance.exitCode,
|
|
404
386
|
terminalInstance.exitReason ?? TerminalExitReason.Unknown
|
|
405
387
|
);
|
|
406
|
-
|
|
407
|
-
if (proxy) {
|
|
408
|
-
proxy.proxy.dispose();
|
|
409
|
-
proxy.store.dispose();
|
|
410
|
-
this._terminalProcessProxies.delete(terminalInstance.instanceId);
|
|
411
|
-
}
|
|
388
|
+
this._terminalProcessProxies.deleteAndDispose(terminalInstance.instanceId);
|
|
412
389
|
}
|
|
413
390
|
_onTerminalOpened(terminalInstance) {
|
|
414
391
|
const extHostTerminalId = terminalInstance.shellLaunchConfig.extHostTerminalId;
|
|
@@ -444,9 +421,10 @@ let MainThreadTerminalService = class MainThreadTerminalService extends Disposab
|
|
|
444
421
|
_onRequestStartExtensionTerminal(request) {
|
|
445
422
|
const proxy = request.proxy;
|
|
446
423
|
const store = ( new DisposableStore());
|
|
424
|
+
store.add(proxy);
|
|
447
425
|
this._terminalProcessProxies.set(proxy.instanceId, {
|
|
448
426
|
proxy,
|
|
449
|
-
store
|
|
427
|
+
dispose: () => store.dispose()
|
|
450
428
|
});
|
|
451
429
|
const initialDimensions = request.cols && request.rows ? {
|
|
452
430
|
columns: request.cols,
|
|
@@ -116,13 +116,13 @@ let MainThreadTunnelService = class MainThreadTunnelService extends Disposable {
|
|
|
116
116
|
}
|
|
117
117
|
async elevationPrompt(tunnelOptions, tunnel, source) {
|
|
118
118
|
return this.notificationService.prompt(Severity.Info, ( localize(
|
|
119
|
-
|
|
119
|
+
2723,
|
|
120
120
|
"The extension {0} has forwarded port {1}. You'll need to run as superuser to use port {2} locally.",
|
|
121
121
|
source,
|
|
122
122
|
tunnelOptions.remoteAddress.port,
|
|
123
123
|
tunnelOptions.localAddressPort
|
|
124
124
|
)), [{
|
|
125
|
-
label: ( localize(
|
|
125
|
+
label: ( localize(2724, "Use Port {0} as Sudo...", tunnel.tunnelRemotePort)),
|
|
126
126
|
run: async () => {
|
|
127
127
|
this.elevateionRetry = true;
|
|
128
128
|
await this.remoteExplorerService.close({
|
|
@@ -61,7 +61,7 @@ let MainThreadUriOpeners = class MainThreadUriOpeners extends Disposable {
|
|
|
61
61
|
}, token);
|
|
62
62
|
} catch (e) {
|
|
63
63
|
if (!isCancellationError(e)) {
|
|
64
|
-
const openDefaultAction = ( new Action("default", ( localize(
|
|
64
|
+
const openDefaultAction = ( new Action("default", ( localize(2725, "Open using default opener")), undefined, undefined, async () => {
|
|
65
65
|
await this.openerService.open(uri, {
|
|
66
66
|
allowTunneling: false,
|
|
67
67
|
allowContributedOpeners: defaultExternalUriOpenerId
|
|
@@ -70,7 +70,7 @@ let MainThreadUriOpeners = class MainThreadUriOpeners extends Disposable {
|
|
|
70
70
|
openDefaultAction.tooltip = ( uri.toString());
|
|
71
71
|
this.notificationService.notify({
|
|
72
72
|
severity: Severity.Error,
|
|
73
|
-
message: ( localize(
|
|
73
|
+
message: ( localize(2726, "Could not open uri with '{0}': {1}", id, (e.toString()))),
|
|
74
74
|
actions: {
|
|
75
75
|
primary: [openDefaultAction]
|
|
76
76
|
}
|
|
@@ -118,7 +118,7 @@ let MainThreadWebviews = class MainThreadWebviews extends Disposable {
|
|
|
118
118
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
|
119
119
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none';">
|
|
120
120
|
</head>
|
|
121
|
-
<body>${( localize(
|
|
121
|
+
<body>${( localize(2727, "An error occurred while loading view: {0}", escape(viewType)))}</body>
|
|
122
122
|
</html>`;
|
|
123
123
|
}
|
|
124
124
|
};
|
|
@@ -133,6 +133,7 @@ function reviveWebviewContentOptions(webviewOptions) {
|
|
|
133
133
|
return {
|
|
134
134
|
allowScripts: webviewOptions.enableScripts,
|
|
135
135
|
allowForms: webviewOptions.enableForms,
|
|
136
|
+
forwardUntrustedKeypressEvents: true,
|
|
136
137
|
enableCommandUris: webviewOptions.enableCommandUris,
|
|
137
138
|
localResourceRoots: Array.isArray(webviewOptions.localResourceRoots) ? ( webviewOptions.localResourceRoots.map(r => URI.revive(r))) : undefined,
|
|
138
139
|
portMapping: webviewOptions.portMapping
|
|
@@ -114,10 +114,10 @@ let MainThreadWorkspace = class MainThreadWorkspace extends Disposable {
|
|
|
114
114
|
const wantsToDelete = removeCount > 0;
|
|
115
115
|
if (wantsToAdd && !wantsToDelete) {
|
|
116
116
|
if (addCount === 1) {
|
|
117
|
-
message = ( localize(
|
|
117
|
+
message = ( localize(2728, "Extension '{0}' added 1 folder to the workspace", extensionName));
|
|
118
118
|
} else {
|
|
119
119
|
message = ( localize(
|
|
120
|
-
|
|
120
|
+
2729,
|
|
121
121
|
"Extension '{0}' added {1} folders to the workspace",
|
|
122
122
|
extensionName,
|
|
123
123
|
addCount
|
|
@@ -126,10 +126,10 @@ let MainThreadWorkspace = class MainThreadWorkspace extends Disposable {
|
|
|
126
126
|
}
|
|
127
127
|
else if (wantsToDelete && !wantsToAdd) {
|
|
128
128
|
if (removeCount === 1) {
|
|
129
|
-
message = ( localize(
|
|
129
|
+
message = ( localize(2730, "Extension '{0}' removed 1 folder from the workspace", extensionName));
|
|
130
130
|
} else {
|
|
131
131
|
message = ( localize(
|
|
132
|
-
|
|
132
|
+
2731,
|
|
133
133
|
"Extension '{0}' removed {1} folders from the workspace",
|
|
134
134
|
extensionName,
|
|
135
135
|
removeCount
|
|
@@ -137,7 +137,7 @@ let MainThreadWorkspace = class MainThreadWorkspace extends Disposable {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
else {
|
|
140
|
-
message = ( localize(
|
|
140
|
+
message = ( localize(2732, "Extension '{0}' changed folders of the workspace", extensionName));
|
|
141
141
|
}
|
|
142
142
|
return message;
|
|
143
143
|
}
|
|
@@ -60,7 +60,7 @@ let CustomTextEditorModel = CustomTextEditorModel_1 = class CustomTextEditorMode
|
|
|
60
60
|
}));
|
|
61
61
|
this._register(extensionService.onWillStop(e => {
|
|
62
62
|
e.veto(true, ( localize(
|
|
63
|
-
|
|
63
|
+
8731,
|
|
64
64
|
"An extension provided text editor for '{0}' is still open that would close otherwise.",
|
|
65
65
|
this.name
|
|
66
66
|
)));
|