@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.
Files changed (58) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
  3. package/vscode/src/vs/platform/telemetry/common/assignmentContext.d.ts +4 -0
  4. package/vscode/src/vs/platform/telemetry/common/assignmentContext.js +13 -0
  5. package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.d.ts +1 -0
  6. package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.js +14 -1
  7. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +9 -3
  8. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +56 -39
  9. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
  10. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +2 -2
  11. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +6 -5
  12. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +2 -2
  13. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +5 -2
  14. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +2 -2
  15. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +7 -2
  16. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +8 -3
  17. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +6 -6
  18. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
  19. package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.d.ts +17 -1
  20. package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +130 -4
  21. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +2 -8
  22. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.d.ts +2 -3
  23. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +8 -12
  24. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
  25. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +9 -1
  26. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
  27. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
  28. package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +1 -1
  29. package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +2 -2
  30. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +1 -0
  31. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
  32. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +42 -0
  33. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +42 -23
  34. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
  35. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +2 -0
  36. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
  37. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
  38. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
  39. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
  40. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
  41. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.d.ts +19 -0
  42. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +14 -1
  43. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +12 -5
  44. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
  45. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +5 -3
  46. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +5 -1
  47. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +39 -4
  48. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
  49. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
  50. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
  51. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
  52. package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
  53. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
  54. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
  55. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +1 -1
  56. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
  57. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
  58. package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-extensions-service-override",
3
- "version": "36.2.7",
3
+ "version": "37.1.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": "36.2.7",
19
- "@codingame/monaco-vscode-files-service-override": "36.2.7"
18
+ "@codingame/monaco-vscode-api": "37.1.0",
19
+ "@codingame/monaco-vscode-files-service-override": "37.1.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(2026, "Extension '{0}' not found.", id));
16
+ const notFound = id => ( localize(2244, "Extension '{0}' not found.", id));
17
17
  const useId = ( localize(
18
- 2027,
18
+ 2245,
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(2028, "Extensions installed on {0}:", this.location)));
65
+ this.logger.info(( localize(2246, "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(2029, "Installing extensions on {0}...", this.location)) : ( localize(2030, "Installing extensions...")));
80
+ this.logger.info(this.location ? ( localize(2247, "Installing extensions on {0}...", this.location)) : ( localize(2248, "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(2031, "Error while installing extensions: {0}", getErrorMessage(error))));
145
+ this.logger.error(( localize(2249, "Error while installing extensions: {0}", getErrorMessage(error))));
146
146
  throw error;
147
147
  }
148
148
  if (failed.length) {
149
- throw ( new Error(( localize(2032, "Failed Installing Extensions: {0}", failed.join(", ")))));
149
+ throw ( new Error(( localize(2250, "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
- 2033,
164
+ 2251,
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(2034, "No extension to update")));
188
+ this.logger.info(( localize(2252, "No extension to update")));
189
189
  return;
190
190
  }
191
191
  this.logger.info(( localize(
192
- 2035,
192
+ 2253,
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
- 2036,
200
+ 2254,
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
- 2037,
207
+ 2255,
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
- 2038,
233
+ 2256,
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(2039, "Extension '{0}' is already installed.", `${id}@${version}`)));
242
+ this.logger.info(( localize(2257, "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
- 2039,
284
+ 2257,
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
- 2040,
291
+ 2258,
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(2041, "Installing builtin extension '{0}' v{1}...", id, version)) : ( localize(2042, "Installing builtin extension '{0}'...", id)));
298
+ this.logger.info(version ? ( localize(2259, "Installing builtin extension '{0}' v{1}...", id, version)) : ( localize(2260, "Installing builtin extension '{0}'...", id)));
299
299
  } else {
300
- this.logger.info(version ? ( localize(2043, "Installing extension '{0}' v{1}...", id, version)) : ( localize(2044, "Installing extension '{0}'...", id)));
300
+ this.logger.info(version ? ( localize(2261, "Installing extension '{0}' v{1}...", id, version)) : ( localize(2262, "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
- 2045,
316
+ 2263,
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
- 2046,
324
+ 2264,
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(2047, "Extension '{0}' was successfully installed.", basename(vsix))));
346
+ this.logger.info(( localize(2265, "Extension '{0}' was successfully installed.", basename(vsix))));
347
347
  } catch (error) {
348
348
  if (isCancellationError(error)) {
349
- this.logger.info(( localize(2048, "Cancelled installing extension '{0}'.", basename(vsix))));
349
+ this.logger.info(( localize(2266, "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
- 2049,
396
+ 2267,
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
- 2050,
427
+ 2268,
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
- 2051,
435
+ 2269,
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(2052, "Uninstalling {0}...", id)));
441
+ this.logger.info(( localize(2270, "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
- 2053,
449
+ 2271,
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(2054, "Extension '{0}' was successfully uninstalled!", id)));
455
+ this.logger.info(( localize(2272, "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(2055, "Extension '{0}' is not installed on {1}.", id, this.location)) : ( localize(2056, "Extension '{0}' is not installed.", id));
473
+ return this.location ? ( localize(2273, "Extension '{0}' is not installed on {1}.", id, this.location)) : ( localize(2274, "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
- 2057,
478
+ 2275,
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
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Validates an experiment assignment context before it is trusted onto telemetry events.
3
+ */
4
+ export declare function isValidAssignmentContext(value: string): boolean;
@@ -0,0 +1,13 @@
1
+
2
+
3
+ const MAX_ASSIGNMENT_CONTEXT_LENGTH = 8 * 1024;
4
+ const ASSIGNMENT_CONTEXT_ENTRY_PATTERN = /^[^:;\s\x00-\x1F\x7F]+:[^;\x00-\x1F\x7F]+$/;
5
+ function isValidAssignmentContext(value) {
6
+ if (value.length === 0 || value.length > MAX_ASSIGNMENT_CONTEXT_LENGTH) {
7
+ return false;
8
+ }
9
+ const entries = value.endsWith(';') ? value.slice(0, -1).split(';') : value.split(';');
10
+ return entries.length > 0 && entries.every(entry => ASSIGNMENT_CONTEXT_ENTRY_PATTERN.test(entry));
11
+ }
12
+
13
+ export { isValidAssignmentContext };
@@ -19,6 +19,7 @@ export declare class MainThreadAgentEditorComments implements MainThreadAgentEdi
19
19
  constructor(extHostContext: IExtHostContext, _bridge: IAgentEditorCommentsBridge);
20
20
  $createAgentEditorComments(handle: number, uri: UriComponents): Promise<void>;
21
21
  $addComment(handle: number, range: IRange, body: string): Promise<void>;
22
+ $deleteComment(handle: number, id: string): Promise<void>;
22
23
  $disposeAgentEditorComments(handle: number): Promise<void>;
23
24
  private _sendComments;
24
25
  dispose(): void;
@@ -1,6 +1,7 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
4
5
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
5
6
  import { IAgentEditorCommentsBridge } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/agentEditorComments/common/agentEditorComments.service';
6
7
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
@@ -18,6 +19,11 @@ let MainThreadAgentEditorComments = class MainThreadAgentEditorComments {
18
19
  this._resources.set(handle, resource);
19
20
  const store = ( new DisposableStore());
20
21
  store.add(this._bridge.onDidChangeComments(() => this._sendComments(handle)));
22
+ store.add(this._bridge.onDidRevealComment(event => {
23
+ if (isEqual(event.resource, resource)) {
24
+ this._proxy.$revealAgentEditorComment(handle, event.id);
25
+ }
26
+ }));
21
27
  this._disposables.set(handle, store);
22
28
  this._sendComments(handle);
23
29
  }
@@ -28,6 +34,13 @@ let MainThreadAgentEditorComments = class MainThreadAgentEditorComments {
28
34
  }
29
35
  this._bridge.addComment(resource, range, body);
30
36
  }
37
+ async $deleteComment(handle, id) {
38
+ const resource = this._resources.get(handle);
39
+ if (!resource) {
40
+ return;
41
+ }
42
+ this._bridge.deleteComment(resource, id);
43
+ }
31
44
  async $disposeAgentEditorComments(handle) {
32
45
  this._resources.delete(handle);
33
46
  this._disposables.deleteAndDispose(handle);
@@ -42,7 +55,7 @@ let MainThreadAgentEditorComments = class MainThreadAgentEditorComments {
42
55
  range: comment.range,
43
56
  body: comment.body
44
57
  })));
45
- this._proxy.$acceptAgentEditorComments(handle, comments);
58
+ this._proxy.$acceptAgentEditorComments(handle, comments, this._bridge.acceptsComments(resource));
46
59
  }
47
60
  dispose() {
48
61
  this._disposables.dispose();
@@ -13,6 +13,7 @@ import { IAuthenticationUsageService } from "@codingame/monaco-vscode-api/vscode
13
13
  import { UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
14
14
  import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
15
15
  import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
16
+ import { Dto } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier";
16
17
  import { IURLService } from "@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service";
17
18
  import { IAuthorizationTokenResponse } from "@codingame/monaco-vscode-api/vscode/vs/base/common/oauth";
18
19
  import { IDynamicAuthenticationProviderStorageService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service";
@@ -34,6 +35,11 @@ export interface AuthenticationGetSessionOptions {
34
35
  account?: AuthenticationSessionAccount;
35
36
  authorizationServer?: UriComponents;
36
37
  }
38
+ /**
39
+ * The account icon is a {@link URI} that does not survive being sent over the RPC boundary,
40
+ * so it needs to be revived when sessions are received from the extension host.
41
+ */
42
+ export declare function reviveSessionAccountIcon(session: Dto<AuthenticationSession>): AuthenticationSession;
37
43
  export declare class MainThreadAuthentication extends Disposable implements MainThreadAuthenticationShape {
38
44
  private readonly productService;
39
45
  private readonly authenticationService;
@@ -60,7 +66,7 @@ export declare class MainThreadAuthentication extends Disposable implements Main
60
66
  $registerAuthenticationProvider({ id, label, supportsMultipleAccounts, resourceServer, supportedAuthorizationServers, supportsChallenges }: IRegisterAuthenticationProviderDetails): Promise<void>;
61
67
  $unregisterAuthenticationProvider(id: string): Promise<void>;
62
68
  $ensureProvider(id: string): Promise<void>;
63
- $sendDidChangeSessions(providerId: string, event: AuthenticationSessionsChangeEvent): Promise<void>;
69
+ $sendDidChangeSessions(providerId: string, event: Dto<AuthenticationSessionsChangeEvent>): Promise<void>;
64
70
  $removeSession(providerId: string, sessionId: string): Promise<void>;
65
71
  $waitForUriHandler(expectedUri: UriComponents): Promise<UriComponents>;
66
72
  $showContinueNotification(message: string): Promise<boolean>;
@@ -78,8 +84,8 @@ export declare class MainThreadAuthentication extends Disposable implements Main
78
84
  private loginPrompt;
79
85
  private continueWithIncorrectAccountPrompt;
80
86
  private doGetSession;
81
- $getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | IAuthenticationWwwAuthenticateRequest, extensionId: string, extensionName: string, options: AuthenticationGetSessionOptions): Promise<AuthenticationSession | undefined>;
82
- $getAccounts(providerId: string): Promise<ReadonlyArray<AuthenticationSessionAccount>>;
87
+ $getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | IAuthenticationWwwAuthenticateRequest, extensionId: string, extensionName: string, options: AuthenticationGetSessionOptions): Promise<Dto<AuthenticationSession> | undefined>;
88
+ $getAccounts(providerId: string): Promise<ReadonlyArray<Dto<AuthenticationSessionAccount>>>;
83
89
  private _sentClientIdUsageEvents;
84
90
  private sendClientIdUsageTelemetry;
85
91
  private sendProviderUsageTelemetry;
@@ -3,7 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
3
3
  import { Disposable, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
4
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
5
5
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
- import { isAuthenticationWwwAuthenticateRequest } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication';
6
+ import { getDynamicAuthenticationProviderId, isAuthenticationWwwAuthenticateRequest } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication';
7
7
  import { IAuthenticationService, IAuthenticationExtensionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
8
8
  import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
9
9
  import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
@@ -33,6 +33,15 @@ import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform
33
33
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
34
34
  import { mcpEnterpriseManagedAuthIdpSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
35
35
 
36
+ function reviveSessionAccountIcon(session) {
37
+ return {
38
+ ...session,
39
+ account: {
40
+ ...session.account,
41
+ icon: URI.revive(session.account.icon)
42
+ }
43
+ };
44
+ }
36
45
  class MainThreadAuthenticationProvider extends Disposable {
37
46
  constructor(
38
47
  _proxy,
@@ -53,10 +62,11 @@ class MainThreadAuthenticationProvider extends Disposable {
53
62
  this.onDidChangeSessions = onDidChangeSessionsEmitter.event;
54
63
  }
55
64
  async getSessions(scopes, options) {
56
- return this._proxy.$getSessions(this.id, scopes, options);
65
+ const sessions = await this._proxy.$getSessions(this.id, scopes, options);
66
+ return ( sessions.map(reviveSessionAccountIcon));
57
67
  }
58
- createSession(scopes, options) {
59
- return this._proxy.$createSession(this.id, scopes, options);
68
+ async createSession(scopes, options) {
69
+ return reviveSessionAccountIcon(await this._proxy.$createSession(this.id, scopes, options));
60
70
  }
61
71
  async removeSession(sessionId) {
62
72
  await this._proxy.$removeSession(this.id, sessionId);
@@ -82,11 +92,14 @@ class MainThreadAuthenticationProviderWithChallenges extends MainThreadAuthentic
82
92
  onDidChangeSessionsEmitter
83
93
  );
84
94
  }
85
- getSessionsFromChallenges(constraint, options) {
86
- return this._proxy.$getSessionsFromChallenges(this.id, constraint, options);
95
+ async getSessionsFromChallenges(constraint, options) {
96
+ const sessions = await this._proxy.$getSessionsFromChallenges(this.id, constraint, options);
97
+ return ( sessions.map(reviveSessionAccountIcon));
87
98
  }
88
- createSessionFromChallenges(constraint, options) {
89
- return this._proxy.$createSessionFromChallenges(this.id, constraint, options);
99
+ async createSessionFromChallenges(constraint, options) {
100
+ return reviveSessionAccountIcon(
101
+ await this._proxy.$createSessionFromChallenges(this.id, constraint, options)
102
+ );
90
103
  }
91
104
  }
92
105
  let MainThreadAuthentication = class MainThreadAuthentication extends Disposable {
@@ -157,7 +170,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
157
170
  overrideClientId,
158
171
  overrideClientSecret
159
172
  ) => {
160
- const authProviderId = resource ? `${( authorizationServer.toString(true))} ${resource.resource}` : ( authorizationServer.toString(true));
173
+ const authProviderId = getDynamicAuthenticationProviderId(authorizationServer, resource);
161
174
  const clientDetails = await this.dynamicAuthProviderStorageService.getClientRegistration(authProviderId);
162
175
  let clientId = overrideClientId ?? clientDetails?.clientId;
163
176
  const clientSecret = overrideClientId ? overrideClientSecret : (overrideClientSecret ?? clientDetails?.clientSecret);
@@ -252,7 +265,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
252
265
  async $sendDidChangeSessions(providerId, event) {
253
266
  const obj = this._registrations.get(providerId);
254
267
  if (obj instanceof Emitter) {
255
- obj.fire(event);
268
+ obj.fire({
269
+ added: event.added?.map(reviveSessionAccountIcon),
270
+ removed: event.removed?.map(reviveSessionAccountIcon),
271
+ changed: event.changed?.map(reviveSessionAccountIcon)
272
+ });
256
273
  }
257
274
  }
258
275
  $removeSession(providerId, sessionId) {
@@ -277,8 +294,8 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
277
294
  return await deferredPromise.p;
278
295
  }
279
296
  $showContinueNotification(message) {
280
- const yes = ( localize(2709, "Yes"));
281
- const no = ( localize(2710, "No"));
297
+ const yes = ( localize(2944, "Yes"));
298
+ const no = ( localize(2945, "No"));
282
299
  const deferredPromise = ( new DeferredPromise());
283
300
  let result = false;
284
301
  const handle = this.notificationService.prompt(Severity.Warning, message, [{
@@ -334,26 +351,26 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
334
351
  message = customMessage;
335
352
  } else {
336
353
  message = recreatingSession ? ( localize(
337
- 2711,
354
+ 2946,
338
355
  "The extension '{0}' wants you to sign in again using {1}.",
339
356
  extensionName,
340
357
  provider.label
341
358
  )) : ( localize(
342
- 2712,
359
+ 2947,
343
360
  "The extension '{0}' wants to sign in using {1}.",
344
361
  extensionName,
345
362
  provider.label
346
363
  ));
347
364
  }
348
365
  const buttons = [{
349
- label: ( localize(2713, "&&Allow")),
366
+ label: ( localize(2948, "&&Allow")),
350
367
  run() {
351
368
  return true;
352
369
  }
353
370
  }];
354
371
  if (options?.learnMore) {
355
372
  buttons.push({
356
- label: ( localize(2714, "Learn more")),
373
+ label: ( localize(2949, "Learn more")),
357
374
  run: async () => {
358
375
  const result = this.loginPrompt(provider, extensionName, recreatingSession, options);
359
376
  await this.openerService.open(URI.revive(options.learnMore), {
@@ -376,9 +393,9 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
376
393
  }
377
394
  async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
378
395
  const result = await this.dialogService.prompt({
379
- message: ( localize(2715, "Incorrect account detected")),
396
+ message: ( localize(2950, "Incorrect account detected")),
380
397
  detail: ( localize(
381
- 2716,
398
+ 2951,
382
399
  "The chosen account, {0}, does not match the requested account, {1}.",
383
400
  chosenAccountLabel,
384
401
  requestedAccountLabel
@@ -386,10 +403,10 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
386
403
  type: Severity.Warning,
387
404
  cancelButton: true,
388
405
  buttons: [{
389
- label: ( localize(2717, "Keep {0}", chosenAccountLabel)),
406
+ label: ( localize(2952, "Keep {0}", chosenAccountLabel)),
390
407
  run: () => chosenAccountLabel
391
408
  }, {
392
- label: ( localize(2718, "Login with {0}", requestedAccountLabel)),
409
+ label: ( localize(2953, "Login with {0}", requestedAccountLabel)),
393
410
  run: () => requestedAccountLabel
394
411
  }]
395
412
  });
@@ -542,15 +559,15 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
542
559
  result
543
560
  } = await this.dialogService.prompt({
544
561
  type: Severity.Info,
545
- message: ( localize(2719, "Device Code Authentication")),
562
+ message: ( localize(2954, "Device Code Authentication")),
546
563
  detail: ( localize(
547
- 2720,
564
+ 2955,
548
565
  "Your code: {0}\n\nTo complete authentication, navigate to {1} and enter the code above.",
549
566
  userCode,
550
567
  verificationUri
551
568
  )),
552
569
  buttons: [{
553
- label: ( localize(2721, "Copy & Continue")),
570
+ label: ( localize(2956, "Copy & Continue")),
554
571
  run: () => true
555
572
  }],
556
573
  cancelButton: true
@@ -560,7 +577,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
560
577
  await this.clipboardService.writeText(userCode);
561
578
  return await this.openerService.open(( URI.parse(verificationUri)));
562
579
  } catch (error) {
563
- this.notificationService.error(( localize(2722, "Failed to open {0}", verificationUri)));
580
+ this.notificationService.error(( localize(2957, "Failed to open {0}", verificationUri)));
564
581
  }
565
582
  }
566
583
  return false;
@@ -569,44 +586,44 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
569
586
  const redirectUrls = "http://127.0.0.1:33418\nhttps://vscode.dev/redirect";
570
587
  const result = await this.dialogService.prompt({
571
588
  type: Severity.Info,
572
- message: ( localize(2723, "Dynamic Client Registration not supported")),
589
+ message: ( localize(2958, "Dynamic Client Registration not supported")),
573
590
  detail: ( localize(
574
- 2724,
591
+ 2959,
575
592
  "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}",
576
593
  authorizationServerUrl,
577
594
  redirectUrls
578
595
  )),
579
596
  buttons: [{
580
- label: ( localize(2725, "Copy URIs & Proceed")),
597
+ label: ( localize(2960, "Copy URIs & Proceed")),
581
598
  run: async () => {
582
599
  try {
583
600
  await this.clipboardService.writeText(redirectUrls);
584
601
  } catch (error) {
585
- this.notificationService.error(( localize(2726, "Failed to copy redirect URIs to clipboard.")));
602
+ this.notificationService.error(( localize(2961, "Failed to copy redirect URIs to clipboard.")));
586
603
  }
587
604
  return true;
588
605
  }
589
606
  }],
590
607
  cancelButton: {
591
- label: ( localize(2727, "Cancel")),
608
+ label: ( localize(2962, "Cancel")),
592
609
  run: () => false
593
610
  }
594
611
  });
595
612
  if (!result) {
596
613
  return undefined;
597
614
  }
598
- const sharedTitle = ( localize(2728, "Add Client Registration Details"));
615
+ const sharedTitle = ( localize(2963, "Add Client Registration Details"));
599
616
  const clientId = await this.quickInputService.input({
600
617
  title: sharedTitle,
601
618
  prompt: ( localize(
602
- 2729,
619
+ 2964,
603
620
  "Enter an existing client ID that has been registered with the following redirect URIs: http://127.0.0.1:33418, https://vscode.dev/redirect"
604
621
  )),
605
- placeHolder: ( localize(2730, "OAuth client ID (azye39d...)")),
622
+ placeHolder: ( localize(2965, "OAuth client ID (azye39d...)")),
606
623
  ignoreFocusLost: true,
607
624
  validateInput: async value => {
608
625
  if (!value || value.trim().length === 0) {
609
- return localize(2731, "Client ID is required");
626
+ return localize(2966, "Client ID is required");
610
627
  }
611
628
  return undefined;
612
629
  }
@@ -617,11 +634,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
617
634
  const clientSecret = await this.quickInputService.input({
618
635
  title: sharedTitle,
619
636
  prompt: ( localize(
620
- 2732,
637
+ 2967,
621
638
  "(optional) Enter an existing client secret associated with the client id '{0}' or leave this field blank",
622
639
  clientId
623
640
  )),
624
- placeHolder: ( localize(2733, "OAuth client secret (wer32o50f...) or leave it blank")),
641
+ placeHolder: ( localize(2968, "OAuth client secret (wer32o50f...) or leave it blank")),
625
642
  password: true,
626
643
  ignoreFocusLost: true
627
644
  });
@@ -632,14 +649,14 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
632
649
  }
633
650
  async $promptForResourceClientSecret(resourceClientId, resource) {
634
651
  const value = await this.quickInputService.input({
635
- title: ( localize(2734, "Resource Client Secret Required")),
652
+ title: ( localize(2969, "Resource Client Secret Required")),
636
653
  prompt: ( localize(
637
- 2735,
654
+ 2970,
638
655
  "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
656
  resource,
640
657
  resourceClientId
641
658
  )),
642
- placeHolder: ( localize(2736, "Resource client secret")),
659
+ placeHolder: ( localize(2971, "Resource client secret")),
643
660
  password: true,
644
661
  ignoreFocusLost: true
645
662
  });
@@ -667,4 +684,4 @@ MainThreadAuthentication = __decorate(
667
684
  MainThreadAuthentication
668
685
  );
669
686
 
670
- export { MainThreadAuthentication };
687
+ export { MainThreadAuthentication, reviveSessionAccountIcon };
@@ -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
- 2737,
111
+ 2972,
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
  )));
@@ -27,12 +27,12 @@ import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscod
27
27
  export declare class MainThreadChatTask implements IChatTask {
28
28
  content: IMarkdownString;
29
29
  readonly kind = "progressTask";
30
- readonly deferred: DeferredPromise<string | void>;
30
+ readonly deferred: DeferredPromise<void | string>;
31
31
  private readonly _onDidAddProgress;
32
32
  get onDidAddProgress(): Event<IChatWarningMessage | IChatContentReference>;
33
33
  readonly progress: (IChatWarningMessage | IChatContentReference)[];
34
34
  constructor(content: IMarkdownString);
35
- task(): Promise<string | void>;
35
+ task(): Promise<void | string>;
36
36
  isSettled(): boolean;
37
37
  complete(v: string | void): void;
38
38
  add(progress: IChatWarningMessage | IChatContentReference): void;