@codingame/monaco-vscode-extensions-service-override 20.4.1 → 21.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 (50) hide show
  1. package/package.json +28 -27
  2. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +28 -28
  3. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +6 -24
  4. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +74 -74
  5. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
  6. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +2 -4
  7. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +52 -9
  8. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +271 -134
  9. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +2 -2
  10. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +4 -4
  11. package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.d.ts +1 -1
  12. package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +1 -1
  13. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +1 -1
  14. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
  15. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.d.ts +1 -1
  16. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +2 -2
  17. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.d.ts +1 -1
  18. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +1 -1
  19. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
  20. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
  21. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.d.ts +4 -2
  22. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +58 -8
  23. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +2 -2
  24. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +6 -6
  25. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +7 -7
  26. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
  27. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +7 -0
  28. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +1 -1
  29. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +1 -1
  30. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +2 -2
  31. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
  32. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
  33. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
  34. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +1 -1
  35. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
  36. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +3 -2
  37. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
  38. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
  39. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +1 -1
  40. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
  41. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
  42. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +1 -1
  44. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
  45. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
  46. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
  47. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
  48. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
  49. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/forwardingTelemetryService.d.ts +0 -30
  50. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/forwardingTelemetryService.js +0 -67
@@ -2,9 +2,10 @@
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
4
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
5
- import { Disposable, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
6
+ import { Disposable, DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
7
  import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
7
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
8
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
8
9
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
9
10
  import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
10
11
  import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
@@ -15,7 +16,191 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
15
16
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
16
17
  import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
17
18
  import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
19
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
20
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
18
21
 
22
+ class ObservableChatSession extends Disposable {
23
+ static generateSessionKey(providerHandle, sessionId) {
24
+ return `${providerHandle}_${sessionId}`;
25
+ }
26
+ get sessionKey() {
27
+ return ObservableChatSession.generateSessionKey(this.providerHandle, this.sessionId);
28
+ }
29
+ get progressObs() {
30
+ return this._progressObservable;
31
+ }
32
+ get isCompleteObs() {
33
+ return this._isCompleteObservable;
34
+ }
35
+ constructor(id, providerHandle, proxy, logService, dialogService) {
36
+ super();
37
+ this._progressObservable = observableValue(this, []);
38
+ this._isCompleteObservable = observableValue(this, false);
39
+ this._onWillDispose = ( new Emitter());
40
+ this.onWillDispose = this._onWillDispose.event;
41
+ this._pendingProgressChunks = ( new Map());
42
+ this._isInitialized = false;
43
+ this._interruptionWasCanceled = false;
44
+ this._disposalPending = false;
45
+ this.sessionId = id;
46
+ this.providerHandle = providerHandle;
47
+ this.history = [];
48
+ this._proxy = proxy;
49
+ this._providerHandle = providerHandle;
50
+ this._logService = logService;
51
+ this._dialogService = dialogService;
52
+ }
53
+ initialize(token) {
54
+ if (!this._initializationPromise) {
55
+ this._initializationPromise = this._doInitializeContent(token);
56
+ }
57
+ return this._initializationPromise;
58
+ }
59
+ async _doInitializeContent(token) {
60
+ try {
61
+ const sessionContent = await raceCancellationError(this._proxy.$provideChatSessionContent(this._providerHandle, this.sessionId, token), token);
62
+ this.history.length = 0;
63
+ this.history.push(...( sessionContent.history.map((turn) => {
64
+ if (turn.type === 'request') {
65
+ return { type: 'request', prompt: turn.prompt, participant: turn.participant };
66
+ }
67
+ return {
68
+ type: 'response',
69
+ parts: ( turn.parts.map((part) => revive(part))),
70
+ participant: turn.participant
71
+ };
72
+ })));
73
+ if (sessionContent.hasActiveResponseCallback && !this.interruptActiveResponseCallback) {
74
+ this.interruptActiveResponseCallback = async () => {
75
+ const confirmInterrupt = () => {
76
+ if (this._disposalPending) {
77
+ this._proxy.$disposeChatSessionContent(this._providerHandle, this.sessionId);
78
+ this._disposalPending = false;
79
+ }
80
+ this._proxy.$interruptChatSessionActiveResponse(this._providerHandle, this.sessionId, 'ongoing');
81
+ return true;
82
+ };
83
+ if (sessionContent.supportsInterruption) {
84
+ return confirmInterrupt();
85
+ }
86
+ return this._dialogService.confirm({
87
+ message: ( localize(2449, 'Are you sure you want to interrupt the active session?'))
88
+ }).then(confirmed => {
89
+ if (confirmed.confirmed) {
90
+ return confirmInterrupt();
91
+ }
92
+ else {
93
+ this._addProgress([{
94
+ kind: 'progressMessage',
95
+ content: { value: '', isTrusted: false }
96
+ }]);
97
+ this._interruptionWasCanceled = true;
98
+ if (this._disposalPending) {
99
+ this._logService.info(`Canceling deferred disposal for session ${this.sessionId} (user canceled interruption)`);
100
+ this._disposalPending = false;
101
+ }
102
+ return false;
103
+ }
104
+ });
105
+ };
106
+ }
107
+ if (sessionContent.hasRequestHandler && !this.requestHandler) {
108
+ this.requestHandler = async (request, progress, history, token) => {
109
+ this._progressObservable.set([], undefined);
110
+ this._isCompleteObservable.set(false, undefined);
111
+ let lastProgressLength = 0;
112
+ const progressDisposable = autorun(reader => {
113
+ const progressArray = this._progressObservable.read(reader);
114
+ const isComplete = this._isCompleteObservable.read(reader);
115
+ if (progressArray.length > lastProgressLength) {
116
+ const newProgress = progressArray.slice(lastProgressLength);
117
+ progress(newProgress);
118
+ lastProgressLength = progressArray.length;
119
+ }
120
+ if (isComplete) {
121
+ progressDisposable.dispose();
122
+ }
123
+ });
124
+ try {
125
+ await this._proxy.$invokeChatSessionRequestHandler(this._providerHandle, this.sessionId, request, history, token);
126
+ if (!this._isCompleteObservable.get() && !this.interruptActiveResponseCallback) {
127
+ this._markComplete();
128
+ }
129
+ }
130
+ catch (error) {
131
+ const errorProgress = {
132
+ kind: 'progressMessage',
133
+ content: { value: `Error: ${error instanceof Error ? error.message : String(error)}`, isTrusted: false }
134
+ };
135
+ this._addProgress([errorProgress]);
136
+ this._markComplete();
137
+ throw error;
138
+ }
139
+ finally {
140
+ progressDisposable.dispose();
141
+ }
142
+ };
143
+ }
144
+ this._isInitialized = true;
145
+ const hasActiveResponse = sessionContent.hasActiveResponseCallback;
146
+ const hasRequestHandler = sessionContent.hasRequestHandler;
147
+ const hasAnyCapability = hasActiveResponse || hasRequestHandler;
148
+ for (const [requestId, chunks] of this._pendingProgressChunks) {
149
+ this._logService.debug(`Processing ${chunks.length} pending progress chunks for session ${this.sessionId}, requestId ${requestId}`);
150
+ this._addProgress(chunks);
151
+ }
152
+ this._pendingProgressChunks.clear();
153
+ if (!hasAnyCapability) {
154
+ this._isCompleteObservable.set(true, undefined);
155
+ }
156
+ }
157
+ catch (error) {
158
+ this._logService.error(`Failed to initialize chat session ${this.sessionId}:`, error);
159
+ throw error;
160
+ }
161
+ }
162
+ handleProgressChunk(requestId, progress) {
163
+ if (!this._isInitialized) {
164
+ const existing = this._pendingProgressChunks.get(requestId) || [];
165
+ this._pendingProgressChunks.set(requestId, [...existing, ...progress]);
166
+ this._logService.debug(`Queuing ${progress.length} progress chunks for session ${this.sessionId}, requestId ${requestId} (session not initialized)`);
167
+ return;
168
+ }
169
+ this._addProgress(progress);
170
+ }
171
+ handleProgressComplete(requestId) {
172
+ this._pendingProgressChunks.delete(requestId);
173
+ if (this._isInitialized) {
174
+ if (!this._interruptionWasCanceled) {
175
+ this._markComplete();
176
+ }
177
+ else {
178
+ this._interruptionWasCanceled = false;
179
+ }
180
+ }
181
+ }
182
+ _addProgress(progress) {
183
+ const currentProgress = this._progressObservable.get();
184
+ this._progressObservable.set([...currentProgress, ...progress], undefined);
185
+ }
186
+ _markComplete() {
187
+ if (!this._isCompleteObservable.get()) {
188
+ this._isCompleteObservable.set(true, undefined);
189
+ }
190
+ }
191
+ dispose() {
192
+ this._onWillDispose.fire();
193
+ this._onWillDispose.dispose();
194
+ this._pendingProgressChunks.clear();
195
+ if (this.interruptActiveResponseCallback && !this._interruptionWasCanceled) {
196
+ this._disposalPending = true;
197
+ }
198
+ else {
199
+ this._proxy.$disposeChatSessionContent(this._providerHandle, this.sessionId);
200
+ }
201
+ super.dispose();
202
+ }
203
+ }
19
204
  let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
20
205
  constructor(_extHostContext, _chatSessionsService, _dialogService, _editorService, _logService, _viewsService) {
21
206
  super();
@@ -26,21 +211,29 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
26
211
  this._logService = _logService;
27
212
  this._viewsService = _viewsService;
28
213
  this._itemProvidersRegistrations = this._register(( new DisposableMap()));
29
- this._contentProvidersRegisterations = this._register(( new DisposableMap()));
30
- this._activeProgressEmitters = ( new Map());
31
- this._completionEmitters = ( new Map());
32
- this._pendingProgressChunks = ( new Map());
214
+ this._contentProvidersRegistrations = this._register(( new DisposableMap()));
215
+ this._activeSessions = ( new Map());
216
+ this._sessionDisposables = ( new Map());
33
217
  this._proxy = ( this._extHostContext.getProxy(ExtHostContext.ExtHostChatSessions));
34
218
  }
35
219
  $registerChatSessionItemProvider(handle, chatSessionType) {
220
+ const disposables = ( new DisposableStore());
221
+ const changeEmitter = disposables.add(( new Emitter()));
36
222
  const provider = {
37
223
  chatSessionType,
38
- provideChatSessionItems: (token) => this._provideChatSessionItems(handle, token)
224
+ onDidChangeChatSessionItems: changeEmitter.event,
225
+ provideChatSessionItems: (token) => this._provideChatSessionItems(handle, token),
226
+ provideNewChatSessionItem: (options, token) => this._provideNewChatSessionItem(handle, options, token)
39
227
  };
40
- this._itemProvidersRegistrations.set(handle, this._chatSessionsService.registerChatSessionItemProvider(provider));
228
+ disposables.add(this._chatSessionsService.registerChatSessionItemProvider(provider));
229
+ this._itemProvidersRegistrations.set(handle, {
230
+ dispose: () => disposables.dispose(),
231
+ provider,
232
+ onDidChangeItems: changeEmitter,
233
+ });
41
234
  }
42
- $onDidChangeChatSessionItems(chatSessionType) {
43
- this._chatSessionsService.notifySessionItemsChange(chatSessionType);
235
+ $onDidChangeChatSessionItems(handle) {
236
+ this._itemProvidersRegistrations.get(handle)?.onDidChangeItems.fire();
44
237
  }
45
238
  async _provideChatSessionItems(handle, token) {
46
239
  try {
@@ -48,7 +241,8 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
48
241
  return ( sessions.map(session => ({
49
242
  ...session,
50
243
  id: session.id,
51
- iconPath: session.iconPath ? this._reviveIconPath(session.iconPath) : undefined
244
+ iconPath: session.iconPath,
245
+ tooltip: session.tooltip ? this._reviveTooltip(session.tooltip) : undefined
52
246
  })));
53
247
  }
54
248
  catch (error) {
@@ -56,75 +250,43 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
56
250
  }
57
251
  return [];
58
252
  }
59
- async _provideChatSessionContent(providerHandle, id, token) {
253
+ async _provideNewChatSessionItem(handle, options, token) {
60
254
  try {
61
- const sessionContent = await raceCancellationError(this._proxy.$provideChatSessionContent(providerHandle, id, token), token);
62
- const progressEmitter = ( new Emitter());
63
- const completionEmitter = ( new Emitter());
64
- let progressEvent = undefined;
65
- let interruptActiveResponseCallback = undefined;
66
- if (sessionContent.hasActiveResponseCallback) {
67
- const requestId = 'ongoing';
68
- progressEvent = progressEmitter.event;
69
- const progressKey = `${providerHandle}_${id}_${requestId}`;
70
- interruptActiveResponseCallback = async () => {
71
- return this._dialogService.confirm({
72
- message: ( localize(2445, 'Are you sure you want to interrupt the active session?'))
73
- }).then(confirmed => {
74
- if (confirmed.confirmed) {
75
- this._proxy.$interruptChatSessionActiveResponse(providerHandle, id, requestId);
76
- return true;
77
- }
78
- else {
79
- progressEmitter.fire([{
80
- kind: 'progressMessage',
81
- content: { value: '' }
82
- }]);
83
- return false;
84
- }
85
- });
86
- };
87
- this._activeProgressEmitters.set(progressKey, progressEmitter);
88
- this._completionEmitters.set(progressKey, completionEmitter);
89
- }
90
- let requestHandler;
91
- if (sessionContent.hasRequestHandler) {
92
- requestHandler = async (request, progress, history, token) => {
93
- const progressKey = `${providerHandle}_${id}_${request.requestId}`;
94
- const _progressEmitter = ( new Emitter());
95
- this._activeProgressEmitters.set(progressKey, _progressEmitter);
96
- _progressEmitter.event(e => {
97
- progress(e);
98
- });
99
- await this._proxy.$invokeChatSessionRequestHandler(providerHandle, id, request, [], token);
100
- };
255
+ const chatSessionItem = await this._proxy.$provideNewChatSessionItem(handle, options, token);
256
+ if (!chatSessionItem) {
257
+ throw ( new Error('Extension failed to create chat session'));
101
258
  }
102
- const onWillDisposeEventEmitter = ( new Emitter());
103
259
  return {
104
- id: sessionContent.id,
105
- onWillDispose: onWillDisposeEventEmitter.event,
106
- history: ( sessionContent.history.map(turn => {
107
- if (turn.type === 'request') {
108
- return { type: 'request', prompt: turn.prompt };
109
- }
110
- return {
111
- type: 'response',
112
- parts: ( turn.parts.map(part => revive(part)))
113
- };
114
- })),
115
- progressEvent: progressEvent,
116
- requestHandler: requestHandler,
117
- interruptActiveResponseCallback: interruptActiveResponseCallback,
118
- dispose: () => {
119
- onWillDisposeEventEmitter.fire();
120
- onWillDisposeEventEmitter.dispose();
121
- progressEmitter.dispose();
122
- completionEmitter.dispose();
123
- this._proxy.$disposeChatSessionContent(providerHandle, sessionContent.id);
124
- },
260
+ ...chatSessionItem,
261
+ id: chatSessionItem.id,
262
+ iconPath: chatSessionItem.iconPath,
263
+ tooltip: chatSessionItem.tooltip ? this._reviveTooltip(chatSessionItem.tooltip) : undefined,
125
264
  };
126
265
  }
127
266
  catch (error) {
267
+ this._logService.error('Error creating chat session:', error);
268
+ throw error;
269
+ }
270
+ }
271
+ async _provideChatSessionContent(providerHandle, id, token) {
272
+ const sessionKey = ObservableChatSession.generateSessionKey(providerHandle, id);
273
+ let session = this._activeSessions.get(sessionKey);
274
+ if (!session) {
275
+ session = ( new ObservableChatSession(id, providerHandle, this._proxy, this._logService, this._dialogService));
276
+ this._activeSessions.set(sessionKey, session);
277
+ const disposable = session.onWillDispose(() => {
278
+ this._activeSessions.delete(sessionKey);
279
+ this._sessionDisposables.get(sessionKey)?.dispose();
280
+ this._sessionDisposables.delete(sessionKey);
281
+ });
282
+ this._sessionDisposables.set(sessionKey, disposable);
283
+ }
284
+ try {
285
+ await session.initialize(token);
286
+ return session;
287
+ }
288
+ catch (error) {
289
+ session.dispose();
128
290
  this._logService.error(`Error providing chat session content for handle ${providerHandle} and id ${id}:`, error);
129
291
  throw error;
130
292
  }
@@ -134,90 +296,65 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
134
296
  }
135
297
  $registerChatSessionContentProvider(handle, chatSessionType) {
136
298
  const provider = {
137
- chatSessionType,
138
299
  provideChatSessionContent: (id, token) => this._provideChatSessionContent(handle, id, token)
139
300
  };
140
- this._contentProvidersRegisterations.set(handle, this._chatSessionsService.registerChatSessionContentProvider(provider));
301
+ this._contentProvidersRegistrations.set(handle, this._chatSessionsService.registerChatSessionContentProvider(chatSessionType, provider));
141
302
  }
142
303
  $unregisterChatSessionContentProvider(handle) {
143
- this._contentProvidersRegisterations.deleteAndDispose(handle);
304
+ this._contentProvidersRegistrations.deleteAndDispose(handle);
305
+ for (const [key, session] of this._activeSessions) {
306
+ if (session.providerHandle === handle) {
307
+ session.dispose();
308
+ this._activeSessions.delete(key);
309
+ }
310
+ }
144
311
  }
145
312
  async $handleProgressChunk(handle, sessionId, requestId, chunks) {
146
- const progressKey = `${handle}_${sessionId}_${requestId}`;
147
- const progressEmitter = this._activeProgressEmitters.get(progressKey);
148
- if (!progressEmitter) {
149
- const existingChunks = this._pendingProgressChunks.get(progressKey) || [];
150
- this._pendingProgressChunks.set(progressKey, [...existingChunks, ...chunks]);
151
- this._logService.debug(`Storing pending progress chunks for handle ${handle}, sessionId ${sessionId}, requestId ${requestId}`);
152
- return;
153
- }
154
- const pendingChunks = this._pendingProgressChunks.get(progressKey);
155
- if (pendingChunks && pendingChunks.length > 0) {
156
- this._logService.debug(`Flushing ${pendingChunks.length} pending progress chunks for handle ${handle}, sessionId ${sessionId}, requestId ${requestId}`);
157
- const pendingProgressParts = ( pendingChunks.map(chunk => {
158
- const [progress] = Array.isArray(chunk) ? chunk : [chunk];
159
- return revive(progress);
160
- }));
161
- progressEmitter.fire(pendingProgressParts);
162
- this._pendingProgressChunks.delete(progressKey);
163
- }
313
+ const sessionKey = ObservableChatSession.generateSessionKey(handle, sessionId);
314
+ const observableSession = this._activeSessions.get(sessionKey);
164
315
  const chatProgressParts = ( chunks.map(chunk => {
165
316
  const [progress] = Array.isArray(chunk) ? chunk : [chunk];
166
317
  return revive(progress);
167
318
  }));
168
- progressEmitter.fire(chatProgressParts);
319
+ if (observableSession) {
320
+ observableSession.handleProgressChunk(requestId, chatProgressParts);
321
+ }
322
+ else {
323
+ this._logService.warn(`No session found for progress chunks: handle ${handle}, sessionId ${sessionId}, requestId ${requestId}`);
324
+ }
169
325
  }
170
326
  $handleProgressComplete(handle, sessionId, requestId) {
171
- const progressKey = `${handle}_${sessionId}_${requestId}`;
172
- const progressEmitter = this._activeProgressEmitters.get(progressKey);
173
- const completionEmitter = this._completionEmitters.get(progressKey);
174
- if (!progressEmitter) {
175
- this._logService.warn(`No progress emitter found for handle ${handle} and requestId ${requestId}`);
176
- return;
327
+ const sessionKey = ObservableChatSession.generateSessionKey(handle, sessionId);
328
+ const observableSession = this._activeSessions.get(sessionKey);
329
+ if (observableSession) {
330
+ observableSession.handleProgressComplete(requestId);
177
331
  }
178
- const completionProgress = {
179
- kind: 'progressMessage',
180
- content: { value: 'Session completed', isTrusted: false }
181
- };
182
- progressEmitter.fire([completionProgress]);
183
- if (completionEmitter) {
184
- completionEmitter.fire();
332
+ else {
333
+ this._logService.warn(`No session found for progress completion: handle ${handle}, sessionId ${sessionId}, requestId ${requestId}`);
185
334
  }
186
- progressEmitter.dispose();
187
- completionEmitter?.dispose();
188
- this._activeProgressEmitters.delete(progressKey);
189
- this._completionEmitters.delete(progressKey);
190
- this._pendingProgressChunks.delete(progressKey);
191
335
  }
192
336
  $handleAnchorResolve(handle, sessionId, requestId, requestHandle, anchor) {
193
337
  }
194
338
  dispose() {
195
- for (const emitter of ( this._activeProgressEmitters.values())) {
196
- emitter.dispose();
339
+ for (const session of ( this._activeSessions.values())) {
340
+ session.dispose();
197
341
  }
198
- this._activeProgressEmitters.clear();
199
- for (const emitter of ( this._completionEmitters.values())) {
200
- emitter.dispose();
342
+ this._activeSessions.clear();
343
+ for (const disposable of ( this._sessionDisposables.values())) {
344
+ disposable.dispose();
201
345
  }
202
- this._completionEmitters.clear();
203
- this._pendingProgressChunks.clear();
346
+ this._sessionDisposables.clear();
204
347
  super.dispose();
205
348
  }
206
- _reviveIconPath(iconPath) {
207
- if (!iconPath) {
349
+ _reviveTooltip(tooltip) {
350
+ if (!tooltip) {
208
351
  return undefined;
209
352
  }
210
- if (typeof iconPath === 'object' && 'id' in iconPath) {
211
- return iconPath;
353
+ if (typeof tooltip === 'string') {
354
+ return tooltip;
212
355
  }
213
- if (typeof iconPath === 'object' && 'scheme' in iconPath) {
214
- return URI.revive(iconPath);
215
- }
216
- if (typeof iconPath === 'object' && ('light' in iconPath && 'dark' in iconPath)) {
217
- return {
218
- light: URI.revive(iconPath.light),
219
- dark: URI.revive(iconPath.dark)
220
- };
356
+ if (typeof tooltip === 'object' && 'value' in tooltip) {
357
+ return MarkdownString.lift(tooltip);
221
358
  }
222
359
  return undefined;
223
360
  }
@@ -244,4 +381,4 @@ MainThreadChatSessions = __decorate([
244
381
  ( __param(5, IViewsService))
245
382
  ], MainThreadChatSessions);
246
383
 
247
- export { MainThreadChatSessions };
384
+ export { MainThreadChatSessions, ObservableChatSession };
@@ -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-a8d3bd74-e63e-5327-96e8-4f931661e329-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
17
+ import { ViewPaneContainer } from '@codingame/monaco-vscode-71c8dbff-4c98-552f-aef0-e72b00fdcfc0-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';
@@ -424,7 +424,7 @@ class MainThreadCommentController extends Disposable {
424
424
  };
425
425
  }
426
426
  }
427
- const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localize(2446, 'View icon of the comments view.')));
427
+ const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localize(2450, 'View icon of the comments view.')));
428
428
  let MainThreadComments = class MainThreadComments extends Disposable {
429
429
  constructor(extHostContext, _commentService, _viewsService, _viewDescriptorService, _uriIdentityService, _editorService) {
430
430
  super();
@@ -27,13 +27,13 @@ import { ICustomEditorService } from '@codingame/monaco-vscode-api/vscode/vs/wor
27
27
  import { CustomTextEditorModel } from '../../contrib/customEditor/common/customTextEditorModel.js';
28
28
  import { ExtensionKeyedWebviewOriginStore } from '@codingame/monaco-vscode-a654b07e-8806-5425-b124-18f03ba8e11a-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
- import { editorGroupToColumn } from '@codingame/monaco-vscode-a17e9d37-b6c1-5556-8402-5db73960fae3-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
30
+ import { editorGroupToColumn } from '@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-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';
32
32
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
33
33
  import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
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
- import { ResourceWorkingCopy } from '@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common/vscode/vs/workbench/services/workingCopy/common/resourceWorkingCopy';
36
+ import { ResourceWorkingCopy } from '@codingame/monaco-vscode-bba55be6-41a2-50cd-a3cc-8bafa35bfa89-common/vscode/vs/workbench/services/workingCopy/common/resourceWorkingCopy';
37
37
  import { NO_TYPE_ID, WorkingCopyCapabilities } from '@codingame/monaco-vscode-caeb744c-8e3f-5c11-80fb-0f057d24d544-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';
@@ -303,7 +303,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
303
303
  this._register(workingCopyService.registerWorkingCopy(this));
304
304
  this._register(extensionService.onWillStop(e => {
305
305
  e.veto(true, ( localize(
306
- 2447,
306
+ 2451,
307
307
  "An extension provided editor for '{0}' is still open that would close otherwise.",
308
308
  this.name
309
309
  )));
@@ -371,7 +371,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
371
371
  this._undoService.pushElement({
372
372
  type: UndoRedoElementType.Resource,
373
373
  resource: this._editorResource,
374
- label: label ?? ( localize(2448, "Edit")),
374
+ label: label ?? ( localize(2452, "Edit")),
375
375
  code: 'undoredo.customEditorEdit',
376
376
  undo: () => this.undo(),
377
377
  redo: () => this.redo(),
@@ -1,5 +1,5 @@
1
1
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IDataChannelService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/dataChannel/common/dataChannel.service";
2
+ import { IDataChannelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel.service";
3
3
  import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
4
4
  import { MainThreadDataChannelsShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
5
5
  export declare class MainThreadDataChannels extends Disposable implements MainThreadDataChannelsShape {
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
- import { IDataChannelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/dataChannel/common/dataChannel.service';
4
+ import { IDataChannelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dataChannel/common/dataChannel.service';
5
5
  import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
6
  import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
7
7
 
@@ -13,7 +13,7 @@ import { MainThreadDocuments } from './mainThreadDocuments.js';
13
13
  import { MainThreadTextEditor } from './mainThreadEditor.js';
14
14
  import { MainThreadTextEditors } from './mainThreadEditors.js';
15
15
  import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
16
- import { editorGroupToColumn } from '@codingame/monaco-vscode-a17e9d37-b6c1-5556-8402-5db73960fae3-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
16
+ import { editorGroupToColumn } from '@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
17
17
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
18
18
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
19
19
  import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
@@ -14,7 +14,7 @@ class ExtHostEditSessionIdentityCreateParticipant {
14
14
  }
15
15
  async participate(workspaceFolder, token) {
16
16
  const p = ( new Promise((resolve, reject) => {
17
- setTimeout(() => reject(( new Error(( localize(2449, "Aborted onWillCreateEditSessionIdentity-event after 10000ms"))))), this.timeout);
17
+ setTimeout(() => reject(( new Error(( localize(2453, "Aborted onWillCreateEditSessionIdentity-event after 10000ms"))))), this.timeout);
18
18
  this._proxy.$onWillCreateEditSessionIdentity(workspaceFolder.uri, token, this.timeout).then(resolve, reject);
19
19
  }));
20
20
  return raceCancellationError(p, token);
@@ -1,7 +1,7 @@
1
1
  import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
2
2
  import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
3
3
  import { MainThreadEditorTabsShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
4
- import { EditorGroupColumn } from "@codingame/monaco-vscode-a17e9d37-b6c1-5556-8402-5db73960fae3-common/vscode/vs/workbench/services/editor/common/editorGroupColumn";
4
+ import { EditorGroupColumn } from "@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-common/vscode/vs/workbench/services/editor/common/editorGroupColumn";
5
5
  import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
6
6
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
7
7
  import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
@@ -18,9 +18,9 @@ import { InteractiveEditorInput } from '@codingame/monaco-vscode-eba0b9b3-174c-5
18
18
  import { MergeEditorInput } from '@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput';
19
19
  import { MultiDiffEditorInput } from '@codingame/monaco-vscode-0af61f78-dfc5-57ba-8d32-66268c8de38d-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput';
20
20
  import { NotebookEditorInput } from '@codingame/monaco-vscode-670aae94-7f88-54d7-90ea-6fcbef423557-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
21
- import { TerminalEditorInput } from '@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput';
21
+ import { TerminalEditorInput } from '@codingame/monaco-vscode-05a2a821-e4de-5941-b7f9-bbf01c09f229-common/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput';
22
22
  import { WebviewInput } from '@codingame/monaco-vscode-670aae94-7f88-54d7-90ea-6fcbef423557-common/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
23
- import { editorGroupToColumn, columnToEditorGroup } from '@codingame/monaco-vscode-a17e9d37-b6c1-5556-8402-5db73960fae3-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
23
+ import { editorGroupToColumn, columnToEditorGroup } from '@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
24
24
  import { GroupDirection, preferredSideBySideGroupDirection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService';
25
25
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
26
26
  import { SIDE_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
@@ -6,7 +6,7 @@ import { IDecorationOptions, IDecorationRenderOptions } from "@codingame/monaco-
6
6
  import { ISingleEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/editOperation";
7
7
  import { MainThreadTextEditor } from "./mainThreadEditor.js";
8
8
  import { IApplyEditsOptions, ITextDocumentShowOptions, ITextEditorConfigurationUpdate, IUndoStopOptions, MainThreadTextEditorsShape, TextEditorRevealType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
9
- import { EditorGroupColumn } from "@codingame/monaco-vscode-a17e9d37-b6c1-5556-8402-5db73960fae3-common/vscode/vs/workbench/services/editor/common/editorGroupColumn";
9
+ import { EditorGroupColumn } from "@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-common/vscode/vs/workbench/services/editor/common/editorGroupColumn";
10
10
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
11
11
  import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
12
12
  import { ExtensionIdentifier } from "@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions";
@@ -8,7 +8,7 @@ import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/edito
8
8
  import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
9
9
  import { isTextEditorDiffInformationEqual, EditorResolution, EditorActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor';
10
10
  import { ExtHostContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
11
- import { editorGroupToColumn, columnToEditorGroup } from '@codingame/monaco-vscode-a17e9d37-b6c1-5556-8402-5db73960fae3-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
11
+ import { editorGroupToColumn, columnToEditorGroup } from '@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
12
12
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
13
13
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
14
14
  import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';