@codingame/monaco-vscode-chat-service-override 2.2.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +45 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +11 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +11 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +20 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +29 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +25 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatHistoryVariables.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +71 -112
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +101 -73
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +94 -24
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +37 -24
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChatServiceImpl.js +4 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions2.js +0 -94
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-chat-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@3.1.0",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
2
|
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
4
|
-
import {
|
|
4
|
+
import { IAccessibilitySignalService, AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
5
5
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
6
|
import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
7
7
|
import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
@@ -109,7 +109,7 @@ function getNewChatAction(viewId, providerId) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
function announceChatCleared(accessor) {
|
|
112
|
-
accessor.get(
|
|
112
|
+
accessor.get(IAccessibilitySignalService).playSignal(AccessibilitySignal.clear);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export { ACTION_ID_NEW_CHAT, getNewChatAction, registerNewChatActions };
|
|
@@ -8,7 +8,7 @@ import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextK
|
|
|
8
8
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
9
9
|
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
10
10
|
import { CopyAction } from 'vscode/vscode/vs/editor/contrib/clipboard/browser/clipboard';
|
|
11
|
-
import {
|
|
11
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
12
12
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
13
13
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
14
14
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
@@ -16,7 +16,7 @@ import { TerminalLocation } from 'vscode/vscode/vs/platform/terminal/common/term
|
|
|
16
16
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
17
17
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
18
18
|
import { CONTEXT_PROVIDER_EXISTS, CONTEXT_IN_CHAT_SESSION, CONTEXT_IN_CHAT_INPUT } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
19
|
-
import { IChatService,
|
|
19
|
+
import { IChatService, ChatCopyKind } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
20
20
|
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
21
21
|
import { CTX_INLINE_CHAT_VISIBLE } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
22
22
|
import { insertCell } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/cellOperations';
|
|
@@ -56,14 +56,11 @@ function registerChatCodeBlockActions() {
|
|
|
56
56
|
constructor() {
|
|
57
57
|
super({
|
|
58
58
|
id: 'workbench.action.chat.copyCodeBlock',
|
|
59
|
-
title:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)),
|
|
65
|
-
original: 'Copy'
|
|
66
|
-
},
|
|
59
|
+
title: ( localize2WithPath(
|
|
60
|
+
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
61
|
+
'interactive.copyCodeBlock.label',
|
|
62
|
+
"Copy"
|
|
63
|
+
)),
|
|
67
64
|
f1: false,
|
|
68
65
|
category: CHAT_CATEGORY,
|
|
69
66
|
icon: Codicon.copy,
|
|
@@ -87,10 +84,11 @@ function registerChatCodeBlockActions() {
|
|
|
87
84
|
agentId: context.element.agent?.id,
|
|
88
85
|
sessionId: context.element.sessionId,
|
|
89
86
|
requestId: context.element.requestId,
|
|
87
|
+
result: context.element.result,
|
|
90
88
|
action: {
|
|
91
89
|
kind: 'copy',
|
|
92
90
|
codeBlockIndex: context.codeBlockIndex,
|
|
93
|
-
copyKind:
|
|
91
|
+
copyKind: ChatCopyKind.Toolbar,
|
|
94
92
|
copiedCharacters: context.code.length,
|
|
95
93
|
totalCharacters: context.code.length,
|
|
96
94
|
copiedText: context.code,
|
|
@@ -123,10 +121,11 @@ function registerChatCodeBlockActions() {
|
|
|
123
121
|
agentId: context.element.agent?.id,
|
|
124
122
|
sessionId: context.element.sessionId,
|
|
125
123
|
requestId: context.element.requestId,
|
|
124
|
+
result: context.element.result,
|
|
126
125
|
action: {
|
|
127
126
|
kind: 'copy',
|
|
128
127
|
codeBlockIndex: context.codeBlockIndex,
|
|
129
|
-
copyKind:
|
|
128
|
+
copyKind: ChatCopyKind.Action,
|
|
130
129
|
copiedText,
|
|
131
130
|
copiedCharacters: copiedText.length,
|
|
132
131
|
totalCharacters,
|
|
@@ -142,14 +141,11 @@ function registerChatCodeBlockActions() {
|
|
|
142
141
|
constructor() {
|
|
143
142
|
super({
|
|
144
143
|
id: 'workbench.action.chat.insertCodeBlock',
|
|
145
|
-
title:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
)),
|
|
151
|
-
original: 'Insert at Cursor'
|
|
152
|
-
},
|
|
144
|
+
title: ( localize2WithPath(
|
|
145
|
+
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
146
|
+
'interactive.insertCodeBlock.label',
|
|
147
|
+
"Insert at Cursor"
|
|
148
|
+
)),
|
|
153
149
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
154
150
|
f1: true,
|
|
155
151
|
category: CHAT_CATEGORY,
|
|
@@ -266,6 +262,7 @@ function registerChatCodeBlockActions() {
|
|
|
266
262
|
agentId: context.element.agent?.id,
|
|
267
263
|
sessionId: context.element.sessionId,
|
|
268
264
|
requestId: context.element.requestId,
|
|
265
|
+
result: context.element.result,
|
|
269
266
|
action: {
|
|
270
267
|
kind: 'insert',
|
|
271
268
|
codeBlockIndex: context.codeBlockIndex,
|
|
@@ -279,14 +276,11 @@ function registerChatCodeBlockActions() {
|
|
|
279
276
|
constructor() {
|
|
280
277
|
super({
|
|
281
278
|
id: 'workbench.action.chat.insertIntoNewFile',
|
|
282
|
-
title:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
)),
|
|
288
|
-
original: 'Insert into New File'
|
|
289
|
-
},
|
|
279
|
+
title: ( localize2WithPath(
|
|
280
|
+
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
281
|
+
'interactive.insertIntoNewFile.label',
|
|
282
|
+
"Insert into New File"
|
|
283
|
+
)),
|
|
290
284
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
291
285
|
f1: true,
|
|
292
286
|
category: CHAT_CATEGORY,
|
|
@@ -311,6 +305,7 @@ function registerChatCodeBlockActions() {
|
|
|
311
305
|
agentId: context.element.agent?.id,
|
|
312
306
|
sessionId: context.element.sessionId,
|
|
313
307
|
requestId: context.element.requestId,
|
|
308
|
+
result: context.element.result,
|
|
314
309
|
action: {
|
|
315
310
|
kind: 'insert',
|
|
316
311
|
codeBlockIndex: context.codeBlockIndex,
|
|
@@ -322,21 +317,23 @@ function registerChatCodeBlockActions() {
|
|
|
322
317
|
}
|
|
323
318
|
});
|
|
324
319
|
const shellLangIds = [
|
|
320
|
+
'fish',
|
|
321
|
+
'ps1',
|
|
322
|
+
'pwsh',
|
|
325
323
|
'powershell',
|
|
326
|
-
'
|
|
324
|
+
'sh',
|
|
325
|
+
'shellscript',
|
|
326
|
+
'zsh'
|
|
327
327
|
];
|
|
328
328
|
registerAction2(class RunInTerminalAction extends ChatCodeBlockAction {
|
|
329
329
|
constructor() {
|
|
330
330
|
super({
|
|
331
331
|
id: 'workbench.action.chat.runInTerminal',
|
|
332
|
-
title:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
)),
|
|
338
|
-
original: 'Insert into Terminal'
|
|
339
|
-
},
|
|
332
|
+
title: ( localize2WithPath(
|
|
333
|
+
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
334
|
+
'interactive.runInTerminal.label',
|
|
335
|
+
"Insert into Terminal"
|
|
336
|
+
)),
|
|
340
337
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
341
338
|
f1: true,
|
|
342
339
|
category: CHAT_CATEGORY,
|
|
@@ -395,6 +392,7 @@ function registerChatCodeBlockActions() {
|
|
|
395
392
|
agentId: context.element.agent?.id,
|
|
396
393
|
sessionId: context.element.sessionId,
|
|
397
394
|
requestId: context.element.requestId,
|
|
395
|
+
result: context.element.result,
|
|
398
396
|
action: {
|
|
399
397
|
kind: 'runInTerminal',
|
|
400
398
|
codeBlockIndex: context.codeBlockIndex,
|
|
@@ -433,14 +431,11 @@ function registerChatCodeBlockActions() {
|
|
|
433
431
|
constructor() {
|
|
434
432
|
super({
|
|
435
433
|
id: 'workbench.action.chat.nextCodeBlock',
|
|
436
|
-
title:
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
)),
|
|
442
|
-
original: 'Next Code Block'
|
|
443
|
-
},
|
|
434
|
+
title: ( localize2WithPath(
|
|
435
|
+
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
436
|
+
'interactive.nextCodeBlock.label',
|
|
437
|
+
"Next Code Block"
|
|
438
|
+
)),
|
|
444
439
|
keybinding: {
|
|
445
440
|
primary: 2048 | 512 | 12 ,
|
|
446
441
|
mac: { primary: 2048 | 512 | 12 , },
|
|
@@ -460,14 +455,11 @@ function registerChatCodeBlockActions() {
|
|
|
460
455
|
constructor() {
|
|
461
456
|
super({
|
|
462
457
|
id: 'workbench.action.chat.previousCodeBlock',
|
|
463
|
-
title:
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
)),
|
|
469
|
-
original: 'Previous Code Block'
|
|
470
|
-
},
|
|
458
|
+
title: ( localize2WithPath(
|
|
459
|
+
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
460
|
+
'interactive.previousCodeBlock.label',
|
|
461
|
+
"Previous Code Block"
|
|
462
|
+
)),
|
|
471
463
|
keybinding: {
|
|
472
464
|
primary: 2048 | 512 | 11 ,
|
|
473
465
|
mac: { primary: 2048 | 512 | 11 , },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
3
3
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
4
4
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
@@ -11,14 +11,11 @@ function registerChatCopyActions() {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super({
|
|
13
13
|
id: 'workbench.action.chat.copyAll',
|
|
14
|
-
title:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)),
|
|
20
|
-
original: 'Copy All'
|
|
21
|
-
},
|
|
14
|
+
title: ( localize2WithPath(
|
|
15
|
+
'vs/workbench/contrib/chat/browser/actions/chatCopyActions',
|
|
16
|
+
'interactive.copyAll.label',
|
|
17
|
+
"Copy All"
|
|
18
|
+
)),
|
|
22
19
|
f1: false,
|
|
23
20
|
category: CHAT_CATEGORY,
|
|
24
21
|
menu: {
|
|
@@ -48,14 +45,11 @@ function registerChatCopyActions() {
|
|
|
48
45
|
constructor() {
|
|
49
46
|
super({
|
|
50
47
|
id: 'workbench.action.chat.copyItem',
|
|
51
|
-
title:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
)),
|
|
57
|
-
original: 'Copy'
|
|
58
|
-
},
|
|
48
|
+
title: ( localize2WithPath(
|
|
49
|
+
'vs/workbench/contrib/chat/browser/actions/chatCopyActions',
|
|
50
|
+
'interactive.copyItem.label',
|
|
51
|
+
"Copy"
|
|
52
|
+
)),
|
|
59
53
|
f1: false,
|
|
60
54
|
category: CHAT_CATEGORY,
|
|
61
55
|
menu: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
3
3
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
4
4
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
@@ -10,14 +10,11 @@ function registerChatFileTreeActions() {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super({
|
|
12
12
|
id: 'workbench.action.chat.nextFileTree',
|
|
13
|
-
title:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)),
|
|
19
|
-
original: 'Next File Tree'
|
|
20
|
-
},
|
|
13
|
+
title: ( localize2WithPath(
|
|
14
|
+
'vs/workbench/contrib/chat/browser/actions/chatFileTreeActions',
|
|
15
|
+
'interactive.nextFileTree.label',
|
|
16
|
+
"Next File Tree"
|
|
17
|
+
)),
|
|
21
18
|
keybinding: {
|
|
22
19
|
primary: 2048 | 67 ,
|
|
23
20
|
weight: 200 ,
|
|
@@ -36,14 +33,11 @@ function registerChatFileTreeActions() {
|
|
|
36
33
|
constructor() {
|
|
37
34
|
super({
|
|
38
35
|
id: 'workbench.action.chat.previousFileTree',
|
|
39
|
-
title:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)),
|
|
45
|
-
original: 'Previous File Tree'
|
|
46
|
-
},
|
|
36
|
+
title: ( localize2WithPath(
|
|
37
|
+
'vs/workbench/contrib/chat/browser/actions/chatFileTreeActions',
|
|
38
|
+
'interactive.previousFileTree.label',
|
|
39
|
+
"Previous File Tree"
|
|
40
|
+
)),
|
|
47
41
|
keybinding: {
|
|
48
42
|
primary: 2048 | 1024 | 67 ,
|
|
49
43
|
weight: 200 ,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
1
|
+
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
3
3
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
4
4
|
import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
@@ -60,8 +60,9 @@ function getMoveToAction(viewId, providerId, moveTo) {
|
|
|
60
60
|
}
|
|
61
61
|
const editorService = accessor.get(IEditorService);
|
|
62
62
|
const sessionId = viewModel.sessionId;
|
|
63
|
+
const viewState = view.widget.getViewState();
|
|
63
64
|
view.clear();
|
|
64
|
-
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId }, pinned: true } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
|
65
|
+
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId }, pinned: true, viewState: viewState } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
}
|
|
@@ -70,14 +71,11 @@ function registerMoveActions() {
|
|
|
70
71
|
constructor() {
|
|
71
72
|
super({
|
|
72
73
|
id: `workbench.action.chat.openInEditor`,
|
|
73
|
-
title:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)),
|
|
79
|
-
original: 'Open Chat in Editor'
|
|
80
|
-
},
|
|
74
|
+
title: ( localize2WithPath(
|
|
75
|
+
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
76
|
+
'interactiveSession.openInEditor.label',
|
|
77
|
+
"Open Chat in Editor"
|
|
78
|
+
)),
|
|
81
79
|
category: CHAT_CATEGORY,
|
|
82
80
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
83
81
|
f1: true
|
|
@@ -91,14 +89,11 @@ function registerMoveActions() {
|
|
|
91
89
|
constructor() {
|
|
92
90
|
super({
|
|
93
91
|
id: `workbench.action.chat.openInNewWindow`,
|
|
94
|
-
title:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)),
|
|
100
|
-
original: 'Open Chat In New Window'
|
|
101
|
-
},
|
|
92
|
+
title: ( localize2WithPath(
|
|
93
|
+
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
94
|
+
'interactiveSession.openInNewWindow.label',
|
|
95
|
+
"Open Chat in New Window"
|
|
96
|
+
)),
|
|
102
97
|
category: CHAT_CATEGORY,
|
|
103
98
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
104
99
|
f1: true
|
|
@@ -112,14 +107,11 @@ function registerMoveActions() {
|
|
|
112
107
|
constructor() {
|
|
113
108
|
super({
|
|
114
109
|
id: `workbench.action.chat.openInSidebar`,
|
|
115
|
-
title:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
)),
|
|
121
|
-
original: 'Open Chat in Side Bar'
|
|
122
|
-
},
|
|
110
|
+
title: ( localize2WithPath(
|
|
111
|
+
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
112
|
+
'interactiveSession.openInSidebar.label',
|
|
113
|
+
"Open Chat in Side Bar"
|
|
114
|
+
)),
|
|
123
115
|
category: CHAT_CATEGORY,
|
|
124
116
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
125
117
|
f1: true,
|
|
@@ -152,8 +144,9 @@ async function executeMoveToAction(accessor, moveTo) {
|
|
|
152
144
|
}
|
|
153
145
|
const sessionId = viewModel.sessionId;
|
|
154
146
|
const view = await viewService.openView(widget.viewContext.viewId);
|
|
147
|
+
const viewState = view.widget.getViewState();
|
|
155
148
|
view.clear();
|
|
156
|
-
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId }, pinned: true } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
|
149
|
+
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId }, pinned: true, viewState: viewState } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
|
157
150
|
}
|
|
158
151
|
async function moveToSidebar(accessor) {
|
|
159
152
|
const viewsService = accessor.get(IViewsService);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
2
|
import marked from 'vscode-marked';
|
|
3
3
|
import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
4
|
-
import {
|
|
4
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
6
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
7
7
|
import { ResourceNotebookCellEdit } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
|
@@ -19,14 +19,11 @@ function registerChatTitleActions() {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
super({
|
|
21
21
|
id: 'workbench.action.chat.markHelpful',
|
|
22
|
-
title:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)),
|
|
28
|
-
original: 'Helpful'
|
|
29
|
-
},
|
|
22
|
+
title: ( localize2WithPath(
|
|
23
|
+
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
24
|
+
'interactive.helpful.label',
|
|
25
|
+
"Helpful"
|
|
26
|
+
)),
|
|
30
27
|
f1: false,
|
|
31
28
|
category: CHAT_CATEGORY,
|
|
32
29
|
icon: Codicon.thumbsup,
|
|
@@ -50,6 +47,7 @@ function registerChatTitleActions() {
|
|
|
50
47
|
agentId: item.agent?.id,
|
|
51
48
|
sessionId: item.sessionId,
|
|
52
49
|
requestId: item.requestId,
|
|
50
|
+
result: item.result,
|
|
53
51
|
action: {
|
|
54
52
|
kind: 'vote',
|
|
55
53
|
direction: InteractiveSessionVoteDirection.Up,
|
|
@@ -62,14 +60,11 @@ function registerChatTitleActions() {
|
|
|
62
60
|
constructor() {
|
|
63
61
|
super({
|
|
64
62
|
id: 'workbench.action.chat.markUnhelpful',
|
|
65
|
-
title:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)),
|
|
71
|
-
original: 'Unhelpful'
|
|
72
|
-
},
|
|
63
|
+
title: ( localize2WithPath(
|
|
64
|
+
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
65
|
+
'interactive.unhelpful.label',
|
|
66
|
+
"Unhelpful"
|
|
67
|
+
)),
|
|
73
68
|
f1: false,
|
|
74
69
|
category: CHAT_CATEGORY,
|
|
75
70
|
icon: Codicon.thumbsdown,
|
|
@@ -93,6 +88,7 @@ function registerChatTitleActions() {
|
|
|
93
88
|
agentId: item.agent?.id,
|
|
94
89
|
sessionId: item.sessionId,
|
|
95
90
|
requestId: item.requestId,
|
|
91
|
+
result: item.result,
|
|
96
92
|
action: {
|
|
97
93
|
kind: 'vote',
|
|
98
94
|
direction: InteractiveSessionVoteDirection.Down,
|
|
@@ -105,14 +101,11 @@ function registerChatTitleActions() {
|
|
|
105
101
|
constructor() {
|
|
106
102
|
super({
|
|
107
103
|
id: 'workbench.action.chat.reportIssueForBug',
|
|
108
|
-
title:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
)),
|
|
114
|
-
original: 'Report Issue'
|
|
115
|
-
},
|
|
104
|
+
title: ( localize2WithPath(
|
|
105
|
+
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
106
|
+
'interactive.reportIssueForBug.label',
|
|
107
|
+
"Report Issue"
|
|
108
|
+
)),
|
|
116
109
|
f1: false,
|
|
117
110
|
category: CHAT_CATEGORY,
|
|
118
111
|
icon: Codicon.report,
|
|
@@ -135,6 +128,7 @@ function registerChatTitleActions() {
|
|
|
135
128
|
agentId: item.agent?.id,
|
|
136
129
|
sessionId: item.sessionId,
|
|
137
130
|
requestId: item.requestId,
|
|
131
|
+
result: item.result,
|
|
138
132
|
action: {
|
|
139
133
|
kind: 'bug'
|
|
140
134
|
}
|
|
@@ -145,14 +139,11 @@ function registerChatTitleActions() {
|
|
|
145
139
|
constructor() {
|
|
146
140
|
super({
|
|
147
141
|
id: 'workbench.action.chat.insertIntoNotebook',
|
|
148
|
-
title:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
)),
|
|
154
|
-
original: 'Insert into Notebook'
|
|
155
|
-
},
|
|
142
|
+
title: ( localize2WithPath(
|
|
143
|
+
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
144
|
+
'interactive.insertIntoNotebook.label',
|
|
145
|
+
"Insert into Notebook"
|
|
146
|
+
)),
|
|
156
147
|
f1: false,
|
|
157
148
|
category: CHAT_CATEGORY,
|
|
158
149
|
icon: Codicon.insert,
|
|
@@ -210,14 +201,11 @@ function registerChatTitleActions() {
|
|
|
210
201
|
constructor() {
|
|
211
202
|
super({
|
|
212
203
|
id: 'workbench.action.chat.remove',
|
|
213
|
-
title:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
)),
|
|
219
|
-
original: 'Remove Request and Response'
|
|
220
|
-
},
|
|
204
|
+
title: ( localize2WithPath(
|
|
205
|
+
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
206
|
+
'chat.remove.label',
|
|
207
|
+
"Remove Request and Response"
|
|
208
|
+
)),
|
|
221
209
|
f1: false,
|
|
222
210
|
category: CHAT_CATEGORY,
|
|
223
211
|
icon: Codicon.x,
|
|
@@ -8,7 +8,7 @@ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/d
|
|
|
8
8
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
9
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
10
10
|
import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
|
|
11
|
-
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
11
|
+
import { Extensions as Extensions$1, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
12
12
|
import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
|
|
13
13
|
import { registerChatActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
14
14
|
import { registerChatCodeBlockActions } from './actions/chatCodeblockActions.js';
|
|
@@ -35,9 +35,10 @@ import { IChatSlashCommandService } from 'vscode/vscode/vs/workbench/contrib/cha
|
|
|
35
35
|
import { alertFocusChange } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityContributions';
|
|
36
36
|
import { AccessibleViewAction } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewActions';
|
|
37
37
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
38
|
+
import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables';
|
|
38
39
|
import { registerChatFileTreeActions } from './actions/chatFileTreeActions.js';
|
|
39
40
|
import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
40
|
-
import { chatAgentLeader, chatSubcommandLeader } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
41
|
+
import { chatAgentLeader, chatSubcommandLeader, chatVariableLeader } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
41
42
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
42
43
|
|
|
43
44
|
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
@@ -102,6 +103,7 @@ configurationRegistry.registerConfiguration({
|
|
|
102
103
|
( new SyncDescriptor(ChatEditorInput))
|
|
103
104
|
]);
|
|
104
105
|
let ChatResolverContribution = class ChatResolverContribution extends Disposable {
|
|
106
|
+
static { this.ID = 'workbench.contrib.chatResolver'; }
|
|
105
107
|
constructor(editorResolverService, instantiationService) {
|
|
106
108
|
super();
|
|
107
109
|
this._register(editorResolverService.registerEditor(`${Schemas.vscodeChatSesssion}:**/**`, {
|
|
@@ -202,16 +204,16 @@ class ChatAccessibleViewContribution extends Disposable {
|
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommandsContribution extends Disposable {
|
|
205
|
-
constructor(slashCommandService, commandService, chatAgentService) {
|
|
207
|
+
constructor(slashCommandService, commandService, chatAgentService, chatVariablesService) {
|
|
206
208
|
super();
|
|
207
209
|
this._store.add(slashCommandService.registerSlashCommand({
|
|
208
|
-
command: '
|
|
210
|
+
command: 'clear',
|
|
209
211
|
detail: ( localizeWithPath(
|
|
210
212
|
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
211
|
-
'
|
|
213
|
+
'clear',
|
|
212
214
|
"Start a new chat"
|
|
213
215
|
)),
|
|
214
|
-
sortText: '
|
|
216
|
+
sortText: 'z2_clear',
|
|
215
217
|
executeImmediately: true
|
|
216
218
|
}, async () => {
|
|
217
219
|
commandService.executeCommand(ACTION_ID_NEW_CHAT);
|
|
@@ -240,7 +242,7 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
240
242
|
const actionArg = { inputValue: `${agentWithLeader} ${a.metadata.sampleRequest}` };
|
|
241
243
|
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
242
244
|
const agentLine = `* [\`${agentWithLeader}\`](command:${SubmitAction.ID}?${urlSafeArg}) - ${a.metadata.description}`;
|
|
243
|
-
const commands = await a.provideSlashCommands(CancellationToken.None);
|
|
245
|
+
const commands = await a.provideSlashCommands(undefined, [], CancellationToken.None);
|
|
244
246
|
const commandText = ( commands.map(c => {
|
|
245
247
|
const actionArg = { inputValue: `${agentWithLeader} ${chatSubcommandLeader}${c.name} ${c.sampleRequest ?? ''}` };
|
|
246
248
|
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
@@ -249,6 +251,19 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
249
251
|
return (agentLine + '\n' + commandText).trim();
|
|
250
252
|
})))).join('\n');
|
|
251
253
|
progress.report({ content: ( new MarkdownString(agentText, { isTrusted: { enabledCommands: [SubmitAction.ID] } })), kind: 'markdownContent' });
|
|
254
|
+
if (defaultAgent?.metadata.helpTextVariablesPrefix) {
|
|
255
|
+
progress.report({ content: '\n\n', kind: 'content' });
|
|
256
|
+
if (isMarkdownString(defaultAgent.metadata.helpTextVariablesPrefix)) {
|
|
257
|
+
progress.report({ content: defaultAgent.metadata.helpTextVariablesPrefix, kind: 'markdownContent' });
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
progress.report({ content: defaultAgent.metadata.helpTextVariablesPrefix, kind: 'content' });
|
|
261
|
+
}
|
|
262
|
+
const variableText = ( Array.from(chatVariablesService.getVariables())
|
|
263
|
+
.map(v => `* \`${chatVariableLeader}${v.name}\` - ${v.description}`))
|
|
264
|
+
.join('\n');
|
|
265
|
+
progress.report({ content: '\n' + variableText, kind: 'content' });
|
|
266
|
+
}
|
|
252
267
|
if (defaultAgent?.metadata.helpTextPostfix) {
|
|
253
268
|
progress.report({ content: '\n\n', kind: 'content' });
|
|
254
269
|
if (isMarkdownString(defaultAgent.metadata.helpTextPostfix)) {
|
|
@@ -264,10 +279,11 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
264
279
|
ChatSlashStaticSlashCommandsContribution = ( __decorate([
|
|
265
280
|
( __param(0, IChatSlashCommandService)),
|
|
266
281
|
( __param(1, ICommandService)),
|
|
267
|
-
( __param(2, IChatAgentService))
|
|
282
|
+
( __param(2, IChatAgentService)),
|
|
283
|
+
( __param(3, IChatVariablesService))
|
|
268
284
|
], ChatSlashStaticSlashCommandsContribution));
|
|
269
285
|
const workbenchContributionsRegistry = ( Registry.as(Extensions$1.Workbench));
|
|
270
|
-
|
|
286
|
+
registerWorkbenchContribution2(ChatResolverContribution.ID, ChatResolverContribution, 1 );
|
|
271
287
|
workbenchContributionsRegistry.registerWorkbenchContribution(ChatAccessibleViewContribution, 4 );
|
|
272
288
|
workbenchContributionsRegistry.registerWorkbenchContribution(ChatSlashStaticSlashCommandsContribution, 4 );
|
|
273
289
|
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(ChatEditorInput.TypeID, ChatEditorInputSerializer);
|