@codingame/monaco-vscode-chat-service-override 10.1.4 → 11.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/chat.js +6 -3
- package/package.json +6 -2
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +84 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +265 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +20 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +373 -216
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +14 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +82 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +326 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +448 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +507 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +76 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorActions.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorController.js +284 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.js +116 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +100 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +61 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/{common → browser}/languageModelToolsService.js +28 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeContributions.js +75 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +120 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +10 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +33 -18
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +68 -47
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +250 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +7 -8
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +65 -128
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +0 -170
- package/vscode/src/vs/workbench/contrib/chat/browser/chatGettingStarted.js +0 -131
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
2
1
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
3
2
|
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
4
3
|
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
@@ -12,17 +11,15 @@ import { TerminalLocation } from 'vscode/vscode/vs/platform/terminal/common/term
|
|
|
12
11
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
13
12
|
import { accessibleViewInCodeBlock } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
14
13
|
import { ITerminalService, ITerminalEditorService, ITerminalGroupService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
15
|
-
import { ICodeMapperService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatCodeMapperService.service';
|
|
16
14
|
import { CONTEXT_CHAT_ENABLED, CONTEXT_IN_CHAT_SESSION, CONTEXT_IN_CHAT_INPUT, CONTEXT_CHAT_EDIT_APPLIED } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
17
15
|
import { IChatEditingService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
|
|
18
16
|
import { ChatCopyKind } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
19
17
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
20
|
-
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
18
|
+
import { isResponseVM } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-quickaccess-search-terminal-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
21
19
|
import { IChatWidgetService, IChatCodeBlockContextProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
22
|
-
import { DefaultChatTextEditor } from 'vscode/vscode/vs/workbench/contrib/chat/browser/codeBlockPart';
|
|
23
|
-
import 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
20
|
+
import { DefaultChatTextEditor } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-quickaccess-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/codeBlockPart';
|
|
21
|
+
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-quickaccess-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
24
22
|
import { ApplyCodeBlockOperation, InsertCodeBlockOperation } from './codeBlockOperations.js';
|
|
25
|
-
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
|
|
26
23
|
|
|
27
24
|
const shellLangIds = [
|
|
28
25
|
'fish',
|
|
@@ -64,7 +61,7 @@ function registerChatCodeBlockActions() {
|
|
|
64
61
|
constructor() {
|
|
65
62
|
super({
|
|
66
63
|
id: 'workbench.action.chat.copyCodeBlock',
|
|
67
|
-
title: ( localize2(
|
|
64
|
+
title: ( localize2(7522, "Copy")),
|
|
68
65
|
f1: false,
|
|
69
66
|
category: CHAT_CATEGORY,
|
|
70
67
|
icon: Codicon.copy,
|
|
@@ -149,7 +146,7 @@ function registerChatCodeBlockActions() {
|
|
|
149
146
|
constructor() {
|
|
150
147
|
super({
|
|
151
148
|
id: 'workbench.action.chat.applyInEditor',
|
|
152
|
-
title: ( localize2(
|
|
149
|
+
title: ( localize2(7523, "Apply in Editor")),
|
|
153
150
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
154
151
|
f1: true,
|
|
155
152
|
category: CHAT_CATEGORY,
|
|
@@ -184,7 +181,7 @@ function registerChatCodeBlockActions() {
|
|
|
184
181
|
constructor() {
|
|
185
182
|
super({
|
|
186
183
|
id: 'workbench.action.chat.applyAll',
|
|
187
|
-
title: ( localize2(
|
|
184
|
+
title: ( localize2(7524, "Apply All Edits")),
|
|
188
185
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
189
186
|
f1: true,
|
|
190
187
|
category: CHAT_CATEGORY,
|
|
@@ -193,41 +190,25 @@ function registerChatCodeBlockActions() {
|
|
|
193
190
|
}
|
|
194
191
|
async run(accessor, ...args) {
|
|
195
192
|
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
196
|
-
const codemapperService = accessor.get(ICodeMapperService);
|
|
197
193
|
const chatEditingService = accessor.get(IChatEditingService);
|
|
198
194
|
const widget = chatWidgetService.lastFocusedWidget;
|
|
199
|
-
if (!widget) {
|
|
195
|
+
if (!widget || !widget.viewModel) {
|
|
200
196
|
return;
|
|
201
197
|
}
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const request = [];
|
|
209
|
-
for (const codeblock of codeblocks) {
|
|
210
|
-
if (codeblock.codemapperUri && codeblock.uri) {
|
|
211
|
-
const code = codeblock.getContent();
|
|
212
|
-
request.push({ resource: codeblock.codemapperUri, code });
|
|
213
|
-
}
|
|
198
|
+
const applyEditsId = args[0];
|
|
199
|
+
const chatModel = widget.viewModel.model;
|
|
200
|
+
const request = chatModel.getRequests().find(request => request.response?.result?.metadata?.applyEditsId === applyEditsId);
|
|
201
|
+
if (request && request.response) {
|
|
202
|
+
await chatEditingService.startOrContinueEditingSession(widget.viewModel.sessionId, { silent: true });
|
|
203
|
+
await chatEditingService.triggerEditComputation(request.response);
|
|
214
204
|
}
|
|
215
|
-
await chatEditingService.startOrContinueEditingSession(item.sessionId, async (stream) => {
|
|
216
|
-
const response = {
|
|
217
|
-
textEdit: (resource, textEdits) => {
|
|
218
|
-
stream.textEdits(resource, textEdits);
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
const tokenSource = ( (new CancellationTokenSource()));
|
|
222
|
-
await codemapperService.mapCode({ codeBlocks: request, conversation: [] }, response, tokenSource.token);
|
|
223
|
-
}, { silent: true });
|
|
224
205
|
}
|
|
225
206
|
});
|
|
226
207
|
registerAction2(class SmartApplyInEditorAction extends ChatCodeBlockAction {
|
|
227
208
|
constructor() {
|
|
228
209
|
super({
|
|
229
210
|
id: 'workbench.action.chat.insertCodeBlock',
|
|
230
|
-
title: ( localize2(
|
|
211
|
+
title: ( localize2(7525, "Insert At Cursor")),
|
|
231
212
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
232
213
|
f1: true,
|
|
233
214
|
category: CHAT_CATEGORY,
|
|
@@ -258,7 +239,7 @@ function registerChatCodeBlockActions() {
|
|
|
258
239
|
constructor() {
|
|
259
240
|
super({
|
|
260
241
|
id: 'workbench.action.chat.insertIntoNewFile',
|
|
261
|
-
title: ( localize2(
|
|
242
|
+
title: ( localize2(7526, "Insert into New File")),
|
|
262
243
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
263
244
|
f1: true,
|
|
264
245
|
category: CHAT_CATEGORY,
|
|
@@ -299,7 +280,7 @@ function registerChatCodeBlockActions() {
|
|
|
299
280
|
constructor() {
|
|
300
281
|
super({
|
|
301
282
|
id: 'workbench.action.chat.runInTerminal',
|
|
302
|
-
title: ( localize2(
|
|
283
|
+
title: ( localize2(7527, "Insert into Terminal")),
|
|
303
284
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
304
285
|
f1: true,
|
|
305
286
|
category: CHAT_CATEGORY,
|
|
@@ -399,7 +380,7 @@ function registerChatCodeBlockActions() {
|
|
|
399
380
|
constructor() {
|
|
400
381
|
super({
|
|
401
382
|
id: 'workbench.action.chat.nextCodeBlock',
|
|
402
|
-
title: ( localize2(
|
|
383
|
+
title: ( localize2(7528, "Next Code Block")),
|
|
403
384
|
keybinding: {
|
|
404
385
|
primary: 2048 | 512 | 12 ,
|
|
405
386
|
mac: { primary: 2048 | 512 | 12 , },
|
|
@@ -419,7 +400,7 @@ function registerChatCodeBlockActions() {
|
|
|
419
400
|
constructor() {
|
|
420
401
|
super({
|
|
421
402
|
id: 'workbench.action.chat.previousCodeBlock',
|
|
422
|
-
title: ( localize2(
|
|
403
|
+
title: ( localize2(7529, "Previous Code Block")),
|
|
423
404
|
keybinding: {
|
|
424
405
|
primary: 2048 | 512 | 11 ,
|
|
425
406
|
mac: { primary: 2048 | 512 | 11 , },
|
|
@@ -476,7 +457,7 @@ function registerChatCodeCompareBlockActions() {
|
|
|
476
457
|
constructor() {
|
|
477
458
|
super({
|
|
478
459
|
id: 'workbench.action.chat.applyCompareEdits',
|
|
479
|
-
title: ( localize2(
|
|
460
|
+
title: ( localize2(7530, "Apply Edits")),
|
|
480
461
|
f1: false,
|
|
481
462
|
category: CHAT_CATEGORY,
|
|
482
463
|
icon: Codicon.check,
|
|
@@ -506,7 +487,7 @@ function registerChatCodeCompareBlockActions() {
|
|
|
506
487
|
constructor() {
|
|
507
488
|
super({
|
|
508
489
|
id: 'workbench.action.chat.discardCompareEdits',
|
|
509
|
-
title: ( localize2(
|
|
490
|
+
title: ( localize2(7531, "Discard Edits")),
|
|
510
491
|
f1: false,
|
|
511
492
|
category: CHAT_CATEGORY,
|
|
512
493
|
icon: Codicon.trash,
|