@codingame/monaco-vscode-chat-service-override 25.0.0 → 25.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 +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- 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 +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-chat-service-override",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - chat service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "25.
|
|
19
|
-
"@codingame/monaco-vscode-katex-common": "25.
|
|
20
|
-
"@codingame/monaco-vscode-xterm-addons-common": "25.
|
|
21
|
-
"@codingame/monaco-vscode-xterm-common": "25.
|
|
18
|
+
"@codingame/monaco-vscode-api": "25.1.0",
|
|
19
|
+
"@codingame/monaco-vscode-katex-common": "25.1.0",
|
|
20
|
+
"@codingame/monaco-vscode-xterm-addons-common": "25.1.0",
|
|
21
|
+
"@codingame/monaco-vscode-xterm-common": "25.1.0"
|
|
22
22
|
},
|
|
23
23
|
"main": "index.js",
|
|
24
24
|
"module": "index.js",
|
|
@@ -9,7 +9,7 @@ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
9
9
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
10
10
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
11
11
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
12
|
-
import {
|
|
12
|
+
import { AgentSessionProviders, getAgentSessionProviderName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
13
13
|
import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel';
|
|
14
14
|
import { ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
15
15
|
|
|
@@ -41,68 +41,68 @@ function getAccessibilityHelpText(accessor) {
|
|
|
41
41
|
const focusResponseKeybinding = keybindingService.lookupKeybinding('chat.action.focus')?.getAriaLabel();
|
|
42
42
|
const focusInputKeybinding = keybindingService.lookupKeybinding('workbench.action.chat.focusInput')?.getAriaLabel();
|
|
43
43
|
content.push(( localize(
|
|
44
|
-
|
|
44
|
+
11977,
|
|
45
45
|
"Inline chat occurs within a terminal. It is useful for suggesting terminal commands. Keep in mind that AI generated code may be incorrect."
|
|
46
46
|
)));
|
|
47
47
|
content.push(( localize(
|
|
48
|
-
|
|
48
|
+
11978,
|
|
49
49
|
"It can be activated using the command: Terminal: Start Chat ({0}), which will focus the input box.",
|
|
50
50
|
startChatKeybinding
|
|
51
51
|
)));
|
|
52
52
|
content.push(makeRequestKeybinding ? ( localize(
|
|
53
|
-
|
|
53
|
+
11979,
|
|
54
54
|
"The input box is where the user can type a request and can make the request ({0}). The widget will be closed and all content will be discarded when the Escape key is pressed and the terminal will regain focus.",
|
|
55
55
|
makeRequestKeybinding
|
|
56
56
|
)) : ( localize(
|
|
57
|
-
|
|
57
|
+
11980,
|
|
58
58
|
"The input box is where the user can type a request and can make the request by tabbing to the Make Request button, which is not currently triggerable via keybindings. The widget will be closed and all content will be discarded when the Escape key is pressed and the terminal will regain focus."
|
|
59
59
|
)));
|
|
60
60
|
content.push(openAccessibleViewKeybinding ? ( localize(
|
|
61
|
-
|
|
61
|
+
11981,
|
|
62
62
|
'The response can be inspected in the accessible view ({0}).',
|
|
63
63
|
openAccessibleViewKeybinding
|
|
64
64
|
)) : ( localize(
|
|
65
|
-
|
|
65
|
+
11982,
|
|
66
66
|
'With the input box focused, inspect the response in the accessible view via the Open Accessible View command, which is currently not triggerable by a keybinding.'
|
|
67
67
|
)));
|
|
68
68
|
content.push(focusResponseKeybinding ? ( localize(
|
|
69
|
-
|
|
69
|
+
11983,
|
|
70
70
|
'Reach the response from the input box ({0}).',
|
|
71
71
|
focusResponseKeybinding
|
|
72
72
|
)) : ( localize(
|
|
73
|
-
|
|
73
|
+
11984,
|
|
74
74
|
'Reach the response from the input box by tabbing or assigning a keybinding for the command: Focus Terminal Response.'
|
|
75
75
|
)));
|
|
76
76
|
content.push(focusInputKeybinding ? ( localize(
|
|
77
|
-
|
|
77
|
+
11985,
|
|
78
78
|
'Reach the input box from the response ({0}).',
|
|
79
79
|
focusInputKeybinding
|
|
80
80
|
)) : ( localize(
|
|
81
|
-
|
|
81
|
+
11986,
|
|
82
82
|
'Reach the response from the input box by shift+tabbing or assigning a keybinding for the command: Focus Terminal Input.'
|
|
83
83
|
)));
|
|
84
84
|
content.push(runCommandKeybinding ? ( localize(
|
|
85
|
-
|
|
85
|
+
11987,
|
|
86
86
|
'With focus in the input box or command editor, the Terminal: Run Chat Command ({0}) action.',
|
|
87
87
|
runCommandKeybinding
|
|
88
88
|
)) : ( localize(
|
|
89
|
-
|
|
89
|
+
11988,
|
|
90
90
|
'Run a command by tabbing to the button as the action is currently not triggerable by a keybinding.'
|
|
91
91
|
)));
|
|
92
92
|
content.push(insertCommandKeybinding ? ( localize(
|
|
93
|
-
|
|
93
|
+
11989,
|
|
94
94
|
'With focus in the input box command editor, the Terminal: Insert Chat Command ({0}) action.',
|
|
95
95
|
insertCommandKeybinding
|
|
96
96
|
)) : ( localize(
|
|
97
|
-
|
|
97
|
+
11990,
|
|
98
98
|
'Insert a command by tabbing to the button as the action is currently not triggerable by a keybinding.'
|
|
99
99
|
)));
|
|
100
100
|
content.push(( localize(
|
|
101
|
-
|
|
101
|
+
11991,
|
|
102
102
|
"Use tab to reach conditional parts like commands, status, message responses and more."
|
|
103
103
|
)));
|
|
104
104
|
content.push(( localize(
|
|
105
|
-
|
|
105
|
+
11992,
|
|
106
106
|
"Accessibility Signals can be changed via settings with a prefix of signals.chat. By default, if a request takes more than 4 seconds, you will hear a sound indicating that progress is still occurring."
|
|
107
107
|
)));
|
|
108
108
|
return content.join('\n');
|
|
@@ -33,8 +33,8 @@ import { activeChatController } from './terminalChatControllerHolder.js';
|
|
|
33
33
|
|
|
34
34
|
registerActiveXtermAction({
|
|
35
35
|
id: TerminalChatCommandId.Start,
|
|
36
|
-
title: ( localize2(
|
|
37
|
-
category: ( localize2(
|
|
36
|
+
title: ( localize2(11993, 'Open Inline Chat')),
|
|
37
|
+
category: ( localize2(11994, "Terminal")),
|
|
38
38
|
keybinding: {
|
|
39
39
|
primary: KeyMod.CtrlCmd | KeyCode.KeyI,
|
|
40
40
|
when: ( ContextKeyExpr.and(TerminalContextKeys.focusInAny)),
|
|
@@ -76,7 +76,7 @@ registerActiveXtermAction({
|
|
|
76
76
|
});
|
|
77
77
|
registerActiveXtermAction({
|
|
78
78
|
id: TerminalChatCommandId.Close,
|
|
79
|
-
title: ( localize2(
|
|
79
|
+
title: ( localize2(11995, 'Close')),
|
|
80
80
|
category: AbstractInline1ChatAction.category,
|
|
81
81
|
keybinding: {
|
|
82
82
|
primary: KeyCode.Escape,
|
|
@@ -101,8 +101,8 @@ registerActiveXtermAction({
|
|
|
101
101
|
});
|
|
102
102
|
registerActiveXtermAction({
|
|
103
103
|
id: TerminalChatCommandId.RunCommand,
|
|
104
|
-
title: ( localize2(
|
|
105
|
-
shortTitle: ( localize2(
|
|
104
|
+
title: ( localize2(11996, 'Run Chat Command')),
|
|
105
|
+
shortTitle: ( localize2(11997, 'Run')),
|
|
106
106
|
category: AbstractInline1ChatAction.category,
|
|
107
107
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
108
108
|
TerminalContextKeys.processSupported,
|
|
@@ -130,8 +130,8 @@ registerActiveXtermAction({
|
|
|
130
130
|
});
|
|
131
131
|
registerActiveXtermAction({
|
|
132
132
|
id: TerminalChatCommandId.RunFirstCommand,
|
|
133
|
-
title: ( localize2(
|
|
134
|
-
shortTitle: ( localize2(
|
|
133
|
+
title: ( localize2(11998, 'Run First Chat Command')),
|
|
134
|
+
shortTitle: ( localize2(11999, 'Run First')),
|
|
135
135
|
category: AbstractInline1ChatAction.category,
|
|
136
136
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
137
137
|
TerminalContextKeys.processSupported,
|
|
@@ -159,8 +159,8 @@ registerActiveXtermAction({
|
|
|
159
159
|
});
|
|
160
160
|
registerActiveXtermAction({
|
|
161
161
|
id: TerminalChatCommandId.InsertCommand,
|
|
162
|
-
title: ( localize2(
|
|
163
|
-
shortTitle: ( localize2(
|
|
162
|
+
title: ( localize2(12000, 'Insert Chat Command')),
|
|
163
|
+
shortTitle: ( localize2(12001, 'Insert')),
|
|
164
164
|
category: AbstractInline1ChatAction.category,
|
|
165
165
|
icon: Codicon.insert,
|
|
166
166
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
@@ -189,8 +189,8 @@ registerActiveXtermAction({
|
|
|
189
189
|
});
|
|
190
190
|
registerActiveXtermAction({
|
|
191
191
|
id: TerminalChatCommandId.InsertFirstCommand,
|
|
192
|
-
title: ( localize2(
|
|
193
|
-
shortTitle: ( localize2(
|
|
192
|
+
title: ( localize2(12002, 'Insert First Chat Command')),
|
|
193
|
+
shortTitle: ( localize2(12003, 'Insert First')),
|
|
194
194
|
category: AbstractInline1ChatAction.category,
|
|
195
195
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
196
196
|
TerminalContextKeys.processSupported,
|
|
@@ -218,7 +218,7 @@ registerActiveXtermAction({
|
|
|
218
218
|
});
|
|
219
219
|
registerActiveXtermAction({
|
|
220
220
|
id: TerminalChatCommandId.RerunRequest,
|
|
221
|
-
title: ( localize2(
|
|
221
|
+
title: ( localize2(12004, "Rerun Request")),
|
|
222
222
|
f1: false,
|
|
223
223
|
icon: Codicon.refresh,
|
|
224
224
|
category: AbstractInline1ChatAction.category,
|
|
@@ -259,7 +259,7 @@ registerActiveXtermAction({
|
|
|
259
259
|
});
|
|
260
260
|
registerActiveXtermAction({
|
|
261
261
|
id: TerminalChatCommandId.ViewInChat,
|
|
262
|
-
title: ( localize2(
|
|
262
|
+
title: ( localize2(12005, 'View in Chat')),
|
|
263
263
|
category: AbstractInline1ChatAction.category,
|
|
264
264
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.or(
|
|
265
265
|
TerminalContextKeys.processSupported,
|
|
@@ -285,8 +285,8 @@ registerAction2(class ShowChatTerminalsAction extends Action2 {
|
|
|
285
285
|
constructor() {
|
|
286
286
|
super({
|
|
287
287
|
id: TerminalChatCommandId.ViewHiddenChatTerminals,
|
|
288
|
-
title: ( localize2(
|
|
289
|
-
category: ( localize2(
|
|
288
|
+
title: ( localize2(12006, 'View Hidden Chat Terminals')),
|
|
289
|
+
category: ( localize2(12007, 'Terminal')),
|
|
290
290
|
f1: true,
|
|
291
291
|
precondition: ( ContextKeyExpr.and(TerminalChatContextKeys.hasHiddenChatTerminals, ChatContextKeys.enabled)),
|
|
292
292
|
menu: [{
|
|
@@ -318,7 +318,7 @@ registerAction2(class ShowChatTerminalsAction extends Action2 {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
const items = [];
|
|
321
|
-
const lastCommandLocalized = (command) => ( localize2(
|
|
321
|
+
const lastCommandLocalized = (command) => ( localize2(12008, 'Last: {0}', command)).value;
|
|
322
322
|
const MAX_DETAIL_LENGTH = 80;
|
|
323
323
|
const metas = [];
|
|
324
324
|
for (const instance of ( all.values())) {
|
|
@@ -367,10 +367,10 @@ registerAction2(class ShowChatTerminalsAction extends Action2 {
|
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
369
|
const qp = quickInputService.createQuickPick();
|
|
370
|
-
qp.placeholder = ( localize2(
|
|
370
|
+
qp.placeholder = ( localize2(12009, 'Select a chat terminal to show and focus')).value;
|
|
371
371
|
qp.items = items;
|
|
372
372
|
qp.canSelectMany = false;
|
|
373
|
-
qp.title = ( localize2(
|
|
373
|
+
qp.title = ( localize2(12010, 'Chat Terminals')).value;
|
|
374
374
|
qp.matchOnDescription = true;
|
|
375
375
|
qp.matchOnDetail = true;
|
|
376
376
|
const qpDisposables = ( new DisposableStore());
|
|
@@ -431,14 +431,14 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
431
431
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
432
432
|
command: {
|
|
433
433
|
id: TerminalChatCommandId.FocusMostRecentChatTerminal,
|
|
434
|
-
title: ( localize(
|
|
434
|
+
title: ( localize(12011, 'Chat: Focus Most Recent Terminal')),
|
|
435
435
|
},
|
|
436
436
|
when: ChatContextKeys.inChatSession
|
|
437
437
|
});
|
|
438
438
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
439
439
|
command: {
|
|
440
440
|
id: TerminalChatCommandId.FocusMostRecentChatTerminalOutput,
|
|
441
|
-
title: ( localize(
|
|
441
|
+
title: ( localize(12012, 'Chat: Focus Most Recent Terminal Output')),
|
|
442
442
|
},
|
|
443
443
|
when: ChatContextKeys.inChatSession
|
|
444
444
|
});
|
|
@@ -165,7 +165,7 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
165
165
|
}
|
|
166
166
|
_resetPlaceholder() {
|
|
167
167
|
const defaultAgent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Terminal);
|
|
168
|
-
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(
|
|
168
|
+
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(12013, 'Ask about commands'));
|
|
169
169
|
}
|
|
170
170
|
async reveal() {
|
|
171
171
|
await this._createSession();
|
|
@@ -151,7 +151,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
151
151
|
!( commandsWithSubcommands.has(commandLine)) &&
|
|
152
152
|
!( commandsWithSubSubCommands.has(commandLine))) {
|
|
153
153
|
actions.push({
|
|
154
|
-
label: ( localize(
|
|
154
|
+
label: ( localize(12014, 'Allow Exact Command Line in this Session')),
|
|
155
155
|
data: {
|
|
156
156
|
type: 'newRule',
|
|
157
157
|
rule: {
|
|
@@ -165,7 +165,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
actions.push({
|
|
168
|
-
label: ( localize(
|
|
168
|
+
label: ( localize(12015, 'Allow Exact Command Line in this Workspace')),
|
|
169
169
|
data: {
|
|
170
170
|
type: 'newRule',
|
|
171
171
|
rule: {
|
|
@@ -179,7 +179,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
actions.push({
|
|
182
|
-
label: ( localize(
|
|
182
|
+
label: ( localize(12016, 'Always Allow Exact Command Line')),
|
|
183
183
|
data: {
|
|
184
184
|
type: 'newRule',
|
|
185
185
|
rule: {
|
|
@@ -198,15 +198,15 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
198
198
|
actions.push(( new Separator()));
|
|
199
199
|
}
|
|
200
200
|
actions.push({
|
|
201
|
-
label: ( localize(
|
|
202
|
-
tooltip: ( localize(
|
|
201
|
+
label: ( localize(12017, 'Allow All Commands in this Session')),
|
|
202
|
+
tooltip: ( localize(12018, 'Allow this tool to run in this session without confirmation.')),
|
|
203
203
|
data: {
|
|
204
204
|
type: 'sessionApproval'
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
actions.push(( new Separator()));
|
|
208
208
|
actions.push({
|
|
209
|
-
label: ( localize(
|
|
209
|
+
label: ( localize(12019, 'Configure Auto Approve...')),
|
|
210
210
|
data: {
|
|
211
211
|
type: 'configure'
|
|
212
212
|
}
|
|
@@ -83,7 +83,7 @@ ChatAgentToolsContribution = ( __decorate([
|
|
|
83
83
|
registerWorkbenchContribution2(ChatAgentToolsContribution.ID, ChatAgentToolsContribution, WorkbenchPhase.AfterRestored);
|
|
84
84
|
registerActiveInstanceAction({
|
|
85
85
|
id: TerminalChatAgentToolsCommandId.ChatAddTerminalSelection,
|
|
86
|
-
title: ( localize(
|
|
86
|
+
title: ( localize(12020, 'Add Terminal Selection to Chat')),
|
|
87
87
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, sharedWhenClause.terminalAvailable)),
|
|
88
88
|
menu: [
|
|
89
89
|
{
|
|
@@ -106,8 +106,8 @@ registerActiveInstanceAction({
|
|
|
106
106
|
chatView.attachmentModel.addContext({
|
|
107
107
|
id: `terminal-selection-${Date.now()}`,
|
|
108
108
|
kind: 'generic',
|
|
109
|
-
name: ( localize(
|
|
110
|
-
fullName: ( localize(
|
|
109
|
+
name: ( localize(12021, 'Terminal Selection')),
|
|
110
|
+
fullName: ( localize(12021, 'Terminal Selection')),
|
|
111
111
|
value: selection,
|
|
112
112
|
icon: Codicon.terminal
|
|
113
113
|
});
|
|
@@ -63,7 +63,7 @@ let NpmScriptAutoApprover = class NpmScriptAutoApprover extends Disposable {
|
|
|
63
63
|
isAutoApproved: true,
|
|
64
64
|
scriptName,
|
|
65
65
|
autoApproveInfo: ( new MarkdownString(( localize(
|
|
66
|
-
|
|
66
|
+
12022,
|
|
67
67
|
'Auto approved as {0} is defined in package.json',
|
|
68
68
|
`\`${scriptName}\``
|
|
69
69
|
)))),
|
|
@@ -52,7 +52,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
52
52
|
isAutoApproved: true,
|
|
53
53
|
isAutoApproveAllowed: true,
|
|
54
54
|
disclaimers: [],
|
|
55
|
-
autoApproveInfo: ( new MarkdownString(`${( localize(
|
|
55
|
+
autoApproveInfo: ( new MarkdownString(`${( localize(12023, 'Auto approved for this session'))} ([${( localize(12024, 'Disable'))}](${( disableUri.toString())}))`, mdTrustSettings)),
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
const trimmedCommandLine = options.commandLine.trimStart();
|
|
@@ -142,7 +142,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
142
142
|
if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) ||
|
|
143
143
|
(isPowerShell(options.shell, options.os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
|
|
144
144
|
disclaimers.push(( localize(
|
|
145
|
-
|
|
145
|
+
12025,
|
|
146
146
|
'Web content may contain malicious code or attempt prompt injection attacks.'
|
|
147
147
|
)));
|
|
148
148
|
}
|
|
@@ -169,10 +169,10 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
169
169
|
.filter((e) => isAutoApproveRule(e.rule))
|
|
170
170
|
.map(e => {
|
|
171
171
|
if (e.rule.sourceTarget === 'session') {
|
|
172
|
-
return localize(
|
|
172
|
+
return localize(12026, '{0} (session)', `\`${e.rule.sourceText}\``);
|
|
173
173
|
}
|
|
174
174
|
const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, e.rule.sourceTarget);
|
|
175
|
-
const tooltip = ( localize(
|
|
175
|
+
const tooltip = ( localize(12027, 'View rule in settings'));
|
|
176
176
|
let label = e.rule.sourceText;
|
|
177
177
|
switch (e.rule?.sourceTarget) {
|
|
178
178
|
case ConfigurationTarget.DEFAULT:
|
|
@@ -203,9 +203,9 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
203
203
|
if (isGlobalAutoApproved) {
|
|
204
204
|
const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, 'global');
|
|
205
205
|
return (new MarkdownString(`${( localize(
|
|
206
|
-
|
|
206
|
+
12028,
|
|
207
207
|
'Auto approved by setting {0}',
|
|
208
|
-
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(
|
|
208
|
+
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(12029, 'View settings'))}")`
|
|
209
209
|
))}`, mdTrustSettings));
|
|
210
210
|
}
|
|
211
211
|
if (isAutoApproved) {
|
|
@@ -213,7 +213,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
213
213
|
case 'commandLine': {
|
|
214
214
|
if (isAutoApproveRule(commandLineResult.rule)) {
|
|
215
215
|
return (new MarkdownString(
|
|
216
|
-
localize(
|
|
216
|
+
localize(12030, 'Auto approved by rule {0}', formatRuleLinks(commandLineResult)),
|
|
217
217
|
mdTrustSettings
|
|
218
218
|
));
|
|
219
219
|
}
|
|
@@ -227,13 +227,13 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
227
227
|
const uniqueRules = dedupeRules(subCommandResults);
|
|
228
228
|
if (uniqueRules.length === 1) {
|
|
229
229
|
return (new MarkdownString(
|
|
230
|
-
localize(
|
|
230
|
+
localize(12030, 'Auto approved by rule {0}', formatRuleLinks(uniqueRules)),
|
|
231
231
|
mdTrustSettings
|
|
232
232
|
));
|
|
233
233
|
}
|
|
234
234
|
else if (uniqueRules.length > 1) {
|
|
235
235
|
return (new MarkdownString(
|
|
236
|
-
localize(
|
|
236
|
+
localize(12031, 'Auto approved by rules {0}', formatRuleLinks(uniqueRules)),
|
|
237
237
|
mdTrustSettings
|
|
238
238
|
));
|
|
239
239
|
}
|
|
@@ -246,7 +246,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
246
246
|
case 'commandLine': {
|
|
247
247
|
if (commandLineResult.rule) {
|
|
248
248
|
return (new MarkdownString(localize(
|
|
249
|
-
|
|
249
|
+
12032,
|
|
250
250
|
'Auto approval denied by rule {0}',
|
|
251
251
|
formatRuleLinks(commandLineResult)
|
|
252
252
|
), mdTrustSettings));
|
|
@@ -257,13 +257,13 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
257
257
|
const uniqueRules = dedupeRules(subCommandResults.filter(e => e.result === 'denied'));
|
|
258
258
|
if (uniqueRules.length === 1) {
|
|
259
259
|
return (new MarkdownString(
|
|
260
|
-
localize(
|
|
260
|
+
localize(12032, 'Auto approval denied by rule {0}', formatRuleLinks(uniqueRules)),
|
|
261
261
|
mdTrustSettings
|
|
262
262
|
));
|
|
263
263
|
}
|
|
264
264
|
else if (uniqueRules.length > 1) {
|
|
265
265
|
return (new MarkdownString(
|
|
266
|
-
localize(
|
|
266
|
+
localize(12033, 'Auto approval denied by rules {0}', formatRuleLinks(uniqueRules)),
|
|
267
267
|
mdTrustSettings
|
|
268
268
|
));
|
|
269
269
|
}
|
|
@@ -142,13 +142,13 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
142
142
|
)).join(', ');
|
|
143
143
|
if (!isAutoApproveAllowed) {
|
|
144
144
|
disclaimers.push(( localize(
|
|
145
|
-
|
|
145
|
+
12034,
|
|
146
146
|
'File write operations detected that cannot be auto approved: {0}',
|
|
147
147
|
fileWritesList
|
|
148
148
|
)));
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
|
-
disclaimers.push(( localize(
|
|
151
|
+
disclaimers.push(( localize(12035, 'File write operations detected: {0}', fileWritesList)));
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return {
|
|
@@ -11,7 +11,7 @@ const GetTerminalLastCommandToolData = {
|
|
|
11
11
|
id: 'terminal_last_command',
|
|
12
12
|
toolReferenceName: 'terminalLastCommand',
|
|
13
13
|
legacyToolReferenceFullNames: ['runCommands/terminalLastCommand'],
|
|
14
|
-
displayName: ( localize(
|
|
14
|
+
displayName: ( localize(12036, 'Get Terminal Last Command')),
|
|
15
15
|
modelDescription: 'Get the last command run in the active terminal.',
|
|
16
16
|
source: ToolDataSource.Internal,
|
|
17
17
|
icon: Codicon.terminal,
|
|
@@ -23,8 +23,8 @@ let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Dispos
|
|
|
23
23
|
}
|
|
24
24
|
async prepareToolInvocation(context, token) {
|
|
25
25
|
return {
|
|
26
|
-
invocationMessage: ( localize(
|
|
27
|
-
pastTenseMessage: ( localize(
|
|
26
|
+
invocationMessage: ( localize(12037, "Getting last terminal command")),
|
|
27
|
+
pastTenseMessage: ( localize(12038, "Got last terminal command")),
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -9,7 +9,7 @@ const GetTerminalOutputToolData = {
|
|
|
9
9
|
id: 'get_terminal_output',
|
|
10
10
|
toolReferenceName: 'getTerminalOutput',
|
|
11
11
|
legacyToolReferenceFullNames: ['runCommands/getTerminalOutput'],
|
|
12
|
-
displayName: ( localize(
|
|
12
|
+
displayName: ( localize(12039, 'Get Terminal Output')),
|
|
13
13
|
modelDescription: 'Get the output of a terminal command previously started with run_in_terminal',
|
|
14
14
|
icon: Codicon.terminal,
|
|
15
15
|
source: ToolDataSource.Internal,
|
|
@@ -29,8 +29,8 @@ const GetTerminalOutputToolData = {
|
|
|
29
29
|
class GetTerminalOutputTool extends Disposable {
|
|
30
30
|
async prepareToolInvocation(context, token) {
|
|
31
31
|
return {
|
|
32
|
-
invocationMessage: ( localize(
|
|
33
|
-
pastTenseMessage: ( localize(
|
|
32
|
+
invocationMessage: ( localize(12040, "Checking background terminal output")),
|
|
33
|
+
pastTenseMessage: ( localize(12041, "Checked background terminal output")),
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -10,7 +10,7 @@ const GetTerminalSelectionToolData = {
|
|
|
10
10
|
id: 'terminal_selection',
|
|
11
11
|
toolReferenceName: 'terminalSelection',
|
|
12
12
|
legacyToolReferenceFullNames: ['runCommands/terminalSelection'],
|
|
13
|
-
displayName: ( localize(
|
|
13
|
+
displayName: ( localize(12042, 'Get Terminal Selection')),
|
|
14
14
|
modelDescription: 'Get the current selection in the active terminal.',
|
|
15
15
|
source: ToolDataSource.Internal,
|
|
16
16
|
icon: Codicon.terminal,
|
|
@@ -22,8 +22,8 @@ let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable
|
|
|
22
22
|
}
|
|
23
23
|
async prepareToolInvocation(context, token) {
|
|
24
24
|
return {
|
|
25
|
-
invocationMessage: ( localize(
|
|
26
|
-
pastTenseMessage: ( localize(
|
|
25
|
+
invocationMessage: ( localize(12043, "Reading terminal selection")),
|
|
26
|
+
pastTenseMessage: ( localize(12044, "Read terminal selection")),
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -265,10 +265,10 @@ let OutputMonitor = class OutputMonitor extends Disposable {
|
|
|
265
265
|
if (token.isCancellationRequested || this._state === OutputMonitorState.Cancelled) {
|
|
266
266
|
return { promise: Promise.resolve(false) };
|
|
267
267
|
}
|
|
268
|
-
const result = this._createElicitationPart(token, context?.sessionId, ( new MarkdownString(( localize(
|
|
269
|
-
|
|
268
|
+
const result = this._createElicitationPart(token, context?.sessionId, ( new MarkdownString(( localize(12045, "Continue waiting for `{0}`?", command)))), ( new MarkdownString(( localize(
|
|
269
|
+
12046,
|
|
270
270
|
"This will continue to poll for output to determine when the terminal becomes idle for up to 2 minutes."
|
|
271
|
-
)))), '', ( localize(
|
|
271
|
+
)))), '', ( localize(12047, 'Yes')), ( localize(12048, 'No')), async () => true, async () => { this._state = OutputMonitorState.Cancelled; return false; });
|
|
272
272
|
return { promise: result.promise.then(p => p ?? false), part: result.part };
|
|
273
273
|
}
|
|
274
274
|
async _assessOutputForErrors(buffer, token) {
|
|
@@ -419,11 +419,11 @@ let OutputMonitor = class OutputMonitor extends Disposable {
|
|
|
419
419
|
}
|
|
420
420
|
async _requestFreeFormTerminalInput(token, execution, confirmationPrompt) {
|
|
421
421
|
const focusTerminalSelection = Symbol('focusTerminalSelection');
|
|
422
|
-
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(
|
|
423
|
-
|
|
422
|
+
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(12049, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
|
|
423
|
+
12050,
|
|
424
424
|
"{0}\nPlease provide the required input to the terminal.\n\n",
|
|
425
425
|
confirmationPrompt.prompt
|
|
426
|
-
)))), '', ( localize(
|
|
426
|
+
)))), '', ( localize(12051, 'Focus terminal')), undefined, () => {
|
|
427
427
|
this._showInstance(execution.instance.instanceId);
|
|
428
428
|
return focusTerminalSelection;
|
|
429
429
|
});
|
|
@@ -476,13 +476,13 @@ let OutputMonitor = class OutputMonitor extends Disposable {
|
|
|
476
476
|
const focusTerminalSelection = Symbol('focusTerminalSelection');
|
|
477
477
|
let inputDataDisposable = Disposable.None;
|
|
478
478
|
let instanceDisposedDisposable = Disposable.None;
|
|
479
|
-
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(
|
|
480
|
-
|
|
479
|
+
const { promise: userPrompt, part } = this._createElicitationPart(token, execution.sessionId, ( new MarkdownString(( localize(12052, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
|
|
480
|
+
12053,
|
|
481
481
|
"{0}\n Do you want to send `{1}`{2} followed by `Enter` to the terminal?",
|
|
482
482
|
confirmationPrompt.prompt,
|
|
483
483
|
suggestedOptionValue,
|
|
484
484
|
isString(suggestedOption) ? '' : suggestedOption.description ? ' (' + suggestedOption.description + ')' : ''
|
|
485
|
-
)))), '', ( localize(
|
|
485
|
+
)))), '', ( localize(12054, 'Allow')), ( localize(12055, 'Focus Terminal')), async (value) => {
|
|
486
486
|
let option = undefined;
|
|
487
487
|
if (value === true) {
|
|
488
488
|
option = suggestedOptionValue;
|
|
@@ -7,7 +7,7 @@ import { RunInTerminalTool } from './runInTerminalTool.js';
|
|
|
7
7
|
|
|
8
8
|
const ConfirmTerminalCommandToolData = {
|
|
9
9
|
id: 'vscode_get_terminal_confirmation',
|
|
10
|
-
displayName: ( localize(
|
|
10
|
+
displayName: ( localize(12056, 'Confirm Terminal Command')),
|
|
11
11
|
modelDescription: [
|
|
12
12
|
'This tool allows you to get explicit user confirmation for a terminal command without executing it.',
|
|
13
13
|
'',
|
|
@@ -25,7 +25,7 @@ const ConfirmTerminalCommandToolData = {
|
|
|
25
25
|
'',
|
|
26
26
|
'After confirmation, use a tool to actually execute the command.'
|
|
27
27
|
].join('\n'),
|
|
28
|
-
userDescription: ( localize(
|
|
28
|
+
userDescription: ( localize(12057, 'Tool for confirming terminal commands')),
|
|
29
29
|
source: ToolDataSource.Internal,
|
|
30
30
|
icon: Codicon.shield,
|
|
31
31
|
inputSchema: {
|
|
@@ -183,9 +183,9 @@ async function createRunInTerminalToolData(accessor) {
|
|
|
183
183
|
id: 'run_in_terminal',
|
|
184
184
|
toolReferenceName: TOOL_REFERENCE_NAME,
|
|
185
185
|
legacyToolReferenceFullNames: LEGACY_TOOL_REFERENCE_FULL_NAMES,
|
|
186
|
-
displayName: ( localize(
|
|
186
|
+
displayName: ( localize(12058, 'Run in Terminal')),
|
|
187
187
|
modelDescription,
|
|
188
|
-
userDescription: ( localize(
|
|
188
|
+
userDescription: ( localize(12059, 'Run commands in the terminal')),
|
|
189
189
|
source: ToolDataSource.Internal,
|
|
190
190
|
icon: Codicon.terminal,
|
|
191
191
|
inputSchema: {
|
|
@@ -220,7 +220,7 @@ const telemetryIgnoredSequences = [
|
|
|
220
220
|
'\x1b[I',
|
|
221
221
|
'\x1b[O',
|
|
222
222
|
];
|
|
223
|
-
const altBufferMessage = ( localize(
|
|
223
|
+
const altBufferMessage = ( localize(12060, "The command opened the alternate buffer."));
|
|
224
224
|
let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
225
225
|
static { RunInTerminalTool_1 = this; }
|
|
226
226
|
static { this._backgroundExecutions = ( new Map()); }
|
|
@@ -392,8 +392,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
392
392
|
}
|
|
393
393
|
const confirmationMessages = isFinalAutoApproved ? undefined : {
|
|
394
394
|
title: args.isBackground
|
|
395
|
-
? ( localize(
|
|
396
|
-
: ( localize(
|
|
395
|
+
? ( localize(12061, "Run `{0}` command? (background terminal)", shellType))
|
|
396
|
+
: ( localize(12062, "Run `{0}` command?", shellType)),
|
|
397
397
|
message: ( new MarkdownString(args.explanation)),
|
|
398
398
|
disclaimer,
|
|
399
399
|
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(12063, '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(12064, 'Task not found: `{0}`', args.task.label)))) };
|
|
72
72
|
}
|
|
73
|
-
_progress.report({ message: ( new MarkdownString(( localize(
|
|
73
|
+
_progress.report({ message: ( new MarkdownString(( localize(12065, '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
|
+
12066,
|
|
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(12067, 'Task `{0}` already exists.', task.label)))),
|
|
123
|
+
pastTenseMessage: ( new MarkdownString(( localize(12068, '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(12069, 'Task \`{0}\` is already running.', task.label)))),
|
|
131
|
+
pastTenseMessage: ( new MarkdownString(( localize(12069, '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(12070, 'Created task \`{0}\`', task.label)))),
|
|
137
|
+
pastTenseMessage: ( new MarkdownString(( localize(12071, 'Created task \`{0}\`', task.label)))),
|
|
138
138
|
confirmationMessages: {
|
|
139
|
-
title: ( localize(
|
|
139
|
+
title: ( localize(12072, 'Allow task creation and execution?')),
|
|
140
140
|
message: ( new MarkdownString(( localize(
|
|
141
|
-
|
|
141
|
+
12073,
|
|
142
142
|
'A task \`{0}\` with command \`{1}\`{2} will be created.',
|
|
143
143
|
task.label,
|
|
144
144
|
task.command,
|
|
@@ -160,9 +160,9 @@ const CreateAndRunTaskToolData = {
|
|
|
160
160
|
id: 'create_and_run_task',
|
|
161
161
|
toolReferenceName: 'createAndRunTask',
|
|
162
162
|
legacyToolReferenceFullNames: ['runTasks/createAndRunTask'],
|
|
163
|
-
displayName: ( localize(
|
|
163
|
+
displayName: ( localize(12074, 'Create and run Task')),
|
|
164
164
|
modelDescription: '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.',
|
|
165
|
-
userDescription: ( localize(
|
|
165
|
+
userDescription: ( localize(12075, "Create and run a task in the workspace")),
|
|
166
166
|
source: ToolDataSource.Internal,
|
|
167
167
|
inputSchema: {
|
|
168
168
|
'type': 'object',
|
|
@@ -17,7 +17,7 @@ const GetTaskOutputToolData = {
|
|
|
17
17
|
id: 'get_task_output',
|
|
18
18
|
toolReferenceName: 'getTaskOutput',
|
|
19
19
|
legacyToolReferenceFullNames: ['runTasks/getTaskOutput'],
|
|
20
|
-
displayName: ( localize(
|
|
20
|
+
displayName: ( localize(12076, 'Get Task Output')),
|
|
21
21
|
modelDescription: 'Get the output of a task',
|
|
22
22
|
source: ToolDataSource.Internal,
|
|
23
23
|
when: TasksAvailableContext,
|
|
@@ -53,16 +53,16 @@ let GetTaskOutputTool = class GetTaskOutputTool extends Disposable {
|
|
|
53
53
|
const taskDefinition = getTaskDefinition(args.id);
|
|
54
54
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
55
55
|
if (!task) {
|
|
56
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
56
|
+
return { invocationMessage: ( new MarkdownString(( localize(12077, 'Task not found: `{0}`', args.id)))) };
|
|
57
57
|
}
|
|
58
58
|
const taskLabel = task._label;
|
|
59
59
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
60
60
|
if (activeTasks.includes(task)) {
|
|
61
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
61
|
+
return { invocationMessage: ( new MarkdownString(( localize(12078, 'The task `{0}` is already running.', taskLabel)))) };
|
|
62
62
|
}
|
|
63
63
|
return {
|
|
64
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
65
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
64
|
+
invocationMessage: ( new MarkdownString(( localize(12079, 'Checking output for task `{0}`', taskLabel)))),
|
|
65
|
+
pastTenseMessage: ( new MarkdownString(( localize(12080, 'Checked output for task `{0}`', taskLabel)))),
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -70,14 +70,14 @@ let GetTaskOutputTool = class GetTaskOutputTool extends Disposable {
|
|
|
70
70
|
const taskDefinition = getTaskDefinition(args.id);
|
|
71
71
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
72
72
|
if (!task) {
|
|
73
|
-
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
73
|
+
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(12077, 'Task not found: `{0}`', args.id)))) };
|
|
74
74
|
}
|
|
75
75
|
const dependencyTasks = await resolveDependencyTasks(task, args.workspaceFolder, this._configurationService, this._tasksService);
|
|
76
76
|
const resources = this._tasksService.getTerminalsForTasks(dependencyTasks ?? task);
|
|
77
77
|
const taskLabel = task._label;
|
|
78
78
|
const terminals = resources?.map(resource => this._terminalService.instances.find(t => t.resource.path === resource?.path && t.resource.scheme === resource.scheme)).filter(t => !!t);
|
|
79
79
|
if (!terminals || terminals.length === 0) {
|
|
80
|
-
return { content: [{ kind: 'text', value: `Terminal not found for task ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
80
|
+
return { content: [{ kind: 'text', value: `Terminal not found for task ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(12081, 'Terminal not found for task `{0}`', taskLabel)))) };
|
|
81
81
|
}
|
|
82
82
|
const store = ( new DisposableStore());
|
|
83
83
|
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, (terminalTask) => this._isTaskActive(terminalTask), dependencyTasks, this._tasksService);
|
|
@@ -32,23 +32,23 @@ let RunTaskTool = class RunTaskTool {
|
|
|
32
32
|
const taskDefinition = getTaskDefinition(args.id);
|
|
33
33
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
34
34
|
if (!task) {
|
|
35
|
-
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
35
|
+
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(12082, 'Task not found: `{0}`', args.id)))) };
|
|
36
36
|
}
|
|
37
37
|
const taskLabel = task._label;
|
|
38
38
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
39
39
|
if (activeTasks.includes(task)) {
|
|
40
|
-
return { content: [{ kind: 'text', value: `The task ${taskLabel} is already running.` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
40
|
+
return { content: [{ kind: 'text', value: `The task ${taskLabel} is already running.` }], toolResultMessage: ( new MarkdownString(( localize(12083, 'The task `{0}` is already running.', taskLabel)))) };
|
|
41
41
|
}
|
|
42
42
|
const raceResult = await Promise.race([this._tasksService.run(task, undefined, TaskRunSource.ChatAgent), timeout(3000)]);
|
|
43
43
|
const result = raceResult && typeof raceResult === 'object' ? raceResult : undefined;
|
|
44
44
|
const dependencyTasks = await resolveDependencyTasks(task, args.workspaceFolder, this._configurationService, this._tasksService);
|
|
45
45
|
const resources = this._tasksService.getTerminalsForTasks(dependencyTasks ?? task);
|
|
46
46
|
if (!resources || resources.length === 0) {
|
|
47
|
-
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
47
|
+
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(12084, 'Task started but no terminal was found for: `{0}`', taskLabel)))) };
|
|
48
48
|
}
|
|
49
49
|
const terminals = this._terminalService.instances.filter(t => ( resources.some(r => r.path === t.resource.path && r.scheme === t.resource.scheme)));
|
|
50
50
|
if (terminals.length === 0) {
|
|
51
|
-
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
51
|
+
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(12084, 'Task started but no terminal was found for: `{0}`', taskLabel)))) };
|
|
52
52
|
}
|
|
53
53
|
const store = ( new DisposableStore());
|
|
54
54
|
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, (terminalTask) => this._isTaskActive(terminalTask), dependencyTasks, this._tasksService);
|
|
@@ -85,27 +85,27 @@ let RunTaskTool = class RunTaskTool {
|
|
|
85
85
|
const taskDefinition = getTaskDefinition(args.id);
|
|
86
86
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
87
87
|
if (!task) {
|
|
88
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
88
|
+
return { invocationMessage: ( new MarkdownString(( localize(12082, 'Task not found: `{0}`', args.id)))) };
|
|
89
89
|
}
|
|
90
90
|
const taskLabel = task._label;
|
|
91
91
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
92
92
|
if (task && activeTasks.includes(task)) {
|
|
93
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
93
|
+
return { invocationMessage: ( new MarkdownString(( localize(12085, 'The task is already running.')))) };
|
|
94
94
|
}
|
|
95
95
|
if (await this._isTaskActive(task)) {
|
|
96
96
|
return {
|
|
97
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
98
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
97
|
+
invocationMessage: ( new MarkdownString(( localize(12086, '`{0}` is already running.', taskLabel)))),
|
|
98
|
+
pastTenseMessage: ( new MarkdownString(( localize(12087, '`{0}` was already running.', taskLabel)))),
|
|
99
99
|
confirmationMessages: undefined
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
return {
|
|
103
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
103
|
+
invocationMessage: ( new MarkdownString(( localize(12088, 'Running `{0}`', taskLabel)))),
|
|
104
104
|
pastTenseMessage: ( new MarkdownString(task?.configurationProperties.isBackground
|
|
105
|
-
? ( localize(
|
|
106
|
-
: ( localize(
|
|
105
|
+
? ( localize(12089, 'Started `{0}`', taskLabel))
|
|
106
|
+
: ( localize(12090, 'Ran `{0}`', taskLabel)))),
|
|
107
107
|
confirmationMessages: task
|
|
108
|
-
? { title: ( localize(
|
|
108
|
+
? { title: ( localize(12091, 'Allow task run?')), message: ( localize(12092, 'Allow to run the task `{0}`?', taskLabel)) }
|
|
109
109
|
: undefined
|
|
110
110
|
};
|
|
111
111
|
}
|
|
@@ -121,9 +121,9 @@ const RunTaskToolData = {
|
|
|
121
121
|
id: 'run_task',
|
|
122
122
|
toolReferenceName: 'runTask',
|
|
123
123
|
legacyToolReferenceFullNames: ['runTasks/runTask'],
|
|
124
|
-
displayName: ( localize(
|
|
124
|
+
displayName: ( localize(12093, 'Run Task')),
|
|
125
125
|
modelDescription: 'Runs a VS Code task.\n\n- If you see that an appropriate task exists for building or running code, prefer to use this tool to run the task instead of using the run_in_terminal tool.\n- Make sure that any appropriate build or watch task is running before trying to run tests or execute code.\n- If the user asks to run a task, use this tool to do so.',
|
|
126
|
-
userDescription: ( localize(
|
|
126
|
+
userDescription: ( localize(12094, 'Run tasks in the workspace')),
|
|
127
127
|
icon: Codicon.tools,
|
|
128
128
|
source: ToolDataSource.Internal,
|
|
129
129
|
when: TasksAvailableContext,
|
|
@@ -17,7 +17,7 @@ function toolResultDetailsFromResponse(terminalResults) {
|
|
|
17
17
|
function toolResultMessageFromResponse(result, taskLabel, toolResultDetails, terminalResults, getOutputTool, isBackground) {
|
|
18
18
|
let resultSummary = '';
|
|
19
19
|
if (result?.exitCode) {
|
|
20
|
-
resultSummary = ( localize(
|
|
20
|
+
resultSummary = ( localize(12095, 'Task `{0}` failed with exit code {1}.', taskLabel, result.exitCode));
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
resultSummary += `\`${taskLabel}\` task `;
|