@codingame/monaco-vscode-extensions-service-override 33.0.9 → 34.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 (39) hide show
  1. package/index.js +1 -0
  2. package/package.json +3 -3
  3. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
  4. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +6 -1
  5. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +92 -29
  6. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
  7. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +9 -10
  8. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +9 -0
  9. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +22 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +4 -3
  11. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +1 -1
  12. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
  13. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
  14. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +2 -0
  15. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
  16. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
  17. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +12 -2
  18. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +6 -1
  19. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +134 -20
  20. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
  21. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
  22. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
  23. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
  24. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
  25. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
  26. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +11 -33
  27. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
  28. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
  29. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +2 -1
  30. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
  31. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
  32. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
  33. package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
  34. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +1 -1
  35. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
  36. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
  37. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
  38. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
  39. package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +5 -5
package/index.js CHANGED
@@ -145,6 +145,7 @@ import './vscode/src/vs/workbench/api/browser/mainThreadMcp.js';
145
145
  import './vscode/src/vs/workbench/api/browser/mainThreadChatContext.js';
146
146
  import './vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js';
147
147
  import './vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js';
148
+ import './vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js';
148
149
  import './vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js';
149
150
  import './vscode/src/vs/workbench/api/browser/mainThreadChatOutputRenderer.js';
150
151
  import './vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-extensions-service-override",
3
- "version": "33.0.9",
3
+ "version": "34.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - extensions service-override",
6
6
  "keywords": [],
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "33.0.9",
19
- "@codingame/monaco-vscode-files-service-override": "33.0.9"
18
+ "@codingame/monaco-vscode-api": "34.0.0",
19
+ "@codingame/monaco-vscode-files-service-override": "34.0.0"
20
20
  },
21
21
  "main": "index.js",
22
22
  "module": "index.js",
@@ -13,9 +13,9 @@ import { getIdAndVersion, areSameExtensions, getGalleryExtensionId, getExtension
13
13
  import { ExtensionType, EXTENSION_CATEGORIES } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
14
14
  import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
15
15
 
16
- const notFound = id => ( localize(1920, "Extension '{0}' not found.", id));
16
+ const notFound = id => ( localize(1950, "Extension '{0}' not found.", id));
17
17
  const useId = ( localize(
18
- 1921,
18
+ 1951,
19
19
  "Make sure you use the full extension ID, including the publisher, e.g.: {0}",
20
20
  "ms-dotnettools.csharp"
21
21
  ));
@@ -62,7 +62,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
62
62
  return;
63
63
  }
64
64
  if (this.location) {
65
- this.logger.info(( localize(1922, "Extensions installed on {0}:", this.location)));
65
+ this.logger.info(( localize(1952, "Extensions installed on {0}:", this.location)));
66
66
  }
67
67
  extensions = extensions.sort((e1, e2) => e1.identifier.id.localeCompare(e2.identifier.id));
68
68
  let lastId = undefined;
@@ -77,7 +77,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
77
77
  const failed = [];
78
78
  try {
79
79
  if (extensions.length) {
80
- this.logger.info(this.location ? ( localize(1923, "Installing extensions on {0}...", this.location)) : ( localize(1924, "Installing extensions...")));
80
+ this.logger.info(this.location ? ( localize(1953, "Installing extensions on {0}...", this.location)) : ( localize(1954, "Installing extensions...")));
81
81
  }
82
82
  const installVSIXInfos = [];
83
83
  const installExtensionInfos = [];
@@ -142,11 +142,11 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
142
142
  failed.push(...failedGalleryExtensions);
143
143
  }
144
144
  } catch (error) {
145
- this.logger.error(( localize(1925, "Error while installing extensions: {0}", getErrorMessage(error))));
145
+ this.logger.error(( localize(1955, "Error while installing extensions: {0}", getErrorMessage(error))));
146
146
  throw error;
147
147
  }
148
148
  if (failed.length) {
149
- throw ( new Error(( localize(1926, "Failed Installing Extensions: {0}", failed.join(", ")))));
149
+ throw ( new Error(( localize(1956, "Failed Installing Extensions: {0}", failed.join(", ")))));
150
150
  }
151
151
  }
152
152
  async updateExtensions(profileLocation) {
@@ -161,7 +161,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
161
161
  }
162
162
  }
163
163
  this.logger.trace(( localize(
164
- 1927,
164
+ 1957,
165
165
  "Fetching latest versions for {0} extensions",
166
166
  installedExtensionsQuery.length
167
167
  )));
@@ -185,11 +185,11 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
185
185
  }
186
186
  }
187
187
  if (!extensionsToUpdate.length) {
188
- this.logger.info(( localize(1928, "No extension to update")));
188
+ this.logger.info(( localize(1958, "No extension to update")));
189
189
  return;
190
190
  }
191
191
  this.logger.info(( localize(
192
- 1929,
192
+ 1959,
193
193
  "Updating extensions: {0}",
194
194
  ( extensionsToUpdate.map(ext => ext.extension.identifier.id)).join(", ")
195
195
  )));
@@ -197,14 +197,14 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
197
197
  for (const extensionResult of installationResult) {
198
198
  if (extensionResult.error) {
199
199
  this.logger.error(( localize(
200
- 1930,
200
+ 1960,
201
201
  "Error while updating extension {0}: {1}",
202
202
  extensionResult.identifier.id,
203
203
  getErrorMessage(extensionResult.error)
204
204
  )));
205
205
  } else {
206
206
  this.logger.info(( localize(
207
- 1931,
207
+ 1961,
208
208
  "Extension '{0}' v{1} was successfully updated.",
209
209
  extensionResult.identifier.id,
210
210
  extensionResult.local?.manifest.version
@@ -230,7 +230,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
230
230
  }
231
231
  if (!force && (!version || (version === "prerelease" && installedExtension.preRelease))) {
232
232
  this.logger.info(( localize(
233
- 1932,
233
+ 1962,
234
234
  "Extension '{0}' v{1} is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: '{2}@1.2.3'.",
235
235
  id,
236
236
  installedExtension.manifest.version,
@@ -239,7 +239,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
239
239
  return false;
240
240
  }
241
241
  if (version && installedExtension.manifest.version === version) {
242
- this.logger.info(( localize(1933, "Extension '{0}' is already installed.", `${id}@${version}`)));
242
+ this.logger.info(( localize(1963, "Extension '{0}' is already installed.", `${id}@${version}`)));
243
243
  return false;
244
244
  }
245
245
  if (installedExtension.preRelease && version !== "prerelease") {
@@ -281,23 +281,23 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
281
281
  if (installedExtension) {
282
282
  if (gallery.version === installedExtension.manifest.version) {
283
283
  this.logger.info(( localize(
284
- 1933,
284
+ 1963,
285
285
  "Extension '{0}' is already installed.",
286
286
  version ? `${id}@${version}` : id
287
287
  )));
288
288
  return;
289
289
  }
290
290
  this.logger.info(( localize(
291
- 1934,
291
+ 1964,
292
292
  "Updating the extension '{0}' to the version {1}",
293
293
  id,
294
294
  gallery.version
295
295
  )));
296
296
  }
297
297
  if (installOptions.isBuiltin) {
298
- this.logger.info(version ? ( localize(1935, "Installing builtin extension '{0}' v{1}...", id, version)) : ( localize(1936, "Installing builtin extension '{0}'...", id)));
298
+ this.logger.info(version ? ( localize(1965, "Installing builtin extension '{0}' v{1}...", id, version)) : ( localize(1966, "Installing builtin extension '{0}'...", id)));
299
299
  } else {
300
- this.logger.info(version ? ( localize(1937, "Installing extension '{0}' v{1}...", id, version)) : ( localize(1938, "Installing extension '{0}'...", id)));
300
+ this.logger.info(version ? ( localize(1967, "Installing extension '{0}' v{1}...", id, version)) : ( localize(1968, "Installing extension '{0}'...", id)));
301
301
  }
302
302
  extensionsToInstall.push({
303
303
  extension: gallery,
@@ -313,7 +313,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
313
313
  for (const extensionResult of installationResult) {
314
314
  if (extensionResult.error) {
315
315
  this.logger.error(( localize(
316
- 1939,
316
+ 1969,
317
317
  "Error while installing extension {0}: {1}",
318
318
  extensionResult.identifier.id,
319
319
  getErrorMessage(extensionResult.error)
@@ -321,7 +321,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
321
321
  failed.push(extensionResult.identifier.id);
322
322
  } else {
323
323
  this.logger.info(( localize(
324
- 1940,
324
+ 1970,
325
325
  "Extension '{0}' v{1} was successfully installed.",
326
326
  extensionResult.identifier.id,
327
327
  extensionResult.local?.manifest.version
@@ -343,10 +343,10 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
343
343
  ...installOptions,
344
344
  installGivenVersion: true
345
345
  });
346
- this.logger.info(( localize(1941, "Extension '{0}' was successfully installed.", basename(vsix))));
346
+ this.logger.info(( localize(1971, "Extension '{0}' was successfully installed.", basename(vsix))));
347
347
  } catch (error) {
348
348
  if (isCancellationError(error)) {
349
- this.logger.info(( localize(1942, "Cancelled installing extension '{0}'.", basename(vsix))));
349
+ this.logger.info(( localize(1972, "Cancelled installing extension '{0}'.", basename(vsix))));
350
350
  } else {
351
351
  throw error;
352
352
  }
@@ -393,7 +393,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
393
393
  if (!force) {
394
394
  if (semverExports.gt(existingExtension.manifest.version, manifest.version)) {
395
395
  this.logger.info(( localize(
396
- 1943,
396
+ 1973,
397
397
  "A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",
398
398
  existingExtension.identifier.id,
399
399
  existingExtension.manifest.version,
@@ -424,7 +424,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
424
424
  }
425
425
  if (( extensionsToUninstall.some(e => e.type === ExtensionType.System))) {
426
426
  this.logger.info(( localize(
427
- 1944,
427
+ 1974,
428
428
  "Extension '{0}' is a Built-in extension and cannot be uninstalled",
429
429
  id
430
430
  )));
@@ -432,13 +432,13 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
432
432
  }
433
433
  if (!force && ( extensionsToUninstall.some(e => e.isBuiltin))) {
434
434
  this.logger.info(( localize(
435
- 1945,
435
+ 1975,
436
436
  "Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",
437
437
  id
438
438
  )));
439
439
  return;
440
440
  }
441
- this.logger.info(( localize(1946, "Uninstalling {0}...", id)));
441
+ this.logger.info(( localize(1976, "Uninstalling {0}...", id)));
442
442
  for (const extensionToUninstall of extensionsToUninstall) {
443
443
  await this.extensionManagementService.uninstall(extensionToUninstall, {
444
444
  profileLocation
@@ -446,13 +446,13 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
446
446
  }
447
447
  if (this.location) {
448
448
  this.logger.info(( localize(
449
- 1947,
449
+ 1977,
450
450
  "Extension '{0}' was successfully uninstalled from {1}!",
451
451
  id,
452
452
  this.location
453
453
  )));
454
454
  } else {
455
- this.logger.info(( localize(1948, "Extension '{0}' was successfully uninstalled!", id)));
455
+ this.logger.info(( localize(1978, "Extension '{0}' was successfully uninstalled!", id)));
456
456
  }
457
457
  }
458
458
  }
@@ -470,12 +470,12 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
470
470
  });
471
471
  }
472
472
  notInstalled(id) {
473
- return this.location ? ( localize(1949, "Extension '{0}' is not installed on {1}.", id, this.location)) : ( localize(1950, "Extension '{0}' is not installed.", id));
473
+ return this.location ? ( localize(1979, "Extension '{0}' is not installed on {1}.", id, this.location)) : ( localize(1980, "Extension '{0}' is not installed.", id));
474
474
  }
475
475
  validateBuiltinExtensionEnabledWithAutoUpdates(extension) {
476
476
  if (extension.isBuiltin && ( this.productService.builtInExtensionsEnabledWithAutoUpdates.some(e => e.toLowerCase() === extension.identifier.id.toLowerCase())) && !extension.forceAutoUpdate) {
477
477
  return localize(
478
- 1951,
478
+ 1981,
479
479
  "Extension '{0}' is a built-in extension and not allowed to be updated in the current product quality '{1}'.",
480
480
  extension.identifier.id,
481
481
  this.productService.quality
@@ -18,7 +18,9 @@ import { IAuthorizationTokenResponse } from "@codingame/monaco-vscode-api/vscode
18
18
  import { IDynamicAuthenticationProviderStorageService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service";
19
19
  import { IClipboardService } from "@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service";
20
20
  import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
21
+ import { ISecretStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service";
21
22
  import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
23
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
22
24
  export interface AuthenticationInteractiveOptions {
23
25
  detail?: string;
24
26
  learnMore?: UriComponents;
@@ -48,11 +50,13 @@ export declare class MainThreadAuthentication extends Disposable implements Main
48
50
  private readonly dynamicAuthProviderStorageService;
49
51
  private readonly clipboardService;
50
52
  private readonly quickInputService;
53
+ private readonly configurationService;
54
+ private readonly secretStorageService;
51
55
  private readonly _proxy;
52
56
  private readonly _registrations;
53
57
  private _sentProviderUsageEvents;
54
58
  private _suppressUnregisterEvent;
55
- constructor(extHostContext: IExtHostContext, productService: IProductService, authenticationService: IAuthenticationService, authenticationExtensionsService: IAuthenticationExtensionsService, authenticationAccessService: IAuthenticationAccessService, authenticationUsageService: IAuthenticationUsageService, dialogService: IDialogService, notificationService: INotificationService, extensionService: IExtensionService, telemetryService: ITelemetryService, openerService: IOpenerService, logService: ILogService, urlService: IURLService, dynamicAuthProviderStorageService: IDynamicAuthenticationProviderStorageService, clipboardService: IClipboardService, quickInputService: IQuickInputService);
59
+ constructor(extHostContext: IExtHostContext, productService: IProductService, authenticationService: IAuthenticationService, authenticationExtensionsService: IAuthenticationExtensionsService, authenticationAccessService: IAuthenticationAccessService, authenticationUsageService: IAuthenticationUsageService, dialogService: IDialogService, notificationService: INotificationService, extensionService: IExtensionService, telemetryService: ITelemetryService, openerService: IOpenerService, logService: ILogService, urlService: IURLService, dynamicAuthProviderStorageService: IDynamicAuthenticationProviderStorageService, clipboardService: IClipboardService, quickInputService: IQuickInputService, configurationService: IConfigurationService, secretStorageService: ISecretStorageService);
56
60
  $registerAuthenticationProvider({ id, label, supportsMultipleAccounts, resourceServer, supportedAuthorizationServers, supportsChallenges }: IRegisterAuthenticationProviderDetails): Promise<void>;
57
61
  $unregisterAuthenticationProvider(id: string): Promise<void>;
58
62
  $ensureProvider(id: string): Promise<void>;
@@ -85,4 +89,5 @@ export declare class MainThreadAuthentication extends Disposable implements Main
85
89
  clientId: string;
86
90
  clientSecret?: string;
87
91
  } | undefined>;
92
+ $promptForResourceClientSecret(resourceClientId: string, resource: string): Promise<string | undefined>;
88
93
  }
@@ -23,10 +23,15 @@ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log
23
23
  import { ExtensionHostKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionHostKind';
24
24
  import { IURLService } from '@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service';
25
25
  import { DeferredPromise, raceTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
26
+ import { fetchAuthorizationServerMetadata } from '@codingame/monaco-vscode-api/vscode/vs/base/common/oauth';
26
27
  import { IDynamicAuthenticationProviderStorageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service';
27
28
  import { IClipboardService } from '@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service';
28
29
  import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
30
+ import { ISecretStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service';
31
+ import { mcpOAuthClientSecretStorageKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
29
32
  import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
33
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
34
+ import { mcpEnterpriseManagedAuthIdpSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
30
35
 
31
36
  class MainThreadAuthenticationProvider extends Disposable {
32
37
  constructor(
@@ -101,7 +106,9 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
101
106
  urlService,
102
107
  dynamicAuthProviderStorageService,
103
108
  clipboardService,
104
- quickInputService
109
+ quickInputService,
110
+ configurationService,
111
+ secretStorageService
105
112
  ) {
106
113
  super();
107
114
  this.productService = productService;
@@ -119,6 +126,8 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
119
126
  this.dynamicAuthProviderStorageService = dynamicAuthProviderStorageService;
120
127
  this.clipboardService = clipboardService;
121
128
  this.quickInputService = quickInputService;
129
+ this.configurationService = configurationService;
130
+ this.secretStorageService = secretStorageService;
122
131
  this._registrations = this._register(( new DisposableMap()));
123
132
  this._sentProviderUsageEvents = ( new Set());
124
133
  this._suppressUnregisterEvent = false;
@@ -141,11 +150,17 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
141
150
  }));
142
151
  this._register(authenticationService.registerAuthenticationProviderHostDelegate({
143
152
  priority: extHostContext.extensionHostKind === ExtensionHostKind.LocalWebWorker ? 0 : 1,
144
- create: async (authorizationServer, serverMetadata, resource, overrideClientId) => {
153
+ create: async (
154
+ authorizationServer,
155
+ serverMetadata,
156
+ resource,
157
+ overrideClientId,
158
+ overrideClientSecret
159
+ ) => {
145
160
  const authProviderId = resource ? `${( authorizationServer.toString(true))} ${resource.resource}` : ( authorizationServer.toString(true));
146
161
  const clientDetails = await this.dynamicAuthProviderStorageService.getClientRegistration(authProviderId);
147
162
  let clientId = overrideClientId ?? clientDetails?.clientId;
148
- const clientSecret = overrideClientId ? undefined : clientDetails?.clientSecret;
163
+ const clientSecret = overrideClientId ? overrideClientSecret : (overrideClientSecret ?? clientDetails?.clientSecret);
149
164
  let initialTokens = undefined;
150
165
  if (clientId) {
151
166
  initialTokens = await this.dynamicAuthProviderStorageService.getSessionsForDynamicAuthProvider(authProviderId, clientId);
@@ -160,6 +175,23 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
160
175
  clientSecret,
161
176
  initialTokens
162
177
  );
178
+ },
179
+ createXaa: async issuer => {
180
+ const authProviderId = `xaa:${( issuer.toString(true))}`;
181
+ const {
182
+ metadata: serverMetadata
183
+ } = await fetchAuthorizationServerMetadata(( issuer.toString(true)));
184
+ const configuredIdp = this.configurationService.getValue(mcpEnterpriseManagedAuthIdpSection) ?? {};
185
+ const configuredClientId = configuredIdp.clientId?.trim() || undefined;
186
+ const configuredClientSecret = configuredIdp.clientSecret?.trim() || undefined;
187
+ const cached = await this.dynamicAuthProviderStorageService.getClientRegistration(authProviderId);
188
+ const clientId = configuredClientId ?? cached?.clientId;
189
+ const clientSecret = configuredClientSecret ?? cached?.clientSecret;
190
+ let initialTokens = undefined;
191
+ if (clientId) {
192
+ initialTokens = await this.dynamicAuthProviderStorageService.getSessionsForDynamicAuthProvider(authProviderId, clientId);
193
+ }
194
+ return await this._proxy.$registerXaaAuthProvider(issuer, serverMetadata, clientId, clientSecret, initialTokens);
163
195
  }
164
196
  }));
165
197
  }
@@ -245,8 +277,8 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
245
277
  return await deferredPromise.p;
246
278
  }
247
279
  $showContinueNotification(message) {
248
- const yes = ( localize(2584, "Yes"));
249
- const no = ( localize(2585, "No"));
280
+ const yes = ( localize(2633, "Yes"));
281
+ const no = ( localize(2634, "No"));
250
282
  const deferredPromise = ( new DeferredPromise());
251
283
  let result = false;
252
284
  const handle = this.notificationService.prompt(Severity.Warning, message, [{
@@ -302,26 +334,26 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
302
334
  message = customMessage;
303
335
  } else {
304
336
  message = recreatingSession ? ( localize(
305
- 2586,
337
+ 2635,
306
338
  "The extension '{0}' wants you to sign in again using {1}.",
307
339
  extensionName,
308
340
  provider.label
309
341
  )) : ( localize(
310
- 2587,
342
+ 2636,
311
343
  "The extension '{0}' wants to sign in using {1}.",
312
344
  extensionName,
313
345
  provider.label
314
346
  ));
315
347
  }
316
348
  const buttons = [{
317
- label: ( localize(2588, "&&Allow")),
349
+ label: ( localize(2637, "&&Allow")),
318
350
  run() {
319
351
  return true;
320
352
  }
321
353
  }];
322
354
  if (options?.learnMore) {
323
355
  buttons.push({
324
- label: ( localize(2589, "Learn more")),
356
+ label: ( localize(2638, "Learn more")),
325
357
  run: async () => {
326
358
  const result = this.loginPrompt(provider, extensionName, recreatingSession, options);
327
359
  await this.openerService.open(URI.revive(options.learnMore), {
@@ -344,9 +376,9 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
344
376
  }
345
377
  async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
346
378
  const result = await this.dialogService.prompt({
347
- message: ( localize(2590, "Incorrect account detected")),
379
+ message: ( localize(2639, "Incorrect account detected")),
348
380
  detail: ( localize(
349
- 2591,
381
+ 2640,
350
382
  "The chosen account, {0}, does not match the requested account, {1}.",
351
383
  chosenAccountLabel,
352
384
  requestedAccountLabel
@@ -354,10 +386,10 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
354
386
  type: Severity.Warning,
355
387
  cancelButton: true,
356
388
  buttons: [{
357
- label: ( localize(2592, "Keep {0}", chosenAccountLabel)),
389
+ label: ( localize(2641, "Keep {0}", chosenAccountLabel)),
358
390
  run: () => chosenAccountLabel
359
391
  }, {
360
- label: ( localize(2593, "Login with {0}", requestedAccountLabel)),
392
+ label: ( localize(2642, "Login with {0}", requestedAccountLabel)),
361
393
  run: () => requestedAccountLabel
362
394
  }]
363
395
  });
@@ -510,15 +542,15 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
510
542
  result
511
543
  } = await this.dialogService.prompt({
512
544
  type: Severity.Info,
513
- message: ( localize(2594, "Device Code Authentication")),
545
+ message: ( localize(2643, "Device Code Authentication")),
514
546
  detail: ( localize(
515
- 2595,
547
+ 2644,
516
548
  "Your code: {0}\n\nTo complete authentication, navigate to {1} and enter the code above.",
517
549
  userCode,
518
550
  verificationUri
519
551
  )),
520
552
  buttons: [{
521
- label: ( localize(2596, "Copy & Continue")),
553
+ label: ( localize(2645, "Copy & Continue")),
522
554
  run: () => true
523
555
  }],
524
556
  cancelButton: true
@@ -528,7 +560,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
528
560
  await this.clipboardService.writeText(userCode);
529
561
  return await this.openerService.open(( URI.parse(verificationUri)));
530
562
  } catch (error) {
531
- this.notificationService.error(( localize(2597, "Failed to open {0}", verificationUri)));
563
+ this.notificationService.error(( localize(2646, "Failed to open {0}", verificationUri)));
532
564
  }
533
565
  }
534
566
  return false;
@@ -537,44 +569,44 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
537
569
  const redirectUrls = "http://127.0.0.1:33418\nhttps://vscode.dev/redirect";
538
570
  const result = await this.dialogService.prompt({
539
571
  type: Severity.Info,
540
- message: ( localize(2598, "Dynamic Client Registration not supported")),
572
+ message: ( localize(2647, "Dynamic Client Registration not supported")),
541
573
  detail: ( localize(
542
- 2599,
574
+ 2648,
543
575
  "The authorization server '{0}' does not support automatic client registration. Do you want to proceed by manually providing a client registration (client ID)?\n\nNote: When registering your OAuth application, make sure to include these redirect URIs:\n{1}",
544
576
  authorizationServerUrl,
545
577
  redirectUrls
546
578
  )),
547
579
  buttons: [{
548
- label: ( localize(2600, "Copy URIs & Proceed")),
580
+ label: ( localize(2649, "Copy URIs & Proceed")),
549
581
  run: async () => {
550
582
  try {
551
583
  await this.clipboardService.writeText(redirectUrls);
552
584
  } catch (error) {
553
- this.notificationService.error(( localize(2601, "Failed to copy redirect URIs to clipboard.")));
585
+ this.notificationService.error(( localize(2650, "Failed to copy redirect URIs to clipboard.")));
554
586
  }
555
587
  return true;
556
588
  }
557
589
  }],
558
590
  cancelButton: {
559
- label: ( localize(2602, "Cancel")),
591
+ label: ( localize(2651, "Cancel")),
560
592
  run: () => false
561
593
  }
562
594
  });
563
595
  if (!result) {
564
596
  return undefined;
565
597
  }
566
- const sharedTitle = ( localize(2603, "Add Client Registration Details"));
598
+ const sharedTitle = ( localize(2652, "Add Client Registration Details"));
567
599
  const clientId = await this.quickInputService.input({
568
600
  title: sharedTitle,
569
601
  prompt: ( localize(
570
- 2604,
602
+ 2653,
571
603
  "Enter an existing client ID that has been registered with the following redirect URIs: http://127.0.0.1:33418, https://vscode.dev/redirect"
572
604
  )),
573
- placeHolder: ( localize(2605, "OAuth client ID (azye39d...)")),
605
+ placeHolder: ( localize(2654, "OAuth client ID (azye39d...)")),
574
606
  ignoreFocusLost: true,
575
607
  validateInput: async value => {
576
608
  if (!value || value.trim().length === 0) {
577
- return localize(2606, "Client ID is required");
609
+ return localize(2655, "Client ID is required");
578
610
  }
579
611
  return undefined;
580
612
  }
@@ -585,11 +617,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
585
617
  const clientSecret = await this.quickInputService.input({
586
618
  title: sharedTitle,
587
619
  prompt: ( localize(
588
- 2607,
620
+ 2656,
589
621
  "(optional) Enter an existing client secret associated with the client id '{0}' or leave this field blank",
590
622
  clientId
591
623
  )),
592
- placeHolder: ( localize(2608, "OAuth client secret (wer32o50f...) or leave it blank")),
624
+ placeHolder: ( localize(2657, "OAuth client secret (wer32o50f...) or leave it blank")),
593
625
  password: true,
594
626
  ignoreFocusLost: true
595
627
  });
@@ -598,9 +630,40 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
598
630
  clientSecret: clientSecret?.trim() || undefined
599
631
  };
600
632
  }
633
+ async $promptForResourceClientSecret(resourceClientId, resource) {
634
+ const value = await this.quickInputService.input({
635
+ title: ( localize(2658, "Resource Client Secret Required")),
636
+ prompt: ( localize(
637
+ 2659,
638
+ "The resource at '{0}' uses a per-resource client identifier '{1}'. Enter the matching client secret (leave blank if none). The value is saved in OS secret storage; manage it later via the 'Set Client Secret' code lens in mcp.json.",
639
+ resource,
640
+ resourceClientId
641
+ )),
642
+ placeHolder: ( localize(2660, "Resource client secret")),
643
+ password: true,
644
+ ignoreFocusLost: true
645
+ });
646
+ if (value === undefined) {
647
+ return undefined;
648
+ }
649
+ const trimmed = value.trim();
650
+ const key = mcpOAuthClientSecretStorageKey(resource, resourceClientId);
651
+ try {
652
+ if (trimmed.length === 0) {
653
+ await this.secretStorageService.delete(key);
654
+ } else {
655
+ await this.secretStorageService.set(key, trimmed);
656
+ }
657
+ } catch (err) {
658
+ this.logService.warn(
659
+ `[XAA] Failed to persist resource client secret for ${resource} / ${resourceClientId}: ${err.message}`
660
+ );
661
+ }
662
+ return trimmed;
663
+ }
601
664
  };
602
665
  MainThreadAuthentication = __decorate(
603
- [extHostNamedCustomer(MainContext.MainThreadAuthentication), ( __param(1, IProductService)), ( __param(2, IAuthenticationService)), ( __param(3, IAuthenticationExtensionsService)), ( __param(4, IAuthenticationAccessService)), ( __param(5, IAuthenticationUsageService)), ( __param(6, IDialogService)), ( __param(7, INotificationService)), ( __param(8, IExtensionService)), ( __param(9, ITelemetryService)), ( __param(10, IOpenerService)), ( __param(11, ILogService)), ( __param(12, IURLService)), ( __param(13, IDynamicAuthenticationProviderStorageService)), ( __param(14, IClipboardService)), ( __param(15, IQuickInputService))],
666
+ [extHostNamedCustomer(MainContext.MainThreadAuthentication), ( __param(1, IProductService)), ( __param(2, IAuthenticationService)), ( __param(3, IAuthenticationExtensionsService)), ( __param(4, IAuthenticationAccessService)), ( __param(5, IAuthenticationUsageService)), ( __param(6, IDialogService)), ( __param(7, INotificationService)), ( __param(8, IExtensionService)), ( __param(9, ITelemetryService)), ( __param(10, IOpenerService)), ( __param(11, ILogService)), ( __param(12, IURLService)), ( __param(13, IDynamicAuthenticationProviderStorageService)), ( __param(14, IClipboardService)), ( __param(15, IQuickInputService)), ( __param(16, IConfigurationService)), ( __param(17, ISecretStorageService))],
604
667
  MainThreadAuthentication
605
668
  );
606
669
 
@@ -108,7 +108,7 @@ let RemoteExtensionManagementCLI = class RemoteExtensionManagementCLI extends Ex
108
108
  if (
109
109
  !this._extensionManifestPropertiesService.canExecuteOnWorkspace(manifest) && !(isWeb && this._extensionManifestPropertiesService.canExecuteOnWeb(manifest))) {
110
110
  this.logger.info(( localize(
111
- 2609,
111
+ 2661,
112
112
  "Cannot install the '{0}' extension because it is declared to not run in this setup.",
113
113
  getExtensionId(manifest.publisher, manifest.name)
114
114
  )));
@@ -39,7 +39,7 @@ import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode
39
39
  import { NotebookDto } from './mainThreadNotebookDto.js';
40
40
  import { isUntitledChatSession, getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
41
41
  import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
42
- import { AICustomizationManagementSection, BUILTIN_STORAGE } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
42
+ import { AICustomizationManagementSection, AICustomizationSources } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
43
43
  import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
44
44
  import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
45
45
  import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
@@ -654,6 +654,10 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
654
654
  }
655
655
  return ( contributions.map(c => {
656
656
  return {
657
+ name: c.name,
658
+ description: c.description,
659
+ sessionTypes: c.sessionTypes,
660
+ when: c.when,
657
661
  uri: URI.revive(c.uri)
658
662
  };
659
663
  }));
@@ -687,8 +691,8 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
687
691
  this._customizationProviderEmitters.set(handle, emitter);
688
692
  const itemProvider = {
689
693
  onDidChange: emitter.event,
690
- provideChatSessionCustomizations: async token => {
691
- const items = await this._proxy.$provideChatSessionCustomizations(handle, token);
694
+ provideChatSessionCustomizations: async (sessionResource, token) => {
695
+ const items = await this._proxy.$provideChatSessionCustomizations(handle, sessionResource, token);
692
696
  if (!items) {
693
697
  return undefined;
694
698
  }
@@ -696,6 +700,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
696
700
  uri: URI.revive(item.uri),
697
701
  type: item.type,
698
702
  name: item.name,
703
+ source: item.source,
699
704
  description: item.description,
700
705
  groupKey: item.groupKey,
701
706
  badge: item.badge,
@@ -731,13 +736,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
731
736
  icon: metadata.iconId ? ThemeIcon.fromId(metadata.iconId) : ThemeIcon.fromId(Codicon.extensions.id),
732
737
  hiddenSections,
733
738
  getStorageSourceFilter: () => ({
734
- sources: [
735
- PromptsStorage.local,
736
- PromptsStorage.user,
737
- PromptsStorage.plugin,
738
- PromptsStorage.extension,
739
- BUILTIN_STORAGE
740
- ]
739
+ sources: AICustomizationSources.all
741
740
  }),
742
741
  itemProvider
743
742
  };
@@ -0,0 +1,9 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service";
3
+ import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
4
+ import { IQuotaSnapshotsDto, MainThreadChatQuotaShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
5
+ export declare class MainThreadChatQuota extends Disposable implements MainThreadChatQuotaShape {
6
+ private readonly _chatEntitlementService;
7
+ constructor(extHostContext: IExtHostContext, _chatEntitlementService: IChatEntitlementService);
8
+ $updateQuotas(quotas: IQuotaSnapshotsDto): void;
9
+ }