@codingame/monaco-vscode-chat-service-override 23.0.3 → 23.1.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/package.json +43 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +106 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +28 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +52 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +65 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +57 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +53 -53
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +27 -27
- 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/inlineChatActions.js +22 -23
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +8 -8
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +10 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +10 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js
CHANGED
|
@@ -24,8 +24,8 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quic
|
|
|
24
24
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
25
25
|
import { ToolConfirmKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
26
26
|
|
|
27
|
-
const RUN_WITHOUT_APPROVAL = ( localize(
|
|
28
|
-
const CONTINUE_WITHOUT_REVIEWING_RESULTS = ( localize(
|
|
27
|
+
const RUN_WITHOUT_APPROVAL = ( localize(5572, "without approval"));
|
|
28
|
+
const CONTINUE_WITHOUT_REVIEWING_RESULTS = ( localize(5573, "without reviewing result"));
|
|
29
29
|
class GenericConfirmStore extends Disposable {
|
|
30
30
|
constructor(_storageKey, _instantiationService) {
|
|
31
31
|
super();
|
|
@@ -222,23 +222,23 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
222
222
|
return actions;
|
|
223
223
|
}
|
|
224
224
|
actions.push({
|
|
225
|
-
label: ( localize(
|
|
226
|
-
detail: ( localize(
|
|
225
|
+
label: ( localize(5574, 'Allow in this Session')),
|
|
226
|
+
detail: ( localize(5575, 'Allow this tool to run in this session without confirmation.')),
|
|
227
227
|
divider: !!actions.length,
|
|
228
228
|
select: async () => {
|
|
229
229
|
this._preExecutionToolConfirmStore.setAutoConfirmation(ref.toolId, 'session');
|
|
230
230
|
return true;
|
|
231
231
|
}
|
|
232
232
|
}, {
|
|
233
|
-
label: ( localize(
|
|
234
|
-
detail: ( localize(
|
|
233
|
+
label: ( localize(5576, 'Allow in this Workspace')),
|
|
234
|
+
detail: ( localize(5577, 'Allow this tool to run in this workspace without confirmation.')),
|
|
235
235
|
select: async () => {
|
|
236
236
|
this._preExecutionToolConfirmStore.setAutoConfirmation(ref.toolId, 'workspace');
|
|
237
237
|
return true;
|
|
238
238
|
}
|
|
239
239
|
}, {
|
|
240
|
-
label: ( localize(
|
|
241
|
-
detail: ( localize(
|
|
240
|
+
label: ( localize(5578, 'Always Allow')),
|
|
241
|
+
detail: ( localize(5579, 'Always allow this tool to run without confirmation.')),
|
|
242
242
|
select: async () => {
|
|
243
243
|
this._preExecutionToolConfirmStore.setAutoConfirmation(ref.toolId, 'profile');
|
|
244
244
|
return true;
|
|
@@ -247,9 +247,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
247
247
|
if (ref.source.type === 'mcp') {
|
|
248
248
|
const { serverLabel, definitionId } = ref.source;
|
|
249
249
|
actions.push({
|
|
250
|
-
label: ( localize(
|
|
250
|
+
label: ( localize(5580, 'Allow Tools from {0} in this Session', serverLabel)),
|
|
251
251
|
detail: ( localize(
|
|
252
|
-
|
|
252
|
+
5581,
|
|
253
253
|
'Allow all tools from this server to run in this session without confirmation.'
|
|
254
254
|
)),
|
|
255
255
|
divider: true,
|
|
@@ -258,9 +258,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
258
258
|
return true;
|
|
259
259
|
}
|
|
260
260
|
}, {
|
|
261
|
-
label: ( localize(
|
|
261
|
+
label: ( localize(5582, 'Allow Tools from {0} in this Workspace', serverLabel)),
|
|
262
262
|
detail: ( localize(
|
|
263
|
-
|
|
263
|
+
5583,
|
|
264
264
|
'Allow all tools from this server to run in this workspace without confirmation.'
|
|
265
265
|
)),
|
|
266
266
|
select: async () => {
|
|
@@ -268,9 +268,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
268
268
|
return true;
|
|
269
269
|
}
|
|
270
270
|
}, {
|
|
271
|
-
label: ( localize(
|
|
271
|
+
label: ( localize(5584, 'Always Allow Tools from {0}', serverLabel)),
|
|
272
272
|
detail: ( localize(
|
|
273
|
-
|
|
273
|
+
5585,
|
|
274
274
|
'Always allow all tools from this server to run without confirmation.'
|
|
275
275
|
)),
|
|
276
276
|
select: async () => {
|
|
@@ -291,9 +291,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
291
291
|
return actions;
|
|
292
292
|
}
|
|
293
293
|
actions.push({
|
|
294
|
-
label: ( localize(
|
|
294
|
+
label: ( localize(5586, 'Allow Without Review in this Session')),
|
|
295
295
|
detail: ( localize(
|
|
296
|
-
|
|
296
|
+
5587,
|
|
297
297
|
'Allow results from this tool to be sent without confirmation in this session.'
|
|
298
298
|
)),
|
|
299
299
|
divider: !!actions.length,
|
|
@@ -302,9 +302,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
302
302
|
return true;
|
|
303
303
|
}
|
|
304
304
|
}, {
|
|
305
|
-
label: ( localize(
|
|
305
|
+
label: ( localize(5588, 'Allow Without Review in this Workspace')),
|
|
306
306
|
detail: ( localize(
|
|
307
|
-
|
|
307
|
+
5589,
|
|
308
308
|
'Allow results from this tool to be sent without confirmation in this workspace.'
|
|
309
309
|
)),
|
|
310
310
|
select: async () => {
|
|
@@ -312,9 +312,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
312
312
|
return true;
|
|
313
313
|
}
|
|
314
314
|
}, {
|
|
315
|
-
label: ( localize(
|
|
315
|
+
label: ( localize(5590, 'Always Allow Without Review')),
|
|
316
316
|
detail: ( localize(
|
|
317
|
-
|
|
317
|
+
5591,
|
|
318
318
|
'Always allow results from this tool to be sent without confirmation.'
|
|
319
319
|
)),
|
|
320
320
|
select: async () => {
|
|
@@ -325,9 +325,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
325
325
|
if (ref.source.type === 'mcp') {
|
|
326
326
|
const { serverLabel, definitionId } = ref.source;
|
|
327
327
|
actions.push({
|
|
328
|
-
label: ( localize(
|
|
328
|
+
label: ( localize(5592, 'Allow Tools from {0} Without Review in this Session', serverLabel)),
|
|
329
329
|
detail: ( localize(
|
|
330
|
-
|
|
330
|
+
5593,
|
|
331
331
|
'Allow results from all tools from this server to be sent without confirmation in this session.'
|
|
332
332
|
)),
|
|
333
333
|
divider: true,
|
|
@@ -336,9 +336,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
336
336
|
return true;
|
|
337
337
|
}
|
|
338
338
|
}, {
|
|
339
|
-
label: ( localize(
|
|
339
|
+
label: ( localize(5594, 'Allow Tools from {0} Without Review in this Workspace', serverLabel)),
|
|
340
340
|
detail: ( localize(
|
|
341
|
-
|
|
341
|
+
5595,
|
|
342
342
|
'Allow results from all tools from this server to be sent without confirmation in this workspace.'
|
|
343
343
|
)),
|
|
344
344
|
select: async () => {
|
|
@@ -346,9 +346,9 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
346
346
|
return true;
|
|
347
347
|
}
|
|
348
348
|
}, {
|
|
349
|
-
label: ( localize(
|
|
349
|
+
label: ( localize(5596, 'Always Allow Tools from {0} Without Review', serverLabel)),
|
|
350
350
|
detail: ( localize(
|
|
351
|
-
|
|
351
|
+
5597,
|
|
352
352
|
'Always allow results from all tools from this server to be sent without confirmation.'
|
|
353
353
|
)),
|
|
354
354
|
select: async () => {
|
|
@@ -482,7 +482,7 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
482
482
|
type: 'server-post',
|
|
483
483
|
serverId,
|
|
484
484
|
iconClass: ThemeIcon.asClassName(Codicon.play),
|
|
485
|
-
label: ( localize(
|
|
485
|
+
label: ( localize(5598, "Continue without reviewing any tool results")),
|
|
486
486
|
checked: serverPostConfirmed
|
|
487
487
|
});
|
|
488
488
|
}
|
|
@@ -491,7 +491,7 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
491
491
|
type: 'server-pre',
|
|
492
492
|
serverId,
|
|
493
493
|
iconClass: ThemeIcon.asClassName(Codicon.play),
|
|
494
|
-
label: ( localize(
|
|
494
|
+
label: ( localize(5599, "Run any tool without approval")),
|
|
495
495
|
checked: serverPreConfirmed
|
|
496
496
|
});
|
|
497
497
|
}
|
|
@@ -595,7 +595,7 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
595
595
|
quickTree.sortByLabel = false;
|
|
596
596
|
if (currentScope !== 'session') {
|
|
597
597
|
const scopeToggle = disposables.add(( new Toggle({
|
|
598
|
-
title: ( localize(
|
|
598
|
+
title: ( localize(5600, "Configure for this workspace only")),
|
|
599
599
|
icon: Codicon.folder,
|
|
600
600
|
isChecked: currentScope === 'workspace',
|
|
601
601
|
inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),
|
|
@@ -611,12 +611,12 @@ let LanguageModelToolsConfirmationService = class LanguageModelToolsConfirmation
|
|
|
611
611
|
}
|
|
612
612
|
const updatePlaceholder = () => {
|
|
613
613
|
if (currentScope === 'session') {
|
|
614
|
-
quickTree.placeholder = ( localize(
|
|
614
|
+
quickTree.placeholder = ( localize(5601, "Configure session tool approvals"));
|
|
615
615
|
}
|
|
616
616
|
else {
|
|
617
617
|
quickTree.placeholder = currentScope === 'workspace'
|
|
618
|
-
? ( localize(
|
|
619
|
-
: ( localize(
|
|
618
|
+
? ( localize(5602, "Configure workspace tool approvals"))
|
|
619
|
+
: ( localize(5603, "Configure global tool approvals"));
|
|
620
620
|
}
|
|
621
621
|
};
|
|
622
622
|
updatePlaceholder();
|
|
@@ -64,6 +64,8 @@ export declare class LanguageModelToolsService extends Disposable implements ILa
|
|
|
64
64
|
private ensureToolDetails;
|
|
65
65
|
private formatToolInput;
|
|
66
66
|
private toolResultToIO;
|
|
67
|
+
private getEligbleForAutoApprovalSpecialCase;
|
|
68
|
+
private isToolEligibleForAutoApproval;
|
|
67
69
|
private shouldAutoConfirm;
|
|
68
70
|
private shouldAutoConfirmPostExecution;
|
|
69
71
|
private _checkGlobalAutoApprove;
|
|
@@ -9,7 +9,7 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
|
|
|
9
9
|
import { toErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errorMessage';
|
|
10
10
|
import { CancellationError, isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
11
11
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
12
|
-
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
12
|
+
import { MarkdownString, markdownCommandLink } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
13
13
|
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
14
14
|
import { Disposable, DisposableStore, toDisposable, combinedDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
15
15
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
@@ -49,7 +49,7 @@ var AutoApproveStorageKeys;
|
|
|
49
49
|
})(AutoApproveStorageKeys || (AutoApproveStorageKeys = {}));
|
|
50
50
|
const SkipAutoApproveConfirmationKey = 'vscode.chat.tools.global.autoApprove.testMode';
|
|
51
51
|
const globalAutoApproveDescription = ( localize2(
|
|
52
|
-
|
|
52
|
+
5604,
|
|
53
53
|
'Global auto approve also known as "YOLO mode" disables manual approval completely for _all tools in all workspaces_, allowing the agent to act fully autonomously. This is extremely dangerous and is *never* recommended, even containerized environments like [Codespaces](https://github.com/features/codespaces) and [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) have user keys forwarded into the container that could be compromised.\n\n**This feature disables [critical security protections](https://code.visualstudio.com/docs/copilot/security) and makes it much easier for an attacker to compromise the machine.**'
|
|
54
54
|
));
|
|
55
55
|
let LanguageModelToolsService = class LanguageModelToolsService extends Disposable {
|
|
@@ -372,9 +372,36 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
372
372
|
}
|
|
373
373
|
prepared = await preparePromise;
|
|
374
374
|
}
|
|
375
|
+
const isEligibleForAutoApproval = this.isToolEligibleForAutoApproval(tool.data);
|
|
376
|
+
if (!isEligibleForAutoApproval && !prepared?.confirmationMessages?.title) {
|
|
377
|
+
if (!prepared) {
|
|
378
|
+
prepared = {};
|
|
379
|
+
}
|
|
380
|
+
const toolReferenceName = getToolReferenceName(tool.data);
|
|
381
|
+
prepared.confirmationMessages = {
|
|
382
|
+
...prepared.confirmationMessages,
|
|
383
|
+
title: ( localize(5605, 'Allow tool to execute?')),
|
|
384
|
+
message: ( localize(5606, 'Run the \'{0}\' tool?', toolReferenceName)),
|
|
385
|
+
disclaimer: ( new MarkdownString(( localize(
|
|
386
|
+
5607,
|
|
387
|
+
'Auto approval for \'{0}\' is restricted via {1}.',
|
|
388
|
+
getToolReferenceName(tool.data),
|
|
389
|
+
markdownCommandLink({ title: '`' + ChatConfiguration.EligibleForAutoApproval + '`', id: 'workbench.action.openSettings', arguments: [ChatConfiguration.EligibleForAutoApproval] }, false)
|
|
390
|
+
)), { isTrusted: true })),
|
|
391
|
+
allowAutoConfirm: false,
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
if (!isEligibleForAutoApproval && prepared?.confirmationMessages?.title) {
|
|
395
|
+
prepared.confirmationMessages.disclaimer = ( new MarkdownString(( localize(
|
|
396
|
+
5607,
|
|
397
|
+
'Auto approval for \'{0}\' is restricted via {1}.',
|
|
398
|
+
getToolReferenceName(tool.data),
|
|
399
|
+
markdownCommandLink({ title: '`' + ChatConfiguration.EligibleForAutoApproval + '`', id: 'workbench.action.openSettings', arguments: [ChatConfiguration.EligibleForAutoApproval] }, false)
|
|
400
|
+
)), { isTrusted: true }));
|
|
401
|
+
}
|
|
375
402
|
if (prepared?.confirmationMessages?.title) {
|
|
376
|
-
if (prepared.toolSpecificData?.kind !== 'terminal' &&
|
|
377
|
-
prepared.confirmationMessages.allowAutoConfirm =
|
|
403
|
+
if (prepared.toolSpecificData?.kind !== 'terminal' && prepared.confirmationMessages.allowAutoConfirm !== false) {
|
|
404
|
+
prepared.confirmationMessages.allowAutoConfirm = isEligibleForAutoApproval;
|
|
378
405
|
}
|
|
379
406
|
if (!prepared.toolSpecificData && tool.data.alwaysDisplayInputOutput) {
|
|
380
407
|
prepared.toolSpecificData = {
|
|
@@ -427,7 +454,30 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
427
454
|
}
|
|
428
455
|
}));
|
|
429
456
|
}
|
|
457
|
+
getEligbleForAutoApprovalSpecialCase(toolData) {
|
|
458
|
+
if (toolData.id === 'vscode_fetchWebPage_internal') {
|
|
459
|
+
return 'fetch';
|
|
460
|
+
}
|
|
461
|
+
return undefined;
|
|
462
|
+
}
|
|
463
|
+
isToolEligibleForAutoApproval(toolData) {
|
|
464
|
+
const toolReferenceName = this.getEligbleForAutoApprovalSpecialCase(toolData) ?? getToolReferenceName(toolData);
|
|
465
|
+
if (toolData.id === 'copilot_fetchWebPage') {
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
const eligibilityConfig = this._configurationService.getValue(ChatConfiguration.EligibleForAutoApproval);
|
|
469
|
+
return eligibilityConfig && typeof eligibilityConfig === 'object' && toolReferenceName
|
|
470
|
+
? (eligibilityConfig[toolReferenceName] ?? true)
|
|
471
|
+
: true;
|
|
472
|
+
}
|
|
430
473
|
async shouldAutoConfirm(toolId, runsInWorkspace, source, parameters) {
|
|
474
|
+
const tool = this._tools.get(toolId);
|
|
475
|
+
if (!tool) {
|
|
476
|
+
return undefined;
|
|
477
|
+
}
|
|
478
|
+
if (!this.isToolEligibleForAutoApproval(tool.data)) {
|
|
479
|
+
return undefined;
|
|
480
|
+
}
|
|
431
481
|
const reason = this._confirmationService.getPreConfirmAction({ toolId, source, parameters });
|
|
432
482
|
if (reason) {
|
|
433
483
|
return reason;
|
|
@@ -464,14 +514,14 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
464
514
|
}
|
|
465
515
|
const promptResult = await this._dialogService.prompt({
|
|
466
516
|
type: Severity.Warning,
|
|
467
|
-
message: ( localize(
|
|
517
|
+
message: ( localize(5608, 'Enable global auto approve?')),
|
|
468
518
|
buttons: [
|
|
469
519
|
{
|
|
470
|
-
label: ( localize(
|
|
520
|
+
label: ( localize(5609, 'Enable')),
|
|
471
521
|
run: () => true
|
|
472
522
|
},
|
|
473
523
|
{
|
|
474
|
-
label: ( localize(
|
|
524
|
+
label: ( localize(5610, 'Disable')),
|
|
475
525
|
run: () => false
|
|
476
526
|
},
|
|
477
527
|
],
|
|
@@ -17,7 +17,7 @@ class ConfigAgentActionImpl extends Action2 {
|
|
|
17
17
|
const openerService = accessor.get(IOpenerService);
|
|
18
18
|
const pickers = instaService.createInstance(PromptFilePickers);
|
|
19
19
|
const placeholder = ( localize(
|
|
20
|
-
|
|
20
|
+
5628,
|
|
21
21
|
"Select the custom agents to open and configure visibility in the agent picker"
|
|
22
22
|
));
|
|
23
23
|
const result = await pickers.selectPromptFile({ placeholder, type: PromptsType.agent, optionEdit: false, optionVisibility: true });
|
|
@@ -31,7 +31,7 @@ class PickerConfigAgentAction extends ConfigAgentActionImpl {
|
|
|
31
31
|
constructor() {
|
|
32
32
|
super({
|
|
33
33
|
id: PICKER_CONFIGURE_AGENTS_ACTION_ID,
|
|
34
|
-
title: ( localize2(
|
|
34
|
+
title: ( localize2(5629, "Configure Custom Agents...")),
|
|
35
35
|
category: CHAT_CATEGORY,
|
|
36
36
|
f1: false,
|
|
37
37
|
menu: {
|
|
@@ -45,8 +45,8 @@ class ManageAgentsAction extends ConfigAgentActionImpl {
|
|
|
45
45
|
constructor() {
|
|
46
46
|
super({
|
|
47
47
|
id: CONFIGURE_AGENTS_ACTION_ID,
|
|
48
|
-
title: ( localize2(
|
|
49
|
-
shortTitle: ( localize(
|
|
48
|
+
title: ( localize2(5630, "Configure Custom Agents...")),
|
|
49
|
+
shortTitle: ( localize(5631, "Custom Agents")),
|
|
50
50
|
icon: Codicon.bookmark,
|
|
51
51
|
f1: true,
|
|
52
52
|
precondition: ChatContextKeys.enabled,
|
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js
CHANGED
|
@@ -27,11 +27,11 @@ let PromptCodingAgentActionOverlayWidget = class PromptCodingAgentActionOverlayW
|
|
|
27
27
|
this._domNode = $('.prompt-coding-agent-action-overlay');
|
|
28
28
|
this._button = this._register(( new Button(this._domNode, {
|
|
29
29
|
supportIcons: true,
|
|
30
|
-
title: ( localize(
|
|
30
|
+
title: ( localize(5686, "Run prompt file in a remote coding agent"))
|
|
31
31
|
})));
|
|
32
32
|
this._button.element.style.background = 'var(--vscode-button-background)';
|
|
33
33
|
this._button.element.style.color = 'var(--vscode-button-foreground)';
|
|
34
|
-
this._button.label = ( localize(
|
|
34
|
+
this._button.label = ( localize(5687, "{0} Delegate to Copilot coding agent", '$(cloud-upload)'));
|
|
35
35
|
this._register(this._button.onDidClick(async () => {
|
|
36
36
|
await this._execute();
|
|
37
37
|
}));
|
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js
CHANGED
|
@@ -56,7 +56,7 @@ let PromptToolsCodeLensProvider = class PromptToolsCodeLensProvider extends Disp
|
|
|
56
56
|
const codeLens = {
|
|
57
57
|
range: toolsAttr.range.collapseToStart(),
|
|
58
58
|
command: {
|
|
59
|
-
title: ( localize(
|
|
59
|
+
title: ( localize(5688, "Configure Tools...")),
|
|
60
60
|
id: this.cmdId,
|
|
61
61
|
arguments: [model, toolsAttr.value.range, selectedTools, header.target]
|
|
62
62
|
}
|
|
@@ -65,7 +65,7 @@ let PromptToolsCodeLensProvider = class PromptToolsCodeLensProvider extends Disp
|
|
|
65
65
|
}
|
|
66
66
|
async updateTools(model, range, selectedTools, target) {
|
|
67
67
|
const selectedToolsNow = () => this.languageModelToolsService.toToolAndToolSetEnablementMap(selectedTools, target);
|
|
68
|
-
const newSelectedAfter = await this.instantiationService.invokeFunction(showToolsPicker, ( localize(
|
|
68
|
+
const newSelectedAfter = await this.instantiationService.invokeFunction(showToolsPicker, ( localize(5689, "Select tools")), undefined, selectedToolsNow);
|
|
69
69
|
if (!newSelectedAfter) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
@@ -70,7 +70,7 @@ let PromptUrlHandler = class PromptUrlHandler extends Disposable {
|
|
|
70
70
|
const result = await this.requestService.request({ type: 'GET', url: urlString }, CancellationToken.None);
|
|
71
71
|
if (result.res.statusCode !== 200) {
|
|
72
72
|
this.logService.error(`[PromptUrlHandler] Failed to fetch URL: ${urlString}`);
|
|
73
|
-
this.notificationService.error(( localize(
|
|
73
|
+
this.notificationService.error(( localize(5690, 'Failed to fetch URL: {0}', urlString)));
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
76
76
|
const responseData = ( (await streamToBuffer(result.stream)).toString());
|
|
@@ -99,36 +99,36 @@ let PromptUrlHandler = class PromptUrlHandler extends Disposable {
|
|
|
99
99
|
uriLabel = `${uriLabel.substring(0, 35)}...${uriLabel.substring(uriLabel.length - 15)}`;
|
|
100
100
|
}
|
|
101
101
|
const detail = ( new MarkdownString('', { supportHtml: true }));
|
|
102
|
-
detail.appendMarkdown(( localize(
|
|
102
|
+
detail.appendMarkdown(( localize(5691, "This will access {0}.\n\n", `[${uriLabel}](${( url.toString())})`)));
|
|
103
103
|
detail.appendMarkdown(( localize(
|
|
104
|
-
|
|
104
|
+
5692,
|
|
105
105
|
"If you did not initiate this request, it may represent an attempted attack on your system. Unless you took an explicit action to initiate this request, you should press 'No'"
|
|
106
106
|
)));
|
|
107
107
|
let message;
|
|
108
108
|
switch (promptType) {
|
|
109
109
|
case PromptsType.prompt:
|
|
110
110
|
message = ( localize(
|
|
111
|
-
|
|
111
|
+
5693,
|
|
112
112
|
"An external application wants to create a prompt file with content from a URL. Do you want to continue by selecting a destination folder and name?"
|
|
113
113
|
));
|
|
114
114
|
break;
|
|
115
115
|
case PromptsType.instructions:
|
|
116
116
|
message = ( localize(
|
|
117
|
-
|
|
117
|
+
5694,
|
|
118
118
|
"An external application wants to create an instructions file with content from a URL. Do you want to continue by selecting a destination folder and name?"
|
|
119
119
|
));
|
|
120
120
|
break;
|
|
121
121
|
default:
|
|
122
122
|
message = ( localize(
|
|
123
|
-
|
|
123
|
+
5695,
|
|
124
124
|
"An external application wants to create a custom agent with content from a URL. Do you want to continue by selecting a destination folder and name?"
|
|
125
125
|
));
|
|
126
126
|
break;
|
|
127
127
|
}
|
|
128
128
|
const { confirmed } = await this.dialogService.confirm({
|
|
129
129
|
type: 'warning',
|
|
130
|
-
primaryButton: ( localize(
|
|
131
|
-
cancelButton: ( localize(
|
|
130
|
+
primaryButton: ( localize(5696, "&&Yes")),
|
|
131
|
+
cancelButton: ( localize(5697, "No")),
|
|
132
132
|
message,
|
|
133
133
|
custom: {
|
|
134
134
|
markdownDetails: [{
|
|
@@ -71,7 +71,7 @@ class RunPromptBaseAction extends Action2 {
|
|
|
71
71
|
return widget;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
const RUN_CURRENT_PROMPT_ACTION_TITLE = ( localize2(
|
|
74
|
+
const RUN_CURRENT_PROMPT_ACTION_TITLE = ( localize2(5698, "Run Prompt in Current Chat"));
|
|
75
75
|
const RUN_CURRENT_PROMPT_ACTION_ICON = Codicon.playCircle;
|
|
76
76
|
class RunCurrentPromptAction extends RunPromptBaseAction {
|
|
77
77
|
constructor() {
|
|
@@ -90,7 +90,7 @@ class RunSelectedPromptAction extends Action2 {
|
|
|
90
90
|
constructor() {
|
|
91
91
|
super({
|
|
92
92
|
id: RUN_SELECTED_PROMPT_ACTION_ID,
|
|
93
|
-
title: ( localize2(
|
|
93
|
+
title: ( localize2(5699, "Run Prompt...")),
|
|
94
94
|
icon: Codicon.bookmark,
|
|
95
95
|
f1: true,
|
|
96
96
|
precondition: ChatContextKeys.enabled,
|
|
@@ -110,7 +110,7 @@ class RunSelectedPromptAction extends Action2 {
|
|
|
110
110
|
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
111
111
|
const pickers = instaService.createInstance(PromptFilePickers);
|
|
112
112
|
const placeholder = ( localize(
|
|
113
|
-
|
|
113
|
+
5700,
|
|
114
114
|
'Select the prompt file to run (hold {0}-key to use in new chat)',
|
|
115
115
|
UILabelProvider.modifierLabels[OS].ctrlKey
|
|
116
116
|
));
|
|
@@ -134,8 +134,8 @@ class ManagePromptFilesAction extends Action2 {
|
|
|
134
134
|
constructor() {
|
|
135
135
|
super({
|
|
136
136
|
id: CONFIGURE_PROMPTS_ACTION_ID,
|
|
137
|
-
title: ( localize2(
|
|
138
|
-
shortTitle: ( localize2(
|
|
137
|
+
title: ( localize2(5701, "Configure Prompt Files...")),
|
|
138
|
+
shortTitle: ( localize2(5702, "Prompt Files")),
|
|
139
139
|
icon: Codicon.bookmark,
|
|
140
140
|
f1: true,
|
|
141
141
|
precondition: ChatContextKeys.enabled,
|
|
@@ -152,7 +152,7 @@ class ManagePromptFilesAction extends Action2 {
|
|
|
152
152
|
const openerService = accessor.get(IOpenerService);
|
|
153
153
|
const instaService = accessor.get(IInstantiationService);
|
|
154
154
|
const pickers = instaService.createInstance(PromptFilePickers);
|
|
155
|
-
const placeholder = ( localize(
|
|
155
|
+
const placeholder = ( localize(5703, 'Select the prompt file to open'));
|
|
156
156
|
const result = await pickers.selectPromptFile({ placeholder, type: PromptsType.prompt, optionEdit: false });
|
|
157
157
|
if (result !== undefined) {
|
|
158
158
|
await openerService.open(result.promptFile);
|
|
@@ -168,7 +168,7 @@ function getActivePromptFileUri(accessor) {
|
|
|
168
168
|
return undefined;
|
|
169
169
|
}
|
|
170
170
|
const RUN_CURRENT_PROMPT_IN_NEW_CHAT_ACTION_ID = 'workbench.action.chat.run-in-new-chat.prompt.current';
|
|
171
|
-
const RUN_IN_NEW_CHAT_ACTION_TITLE = ( localize2(
|
|
171
|
+
const RUN_IN_NEW_CHAT_ACTION_TITLE = ( localize2(5704, "Run Prompt In New Chat"));
|
|
172
172
|
const RUN_IN_NEW_CHAT_ACTION_ICON = Codicon.play;
|
|
173
173
|
class RunCurrentPromptInNewChatAction extends RunPromptBaseAction {
|
|
174
174
|
constructor() {
|
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js
CHANGED
|
@@ -70,19 +70,19 @@ function createOptions(id, title, description, languageId) {
|
|
|
70
70
|
const SAVE_AS_PROMPT_FILE_ACTION_ID = 'workbench.action.chat.save-as-prompt';
|
|
71
71
|
class SaveAsPromptFileAction extends BaseSaveAsPromptFileAction {
|
|
72
72
|
constructor() {
|
|
73
|
-
super(createOptions(SAVE_AS_PROMPT_FILE_ACTION_ID, ( localize2(
|
|
73
|
+
super(createOptions(SAVE_AS_PROMPT_FILE_ACTION_ID, ( localize2(5705, "Save As Prompt File")), ( localize2(5706, "Save as prompt file")), PROMPT_LANGUAGE_ID), PromptsType.prompt);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
const SAVE_AS_AGENT_FILE_ACTION_ID = 'workbench.action.chat.save-as-agent';
|
|
77
77
|
class SaveAsAgentFileAction extends BaseSaveAsPromptFileAction {
|
|
78
78
|
constructor() {
|
|
79
|
-
super(createOptions(SAVE_AS_AGENT_FILE_ACTION_ID, ( localize2(
|
|
79
|
+
super(createOptions(SAVE_AS_AGENT_FILE_ACTION_ID, ( localize2(5707, "Save As Agent File")), ( localize2(5708, "Save as agent file")), AGENT_LANGUAGE_ID), PromptsType.agent);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
const SAVE_AS_INSTRUCTIONS_FILE_ACTION_ID = 'workbench.action.chat.save-as-instructions';
|
|
83
83
|
class SaveAsInstructionsFileAction extends BaseSaveAsPromptFileAction {
|
|
84
84
|
constructor() {
|
|
85
|
-
super(createOptions(SAVE_AS_INSTRUCTIONS_FILE_ACTION_ID, ( localize2(
|
|
85
|
+
super(createOptions(SAVE_AS_INSTRUCTIONS_FILE_ACTION_ID, ( localize2(5709, "Save As Instructions File")), ( localize2(5710, "Save as instructions file")), INSTRUCTIONS_LANGUAGE_ID), PromptsType.instructions);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -44,11 +44,11 @@ const toolSetsSchema = {
|
|
|
44
44
|
allowComments: true,
|
|
45
45
|
allowTrailingCommas: true,
|
|
46
46
|
defaultSnippets: [{
|
|
47
|
-
label: ( localize(
|
|
47
|
+
label: ( localize(5711, "Empty tool set")),
|
|
48
48
|
body: { '${1:toolSetName}': { 'tools': ['${2:someTool}', '${3:anotherTool}'], 'description': '${4:description}', 'icon': '${5:tools}' } }
|
|
49
49
|
}],
|
|
50
50
|
type: 'object',
|
|
51
|
-
description: ( localize(
|
|
51
|
+
description: ( localize(5712, 'User tool sets configuration')),
|
|
52
52
|
additionalProperties: {
|
|
53
53
|
type: 'object',
|
|
54
54
|
required: ['tools'],
|
|
@@ -56,7 +56,7 @@ const toolSetsSchema = {
|
|
|
56
56
|
properties: {
|
|
57
57
|
tools: {
|
|
58
58
|
description: ( localize(
|
|
59
|
-
|
|
59
|
+
5713,
|
|
60
60
|
"A list of tools or tool sets to include in this tool set. Cannot be empty and must reference tools the way they are referenced in prompts."
|
|
61
61
|
)),
|
|
62
62
|
type: 'array',
|
|
@@ -69,7 +69,7 @@ const toolSetsSchema = {
|
|
|
69
69
|
},
|
|
70
70
|
icon: {
|
|
71
71
|
description: ( localize(
|
|
72
|
-
|
|
72
|
+
5714,
|
|
73
73
|
'Icon to use for this tool set in the UI. Uses the "\\$(name)"-syntax, like "\\$(zap)"'
|
|
74
74
|
)),
|
|
75
75
|
type: 'string',
|
|
@@ -77,7 +77,7 @@ const toolSetsSchema = {
|
|
|
77
77
|
markdownEnumDescriptions: Array.from(getAllCodicons(), icon => `$(${icon.id})`),
|
|
78
78
|
},
|
|
79
79
|
description: {
|
|
80
|
-
description: ( localize(
|
|
80
|
+
description: ( localize(5715, "A short description of this tool set.")),
|
|
81
81
|
type: 'string'
|
|
82
82
|
},
|
|
83
83
|
},
|
|
@@ -164,7 +164,7 @@ let UserToolSetsContributions = class UserToolSetsContributions extends Disposab
|
|
|
164
164
|
});
|
|
165
165
|
for (const item of data) {
|
|
166
166
|
toolEnumValues.push(item.name);
|
|
167
|
-
toolEnumDescriptions.push(( localize(
|
|
167
|
+
toolEnumDescriptions.push(( localize(5716, "{1} ({0})\n\n{2}", item.sourceLabel, item.name, item.description)));
|
|
168
168
|
}
|
|
169
169
|
store.clear();
|
|
170
170
|
reg.registerSchema(toolSetSchemaId, toolSetsSchema, store);
|
|
@@ -257,8 +257,8 @@ class ConfigureToolSets extends Action2 {
|
|
|
257
257
|
constructor() {
|
|
258
258
|
super({
|
|
259
259
|
id: ConfigureToolSets.ID,
|
|
260
|
-
title: ( localize2(
|
|
261
|
-
shortTitle: ( localize(
|
|
260
|
+
title: ( localize2(5717, 'Configure Tool Sets...')),
|
|
261
|
+
shortTitle: ( localize(5718, "Tool Sets")),
|
|
262
262
|
category: CHAT_CATEGORY,
|
|
263
263
|
f1: true,
|
|
264
264
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ChatContextKeys.Tools.toolsCount.greater(0))),
|
|
@@ -279,7 +279,7 @@ class ConfigureToolSets extends Action2 {
|
|
|
279
279
|
const textFileService = accessor.get(ITextFileService);
|
|
280
280
|
const picks = [];
|
|
281
281
|
picks.push({
|
|
282
|
-
label: ( localize(
|
|
282
|
+
label: ( localize(5719, 'Create new tool sets file...')),
|
|
283
283
|
alwaysShow: true,
|
|
284
284
|
iconClass: ThemeIcon.asClassName(Codicon.plus)
|
|
285
285
|
});
|
|
@@ -296,7 +296,7 @@ class ConfigureToolSets extends Action2 {
|
|
|
296
296
|
}
|
|
297
297
|
const pick = await quickInputService.pick(picks, {
|
|
298
298
|
canPickMany: false,
|
|
299
|
-
placeHolder: ( localize(
|
|
299
|
+
placeHolder: ( localize(5720, 'Select a tool set to configure')),
|
|
300
300
|
});
|
|
301
301
|
if (!pick) {
|
|
302
302
|
return;
|
|
@@ -304,13 +304,13 @@ class ConfigureToolSets extends Action2 {
|
|
|
304
304
|
let resource;
|
|
305
305
|
if (!pick.toolset) {
|
|
306
306
|
const name = await quickInputService.input({
|
|
307
|
-
placeHolder: ( localize(
|
|
307
|
+
placeHolder: ( localize(5721, "Type tool sets file name")),
|
|
308
308
|
validateInput: async (input) => {
|
|
309
309
|
if (!input) {
|
|
310
|
-
return localize(
|
|
310
|
+
return localize(5722, "Invalid file name");
|
|
311
311
|
}
|
|
312
312
|
if (!isValidBasename(input)) {
|
|
313
|
-
return localize(
|
|
313
|
+
return localize(5723, "'{0}' is not a valid file name", input);
|
|
314
314
|
}
|
|
315
315
|
return undefined;
|
|
316
316
|
}
|
package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js
CHANGED
|
@@ -17,29 +17,29 @@ const chatViewsWelcomeJsonSchema = {
|
|
|
17
17
|
properties: {
|
|
18
18
|
icon: {
|
|
19
19
|
type: 'string',
|
|
20
|
-
description: ( localize(
|
|
20
|
+
description: ( localize(5729, 'The icon for the welcome message.')),
|
|
21
21
|
},
|
|
22
22
|
title: {
|
|
23
23
|
type: 'string',
|
|
24
|
-
description: ( localize(
|
|
24
|
+
description: ( localize(5730, 'The title of the welcome message.')),
|
|
25
25
|
},
|
|
26
26
|
content: {
|
|
27
27
|
type: 'string',
|
|
28
28
|
description: ( localize(
|
|
29
|
-
|
|
29
|
+
5731,
|
|
30
30
|
'The content of the welcome message. The first command link will be rendered as a button.'
|
|
31
31
|
)),
|
|
32
32
|
},
|
|
33
33
|
when: {
|
|
34
34
|
type: 'string',
|
|
35
|
-
description: ( localize(
|
|
35
|
+
description: ( localize(5732, 'Condition when the welcome message is shown.')),
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
const chatViewsWelcomeExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
40
40
|
extensionPoint: 'chatViewsWelcome',
|
|
41
41
|
jsonSchema: {
|
|
42
|
-
description: ( localize(
|
|
42
|
+
description: ( localize(5733, 'Contributes a welcome message to a chat view')),
|
|
43
43
|
type: 'array',
|
|
44
44
|
items: chatViewsWelcomeJsonSchema,
|
|
45
45
|
},
|
|
@@ -14,7 +14,7 @@ class ChatToolInvocation {
|
|
|
14
14
|
this.toolCallId = toolCallId;
|
|
15
15
|
this.kind = 'toolInvocation';
|
|
16
16
|
this._progress = observableValue(this, { progress: 0 });
|
|
17
|
-
const defaultMessage = ( localize(
|
|
17
|
+
const defaultMessage = ( localize(5806, "Using {0}", `"${toolData.displayName}"`));
|
|
18
18
|
const invocationMessage = preparedInvocation?.invocationMessage ?? defaultMessage;
|
|
19
19
|
this.invocationMessage = invocationMessage;
|
|
20
20
|
this.pastTenseMessage = preparedInvocation?.pastTenseMessage;
|