@codingame/monaco-vscode-chat-service-override 3.2.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chat.js +7 -5
- package/override/vs/platform/dialogs/common/dialogs.js +2 -0
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +34 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +40 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js +248 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +20 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +16 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +19 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +88 -50
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +27 -28
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChat.js +141 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +6 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +0 -36
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +0 -814
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -223
package/chat.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
2
2
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
3
3
|
import { IChatContributionService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContributionService';
|
|
4
|
-
import { IChatWidgetService, IQuickChatService, IChatAccessibilityService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
4
|
+
import { IChatWidgetService, IQuickChatService, IChatAccessibilityService, IChatCodeBlockContextProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
5
5
|
import { ChatContributionService } from './vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js';
|
|
6
6
|
import { ChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
7
7
|
import { ChatService } from './vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js';
|
|
8
8
|
import { IChatWidgetHistoryService, ChatWidgetHistoryService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatWidgetHistoryService';
|
|
9
9
|
import { ChatAccessibilityService } from './vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js';
|
|
10
|
-
import { IChatProviderService, ChatProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatProvider';
|
|
11
10
|
import { IChatSlashCommandService, ChatSlashCommandService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatSlashCommands';
|
|
12
11
|
import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables';
|
|
13
12
|
import { ChatVariablesService } from './vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js';
|
|
@@ -16,9 +15,11 @@ import { IChatAgentService, ChatAgentService } from 'vscode/vscode/vs/workbench/
|
|
|
16
15
|
import { InlineChatServiceImpl } from './vscode/src/vs/workbench/contrib/inlineChat/common/inlineChatServiceImpl.js';
|
|
17
16
|
import { IInlineChatService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
18
17
|
import { IInlineChatSessionService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService';
|
|
19
|
-
import { InlineChatSessionServiceImpl } from '
|
|
18
|
+
import { InlineChatSessionServiceImpl } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl';
|
|
20
19
|
import { IInlineChatSavingService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSavingService';
|
|
21
20
|
import { InlineChatSavingServiceImpl } from './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js';
|
|
21
|
+
import { ILanguageModelsService, LanguageModelsService } from 'vscode/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
22
|
+
import { ChatCodeBlockContextProviderService } from './vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js';
|
|
22
23
|
import './vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js';
|
|
23
24
|
import './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js';
|
|
24
25
|
|
|
@@ -30,13 +31,14 @@ function getServiceOverride() {
|
|
|
30
31
|
[( IQuickChatService.toString())]: new SyncDescriptor(QuickChatService, [], true),
|
|
31
32
|
[( IChatAccessibilityService.toString())]: new SyncDescriptor(ChatAccessibilityService, [], true),
|
|
32
33
|
[( IChatWidgetHistoryService.toString())]: new SyncDescriptor(ChatWidgetHistoryService, [], true),
|
|
33
|
-
[(
|
|
34
|
+
[( ILanguageModelsService.toString())]: new SyncDescriptor(LanguageModelsService, [], true),
|
|
34
35
|
[( IChatSlashCommandService.toString())]: new SyncDescriptor(ChatSlashCommandService, [], true),
|
|
35
36
|
[( IChatAgentService.toString())]: new SyncDescriptor(ChatAgentService, [], true),
|
|
36
37
|
[( IChatVariablesService.toString())]: new SyncDescriptor(ChatVariablesService, [], true),
|
|
37
38
|
[( IInlineChatService.toString())]: new SyncDescriptor(InlineChatServiceImpl, [], true),
|
|
38
39
|
[( IInlineChatSessionService.toString())]: new SyncDescriptor(InlineChatSessionServiceImpl, [], true),
|
|
39
|
-
[( IInlineChatSavingService.toString())]: new SyncDescriptor(InlineChatSavingServiceImpl, [], true)
|
|
40
|
+
[( IInlineChatSavingService.toString())]: new SyncDescriptor(InlineChatSavingServiceImpl, [], true),
|
|
41
|
+
[( IChatCodeBlockContextProviderService.toString())]: new SyncDescriptor(ChatCodeBlockContextProviderService, [], true)
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-chat-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
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@4.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -13,12 +13,12 @@ import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/acti
|
|
|
13
13
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
14
14
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
15
15
|
import { TerminalLocation } from 'vscode/vscode/vs/platform/terminal/common/terminal';
|
|
16
|
+
import { accessibleViewInCodeBlock } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
16
17
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
17
|
-
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
18
|
+
import { IChatWidgetService, IChatCodeBlockContextProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
18
19
|
import { CONTEXT_PROVIDER_EXISTS, CONTEXT_IN_CHAT_SESSION, CONTEXT_IN_CHAT_INPUT } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
19
20
|
import { IChatService, ChatCopyKind } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
20
21
|
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
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';
|
|
23
23
|
import { NOTEBOOK_EDITOR_ID, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
24
24
|
import { ITerminalService, ITerminalEditorService, ITerminalGroupService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal';
|
|
@@ -66,7 +66,7 @@ function registerChatCodeBlockActions() {
|
|
|
66
66
|
icon: Codicon.copy,
|
|
67
67
|
menu: {
|
|
68
68
|
id: MenuId.ChatCodeBlock,
|
|
69
|
-
group: 'navigation'
|
|
69
|
+
group: 'navigation'
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
@@ -116,21 +116,24 @@ function registerChatCodeBlockActions() {
|
|
|
116
116
|
editor.getSelections()?.reduce((acc, selection) => acc + editorModel.getValueInRange(selection), '') ?? '';
|
|
117
117
|
const totalCharacters = editorModel.getValueLength();
|
|
118
118
|
const chatService = accessor.get(IChatService);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
119
|
+
const element = context.element;
|
|
120
|
+
if (element) {
|
|
121
|
+
chatService.notifyUserAction({
|
|
122
|
+
providerId: element.providerId,
|
|
123
|
+
agentId: element.agent?.id,
|
|
124
|
+
sessionId: element.sessionId,
|
|
125
|
+
requestId: element.requestId,
|
|
126
|
+
result: element.result,
|
|
127
|
+
action: {
|
|
128
|
+
kind: 'copy',
|
|
129
|
+
codeBlockIndex: context.codeBlockIndex,
|
|
130
|
+
copyKind: ChatCopyKind.Action,
|
|
131
|
+
copiedText,
|
|
132
|
+
copiedCharacters: copiedText.length,
|
|
133
|
+
totalCharacters,
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
134
137
|
if (noSelection) {
|
|
135
138
|
accessor.get(IClipboardService).writeText(context.code);
|
|
136
139
|
return true;
|
|
@@ -153,13 +156,13 @@ function registerChatCodeBlockActions() {
|
|
|
153
156
|
menu: {
|
|
154
157
|
id: MenuId.ChatCodeBlock,
|
|
155
158
|
group: 'navigation',
|
|
156
|
-
when: CONTEXT_IN_CHAT_SESSION
|
|
159
|
+
when: CONTEXT_IN_CHAT_SESSION
|
|
157
160
|
},
|
|
158
161
|
keybinding: {
|
|
159
|
-
when: ( ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, ( CONTEXT_IN_CHAT_INPUT.negate()))),
|
|
162
|
+
when: ( ContextKeyExpr.or(( ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, ( CONTEXT_IN_CHAT_INPUT.negate()))), accessibleViewInCodeBlock)),
|
|
160
163
|
primary: 2048 | 3 ,
|
|
161
164
|
mac: { primary: 256 | 3 },
|
|
162
|
-
weight:
|
|
165
|
+
weight: 400 + 1
|
|
163
166
|
},
|
|
164
167
|
});
|
|
165
168
|
}
|
|
@@ -288,7 +291,7 @@ function registerChatCodeBlockActions() {
|
|
|
288
291
|
menu: {
|
|
289
292
|
id: MenuId.ChatCodeBlock,
|
|
290
293
|
group: 'navigation',
|
|
291
|
-
isHiddenByDefault: true
|
|
294
|
+
isHiddenByDefault: true
|
|
292
295
|
}
|
|
293
296
|
});
|
|
294
297
|
}
|
|
@@ -348,11 +351,6 @@ function registerChatCodeBlockActions() {
|
|
|
348
351
|
group: 'navigation',
|
|
349
352
|
isHiddenByDefault: true,
|
|
350
353
|
when: ( ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, ...( shellLangIds.map(e => ( ContextKeyExpr.notEquals(EditorContextKeys.languageId.key, e))))))
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
id: MenuId.ChatCodeBlock,
|
|
354
|
-
group: 'navigation',
|
|
355
|
-
when: CTX_INLINE_CHAT_VISIBLE,
|
|
356
354
|
}],
|
|
357
355
|
keybinding: [{
|
|
358
356
|
primary: 2048 | 512 | 3 ,
|
|
@@ -360,7 +358,7 @@ function registerChatCodeBlockActions() {
|
|
|
360
358
|
primary: 256 | 512 | 3
|
|
361
359
|
},
|
|
362
360
|
weight: 100 ,
|
|
363
|
-
when: CONTEXT_IN_CHAT_SESSION,
|
|
361
|
+
when: ( ContextKeyExpr.or(CONTEXT_IN_CHAT_SESSION, accessibleViewInCodeBlock)),
|
|
364
362
|
}]
|
|
365
363
|
});
|
|
366
364
|
}
|
|
@@ -478,16 +476,20 @@ function registerChatCodeBlockActions() {
|
|
|
478
476
|
}
|
|
479
477
|
function getContextFromEditor(editor, accessor) {
|
|
480
478
|
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
479
|
+
const chatCodeBlockContextProviderService = accessor.get(IChatCodeBlockContextProviderService);
|
|
481
480
|
const model = editor.getModel();
|
|
482
481
|
if (!model) {
|
|
483
482
|
return;
|
|
484
483
|
}
|
|
485
484
|
const widget = chatWidgetService.lastFocusedWidget;
|
|
486
|
-
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
const codeBlockInfo = widget.getCodeBlockInfoForEditor(model.uri);
|
|
485
|
+
const codeBlockInfo = widget?.getCodeBlockInfoForEditor(model.uri);
|
|
490
486
|
if (!codeBlockInfo) {
|
|
487
|
+
for (const provider of chatCodeBlockContextProviderService.providers) {
|
|
488
|
+
const context = provider.getCodeBlockContext(editor);
|
|
489
|
+
if (context) {
|
|
490
|
+
return context;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
491
493
|
return;
|
|
492
494
|
}
|
|
493
495
|
return {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { isMarkdownString, MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
2
3
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
4
5
|
import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
6
|
+
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
5
7
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
8
|
+
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
6
9
|
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
7
10
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
8
11
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -10,36 +13,43 @@ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
|
10
13
|
import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
|
|
11
14
|
import { Extensions as Extensions$1, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
12
15
|
import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
|
|
16
|
+
import { alertFocusChange } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityContributions';
|
|
17
|
+
import { IAccessibleViewService } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleView';
|
|
18
|
+
import { AccessibleViewAction } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewActions';
|
|
13
19
|
import { registerChatActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
20
|
+
import { registerNewChatActions, ACTION_ID_NEW_CHAT } from './actions/chatClearActions.js';
|
|
14
21
|
import { registerChatCodeBlockActions } from './actions/chatCodeblockActions.js';
|
|
15
22
|
import { registerChatCopyActions } from './actions/chatCopyActions.js';
|
|
16
23
|
import { registerChatExecuteActions, SubmitAction } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatExecuteActions';
|
|
24
|
+
import { registerChatFileTreeActions } from './actions/chatFileTreeActions.js';
|
|
25
|
+
import { registerChatExportActions } from './actions/chatImportExport.js';
|
|
26
|
+
import { registerMoveActions } from './actions/chatMoveActions.js';
|
|
17
27
|
import { registerQuickChatActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions';
|
|
18
28
|
import { registerChatTitleActions } from './actions/chatTitleActions.js';
|
|
19
|
-
import { registerChatExportActions } from './actions/chatImportExport.js';
|
|
20
29
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
30
|
+
import './chatAccessibilityService.js';
|
|
31
|
+
import './chatContributionServiceImpl.js';
|
|
21
32
|
import { ChatEditor } from './chatEditor.js';
|
|
22
33
|
import { ChatEditorInput, ChatEditorInputSerializer } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
23
|
-
import './
|
|
34
|
+
import './chatQuick.js';
|
|
35
|
+
import './chatVariables.js';
|
|
36
|
+
import 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
24
37
|
import './contrib/chatHistoryVariables.js';
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import { registerNewChatActions, ACTION_ID_NEW_CHAT } from './actions/chatClearActions.js';
|
|
28
|
-
import { IAccessibleViewService } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleView';
|
|
29
|
-
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
38
|
+
import './contrib/chatInputEditorContrib.js';
|
|
39
|
+
import { ChatAgentLocation, IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
30
40
|
import { CONTEXT_IN_CHAT_SESSION } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
31
|
-
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
32
41
|
import { ChatWelcomeMessageModel } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatModel';
|
|
33
|
-
import {
|
|
42
|
+
import { chatAgentLeader, chatSubcommandLeader, chatVariableLeader } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
43
|
+
import 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
44
|
+
import '../common/chatServiceImpl.js';
|
|
34
45
|
import { IChatSlashCommandService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatSlashCommands';
|
|
35
|
-
import { alertFocusChange } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityContributions';
|
|
36
|
-
import { AccessibleViewAction } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewActions';
|
|
37
|
-
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
38
46
|
import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables';
|
|
39
|
-
import {
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
47
|
+
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
48
|
+
import 'vscode/vscode/vs/workbench/contrib/chat/common/chatWidgetHistoryService';
|
|
49
|
+
import 'vscode/vscode/vs/base/common/event';
|
|
50
|
+
import '../common/voiceChat.js';
|
|
51
|
+
import { RegisteredEditorPriority, IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
52
|
+
import 'vscode/vscode/vs/workbench/contrib/chat/common/chatColors';
|
|
43
53
|
|
|
44
54
|
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
45
55
|
configurationRegistry.registerConfiguration({
|
|
@@ -96,7 +106,16 @@ configurationRegistry.registerConfiguration({
|
|
|
96
106
|
"Controls the line height in pixels in chat codeblocks. Use 0 to compute the line height from the font size."
|
|
97
107
|
)),
|
|
98
108
|
default: 0
|
|
99
|
-
}
|
|
109
|
+
},
|
|
110
|
+
'chat.experimental.implicitContext': {
|
|
111
|
+
type: 'boolean',
|
|
112
|
+
description: ( localizeWithPath(
|
|
113
|
+
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
114
|
+
'chat.experimental.implicitContext',
|
|
115
|
+
"Controls whether a checkbox is shown to allow the user to determine which implicit context is included with a chat participant's prompt."
|
|
116
|
+
)),
|
|
117
|
+
default: false
|
|
118
|
+
},
|
|
100
119
|
}
|
|
101
120
|
});
|
|
102
121
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(ChatEditor, ChatEditorInput.EditorID, ( localizeWithPath('vs/workbench/contrib/chat/browser/chat.contribution', 'chat', "Chat"))), [
|
|
@@ -224,7 +243,7 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
224
243
|
sortText: 'z1_help',
|
|
225
244
|
executeImmediately: true
|
|
226
245
|
}, async (prompt, progress) => {
|
|
227
|
-
const defaultAgent = chatAgentService.getDefaultAgent();
|
|
246
|
+
const defaultAgent = chatAgentService.getDefaultAgent(ChatAgentLocation.Panel);
|
|
228
247
|
const agents = chatAgentService.getAgents();
|
|
229
248
|
if (defaultAgent?.metadata.helpTextPrefix) {
|
|
230
249
|
if (isMarkdownString(defaultAgent.metadata.helpTextPrefix)) {
|
|
@@ -238,12 +257,11 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
238
257
|
const agentText = (await Promise.all(( agents
|
|
239
258
|
.filter(a => a.id !== defaultAgent?.id)
|
|
240
259
|
.map(async (a) => {
|
|
241
|
-
const agentWithLeader = `${chatAgentLeader}${a.
|
|
260
|
+
const agentWithLeader = `${chatAgentLeader}${a.name}`;
|
|
242
261
|
const actionArg = { inputValue: `${agentWithLeader} ${a.metadata.sampleRequest}` };
|
|
243
262
|
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
244
|
-
const agentLine = `* [\`${agentWithLeader}\`](command:${SubmitAction.ID}?${urlSafeArg}) - ${a.
|
|
245
|
-
const
|
|
246
|
-
const commandText = ( commands.map(c => {
|
|
263
|
+
const agentLine = `* [\`${agentWithLeader}\`](command:${SubmitAction.ID}?${urlSafeArg}) - ${a.description}`;
|
|
264
|
+
const commandText = ( a.slashCommands.map(c => {
|
|
247
265
|
const actionArg = { inputValue: `${agentWithLeader} ${chatSubcommandLeader}${c.name} ${c.sampleRequest ?? ''}` };
|
|
248
266
|
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
249
267
|
return `\t* [\`${chatSubcommandLeader}${c.name}\`](command:${SubmitAction.ID}?${urlSafeArg}) - ${c.description}`;
|
|
@@ -10,17 +10,17 @@ let ChatAccessibilityService = class ChatAccessibilityService extends Disposable
|
|
|
10
10
|
super();
|
|
11
11
|
this._accessibilitySignalService = _accessibilitySignalService;
|
|
12
12
|
this._instantiationService = _instantiationService;
|
|
13
|
-
this.
|
|
13
|
+
this._pendingSignalMap = this._register(( new DisposableMap()));
|
|
14
14
|
this._requestId = 0;
|
|
15
15
|
}
|
|
16
16
|
acceptRequest() {
|
|
17
17
|
this._requestId++;
|
|
18
18
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.chatRequestSent, { allowManyInParallel: true });
|
|
19
|
-
this.
|
|
19
|
+
this._pendingSignalMap.set(this._requestId, this._instantiationService.createInstance(AccessibilitySignalScheduler));
|
|
20
20
|
return this._requestId;
|
|
21
21
|
}
|
|
22
22
|
acceptResponse(response, requestId) {
|
|
23
|
-
this.
|
|
23
|
+
this._pendingSignalMap.deleteAndDispose(requestId);
|
|
24
24
|
const isPanelChat = typeof response !== 'string';
|
|
25
25
|
const responseContent = typeof response === 'string' ? response : response?.response.asString();
|
|
26
26
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.chatResponseReceived, { allowManyInParallel: true });
|
|
@@ -37,24 +37,24 @@ ChatAccessibilityService = ( __decorate([
|
|
|
37
37
|
], ChatAccessibilityService));
|
|
38
38
|
const CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS = 5000;
|
|
39
39
|
const CHAT_RESPONSE_PENDING_ALLOWANCE_MS = 4000;
|
|
40
|
-
let
|
|
40
|
+
let AccessibilitySignalScheduler = class AccessibilitySignalScheduler extends Disposable {
|
|
41
41
|
constructor(_accessibilitySignalService) {
|
|
42
42
|
super();
|
|
43
43
|
this._accessibilitySignalService = _accessibilitySignalService;
|
|
44
44
|
this._scheduler = ( new RunOnceScheduler(() => {
|
|
45
|
-
this.
|
|
45
|
+
this._signalLoop = this._accessibilitySignalService.playSignalLoop(AccessibilitySignal.chatResponsePending, CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS);
|
|
46
46
|
}, CHAT_RESPONSE_PENDING_ALLOWANCE_MS));
|
|
47
47
|
this._scheduler.schedule();
|
|
48
48
|
}
|
|
49
49
|
dispose() {
|
|
50
50
|
super.dispose();
|
|
51
|
-
this.
|
|
51
|
+
this._signalLoop?.dispose();
|
|
52
52
|
this._scheduler.cancel();
|
|
53
53
|
this._scheduler.dispose();
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
AccessibilitySignalScheduler = ( __decorate([
|
|
57
57
|
( __param(0, IAccessibilitySignalService))
|
|
58
|
-
],
|
|
58
|
+
], AccessibilitySignalScheduler));
|
|
59
59
|
|
|
60
60
|
export { ChatAccessibilityService };
|