@codingame/monaco-vscode-chat-service-override 10.0.2 → 10.1.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatGettingStarted.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +2 -2
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
|
+
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
3
|
+
import { Selection } from 'vscode/vscode/vs/editor/common/core/selection';
|
|
4
|
+
import { localize2, localize } from 'vscode/vscode/vs/nls';
|
|
5
|
+
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
|
+
import 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
7
|
+
import { IQuickChatService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
8
|
+
import { CONTEXT_CHAT_ENABLED } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
9
|
+
import { InlineChatController } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
10
|
+
import { CHAT_CATEGORY, ASK_QUICK_QUESTION_ACTION_ID } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
|
|
11
|
+
export { ASK_QUICK_QUESTION_ACTION_ID } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
|
|
12
|
+
|
|
13
|
+
function registerQuickChatActions() {
|
|
14
|
+
registerAction2(QuickChatGlobalAction);
|
|
15
|
+
registerAction2(AskQuickChatAction);
|
|
16
|
+
registerAction2(class OpenInChatViewAction extends Action2 {
|
|
17
|
+
constructor() {
|
|
18
|
+
super({
|
|
19
|
+
id: 'workbench.action.quickchat.openInChatView',
|
|
20
|
+
title: ( localize2(7548, "Open in Chat View")),
|
|
21
|
+
f1: false,
|
|
22
|
+
category: CHAT_CATEGORY,
|
|
23
|
+
icon: Codicon.commentDiscussion,
|
|
24
|
+
menu: {
|
|
25
|
+
id: MenuId.ChatInputSide,
|
|
26
|
+
group: 'navigation',
|
|
27
|
+
order: 10
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
run(accessor) {
|
|
32
|
+
const quickChatService = accessor.get(IQuickChatService);
|
|
33
|
+
quickChatService.openInChatView();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
registerAction2(class CloseQuickChatAction extends Action2 {
|
|
37
|
+
constructor() {
|
|
38
|
+
super({
|
|
39
|
+
id: 'workbench.action.quickchat.close',
|
|
40
|
+
title: ( localize2(7549, "Close Quick Chat")),
|
|
41
|
+
f1: false,
|
|
42
|
+
category: CHAT_CATEGORY,
|
|
43
|
+
icon: Codicon.close,
|
|
44
|
+
menu: {
|
|
45
|
+
id: MenuId.ChatInputSide,
|
|
46
|
+
group: 'navigation',
|
|
47
|
+
order: 20
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
run(accessor) {
|
|
52
|
+
const quickChatService = accessor.get(IQuickChatService);
|
|
53
|
+
quickChatService.close();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
registerAction2(class LaunchInlineChatFromQuickChatAction extends Action2 {
|
|
57
|
+
constructor() {
|
|
58
|
+
super({
|
|
59
|
+
id: 'workbench.action.quickchat.launchInlineChat',
|
|
60
|
+
title: ( localize2(7550, "Launch Inline Chat")),
|
|
61
|
+
f1: false,
|
|
62
|
+
category: CHAT_CATEGORY
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async run(accessor) {
|
|
66
|
+
const quickChatService = accessor.get(IQuickChatService);
|
|
67
|
+
const codeEditorService = accessor.get(ICodeEditorService);
|
|
68
|
+
if (quickChatService.focused) {
|
|
69
|
+
quickChatService.close();
|
|
70
|
+
}
|
|
71
|
+
const codeEditor = codeEditorService.getActiveCodeEditor();
|
|
72
|
+
if (!codeEditor) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const controller = InlineChatController.get(codeEditor);
|
|
76
|
+
if (!controller) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
await controller.run();
|
|
80
|
+
controller.focus();
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
class QuickChatGlobalAction extends Action2 {
|
|
85
|
+
constructor() {
|
|
86
|
+
super({
|
|
87
|
+
id: ASK_QUICK_QUESTION_ACTION_ID,
|
|
88
|
+
title: ( localize2(7551, 'Quick Chat')),
|
|
89
|
+
precondition: CONTEXT_CHAT_ENABLED,
|
|
90
|
+
icon: Codicon.commentDiscussion,
|
|
91
|
+
f1: false,
|
|
92
|
+
category: CHAT_CATEGORY,
|
|
93
|
+
keybinding: {
|
|
94
|
+
weight: 200 ,
|
|
95
|
+
primary: 2048 | 1024 | 39 ,
|
|
96
|
+
linux: {
|
|
97
|
+
primary: 2048 | 1024 | 512 | 39
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
menu: {
|
|
101
|
+
id: MenuId.ChatCommandCenter,
|
|
102
|
+
group: 'c_quickChat',
|
|
103
|
+
order: 5
|
|
104
|
+
},
|
|
105
|
+
metadata: {
|
|
106
|
+
description: ( localize(7552, 'Toggle the quick chat')),
|
|
107
|
+
args: [{
|
|
108
|
+
name: 'args',
|
|
109
|
+
schema: {
|
|
110
|
+
anyOf: [
|
|
111
|
+
{
|
|
112
|
+
type: 'object',
|
|
113
|
+
required: ['query'],
|
|
114
|
+
properties: {
|
|
115
|
+
query: {
|
|
116
|
+
description: ( localize(7553, "The query to open the quick chat with")),
|
|
117
|
+
type: 'string'
|
|
118
|
+
},
|
|
119
|
+
isPartialQuery: {
|
|
120
|
+
description: ( localize(7554, "Whether the query is partial; it will wait for more user input")),
|
|
121
|
+
type: 'boolean'
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: 'string',
|
|
127
|
+
description: ( localize(7553, "The query to open the quick chat with"))
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}]
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
run(accessor, query) {
|
|
136
|
+
const quickChatService = accessor.get(IQuickChatService);
|
|
137
|
+
let options;
|
|
138
|
+
switch (typeof query) {
|
|
139
|
+
case 'string':
|
|
140
|
+
options = { query };
|
|
141
|
+
break;
|
|
142
|
+
case 'object':
|
|
143
|
+
options = query;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
if (options?.query) {
|
|
147
|
+
options.selection = ( (new Selection(1, options.query.length + 1, 1, options.query.length + 1)));
|
|
148
|
+
}
|
|
149
|
+
quickChatService.toggle(options);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
class AskQuickChatAction extends Action2 {
|
|
153
|
+
constructor() {
|
|
154
|
+
super({
|
|
155
|
+
id: `workbench.action.openQuickChat`,
|
|
156
|
+
category: CHAT_CATEGORY,
|
|
157
|
+
title: ( localize2(7555, "Open Quick Chat")),
|
|
158
|
+
f1: true
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
run(accessor, query) {
|
|
162
|
+
const quickChatService = accessor.get(IQuickChatService);
|
|
163
|
+
quickChatService.toggle(query ? {
|
|
164
|
+
query,
|
|
165
|
+
selection: ( (new Selection(1, query.length + 1, 1, query.length + 1)))
|
|
166
|
+
} : undefined);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export { registerQuickChatActions };
|
|
@@ -50,7 +50,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
52
|
this.notify(( localize(
|
|
53
|
-
|
|
53
|
+
10749,
|
|
54
54
|
"To insert the code block, open a code editor or notebook editor and set the cursor at the location where to insert the code block."
|
|
55
55
|
)));
|
|
56
56
|
}
|
|
@@ -63,7 +63,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
63
63
|
}
|
|
64
64
|
async handleNotebookEditor(notebookEditor, codeBlockContext) {
|
|
65
65
|
if (notebookEditor.isReadOnly) {
|
|
66
|
-
this.notify(( localize(
|
|
66
|
+
this.notify(( localize(10750, "Cannot insert the code block to read-only notebook editor.")));
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
69
|
const focusRange = notebookEditor.getFocus();
|
|
@@ -74,7 +74,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
74
74
|
async handleTextEditor(codeEditor, codeBlockContext) {
|
|
75
75
|
const activeModel = codeEditor.getModel();
|
|
76
76
|
if (isReadOnly(activeModel, this.textFileService)) {
|
|
77
|
-
this.notify(( localize(
|
|
77
|
+
this.notify(( localize(10751, "Cannot insert the code block to read-only code editor.")));
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
80
|
const range = codeEditor.getSelection() ?? ( (new Range(activeModel.getLineCount(), 1, activeModel.getLineCount(), 1)));
|
|
@@ -114,7 +114,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
114
114
|
async run(context) {
|
|
115
115
|
if (this.inlineChatPreview && this.inlineChatPreview.isOpen()) {
|
|
116
116
|
await this.dialogService.info(( localize(
|
|
117
|
-
|
|
117
|
+
10752,
|
|
118
118
|
"Another code change is being previewed. Please apply or discard the pending changes first."
|
|
119
119
|
)));
|
|
120
120
|
return;
|
|
@@ -145,7 +145,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
145
145
|
result = await this.handleNotebookEditor(activeNotebookEditor, context);
|
|
146
146
|
}
|
|
147
147
|
else {
|
|
148
|
-
this.notify(( localize(
|
|
148
|
+
this.notify(( localize(10753, "To apply this code block, open a code or notebook editor.")));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
notifyUserAction(this.chatService, context, {
|
|
@@ -158,7 +158,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
158
158
|
}
|
|
159
159
|
async handleNotebookEditor(notebookEditor, codeBlockContext) {
|
|
160
160
|
if (notebookEditor.isReadOnly) {
|
|
161
|
-
this.notify(( localize(
|
|
161
|
+
this.notify(( localize(10754, "Cannot apply code block to read-only notebook editor.")));
|
|
162
162
|
return undefined;
|
|
163
163
|
}
|
|
164
164
|
const focusRange = notebookEditor.getFocus();
|
|
@@ -168,7 +168,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
168
168
|
}
|
|
169
169
|
async handleTextEditor(codeEditor, codeBlockContext) {
|
|
170
170
|
if (isReadOnly(codeEditor.getModel(), this.textFileService)) {
|
|
171
|
-
this.notify(( localize(
|
|
171
|
+
this.notify(( localize(10755, "Cannot apply code block to read-only file.")));
|
|
172
172
|
return undefined;
|
|
173
173
|
}
|
|
174
174
|
const result = await this.computeEdits(codeEditor, codeBlockContext);
|
|
@@ -195,7 +195,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
195
195
|
const result = await this.progressService.withProgress({ location: 15 , delay: 500, sticky: true, cancellable: true }, async (progress) => {
|
|
196
196
|
for (const provider of mappedEditsProviders) {
|
|
197
197
|
codeMapper = provider.displayName;
|
|
198
|
-
progress.report({ message: ( localize(
|
|
198
|
+
progress.report({ message: ( localize(10756, "Applying code block using {0}...", codeMapper)) });
|
|
199
199
|
const mappedEdits = await provider.provideMappedEdits(activeModel, [codeBlockActionContext.code], {
|
|
200
200
|
documents: docRefs,
|
|
201
201
|
conversation: getChatConversation(codeBlockActionContext),
|
|
@@ -212,7 +212,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
212
212
|
}
|
|
213
213
|
catch (e) {
|
|
214
214
|
if (!isCancellationError(e)) {
|
|
215
|
-
this.notify(( localize(
|
|
215
|
+
this.notify(( localize(10757, "Failed to apply code block: {0}", e.message)));
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
finally {
|
|
@@ -41,7 +41,7 @@ import { SubmitAction, registerChatExecuteActions } from 'vscode/vscode/vs/workb
|
|
|
41
41
|
import { registerChatFileTreeActions } from './actions/chatFileTreeActions.js';
|
|
42
42
|
import { registerChatExportActions } from './actions/chatImportExport.js';
|
|
43
43
|
import { registerMoveActions } from './actions/chatMoveActions.js';
|
|
44
|
-
import { registerQuickChatActions } from '
|
|
44
|
+
import { registerQuickChatActions } from './actions/chatQuickInputActions.js';
|
|
45
45
|
import { registerChatTitleActions } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatTitleActions';
|
|
46
46
|
import './chatAccessibilityService.js';
|
|
47
47
|
import 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditingService';
|
|
@@ -63,34 +63,34 @@ import './contrib/chatInputEditorHover.js';
|
|
|
63
63
|
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
64
64
|
configurationRegistry.registerConfiguration({
|
|
65
65
|
id: 'chatSidebar',
|
|
66
|
-
title: ( localize(
|
|
66
|
+
title: ( localize(3188, "Chat")),
|
|
67
67
|
type: 'object',
|
|
68
68
|
properties: {
|
|
69
69
|
'chat.editor.fontSize': {
|
|
70
70
|
type: 'number',
|
|
71
|
-
description: ( localize(
|
|
71
|
+
description: ( localize(3189, "Controls the font size in pixels in chat codeblocks.")),
|
|
72
72
|
default: isMacintosh ? 12 : 14,
|
|
73
73
|
},
|
|
74
74
|
'chat.editor.fontFamily': {
|
|
75
75
|
type: 'string',
|
|
76
|
-
description: ( localize(
|
|
76
|
+
description: ( localize(3190, "Controls the font family in chat codeblocks.")),
|
|
77
77
|
default: 'default'
|
|
78
78
|
},
|
|
79
79
|
'chat.editor.fontWeight': {
|
|
80
80
|
type: 'string',
|
|
81
|
-
description: ( localize(
|
|
81
|
+
description: ( localize(3191, "Controls the font weight in chat codeblocks.")),
|
|
82
82
|
default: 'default'
|
|
83
83
|
},
|
|
84
84
|
'chat.editor.wordWrap': {
|
|
85
85
|
type: 'string',
|
|
86
|
-
description: ( localize(
|
|
86
|
+
description: ( localize(3192, "Controls whether lines should wrap in chat codeblocks.")),
|
|
87
87
|
default: 'off',
|
|
88
88
|
enum: ['on', 'off']
|
|
89
89
|
},
|
|
90
90
|
'chat.editor.lineHeight': {
|
|
91
91
|
type: 'number',
|
|
92
92
|
description: ( localize(
|
|
93
|
-
|
|
93
|
+
3193,
|
|
94
94
|
"Controls the line height in pixels in chat codeblocks. Use 0 to compute the line height from the font size."
|
|
95
95
|
)),
|
|
96
96
|
default: 0
|
|
@@ -99,7 +99,7 @@ configurationRegistry.registerConfiguration({
|
|
|
99
99
|
type: 'boolean',
|
|
100
100
|
tags: ['experimental'],
|
|
101
101
|
markdownDescription: ( localize(
|
|
102
|
-
|
|
102
|
+
3194,
|
|
103
103
|
"Controls whether the command center shows a menu for chat actions (requires {0}).",
|
|
104
104
|
'`#window.commandCenter#`'
|
|
105
105
|
)),
|
|
@@ -108,7 +108,7 @@ configurationRegistry.registerConfiguration({
|
|
|
108
108
|
'chat.experimental.implicitContext': {
|
|
109
109
|
type: 'boolean',
|
|
110
110
|
description: ( localize(
|
|
111
|
-
|
|
111
|
+
3195,
|
|
112
112
|
"Controls whether a checkbox is shown to allow the user to determine which implicit context is included with a chat participant's prompt."
|
|
113
113
|
)),
|
|
114
114
|
deprecated: true,
|
|
@@ -116,27 +116,27 @@ configurationRegistry.registerConfiguration({
|
|
|
116
116
|
},
|
|
117
117
|
'chat.experimental.variables.editor': {
|
|
118
118
|
type: 'boolean',
|
|
119
|
-
description: ( localize(
|
|
119
|
+
description: ( localize(3196, "Enables variables for editor chat.")),
|
|
120
120
|
default: true
|
|
121
121
|
},
|
|
122
122
|
'chat.experimental.variables.notebook': {
|
|
123
123
|
type: 'boolean',
|
|
124
|
-
description: ( localize(
|
|
124
|
+
description: ( localize(3197, "Enables variables for notebook chat.")),
|
|
125
125
|
default: true
|
|
126
126
|
},
|
|
127
127
|
'chat.experimental.variables.terminal': {
|
|
128
128
|
type: 'boolean',
|
|
129
|
-
description: ( localize(
|
|
129
|
+
description: ( localize(3198, "Enables variables for terminal chat.")),
|
|
130
130
|
default: false
|
|
131
131
|
},
|
|
132
132
|
'chat.experimental.detectParticipant.enabled': {
|
|
133
133
|
type: 'boolean',
|
|
134
|
-
description: ( localize(
|
|
134
|
+
description: ( localize(3199, "Enables chat participant autodetection for panel chat.")),
|
|
135
135
|
default: null
|
|
136
136
|
},
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(ChatEditor, ChatEditorInput.EditorID, ( localize(
|
|
139
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(ChatEditor, ChatEditorInput.EditorID, ( localize(3200, "Chat"))), [
|
|
140
140
|
( (new SyncDescriptor(ChatEditorInput)))
|
|
141
141
|
]);
|
|
142
142
|
let ChatResolverContribution = class ChatResolverContribution extends Disposable {
|
|
@@ -145,7 +145,7 @@ let ChatResolverContribution = class ChatResolverContribution extends Disposable
|
|
|
145
145
|
super();
|
|
146
146
|
this._register(editorResolverService.registerEditor(`${Schemas.vscodeChatSesssion}:**/**`, {
|
|
147
147
|
id: ChatEditorInput.EditorID,
|
|
148
|
-
label: ( localize(
|
|
148
|
+
label: ( localize(3200, "Chat")),
|
|
149
149
|
priority: RegisteredEditorPriority.builtin
|
|
150
150
|
}, {
|
|
151
151
|
singlePerResource: true,
|
|
@@ -168,7 +168,7 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
168
168
|
super();
|
|
169
169
|
this._store.add(slashCommandService.registerSlashCommand({
|
|
170
170
|
command: 'clear',
|
|
171
|
-
detail: ( localize(
|
|
171
|
+
detail: ( localize(3201, "Start a new chat")),
|
|
172
172
|
sortText: 'z2_clear',
|
|
173
173
|
executeImmediately: true,
|
|
174
174
|
locations: [ChatAgentLocation.Panel]
|
|
@@ -217,7 +217,7 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
|
|
|
217
217
|
}
|
|
218
218
|
const variables = [
|
|
219
219
|
...chatVariablesService.getVariables(ChatAgentLocation.Panel),
|
|
220
|
-
{ name: 'file', description: ( localize(
|
|
220
|
+
{ name: 'file', description: ( localize(3202, "Choose a file in the workspace")) }
|
|
221
221
|
];
|
|
222
222
|
const variableText = ( (variables
|
|
223
223
|
.map(v => `* \`${chatVariableLeader}${v.name}\` - ${v.description}`)))
|
|
@@ -88,7 +88,7 @@ let ChatGettingStartedContribution = class ChatGettingStartedContribution extend
|
|
|
88
88
|
if (!showGettingStartedExp || showGettingStartedExp !== 'showBadge') {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
const badge = ( (new NumberBadge(1, () => ( localize(
|
|
91
|
+
const badge = ( (new NumberBadge(1, () => ( localize(7564, 'Open Chat Panel')))));
|
|
92
92
|
this.showChatGettingStartedDisposable.value = this.activityService.showViewActivity(CHAT_VIEW_ID, { badge });
|
|
93
93
|
this.storageService.store(showChatGettingStartedConfigKey, showGettingStartedExp, -1 , 1 );
|
|
94
94
|
}
|
|
@@ -121,7 +121,7 @@ configurationRegistry.registerConfiguration({
|
|
|
121
121
|
default: '',
|
|
122
122
|
tags: ['experimental'],
|
|
123
123
|
description: ( localize(
|
|
124
|
-
|
|
124
|
+
7565,
|
|
125
125
|
"When enabled, shows a getting started experiments in the chat panel."
|
|
126
126
|
))
|
|
127
127
|
}
|
|
@@ -26,7 +26,7 @@ import { CHAT_SIDEBAR_PANEL_ID, ChatViewPane } from './chatViewPane.js';
|
|
|
26
26
|
const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
27
27
|
extensionPoint: 'chatParticipants',
|
|
28
28
|
jsonSchema: {
|
|
29
|
-
description: ( localize(
|
|
29
|
+
description: ( localize(7566, 'Contributes a chat participant')),
|
|
30
30
|
type: 'array',
|
|
31
31
|
items: {
|
|
32
32
|
additionalProperties: false,
|
|
@@ -35,12 +35,12 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
35
35
|
required: ['name', 'id'],
|
|
36
36
|
properties: {
|
|
37
37
|
id: {
|
|
38
|
-
description: ( localize(
|
|
38
|
+
description: ( localize(7567, "A unique id for this chat participant.")),
|
|
39
39
|
type: 'string'
|
|
40
40
|
},
|
|
41
41
|
name: {
|
|
42
42
|
description: ( localize(
|
|
43
|
-
|
|
43
|
+
7568,
|
|
44
44
|
"User-facing name for this chat participant. The user will use '@' with this name to invoke the participant. Name must not contain whitespace."
|
|
45
45
|
)),
|
|
46
46
|
type: 'string',
|
|
@@ -48,37 +48,37 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
48
48
|
},
|
|
49
49
|
fullName: {
|
|
50
50
|
markdownDescription: ( localize(
|
|
51
|
-
|
|
51
|
+
7569,
|
|
52
52
|
"The full name of this chat participant, which is shown as the label for responses coming from this participant. If not provided, {0} is used.",
|
|
53
53
|
'`name`'
|
|
54
54
|
)),
|
|
55
55
|
type: 'string'
|
|
56
56
|
},
|
|
57
57
|
description: {
|
|
58
|
-
description: ( localize(
|
|
58
|
+
description: ( localize(7570, "A description of this chat participant, shown in the UI.")),
|
|
59
59
|
type: 'string'
|
|
60
60
|
},
|
|
61
61
|
isSticky: {
|
|
62
62
|
description: ( localize(
|
|
63
|
-
|
|
63
|
+
7571,
|
|
64
64
|
"Whether invoking the command puts the chat into a persistent mode, where the command is automatically added to the chat input for the next message."
|
|
65
65
|
)),
|
|
66
66
|
type: 'boolean'
|
|
67
67
|
},
|
|
68
68
|
sampleRequest: {
|
|
69
69
|
description: ( localize(
|
|
70
|
-
|
|
70
|
+
7572,
|
|
71
71
|
"When the user clicks this participant in `/help`, this text will be submitted to the participant."
|
|
72
72
|
)),
|
|
73
73
|
type: 'string'
|
|
74
74
|
},
|
|
75
75
|
when: {
|
|
76
|
-
description: ( localize(
|
|
76
|
+
description: ( localize(7573, "A condition which must be true to enable this participant.")),
|
|
77
77
|
type: 'string'
|
|
78
78
|
},
|
|
79
79
|
disambiguation: {
|
|
80
80
|
description: ( localize(
|
|
81
|
-
|
|
81
|
+
7574,
|
|
82
82
|
"Metadata to help with automatically routing user questions to this chat participant."
|
|
83
83
|
)),
|
|
84
84
|
type: 'array',
|
|
@@ -90,21 +90,21 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
90
90
|
properties: {
|
|
91
91
|
category: {
|
|
92
92
|
markdownDescription: ( localize(
|
|
93
|
-
|
|
93
|
+
7575,
|
|
94
94
|
"A detailed name for this category, e.g. `workspace_questions` or `web_questions`."
|
|
95
95
|
)),
|
|
96
96
|
type: 'string'
|
|
97
97
|
},
|
|
98
98
|
description: {
|
|
99
99
|
description: ( localize(
|
|
100
|
-
|
|
100
|
+
7576,
|
|
101
101
|
"A detailed description of the kinds of questions that are suitable for this chat participant."
|
|
102
102
|
)),
|
|
103
103
|
type: 'string'
|
|
104
104
|
},
|
|
105
105
|
examples: {
|
|
106
106
|
description: ( localize(
|
|
107
|
-
|
|
107
|
+
7577,
|
|
108
108
|
"A list of representative example questions that are suitable for this chat participant."
|
|
109
109
|
)),
|
|
110
110
|
type: 'array'
|
|
@@ -114,7 +114,7 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
114
114
|
},
|
|
115
115
|
commands: {
|
|
116
116
|
markdownDescription: ( localize(
|
|
117
|
-
|
|
117
|
+
7578,
|
|
118
118
|
"Commands available for this chat participant, which the user can invoke with a `/`."
|
|
119
119
|
)),
|
|
120
120
|
type: 'array',
|
|
@@ -126,36 +126,36 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
126
126
|
properties: {
|
|
127
127
|
name: {
|
|
128
128
|
description: ( localize(
|
|
129
|
-
|
|
129
|
+
7579,
|
|
130
130
|
"A short name by which this command is referred to in the UI, e.g. `fix` or * `explain` for commands that fix an issue or explain code. The name should be unique among the commands provided by this participant."
|
|
131
131
|
)),
|
|
132
132
|
type: 'string'
|
|
133
133
|
},
|
|
134
134
|
description: {
|
|
135
|
-
description: ( localize(
|
|
135
|
+
description: ( localize(7580, "A description of this command.")),
|
|
136
136
|
type: 'string'
|
|
137
137
|
},
|
|
138
138
|
when: {
|
|
139
|
-
description: ( localize(
|
|
139
|
+
description: ( localize(7581, "A condition which must be true to enable this command.")),
|
|
140
140
|
type: 'string'
|
|
141
141
|
},
|
|
142
142
|
sampleRequest: {
|
|
143
143
|
description: ( localize(
|
|
144
|
-
|
|
144
|
+
7582,
|
|
145
145
|
"When the user clicks this command in `/help`, this text will be submitted to the participant."
|
|
146
146
|
)),
|
|
147
147
|
type: 'string'
|
|
148
148
|
},
|
|
149
149
|
isSticky: {
|
|
150
150
|
description: ( localize(
|
|
151
|
-
|
|
151
|
+
7571,
|
|
152
152
|
"Whether invoking the command puts the chat into a persistent mode, where the command is automatically added to the chat input for the next message."
|
|
153
153
|
)),
|
|
154
154
|
type: 'boolean'
|
|
155
155
|
},
|
|
156
156
|
disambiguation: {
|
|
157
157
|
description: ( localize(
|
|
158
|
-
|
|
158
|
+
7583,
|
|
159
159
|
"Metadata to help with automatically routing user questions to this chat command."
|
|
160
160
|
)),
|
|
161
161
|
type: 'array',
|
|
@@ -167,21 +167,21 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
167
167
|
properties: {
|
|
168
168
|
category: {
|
|
169
169
|
markdownDescription: ( localize(
|
|
170
|
-
|
|
170
|
+
7584,
|
|
171
171
|
"A detailed name for this category, e.g. `workspace_questions` or `web_questions`."
|
|
172
172
|
)),
|
|
173
173
|
type: 'string'
|
|
174
174
|
},
|
|
175
175
|
description: {
|
|
176
176
|
description: ( localize(
|
|
177
|
-
|
|
177
|
+
7585,
|
|
178
178
|
"A detailed description of the kinds of questions that are suitable for this chat command."
|
|
179
179
|
)),
|
|
180
180
|
type: 'string'
|
|
181
181
|
},
|
|
182
182
|
examples: {
|
|
183
183
|
description: ( localize(
|
|
184
|
-
|
|
184
|
+
7586,
|
|
185
185
|
"A list of representative example questions that are suitable for this chat command."
|
|
186
186
|
)),
|
|
187
187
|
type: 'array'
|
|
@@ -194,7 +194,7 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
194
194
|
},
|
|
195
195
|
supportsToolReferences: {
|
|
196
196
|
description: ( localize(
|
|
197
|
-
|
|
197
|
+
7587,
|
|
198
198
|
"Whether this participant supports {0}.",
|
|
199
199
|
'ChatRequest#toolReferences'
|
|
200
200
|
)),
|
|
@@ -299,7 +299,7 @@ let ChatExtensionPointHandler = class ChatExtensionPointHandler {
|
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
registerViewContainer() {
|
|
302
|
-
const title = ( localize2(
|
|
302
|
+
const title = ( localize2(7588, "Chat"));
|
|
303
303
|
const icon = Codicon.commentDiscussion;
|
|
304
304
|
const viewContainerId = CHAT_SIDEBAR_PANEL_ID;
|
|
305
305
|
const viewContainer = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
|
|
@@ -366,9 +366,9 @@ let ChatCompatibilityNotifier = class ChatCompatibilityNotifier extends Disposab
|
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
368
|
this.registeredWelcomeView = true;
|
|
369
|
-
const showExtensionLabel = ( localize(
|
|
369
|
+
const showExtensionLabel = ( localize(7589, "Show Extension"));
|
|
370
370
|
const mainMessage = ( localize(
|
|
371
|
-
|
|
371
|
+
7590,
|
|
372
372
|
"Chat failed to load because the installed version of the {0} extension is not compatible with this version of {1}. Please ensure that the GitHub Copilot Chat extension is up to date.",
|
|
373
373
|
'GitHub Copilot Chat',
|
|
374
374
|
this.productService.nameLong
|
|
@@ -61,7 +61,7 @@ let ChatAgentHoverParticipant = class ChatAgentHoverParticipant {
|
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
getAccessibleContent(hoverPart) {
|
|
64
|
-
return ( localize(
|
|
64
|
+
return ( localize(7592, 'There is a chat agent hover part here.'));
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
ChatAgentHoverParticipant = ( (__decorate([
|
|
@@ -246,7 +246,7 @@ let ChatService = class ChatService extends Disposable {
|
|
|
246
246
|
const liveSessionItems = ( (Array.from(( (this._sessionModels.values())))
|
|
247
247
|
.filter(session => !session.isImported)
|
|
248
248
|
.map(session => {
|
|
249
|
-
const title = session.title || ( localize(
|
|
249
|
+
const title = session.title || ( localize(3176, "New Chat"));
|
|
250
250
|
return {
|
|
251
251
|
sessionId: session.sessionId,
|
|
252
252
|
title,
|
|
@@ -531,7 +531,7 @@ let ChatService = class ChatService extends Disposable {
|
|
|
531
531
|
else {
|
|
532
532
|
if (!rawResult) {
|
|
533
533
|
this.trace('sendRequest', `Provider returned no response for session ${model.sessionId}`);
|
|
534
|
-
rawResult = { errorDetails: { message: ( localize(
|
|
534
|
+
rawResult = { errorDetails: { message: ( localize(3177, "Provider returned null response")) } };
|
|
535
535
|
}
|
|
536
536
|
const result = rawResult.errorDetails?.responseIsFiltered ? 'filtered' :
|
|
537
537
|
rawResult.errorDetails && gotProgress ? 'errorWithOutput' :
|
|
@@ -120,8 +120,8 @@ LanguageModelStatsService = LanguageModelStatsService_1 = ( (__decorate([
|
|
|
120
120
|
], LanguageModelStatsService)));
|
|
121
121
|
( (Registry.as(Extensions.ExtensionFeaturesRegistry))).registerExtensionFeature({
|
|
122
122
|
id: 'languageModels',
|
|
123
|
-
label: ( localize(
|
|
124
|
-
description: ( localize(
|
|
123
|
+
label: ( localize(3186, "Language Models")),
|
|
124
|
+
description: ( localize(3187, "Language models usage statistics of this extension.")),
|
|
125
125
|
access: {
|
|
126
126
|
canToggle: false
|
|
127
127
|
},
|
|
@@ -108,9 +108,9 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
108
108
|
return undefined;
|
|
109
109
|
}
|
|
110
110
|
return (await tool.impl.provideToolConfirmationMessages(participantName, dto.parameters, token)) ?? {
|
|
111
|
-
title: ( localize(
|
|
111
|
+
title: ( localize(3207, "Use {0}?", `"${tool.data.displayName ?? tool.data.id}"`)),
|
|
112
112
|
message: ( localize(
|
|
113
|
-
|
|
113
|
+
3208,
|
|
114
114
|
"{0} will use {1}.",
|
|
115
115
|
participantName,
|
|
116
116
|
`"${tool.data.displayName ?? tool.data.id}"`
|
|
@@ -121,7 +121,7 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
121
121
|
tool.impl.provideToolInvocationMessage(dto.parameters, token),
|
|
122
122
|
getConfirmationMessages()
|
|
123
123
|
]);
|
|
124
|
-
const defaultMessage = ( localize(
|
|
124
|
+
const defaultMessage = ( localize(3209, "Using {0}", `"${tool.data.displayName ?? tool.data.id}"`));
|
|
125
125
|
toolInvocation = ( (new ChatToolInvocation(invocationMessage ?? defaultMessage, confirmationMessages)));
|
|
126
126
|
token.onCancellationRequested(() => {
|
|
127
127
|
toolInvocation.confirmed.complete(false);
|