@codingame/monaco-vscode-chat-service-override 23.1.0 → 23.2.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/index.js +1 -1
- package/package.json +41 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +48 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +101 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +3 -3
- 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 +18 -18
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- 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 +8 -8
- 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/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.js +8 -8
- 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 +21 -21
- 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 +4 -4
- 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
|
@@ -27,8 +27,8 @@ import { activeChatController } from './terminalChatControllerHolder.js';
|
|
|
27
27
|
|
|
28
28
|
registerActiveXtermAction({
|
|
29
29
|
id: TerminalChatCommandId.Start,
|
|
30
|
-
title: ( localize2(
|
|
31
|
-
category: ( localize2(
|
|
30
|
+
title: ( localize2(11830, 'Open Inline Chat')),
|
|
31
|
+
category: ( localize2(11831, "Terminal")),
|
|
32
32
|
keybinding: {
|
|
33
33
|
primary: KeyMod.CtrlCmd | KeyCode.KeyI,
|
|
34
34
|
when: ( ContextKeyExpr.and(TerminalContextKeys.focusInAny)),
|
|
@@ -64,7 +64,7 @@ registerActiveXtermAction({
|
|
|
64
64
|
});
|
|
65
65
|
registerActiveXtermAction({
|
|
66
66
|
id: TerminalChatCommandId.Close,
|
|
67
|
-
title: ( localize2(
|
|
67
|
+
title: ( localize2(11832, 'Close')),
|
|
68
68
|
category: AbstractInline1ChatAction.category,
|
|
69
69
|
keybinding: {
|
|
70
70
|
primary: KeyCode.Escape,
|
|
@@ -89,8 +89,8 @@ registerActiveXtermAction({
|
|
|
89
89
|
});
|
|
90
90
|
registerActiveXtermAction({
|
|
91
91
|
id: TerminalChatCommandId.RunCommand,
|
|
92
|
-
title: ( localize2(
|
|
93
|
-
shortTitle: ( localize2(
|
|
92
|
+
title: ( localize2(11833, 'Run Chat Command')),
|
|
93
|
+
shortTitle: ( localize2(11834, 'Run')),
|
|
94
94
|
category: AbstractInline1ChatAction.category,
|
|
95
95
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
96
96
|
TerminalContextKeys.processSupported,
|
|
@@ -118,8 +118,8 @@ registerActiveXtermAction({
|
|
|
118
118
|
});
|
|
119
119
|
registerActiveXtermAction({
|
|
120
120
|
id: TerminalChatCommandId.RunFirstCommand,
|
|
121
|
-
title: ( localize2(
|
|
122
|
-
shortTitle: ( localize2(
|
|
121
|
+
title: ( localize2(11835, 'Run First Chat Command')),
|
|
122
|
+
shortTitle: ( localize2(11836, 'Run First')),
|
|
123
123
|
category: AbstractInline1ChatAction.category,
|
|
124
124
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
125
125
|
TerminalContextKeys.processSupported,
|
|
@@ -147,8 +147,8 @@ registerActiveXtermAction({
|
|
|
147
147
|
});
|
|
148
148
|
registerActiveXtermAction({
|
|
149
149
|
id: TerminalChatCommandId.InsertCommand,
|
|
150
|
-
title: ( localize2(
|
|
151
|
-
shortTitle: ( localize2(
|
|
150
|
+
title: ( localize2(11837, 'Insert Chat Command')),
|
|
151
|
+
shortTitle: ( localize2(11838, 'Insert')),
|
|
152
152
|
category: AbstractInline1ChatAction.category,
|
|
153
153
|
icon: Codicon.insert,
|
|
154
154
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
@@ -177,8 +177,8 @@ registerActiveXtermAction({
|
|
|
177
177
|
});
|
|
178
178
|
registerActiveXtermAction({
|
|
179
179
|
id: TerminalChatCommandId.InsertFirstCommand,
|
|
180
|
-
title: ( localize2(
|
|
181
|
-
shortTitle: ( localize2(
|
|
180
|
+
title: ( localize2(11839, 'Insert First Chat Command')),
|
|
181
|
+
shortTitle: ( localize2(11840, 'Insert First')),
|
|
182
182
|
category: AbstractInline1ChatAction.category,
|
|
183
183
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
184
184
|
TerminalContextKeys.processSupported,
|
|
@@ -206,7 +206,7 @@ registerActiveXtermAction({
|
|
|
206
206
|
});
|
|
207
207
|
registerActiveXtermAction({
|
|
208
208
|
id: TerminalChatCommandId.RerunRequest,
|
|
209
|
-
title: ( localize2(
|
|
209
|
+
title: ( localize2(11841, "Rerun Request")),
|
|
210
210
|
f1: false,
|
|
211
211
|
icon: Codicon.refresh,
|
|
212
212
|
category: AbstractInline1ChatAction.category,
|
|
@@ -247,7 +247,7 @@ registerActiveXtermAction({
|
|
|
247
247
|
});
|
|
248
248
|
registerActiveXtermAction({
|
|
249
249
|
id: TerminalChatCommandId.ViewInChat,
|
|
250
|
-
title: ( localize2(
|
|
250
|
+
title: ( localize2(11842, 'View in Chat')),
|
|
251
251
|
category: AbstractInline1ChatAction.category,
|
|
252
252
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
253
253
|
TerminalContextKeys.processSupported,
|
|
@@ -273,8 +273,8 @@ registerAction2(class ShowChatTerminalsAction extends Action2 {
|
|
|
273
273
|
constructor() {
|
|
274
274
|
super({
|
|
275
275
|
id: TerminalChatCommandId.ViewHiddenChatTerminals,
|
|
276
|
-
title: ( localize2(
|
|
277
|
-
category: ( localize2(
|
|
276
|
+
title: ( localize2(11843, 'View Hidden Chat Terminals')),
|
|
277
|
+
category: ( localize2(11844, 'Terminal')),
|
|
278
278
|
f1: true,
|
|
279
279
|
precondition: ( ContextKeyExpr.and(TerminalChatContextKeys.hasHiddenChatTerminals, ChatContextKeys.enabled)),
|
|
280
280
|
menu: [{
|
|
@@ -306,7 +306,7 @@ registerAction2(class ShowChatTerminalsAction extends Action2 {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
const items = [];
|
|
309
|
-
const lastCommandLocalized = (command) => ( localize2(
|
|
309
|
+
const lastCommandLocalized = (command) => ( localize2(11845, 'Last: {0}', command)).value;
|
|
310
310
|
const metas = [];
|
|
311
311
|
for (const instance of ( all.values())) {
|
|
312
312
|
const iconId = instantiationService.invokeFunction(getIconId, instance);
|
|
@@ -338,10 +338,10 @@ registerAction2(class ShowChatTerminalsAction extends Action2 {
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
const qp = quickInputService.createQuickPick();
|
|
341
|
-
qp.placeholder = ( localize2(
|
|
341
|
+
qp.placeholder = ( localize2(11846, 'Select a chat terminal to show and focus')).value;
|
|
342
342
|
qp.items = items;
|
|
343
343
|
qp.canSelectMany = false;
|
|
344
|
-
qp.title = ( localize2(
|
|
344
|
+
qp.title = ( localize2(11847, 'Chat Terminals')).value;
|
|
345
345
|
qp.matchOnDescription = true;
|
|
346
346
|
qp.matchOnDetail = true;
|
|
347
347
|
qp.onDidAccept(async () => {
|
|
@@ -167,7 +167,7 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
167
167
|
}
|
|
168
168
|
_resetPlaceholder() {
|
|
169
169
|
const defaultAgent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Terminal);
|
|
170
|
-
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(
|
|
170
|
+
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(11848, 'Ask about commands'));
|
|
171
171
|
}
|
|
172
172
|
async reveal(viewState) {
|
|
173
173
|
await this._createSession(viewState);
|
|
@@ -72,11 +72,11 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
72
72
|
if (subCommandsToSuggest.length > 0) {
|
|
73
73
|
let subCommandLabel;
|
|
74
74
|
if (subCommandsToSuggest.length === 1) {
|
|
75
|
-
subCommandLabel = ( localize(
|
|
75
|
+
subCommandLabel = ( localize(11850, 'Always Allow Command: {0}', subCommandsToSuggest[0]));
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
78
|
const commandSeparated = subCommandsToSuggest.join(', ');
|
|
79
|
-
subCommandLabel = ( localize(
|
|
79
|
+
subCommandLabel = ( localize(11851, 'Always Allow Commands: {0}', commandSeparated));
|
|
80
80
|
}
|
|
81
81
|
actions.push({
|
|
82
82
|
label: subCommandLabel,
|
|
@@ -94,7 +94,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
94
94
|
!( commandsWithSubcommands.has(commandLine)) &&
|
|
95
95
|
!( commandsWithSubSubCommands.has(commandLine))) {
|
|
96
96
|
actions.push({
|
|
97
|
-
label: ( localize(
|
|
97
|
+
label: ( localize(11852, 'Always Allow Exact Command Line')),
|
|
98
98
|
data: {
|
|
99
99
|
type: 'newRule',
|
|
100
100
|
rule: {
|
|
@@ -112,7 +112,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
112
112
|
actions.push(( new Separator()));
|
|
113
113
|
}
|
|
114
114
|
actions.push({
|
|
115
|
-
label: ( localize(
|
|
115
|
+
label: ( localize(11853, 'Configure Auto Approve...')),
|
|
116
116
|
data: {
|
|
117
117
|
type: 'configure'
|
|
118
118
|
}
|
|
@@ -60,7 +60,7 @@ let ChatAgentToolsContribution = class ChatAgentToolsContribution extends Dispos
|
|
|
60
60
|
this._register(toolsService.registerTool(GetTerminalOutputToolData, getTerminalOutputTool));
|
|
61
61
|
const runCommandsToolSet = this._register(toolsService.createToolSet(ToolDataSource.Internal, 'runCommands', VSCodeToolReference.runCommands, {
|
|
62
62
|
icon: ThemeIcon.fromId(Codicon.terminal.id),
|
|
63
|
-
description: ( localize(
|
|
63
|
+
description: ( localize(11854, 'Runs commands in the terminal'))
|
|
64
64
|
}));
|
|
65
65
|
runCommandsToolSet.addTool(GetTerminalOutputToolData);
|
|
66
66
|
instantiationService.invokeFunction(createRunInTerminalToolData).then(runInTerminalToolData => {
|
|
@@ -81,7 +81,7 @@ let ChatAgentToolsContribution = class ChatAgentToolsContribution extends Dispos
|
|
|
81
81
|
const createAndRunTaskTool = instantiationService.createInstance(CreateAndRunTaskTool);
|
|
82
82
|
this._register(toolsService.registerTool(CreateAndRunTaskToolData, createAndRunTaskTool));
|
|
83
83
|
const runTasksToolSet = this._register(toolsService.createToolSet(ToolDataSource.Internal, 'runTasks', 'runTasks', {
|
|
84
|
-
description: ( localize(
|
|
84
|
+
description: ( localize(11855, 'Runs tasks and gets their output for your workspace')),
|
|
85
85
|
}));
|
|
86
86
|
runTasksToolSet.addTool(RunTaskToolData);
|
|
87
87
|
runTasksToolSet.addTool(GetTaskOutputToolData);
|
|
@@ -95,7 +95,7 @@ ChatAgentToolsContribution = ( __decorate([
|
|
|
95
95
|
registerWorkbenchContribution2(ChatAgentToolsContribution.ID, ChatAgentToolsContribution, WorkbenchPhase.AfterRestored);
|
|
96
96
|
registerActiveInstanceAction({
|
|
97
97
|
id: TerminalChatAgentToolsCommandId.ChatAddTerminalSelection,
|
|
98
|
-
title: ( localize(
|
|
98
|
+
title: ( localize(11856, 'Add Terminal Selection to Chat')),
|
|
99
99
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, sharedWhenClause.terminalAvailable)),
|
|
100
100
|
menu: [
|
|
101
101
|
{
|
|
@@ -120,8 +120,8 @@ registerActiveInstanceAction({
|
|
|
120
120
|
chatView.attachmentModel.addContext({
|
|
121
121
|
id: `terminal-selection-${Date.now()}`,
|
|
122
122
|
kind: 'generic',
|
|
123
|
-
name: ( localize(
|
|
124
|
-
fullName: ( localize(
|
|
123
|
+
name: ( localize(11857, 'Terminal Selection')),
|
|
124
|
+
fullName: ( localize(11857, 'Terminal Selection')),
|
|
125
125
|
value: selection,
|
|
126
126
|
icon: Codicon.terminal
|
|
127
127
|
});
|
|
@@ -122,7 +122,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
122
122
|
if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) ||
|
|
123
123
|
(isPowerShell(options.shell, options.os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
|
|
124
124
|
disclaimers.push(( localize(
|
|
125
|
-
|
|
125
|
+
11858,
|
|
126
126
|
'Web content may contain malicious code or attempt prompt injection attacks.'
|
|
127
127
|
)));
|
|
128
128
|
}
|
|
@@ -140,7 +140,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
140
140
|
const formatRuleLinks = (result) => {
|
|
141
141
|
return ( asArray(result).map(e => {
|
|
142
142
|
const settingsUri = createCommandUri(openTerminalSettingsLinkCommandId, e.rule.sourceTarget);
|
|
143
|
-
return `[\`${e.rule.sourceText}\`](${( settingsUri.toString())} "${( localize(
|
|
143
|
+
return `[\`${e.rule.sourceText}\`](${( settingsUri.toString())} "${( localize(11859, 'View rule in settings'))}")`;
|
|
144
144
|
})).join(', ');
|
|
145
145
|
};
|
|
146
146
|
const mdTrustSettings = {
|
|
@@ -153,9 +153,9 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
153
153
|
if (isGlobalAutoApproved) {
|
|
154
154
|
const settingsUri = createCommandUri(openTerminalSettingsLinkCommandId, 'global');
|
|
155
155
|
return (new MarkdownString(`${( localize(
|
|
156
|
-
|
|
156
|
+
11860,
|
|
157
157
|
'Auto approved by setting {0}',
|
|
158
|
-
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(
|
|
158
|
+
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(11861, 'View settings'))}")`
|
|
159
159
|
))}`, mdTrustSettings));
|
|
160
160
|
}
|
|
161
161
|
if (isAutoApproved) {
|
|
@@ -163,7 +163,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
163
163
|
case 'commandLine': {
|
|
164
164
|
if (commandLineResult.rule) {
|
|
165
165
|
return (new MarkdownString(
|
|
166
|
-
localize(
|
|
166
|
+
localize(11862, 'Auto approved by rule {0}', formatRuleLinks(commandLineResult)),
|
|
167
167
|
mdTrustSettings
|
|
168
168
|
));
|
|
169
169
|
}
|
|
@@ -173,13 +173,13 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
173
173
|
const uniqueRules = dedupeRules(subCommandResults);
|
|
174
174
|
if (uniqueRules.length === 1) {
|
|
175
175
|
return (new MarkdownString(
|
|
176
|
-
localize(
|
|
176
|
+
localize(11862, 'Auto approved by rule {0}', formatRuleLinks(uniqueRules)),
|
|
177
177
|
mdTrustSettings
|
|
178
178
|
));
|
|
179
179
|
}
|
|
180
180
|
else if (uniqueRules.length > 1) {
|
|
181
181
|
return (new MarkdownString(
|
|
182
|
-
localize(
|
|
182
|
+
localize(11863, 'Auto approved by rules {0}', formatRuleLinks(uniqueRules)),
|
|
183
183
|
mdTrustSettings
|
|
184
184
|
));
|
|
185
185
|
}
|
|
@@ -192,7 +192,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
192
192
|
case 'commandLine': {
|
|
193
193
|
if (commandLineResult.rule) {
|
|
194
194
|
return (new MarkdownString(localize(
|
|
195
|
-
|
|
195
|
+
11864,
|
|
196
196
|
'Auto approval denied by rule {0}',
|
|
197
197
|
formatRuleLinks(commandLineResult)
|
|
198
198
|
), mdTrustSettings));
|
|
@@ -203,12 +203,12 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
203
203
|
const uniqueRules = dedupeRules(subCommandResults.filter(e => e.result === 'denied'));
|
|
204
204
|
if (uniqueRules.length === 1) {
|
|
205
205
|
return (new MarkdownString(
|
|
206
|
-
localize(
|
|
206
|
+
localize(11864, 'Auto approval denied by rule {0}', formatRuleLinks(uniqueRules))
|
|
207
207
|
));
|
|
208
208
|
}
|
|
209
209
|
else if (uniqueRules.length > 1) {
|
|
210
210
|
return (new MarkdownString(
|
|
211
|
-
localize(
|
|
211
|
+
localize(11865, 'Auto approval denied by rules {0}', formatRuleLinks(uniqueRules))
|
|
212
212
|
));
|
|
213
213
|
}
|
|
214
214
|
break;
|
|
@@ -109,13 +109,13 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
109
109
|
const fileWritesList = ( fileWrites.map(fw => `\`${URI.isUri(fw) ? this._labelService.getUriLabel(fw) : fw}\``)).join(', ');
|
|
110
110
|
if (!isAutoApproveAllowed) {
|
|
111
111
|
disclaimers.push(( localize(
|
|
112
|
-
|
|
112
|
+
11866,
|
|
113
113
|
'File write operations detected that cannot be auto approved: {0}',
|
|
114
114
|
fileWritesList
|
|
115
115
|
)));
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
|
-
disclaimers.push(( localize(
|
|
118
|
+
disclaimers.push(( localize(11867, 'File write operations detected: {0}', fileWritesList)));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
return {
|
|
@@ -10,7 +10,7 @@ import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workben
|
|
|
10
10
|
const GetTerminalLastCommandToolData = {
|
|
11
11
|
id: 'terminal_last_command',
|
|
12
12
|
toolReferenceName: 'terminalLastCommand',
|
|
13
|
-
displayName: ( localize(
|
|
13
|
+
displayName: ( localize(11868, 'Get Terminal Last Command')),
|
|
14
14
|
modelDescription: 'Get the last command run in the active terminal.',
|
|
15
15
|
source: ToolDataSource.Internal,
|
|
16
16
|
icon: Codicon.terminal,
|
|
@@ -22,8 +22,8 @@ let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Dispos
|
|
|
22
22
|
}
|
|
23
23
|
async prepareToolInvocation(context, token) {
|
|
24
24
|
return {
|
|
25
|
-
invocationMessage: ( localize(
|
|
26
|
-
pastTenseMessage: ( localize(
|
|
25
|
+
invocationMessage: ( localize(11869, "Getting last terminal command")),
|
|
26
|
+
pastTenseMessage: ( localize(11870, "Got last terminal command")),
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -8,7 +8,7 @@ import { RunInTerminalTool } from './runInTerminalTool.js';
|
|
|
8
8
|
const GetTerminalOutputToolData = {
|
|
9
9
|
id: 'get_terminal_output',
|
|
10
10
|
toolReferenceName: 'getTerminalOutput',
|
|
11
|
-
displayName: ( localize(
|
|
11
|
+
displayName: ( localize(11871, 'Get Terminal Output')),
|
|
12
12
|
modelDescription: 'Get the output of a terminal command previously started with run_in_terminal',
|
|
13
13
|
icon: Codicon.terminal,
|
|
14
14
|
source: ToolDataSource.Internal,
|
|
@@ -28,8 +28,8 @@ const GetTerminalOutputToolData = {
|
|
|
28
28
|
class GetTerminalOutputTool extends Disposable {
|
|
29
29
|
async prepareToolInvocation(context, token) {
|
|
30
30
|
return {
|
|
31
|
-
invocationMessage: ( localize(
|
|
32
|
-
pastTenseMessage: ( localize(
|
|
31
|
+
invocationMessage: ( localize(11872, "Checking background terminal output")),
|
|
32
|
+
pastTenseMessage: ( localize(11873, "Checked background terminal output")),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -9,7 +9,7 @@ import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workben
|
|
|
9
9
|
const GetTerminalSelectionToolData = {
|
|
10
10
|
id: 'terminal_selection',
|
|
11
11
|
toolReferenceName: 'terminalSelection',
|
|
12
|
-
displayName: ( localize(
|
|
12
|
+
displayName: ( localize(11874, 'Get Terminal Selection')),
|
|
13
13
|
modelDescription: 'Get the current selection in the active terminal.',
|
|
14
14
|
source: ToolDataSource.Internal,
|
|
15
15
|
icon: Codicon.terminal,
|
|
@@ -21,8 +21,8 @@ let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable
|
|
|
21
21
|
}
|
|
22
22
|
async prepareToolInvocation(context, token) {
|
|
23
23
|
return {
|
|
24
|
-
invocationMessage: ( localize(
|
|
25
|
-
pastTenseMessage: ( localize(
|
|
24
|
+
invocationMessage: ( localize(11875, "Reading terminal selection")),
|
|
25
|
+
pastTenseMessage: ( localize(11876, "Read terminal selection")),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -255,10 +255,10 @@ let OutputMonitor = class OutputMonitor extends Disposable {
|
|
|
255
255
|
if (token.isCancellationRequested || this._state === OutputMonitorState.Cancelled) {
|
|
256
256
|
return { promise: Promise.resolve(false) };
|
|
257
257
|
}
|
|
258
|
-
const result = this._createElicitationPart(token, context?.sessionId, ( new MarkdownString(( localize(
|
|
259
|
-
|
|
258
|
+
const result = this._createElicitationPart(token, context?.sessionId, ( new MarkdownString(( localize(11877, "Continue waiting for `{0}`?", command)))), ( new MarkdownString(( localize(
|
|
259
|
+
11878,
|
|
260
260
|
"This will continue to poll for output to determine when the terminal becomes idle for up to 2 minutes."
|
|
261
|
-
)))), '', ( localize(
|
|
261
|
+
)))), '', ( localize(11879, 'Yes')), ( localize(11880, 'No')), async () => true, async () => { this._state = OutputMonitorState.Cancelled; return false; });
|
|
262
262
|
return { promise: result.promise.then(p => p ?? false), part: result.part };
|
|
263
263
|
}
|
|
264
264
|
async _assessOutputForErrors(buffer, token) {
|
|
@@ -406,11 +406,11 @@ let OutputMonitor = class OutputMonitor extends Disposable {
|
|
|
406
406
|
return description ? { suggestedOption: { description, option: validOption }, sentToTerminal } : { suggestedOption: validOption, sentToTerminal };
|
|
407
407
|
}
|
|
408
408
|
async _requestFreeFormTerminalInput(token, execution, confirmationPrompt) {
|
|
409
|
-
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(
|
|
410
|
-
|
|
409
|
+
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(11881, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
|
|
410
|
+
11882,
|
|
411
411
|
"{0}\nPlease provide the required input to the terminal.\n\n",
|
|
412
412
|
confirmationPrompt.prompt
|
|
413
|
-
)))), '', ( localize(
|
|
413
|
+
)))), '', ( localize(11883, 'Focus terminal')), undefined, async () => {
|
|
414
414
|
this._showInstance(execution.instance.instanceId);
|
|
415
415
|
return true;
|
|
416
416
|
});
|
|
@@ -430,13 +430,13 @@ let OutputMonitor = class OutputMonitor extends Disposable {
|
|
|
430
430
|
async _confirmRunInTerminal(token, suggestedOption, execution, confirmationPrompt) {
|
|
431
431
|
const suggestedOptionValue = typeof suggestedOption === 'string' ? suggestedOption : suggestedOption.option;
|
|
432
432
|
let inputDataDisposable = Disposable.None;
|
|
433
|
-
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(
|
|
434
|
-
|
|
433
|
+
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(11884, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
|
|
434
|
+
11885,
|
|
435
435
|
"{0}\n Do you want to send `{1}`{2} followed by `Enter` to the terminal?",
|
|
436
436
|
confirmationPrompt.prompt,
|
|
437
437
|
suggestedOptionValue,
|
|
438
438
|
typeof suggestedOption === 'string' ? '' : suggestedOption.description ? ' (' + suggestedOption.description + ')' : ''
|
|
439
|
-
)))), '', ( localize(
|
|
439
|
+
)))), '', ( localize(11886, 'Allow')), ( localize(11887, 'Focus Terminal')), async (value) => {
|
|
440
440
|
let option = undefined;
|
|
441
441
|
if (value === true) {
|
|
442
442
|
option = suggestedOptionValue;
|
|
@@ -6,7 +6,7 @@ import { RunInTerminalTool } from './runInTerminalTool.js';
|
|
|
6
6
|
|
|
7
7
|
const ConfirmTerminalCommandToolData = {
|
|
8
8
|
id: 'vscode_get_terminal_confirmation',
|
|
9
|
-
displayName: ( localize(
|
|
9
|
+
displayName: ( localize(11888, 'Confirm Terminal Command')),
|
|
10
10
|
modelDescription: [
|
|
11
11
|
'This tool allows you to get explicit user confirmation for a terminal command without executing it.',
|
|
12
12
|
'',
|
|
@@ -24,7 +24,7 @@ const ConfirmTerminalCommandToolData = {
|
|
|
24
24
|
'',
|
|
25
25
|
'After confirmation, use a tool to actually execute the command.'
|
|
26
26
|
].join('\n'),
|
|
27
|
-
userDescription: ( localize(
|
|
27
|
+
userDescription: ( localize(11889, 'Tool for confirming terminal commands')),
|
|
28
28
|
source: ToolDataSource.Internal,
|
|
29
29
|
icon: Codicon.shield,
|
|
30
30
|
inputSchema: {
|
|
@@ -173,9 +173,9 @@ async function createRunInTerminalToolData(accessor) {
|
|
|
173
173
|
return {
|
|
174
174
|
id: 'run_in_terminal',
|
|
175
175
|
toolReferenceName: TOOL_REFERENCE_NAME,
|
|
176
|
-
displayName: ( localize(
|
|
176
|
+
displayName: ( localize(11890, 'Run in Terminal')),
|
|
177
177
|
modelDescription,
|
|
178
|
-
userDescription: ( localize(
|
|
178
|
+
userDescription: ( localize(11891, 'Tool for running commands in the terminal')),
|
|
179
179
|
source: ToolDataSource.Internal,
|
|
180
180
|
icon: Codicon.terminal,
|
|
181
181
|
inputSchema: {
|
|
@@ -351,8 +351,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
351
351
|
const isFinalAutoApproved = isAutoApproveAllowed && commandLineAnalyzerResults.every(e => e.isAutoApproveAllowed);
|
|
352
352
|
const confirmationMessages = isFinalAutoApproved ? undefined : {
|
|
353
353
|
title: args.isBackground
|
|
354
|
-
? ( localize(
|
|
355
|
-
: ( localize(
|
|
354
|
+
? ( localize(11892, "Run `{0}` command? (background terminal)", shellType))
|
|
355
|
+
: ( localize(11893, "Run `{0}` command?", shellType)),
|
|
356
356
|
message: ( new MarkdownString(args.explanation)),
|
|
357
357
|
disclaimer,
|
|
358
358
|
terminalCustomActions: customActions,
|
|
@@ -57,7 +57,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
57
57
|
await this._fileService.writeFile(tasksJsonUri, VSBuffer.fromString(JSON.stringify(tasksJson, null, '\t')));
|
|
58
58
|
_progress.report({ message: 'Updated tasks.json file' });
|
|
59
59
|
}
|
|
60
|
-
_progress.report({ message: ( new MarkdownString(( localize(
|
|
60
|
+
_progress.report({ message: ( new MarkdownString(( localize(11894, 'Resolving the task')))) });
|
|
61
61
|
let task;
|
|
62
62
|
const start = Date.now();
|
|
63
63
|
while (Date.now() - start < 5000 && !token.isCancellationRequested) {
|
|
@@ -68,9 +68,9 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
68
68
|
await timeout(100);
|
|
69
69
|
}
|
|
70
70
|
if (!task) {
|
|
71
|
-
return { content: [{ kind: 'text', value: `Task not found: ${args.task.label}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
71
|
+
return { content: [{ kind: 'text', value: `Task not found: ${args.task.label}` }], toolResultMessage: ( new MarkdownString(( localize(11895, 'Task not found: `{0}`', args.task.label)))) };
|
|
72
72
|
}
|
|
73
|
-
_progress.report({ message: ( new MarkdownString(( localize(
|
|
73
|
+
_progress.report({ message: ( new MarkdownString(( localize(11896, 'Running task `{0}`', args.task.label)))) });
|
|
74
74
|
const raceResult = await Promise.race([this._tasksService.run(task, undefined, TaskRunSource.ChatAgent), timeout(3000)]);
|
|
75
75
|
const result = raceResult && typeof raceResult === 'object' ? raceResult : undefined;
|
|
76
76
|
const dependencyTasks = await resolveDependencyTasks(task, args.workspaceFolder, this._configurationService, this._tasksService);
|
|
@@ -78,7 +78,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
78
78
|
const terminals = resources?.map(resource => this._terminalService.instances.find(t => t.resource.path === resource?.path && t.resource.scheme === resource.scheme)).filter(Boolean);
|
|
79
79
|
if (!terminals || terminals.length === 0) {
|
|
80
80
|
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${args.task.label}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
81
|
-
|
|
81
|
+
11897,
|
|
82
82
|
'Task started but no terminal was found for: `{0}`',
|
|
83
83
|
args.task.label
|
|
84
84
|
)))) };
|
|
@@ -119,26 +119,26 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
119
119
|
const allTasks = await this._tasksService.tasks();
|
|
120
120
|
if (allTasks?.find(t => t._label === task.label)) {
|
|
121
121
|
return {
|
|
122
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
123
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
122
|
+
invocationMessage: ( new MarkdownString(( localize(11898, 'Task `{0}` already exists.', task.label)))),
|
|
123
|
+
pastTenseMessage: ( new MarkdownString(( localize(11899, 'Task `{0}` already exists.', task.label)))),
|
|
124
124
|
confirmationMessages: undefined
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
128
128
|
if (activeTasks.find(t => t._label === task.label)) {
|
|
129
129
|
return {
|
|
130
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
131
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
130
|
+
invocationMessage: ( new MarkdownString(( localize(11900, 'Task \`{0}\` is already running.', task.label)))),
|
|
131
|
+
pastTenseMessage: ( new MarkdownString(( localize(11900, 'Task \`{0}\` is already running.', task.label)))),
|
|
132
132
|
confirmationMessages: undefined
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
return {
|
|
136
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
137
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
136
|
+
invocationMessage: ( new MarkdownString(( localize(11901, 'Created task \`{0}\`', task.label)))),
|
|
137
|
+
pastTenseMessage: ( new MarkdownString(( localize(11902, 'Created task \`{0}\`', task.label)))),
|
|
138
138
|
confirmationMessages: {
|
|
139
|
-
title: ( localize(
|
|
139
|
+
title: ( localize(11903, 'Allow task creation and execution?')),
|
|
140
140
|
message: ( new MarkdownString(( localize(
|
|
141
|
-
|
|
141
|
+
11904,
|
|
142
142
|
'A task \`{0}\` with command \`{1}\`{2} will be created.',
|
|
143
143
|
task.label,
|
|
144
144
|
task.command,
|
|
@@ -159,12 +159,12 @@ CreateAndRunTaskTool = ( __decorate([
|
|
|
159
159
|
const CreateAndRunTaskToolData = {
|
|
160
160
|
id: 'create_and_run_task',
|
|
161
161
|
toolReferenceName: 'createAndRunTask',
|
|
162
|
-
displayName: ( localize(
|
|
162
|
+
displayName: ( localize(11905, 'Create and run Task')),
|
|
163
163
|
modelDescription: ( localize(
|
|
164
|
-
|
|
164
|
+
11906,
|
|
165
165
|
'Creates and runs a build, run, or custom task for the workspace by generating or adding to a tasks.json file based on the project structure (such as package.json or README.md). If the user asks to build, run, launch and they have no tasks.json file, use this tool. If they ask to create or add a task, use this tool.'
|
|
166
166
|
)),
|
|
167
|
-
userDescription: ( localize(
|
|
167
|
+
userDescription: ( localize(11907, "Create and run a task in the workspace")),
|
|
168
168
|
source: ToolDataSource.Internal,
|
|
169
169
|
inputSchema: {
|
|
170
170
|
'type': 'object',
|
|
@@ -16,7 +16,7 @@ import { toolResultDetailsFromResponse, toolResultMessageFromResponse } from './
|
|
|
16
16
|
const GetTaskOutputToolData = {
|
|
17
17
|
id: 'get_task_output',
|
|
18
18
|
toolReferenceName: 'getTaskOutput',
|
|
19
|
-
displayName: ( localize(
|
|
19
|
+
displayName: ( localize(11908, 'Get Task Output')),
|
|
20
20
|
modelDescription: 'Get the output of a task',
|
|
21
21
|
source: ToolDataSource.Internal,
|
|
22
22
|
when: TasksAvailableContext,
|
|
@@ -52,16 +52,16 @@ let GetTaskOutputTool = class GetTaskOutputTool extends Disposable {
|
|
|
52
52
|
const taskDefinition = getTaskDefinition(args.id);
|
|
53
53
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
54
54
|
if (!task) {
|
|
55
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
55
|
+
return { invocationMessage: ( new MarkdownString(( localize(11909, 'Task not found: `{0}`', args.id)))) };
|
|
56
56
|
}
|
|
57
57
|
const taskLabel = task._label;
|
|
58
58
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
59
59
|
if (activeTasks.includes(task)) {
|
|
60
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
60
|
+
return { invocationMessage: ( new MarkdownString(( localize(11910, 'The task `{0}` is already running.', taskLabel)))) };
|
|
61
61
|
}
|
|
62
62
|
return {
|
|
63
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
64
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
63
|
+
invocationMessage: ( new MarkdownString(( localize(11911, 'Checking output for task `{0}`', taskLabel)))),
|
|
64
|
+
pastTenseMessage: ( new MarkdownString(( localize(11912, 'Checked output for task `{0}`', taskLabel)))),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -69,14 +69,14 @@ let GetTaskOutputTool = class GetTaskOutputTool extends Disposable {
|
|
|
69
69
|
const taskDefinition = getTaskDefinition(args.id);
|
|
70
70
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
71
71
|
if (!task) {
|
|
72
|
-
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
72
|
+
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(11909, 'Task not found: `{0}`', args.id)))) };
|
|
73
73
|
}
|
|
74
74
|
const dependencyTasks = await resolveDependencyTasks(task, args.workspaceFolder, this._configurationService, this._tasksService);
|
|
75
75
|
const resources = this._tasksService.getTerminalsForTasks(dependencyTasks ?? task);
|
|
76
76
|
const taskLabel = task._label;
|
|
77
77
|
const terminals = resources?.map(resource => this._terminalService.instances.find(t => t.resource.path === resource?.path && t.resource.scheme === resource.scheme)).filter(t => !!t);
|
|
78
78
|
if (!terminals || terminals.length === 0) {
|
|
79
|
-
return { content: [{ kind: 'text', value: `Terminal not found for task ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
79
|
+
return { content: [{ kind: 'text', value: `Terminal not found for task ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(11913, 'Terminal not found for task `{0}`', taskLabel)))) };
|
|
80
80
|
}
|
|
81
81
|
const store = ( new DisposableStore());
|
|
82
82
|
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, (terminalTask) => this._isTaskActive(terminalTask), dependencyTasks);
|