@codingame/monaco-vscode-chat-service-override 2.0.3 → 2.1.0-update-vscode-1.86.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chat.js +6 -2
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +14 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +11 -16
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +24 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +7 -8
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +106 -115
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +17 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +236 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +210 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditor.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDecorations.js +0 -250
package/chat.js
CHANGED
|
@@ -14,8 +14,11 @@ import { ChatVariablesService } from './vscode/src/vs/workbench/contrib/chat/bro
|
|
|
14
14
|
import { QuickChatService } from './vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js';
|
|
15
15
|
import { IChatAgentService, ChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
16
16
|
import { InlineChatServiceImpl } from './vscode/src/vs/workbench/contrib/inlineChat/common/inlineChatServiceImpl.js';
|
|
17
|
-
import { IInlineChatSessionService, InlineChatSessionService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSession';
|
|
18
17
|
import { IInlineChatService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
18
|
+
import { IInlineChatSessionService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService';
|
|
19
|
+
import { InlineChatSessionServiceImpl } from './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js';
|
|
20
|
+
import { IInlineChatSavingService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSavingService';
|
|
21
|
+
import { InlineChatSavingServiceImpl } from './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js';
|
|
19
22
|
import './vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js';
|
|
20
23
|
import './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js';
|
|
21
24
|
|
|
@@ -32,7 +35,8 @@ function getServiceOverride() {
|
|
|
32
35
|
[( IChatAgentService.toString())]: new SyncDescriptor(ChatAgentService, [], true),
|
|
33
36
|
[( IChatVariablesService.toString())]: new SyncDescriptor(ChatVariablesService, [], true),
|
|
34
37
|
[( IInlineChatService.toString())]: new SyncDescriptor(InlineChatServiceImpl, [], true),
|
|
35
|
-
[( IInlineChatSessionService.toString())]: new SyncDescriptor(
|
|
38
|
+
[( IInlineChatSessionService.toString())]: new SyncDescriptor(InlineChatSessionServiceImpl, [], true),
|
|
39
|
+
[( IInlineChatSavingService.toString())]: new SyncDescriptor(InlineChatSavingServiceImpl, [], true)
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-chat-service-override",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.1.0-update-vscode-1.86.1",
|
|
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@2.0.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.1.0-update-vscode-1.86.1",
|
|
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
|
-
import { IAccessibleNotificationService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
4
3
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
4
|
+
import { IAudioCueService, AudioCue } from 'vscode/vscode/vs/platform/audioCues/browser/audioCueService';
|
|
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';
|
|
@@ -11,16 +11,16 @@ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/brow
|
|
|
11
11
|
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
12
12
|
import { CONTEXT_PROVIDER_EXISTS, CONTEXT_IN_CHAT_SESSION } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
function
|
|
16
|
-
registerAction2(class
|
|
14
|
+
const ACTION_ID_NEW_CHAT = `workbench.action.chat.newChat`;
|
|
15
|
+
function registerNewChatActions() {
|
|
16
|
+
registerAction2(class NewChatEditorAction extends Action2 {
|
|
17
17
|
constructor() {
|
|
18
18
|
super({
|
|
19
|
-
id: 'workbench.action.chatEditor.
|
|
19
|
+
id: 'workbench.action.chatEditor.newChat',
|
|
20
20
|
title: ( localize2WithPath(
|
|
21
21
|
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
22
|
-
'chat.
|
|
23
|
-
"New
|
|
22
|
+
'chat.newChat.label',
|
|
23
|
+
"New Chat"
|
|
24
24
|
)),
|
|
25
25
|
icon: Codicon.plus,
|
|
26
26
|
f1: false,
|
|
@@ -41,14 +41,14 @@ function registerClearActions() {
|
|
|
41
41
|
registerAction2(class GlobalClearChatAction extends Action2 {
|
|
42
42
|
constructor() {
|
|
43
43
|
super({
|
|
44
|
-
id:
|
|
44
|
+
id: ACTION_ID_NEW_CHAT,
|
|
45
45
|
title: ( localize2WithPath(
|
|
46
46
|
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
47
|
-
'chat.
|
|
48
|
-
"New
|
|
47
|
+
'chat.newChat.label',
|
|
48
|
+
"New Chat"
|
|
49
49
|
)),
|
|
50
50
|
category: CHAT_CATEGORY,
|
|
51
|
-
icon: Codicon.
|
|
51
|
+
icon: Codicon.plus,
|
|
52
52
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
53
53
|
f1: true,
|
|
54
54
|
keybinding: {
|
|
@@ -77,13 +77,13 @@ function registerClearActions() {
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const getNewChatActionDescriptorForViewTitle = (viewId, providerId) => ({
|
|
81
81
|
viewId,
|
|
82
|
-
id: `workbench.action.chat.${providerId}.
|
|
82
|
+
id: `workbench.action.chat.${providerId}.newChat`,
|
|
83
83
|
title: ( localize2WithPath(
|
|
84
84
|
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
85
|
-
'chat.
|
|
86
|
-
"New
|
|
85
|
+
'chat.newChat.label',
|
|
86
|
+
"New Chat"
|
|
87
87
|
)),
|
|
88
88
|
menu: {
|
|
89
89
|
id: MenuId.ViewTitle,
|
|
@@ -96,10 +96,10 @@ const getClearChatActionDescriptorForViewTitle = (viewId, providerId) => ({
|
|
|
96
96
|
icon: Codicon.plus,
|
|
97
97
|
f1: false
|
|
98
98
|
});
|
|
99
|
-
function
|
|
100
|
-
return class
|
|
99
|
+
function getNewChatAction(viewId, providerId) {
|
|
100
|
+
return class NewChatAction extends ViewAction {
|
|
101
101
|
constructor() {
|
|
102
|
-
super(
|
|
102
|
+
super(getNewChatActionDescriptorForViewTitle(viewId, providerId));
|
|
103
103
|
}
|
|
104
104
|
async runInView(accessor, view) {
|
|
105
105
|
announceChatCleared(accessor);
|
|
@@ -109,7 +109,7 @@ function getClearAction(viewId, providerId) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
function announceChatCleared(accessor) {
|
|
112
|
-
accessor.get(
|
|
112
|
+
accessor.get(IAudioCueService).playAudioCue(AudioCue.clear);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
export {
|
|
115
|
+
export { ACTION_ID_NEW_CHAT, getNewChatAction, registerNewChatActions };
|
|
@@ -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, ChatAgentCopyKind } 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';
|
|
@@ -90,7 +90,7 @@ function registerChatCodeBlockActions() {
|
|
|
90
90
|
action: {
|
|
91
91
|
kind: 'copy',
|
|
92
92
|
codeBlockIndex: context.codeBlockIndex,
|
|
93
|
-
|
|
93
|
+
copyKind: ChatAgentCopyKind.Toolbar,
|
|
94
94
|
copiedCharacters: context.code.length,
|
|
95
95
|
totalCharacters: context.code.length,
|
|
96
96
|
copiedText: context.code,
|
|
@@ -126,7 +126,7 @@ function registerChatCodeBlockActions() {
|
|
|
126
126
|
action: {
|
|
127
127
|
kind: 'copy',
|
|
128
128
|
codeBlockIndex: context.codeBlockIndex,
|
|
129
|
-
|
|
129
|
+
copyKind: ChatAgentCopyKind.Action,
|
|
130
130
|
copiedText,
|
|
131
131
|
copiedCharacters: copiedText.length,
|
|
132
132
|
totalCharacters,
|
|
@@ -388,7 +388,7 @@ function registerChatCodeBlockActions() {
|
|
|
388
388
|
else {
|
|
389
389
|
terminalGroupService.showPanel(true);
|
|
390
390
|
}
|
|
391
|
-
terminal.
|
|
391
|
+
terminal.runCommand(context.code, false);
|
|
392
392
|
if (isResponseVM(context.element)) {
|
|
393
393
|
chatService.notifyUserAction({
|
|
394
394
|
providerId: context.element.providerId,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { 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
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
4
|
import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
6
5
|
import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
7
|
-
import { IViewsService } from 'vscode/vscode/vs/workbench/common/
|
|
6
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
8
7
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
9
8
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
10
9
|
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
@@ -12,7 +11,7 @@ import { CONTEXT_PROVIDER_EXISTS } from 'vscode/vscode/vs/workbench/contrib/chat
|
|
|
12
11
|
import { IChatContributionService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContributionService';
|
|
13
12
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
14
13
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
15
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
14
|
+
import { IEditorService, AUX_WINDOW_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
16
15
|
|
|
17
16
|
var MoveToNewLocation;
|
|
18
17
|
( (function(MoveToNewLocation) {
|
|
@@ -25,13 +24,13 @@ const getMoveToChatActionDescriptorForViewTitle = (viewId, providerId, moveTo) =
|
|
|
25
24
|
value: moveTo === MoveToNewLocation.Editor ? ( localizeWithPath(
|
|
26
25
|
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
27
26
|
'chat.openInEditor.label',
|
|
28
|
-
"Open
|
|
27
|
+
"Open Chat in Editor"
|
|
29
28
|
)) : ( localizeWithPath(
|
|
30
29
|
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
31
30
|
'chat.openInNewWindow.label',
|
|
32
|
-
"Open
|
|
31
|
+
"Open Chat in New Window"
|
|
33
32
|
)),
|
|
34
|
-
original: moveTo === MoveToNewLocation.Editor ? 'Open
|
|
33
|
+
original: moveTo === MoveToNewLocation.Editor ? 'Open Chat in Editor' : 'Open Chat in New Window',
|
|
35
34
|
},
|
|
36
35
|
category: CHAT_CATEGORY,
|
|
37
36
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
@@ -59,24 +58,10 @@ function getMoveToAction(viewId, providerId, moveTo) {
|
|
|
59
58
|
if (!viewModel) {
|
|
60
59
|
return;
|
|
61
60
|
}
|
|
62
|
-
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
63
|
-
const instantiationService = accessor.get(IInstantiationService);
|
|
64
61
|
const editorService = accessor.get(IEditorService);
|
|
65
62
|
const sessionId = viewModel.sessionId;
|
|
66
63
|
view.clear();
|
|
67
|
-
|
|
68
|
-
case (MoveToNewLocation.Editor): {
|
|
69
|
-
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId: viewModel.sessionId }, pinned: true } });
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
case (MoveToNewLocation.Window): {
|
|
73
|
-
await openInNewWindow(instantiationService, editorGroupService, { target: { sessionId } });
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
default: {
|
|
77
|
-
throw new Error(`Unexpected move to location : ${moveTo}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
64
|
+
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId }, pinned: true } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
|
80
65
|
}
|
|
81
66
|
};
|
|
82
67
|
}
|
|
@@ -89,9 +74,9 @@ function registerMoveActions() {
|
|
|
89
74
|
value: ( localizeWithPath(
|
|
90
75
|
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
91
76
|
'interactiveSession.openInEditor.label',
|
|
92
|
-
"Open
|
|
77
|
+
"Open Chat in Editor"
|
|
93
78
|
)),
|
|
94
|
-
original: 'Open
|
|
79
|
+
original: 'Open Chat in Editor'
|
|
95
80
|
},
|
|
96
81
|
category: CHAT_CATEGORY,
|
|
97
82
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
@@ -110,9 +95,9 @@ function registerMoveActions() {
|
|
|
110
95
|
value: ( localizeWithPath(
|
|
111
96
|
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
112
97
|
'interactiveSession.openInNewWindow.label',
|
|
113
|
-
"Open
|
|
98
|
+
"Open Chat in New Window"
|
|
114
99
|
)),
|
|
115
|
-
original: 'Open
|
|
100
|
+
original: 'Open Chat In New Window'
|
|
116
101
|
},
|
|
117
102
|
category: CHAT_CATEGORY,
|
|
118
103
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
@@ -131,9 +116,9 @@ function registerMoveActions() {
|
|
|
131
116
|
value: ( localizeWithPath(
|
|
132
117
|
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
133
118
|
'interactiveSession.openInSidebar.label',
|
|
134
|
-
"Open
|
|
119
|
+
"Open Chat in Side Bar"
|
|
135
120
|
)),
|
|
136
|
-
original: 'Open
|
|
121
|
+
original: 'Open Chat in Side Bar'
|
|
137
122
|
},
|
|
138
123
|
category: CHAT_CATEGORY,
|
|
139
124
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
@@ -155,24 +140,10 @@ async function executeMoveToAction(accessor, moveTo) {
|
|
|
155
140
|
const viewService = accessor.get(IViewsService);
|
|
156
141
|
const chatService = accessor.get(IChatService);
|
|
157
142
|
const editorService = accessor.get(IEditorService);
|
|
158
|
-
const instantiationService = accessor.get(IInstantiationService);
|
|
159
|
-
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
160
143
|
const widget = widgetService.lastFocusedWidget;
|
|
161
144
|
if (!widget || !('viewId' in widget.viewContext)) {
|
|
162
145
|
const providerId = chatService.getProviderInfos()[0].id;
|
|
163
|
-
|
|
164
|
-
case (MoveToNewLocation.Editor): {
|
|
165
|
-
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { providerId }, pinned: true } });
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
case (MoveToNewLocation.Window): {
|
|
169
|
-
await openInNewWindow(instantiationService, editorGroupService, { target: { providerId } });
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
default: {
|
|
173
|
-
throw new Error(`Unexpected move to location : ${moveTo}`);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
146
|
+
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { providerId }, pinned: true } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
|
176
147
|
return;
|
|
177
148
|
}
|
|
178
149
|
const viewModel = widget.viewModel;
|
|
@@ -182,23 +153,7 @@ async function executeMoveToAction(accessor, moveTo) {
|
|
|
182
153
|
const sessionId = viewModel.sessionId;
|
|
183
154
|
const view = await viewService.openView(widget.viewContext.viewId);
|
|
184
155
|
view.clear();
|
|
185
|
-
|
|
186
|
-
case (MoveToNewLocation.Editor): {
|
|
187
|
-
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId: sessionId }, pinned: true } });
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
case (MoveToNewLocation.Window): {
|
|
191
|
-
await openInNewWindow(instantiationService, editorGroupService, { target: { sessionId } });
|
|
192
|
-
}
|
|
193
|
-
default: {
|
|
194
|
-
throw new Error(`Unexpected move to location : ${moveTo}`);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async function openInNewWindow(intstantiationService, editorGroupService, options) {
|
|
199
|
-
const auxiliaryEditorPart = await editorGroupService.createAuxiliaryEditorPart();
|
|
200
|
-
const chatEditorInput = intstantiationService.createInstance(ChatEditorInput, ChatEditorInput.getNewEditorUri(), options);
|
|
201
|
-
await auxiliaryEditorPart.activeGroup.openEditor(chatEditorInput, { pinned: true });
|
|
156
|
+
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId }, pinned: true } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
|
202
157
|
}
|
|
203
158
|
async function moveToSidebar(accessor) {
|
|
204
159
|
const viewsService = accessor.get(IViewsService);
|
|
@@ -24,7 +24,7 @@ import './contrib/chatInputEditorContrib.js';
|
|
|
24
24
|
import './contrib/chatHistoryVariables.js';
|
|
25
25
|
import { RegisteredEditorPriority, IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
26
26
|
import { registerMoveActions } from './actions/chatMoveActions.js';
|
|
27
|
-
import {
|
|
27
|
+
import { registerNewChatActions, ACTION_ID_NEW_CHAT } from './actions/chatClearActions.js';
|
|
28
28
|
import { IAccessibleViewService } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleView';
|
|
29
29
|
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
30
30
|
import { CONTEXT_IN_CHAT_SESSION } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
@@ -205,16 +205,16 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
205
205
|
constructor(slashCommandService, commandService, chatAgentService) {
|
|
206
206
|
super();
|
|
207
207
|
this._store.add(slashCommandService.registerSlashCommand({
|
|
208
|
-
command: '
|
|
208
|
+
command: 'newChat',
|
|
209
209
|
detail: ( localizeWithPath(
|
|
210
210
|
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
211
|
-
'
|
|
212
|
-
"
|
|
211
|
+
'newChat',
|
|
212
|
+
"Start a new chat"
|
|
213
213
|
)),
|
|
214
|
-
sortText: '
|
|
214
|
+
sortText: 'z2_newChat',
|
|
215
215
|
executeImmediately: true
|
|
216
216
|
}, async () => {
|
|
217
|
-
commandService.executeCommand(
|
|
217
|
+
commandService.executeCommand(ACTION_ID_NEW_CHAT);
|
|
218
218
|
}));
|
|
219
219
|
this._store.add(slashCommandService.registerSlashCommand({
|
|
220
220
|
command: 'help',
|
|
@@ -246,7 +246,7 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
246
246
|
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
247
247
|
return `\t* [\`${chatSubcommandLeader}${c.name}\`](command:${SubmitAction.ID}?${urlSafeArg}) - ${c.description}`;
|
|
248
248
|
})).join('\n');
|
|
249
|
-
return agentLine + '\n' + commandText;
|
|
249
|
+
return (agentLine + '\n' + commandText).trim();
|
|
250
250
|
})))).join('\n');
|
|
251
251
|
progress.report({ content: ( new MarkdownString(agentText, { isTrusted: { enabledCommands: [SubmitAction.ID] } })), kind: 'markdownContent' });
|
|
252
252
|
if (defaultAgent?.metadata.helpTextPostfix) {
|
|
@@ -280,4 +280,4 @@ registerChatExecuteActions();
|
|
|
280
280
|
registerQuickChatActions();
|
|
281
281
|
registerChatExportActions();
|
|
282
282
|
registerMoveActions();
|
|
283
|
-
|
|
283
|
+
registerNewChatActions();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { status } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
|
|
3
3
|
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
4
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { AudioCue, IAudioCueService } from 'vscode/vscode/vs/platform/audioCues/browser/audioCueService';
|
|
6
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
7
|
|
|
@@ -10,18 +10,17 @@ let ChatAccessibilityService = class ChatAccessibilityService extends Disposable
|
|
|
10
10
|
super();
|
|
11
11
|
this._audioCueService = _audioCueService;
|
|
12
12
|
this._instantiationService = _instantiationService;
|
|
13
|
-
this._pendingCueMap = ( new
|
|
13
|
+
this._pendingCueMap = this._register(( new DisposableMap()));
|
|
14
14
|
this._requestId = 0;
|
|
15
15
|
}
|
|
16
16
|
acceptRequest() {
|
|
17
17
|
this._requestId++;
|
|
18
18
|
this._audioCueService.playAudioCue(AudioCue.chatRequestSent, { allowManyInParallel: true });
|
|
19
|
-
this._pendingCueMap.set(this._requestId, this.
|
|
19
|
+
this._pendingCueMap.set(this._requestId, this._instantiationService.createInstance(AudioCueScheduler));
|
|
20
20
|
return this._requestId;
|
|
21
21
|
}
|
|
22
22
|
acceptResponse(response, requestId) {
|
|
23
|
-
this._pendingCueMap.
|
|
24
|
-
this._pendingCueMap.delete(requestId);
|
|
23
|
+
this._pendingCueMap.deleteAndDispose(requestId);
|
|
25
24
|
const isPanelChat = typeof response !== 'string';
|
|
26
25
|
const responseContent = typeof response === 'string' ? response : response?.response.asString();
|
|
27
26
|
this._audioCueService.playAudioCue(AudioCue.chatResponseReceived, { allowManyInParallel: true });
|
|
@@ -10,7 +10,7 @@ import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/view
|
|
|
10
10
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
11
11
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/views';
|
|
12
12
|
import { getHistoryAction, getOpenChatEditorAction } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
13
|
-
import {
|
|
13
|
+
import { getNewChatAction } from './actions/chatClearActions.js';
|
|
14
14
|
import { getMoveToEditorAction, getMoveToNewWindowAction } from './actions/chatMoveActions.js';
|
|
15
15
|
import { getQuickChatActionForProvider } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions';
|
|
16
16
|
import { ChatViewPane, CHAT_SIDEBAR_PANEL_ID } from './chatViewPane.js';
|
|
@@ -139,7 +139,7 @@ let ChatExtensionPointHandler = class ChatExtensionPointHandler {
|
|
|
139
139
|
( Registry.as(Extensions$1.ViewsRegistry)).registerViews(viewDescriptor, this._viewContainer);
|
|
140
140
|
const disposables = ( new DisposableStore());
|
|
141
141
|
disposables.add(registerAction2(getHistoryAction(viewId, providerDescriptor.id)));
|
|
142
|
-
disposables.add(registerAction2(
|
|
142
|
+
disposables.add(registerAction2(getNewChatAction(viewId, providerDescriptor.id)));
|
|
143
143
|
disposables.add(registerAction2(getMoveToEditorAction(viewId, providerDescriptor.id)));
|
|
144
144
|
disposables.add(registerAction2(getMoveToNewWindowAction(viewId, providerDescriptor.id)));
|
|
145
145
|
disposables.add(registerAction2(getOpenChatEditorAction(providerDescriptor.id, providerDescriptor.label, providerDescriptor.when)));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import './media/chatEditor.css.js';
|
|
3
2
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
4
3
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
4
|
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
@@ -232,7 +232,7 @@ let QuickChat = class QuickChat extends Disposable {
|
|
|
232
232
|
}
|
|
233
233
|
for (const request of this.model.getRequests()) {
|
|
234
234
|
if (request.response?.response.value || request.response?.errorDetails) {
|
|
235
|
-
this.chatService.addCompleteRequest(widget.viewModel.sessionId, request.message, {
|
|
235
|
+
this.chatService.addCompleteRequest(widget.viewModel.sessionId, request.message, request.variableData, {
|
|
236
236
|
message: request.response.response.value,
|
|
237
237
|
errorDetails: request.response.errorDetails,
|
|
238
238
|
followups: request.response.followups
|
|
@@ -45,7 +45,7 @@ let ChatVariablesService = class ChatVariablesService {
|
|
|
45
45
|
await Promise.allSettled(jobs);
|
|
46
46
|
return {
|
|
47
47
|
variables: resolvedVariables,
|
|
48
|
-
|
|
48
|
+
message: parsedPrompt.join('').trim()
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
getUniqueReferenceName(name, vars) {
|
|
@@ -8,7 +8,6 @@ import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/service
|
|
|
8
8
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
9
9
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
10
10
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
-
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
|
|
12
11
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
13
12
|
import { inputPlaceholderForeground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
14
13
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
@@ -36,13 +35,14 @@ function agentAndCommandToKey(agent, subcommand) {
|
|
|
36
35
|
return `${agent}__${subcommand}`;
|
|
37
36
|
}
|
|
38
37
|
let InputEditorDecorations = class InputEditorDecorations extends Disposable {
|
|
39
|
-
constructor(widget, instantiationService, codeEditorService, themeService, chatService) {
|
|
38
|
+
constructor(widget, instantiationService, codeEditorService, themeService, chatService, chatAgentService) {
|
|
40
39
|
super();
|
|
41
40
|
this.widget = widget;
|
|
42
41
|
this.instantiationService = instantiationService;
|
|
43
42
|
this.codeEditorService = codeEditorService;
|
|
44
43
|
this.themeService = themeService;
|
|
45
44
|
this.chatService = chatService;
|
|
45
|
+
this.chatAgentService = chatAgentService;
|
|
46
46
|
this.id = 'inputEditorDecorations';
|
|
47
47
|
this.previouslyUsedAgents = ( new Set());
|
|
48
48
|
this.viewModelDisposables = this._register(( new MutableDisposable()));
|
|
@@ -61,6 +61,7 @@ let InputEditorDecorations = class InputEditorDecorations extends Disposable {
|
|
|
61
61
|
this.previouslyUsedAgents.add(agentAndCommandToKey(e.agent.id, e.slashCommand.name));
|
|
62
62
|
}
|
|
63
63
|
}));
|
|
64
|
+
this._register(this.chatAgentService.onDidChangeAgents(() => this.updateInputEditorDecorations()));
|
|
64
65
|
this.registerViewModelListeners();
|
|
65
66
|
}
|
|
66
67
|
registerViewModelListeners() {
|
|
@@ -221,7 +222,8 @@ InputEditorDecorations = ( __decorate([
|
|
|
221
222
|
( __param(1, IInstantiationService)),
|
|
222
223
|
( __param(2, ICodeEditorService)),
|
|
223
224
|
( __param(3, IThemeService)),
|
|
224
|
-
( __param(4, IChatService))
|
|
225
|
+
( __param(4, IChatService)),
|
|
226
|
+
( __param(5, IChatAgentService))
|
|
225
227
|
], InputEditorDecorations));
|
|
226
228
|
let InputEditorSlashCommandMode = class InputEditorSlashCommandMode extends Disposable {
|
|
227
229
|
constructor(widget, chatService) {
|
|
@@ -421,6 +423,7 @@ let AgentCompletions = class AgentCompletions extends Disposable {
|
|
|
421
423
|
return {
|
|
422
424
|
label: { label: withSlash, description: agentLabel },
|
|
423
425
|
filterText: `${chatSubcommandLeader}${agent.id}${c.name}`,
|
|
426
|
+
commitCharacters: [' '],
|
|
424
427
|
insertText: `${agentLabel} ${withSlash} `,
|
|
425
428
|
detail: `(${agentLabel}) ${c.description}`,
|
|
426
429
|
range: ( new Range(1, 1, 1, 1)),
|
|
@@ -443,20 +446,14 @@ AgentCompletions = ( __decorate([
|
|
|
443
446
|
let BuiltinDynamicCompletions = class BuiltinDynamicCompletions extends Disposable {
|
|
444
447
|
static { BuiltinDynamicCompletions_1 = this; }
|
|
445
448
|
static { this.VariableNameDef = ( new RegExp(`${chatVariableLeader}\\w*`, 'g')); }
|
|
446
|
-
constructor(languageFeaturesService, chatWidgetService
|
|
449
|
+
constructor(languageFeaturesService, chatWidgetService) {
|
|
447
450
|
super();
|
|
448
451
|
this.languageFeaturesService = languageFeaturesService;
|
|
449
452
|
this.chatWidgetService = chatWidgetService;
|
|
450
|
-
this.configurationService = configurationService;
|
|
451
|
-
this.productService = productService;
|
|
452
453
|
this._register(this.languageFeaturesService.completionProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, hasAccessToAllModels: true }, {
|
|
453
454
|
_debugDisplayName: 'chatDynamicCompletions',
|
|
454
455
|
triggerCharacters: [chatVariableLeader],
|
|
455
456
|
provideCompletionItems: async (model, position, _context, _token) => {
|
|
456
|
-
const fileVariablesEnabled = this.configurationService.getValue('chat.experimental.fileVariables') ?? this.productService.quality !== 'stable';
|
|
457
|
-
if (!fileVariablesEnabled) {
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
457
|
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
|
|
461
458
|
if (!widget || !widget.supportsFileReferences) {
|
|
462
459
|
return null;
|
|
@@ -469,7 +466,7 @@ let BuiltinDynamicCompletions = class BuiltinDynamicCompletions extends Disposab
|
|
|
469
466
|
position.lineNumber,
|
|
470
467
|
range.replace.startColumn,
|
|
471
468
|
position.lineNumber,
|
|
472
|
-
range.replace.
|
|
469
|
+
range.replace.startColumn + '#file:'.length
|
|
473
470
|
));
|
|
474
471
|
return {
|
|
475
472
|
suggestions: [
|
|
@@ -494,9 +491,7 @@ let BuiltinDynamicCompletions = class BuiltinDynamicCompletions extends Disposab
|
|
|
494
491
|
};
|
|
495
492
|
BuiltinDynamicCompletions = BuiltinDynamicCompletions_1 = ( __decorate([
|
|
496
493
|
( __param(0, ILanguageFeaturesService)),
|
|
497
|
-
( __param(1, IChatWidgetService))
|
|
498
|
-
( __param(2, IConfigurationService)),
|
|
499
|
-
( __param(3, IProductService))
|
|
494
|
+
( __param(1, IChatWidgetService))
|
|
500
495
|
], BuiltinDynamicCompletions));
|
|
501
496
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BuiltinDynamicCompletions, 4 );
|
|
502
497
|
function computeCompletionRanges(model, position, reg) {
|
|
@@ -595,9 +590,9 @@ let ChatTokenDeleter = class ChatTokenDeleter extends Disposable {
|
|
|
595
590
|
previousInputValue = inputValue;
|
|
596
591
|
}
|
|
597
592
|
const change = e.changes[0];
|
|
598
|
-
if (!change.text) {
|
|
593
|
+
if (!change.text && this.widget.viewModel) {
|
|
599
594
|
parser.parseChatRequest(this.widget.viewModel.sessionId, previousInputValue).then(previousParsedValue => {
|
|
600
|
-
const deletableTokens = previousParsedValue.parts.filter(p => p instanceof ChatRequestAgentPart || p instanceof ChatRequestAgentSubcommandPart || p instanceof ChatRequestSlashCommandPart);
|
|
595
|
+
const deletableTokens = previousParsedValue.parts.filter(p => p instanceof ChatRequestAgentPart || p instanceof ChatRequestAgentSubcommandPart || p instanceof ChatRequestSlashCommandPart || p instanceof ChatRequestVariablePart);
|
|
601
596
|
deletableTokens.forEach(token => {
|
|
602
597
|
const deletedRangeOfToken = Range.intersectRanges(token.editorRange, change.range);
|
|
603
598
|
if ((deletedRangeOfToken && !deletedRangeOfToken.isEmpty()) && Range.compareRangesUsingStarts(token.editorRange, change.range) < 0) {
|