@codingame/monaco-vscode-chat-service-override 4.5.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chat.js +6 -6
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +36 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +78 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +5 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +6 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +10 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +39 -95
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +102 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +57 -70
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +3 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatContributionServiceImpl.js → chatParticipantContributions.js} +63 -202
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +35 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +49 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +71 -74
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +142 -185
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +131 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +11 -2
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChat.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +1 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -34
|
@@ -13,12 +13,12 @@ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
|
13
13
|
import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
|
|
14
14
|
import { Extensions as Extensions$1, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
15
15
|
import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
|
|
16
|
-
import { alertFocusChange } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityContributions';
|
|
17
16
|
import { IAccessibleViewService } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleView.service';
|
|
18
17
|
import { AccessibleViewAction } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewActions';
|
|
18
|
+
import { alertFocusChange } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewContributions';
|
|
19
19
|
import { registerChatActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
20
20
|
import { ACTION_ID_NEW_CHAT, registerNewChatActions } from './actions/chatClearActions.js';
|
|
21
|
-
import { registerChatCodeBlockActions } from './actions/chatCodeblockActions.js';
|
|
21
|
+
import { registerChatCodeBlockActions, registerChatCodeCompareBlockActions } from './actions/chatCodeblockActions.js';
|
|
22
22
|
import { registerChatCopyActions } from './actions/chatCopyActions.js';
|
|
23
23
|
import { SubmitAction, registerChatExecuteActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatExecuteActions';
|
|
24
24
|
import { registerChatFileTreeActions } from './actions/chatFileTreeActions.js';
|
|
@@ -28,7 +28,6 @@ import { registerQuickChatActions } from 'vscode/vscode/vs/workbench/contrib/cha
|
|
|
28
28
|
import { registerChatTitleActions } from './actions/chatTitleActions.js';
|
|
29
29
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
30
30
|
import './chatAccessibilityService.js';
|
|
31
|
-
import './chatContributionServiceImpl.js';
|
|
32
31
|
import { ChatEditor } from './chatEditor.js';
|
|
33
32
|
import { ChatEditorInput, ChatEditorInputSerializer } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
34
33
|
import './chatQuick.js';
|
|
@@ -48,63 +47,46 @@ import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/c
|
|
|
48
47
|
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
49
48
|
import '../common/chatWidgetHistoryService.js';
|
|
50
49
|
import 'vscode/vscode/vs/base/common/event';
|
|
50
|
+
import '../common/languageModelStats.js';
|
|
51
51
|
import '../common/voiceChat.js';
|
|
52
52
|
import { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
53
53
|
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
|
|
54
54
|
import 'vscode/vscode/vs/workbench/contrib/chat/common/chatColors';
|
|
55
|
+
import { ChatExtensionPointHandler } from './chatParticipantContributions.js';
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/chat.contribution";
|
|
58
|
+
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
57
59
|
configurationRegistry.registerConfiguration({
|
|
58
60
|
id: 'chatSidebar',
|
|
59
|
-
title: ( localizeWithPath(
|
|
60
|
-
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
61
|
-
'interactiveSessionConfigurationTitle',
|
|
62
|
-
"Chat"
|
|
63
|
-
)),
|
|
61
|
+
title: ( localizeWithPath(_moduleId, 0, "Chat")),
|
|
64
62
|
type: 'object',
|
|
65
63
|
properties: {
|
|
66
64
|
'chat.editor.fontSize': {
|
|
67
65
|
type: 'number',
|
|
68
|
-
description: ( localizeWithPath(
|
|
69
|
-
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
70
|
-
'interactiveSession.editor.fontSize',
|
|
71
|
-
"Controls the font size in pixels in chat codeblocks."
|
|
72
|
-
)),
|
|
66
|
+
description: ( localizeWithPath(_moduleId, 1, "Controls the font size in pixels in chat codeblocks.")),
|
|
73
67
|
default: isMacintosh ? 12 : 14,
|
|
74
68
|
},
|
|
75
69
|
'chat.editor.fontFamily': {
|
|
76
70
|
type: 'string',
|
|
77
|
-
description: ( localizeWithPath(
|
|
78
|
-
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
79
|
-
'interactiveSession.editor.fontFamily',
|
|
80
|
-
"Controls the font family in chat codeblocks."
|
|
81
|
-
)),
|
|
71
|
+
description: ( localizeWithPath(_moduleId, 2, "Controls the font family in chat codeblocks.")),
|
|
82
72
|
default: 'default'
|
|
83
73
|
},
|
|
84
74
|
'chat.editor.fontWeight': {
|
|
85
75
|
type: 'string',
|
|
86
|
-
description: ( localizeWithPath(
|
|
87
|
-
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
88
|
-
'interactiveSession.editor.fontWeight',
|
|
89
|
-
"Controls the font weight in chat codeblocks."
|
|
90
|
-
)),
|
|
76
|
+
description: ( localizeWithPath(_moduleId, 3, "Controls the font weight in chat codeblocks.")),
|
|
91
77
|
default: 'default'
|
|
92
78
|
},
|
|
93
79
|
'chat.editor.wordWrap': {
|
|
94
80
|
type: 'string',
|
|
95
|
-
description: ( localizeWithPath(
|
|
96
|
-
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
97
|
-
'interactiveSession.editor.wordWrap',
|
|
98
|
-
"Controls whether lines should wrap in chat codeblocks."
|
|
99
|
-
)),
|
|
81
|
+
description: ( localizeWithPath(_moduleId, 4, "Controls whether lines should wrap in chat codeblocks.")),
|
|
100
82
|
default: 'off',
|
|
101
83
|
enum: ['on', 'off']
|
|
102
84
|
},
|
|
103
85
|
'chat.editor.lineHeight': {
|
|
104
86
|
type: 'number',
|
|
105
87
|
description: ( localizeWithPath(
|
|
106
|
-
|
|
107
|
-
|
|
88
|
+
_moduleId,
|
|
89
|
+
5,
|
|
108
90
|
"Controls the line height in pixels in chat codeblocks. Use 0 to compute the line height from the font size."
|
|
109
91
|
)),
|
|
110
92
|
default: 0
|
|
@@ -112,16 +94,16 @@ configurationRegistry.registerConfiguration({
|
|
|
112
94
|
'chat.experimental.implicitContext': {
|
|
113
95
|
type: 'boolean',
|
|
114
96
|
description: ( localizeWithPath(
|
|
115
|
-
|
|
116
|
-
|
|
97
|
+
_moduleId,
|
|
98
|
+
6,
|
|
117
99
|
"Controls whether a checkbox is shown to allow the user to determine which implicit context is included with a chat participant's prompt."
|
|
118
100
|
)),
|
|
119
101
|
default: false
|
|
120
102
|
},
|
|
121
103
|
}
|
|
122
104
|
});
|
|
123
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(ChatEditor, ChatEditorInput.EditorID, ( localizeWithPath(
|
|
124
|
-
( new SyncDescriptor(ChatEditorInput))
|
|
105
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(ChatEditor, ChatEditorInput.EditorID, ( localizeWithPath(_moduleId, 7, "Chat"))), [
|
|
106
|
+
( (new SyncDescriptor(ChatEditorInput)))
|
|
125
107
|
]);
|
|
126
108
|
let ChatResolverContribution = class ChatResolverContribution extends Disposable {
|
|
127
109
|
static { this.ID = 'workbench.contrib.chatResolver'; }
|
|
@@ -129,7 +111,7 @@ let ChatResolverContribution = class ChatResolverContribution extends Disposable
|
|
|
129
111
|
super();
|
|
130
112
|
this._register(editorResolverService.registerEditor(`${Schemas.vscodeChatSesssion}:**/**`, {
|
|
131
113
|
id: ChatEditorInput.EditorID,
|
|
132
|
-
label: ( localizeWithPath(
|
|
114
|
+
label: ( localizeWithPath(_moduleId, 7, "Chat")),
|
|
133
115
|
priority: RegisteredEditorPriority.builtin
|
|
134
116
|
}, {
|
|
135
117
|
singlePerResource: true,
|
|
@@ -141,10 +123,10 @@ let ChatResolverContribution = class ChatResolverContribution extends Disposable
|
|
|
141
123
|
}));
|
|
142
124
|
}
|
|
143
125
|
};
|
|
144
|
-
ChatResolverContribution = ( __decorate([
|
|
145
|
-
( __param(0, IEditorResolverService)),
|
|
146
|
-
( __param(1, IInstantiationService))
|
|
147
|
-
], ChatResolverContribution));
|
|
126
|
+
ChatResolverContribution = ( (__decorate([
|
|
127
|
+
( (__param(0, IEditorResolverService))),
|
|
128
|
+
( (__param(1, IInstantiationService)))
|
|
129
|
+
], ChatResolverContribution)));
|
|
148
130
|
class ChatAccessibleViewContribution extends Disposable {
|
|
149
131
|
constructor() {
|
|
150
132
|
super();
|
|
@@ -177,7 +159,7 @@ class ChatAccessibleViewContribution extends Disposable {
|
|
|
177
159
|
const welcomeReplyContents = [];
|
|
178
160
|
for (const content of focusedItem.content) {
|
|
179
161
|
if (Array.isArray(content)) {
|
|
180
|
-
welcomeReplyContents.push(...( content.map(m => m.message)));
|
|
162
|
+
welcomeReplyContents.push(...( (content.map(m => m.message))));
|
|
181
163
|
}
|
|
182
164
|
else {
|
|
183
165
|
welcomeReplyContents.push(content.value);
|
|
@@ -229,11 +211,7 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
229
211
|
super();
|
|
230
212
|
this._store.add(slashCommandService.registerSlashCommand({
|
|
231
213
|
command: 'clear',
|
|
232
|
-
detail: ( localizeWithPath(
|
|
233
|
-
'vs/workbench/contrib/chat/browser/chat.contribution',
|
|
234
|
-
'clear',
|
|
235
|
-
"Start a new chat"
|
|
236
|
-
)),
|
|
214
|
+
detail: ( localizeWithPath(_moduleId, 8, "Start a new chat")),
|
|
237
215
|
sortText: 'z2_clear',
|
|
238
216
|
executeImmediately: true
|
|
239
217
|
}, async () => {
|
|
@@ -252,64 +230,73 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
252
230
|
progress.report({ content: defaultAgent.metadata.helpTextPrefix, kind: 'markdownContent' });
|
|
253
231
|
}
|
|
254
232
|
else {
|
|
255
|
-
progress.report({ content: defaultAgent.metadata.helpTextPrefix, kind: '
|
|
233
|
+
progress.report({ content: ( (new MarkdownString(defaultAgent.metadata.helpTextPrefix))), kind: 'markdownContent' });
|
|
256
234
|
}
|
|
257
|
-
progress.report({ content: '\n\n', kind: '
|
|
235
|
+
progress.report({ content: ( (new MarkdownString('\n\n'))), kind: 'markdownContent' });
|
|
258
236
|
}
|
|
259
|
-
const agentText = (await Promise.all(( agents
|
|
237
|
+
const agentText = (await Promise.all(( (agents
|
|
260
238
|
.filter(a => a.id !== defaultAgent?.id)
|
|
239
|
+
.filter(a => a.locations.includes(ChatAgentLocation.Panel))
|
|
261
240
|
.map(async (a) => {
|
|
262
241
|
const agentWithLeader = `${chatAgentLeader}${a.name}`;
|
|
263
242
|
const actionArg = { inputValue: `${agentWithLeader} ${a.metadata.sampleRequest}` };
|
|
264
243
|
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
265
|
-
const
|
|
266
|
-
const
|
|
244
|
+
const description = a.description ? `- ${a.description}` : '';
|
|
245
|
+
const agentLine = `* [\`${agentWithLeader}\`](command:${SubmitAction.ID}?${urlSafeArg}) ${description}`;
|
|
246
|
+
const commandText = ( (a.slashCommands.map(c => {
|
|
267
247
|
const actionArg = { inputValue: `${agentWithLeader} ${chatSubcommandLeader}${c.name} ${c.sampleRequest ?? ''}` };
|
|
268
248
|
const urlSafeArg = encodeURIComponent(JSON.stringify(actionArg));
|
|
269
|
-
|
|
270
|
-
|
|
249
|
+
const description = c.description ? `- ${c.description}` : '';
|
|
250
|
+
return `\t* [\`${chatSubcommandLeader}${c.name}\`](command:${SubmitAction.ID}?${urlSafeArg}) ${description}`;
|
|
251
|
+
}))).join('\n');
|
|
271
252
|
return (agentLine + '\n' + commandText).trim();
|
|
272
|
-
})))).join('\n');
|
|
273
|
-
progress.report({ content: ( new MarkdownString(agentText, { isTrusted: { enabledCommands: [SubmitAction.ID] } })), kind: 'markdownContent' });
|
|
253
|
+
}))))).join('\n');
|
|
254
|
+
progress.report({ content: ( (new MarkdownString(agentText, { isTrusted: { enabledCommands: [SubmitAction.ID] } }))), kind: 'markdownContent' });
|
|
274
255
|
if (defaultAgent?.metadata.helpTextVariablesPrefix) {
|
|
275
|
-
progress.report({ content: '\n\n', kind: '
|
|
256
|
+
progress.report({ content: ( (new MarkdownString('\n\n'))), kind: 'markdownContent' });
|
|
276
257
|
if (isMarkdownString(defaultAgent.metadata.helpTextVariablesPrefix)) {
|
|
277
258
|
progress.report({ content: defaultAgent.metadata.helpTextVariablesPrefix, kind: 'markdownContent' });
|
|
278
259
|
}
|
|
279
260
|
else {
|
|
280
|
-
progress.report({ content: defaultAgent.metadata.helpTextVariablesPrefix, kind: '
|
|
261
|
+
progress.report({ content: ( (new MarkdownString(defaultAgent.metadata.helpTextVariablesPrefix))), kind: 'markdownContent' });
|
|
281
262
|
}
|
|
282
|
-
const
|
|
283
|
-
.
|
|
263
|
+
const variables = [
|
|
264
|
+
...chatVariablesService.getVariables(),
|
|
265
|
+
{ name: 'file', description: ( localizeWithPath(_moduleId, 9, "Choose a file in the workspace")) }
|
|
266
|
+
];
|
|
267
|
+
const variableText = ( (variables
|
|
268
|
+
.map(v => `* \`${chatVariableLeader}${v.name}\` - ${v.description}`)))
|
|
284
269
|
.join('\n');
|
|
285
|
-
progress.report({ content: '\n' + variableText, kind: '
|
|
270
|
+
progress.report({ content: ( (new MarkdownString('\n' + variableText))), kind: 'markdownContent' });
|
|
286
271
|
}
|
|
287
272
|
if (defaultAgent?.metadata.helpTextPostfix) {
|
|
288
|
-
progress.report({ content: '\n\n', kind: '
|
|
273
|
+
progress.report({ content: ( (new MarkdownString('\n\n'))), kind: 'markdownContent' });
|
|
289
274
|
if (isMarkdownString(defaultAgent.metadata.helpTextPostfix)) {
|
|
290
275
|
progress.report({ content: defaultAgent.metadata.helpTextPostfix, kind: 'markdownContent' });
|
|
291
276
|
}
|
|
292
277
|
else {
|
|
293
|
-
progress.report({ content: defaultAgent.metadata.helpTextPostfix, kind: '
|
|
278
|
+
progress.report({ content: ( (new MarkdownString(defaultAgent.metadata.helpTextPostfix))), kind: 'markdownContent' });
|
|
294
279
|
}
|
|
295
280
|
}
|
|
296
281
|
}));
|
|
297
282
|
}
|
|
298
283
|
};
|
|
299
|
-
ChatSlashStaticSlashCommandsContribution = ( __decorate([
|
|
300
|
-
( __param(0, IChatSlashCommandService)),
|
|
301
|
-
( __param(1, ICommandService)),
|
|
302
|
-
( __param(2, IChatAgentService)),
|
|
303
|
-
( __param(3, IChatVariablesService))
|
|
304
|
-
], ChatSlashStaticSlashCommandsContribution));
|
|
305
|
-
const workbenchContributionsRegistry = ( Registry.as(Extensions$1.Workbench));
|
|
284
|
+
ChatSlashStaticSlashCommandsContribution = ( (__decorate([
|
|
285
|
+
( (__param(0, IChatSlashCommandService))),
|
|
286
|
+
( (__param(1, ICommandService))),
|
|
287
|
+
( (__param(2, IChatAgentService))),
|
|
288
|
+
( (__param(3, IChatVariablesService)))
|
|
289
|
+
], ChatSlashStaticSlashCommandsContribution)));
|
|
290
|
+
const workbenchContributionsRegistry = ( (Registry.as(Extensions$1.Workbench)));
|
|
306
291
|
registerWorkbenchContribution2(ChatResolverContribution.ID, ChatResolverContribution, 1 );
|
|
307
292
|
workbenchContributionsRegistry.registerWorkbenchContribution(ChatAccessibleViewContribution, 4 );
|
|
308
293
|
workbenchContributionsRegistry.registerWorkbenchContribution(ChatSlashStaticSlashCommandsContribution, 4 );
|
|
309
|
-
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(ChatEditorInput.TypeID, ChatEditorInputSerializer);
|
|
294
|
+
( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(ChatEditorInput.TypeID, ChatEditorInputSerializer);
|
|
295
|
+
registerWorkbenchContribution2(ChatExtensionPointHandler.ID, ChatExtensionPointHandler, 1 );
|
|
310
296
|
registerChatActions();
|
|
311
297
|
registerChatCopyActions();
|
|
312
298
|
registerChatCodeBlockActions();
|
|
299
|
+
registerChatCodeCompareBlockActions();
|
|
313
300
|
registerChatFileTreeActions();
|
|
314
301
|
registerChatTitleActions();
|
|
315
302
|
registerChatExecuteActions();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { status } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
|
|
3
|
-
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
4
3
|
import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
4
|
import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
6
5
|
import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
7
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
+
import { AccessibilityProgressSignalScheduler } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler';
|
|
8
8
|
|
|
9
|
+
const CHAT_RESPONSE_PENDING_ALLOWANCE_MS = 4000;
|
|
9
10
|
let ChatAccessibilityService = class ChatAccessibilityService extends Disposable {
|
|
10
11
|
constructor(_accessibilitySignalService, _instantiationService) {
|
|
11
12
|
super();
|
|
@@ -17,7 +18,7 @@ let ChatAccessibilityService = class ChatAccessibilityService extends Disposable
|
|
|
17
18
|
acceptRequest() {
|
|
18
19
|
this._requestId++;
|
|
19
20
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.chatRequestSent, { allowManyInParallel: true });
|
|
20
|
-
this._pendingSignalMap.set(this._requestId, this._instantiationService.createInstance(
|
|
21
|
+
this._pendingSignalMap.set(this._requestId, this._instantiationService.createInstance(AccessibilityProgressSignalScheduler, CHAT_RESPONSE_PENDING_ALLOWANCE_MS, undefined));
|
|
21
22
|
return this._requestId;
|
|
22
23
|
}
|
|
23
24
|
acceptResponse(response, requestId) {
|
|
@@ -36,26 +37,5 @@ ChatAccessibilityService = ( __decorate([
|
|
|
36
37
|
( __param(0, IAccessibilitySignalService)),
|
|
37
38
|
( __param(1, IInstantiationService))
|
|
38
39
|
], ChatAccessibilityService));
|
|
39
|
-
const CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS = 5000;
|
|
40
|
-
const CHAT_RESPONSE_PENDING_ALLOWANCE_MS = 4000;
|
|
41
|
-
let AccessibilitySignalScheduler = class AccessibilitySignalScheduler extends Disposable {
|
|
42
|
-
constructor(_accessibilitySignalService) {
|
|
43
|
-
super();
|
|
44
|
-
this._accessibilitySignalService = _accessibilitySignalService;
|
|
45
|
-
this._scheduler = ( new RunOnceScheduler(() => {
|
|
46
|
-
this._signalLoop = this._accessibilitySignalService.playSignalLoop(AccessibilitySignal.chatResponsePending, CHAT_RESPONSE_PENDING_AUDIO_CUE_LOOP_MS);
|
|
47
|
-
}, CHAT_RESPONSE_PENDING_ALLOWANCE_MS));
|
|
48
|
-
this._scheduler.schedule();
|
|
49
|
-
}
|
|
50
|
-
dispose() {
|
|
51
|
-
super.dispose();
|
|
52
|
-
this._signalLoop?.dispose();
|
|
53
|
-
this._scheduler.cancel();
|
|
54
|
-
this._scheduler.dispose();
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
AccessibilitySignalScheduler = ( __decorate([
|
|
58
|
-
( __param(0, IAccessibilitySignalService))
|
|
59
|
-
], AccessibilitySignalScheduler));
|
|
60
40
|
|
|
61
41
|
export { ChatAccessibilityService };
|
|
@@ -22,6 +22,7 @@ import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser
|
|
|
22
22
|
import { ChatWidget } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
23
23
|
import { clearChatEditor } from './actions/chatClear.js';
|
|
24
24
|
import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
25
|
+
import { CHAT_PROVIDER_ID } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParticipantContribTypes';
|
|
25
26
|
|
|
26
27
|
let ChatEditor = class ChatEditor extends EditorPane {
|
|
27
28
|
get scopedContextKeyService() {
|
|
@@ -61,15 +62,15 @@ let ChatEditor = class ChatEditor extends EditorPane {
|
|
|
61
62
|
super.setInput(input, options, context, token);
|
|
62
63
|
const editorModel = await input.resolve();
|
|
63
64
|
if (!editorModel) {
|
|
64
|
-
throw new Error(`Failed to get model for chat editor. id: ${input.sessionId}`);
|
|
65
|
+
throw ( new Error(`Failed to get model for chat editor. id: ${input.sessionId}`));
|
|
65
66
|
}
|
|
66
67
|
if (!this.widget) {
|
|
67
|
-
throw new Error('ChatEditor lifecycle issue: no editor widget');
|
|
68
|
+
throw ( new Error('ChatEditor lifecycle issue: no editor widget'));
|
|
68
69
|
}
|
|
69
70
|
this.updateModel(editorModel.model, options?.viewState ?? input.options.viewState);
|
|
70
71
|
}
|
|
71
72
|
updateModel(model, viewState) {
|
|
72
|
-
this._memento = ( new Memento('interactive-session-editor-' +
|
|
73
|
+
this._memento = ( new Memento('interactive-session-editor-' + CHAT_PROVIDER_ID, this.storageService));
|
|
73
74
|
this._viewState = viewState ?? this._memento.getMemento(1 , 1 );
|
|
74
75
|
this.widget.setModel(model, { ...this._viewState });
|
|
75
76
|
}
|