@codingame/monaco-vscode-extensions-service-override 17.2.1 → 18.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.
Files changed (71) hide show
  1. package/index.js +1 -1
  2. package/package.json +30 -28
  3. package/vscode/src/vs/base/common/console.d.ts +1 -1
  4. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +28 -28
  5. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.d.ts +1 -1
  6. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +1 -1
  7. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +22 -6
  8. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +126 -21
  9. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +1 -1
  10. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
  11. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +6 -3
  12. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +54 -44
  13. package/vscode/src/vs/workbench/api/browser/mainThreadComments.d.ts +2 -2
  14. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +7 -5
  15. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +4 -4
  16. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +11 -9
  17. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
  18. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +5 -5
  19. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +4 -3
  20. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
  21. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
  22. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +1 -1
  23. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +4 -3
  24. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +14 -2
  25. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +1 -1
  26. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
  27. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +17 -1
  28. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +141 -4
  29. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
  30. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +1 -1
  31. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +1 -1
  32. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.d.ts +1 -1
  33. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.d.ts +2 -2
  34. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +1 -1
  35. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -6
  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/mainThreadSCM.js +16 -12
  40. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
  41. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +3 -2
  42. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.d.ts +1 -1
  43. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
  44. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.d.ts +3 -2
  45. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +8 -6
  46. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +1 -1
  47. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +2 -1
  48. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
  49. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
  50. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +1 -1
  51. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +2 -2
  52. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.d.ts +1 -1
  53. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
  54. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
  55. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
  56. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +1 -1
  57. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
  58. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +1 -1
  59. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.d.ts +1 -1
  60. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +1 -1
  61. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +1 -1
  62. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +13 -13
  63. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +1 -1
  64. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
  65. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManagers.d.ts +1 -1
  66. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.d.ts +1 -1
  67. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +1 -1
  68. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
  69. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
  70. package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.d.ts +1 -1
  71. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.d.ts +1 -1
@@ -20,14 +20,20 @@ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
20
20
  import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
21
21
  import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
22
22
  import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
23
+ import { ExtensionHostKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionHostKind';
24
+ import { IURLService } from '@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service';
25
+ import { DeferredPromise, raceTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
26
+ import { IDynamicAuthenticationProviderStorageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service';
27
+ import { IClipboardService } from '@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service';
23
28
 
24
29
  class MainThreadAuthenticationProvider extends Disposable {
25
- constructor(_proxy, id, label, supportsMultipleAccounts, notificationService, onDidChangeSessionsEmitter) {
30
+ constructor(_proxy, id, label, supportsMultipleAccounts, authorizationServers, notificationService, onDidChangeSessionsEmitter) {
26
31
  super();
27
32
  this._proxy = _proxy;
28
33
  this.id = id;
29
34
  this.label = label;
30
35
  this.supportsMultipleAccounts = supportsMultipleAccounts;
36
+ this.authorizationServers = authorizationServers;
31
37
  this.notificationService = notificationService;
32
38
  this.onDidChangeSessions = onDidChangeSessionsEmitter.event;
33
39
  }
@@ -39,11 +45,11 @@ class MainThreadAuthenticationProvider extends Disposable {
39
45
  }
40
46
  async removeSession(sessionId) {
41
47
  await this._proxy.$removeSession(this.id, sessionId);
42
- this.notificationService.info(( localize(2381, "Successfully signed out.")));
48
+ this.notificationService.info(( localize(2387, "Successfully signed out.")));
43
49
  }
44
50
  }
45
51
  let MainThreadAuthentication = class MainThreadAuthentication extends Disposable {
46
- constructor(extHostContext, authenticationService, authenticationExtensionsService, authenticationAccessService, authenticationUsageService, dialogService, notificationService, extensionService, telemetryService, openerService, logService) {
52
+ constructor(extHostContext, authenticationService, authenticationExtensionsService, authenticationAccessService, authenticationUsageService, dialogService, notificationService, extensionService, telemetryService, openerService, logService, urlService, dynamicAuthProviderStorageService, clipboardService) {
47
53
  super();
48
54
  this.authenticationService = authenticationService;
49
55
  this.authenticationExtensionsService = authenticationExtensionsService;
@@ -55,36 +61,55 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
55
61
  this.telemetryService = telemetryService;
56
62
  this.openerService = openerService;
57
63
  this.logService = logService;
64
+ this.urlService = urlService;
65
+ this.dynamicAuthProviderStorageService = dynamicAuthProviderStorageService;
66
+ this.clipboardService = clipboardService;
58
67
  this._registrations = this._register(( new DisposableMap()));
59
68
  this._sentProviderUsageEvents = ( new Set());
60
69
  this._sentClientIdUsageEvents = ( new Set());
61
70
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostAuthentication));
62
- this._register(this.authenticationService.onDidChangeSessions(e => {
63
- this._proxy.$onDidChangeAuthenticationSessions(e.providerId, e.label);
64
- }));
71
+ this._register(this.authenticationService.onDidChangeSessions(e => this._proxy.$onDidChangeAuthenticationSessions(e.providerId, e.label)));
72
+ this._register(this.authenticationService.onDidUnregisterAuthenticationProvider(e => this._proxy.$onDidUnregisterAuthenticationProvider(e.id)));
65
73
  this._register(this.authenticationExtensionsService.onDidChangeAccountPreference(e => {
66
74
  const providerInfo = this.authenticationService.getProvider(e.providerId);
67
75
  this._proxy.$onDidChangeAuthenticationSessions(providerInfo.id, providerInfo.label, e.extensionIds);
68
76
  }));
77
+ this._register(this.dynamicAuthProviderStorageService.onDidChangeTokens(e => {
78
+ this._proxy.$onDidChangeDynamicAuthProviderTokens(e.authProviderId, e.clientId, e.tokens);
79
+ }));
80
+ this._register(authenticationService.registerAuthenticationProviderHostDelegate({
81
+ priority: extHostContext.extensionHostKind === ExtensionHostKind.LocalWebWorker ? 0 : 1,
82
+ create: async (authorizationServer, serverMetadata, resource) => {
83
+ const authProviderId = ( authorizationServer.toString(true));
84
+ const clientId = this.dynamicAuthProviderStorageService.getClientId(authProviderId);
85
+ let initialTokens = undefined;
86
+ if (clientId) {
87
+ initialTokens = await this.dynamicAuthProviderStorageService.getSessionsForDynamicAuthProvider(authProviderId, clientId);
88
+ }
89
+ return await this._proxy.$registerDynamicAuthProvider(authorizationServer, serverMetadata, resource, clientId, initialTokens);
90
+ }
91
+ }));
69
92
  }
70
- async $registerAuthenticationProvider(id, label, supportsMultipleAccounts) {
93
+ async $registerAuthenticationProvider(id, label, supportsMultipleAccounts, supportedAuthorizationServer = []) {
71
94
  if (!this.authenticationService.declaredProviders.find(p => p.id === id)) {
72
95
  this.logService.warn(`Authentication provider ${id} was not declared in the Extension Manifest.`);
73
96
  this.telemetryService.publicLog2('authentication.providerNotDeclared', { id });
74
97
  }
75
98
  const emitter = ( new Emitter());
76
99
  this._registrations.set(id, emitter);
100
+ const supportedAuthorizationServerUris = ( supportedAuthorizationServer.map(i => URI.revive(i)));
77
101
  const provider = ( new MainThreadAuthenticationProvider(
78
102
  this._proxy,
79
103
  id,
80
104
  label,
81
105
  supportsMultipleAccounts,
106
+ supportedAuthorizationServerUris,
82
107
  this.notificationService,
83
108
  emitter
84
109
  ));
85
110
  this.authenticationService.registerAuthenticationProvider(id, provider);
86
111
  }
87
- $unregisterAuthenticationProvider(id) {
112
+ async $unregisterAuthenticationProvider(id) {
88
113
  this._registrations.deleteAndDispose(id);
89
114
  this.authenticationService.unregisterAuthenticationProvider(id);
90
115
  }
@@ -93,7 +118,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
93
118
  return await this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id), ActivationKind.Immediate);
94
119
  }
95
120
  }
96
- $sendDidChangeSessions(providerId, event) {
121
+ async $sendDidChangeSessions(providerId, event) {
97
122
  const obj = this._registrations.get(providerId);
98
123
  if (obj instanceof Emitter) {
99
124
  obj.fire(event);
@@ -102,11 +127,54 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
102
127
  $removeSession(providerId, sessionId) {
103
128
  return this.authenticationService.removeSession(providerId, sessionId);
104
129
  }
130
+ async $waitForUriHandler(expectedUri) {
131
+ const deferredPromise = ( new DeferredPromise());
132
+ const disposable = this.urlService.registerHandler({
133
+ handleURL: async (uri) => {
134
+ if (uri.scheme !== expectedUri.scheme || uri.authority !== expectedUri.authority || uri.path !== expectedUri.path) {
135
+ return false;
136
+ }
137
+ deferredPromise.complete(uri);
138
+ disposable.dispose();
139
+ return true;
140
+ }
141
+ });
142
+ const result = await raceTimeout(deferredPromise.p, 5 * 60 * 1000);
143
+ if (!result) {
144
+ throw ( new Error('Timed out waiting for URI handler'));
145
+ }
146
+ return await deferredPromise.p;
147
+ }
148
+ $showContinueNotification(message) {
149
+ const yes = ( localize(2388, "Yes"));
150
+ const no = ( localize(2389, "No"));
151
+ const deferredPromise = ( new DeferredPromise());
152
+ let result = false;
153
+ const handle = this.notificationService.prompt(Severity.Warning, message, [{
154
+ label: yes,
155
+ run: () => result = true
156
+ }, {
157
+ label: no,
158
+ run: () => result = false
159
+ }]);
160
+ const disposable = handle.onDidClose(() => {
161
+ deferredPromise.complete(result);
162
+ disposable.dispose();
163
+ });
164
+ return deferredPromise.p;
165
+ }
166
+ async $registerDynamicAuthenticationProvider(id, label, authorizationServer, clientId) {
167
+ await this.$registerAuthenticationProvider(id, label, false, [authorizationServer]);
168
+ this.dynamicAuthProviderStorageService.storeClientId(id, ( URI.revive(authorizationServer).toString(true)), clientId, label);
169
+ }
170
+ async $setSessionsForDynamicAuthProvider(authProviderId, clientId, sessions) {
171
+ await this.dynamicAuthProviderStorageService.setSessionsForDynamicAuthProvider(authProviderId, clientId, sessions);
172
+ }
105
173
  async loginPrompt(provider, extensionName, recreatingSession, options) {
106
174
  let message;
107
175
  if (provider.id.startsWith(INTERNAL_AUTH_PROVIDER_PREFIX)) {
108
176
  message = ( localize(
109
- 2382,
177
+ 2390,
110
178
  "The extension '{0}' wants to access the language models provided by {1}.",
111
179
  extensionName,
112
180
  provider.label
@@ -115,13 +183,13 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
115
183
  else {
116
184
  message = recreatingSession
117
185
  ? ( localize(
118
- 2383,
186
+ 2391,
119
187
  "The extension '{0}' wants you to sign in again using {1}.",
120
188
  extensionName,
121
189
  provider.label
122
190
  ))
123
191
  : ( localize(
124
- 2384,
192
+ 2392,
125
193
  "The extension '{0}' wants to sign in using {1}.",
126
194
  extensionName,
127
195
  provider.label
@@ -129,7 +197,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
129
197
  }
130
198
  const buttons = [
131
199
  {
132
- label: ( localize(2385, "&&Allow")),
200
+ label: ( localize(2393, "&&Allow")),
133
201
  run() {
134
202
  return true;
135
203
  },
@@ -137,7 +205,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
137
205
  ];
138
206
  if (options?.learnMore) {
139
207
  buttons.push({
140
- label: ( localize(2386, "Learn more")),
208
+ label: ( localize(2394, "Learn more")),
141
209
  run: async () => {
142
210
  const result = this.loginPrompt(provider, extensionName, recreatingSession, options);
143
211
  await this.openerService.open(URI.revive(options.learnMore), { allowCommands: true });
@@ -156,9 +224,9 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
156
224
  }
157
225
  async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
158
226
  const result = await this.dialogService.prompt({
159
- message: ( localize(2387, "Incorrect account detected")),
227
+ message: ( localize(2395, "Incorrect account detected")),
160
228
  detail: ( localize(
161
- 2388,
229
+ 2396,
162
230
  "The chosen account, {0}, does not match the requested account, {1}.",
163
231
  chosenAccountLabel,
164
232
  requestedAccountLabel
@@ -167,11 +235,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
167
235
  cancelButton: true,
168
236
  buttons: [
169
237
  {
170
- label: ( localize(2389, 'Keep {0}', chosenAccountLabel)),
238
+ label: ( localize(2397, 'Keep {0}', chosenAccountLabel)),
171
239
  run: () => chosenAccountLabel
172
240
  },
173
241
  {
174
- label: ( localize(2390, 'Login with {0}', requestedAccountLabel)),
242
+ label: ( localize(2398, 'Login with {0}', requestedAccountLabel)),
175
243
  run: () => requestedAccountLabel
176
244
  }
177
245
  ],
@@ -182,7 +250,8 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
182
250
  return result.result === chosenAccountLabel;
183
251
  }
184
252
  async doGetSession(providerId, scopes, extensionId, extensionName, options) {
185
- const sessions = await this.authenticationService.getSessions(providerId, scopes, options.account, true);
253
+ const authorizationServer = URI.revive(options.authorizationServer);
254
+ const sessions = await this.authenticationService.getSessions(providerId, scopes, { account: options.account, authorizationServer }, true);
186
255
  const provider = this.authenticationService.getProvider(providerId);
187
256
  if (options.forceNewSession && options.createIfNone) {
188
257
  throw ( new Error(
@@ -236,7 +305,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
236
305
  else {
237
306
  const accountToCreate = options.account ?? matchingAccountPreferenceSession?.account;
238
307
  do {
239
- session = await this.authenticationService.createSession(providerId, scopes, { activateImmediate: true, account: accountToCreate });
308
+ session = await this.authenticationService.createSession(providerId, scopes, {
309
+ activateImmediate: true,
310
+ account: accountToCreate,
311
+ authorizationServer
312
+ });
240
313
  } while (accountToCreate
241
314
  && accountToCreate.label !== session.account.label
242
315
  && !(await this.continueWithIncorrectAccountPrompt(session.account.label, accountToCreate.label)));
@@ -317,6 +390,35 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
317
390
  this.authenticationExtensionsService.removeAccountPreference(extensionId, providerId);
318
391
  this.authenticationExtensionsService.removeSessionPreference(providerId, extensionId, scopes);
319
392
  }
393
+ async $showDeviceCodeModal(userCode, verificationUri) {
394
+ const { result } = await this.dialogService.prompt({
395
+ type: Severity.Info,
396
+ message: ( localize(2399, "Device Code Authentication")),
397
+ detail: ( localize(
398
+ 2400,
399
+ "Your code: {0}\n\nTo complete authentication, navigate to {1} and enter the code above.",
400
+ userCode,
401
+ verificationUri
402
+ )),
403
+ buttons: [
404
+ {
405
+ label: ( localize(2401, "Copy & Continue")),
406
+ run: () => true
407
+ }
408
+ ],
409
+ cancelButton: true
410
+ });
411
+ if (result) {
412
+ try {
413
+ await this.clipboardService.writeText(userCode);
414
+ return await this.openerService.open(( URI.parse(verificationUri)));
415
+ }
416
+ catch (error) {
417
+ this.notificationService.error(( localize(2402, "Failed to open {0}", verificationUri)));
418
+ }
419
+ }
420
+ return false;
421
+ }
320
422
  };
321
423
  MainThreadAuthentication = __decorate([
322
424
  extHostNamedCustomer(MainContext.MainThreadAuthentication),
@@ -329,7 +431,10 @@ MainThreadAuthentication = __decorate([
329
431
  ( __param(7, IExtensionService)),
330
432
  ( __param(8, ITelemetryService)),
331
433
  ( __param(9, IOpenerService)),
332
- ( __param(10, ILogService))
434
+ ( __param(10, ILogService)),
435
+ ( __param(11, IURLService)),
436
+ ( __param(12, IDynamicAuthenticationProviderStorageService)),
437
+ ( __param(13, IClipboardService))
333
438
  ], MainThreadAuthentication);
334
439
 
335
440
  export { MainThreadAuthentication, MainThreadAuthenticationProvider };
@@ -7,7 +7,7 @@ import { IBulkEditService } from '@codingame/monaco-vscode-api/vscode/vs/editor/
7
7
  import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
8
8
  import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
9
9
  import { MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
10
- import { ResourceNotebookCellEdit } from '@codingame/monaco-vscode-324f9a6e-6231-5bfc-af17-e147abd2dfd2-common/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
10
+ import { ResourceNotebookCellEdit } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
11
11
  import { CellEditType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
12
12
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
13
13
 
@@ -92,7 +92,7 @@ let RemoteExtensionManagementCLI = class RemoteExtensionManagementCLI extends Ex
92
92
  if (!this._extensionManifestPropertiesService.canExecuteOnWorkspace(manifest)
93
93
  && !(isWeb && this._extensionManifestPropertiesService.canExecuteOnWeb(manifest))) {
94
94
  this.logger.info(( localize(
95
- 2391,
95
+ 2403,
96
96
  "Cannot install the '{0}' extension because it is declared to not run in this setup.",
97
97
  getExtensionId(manifest.publisher, manifest.name)
98
98
  )));
@@ -12,7 +12,7 @@ import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workb
12
12
  import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
13
13
  import { IChatRelatedFileProviderMetadata } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
14
14
  import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service";
15
- import { IChatContentInlineReference, IChatContentReference, IChatTask, IChatWarningMessage } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService";
15
+ import { IChatContentInlineReference, IChatContentReference, IChatTask, IChatTaskSerialized, IChatWarningMessage } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService";
16
16
  import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
17
17
  import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
18
18
  import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
@@ -30,6 +30,7 @@ export declare class MainThreadChatTask implements IChatTask {
30
30
  isSettled(): boolean;
31
31
  complete(v: string | void): void;
32
32
  add(progress: IChatWarningMessage | IChatContentReference): void;
33
+ toJSON(): IChatTaskSerialized;
33
34
  }
34
35
  export declare class MainThreadChatAgents2 extends Disposable implements MainThreadChatAgentsShape2 {
35
36
  private readonly _chatAgentService;
@@ -48,7 +49,6 @@ export declare class MainThreadChatAgents2 extends Disposable implements MainThr
48
49
  private readonly _chatRelatedFilesProviders;
49
50
  private readonly _pendingProgress;
50
51
  private readonly _proxy;
51
- private _responsePartHandlePool;
52
52
  private readonly _activeTasks;
53
53
  private readonly _unresolvedAnchors;
54
54
  constructor(extHostContext: IExtHostContext, _chatAgentService: IChatAgentService, _chatService: IChatService, _chatEditingService: IChatEditingService, _languageFeaturesService: ILanguageFeaturesService, _chatWidgetService: IChatWidgetService, _instantiationService: IInstantiationService, _logService: ILogService, _extensionService: IExtensionService, _uriIdentityService: IUriIdentityService);
@@ -56,7 +56,10 @@ export declare class MainThreadChatAgents2 extends Disposable implements MainThr
56
56
  $transferActiveChatSession(toWorkspace: UriComponents): void;
57
57
  $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: IDynamicChatAgentProps | undefined): Promise<void>;
58
58
  $updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): Promise<void>;
59
- $handleProgressChunk(requestId: string, progress: IChatProgressDto, responsePartHandle?: number): Promise<number | void>;
59
+ $handleProgressChunk(requestId: string, chunks: (IChatProgressDto | [
60
+ IChatProgressDto,
61
+ number
62
+ ])[]): Promise<void>;
60
63
  $handleAnchorResolve(requestId: string, handle: string, resolveAnchor: Dto<IChatContentInlineReference> | undefined): void;
61
64
  $registerAgentCompletionsProvider(handle: number, id: string, triggerCharacters: string[]): void;
62
65
  $unregisterAgentCompletionsProvider(handle: number, id: string): void;
@@ -51,6 +51,13 @@ class MainThreadChatTask {
51
51
  this.progress.push(progress);
52
52
  this._onDidAddProgress.fire(progress);
53
53
  }
54
+ toJSON() {
55
+ return {
56
+ kind: 'progressTaskSerialized',
57
+ content: this.content,
58
+ progress: this.progress
59
+ };
60
+ }
54
61
  }
55
62
  let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
56
63
  constructor(extHostContext, _chatAgentService, _chatService, _chatEditingService, _languageFeaturesService, _chatWidgetService, _instantiationService, _logService, _extensionService, _uriIdentityService) {
@@ -70,7 +77,6 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
70
77
  this._chatParticipantDetectionProviders = this._register(( new DisposableMap()));
71
78
  this._chatRelatedFilesProviders = this._register(( new DisposableMap()));
72
79
  this._pendingProgress = ( new Map());
73
- this._responsePartHandlePool = 0;
74
80
  this._activeTasks = ( new Map());
75
81
  this._unresolvedAnchors = ( new Map());
76
82
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatAgents2));
@@ -141,9 +147,6 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
141
147
  provideChatTitle: (history, token) => {
142
148
  return this._proxy.$provideChatTitle(handle, history, token);
143
149
  },
144
- provideSampleQuestions: (location, token) => {
145
- return this._proxy.$provideSampleQuestions(handle, location, token);
146
- }
147
150
  };
148
151
  let disposable;
149
152
  if (!staticAgentRegistration && dynamicProps) {
@@ -184,49 +187,56 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
184
187
  data.hasFollowups = metadataUpdate.hasFollowups;
185
188
  this._chatAgentService.updateAgent(data.id, revive(metadataUpdate));
186
189
  }
187
- async $handleProgressChunk(requestId, progress, responsePartHandle) {
188
- const revivedProgress = progress.kind === 'notebookEdit'
189
- ? ChatNotebookEdit.fromChatEdit(revive(progress))
190
- : revive(progress);
191
- if (revivedProgress.kind === 'notebookEdit'
192
- || revivedProgress.kind === 'textEdit'
193
- || revivedProgress.kind === 'codeblockUri') {
194
- revivedProgress.uri = this._uriIdentityService.asCanonicalUri(revivedProgress.uri);
195
- }
196
- if (revivedProgress.kind === 'progressTask') {
197
- const handle = ++this._responsePartHandlePool;
198
- const responsePartId = `${requestId}_${handle}`;
199
- const task = ( new MainThreadChatTask(revivedProgress.content));
200
- this._activeTasks.set(responsePartId, task);
201
- this._pendingProgress.get(requestId)?.(task);
202
- return handle;
203
- }
204
- else if (responsePartHandle !== undefined) {
205
- const responsePartId = `${requestId}_${responsePartHandle}`;
206
- const task = this._activeTasks.get(responsePartId);
207
- switch (revivedProgress.kind) {
208
- case 'progressTaskResult':
209
- if (task && revivedProgress.content) {
210
- task.complete(revivedProgress.content.value);
211
- this._activeTasks.delete(responsePartId);
212
- }
213
- else {
214
- task?.complete(undefined);
215
- }
216
- return responsePartHandle;
217
- case 'warning':
218
- case 'reference':
219
- task?.add(revivedProgress);
190
+ async $handleProgressChunk(requestId, chunks) {
191
+ const chatProgressParts = [];
192
+ chunks.forEach(item => {
193
+ const [progress, responsePartHandle] = Array.isArray(item) ? item : [item];
194
+ const revivedProgress = progress.kind === 'notebookEdit'
195
+ ? ChatNotebookEdit.fromChatEdit(revive(progress))
196
+ : revive(progress);
197
+ if (revivedProgress.kind === 'notebookEdit'
198
+ || revivedProgress.kind === 'textEdit'
199
+ || revivedProgress.kind === 'codeblockUri') {
200
+ revivedProgress.uri = this._uriIdentityService.asCanonicalUri(revivedProgress.uri);
201
+ }
202
+ if (responsePartHandle !== undefined) {
203
+ if (revivedProgress.kind === 'progressTask') {
204
+ const handle = responsePartHandle;
205
+ const responsePartId = `${requestId}_${handle}`;
206
+ const task = ( new MainThreadChatTask(revivedProgress.content));
207
+ this._activeTasks.set(responsePartId, task);
208
+ chatProgressParts.push(task);
220
209
  return;
210
+ }
211
+ else if (responsePartHandle !== undefined) {
212
+ const responsePartId = `${requestId}_${responsePartHandle}`;
213
+ const task = this._activeTasks.get(responsePartId);
214
+ switch (revivedProgress.kind) {
215
+ case 'progressTaskResult':
216
+ if (task && revivedProgress.content) {
217
+ task.complete(revivedProgress.content.value);
218
+ this._activeTasks.delete(responsePartId);
219
+ }
220
+ else {
221
+ task?.complete(undefined);
222
+ }
223
+ return;
224
+ case 'warning':
225
+ case 'reference':
226
+ task?.add(revivedProgress);
227
+ return;
228
+ }
229
+ }
221
230
  }
222
- }
223
- if (revivedProgress.kind === 'inlineReference' && revivedProgress.resolveId) {
224
- if (!( this._unresolvedAnchors.has(requestId))) {
225
- this._unresolvedAnchors.set(requestId, ( new Map()));
231
+ if (revivedProgress.kind === 'inlineReference' && revivedProgress.resolveId) {
232
+ if (!( this._unresolvedAnchors.has(requestId))) {
233
+ this._unresolvedAnchors.set(requestId, ( new Map()));
234
+ }
235
+ this._unresolvedAnchors.get(requestId)?.set(revivedProgress.resolveId, revivedProgress);
226
236
  }
227
- this._unresolvedAnchors.get(requestId)?.set(revivedProgress.resolveId, revivedProgress);
228
- }
229
- this._pendingProgress.get(requestId)?.(revivedProgress);
237
+ chatProgressParts.push(revivedProgress);
238
+ });
239
+ this._pendingProgress.get(requestId)?.(chatProgressParts);
230
240
  }
231
241
  $handleAnchorResolve(requestId, handle, resolveAnchor) {
232
242
  const anchor = this._unresolvedAnchors.get(requestId)?.get(handle);
@@ -10,7 +10,7 @@ import { ICommentController } from "@codingame/monaco-vscode-comments-service-ov
10
10
  import { ICommentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/comments/browser/commentService.service";
11
11
  import { CommentProviderFeatures, ExtHostCommentsShape, MainThreadCommentsShape, CommentThreadChanges } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
12
12
  import { IViewDescriptorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service";
13
- import { ICellRange } from "@codingame/monaco-vscode-324f9a6e-6231-5bfc-af17-e147abd2dfd2-common/vscode/vs/workbench/contrib/notebook/common/notebookRange";
13
+ import { ICellRange } from "@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/notebook/common/notebookRange";
14
14
  import { IViewsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service";
15
15
  import { MarshalledCommentThread } from "../../common/comments.js";
16
16
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
@@ -79,7 +79,7 @@ export declare class MainThreadCommentThread<T> implements languages.CommentThre
79
79
  dispose(): void;
80
80
  toJSON(): MarshalledCommentThread;
81
81
  }
82
- export declare class MainThreadCommentController implements ICommentController {
82
+ export declare class MainThreadCommentController extends Disposable implements ICommentController {
83
83
  private readonly _proxy;
84
84
  private readonly _commentService;
85
85
  private readonly _handle;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
- import { DisposableStore, DisposableMap, Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { DisposableStore, Disposable, DisposableMap, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
5
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
6
6
  import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
7
7
  import { CommentThreadCollapsibleState } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
@@ -14,7 +14,7 @@ import { COMMENTS_VIEW_ID, COMMENTS_VIEW_STORAGE_ID, COMMENTS_VIEW_TITLE } from
14
14
  import { Extensions, ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
15
15
  import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
16
16
  import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
17
- import { ViewPaneContainer } from '@codingame/monaco-vscode-e67a0dae-5b2c-54e6-8d61-90102c78362d-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
17
+ import { ViewPaneContainer } from '@codingame/monaco-vscode-a8d3bd74-e63e-5327-96e8-4f931661e329-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
18
18
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
19
19
  import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/iconRegistry';
20
20
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
@@ -201,7 +201,7 @@ class CommentThreadWithDisposable {
201
201
  this.disposableStore.dispose();
202
202
  }
203
203
  }
204
- class MainThreadCommentController {
204
+ class MainThreadCommentController extends Disposable {
205
205
  get handle() {
206
206
  return this._handle;
207
207
  }
@@ -233,6 +233,7 @@ class MainThreadCommentController {
233
233
  return this._id;
234
234
  }
235
235
  constructor(_proxy, _commentService, _handle, _uniqueId, _id, _label, _features) {
236
+ super();
236
237
  this._proxy = _proxy;
237
238
  this._commentService = _commentService;
238
239
  this._handle = _handle;
@@ -240,7 +241,7 @@ class MainThreadCommentController {
240
241
  this._id = _id;
241
242
  this._label = _label;
242
243
  this._features = _features;
243
- this._threads = ( new DisposableMap());
244
+ this._threads = this._register(( new DisposableMap()));
244
245
  }
245
246
  get activeComment() {
246
247
  return this._activeComment;
@@ -423,7 +424,7 @@ class MainThreadCommentController {
423
424
  };
424
425
  }
425
426
  }
426
- const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localize(2392, 'View icon of the comments view.')));
427
+ const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localize(2404, 'View icon of the comments view.')));
427
428
  let MainThreadComments = class MainThreadComments extends Disposable {
428
429
  constructor(extHostContext, _commentService, _viewsService, _viewDescriptorService, _uriIdentityService, _editorService) {
429
430
  super();
@@ -468,6 +469,7 @@ let MainThreadComments = class MainThreadComments extends Disposable {
468
469
  $unregisterCommentController(handle) {
469
470
  const providerId = this._handlers.get(handle);
470
471
  this._handlers.delete(handle);
472
+ this._commentControllers.get(handle)?.dispose();
471
473
  this._commentControllers.delete(handle);
472
474
  if (typeof providerId !== 'string') {
473
475
  return;
@@ -25,7 +25,7 @@ import { ExtHostContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench
25
25
  import { CustomEditorInput } from '@codingame/monaco-vscode-7f39b6f1-3542-5430-8760-0f404d7a7cee-common/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput';
26
26
  import { ICustomEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/customEditor/common/customEditor.service';
27
27
  import { CustomTextEditorModel } from '../../contrib/customEditor/common/customTextEditorModel.js';
28
- import { ExtensionKeyedWebviewOriginStore } from '@codingame/monaco-vscode-324f9a6e-6231-5bfc-af17-e147abd2dfd2-common/vscode/vs/workbench/contrib/webview/browser/webview';
28
+ import { ExtensionKeyedWebviewOriginStore } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/webview/browser/webview';
29
29
  import { IWebviewWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.service';
30
30
  import { editorGroupToColumn } from '@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
31
31
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
@@ -34,7 +34,7 @@ import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscod
34
34
  import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
35
35
  import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
36
36
  import { ResourceWorkingCopy } from '@codingame/monaco-vscode-bba55be6-41a2-50cd-a3cc-8bafa35bfa89-common/vscode/vs/workbench/services/workingCopy/common/resourceWorkingCopy';
37
- import { NO_TYPE_ID, WorkingCopyCapabilities } from '@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/services/workingCopy/common/workingCopy';
37
+ import { NO_TYPE_ID, WorkingCopyCapabilities } from '@codingame/monaco-vscode-a4683c2b-a0d2-5112-96ba-eedc605346d2-common/vscode/vs/workbench/services/workingCopy/common/workingCopy';
38
38
  import { IWorkingCopyFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
39
39
  import { IWorkingCopyService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
40
40
  import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
@@ -302,7 +302,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
302
302
  this._register(workingCopyService.registerWorkingCopy(this));
303
303
  this._register(extensionService.onWillStop(e => {
304
304
  e.veto(true, ( localize(
305
- 2393,
305
+ 2405,
306
306
  "An extension provided editor for '{0}' is still open that would close otherwise.",
307
307
  this.name
308
308
  )));
@@ -370,7 +370,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
370
370
  this._undoService.pushElement({
371
371
  type: UndoRedoElementType.Resource,
372
372
  resource: this._editorResource,
373
- label: label ?? ( localize(2394, "Edit")),
373
+ label: label ?? ( localize(2406, "Edit")),
374
374
  code: 'undoredo.customEditorEdit',
375
375
  undo: () => this.undo(),
376
376
  redo: () => this.redo(),
@@ -7,6 +7,8 @@ import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode
7
7
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
8
8
  import { IDecorationsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/decorations/common/decorations.service';
9
9
  import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
10
+ import { DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
11
+ import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
10
12
 
11
13
  class DecorationRequestsQueue {
12
14
  constructor(_proxy, _handle) {
@@ -18,27 +20,27 @@ class DecorationRequestsQueue {
18
20
  }
19
21
  enqueue(uri, token) {
20
22
  const id = ++this._idPool;
21
- const result = ( new Promise(resolve => {
22
- this._requests.set(id, { id, uri });
23
- this._resolver.set(id, resolve);
24
- this._processQueue();
25
- }));
23
+ const defer = ( new DeferredPromise());
24
+ this._requests.set(id, { id, uri });
25
+ this._resolver.set(id, defer);
26
+ this._processQueue();
26
27
  const sub = token.onCancellationRequested(() => {
27
28
  this._requests.delete(id);
28
29
  this._resolver.delete(id);
30
+ defer.error(( new CancellationError()));
29
31
  });
30
- return result.finally(() => sub.dispose());
32
+ return defer.p.finally(() => sub.dispose());
31
33
  }
32
34
  _processQueue() {
33
- if (typeof this._timer === 'number') {
35
+ if (this._timer !== undefined) {
34
36
  return;
35
37
  }
36
38
  this._timer = setTimeout(() => {
37
39
  const requests = this._requests;
38
40
  const resolver = this._resolver;
39
41
  this._proxy.$provideDecorations(this._handle, [...( requests.values())], CancellationToken.None).then(data => {
40
- for (const [id, resolve] of resolver) {
41
- resolve(data[id]);
42
+ for (const [id, defer] of resolver) {
43
+ defer.complete(data[id]);
42
44
  }
43
45
  });
44
46
  this._requests = ( new Map());