@codingame/monaco-vscode-extensions-service-override 28.4.1 → 29.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.
- package/index.js +1 -0
- package/package.json +3 -3
- package/vscode/src/vs/platform/browserView/common/browserViewTelemetry.d.ts +34 -0
- package/vscode/src/vs/platform/browserView/common/browserViewTelemetry.js +7 -0
- package/vscode/src/vs/platform/browserView/common/browserViewUri.d.ts +21 -0
- package/vscode/src/vs/platform/browserView/common/browserViewUri.js +34 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +28 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +25 -25
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.d.ts +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.js +147 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +6 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +8 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +160 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +19 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +134 -49
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +47 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +9 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +4 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +21 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +25 -23
- package/vscode/src/vs/workbench/api/common/shared/tasks.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/browserView/common/browserEditorInput.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/browserView/common/browserEditorInput.js +222 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/git/common/gitService.d.ts +22 -0
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +6 -6
|
@@ -12,6 +12,7 @@ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/reso
|
|
|
12
12
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
13
13
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
14
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
15
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
16
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
16
17
|
import { hasValidDiff } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel';
|
|
17
18
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
@@ -21,9 +22,12 @@ import { ChatEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbenc
|
|
|
21
22
|
import { awaitStatsForSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
|
|
22
23
|
import { ResponseModelState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
23
24
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
24
|
-
import { ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
25
|
+
import { ChatSessionOptionsMap, ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
25
26
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
26
27
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
28
|
+
import { isUntitledChatSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
29
|
+
import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
|
|
30
|
+
import { IChatArtifactsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service';
|
|
27
31
|
import { IChatTodoListService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatTodoListService.service';
|
|
28
32
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
29
33
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
@@ -34,7 +38,7 @@ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
|
|
|
34
38
|
|
|
35
39
|
class ObservableChatSession extends Disposable {
|
|
36
40
|
get options() {
|
|
37
|
-
return this._options;
|
|
41
|
+
return this._options ? ( new Map(this._options)) : undefined;
|
|
38
42
|
}
|
|
39
43
|
get progressObs() {
|
|
40
44
|
return this._progressObservable;
|
|
@@ -60,19 +64,19 @@ class ObservableChatSession extends Disposable {
|
|
|
60
64
|
this._logService = logService;
|
|
61
65
|
this._dialogService = dialogService;
|
|
62
66
|
}
|
|
63
|
-
initialize(token) {
|
|
67
|
+
initialize(token, context) {
|
|
64
68
|
if (!this._initializationPromise) {
|
|
65
|
-
this._initializationPromise = this._doInitializeContent(token);
|
|
69
|
+
this._initializationPromise = this._doInitializeContent(token, context);
|
|
66
70
|
}
|
|
67
71
|
return this._initializationPromise;
|
|
68
72
|
}
|
|
69
|
-
async _doInitializeContent(token) {
|
|
73
|
+
async _doInitializeContent(token, context) {
|
|
70
74
|
try {
|
|
71
75
|
const sessionContent = await raceCancellationError(
|
|
72
|
-
this._proxy.$provideChatSessionContent(this._providerHandle, this.sessionResource, token),
|
|
76
|
+
this._proxy.$provideChatSessionContent(this._providerHandle, this.sessionResource, context, token),
|
|
73
77
|
token
|
|
74
78
|
);
|
|
75
|
-
this._options = sessionContent.options;
|
|
79
|
+
this._options = sessionContent.options ? ChatSessionOptionsMap.fromRecord(sessionContent.options) : undefined;
|
|
76
80
|
this.title = sessionContent.title;
|
|
77
81
|
this.history.length = 0;
|
|
78
82
|
this.history.push(...( sessionContent.history.map(turn => {
|
|
@@ -116,7 +120,7 @@ class ObservableChatSession extends Disposable {
|
|
|
116
120
|
return confirmInterrupt();
|
|
117
121
|
}
|
|
118
122
|
return this._dialogService.confirm({
|
|
119
|
-
message: ( localize(
|
|
123
|
+
message: ( localize(2554, "Are you sure you want to interrupt the active session?"))
|
|
120
124
|
}).then(confirmed => {
|
|
121
125
|
if (confirmed.confirmed) {
|
|
122
126
|
return confirmInterrupt();
|
|
@@ -178,6 +182,17 @@ class ObservableChatSession extends Disposable {
|
|
|
178
182
|
}
|
|
179
183
|
};
|
|
180
184
|
}
|
|
185
|
+
if (sessionContent.hasForkHandler && !this.forkSession) {
|
|
186
|
+
this.forkSession = async (request, token) => {
|
|
187
|
+
const result = await this._proxy.$forkChatSession(
|
|
188
|
+
this._providerHandle,
|
|
189
|
+
this.sessionResource,
|
|
190
|
+
request ? this.toRequestDto(request) : undefined,
|
|
191
|
+
token
|
|
192
|
+
);
|
|
193
|
+
return revive(result);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
181
196
|
this._isInitialized = true;
|
|
182
197
|
const hasActiveResponse = sessionContent.hasActiveResponseCallback;
|
|
183
198
|
const hasRequestHandler = sessionContent.hasRequestHandler;
|
|
@@ -227,6 +242,17 @@ class ObservableChatSession extends Disposable {
|
|
|
227
242
|
this._isCompleteObservable.set(true, undefined);
|
|
228
243
|
}
|
|
229
244
|
}
|
|
245
|
+
toRequestDto(request) {
|
|
246
|
+
return {
|
|
247
|
+
type: "request",
|
|
248
|
+
id: request.id,
|
|
249
|
+
prompt: request.prompt,
|
|
250
|
+
participant: request.participant,
|
|
251
|
+
command: request.command,
|
|
252
|
+
variableData: undefined,
|
|
253
|
+
modelId: request.modelId
|
|
254
|
+
};
|
|
255
|
+
}
|
|
230
256
|
dispose() {
|
|
231
257
|
this._onWillDispose.fire();
|
|
232
258
|
this._onWillDispose.dispose();
|
|
@@ -239,14 +265,25 @@ class ObservableChatSession extends Disposable {
|
|
|
239
265
|
super.dispose();
|
|
240
266
|
}
|
|
241
267
|
}
|
|
242
|
-
class MainThreadChatSessionItemController extends Disposable {
|
|
243
|
-
constructor(proxy, handle) {
|
|
268
|
+
let MainThreadChatSessionItemController = class MainThreadChatSessionItemController extends Disposable {
|
|
269
|
+
constructor(proxy, chatSessionType, handle, chatService, _logService) {
|
|
244
270
|
super();
|
|
271
|
+
this._logService = _logService;
|
|
245
272
|
this._onDidChangeChatSessionItems = this._register(( new Emitter()));
|
|
246
273
|
this.onDidChangeChatSessionItems = this._onDidChangeChatSessionItems.event;
|
|
247
274
|
this._items = ( new ResourceMap());
|
|
248
275
|
this._proxy = proxy;
|
|
249
276
|
this._handle = handle;
|
|
277
|
+
this._register(
|
|
278
|
+
chatService.registerChatModelChangeListeners(chatSessionType, sessionResource => {
|
|
279
|
+
const item = this._items.get(sessionResource);
|
|
280
|
+
if (item) {
|
|
281
|
+
this._onDidChangeChatSessionItems.fire({
|
|
282
|
+
addedOrUpdated: [item]
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
})
|
|
286
|
+
);
|
|
250
287
|
}
|
|
251
288
|
get items() {
|
|
252
289
|
return Array.from(( this._items.values()));
|
|
@@ -255,7 +292,11 @@ class MainThreadChatSessionItemController extends Disposable {
|
|
|
255
292
|
return this._proxy.$refreshChatSessionItems(this._handle, token);
|
|
256
293
|
}
|
|
257
294
|
async newChatSessionItem(request, token) {
|
|
258
|
-
const dto = await raceCancellationError(this._proxy.$newChatSessionItem(this._handle,
|
|
295
|
+
const dto = await raceCancellationError(this._proxy.$newChatSessionItem(this._handle, {
|
|
296
|
+
prompt: request.prompt,
|
|
297
|
+
command: request.command,
|
|
298
|
+
initialSessionOptions: request.initialSessionOptions ? ChatSessionOptionsMap.toStrValueArray(request.initialSessionOptions) : undefined
|
|
299
|
+
}, token), token);
|
|
259
300
|
if (!dto) {
|
|
260
301
|
return undefined;
|
|
261
302
|
}
|
|
@@ -265,26 +306,33 @@ class MainThreadChatSessionItemController extends Disposable {
|
|
|
265
306
|
changes: revive(dto.changes)
|
|
266
307
|
};
|
|
267
308
|
this._items.set(item.resource, item);
|
|
268
|
-
this._onDidChangeChatSessionItems.fire(
|
|
309
|
+
this._onDidChangeChatSessionItems.fire({
|
|
310
|
+
addedOrUpdated: [item]
|
|
311
|
+
});
|
|
269
312
|
return item;
|
|
270
313
|
}
|
|
271
314
|
acceptChange(change) {
|
|
272
315
|
for (const item of change.addedOrUpdated) {
|
|
316
|
+
warnOnUntitledSessionResource(item.resource, this._logService);
|
|
273
317
|
this._items.set(item.resource, item);
|
|
274
318
|
}
|
|
275
319
|
for (const uri of change.removed) {
|
|
276
320
|
this._items.delete(uri);
|
|
277
321
|
}
|
|
278
|
-
this._onDidChangeChatSessionItems.fire(
|
|
322
|
+
this._onDidChangeChatSessionItems.fire({
|
|
323
|
+
addedOrUpdated: change.addedOrUpdated,
|
|
324
|
+
removed: change.removed
|
|
325
|
+
});
|
|
279
326
|
}
|
|
280
327
|
addOrUpdateItem(item) {
|
|
328
|
+
warnOnUntitledSessionResource(item.resource, this._logService);
|
|
281
329
|
this._items.set(item.resource, item);
|
|
282
|
-
this._onDidChangeChatSessionItems.fire(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this._onDidChangeChatSessionItems.fire();
|
|
330
|
+
this._onDidChangeChatSessionItems.fire({
|
|
331
|
+
addedOrUpdated: [item]
|
|
332
|
+
});
|
|
286
333
|
}
|
|
287
|
-
}
|
|
334
|
+
};
|
|
335
|
+
MainThreadChatSessionItemController = ( __decorate([( __param(3, IChatService)), ( __param(4, ILogService))], MainThreadChatSessionItemController));
|
|
288
336
|
let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
289
337
|
constructor(
|
|
290
338
|
_extHostContext,
|
|
@@ -293,10 +341,13 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
293
341
|
_chatService,
|
|
294
342
|
_chatWidgetService,
|
|
295
343
|
_chatTodoListService,
|
|
344
|
+
_chatArtifactsService,
|
|
345
|
+
_chatDebugService,
|
|
296
346
|
_dialogService,
|
|
297
347
|
_editorService,
|
|
298
348
|
editorGroupService,
|
|
299
|
-
_logService
|
|
349
|
+
_logService,
|
|
350
|
+
_instantiationService
|
|
300
351
|
) {
|
|
301
352
|
super();
|
|
302
353
|
this._extHostContext = _extHostContext;
|
|
@@ -305,29 +356,32 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
305
356
|
this._chatService = _chatService;
|
|
306
357
|
this._chatWidgetService = _chatWidgetService;
|
|
307
358
|
this._chatTodoListService = _chatTodoListService;
|
|
359
|
+
this._chatArtifactsService = _chatArtifactsService;
|
|
360
|
+
this._chatDebugService = _chatDebugService;
|
|
308
361
|
this._dialogService = _dialogService;
|
|
309
362
|
this._editorService = _editorService;
|
|
310
363
|
this.editorGroupService = editorGroupService;
|
|
311
364
|
this._logService = _logService;
|
|
365
|
+
this._instantiationService = _instantiationService;
|
|
312
366
|
this._itemControllerRegistrations = this._register(( new DisposableMap()));
|
|
313
367
|
this._contentProvidersRegistrations = this._register(( new DisposableMap()));
|
|
314
368
|
this._sessionTypeToHandle = ( new Map());
|
|
315
369
|
this._activeSessions = ( new ResourceMap());
|
|
316
370
|
this._sessionDisposables = ( new ResourceMap());
|
|
317
371
|
this._proxy = ( this._extHostContext.getProxy(ExtHostContext.ExtHostChatSessions));
|
|
318
|
-
this._register(this._chatSessionsService.
|
|
372
|
+
this._register(this._chatSessionsService.onDidChangeSessionOptions((
|
|
319
373
|
{
|
|
320
374
|
sessionResource,
|
|
321
|
-
updates
|
|
322
|
-
waitUntil
|
|
375
|
+
updates
|
|
323
376
|
}
|
|
324
377
|
) => {
|
|
378
|
+
warnOnUntitledSessionResource(sessionResource, this._logService);
|
|
325
379
|
const handle = this._getHandleForSessionType(sessionResource.scheme);
|
|
326
380
|
this._logService.trace(
|
|
327
|
-
`[MainThreadChatSessions] onRequestNotifyExtension received: scheme '${sessionResource.scheme}', handle ${handle}, ${updates.
|
|
381
|
+
`[MainThreadChatSessions] onRequestNotifyExtension received: scheme '${sessionResource.scheme}', handle ${handle}, ${updates.size} update(s)`
|
|
328
382
|
);
|
|
329
383
|
if (handle !== undefined) {
|
|
330
|
-
|
|
384
|
+
this.notifyOptionsChange(handle, sessionResource, updates);
|
|
331
385
|
} else {
|
|
332
386
|
this._logService.warn(
|
|
333
387
|
`[MainThreadChatSessions] Cannot notify option change for scheme '${sessionResource.scheme}': no provider registered. Registered schemes: [${Array.from(( this._sessionTypeToHandle.keys())).join(", ")}]`
|
|
@@ -340,6 +394,7 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
340
394
|
chatSessionType
|
|
341
395
|
}] of this._itemControllerRegistrations) {
|
|
342
396
|
if (chatSessionType === session.providerType) {
|
|
397
|
+
warnOnUntitledSessionResource(session.resource, this._logService);
|
|
343
398
|
this._proxy.$onDidChangeChatSessionItemState(handle, session.resource, session.isArchived());
|
|
344
399
|
}
|
|
345
400
|
}
|
|
@@ -351,7 +406,9 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
351
406
|
}
|
|
352
407
|
$registerChatSessionItemController(handle, chatSessionType) {
|
|
353
408
|
const disposables = ( new DisposableStore());
|
|
354
|
-
const controller = disposables.add(
|
|
409
|
+
const controller = disposables.add(
|
|
410
|
+
this._instantiationService.createInstance(MainThreadChatSessionItemController, this._proxy, chatSessionType, handle)
|
|
411
|
+
);
|
|
355
412
|
disposables.add(
|
|
356
413
|
this._chatSessionsService.registerChatSessionItemController(chatSessionType, controller)
|
|
357
414
|
);
|
|
@@ -360,11 +417,6 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
360
417
|
controller,
|
|
361
418
|
dispose: () => disposables.dispose()
|
|
362
419
|
});
|
|
363
|
-
disposables.add(this._chatSessionsService.registerChatModelChangeListeners(
|
|
364
|
-
this._chatService,
|
|
365
|
-
chatSessionType,
|
|
366
|
-
() => controller.fireOnDidChangeChatSessionItems()
|
|
367
|
-
));
|
|
368
420
|
}
|
|
369
421
|
getController(handle) {
|
|
370
422
|
const registration = this._itemControllerRegistrations.get(handle);
|
|
@@ -373,17 +425,14 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
373
425
|
}
|
|
374
426
|
return registration.controller;
|
|
375
427
|
}
|
|
376
|
-
$onDidChangeChatSessionItems(handle) {
|
|
377
|
-
const controller = this.getController(handle);
|
|
378
|
-
controller.fireOnDidChangeChatSessionItems();
|
|
379
|
-
}
|
|
380
428
|
async _resolveSessionItem(item) {
|
|
381
429
|
const uri = URI.revive(item.resource);
|
|
382
430
|
const model = this._chatService.getSession(uri);
|
|
383
431
|
if (model) {
|
|
384
432
|
item = await this.handleSessionModelOverrides(model, item);
|
|
385
433
|
}
|
|
386
|
-
|
|
434
|
+
let changes = revive(item.changes);
|
|
435
|
+
if (!changes || !model) {
|
|
387
436
|
const stats = (await this._chatService.getMetadataForSession(uri))?.stats;
|
|
388
437
|
const diffs = {
|
|
389
438
|
files: stats?.fileCount || 0,
|
|
@@ -391,12 +440,12 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
391
440
|
deletions: stats?.removed || 0
|
|
392
441
|
};
|
|
393
442
|
if (hasValidDiff(diffs)) {
|
|
394
|
-
|
|
443
|
+
changes = diffs;
|
|
395
444
|
}
|
|
396
445
|
}
|
|
397
446
|
return {
|
|
398
447
|
...item,
|
|
399
|
-
changes
|
|
448
|
+
changes,
|
|
400
449
|
resource: uri,
|
|
401
450
|
iconPath: item.iconPath,
|
|
402
451
|
tooltip: item.tooltip ? this._reviveTooltip(item.tooltip) : undefined,
|
|
@@ -418,7 +467,8 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
418
467
|
}
|
|
419
468
|
$onDidChangeChatSessionOptions(handle, sessionResourceComponents, updates) {
|
|
420
469
|
const sessionResource = URI.revive(sessionResourceComponents);
|
|
421
|
-
|
|
470
|
+
warnOnUntitledSessionResource(sessionResource, this._logService);
|
|
471
|
+
this._chatSessionsService.updateSessionOptions(sessionResource, ChatSessionOptionsMap.fromRecord(updates));
|
|
422
472
|
}
|
|
423
473
|
async $onDidCommitChatSessionItem(handle, originalComponents, modifiedCompoennts) {
|
|
424
474
|
const originalResource = URI.revive(originalComponents);
|
|
@@ -436,11 +486,15 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
436
486
|
const contribution = this._chatSessionsService.getAllChatSessionContributions().find(c => c.type === chatSessionType);
|
|
437
487
|
try {
|
|
438
488
|
this._chatTodoListService.migrateTodos(originalResource, modifiedResource);
|
|
489
|
+
this._chatArtifactsService.migrateArtifacts(originalResource, modifiedResource);
|
|
490
|
+
if (chatSessionType === "copilotcli") {
|
|
491
|
+
this._chatDebugService.invokeProviders(modifiedResource).catch(() => {});
|
|
492
|
+
}
|
|
439
493
|
const originalGroup = this.editorGroupService.groups.find(group => ( group.editors.some(editor => isEqual(editor.resource, originalResource)))) ?? this.editorGroupService.activeGroup;
|
|
440
494
|
const options = {
|
|
441
495
|
title: {
|
|
442
496
|
preferred: originalEditor?.getName() || undefined,
|
|
443
|
-
fallback: ( localize(
|
|
497
|
+
fallback: ( localize(2555, "{0}", contribution?.displayName))
|
|
444
498
|
}
|
|
445
499
|
};
|
|
446
500
|
const newSession = await this._chatSessionsService.getOrCreateChatSession(URI.revive(modifiedResource), CancellationToken.None);
|
|
@@ -456,6 +510,7 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
456
510
|
options
|
|
457
511
|
}
|
|
458
512
|
}], originalGroup);
|
|
513
|
+
this._resendPendingRequests(originalResource, modifiedResource);
|
|
459
514
|
return;
|
|
460
515
|
}
|
|
461
516
|
if (originalModel) {
|
|
@@ -473,19 +528,26 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
473
528
|
const ref = await this._chatService.acquireOrLoadSession(modifiedResource, ChatAgentLocation.Chat, CancellationToken.None);
|
|
474
529
|
ref?.dispose();
|
|
475
530
|
}
|
|
531
|
+
this._resendPendingRequests(originalResource, modifiedResource);
|
|
476
532
|
} finally {
|
|
477
533
|
originalModel?.dispose();
|
|
478
534
|
}
|
|
479
535
|
}
|
|
536
|
+
_resendPendingRequests(originalResource, modifiedResource) {
|
|
537
|
+
this._chatService.migrateRequests(originalResource, modifiedResource);
|
|
538
|
+
}
|
|
480
539
|
async handleSessionModelOverrides(model, session) {
|
|
540
|
+
const outgoingSession = {
|
|
541
|
+
...session
|
|
542
|
+
};
|
|
481
543
|
const inProgress = model.getRequests().filter(r => r.response && !r.response.isComplete);
|
|
482
544
|
if (inProgress.length) {
|
|
483
|
-
|
|
545
|
+
outgoingSession.description = this._chatSessionsService.getInProgressSessionDescription(model);
|
|
484
546
|
}
|
|
485
|
-
if (!(
|
|
547
|
+
if (!(outgoingSession.changes instanceof Array)) {
|
|
486
548
|
const modelStats = await awaitStatsForSession(model);
|
|
487
549
|
if (modelStats) {
|
|
488
|
-
|
|
550
|
+
outgoingSession.changes = {
|
|
489
551
|
files: modelStats.fileCount,
|
|
490
552
|
insertions: modelStats.added,
|
|
491
553
|
deletions: modelStats.removed
|
|
@@ -493,11 +555,12 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
493
555
|
}
|
|
494
556
|
}
|
|
495
557
|
if (model.lastRequest?.response?.state === ResponseModelState.NeedsInput) {
|
|
496
|
-
|
|
558
|
+
outgoingSession.status = ChatSessionStatus.NeedsInput;
|
|
497
559
|
}
|
|
498
|
-
return
|
|
560
|
+
return outgoingSession;
|
|
499
561
|
}
|
|
500
562
|
async _provideChatSessionContent(providerHandle, sessionResource, token) {
|
|
563
|
+
warnOnUntitledSessionResource(sessionResource, this._logService);
|
|
501
564
|
let session = this._activeSessions.get(sessionResource);
|
|
502
565
|
if (!session) {
|
|
503
566
|
session = ( new ObservableChatSession(
|
|
@@ -516,11 +579,17 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
516
579
|
this._sessionDisposables.set(sessionResource, disposable);
|
|
517
580
|
}
|
|
518
581
|
try {
|
|
519
|
-
|
|
582
|
+
const initialSessionOptions = this._chatSessionsService.getSessionOptions(sessionResource);
|
|
583
|
+
await session.initialize(token, {
|
|
584
|
+
initialSessionOptions: initialSessionOptions ? ( [...initialSessionOptions].map(([optionId, value]) => ({
|
|
585
|
+
optionId,
|
|
586
|
+
value: typeof value === "string" ? value : value?.id
|
|
587
|
+
}))) : undefined
|
|
588
|
+
});
|
|
520
589
|
if (session.options) {
|
|
521
590
|
for (const [_, handle] of this._sessionTypeToHandle) {
|
|
522
591
|
if (handle === providerHandle) {
|
|
523
|
-
for (const [optionId, value] of
|
|
592
|
+
for (const [optionId, value] of session.options) {
|
|
524
593
|
this._chatSessionsService.setSessionOption(sessionResource, optionId, value);
|
|
525
594
|
}
|
|
526
595
|
break;
|
|
@@ -583,6 +652,7 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
583
652
|
}
|
|
584
653
|
$handleProgressComplete(handle, sessionResource, requestId) {
|
|
585
654
|
const resource = URI.revive(sessionResource);
|
|
655
|
+
warnOnUntitledSessionResource(resource, this._logService);
|
|
586
656
|
const observableSession = this._activeSessions.get(resource);
|
|
587
657
|
if (!observableSession) {
|
|
588
658
|
this._logService.warn(
|
|
@@ -621,7 +691,10 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
621
691
|
this._chatSessionsService.setOptionGroupsForSessionType(chatSessionScheme, handle, groupsWithCallbacks);
|
|
622
692
|
}
|
|
623
693
|
if (options?.newSessionOptions) {
|
|
624
|
-
this._chatSessionsService.setNewSessionOptionsForSessionType(
|
|
694
|
+
this._chatSessionsService.setNewSessionOptionsForSessionType(
|
|
695
|
+
chatSessionScheme,
|
|
696
|
+
ChatSessionOptionsMap.fromRecord(options.newSessionOptions)
|
|
697
|
+
);
|
|
625
698
|
}
|
|
626
699
|
}).catch(err => this._logService.error("Error fetching chat session options", err));
|
|
627
700
|
}
|
|
@@ -653,7 +726,12 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
653
726
|
`[MainThreadChatSessions] notifyOptionsChange: starting proxy call for handle ${handle}, sessionResource ${sessionResource}`
|
|
654
727
|
);
|
|
655
728
|
try {
|
|
656
|
-
await this._proxy.$provideHandleOptionsChange(
|
|
729
|
+
await this._proxy.$provideHandleOptionsChange(
|
|
730
|
+
handle,
|
|
731
|
+
sessionResource,
|
|
732
|
+
Object.fromEntries(updates),
|
|
733
|
+
CancellationToken.None
|
|
734
|
+
);
|
|
657
735
|
this._logService.trace(
|
|
658
736
|
`[MainThreadChatSessions] notifyOptionsChange: proxy call completed for handle ${handle}, sessionResource ${sessionResource}`
|
|
659
737
|
);
|
|
@@ -665,6 +743,13 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
665
743
|
}
|
|
666
744
|
}
|
|
667
745
|
};
|
|
668
|
-
MainThreadChatSessions = __decorate([extHostNamedCustomer(MainContext.MainThreadChatSessions), ( __param(1, IAgentSessionsService)), ( __param(2, IChatSessionsService)), ( __param(3, IChatService)), ( __param(4, IChatWidgetService)), ( __param(5, IChatTodoListService)), ( __param(6,
|
|
746
|
+
MainThreadChatSessions = __decorate([extHostNamedCustomer(MainContext.MainThreadChatSessions), ( __param(1, IAgentSessionsService)), ( __param(2, IChatSessionsService)), ( __param(3, IChatService)), ( __param(4, IChatWidgetService)), ( __param(5, IChatTodoListService)), ( __param(6, IChatArtifactsService)), ( __param(7, IChatDebugService)), ( __param(8, IDialogService)), ( __param(9, IEditorService)), ( __param(10, IEditorGroupsService)), ( __param(11, ILogService)), ( __param(12, IInstantiationService))], MainThreadChatSessions);
|
|
747
|
+
function warnOnUntitledSessionResource(resource, logService) {
|
|
748
|
+
if (isUntitledChatSession(resource)) {
|
|
749
|
+
logService.warn(
|
|
750
|
+
`[MainThreadChatSessions] untitled-style sessionResource detected ${( resource.toString())}`
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
669
754
|
|
|
670
755
|
export { MainThreadChatSessions, ObservableChatSession };
|
|
@@ -456,7 +456,7 @@ class MainThreadCommentController extends Disposable {
|
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
const commentsViewIcon = registerIcon("comments-view-icon", Codicon.commentDiscussion, ( localize(
|
|
459
|
+
const commentsViewIcon = registerIcon("comments-view-icon", Codicon.commentDiscussion, ( localize(2556, "View icon of the comments view.")));
|
|
460
460
|
let MainThreadComments = class MainThreadComments extends Disposable {
|
|
461
461
|
constructor(
|
|
462
462
|
extHostContext,
|
|
@@ -405,7 +405,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
|
|
|
405
405
|
this._register(workingCopyService.registerWorkingCopy(this));
|
|
406
406
|
this._register(extensionService.onWillStop(e => {
|
|
407
407
|
e.veto(true, ( localize(
|
|
408
|
-
|
|
408
|
+
2557,
|
|
409
409
|
"An extension provided editor for '{0}' is still open that would close otherwise.",
|
|
410
410
|
this.name
|
|
411
411
|
)));
|
|
@@ -473,7 +473,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
|
|
|
473
473
|
this._undoService.pushElement({
|
|
474
474
|
type: UndoRedoElementType.Resource,
|
|
475
475
|
resource: this._editorResource,
|
|
476
|
-
label: label ?? ( localize(
|
|
476
|
+
label: label ?? ( localize(2558, "Edit")),
|
|
477
477
|
code: "undoredo.customEditorEdit",
|
|
478
478
|
undo: () => this.undo(),
|
|
479
479
|
redo: () => this.redo()
|
|
@@ -12,7 +12,7 @@ let MainThreadDownloadService = class MainThreadDownloadService extends Disposab
|
|
|
12
12
|
this.downloadService = downloadService;
|
|
13
13
|
}
|
|
14
14
|
$download(uri, to) {
|
|
15
|
-
return this.downloadService.download(URI.revive(uri), URI.revive(to));
|
|
15
|
+
return this.downloadService.download(URI.revive(uri), URI.revive(to), "mainThreadDownloadService.download");
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
MainThreadDownloadService = __decorate([
|
|
@@ -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(
|
|
17
|
+
setTimeout(() => reject(( new Error(( localize(2559, "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);
|
|
@@ -111,7 +111,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
111
111
|
this._notificationService.notify({
|
|
112
112
|
severity: Severity.Error,
|
|
113
113
|
message: ( localize(
|
|
114
|
-
|
|
114
|
+
2560,
|
|
115
115
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",
|
|
116
116
|
extName,
|
|
117
117
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -119,7 +119,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
119
119
|
actions: {
|
|
120
120
|
primary: [toAction({
|
|
121
121
|
id: "reload",
|
|
122
|
-
label: ( localize(
|
|
122
|
+
label: ( localize(2561, "Reload Window")),
|
|
123
123
|
run: () => this._hostService.reload()
|
|
124
124
|
})]
|
|
125
125
|
}
|
|
@@ -130,7 +130,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
130
130
|
this._notificationService.notify({
|
|
131
131
|
severity: Severity.Error,
|
|
132
132
|
message: ( localize(
|
|
133
|
-
|
|
133
|
+
2562,
|
|
134
134
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",
|
|
135
135
|
extName,
|
|
136
136
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -140,7 +140,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
140
140
|
this._notificationService.notify({
|
|
141
141
|
severity: Severity.Error,
|
|
142
142
|
message: ( localize(
|
|
143
|
-
|
|
143
|
+
2563,
|
|
144
144
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",
|
|
145
145
|
extName,
|
|
146
146
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -148,7 +148,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
148
148
|
actions: {
|
|
149
149
|
primary: [toAction({
|
|
150
150
|
id: "manageWorkspaceTrust",
|
|
151
|
-
label: ( localize(
|
|
151
|
+
label: ( localize(2564, "Manage Workspace Trust")),
|
|
152
152
|
run: () => this._commandService.executeCommand("workbench.trust.manage")
|
|
153
153
|
})]
|
|
154
154
|
}
|
|
@@ -157,7 +157,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
157
157
|
this._notificationService.notify({
|
|
158
158
|
severity: Severity.Error,
|
|
159
159
|
message: ( localize(
|
|
160
|
-
|
|
160
|
+
2565,
|
|
161
161
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",
|
|
162
162
|
extName,
|
|
163
163
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -165,7 +165,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
165
165
|
actions: {
|
|
166
166
|
primary: [toAction({
|
|
167
167
|
id: "enable",
|
|
168
|
-
label: ( localize(
|
|
168
|
+
label: ( localize(2566, "Enable and Reload")),
|
|
169
169
|
enabled: true,
|
|
170
170
|
run: () => this._extensionEnablementService.setEnablement(
|
|
171
171
|
[missingInstalledDependency],
|
|
@@ -178,7 +178,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
178
178
|
this._notificationService.notify({
|
|
179
179
|
severity: Severity.Error,
|
|
180
180
|
message: ( localize(
|
|
181
|
-
|
|
181
|
+
2567,
|
|
182
182
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",
|
|
183
183
|
extName,
|
|
184
184
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -199,7 +199,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
199
199
|
this._notificationService.notify({
|
|
200
200
|
severity: Severity.Error,
|
|
201
201
|
message: ( localize(
|
|
202
|
-
|
|
202
|
+
2568,
|
|
203
203
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",
|
|
204
204
|
extName,
|
|
205
205
|
dependencyExtension.displayName,
|
|
@@ -208,14 +208,14 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
208
208
|
actions: {
|
|
209
209
|
primary: [toAction({
|
|
210
210
|
id: "install",
|
|
211
|
-
label: ( localize(
|
|
211
|
+
label: ( localize(2569, "Install and Reload")),
|
|
212
212
|
run: () => this._extensionsWorkbenchService.install(dependencyExtension).then(() => this._hostService.reload(), e => this._notificationService.error(e))
|
|
213
213
|
})]
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
} else {
|
|
217
217
|
this._notificationService.error(( localize(
|
|
218
|
-
|
|
218
|
+
2570,
|
|
219
219
|
"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",
|
|
220
220
|
extName,
|
|
221
221
|
missingDependency
|