@codingame/monaco-vscode-chat-service-override 5.3.0 → 6.0.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 +5 -7
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +17 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +15 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +215 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +1 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +15 -93
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +27 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.js +95 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +64 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatContextAttachments.js +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +370 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +19 -366
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +122 -63
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +12 -5
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/common/{voiceChat.js → voiceChatService.js} +58 -21
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +15 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +33 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatHistoryVariables.js +0 -26
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +0 -50
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChatServiceImpl.js +0 -33
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
|
+
import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
2
3
|
import marked_1 from 'vscode/external/vscode-marked/lib/marked.esm.js';
|
|
3
4
|
import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
4
|
-
import { localize2WithPath
|
|
5
|
-
import { registerAction2, Action2, MenuId
|
|
5
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
6
|
+
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
7
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
8
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
7
9
|
import { ResourceNotebookCellEdit } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
|
8
10
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
9
11
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { InteractiveSessionVoteDirection } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
12
|
+
import { CONTEXT_RESPONSE_VOTE, CONTEXT_RESPONSE, CONTEXT_CHAT_RESPONSE_SUPPORT_ISSUE_REPORTING, CONTEXT_RESPONSE_FILTERED, CONTEXT_IN_CHAT_SESSION, CONTEXT_IN_CHAT_INPUT, CONTEXT_REQUEST } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
13
|
+
import { ChatAgentVoteDirection } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
13
14
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
14
15
|
import { isResponseVM, isRequestVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
15
|
-
import { NOTEBOOK_EDITOR_ID, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
|
+
import { NOTEBOOK_EDITOR_ID, CellEditType, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
17
|
import { NOTEBOOK_IS_ACTIVE_EDITOR } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
17
18
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
18
19
|
|
|
@@ -48,10 +49,10 @@ function registerChatTitleActions() {
|
|
|
48
49
|
result: item.result,
|
|
49
50
|
action: {
|
|
50
51
|
kind: 'vote',
|
|
51
|
-
direction:
|
|
52
|
+
direction: ChatAgentVoteDirection.Up,
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
|
-
item.setVote(
|
|
55
|
+
item.setVote(ChatAgentVoteDirection.Up);
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
registerAction2(class MarkUnhelpfulAction extends Action2 {
|
|
@@ -84,10 +85,10 @@ function registerChatTitleActions() {
|
|
|
84
85
|
result: item.result,
|
|
85
86
|
action: {
|
|
86
87
|
kind: 'vote',
|
|
87
|
-
direction:
|
|
88
|
+
direction: ChatAgentVoteDirection.Down,
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
|
-
item.setVote(
|
|
91
|
+
item.setVote(ChatAgentVoteDirection.Down);
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
94
|
registerAction2(class ReportIssueForBugAction extends Action2 {
|
|
@@ -164,7 +165,7 @@ function registerChatTitleActions() {
|
|
|
164
165
|
const bulkEditService = accessor.get(IBulkEditService);
|
|
165
166
|
await bulkEditService.apply([
|
|
166
167
|
( (new ResourceNotebookCellEdit(notebookEditor.textModel.uri, {
|
|
167
|
-
editType:
|
|
168
|
+
editType: CellEditType.Replace,
|
|
168
169
|
index: index,
|
|
169
170
|
count: 0,
|
|
170
171
|
cells: ( (splitContents.map(content => {
|
|
@@ -194,12 +195,12 @@ function registerChatTitleActions() {
|
|
|
194
195
|
category: CHAT_CATEGORY,
|
|
195
196
|
icon: Codicon.x,
|
|
196
197
|
keybinding: {
|
|
197
|
-
primary:
|
|
198
|
+
primary: KeyCode.Delete,
|
|
198
199
|
mac: {
|
|
199
|
-
primary:
|
|
200
|
+
primary: KeyMod.CtrlCmd | KeyCode.Backspace,
|
|
200
201
|
},
|
|
201
202
|
when: ( (ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, (CONTEXT_IN_CHAT_INPUT.negate())))),
|
|
202
|
-
weight:
|
|
203
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
203
204
|
},
|
|
204
205
|
menu: {
|
|
205
206
|
id: MenuId.ChatMessageTitle,
|
|
@@ -224,85 +225,6 @@ function registerChatTitleActions() {
|
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
});
|
|
227
|
-
const rerunMenu = MenuId.for('ChatMessageTitle#Rerun');
|
|
228
|
-
MenuRegistry.appendMenuItem(MenuId.ChatMessageTitle, {
|
|
229
|
-
submenu: rerunMenu,
|
|
230
|
-
title: ( localizeWithPath(_moduleId, 5, "Rerun...")),
|
|
231
|
-
icon: Codicon.refresh,
|
|
232
|
-
group: 'navigation',
|
|
233
|
-
order: -10,
|
|
234
|
-
when: ( (ContextKeyExpr.and(
|
|
235
|
-
CONTEXT_RESPONSE,
|
|
236
|
-
(CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Editor))
|
|
237
|
-
)))
|
|
238
|
-
});
|
|
239
|
-
registerAction2(class RerunAction extends Action2 {
|
|
240
|
-
constructor() {
|
|
241
|
-
super({
|
|
242
|
-
id: 'workbench.action.chat.rerun',
|
|
243
|
-
title: ( localize2WithPath(_moduleId, 6, "Rerun Request")),
|
|
244
|
-
f1: false,
|
|
245
|
-
category: CHAT_CATEGORY,
|
|
246
|
-
icon: Codicon.refresh,
|
|
247
|
-
precondition: ( (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Editor))),
|
|
248
|
-
menu: {
|
|
249
|
-
id: rerunMenu,
|
|
250
|
-
group: 'navigation',
|
|
251
|
-
order: -1,
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
async run(accessor, ...args) {
|
|
256
|
-
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
257
|
-
const chatService = accessor.get(IChatService);
|
|
258
|
-
const widget = chatWidgetService.lastFocusedWidget;
|
|
259
|
-
let item = args[0];
|
|
260
|
-
if (!isResponseVM(item)) {
|
|
261
|
-
item = widget?.getFocus();
|
|
262
|
-
}
|
|
263
|
-
if (!isResponseVM(item) || !widget) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
const request = chatService.getSession(item.sessionId)?.getRequests().find(candidate => candidate.id === item.requestId);
|
|
267
|
-
if (request) {
|
|
268
|
-
await chatService.resendRequest(request, { noCommandDetection: false, attempt: request.attempt + 1, location: widget.location, implicitVariablesEnabled: true });
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
registerAction2(class RerunWithoutCommandDetectionAction extends Action2 {
|
|
273
|
-
constructor() {
|
|
274
|
-
super({
|
|
275
|
-
id: 'workbench.action.chat.rerunWithoutCommandDetection',
|
|
276
|
-
title: ( localize2WithPath(_moduleId, 7, "Rerun without Command Detection")),
|
|
277
|
-
f1: false,
|
|
278
|
-
category: CHAT_CATEGORY,
|
|
279
|
-
icon: Codicon.refresh,
|
|
280
|
-
precondition: ( (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Editor))),
|
|
281
|
-
menu: {
|
|
282
|
-
when: CONTEXT_RESPONSE_DETECTED_AGENT_COMMAND,
|
|
283
|
-
id: rerunMenu,
|
|
284
|
-
group: 'navigation',
|
|
285
|
-
order: -1,
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
async run(accessor, ...args) {
|
|
290
|
-
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
291
|
-
const chatService = accessor.get(IChatService);
|
|
292
|
-
const widget = chatWidgetService.lastFocusedWidget;
|
|
293
|
-
let item = args[0];
|
|
294
|
-
if (!isResponseVM(item)) {
|
|
295
|
-
item = widget?.getFocus();
|
|
296
|
-
}
|
|
297
|
-
if (!isResponseVM(item) || !widget) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
const request = chatService.getSession(item.sessionId)?.getRequests().find(candidate => candidate.id === item.requestId);
|
|
301
|
-
if (request) {
|
|
302
|
-
await chatService.resendRequest(request, { noCommandDetection: true, attempt: request.attempt, location: widget.location, implicitVariablesEnabled: true });
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
228
|
}
|
|
307
229
|
function splitMarkdownAndCodeBlocks(markdown) {
|
|
308
230
|
const lexer = new marked_1.Lexer();
|
|
@@ -3,19 +3,18 @@ import { isMarkdownString, MarkdownString } from 'vscode/vscode/vs/base/common/h
|
|
|
3
3
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
5
5
|
import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
6
|
-
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
7
6
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
7
|
+
import { AccessibleViewRegistry } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry';
|
|
8
8
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
9
9
|
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
10
10
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
11
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
11
12
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
13
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
13
14
|
import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
|
|
14
|
-
import { Extensions as Extensions$1, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
15
|
+
import { Extensions as Extensions$1, registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
15
16
|
import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
|
|
16
|
-
import {
|
|
17
|
-
import { AccessibleViewAction } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewActions';
|
|
18
|
-
import { alertFocusChange } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewContributions';
|
|
17
|
+
import { ChatAccessibilityHelp } from './actions/chatAccessibilityHelp.js';
|
|
19
18
|
import { registerChatActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
20
19
|
import { ACTION_ID_NEW_CHAT, registerNewChatActions } from './actions/chatClearActions.js';
|
|
21
20
|
import { registerChatCodeBlockActions, registerChatCodeCompareBlockActions } from './actions/chatCodeblockActions.js';
|
|
@@ -26,33 +25,34 @@ import { registerChatExportActions } from './actions/chatImportExport.js';
|
|
|
26
25
|
import { registerMoveActions } from './actions/chatMoveActions.js';
|
|
27
26
|
import { registerQuickChatActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions';
|
|
28
27
|
import { registerChatTitleActions } from './actions/chatTitleActions.js';
|
|
29
|
-
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
30
28
|
import './chatAccessibilityService.js';
|
|
31
29
|
import { ChatEditor } from './chatEditor.js';
|
|
32
30
|
import { ChatEditorInput, ChatEditorInputSerializer } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
31
|
+
import { agentToMarkdown, agentSlashCommandToMarkdown } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer';
|
|
32
|
+
import { ChatExtensionPointHandler } from './chatParticipantContributions.js';
|
|
33
33
|
import './chatQuick.js';
|
|
34
|
+
import { ChatResponseAccessibleView } from './chatResponseAccessibleView.js';
|
|
34
35
|
import './chatVariables.js';
|
|
35
36
|
import 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
36
|
-
import './contrib/chatHistoryVariables.js';
|
|
37
37
|
import './contrib/chatInputEditorContrib.js';
|
|
38
|
+
import './contrib/chatContextAttachments.js';
|
|
39
|
+
import './contrib/chatInputCompletions.js';
|
|
38
40
|
import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
39
41
|
import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
40
|
-
import {
|
|
41
|
-
import { ChatWelcomeMessageModel } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatModel';
|
|
42
|
-
import { chatAgentLeader, chatSubcommandLeader, chatVariableLeader } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
42
|
+
import { chatVariableLeader } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
43
43
|
import '../common/chatServiceImpl.js';
|
|
44
44
|
import '../common/chatSlashCommands.js';
|
|
45
45
|
import { IChatSlashCommandService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatSlashCommands.service';
|
|
46
46
|
import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables.service';
|
|
47
|
-
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
48
47
|
import '../common/chatWidgetHistoryService.js';
|
|
49
|
-
import 'vscode/vscode/vs/
|
|
48
|
+
import 'vscode/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
50
49
|
import '../common/languageModelStats.js';
|
|
51
|
-
import '../common/
|
|
50
|
+
import '../common/voiceChatService.js';
|
|
52
51
|
import { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
53
52
|
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
|
|
53
|
+
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
54
54
|
import 'vscode/vscode/vs/workbench/contrib/chat/common/chatColors';
|
|
55
|
-
import {
|
|
55
|
+
import { registerChatContextActions } from './actions/chatContextActions.js';
|
|
56
56
|
|
|
57
57
|
const _moduleId = "vs/workbench/contrib/chat/browser/chat.contribution";
|
|
58
58
|
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
@@ -98,6 +98,7 @@ configurationRegistry.registerConfiguration({
|
|
|
98
98
|
6,
|
|
99
99
|
"Controls whether a checkbox is shown to allow the user to determine which implicit context is included with a chat participant's prompt."
|
|
100
100
|
)),
|
|
101
|
+
deprecated: true,
|
|
101
102
|
default: false
|
|
102
103
|
},
|
|
103
104
|
}
|
|
@@ -127,87 +128,10 @@ ChatResolverContribution = ( (__decorate([
|
|
|
127
128
|
( (__param(0, IEditorResolverService))),
|
|
128
129
|
( (__param(1, IInstantiationService)))
|
|
129
130
|
], ChatResolverContribution)));
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
super();
|
|
133
|
-
this._register(AccessibleViewAction.addImplementation(100, 'panelChat', accessor => {
|
|
134
|
-
const accessibleViewService = accessor.get(IAccessibleViewService);
|
|
135
|
-
const widgetService = accessor.get(IChatWidgetService);
|
|
136
|
-
const codeEditorService = accessor.get(ICodeEditorService);
|
|
137
|
-
return renderAccessibleView(accessibleViewService, widgetService, codeEditorService, true);
|
|
138
|
-
function renderAccessibleView(accessibleViewService, widgetService, codeEditorService, initialRender) {
|
|
139
|
-
const widget = widgetService.lastFocusedWidget;
|
|
140
|
-
if (!widget) {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
const chatInputFocused = initialRender && !!codeEditorService.getFocusedCodeEditor();
|
|
144
|
-
if (initialRender && chatInputFocused) {
|
|
145
|
-
widget.focusLastMessage();
|
|
146
|
-
}
|
|
147
|
-
if (!widget) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
const verifiedWidget = widget;
|
|
151
|
-
const focusedItem = verifiedWidget.getFocus();
|
|
152
|
-
if (!focusedItem) {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
widget.focus(focusedItem);
|
|
156
|
-
const isWelcome = focusedItem instanceof ChatWelcomeMessageModel;
|
|
157
|
-
let responseContent = isResponseVM(focusedItem) ? focusedItem.response.asString() : undefined;
|
|
158
|
-
if (isWelcome) {
|
|
159
|
-
const welcomeReplyContents = [];
|
|
160
|
-
for (const content of focusedItem.content) {
|
|
161
|
-
if (Array.isArray(content)) {
|
|
162
|
-
welcomeReplyContents.push(...( (content.map(m => m.message))));
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
welcomeReplyContents.push(content.value);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
responseContent = welcomeReplyContents.join('\n');
|
|
169
|
-
}
|
|
170
|
-
if (!responseContent && 'errorDetails' in focusedItem && focusedItem.errorDetails) {
|
|
171
|
-
responseContent = focusedItem.errorDetails.message;
|
|
172
|
-
}
|
|
173
|
-
if (!responseContent) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
const responses = verifiedWidget.viewModel?.getItems().filter(i => isResponseVM(i));
|
|
177
|
-
const length = responses?.length;
|
|
178
|
-
const responseIndex = responses?.findIndex(i => i === focusedItem);
|
|
179
|
-
accessibleViewService.show({
|
|
180
|
-
id: "panelChat" ,
|
|
181
|
-
verbositySettingKey: "accessibility.verbosity.panelChat" ,
|
|
182
|
-
provideContent() { return responseContent; },
|
|
183
|
-
onClose() {
|
|
184
|
-
verifiedWidget.reveal(focusedItem);
|
|
185
|
-
if (chatInputFocused) {
|
|
186
|
-
verifiedWidget.focusInput();
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
verifiedWidget.focus(focusedItem);
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
next() {
|
|
193
|
-
verifiedWidget.moveFocus(focusedItem, 'next');
|
|
194
|
-
alertFocusChange(responseIndex, length, 'next');
|
|
195
|
-
renderAccessibleView(accessibleViewService, widgetService, codeEditorService);
|
|
196
|
-
},
|
|
197
|
-
previous() {
|
|
198
|
-
verifiedWidget.moveFocus(focusedItem, 'previous');
|
|
199
|
-
alertFocusChange(responseIndex, length, 'previous');
|
|
200
|
-
renderAccessibleView(accessibleViewService, widgetService, codeEditorService);
|
|
201
|
-
},
|
|
202
|
-
options: { type: "view" }
|
|
203
|
-
});
|
|
204
|
-
return true;
|
|
205
|
-
}
|
|
206
|
-
}, CONTEXT_IN_CHAT_SESSION));
|
|
207
|
-
}
|
|
208
|
-
}
|
|
131
|
+
AccessibleViewRegistry.register(( (new ChatResponseAccessibleView())));
|
|
132
|
+
AccessibleViewRegistry.register(( (new ChatAccessibilityHelp())));
|
|
209
133
|
let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommandsContribution extends Disposable {
|
|
210
|
-
constructor(slashCommandService, commandService, chatAgentService, chatVariablesService) {
|
|
134
|
+
constructor(slashCommandService, commandService, chatAgentService, chatVariablesService, instantiationService) {
|
|
211
135
|
super();
|
|
212
136
|
this._store.add(slashCommandService.registerSlashCommand({
|
|
213
137
|
command: 'clear',
|
|
@@ -238,16 +162,12 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
238
162
|
.filter(a => a.id !== defaultAgent?.id)
|
|
239
163
|
.filter(a => a.locations.includes(ChatAgentLocation.Panel))
|
|
240
164
|
.map(async (a) => {
|
|
241
|
-
const agentWithLeader = `${chatAgentLeader}${a.name}`;
|
|
242
|
-
const actionArg = { inputValue: `${agentWithLeader} ${a.metadata.sampleRequest}` };
|
|
243
|
-
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
244
165
|
const description = a.description ? `- ${a.description}` : '';
|
|
245
|
-
const
|
|
166
|
+
const agentMarkdown = instantiationService.invokeFunction(accessor => agentToMarkdown(a, true, accessor));
|
|
167
|
+
const agentLine = `- ${agentMarkdown} ${description}`;
|
|
246
168
|
const commandText = ( (a.slashCommands.map(c => {
|
|
247
|
-
const actionArg = { inputValue: `${agentWithLeader} ${chatSubcommandLeader}${c.name} ${c.sampleRequest ?? ''}` };
|
|
248
|
-
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
249
169
|
const description = c.description ? `- ${c.description}` : '';
|
|
250
|
-
return `\t*
|
|
170
|
+
return `\t* ${agentSlashCommandToMarkdown(a, c)} ${description}`;
|
|
251
171
|
}))).join('\n');
|
|
252
172
|
return (agentLine + '\n' + commandText).trim();
|
|
253
173
|
}))))).join('\n');
|
|
@@ -285,14 +205,14 @@ ChatSlashStaticSlashCommandsContribution = ( (__decorate([
|
|
|
285
205
|
( (__param(0, IChatSlashCommandService))),
|
|
286
206
|
( (__param(1, ICommandService))),
|
|
287
207
|
( (__param(2, IChatAgentService))),
|
|
288
|
-
( (__param(3, IChatVariablesService)))
|
|
208
|
+
( (__param(3, IChatVariablesService))),
|
|
209
|
+
( (__param(4, IInstantiationService)))
|
|
289
210
|
], ChatSlashStaticSlashCommandsContribution)));
|
|
290
211
|
const workbenchContributionsRegistry = ( (Registry.as(Extensions$1.Workbench)));
|
|
291
|
-
registerWorkbenchContribution2(ChatResolverContribution.ID, ChatResolverContribution,
|
|
292
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(
|
|
293
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(ChatSlashStaticSlashCommandsContribution, 4 );
|
|
212
|
+
registerWorkbenchContribution2(ChatResolverContribution.ID, ChatResolverContribution, WorkbenchPhase.BlockStartup);
|
|
213
|
+
workbenchContributionsRegistry.registerWorkbenchContribution(ChatSlashStaticSlashCommandsContribution, LifecyclePhase.Eventually);
|
|
294
214
|
( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(ChatEditorInput.TypeID, ChatEditorInputSerializer);
|
|
295
|
-
registerWorkbenchContribution2(ChatExtensionPointHandler.ID, ChatExtensionPointHandler,
|
|
215
|
+
registerWorkbenchContribution2(ChatExtensionPointHandler.ID, ChatExtensionPointHandler, WorkbenchPhase.BlockStartup);
|
|
296
216
|
registerChatActions();
|
|
297
217
|
registerChatCopyActions();
|
|
298
218
|
registerChatCodeBlockActions();
|
|
@@ -304,3 +224,4 @@ registerQuickChatActions();
|
|
|
304
224
|
registerChatExportActions();
|
|
305
225
|
registerMoveActions();
|
|
306
226
|
registerNewChatActions();
|
|
227
|
+
registerChatContextActions();
|
|
@@ -5,6 +5,8 @@ import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySign
|
|
|
5
5
|
import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
6
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
7
|
import { AccessibilityProgressSignalScheduler } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler';
|
|
8
|
+
import { renderStringAsPlaintext } from 'vscode/vscode/vs/base/browser/markdownRenderer';
|
|
9
|
+
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
8
10
|
|
|
9
11
|
const CHAT_RESPONSE_PENDING_ALLOWANCE_MS = 4000;
|
|
10
12
|
let ChatAccessibilityService = class ChatAccessibilityService extends Disposable {
|
|
@@ -26,11 +28,12 @@ let ChatAccessibilityService = class ChatAccessibilityService extends Disposable
|
|
|
26
28
|
const isPanelChat = typeof response !== 'string';
|
|
27
29
|
const responseContent = typeof response === 'string' ? response : response?.response.asString();
|
|
28
30
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.chatResponseReceived, { allowManyInParallel: true });
|
|
29
|
-
if (!response) {
|
|
31
|
+
if (!response || !responseContent) {
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
34
|
const errorDetails = isPanelChat && response.errorDetails ? ` ${response.errorDetails.message}` : '';
|
|
33
|
-
|
|
35
|
+
const plainTextResponse = renderStringAsPlaintext(( new MarkdownString(responseContent)));
|
|
36
|
+
status(plainTextResponse + errorDetails);
|
|
34
37
|
}
|
|
35
38
|
};
|
|
36
39
|
ChatAccessibilityService = ( __decorate([
|
|
@@ -2,6 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
3
3
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
4
|
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
5
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
5
6
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
6
7
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
7
8
|
import 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
@@ -50,6 +51,10 @@ let ChatEditor = class ChatEditor extends EditorPane {
|
|
|
50
51
|
this.widget.render(parent);
|
|
51
52
|
this.widget.setVisible(true);
|
|
52
53
|
}
|
|
54
|
+
setEditorVisible(visible) {
|
|
55
|
+
super.setEditorVisible(visible);
|
|
56
|
+
this.widget?.setVisible(visible);
|
|
57
|
+
}
|
|
53
58
|
focus() {
|
|
54
59
|
super.focus();
|
|
55
60
|
this.widget?.focusInput();
|
|
@@ -71,7 +76,7 @@ let ChatEditor = class ChatEditor extends EditorPane {
|
|
|
71
76
|
}
|
|
72
77
|
updateModel(model, viewState) {
|
|
73
78
|
this._memento = ( new Memento('interactive-session-editor-' + CHAT_PROVIDER_ID, this.storageService));
|
|
74
|
-
this._viewState = viewState ?? this._memento.getMemento(
|
|
79
|
+
this._viewState = viewState ?? this._memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
75
80
|
this.widget.setModel(model, { ...this._viewState });
|
|
76
81
|
}
|
|
77
82
|
saveState() {
|