@codingame/monaco-vscode-chat-service-override 20.5.0 → 21.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -7
- package/package.json +38 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +56 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +18 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +52 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +28 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +19 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +2 -2
- 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 +15 -12
- 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/chatQuickInputActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +433 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +205 -551
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +52 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +277 -163
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +20 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +11 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +32 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +22 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +22 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +6 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +47 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +8 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +33 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +74 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +23 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatLayoutService.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatLayoutService.js +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +36 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +37 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +238 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +23 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +257 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +126 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +3 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +55 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +13 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +130 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/media/apple-dark.svg +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/apple-light.svg +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +39 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +12 -12
- 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/saveToPromptAction.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +4 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +153 -168
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +127 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +111 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +66 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +143 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +12 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderDiagnosticsProvider.d.ts +8 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderDiagnosticsProvider.js +41 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderHovers.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderHovers.js +55 -22
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkDiagnosticsProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/headerBase.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/applyTo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/string.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/string.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/mode.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/mode.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/tools.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/promptHeader.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/promptHeader.js +8 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/topError.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +11 -5
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +28 -28
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +54 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +33 -31
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +9 -9
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +9 -13
- 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 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +11 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +1 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.d.ts +16 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +84 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.js +55 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +8 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +15 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +72 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +8 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +19 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +7 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +12 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +85 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +448 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +30 -77
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +174 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +75 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +15 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +81 -38
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +106 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{getTerminalOutputTool.js → tools/getTerminalOutputTool.js} +5 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +59 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +452 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/utils.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/utils.js +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{runInTerminalTool.d.ts → tools/runInTerminalTool.d.ts} +11 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{runInTerminalTool.js → tools/runInTerminalTool.js} +282 -133
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{task → tools/task}/createAndRunTaskTool.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{task → tools/task}/createAndRunTaskTool.js +51 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{task → tools/task}/getTaskOutputTool.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +117 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{task → tools/task}/runTaskTool.d.ts +3 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{task → tools/task}/runTaskTool.js +54 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminal.chatAgentTools.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminal.chatAgentTools.js +8 -0
- package/vscode/src/vs/base/common/policy.d.ts +0 -41
- package/vscode/src/vs/base/common/policy.js +0 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.js +0 -738
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +0 -42
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptPathAutocompletion.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptPathAutocompletion.js +0 -167
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/enum.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/enum.js +0 -63
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/bufferOutputPolling.d.ts +0 -55
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/bufferOutputPolling.js +0 -163
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/getTaskOutputTool.js +0 -88
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.js +0 -80
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task.chatAgentTools.contribution.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task.chatAgentTools.contribution.js +0 -40
- /package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/{getTerminalOutputTool.d.ts → tools/getTerminalOutputTool.d.ts} +0 -0
|
@@ -1,48 +1,60 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { asArray } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
3
4
|
import { timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
5
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
6
|
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
7
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
6
8
|
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
9
|
+
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
7
10
|
import { OS, OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
8
11
|
import { count } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
9
12
|
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
10
13
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
15
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
16
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
13
17
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
14
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
15
18
|
import { TerminalCapability } from '@codingame/monaco-vscode-a9da9abe-278d-5ce6-9418-99c7c07c5c37-common/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
16
19
|
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
17
|
-
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
18
20
|
import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
|
|
19
21
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
20
|
-
import {
|
|
21
|
-
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
22
|
+
import { ToolDataSource, ToolInvocationPresentation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
22
23
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
23
24
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
24
25
|
import { ITerminalProfileResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal.service';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { CommandLineAutoApprover } from '
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
26
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-a175bd1a-4858-5944-9ae5-fb73305dcb13-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
27
|
+
import { getRecommendedToolsOverRunInTerminal } from '../alternativeRecommendation.js';
|
|
28
|
+
import { CommandLineAutoApprover } from '../commandLineAutoApprover.js';
|
|
29
|
+
import { CommandSimplifier } from '../commandSimplifier.js';
|
|
30
|
+
import { BasicExecuteStrategy } from '../executeStrategy/basicExecuteStrategy.js';
|
|
31
|
+
import { NoneExecuteStrategy } from '../executeStrategy/noneExecuteStrategy.js';
|
|
32
|
+
import { RichExecuteStrategy } from '../executeStrategy/richExecuteStrategy.js';
|
|
33
|
+
import { OutputMonitor } from './monitoring/outputMonitor.js';
|
|
34
|
+
import { isPowerShell, generateAutoApproveActions } from '../runInTerminalHelpers.js';
|
|
35
|
+
import { RunInTerminalToolTelemetry } from '../runInTerminalToolTelemetry.js';
|
|
36
|
+
import { splitCommandLineIntoSubCommands } from '../subCommands.js';
|
|
37
|
+
import { ToolTerminalCreator, ShellIntegrationQuality } from '../toolTerminalCreator.js';
|
|
38
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
39
|
+
import { TerminalToolConfirmationStorageKeys } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart';
|
|
40
|
+
import { OutputMonitorState } from './monitoring/types.js';
|
|
41
|
+
import { getOutput } from '../outputHelpers.js';
|
|
42
|
+
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
34
43
|
|
|
35
44
|
var RunInTerminalTool_1;
|
|
36
|
-
|
|
45
|
+
var TerminalToolStorageKeysInternal;
|
|
46
|
+
(function (TerminalToolStorageKeysInternal) {
|
|
47
|
+
TerminalToolStorageKeysInternal["TerminalSession"] = "chat.terminalSessions";
|
|
48
|
+
})(TerminalToolStorageKeysInternal || (TerminalToolStorageKeysInternal = {}));
|
|
37
49
|
const RunInTerminalToolData = {
|
|
38
50
|
id: 'run_in_terminal',
|
|
39
51
|
toolReferenceName: 'runInTerminal',
|
|
40
|
-
displayName: ( localize(
|
|
52
|
+
displayName: ( localize(11451, 'Run in Terminal')),
|
|
41
53
|
modelDescription: [
|
|
42
54
|
'This tool allows you to execute shell commands in a persistent terminal session, preserving environment variables, working directory, and other context across multiple commands.',
|
|
43
55
|
'',
|
|
44
56
|
'Command Execution:',
|
|
45
|
-
'-
|
|
57
|
+
'- Does NOT support multi-line commands',
|
|
46
58
|
'',
|
|
47
59
|
'Directory Management:',
|
|
48
60
|
'- Must use absolute paths to avoid navigation issues.',
|
|
@@ -65,8 +77,9 @@ const RunInTerminalToolData = {
|
|
|
65
77
|
'- Use targeted queries instead of broad scans',
|
|
66
78
|
'- Consider using \'wc -l\' to count before listing many items'
|
|
67
79
|
].join('\n'),
|
|
68
|
-
userDescription: ( localize(
|
|
80
|
+
userDescription: ( localize(11452, 'Tool for running commands in the terminal')),
|
|
69
81
|
source: ToolDataSource.Internal,
|
|
82
|
+
icon: Codicon.terminal,
|
|
70
83
|
inputSchema: {
|
|
71
84
|
type: 'object',
|
|
72
85
|
properties: {
|
|
@@ -94,6 +107,16 @@ const telemetryIgnoredSequences = [
|
|
|
94
107
|
'\x1b[I',
|
|
95
108
|
'\x1b[O',
|
|
96
109
|
];
|
|
110
|
+
const promptInjectionWarningCommandsLower = [
|
|
111
|
+
'curl',
|
|
112
|
+
'wget',
|
|
113
|
+
];
|
|
114
|
+
const promptInjectionWarningCommandsLowerPwshOnly = [
|
|
115
|
+
'invoke-restmethod',
|
|
116
|
+
'invoke-webrequest',
|
|
117
|
+
'irm',
|
|
118
|
+
'iwr',
|
|
119
|
+
];
|
|
97
120
|
let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
98
121
|
static { RunInTerminalTool_1 = this; }
|
|
99
122
|
static { this._backgroundExecutions = ( new Map()); }
|
|
@@ -104,22 +127,30 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
104
127
|
}
|
|
105
128
|
return backgroundExecution.getOutput();
|
|
106
129
|
}
|
|
107
|
-
constructor(_instantiationService, _languageModelToolsService, _storageService,
|
|
130
|
+
constructor(_instantiationService, _configurationService, _languageModelToolsService, _storageService, _logService, _terminalProfileResolverService, _terminalService, _remoteAgentService, _chatService) {
|
|
108
131
|
super();
|
|
109
132
|
this._instantiationService = _instantiationService;
|
|
133
|
+
this._configurationService = _configurationService;
|
|
110
134
|
this._languageModelToolsService = _languageModelToolsService;
|
|
111
135
|
this._storageService = _storageService;
|
|
112
|
-
this._telemetryService = _telemetryService;
|
|
113
136
|
this._logService = _logService;
|
|
114
137
|
this._terminalProfileResolverService = _terminalProfileResolverService;
|
|
115
138
|
this._terminalService = _terminalService;
|
|
116
139
|
this._remoteAgentService = _remoteAgentService;
|
|
117
140
|
this._chatService = _chatService;
|
|
118
|
-
this._workspaceContextService = _workspaceContextService;
|
|
119
|
-
this._languageModelsService = _languageModelsService;
|
|
120
141
|
this._sessionTerminalAssociations = ( new Map());
|
|
121
|
-
this._commandLineAutoApprover = this._register(_instantiationService.createInstance(CommandLineAutoApprover));
|
|
122
142
|
this._osBackend = this._remoteAgentService.getEnvironment().then(remoteEnv => remoteEnv?.os ?? OS);
|
|
143
|
+
this._terminalToolCreator = _instantiationService.createInstance(ToolTerminalCreator);
|
|
144
|
+
this._commandSimplifier = _instantiationService.createInstance(CommandSimplifier, this._osBackend);
|
|
145
|
+
this._telemetry = _instantiationService.createInstance(RunInTerminalToolTelemetry);
|
|
146
|
+
this._commandLineAutoApprover = this._register(_instantiationService.createInstance(CommandLineAutoApprover));
|
|
147
|
+
this._register(Event.runAndSubscribe(this._configurationService.onDidChangeConfiguration, e => {
|
|
148
|
+
if (!e || e.affectsConfiguration(TerminalChatAgentToolsSettingId.EnableAutoApprove)) {
|
|
149
|
+
if (this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) !== true) {
|
|
150
|
+
this._storageService.remove(TerminalToolConfirmationStorageKeys.TerminalAutoApproveWarningAccepted, StorageScope.APPLICATION);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}));
|
|
123
154
|
this._restoreTerminalAssociations();
|
|
124
155
|
this._register(this._terminalService.onDidDisposeInstance(e => {
|
|
125
156
|
for (const [sessionId, toolTerminal] of this._sessionTerminalAssociations.entries()) {
|
|
@@ -134,51 +165,62 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
134
165
|
}
|
|
135
166
|
async prepareToolInvocation(context, token) {
|
|
136
167
|
const args = context.parameters;
|
|
137
|
-
|
|
138
|
-
const presentation =
|
|
168
|
+
const alternativeRecommendation = getRecommendedToolsOverRunInTerminal(args.command, this._languageModelToolsService);
|
|
169
|
+
const presentation = alternativeRecommendation ? ToolInvocationPresentation.Hidden : undefined;
|
|
139
170
|
const os = await this._osBackend;
|
|
140
|
-
const shell = await this.
|
|
141
|
-
os,
|
|
142
|
-
remoteAuthority: this._remoteAgentService.getConnection()?.remoteAuthority
|
|
143
|
-
});
|
|
171
|
+
const shell = await this._getCopilotShell();
|
|
144
172
|
const language = os === OperatingSystem.Windows ? 'pwsh' : 'sh';
|
|
145
173
|
const instance = context.chatSessionId ? this._sessionTerminalAssociations.get(context.chatSessionId)?.instance : undefined;
|
|
146
|
-
|
|
174
|
+
const terminalToolSessionId = generateUuid();
|
|
175
|
+
let toolEditedCommand = await this._commandSimplifier.rewriteIfNeeded(args, instance, shell);
|
|
147
176
|
if (toolEditedCommand === args.command) {
|
|
148
177
|
toolEditedCommand = undefined;
|
|
149
178
|
}
|
|
179
|
+
let autoApproveInfo;
|
|
150
180
|
let confirmationMessages;
|
|
151
|
-
if (
|
|
181
|
+
if (alternativeRecommendation) {
|
|
152
182
|
confirmationMessages = undefined;
|
|
153
183
|
}
|
|
154
184
|
else {
|
|
155
185
|
const actualCommand = toolEditedCommand ?? args.command;
|
|
156
186
|
const subCommands = splitCommandLineIntoSubCommands(actualCommand, shell, os);
|
|
157
|
-
const
|
|
158
|
-
const allSubCommands = [...subCommands, ...inlineSubCommands];
|
|
159
|
-
const subCommandResults = ( allSubCommands.map(e => this._commandLineAutoApprover.isCommandAutoApproved(e, shell, os)));
|
|
187
|
+
const subCommandResults = ( subCommands.map(e => this._commandLineAutoApprover.isCommandAutoApproved(e, shell, os)));
|
|
160
188
|
const commandLineResult = this._commandLineAutoApprover.isCommandLineAutoApproved(actualCommand);
|
|
161
189
|
const autoApproveReasons = [
|
|
162
190
|
...( subCommandResults.map(e => e.reason)),
|
|
163
191
|
commandLineResult.reason,
|
|
164
192
|
];
|
|
165
193
|
let isAutoApproved = false;
|
|
166
|
-
|
|
194
|
+
let isDenied = false;
|
|
195
|
+
let autoApproveReason;
|
|
196
|
+
let autoApproveDefault;
|
|
197
|
+
const deniedSubCommandResult = subCommandResults.find(e => e.result === 'denied');
|
|
198
|
+
if (deniedSubCommandResult) {
|
|
167
199
|
this._logService.info('autoApprove: Sub-command DENIED auto approval');
|
|
200
|
+
isDenied = true;
|
|
201
|
+
autoApproveDefault = deniedSubCommandResult.rule?.isDefaultRule;
|
|
202
|
+
autoApproveReason = 'subCommand';
|
|
168
203
|
}
|
|
169
204
|
else if (commandLineResult.result === 'denied') {
|
|
170
205
|
this._logService.info('autoApprove: Command line DENIED auto approval');
|
|
206
|
+
isDenied = true;
|
|
207
|
+
autoApproveDefault = commandLineResult.rule?.isDefaultRule;
|
|
208
|
+
autoApproveReason = 'commandLine';
|
|
171
209
|
}
|
|
172
210
|
else {
|
|
173
211
|
if (subCommandResults.every(e => e.result === 'approved')) {
|
|
174
212
|
this._logService.info('autoApprove: All sub-commands auto-approved');
|
|
213
|
+
autoApproveReason = 'subCommand';
|
|
175
214
|
isAutoApproved = true;
|
|
215
|
+
autoApproveDefault = subCommandResults.every(e => e.rule?.isDefaultRule);
|
|
176
216
|
}
|
|
177
217
|
else {
|
|
178
218
|
this._logService.info('autoApprove: All sub-commands NOT auto-approved');
|
|
179
219
|
if (commandLineResult.result === 'approved') {
|
|
180
220
|
this._logService.info('autoApprove: Command line auto-approved');
|
|
221
|
+
autoApproveReason = 'commandLine';
|
|
181
222
|
isAutoApproved = true;
|
|
223
|
+
autoApproveDefault = commandLineResult.rule?.isDefaultRule;
|
|
182
224
|
}
|
|
183
225
|
else {
|
|
184
226
|
this._logService.info('autoApprove: Command line NOT auto-approved');
|
|
@@ -188,11 +230,47 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
188
230
|
for (const reason of autoApproveReasons) {
|
|
189
231
|
this._logService.info(`- ${reason}`);
|
|
190
232
|
}
|
|
191
|
-
|
|
233
|
+
const isAutoApproveEnabled = this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) === true;
|
|
234
|
+
const isAutoApproveWarningAccepted = this._storageService.getBoolean(TerminalToolConfirmationStorageKeys.TerminalAutoApproveWarningAccepted, StorageScope.APPLICATION, false);
|
|
235
|
+
const isAutoApproveAllowed = isAutoApproveEnabled && isAutoApproveWarningAccepted;
|
|
236
|
+
if (isAutoApproveEnabled) {
|
|
237
|
+
autoApproveInfo = this._createAutoApproveInfo(isAutoApproved, isDenied, autoApproveReason, subCommandResults, commandLineResult);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
isAutoApproved = false;
|
|
241
|
+
}
|
|
242
|
+
this._telemetry.logPrepare({
|
|
243
|
+
terminalToolSessionId,
|
|
244
|
+
subCommands,
|
|
245
|
+
autoApproveAllowed: !isAutoApproveEnabled ? 'off' : isAutoApproveWarningAccepted ? 'allowed' : 'needsOptIn',
|
|
246
|
+
autoApproveResult: isAutoApproved ? 'approved' : isDenied ? 'denied' : 'manual',
|
|
247
|
+
autoApproveReason,
|
|
248
|
+
autoApproveDefault
|
|
249
|
+
});
|
|
250
|
+
let disclaimer;
|
|
251
|
+
const subCommandsLowerFirstWordOnly = ( subCommands.map(command => command.split(' ')[0].toLowerCase()));
|
|
252
|
+
if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) ||
|
|
253
|
+
(isPowerShell(shell, os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
|
|
254
|
+
disclaimer = ( new MarkdownString(`$(${Codicon.info.id}) ` + ( localize(
|
|
255
|
+
11453,
|
|
256
|
+
'Web content may contain malicious code or attempt prompt injection attacks.'
|
|
257
|
+
)), { supportThemeIcons: true }));
|
|
258
|
+
}
|
|
259
|
+
let customActions;
|
|
260
|
+
if (!isAutoApproved && isAutoApproveEnabled) {
|
|
261
|
+
customActions = generateAutoApproveActions(actualCommand, subCommands, { subCommandResults, commandLineResult });
|
|
262
|
+
}
|
|
263
|
+
let shellType = basename(shell, '.exe');
|
|
264
|
+
if (shellType === 'powershell') {
|
|
265
|
+
shellType = 'pwsh';
|
|
266
|
+
}
|
|
267
|
+
confirmationMessages = (isAutoApproved && isAutoApproveAllowed) ? undefined : {
|
|
192
268
|
title: args.isBackground
|
|
193
|
-
? ( localize(
|
|
194
|
-
: ( localize(
|
|
269
|
+
? ( localize(11454, "Run `{0}` command? (background terminal)", shellType))
|
|
270
|
+
: ( localize(11455, "Run `{0}` command?", shellType)),
|
|
195
271
|
message: ( new MarkdownString(args.explanation)),
|
|
272
|
+
disclaimer,
|
|
273
|
+
terminalCustomActions: customActions,
|
|
196
274
|
};
|
|
197
275
|
}
|
|
198
276
|
return {
|
|
@@ -200,24 +278,32 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
200
278
|
presentation,
|
|
201
279
|
toolSpecificData: {
|
|
202
280
|
kind: 'terminal',
|
|
281
|
+
terminalToolSessionId,
|
|
203
282
|
commandLine: {
|
|
204
283
|
original: args.command,
|
|
205
284
|
toolEdited: toolEditedCommand
|
|
206
285
|
},
|
|
207
286
|
language,
|
|
287
|
+
alternativeRecommendation,
|
|
288
|
+
autoApproveInfo,
|
|
208
289
|
}
|
|
209
290
|
};
|
|
210
291
|
}
|
|
211
292
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
212
|
-
if (this._alternativeRecommendation) {
|
|
213
|
-
return this._alternativeRecommendation;
|
|
214
|
-
}
|
|
215
|
-
const args = invocation.parameters;
|
|
216
|
-
this._logService.debug(`RunInTerminalTool: Invoking with options ${JSON.stringify(args)}`);
|
|
217
293
|
const toolSpecificData = invocation.toolSpecificData;
|
|
218
294
|
if (!toolSpecificData) {
|
|
219
295
|
throw ( new Error('toolSpecificData must be provided for this tool'));
|
|
220
296
|
}
|
|
297
|
+
if (toolSpecificData.alternativeRecommendation) {
|
|
298
|
+
return {
|
|
299
|
+
content: [{
|
|
300
|
+
kind: 'text',
|
|
301
|
+
value: toolSpecificData.alternativeRecommendation
|
|
302
|
+
}]
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
const args = invocation.parameters;
|
|
306
|
+
this._logService.debug(`RunInTerminalTool: Invoking with options ${JSON.stringify(args)}`);
|
|
221
307
|
let toolResultMessage;
|
|
222
308
|
const chatSessionId = invocation.context?.sessionId ?? 'no-chat-session';
|
|
223
309
|
const command = toolSpecificData.commandLine.userEdited ?? toolSpecificData.commandLine.toolEdited ?? toolSpecificData.commandLine.original;
|
|
@@ -253,34 +339,36 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
253
339
|
}
|
|
254
340
|
inputUserSigint ||= data === '\x03';
|
|
255
341
|
}));
|
|
342
|
+
let outputMonitor;
|
|
256
343
|
if (args.isBackground) {
|
|
257
|
-
let
|
|
344
|
+
let pollingResult;
|
|
258
345
|
try {
|
|
259
346
|
this._logService.debug(`RunInTerminalTool: Starting background execution \`${command}\``);
|
|
260
|
-
const execution = ( new BackgroundTerminalExecution(toolTerminal.instance, xterm, command));
|
|
347
|
+
const execution = ( new BackgroundTerminalExecution(toolTerminal.instance, xterm, command, chatSessionId));
|
|
261
348
|
RunInTerminalTool_1._backgroundExecutions.set(termId, execution);
|
|
262
|
-
|
|
349
|
+
outputMonitor = store.add(this._instantiationService.createInstance(OutputMonitor, execution, undefined, invocation.context, token, command));
|
|
350
|
+
await Event.toPromise(outputMonitor.onDidFinishCommand);
|
|
351
|
+
const pollingResult = outputMonitor.pollingResult;
|
|
263
352
|
if (token.isCancellationRequested) {
|
|
264
353
|
throw ( new CancellationError());
|
|
265
354
|
}
|
|
266
|
-
if (!outputAndIdle.terminalExecutionIdleBeforeTimeout) {
|
|
267
|
-
outputAndIdle = await racePollingOrPrompt(() => pollForOutputAndIdle(execution, true, token, this._languageModelsService), () => promptForMorePolling(command, token, invocation.context, this._chatService), outputAndIdle, token, this._languageModelsService, execution);
|
|
268
|
-
if (token.isCancellationRequested) {
|
|
269
|
-
throw ( new CancellationError());
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
355
|
let resultText = (didUserEditCommand
|
|
273
356
|
? `Note: The user manually edited the command to \`${command}\`, and that command is now running in terminal with ID=${termId}`
|
|
274
357
|
: didToolEditCommand
|
|
275
358
|
? `Note: The tool simplified the command to \`${command}\`, and that command is now running in terminal with ID=${termId}`
|
|
276
359
|
: `Command is running in terminal with ID=${termId}`);
|
|
277
|
-
if (
|
|
278
|
-
resultText += `\n\ The command became idle with output:\n${
|
|
360
|
+
if (pollingResult && pollingResult.modelOutputEvalResponse) {
|
|
361
|
+
resultText += `\n\ The command became idle with output:\n${pollingResult.modelOutputEvalResponse}`;
|
|
279
362
|
}
|
|
280
|
-
else if (
|
|
281
|
-
resultText += `\n\ The command is still running, with output:\n${
|
|
363
|
+
else if (pollingResult) {
|
|
364
|
+
resultText += `\n\ The command is still running, with output:\n${pollingResult.output}`;
|
|
365
|
+
}
|
|
366
|
+
let toolResultMessage;
|
|
367
|
+
if (toolSpecificData.autoApproveInfo) {
|
|
368
|
+
toolResultMessage = toolSpecificData.autoApproveInfo.value;
|
|
282
369
|
}
|
|
283
370
|
return {
|
|
371
|
+
toolResultMessage: toolResultMessage ? ( new MarkdownString(toolResultMessage)) : undefined,
|
|
284
372
|
content: [{
|
|
285
373
|
kind: 'text',
|
|
286
374
|
value: resultText,
|
|
@@ -297,9 +385,10 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
297
385
|
}
|
|
298
386
|
finally {
|
|
299
387
|
store.dispose();
|
|
300
|
-
this._logService.debug(`RunInTerminalTool: Finished polling \`${
|
|
388
|
+
this._logService.debug(`RunInTerminalTool: Finished polling \`${pollingResult?.output.length}\` lines of output in \`${pollingResult?.pollDurationMs}\``);
|
|
301
389
|
const timingExecuteMs = Date.now() - timingStart;
|
|
302
|
-
this.
|
|
390
|
+
this._telemetry.logInvoke(toolTerminal.instance, {
|
|
391
|
+
terminalToolSessionId: toolSpecificData.terminalToolSessionId,
|
|
303
392
|
didUserEditCommand,
|
|
304
393
|
didToolEditCommand,
|
|
305
394
|
shellIntegrationQuality: toolTerminal.shellIntegrationQuality,
|
|
@@ -309,11 +398,14 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
309
398
|
isNewSession: true,
|
|
310
399
|
timingExecuteMs,
|
|
311
400
|
timingConnectMs,
|
|
312
|
-
terminalExecutionIdleBeforeTimeout:
|
|
313
|
-
outputLineCount:
|
|
314
|
-
pollDurationMs:
|
|
401
|
+
terminalExecutionIdleBeforeTimeout: pollingResult?.state === OutputMonitorState.Idle,
|
|
402
|
+
outputLineCount: 0,
|
|
403
|
+
pollDurationMs: pollingResult?.pollDurationMs,
|
|
315
404
|
inputUserChars,
|
|
316
405
|
inputUserSigint,
|
|
406
|
+
inputToolManualAcceptCount: outputMonitor?.outputMonitorTelemetryCounters.inputToolManualAcceptCount,
|
|
407
|
+
inputToolManualRejectCount: outputMonitor?.outputMonitorTelemetryCounters.inputToolManualRejectCount,
|
|
408
|
+
inputToolManualChars: outputMonitor?.outputMonitorTelemetryCounters.inputToolManualChars,
|
|
317
409
|
});
|
|
318
410
|
}
|
|
319
411
|
}
|
|
@@ -326,11 +418,12 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
326
418
|
const commandDetection = toolTerminal.instance.capabilities.get(TerminalCapability.CommandDetection);
|
|
327
419
|
switch (toolTerminal.shellIntegrationQuality) {
|
|
328
420
|
case ShellIntegrationQuality.None: {
|
|
329
|
-
strategy = this._instantiationService.createInstance(NoneExecuteStrategy, toolTerminal.instance);
|
|
421
|
+
strategy = this._instantiationService.createInstance(NoneExecuteStrategy, toolTerminal.instance, () => toolTerminal.receivedUserInput ?? false);
|
|
422
|
+
toolResultMessage = '$(info) Enable [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) to improve command detection';
|
|
330
423
|
break;
|
|
331
424
|
}
|
|
332
425
|
case ShellIntegrationQuality.Basic: {
|
|
333
|
-
strategy = this._instantiationService.createInstance(BasicExecuteStrategy, toolTerminal.instance, commandDetection);
|
|
426
|
+
strategy = this._instantiationService.createInstance(BasicExecuteStrategy, toolTerminal.instance, () => toolTerminal.receivedUserInput ?? false, commandDetection);
|
|
334
427
|
break;
|
|
335
428
|
}
|
|
336
429
|
case ShellIntegrationQuality.Rich: {
|
|
@@ -339,7 +432,11 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
339
432
|
}
|
|
340
433
|
}
|
|
341
434
|
this._logService.debug(`RunInTerminalTool: Using \`${strategy.type}\` execute strategy for command \`${command}\``);
|
|
435
|
+
store.add(strategy.onDidCreateStartMarker(startMarker => {
|
|
436
|
+
outputMonitor = store.add(this._instantiationService.createInstance(OutputMonitor, { instance: toolTerminal.instance, sessionId: invocation.context.sessionId, getOutput: (marker) => getOutput(toolTerminal.instance, marker ?? startMarker) }, undefined, invocation.context, token, command));
|
|
437
|
+
}));
|
|
342
438
|
const executeResult = await strategy.execute(command, token);
|
|
439
|
+
toolTerminal.receivedUserInput = false;
|
|
343
440
|
if (token.isCancellationRequested) {
|
|
344
441
|
throw ( new CancellationError());
|
|
345
442
|
}
|
|
@@ -365,7 +462,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
365
462
|
finally {
|
|
366
463
|
store.dispose();
|
|
367
464
|
const timingExecuteMs = Date.now() - timingStart;
|
|
368
|
-
this.
|
|
465
|
+
this._telemetry.logInvoke(toolTerminal.instance, {
|
|
466
|
+
terminalToolSessionId: toolSpecificData.terminalToolSessionId,
|
|
369
467
|
didUserEditCommand,
|
|
370
468
|
didToolEditCommand,
|
|
371
469
|
isBackground: false,
|
|
@@ -378,6 +476,11 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
378
476
|
timingConnectMs,
|
|
379
477
|
inputUserChars,
|
|
380
478
|
inputUserSigint,
|
|
479
|
+
terminalExecutionIdleBeforeTimeout: undefined,
|
|
480
|
+
pollDurationMs: undefined,
|
|
481
|
+
inputToolManualAcceptCount: outputMonitor?.outputMonitorTelemetryCounters?.inputToolManualAcceptCount,
|
|
482
|
+
inputToolManualRejectCount: outputMonitor?.outputMonitorTelemetryCounters?.inputToolManualRejectCount,
|
|
483
|
+
inputToolManualChars: outputMonitor?.outputMonitorTelemetryCounters?.inputToolManualChars,
|
|
381
484
|
});
|
|
382
485
|
}
|
|
383
486
|
const resultText = [];
|
|
@@ -388,8 +491,16 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
388
491
|
resultText.push(`Note: The tool simplified the command to \`${command}\`, and this is the output of running that command instead:\n`);
|
|
389
492
|
}
|
|
390
493
|
resultText.push(terminalResult);
|
|
494
|
+
if (toolSpecificData.autoApproveInfo) {
|
|
495
|
+
if (toolResultMessage) {
|
|
496
|
+
toolResultMessage = `${toolSpecificData.autoApproveInfo.value}\n\n${toolResultMessage}`;
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
toolResultMessage = toolSpecificData.autoApproveInfo.value;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
391
502
|
return {
|
|
392
|
-
toolResultMessage,
|
|
503
|
+
toolResultMessage: toolResultMessage ? ( new MarkdownString(toolResultMessage)) : undefined,
|
|
393
504
|
content: [{
|
|
394
505
|
kind: 'text',
|
|
395
506
|
value: resultText.join(''),
|
|
@@ -397,9 +508,21 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
397
508
|
};
|
|
398
509
|
}
|
|
399
510
|
}
|
|
511
|
+
async _getCopilotShell() {
|
|
512
|
+
const defaultShell = await this._terminalProfileResolverService.getDefaultShell({
|
|
513
|
+
os: await this._osBackend,
|
|
514
|
+
remoteAuthority: this._remoteAgentService.getConnection()?.remoteAuthority
|
|
515
|
+
});
|
|
516
|
+
if (basename(defaultShell) === 'cmd.exe') {
|
|
517
|
+
return 'C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe';
|
|
518
|
+
}
|
|
519
|
+
return defaultShell;
|
|
520
|
+
}
|
|
400
521
|
async _initBackgroundTerminal(chatSessionId, termId, token) {
|
|
401
522
|
this._logService.debug(`RunInTerminalTool: Creating background terminal with ID=${termId}`);
|
|
402
|
-
const
|
|
523
|
+
const shell = await this._getCopilotShell();
|
|
524
|
+
const toolTerminal = await this._terminalToolCreator.createTerminal(shell, token);
|
|
525
|
+
this._registerInputListener(toolTerminal);
|
|
403
526
|
this._sessionTerminalAssociations.set(chatSessionId, toolTerminal);
|
|
404
527
|
if (token.isCancellationRequested) {
|
|
405
528
|
toolTerminal.instance.dispose();
|
|
@@ -412,9 +535,12 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
412
535
|
const cachedTerminal = this._sessionTerminalAssociations.get(chatSessionId);
|
|
413
536
|
if (cachedTerminal) {
|
|
414
537
|
this._logService.debug(`RunInTerminalTool: Using cached foreground terminal with session ID \`${chatSessionId}\``);
|
|
538
|
+
this._terminalToolCreator.refreshShellIntegrationQuality(cachedTerminal);
|
|
415
539
|
return cachedTerminal;
|
|
416
540
|
}
|
|
417
|
-
const
|
|
541
|
+
const shell = await this._getCopilotShell();
|
|
542
|
+
const toolTerminal = await this._terminalToolCreator.createTerminal(shell, token);
|
|
543
|
+
this._registerInputListener(toolTerminal);
|
|
418
544
|
this._sessionTerminalAssociations.set(chatSessionId, toolTerminal);
|
|
419
545
|
if (token.isCancellationRequested) {
|
|
420
546
|
toolTerminal.instance.dispose();
|
|
@@ -423,46 +549,16 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
423
549
|
await this._setupProcessIdAssociation(toolTerminal, chatSessionId, termId, false);
|
|
424
550
|
return toolTerminal;
|
|
425
551
|
}
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
const cdPrefixMatch = commandLine.match(isPwsh
|
|
431
|
-
? /^(?:cd(?: \/d)?|Set-Location(?: -Path)?) (?<dir>[^\s]+) ?(?:&&|;)\s+(?<suffix>.+)$/i
|
|
432
|
-
: /^cd (?<dir>[^\s]+) &&\s+(?<suffix>.+)$/);
|
|
433
|
-
const cdDir = cdPrefixMatch?.groups?.dir;
|
|
434
|
-
const cdSuffix = cdPrefixMatch?.groups?.suffix;
|
|
435
|
-
if (cdDir && cdSuffix) {
|
|
436
|
-
let cwd;
|
|
437
|
-
if (instance) {
|
|
438
|
-
cwd = await instance.getCwdResource();
|
|
439
|
-
}
|
|
440
|
-
if (!cwd) {
|
|
441
|
-
const workspaceFolders = this._workspaceContextService.getWorkspace().folders;
|
|
442
|
-
if (workspaceFolders.length === 1) {
|
|
443
|
-
cwd = workspaceFolders[0].uri;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
if (cwd) {
|
|
447
|
-
let cdDirPath = cdDir;
|
|
448
|
-
if (cdDirPath.startsWith('"') && cdDirPath.endsWith('"')) {
|
|
449
|
-
cdDirPath = cdDirPath.slice(1, -1);
|
|
450
|
-
}
|
|
451
|
-
cdDirPath = cdDirPath.replace(/(?:[\\\/])$/, '');
|
|
452
|
-
let cwdFsPath = cwd.fsPath.replace(/(?:[\\\/])$/, '');
|
|
453
|
-
if (os === OperatingSystem.Windows) {
|
|
454
|
-
cdDirPath = cdDirPath.toLowerCase();
|
|
455
|
-
cwdFsPath = cwdFsPath.toLowerCase();
|
|
456
|
-
}
|
|
457
|
-
if (cdDirPath === cwdFsPath) {
|
|
458
|
-
return cdSuffix;
|
|
459
|
-
}
|
|
552
|
+
_registerInputListener(toolTerminal) {
|
|
553
|
+
const disposable = toolTerminal.instance.onData(data => {
|
|
554
|
+
if (!telemetryIgnoredSequences.includes(data)) {
|
|
555
|
+
toolTerminal.receivedUserInput = data.length > 0;
|
|
460
556
|
}
|
|
461
|
-
}
|
|
462
|
-
|
|
557
|
+
});
|
|
558
|
+
this._register(toolTerminal.instance.onDisposed(() => disposable.dispose()));
|
|
463
559
|
}
|
|
464
560
|
_restoreTerminalAssociations() {
|
|
465
|
-
const storedAssociations = this._storageService.get(
|
|
561
|
+
const storedAssociations = this._storageService.get(TerminalToolStorageKeysInternal.TerminalSession, StorageScope.WORKSPACE, '{}');
|
|
466
562
|
try {
|
|
467
563
|
const associations = JSON.parse(storedAssociations);
|
|
468
564
|
for (const instance of this._terminalService.instances) {
|
|
@@ -501,7 +597,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
501
597
|
timeout(5000).then(() => { throw ( new Error('Timeout')); })
|
|
502
598
|
]);
|
|
503
599
|
if (typeof pid === 'number') {
|
|
504
|
-
const storedAssociations = this._storageService.get(
|
|
600
|
+
const storedAssociations = this._storageService.get(TerminalToolStorageKeysInternal.TerminalSession, StorageScope.WORKSPACE, '{}');
|
|
505
601
|
const associations = JSON.parse(storedAssociations);
|
|
506
602
|
const existingAssociation = associations[pid] || {};
|
|
507
603
|
associations[pid] = {
|
|
@@ -511,7 +607,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
511
607
|
id,
|
|
512
608
|
isBackground
|
|
513
609
|
};
|
|
514
|
-
this._storageService.store(
|
|
610
|
+
this._storageService.store(TerminalToolStorageKeysInternal.TerminalSession, JSON.stringify(associations), StorageScope.WORKSPACE, StorageTarget.USER);
|
|
515
611
|
this._logService.debug(`RunInTerminalTool: Associated terminal PID ${pid} with session ${sessionId}`);
|
|
516
612
|
}
|
|
517
613
|
}
|
|
@@ -521,11 +617,11 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
521
617
|
}
|
|
522
618
|
async _removeProcessIdAssociation(pid) {
|
|
523
619
|
try {
|
|
524
|
-
const storedAssociations = this._storageService.get(
|
|
620
|
+
const storedAssociations = this._storageService.get(TerminalToolStorageKeysInternal.TerminalSession, StorageScope.WORKSPACE, '{}');
|
|
525
621
|
const associations = JSON.parse(storedAssociations);
|
|
526
622
|
if (associations[pid]) {
|
|
527
623
|
delete associations[pid];
|
|
528
|
-
this._storageService.store(
|
|
624
|
+
this._storageService.store(TerminalToolStorageKeysInternal.TerminalSession, JSON.stringify(associations), StorageScope.WORKSPACE, StorageTarget.USER);
|
|
529
625
|
this._logService.debug(`RunInTerminalTool: Removed terminal association for PID ${pid}`);
|
|
530
626
|
}
|
|
531
627
|
}
|
|
@@ -551,49 +647,102 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
551
647
|
}
|
|
552
648
|
}
|
|
553
649
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
650
|
+
_createAutoApproveInfo(isAutoApproved, isDenied, autoApproveReason, subCommandResults, commandLineResult) {
|
|
651
|
+
function formatRuleLinks(result) {
|
|
652
|
+
return ( asArray(result).map(e => {
|
|
653
|
+
return `[\`${e.rule.sourceText}\`](settings_${e.rule.sourceTarget} "${( localize(11456, 'View rule in settings'))}")`;
|
|
654
|
+
})).join(', ');
|
|
655
|
+
}
|
|
656
|
+
const config = this._configurationService.inspect(ChatConfiguration.GlobalAutoApprove);
|
|
657
|
+
const isGlobalAutoApproved = config?.value ?? config.defaultValue;
|
|
658
|
+
if (isGlobalAutoApproved) {
|
|
659
|
+
return (new MarkdownString(`_${( localize(
|
|
660
|
+
11457,
|
|
661
|
+
'Auto approved by setting {0}',
|
|
662
|
+
`[\`${ChatConfiguration.GlobalAutoApprove}\`](settings_global "${( localize(11458, 'View settings'))}")`
|
|
663
|
+
))}_`));
|
|
664
|
+
}
|
|
665
|
+
if (isAutoApproved) {
|
|
666
|
+
switch (autoApproveReason) {
|
|
667
|
+
case 'commandLine': {
|
|
668
|
+
if (commandLineResult.rule) {
|
|
669
|
+
return (new MarkdownString(
|
|
670
|
+
`_${( localize(11459, 'Auto approved by rule {0}', formatRuleLinks(commandLineResult)))}_`
|
|
671
|
+
));
|
|
672
|
+
}
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
case 'subCommand': {
|
|
676
|
+
const uniqueRules = Array.from(( new Set(subCommandResults)));
|
|
677
|
+
if (uniqueRules.length === 1) {
|
|
678
|
+
return (new MarkdownString(
|
|
679
|
+
`_${( localize(11459, 'Auto approved by rule {0}', formatRuleLinks(uniqueRules)))}_`
|
|
680
|
+
));
|
|
681
|
+
}
|
|
682
|
+
else if (uniqueRules.length > 1) {
|
|
683
|
+
return (new MarkdownString(
|
|
684
|
+
`_${( localize(11460, 'Auto approved by rules {0}', formatRuleLinks(uniqueRules)))}_`
|
|
685
|
+
));
|
|
686
|
+
}
|
|
687
|
+
break;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
else if (isDenied) {
|
|
692
|
+
switch (autoApproveReason) {
|
|
693
|
+
case 'commandLine': {
|
|
694
|
+
if (commandLineResult.rule) {
|
|
695
|
+
return (new MarkdownString(`_${( localize(
|
|
696
|
+
11461,
|
|
697
|
+
'Auto approval denied by rule {0}',
|
|
698
|
+
formatRuleLinks(commandLineResult)
|
|
699
|
+
))}_`));
|
|
700
|
+
}
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
case 'subCommand': {
|
|
704
|
+
const deniedRules = subCommandResults.filter(e => e.result === 'denied');
|
|
705
|
+
const uniqueRules = Array.from(( new Set(deniedRules)));
|
|
706
|
+
if (uniqueRules.length === 1) {
|
|
707
|
+
return (new MarkdownString(
|
|
708
|
+
`_${( localize(11461, 'Auto approval denied by rule {0}', formatRuleLinks(uniqueRules)))}_`
|
|
709
|
+
));
|
|
710
|
+
}
|
|
711
|
+
else if (uniqueRules.length > 1) {
|
|
712
|
+
return (new MarkdownString(
|
|
713
|
+
`_${( localize(11462, 'Auto approval denied by rules {0}', formatRuleLinks(uniqueRules)))}_`
|
|
714
|
+
));
|
|
715
|
+
}
|
|
716
|
+
break;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return undefined;
|
|
571
721
|
}
|
|
572
722
|
};
|
|
573
723
|
RunInTerminalTool = RunInTerminalTool_1 = ( __decorate([
|
|
574
724
|
( __param(0, IInstantiationService)),
|
|
575
|
-
( __param(1,
|
|
576
|
-
( __param(2,
|
|
577
|
-
( __param(3,
|
|
725
|
+
( __param(1, IConfigurationService)),
|
|
726
|
+
( __param(2, ILanguageModelToolsService)),
|
|
727
|
+
( __param(3, IStorageService)),
|
|
578
728
|
( __param(4, ITerminalLogService)),
|
|
579
729
|
( __param(5, ITerminalProfileResolverService)),
|
|
580
730
|
( __param(6, ITerminalService)),
|
|
581
731
|
( __param(7, IRemoteAgentService)),
|
|
582
|
-
( __param(8, IChatService))
|
|
583
|
-
( __param(9, IWorkspaceContextService)),
|
|
584
|
-
( __param(10, ILanguageModelsService))
|
|
732
|
+
( __param(8, IChatService))
|
|
585
733
|
], RunInTerminalTool));
|
|
586
734
|
class BackgroundTerminalExecution extends Disposable {
|
|
587
|
-
constructor(instance, _xterm, _commandLine) {
|
|
735
|
+
constructor(instance, _xterm, _commandLine, sessionId) {
|
|
588
736
|
super();
|
|
589
737
|
this.instance = instance;
|
|
590
738
|
this._xterm = _xterm;
|
|
591
739
|
this._commandLine = _commandLine;
|
|
740
|
+
this.sessionId = sessionId;
|
|
592
741
|
this._startMarker = this._register(this._xterm.raw.registerMarker());
|
|
593
742
|
this.instance.runCommand(this._commandLine, true);
|
|
594
743
|
}
|
|
595
|
-
getOutput() {
|
|
596
|
-
return getOutput(this.instance, this._startMarker);
|
|
744
|
+
getOutput(marker) {
|
|
745
|
+
return getOutput(this.instance, marker ?? this._startMarker);
|
|
597
746
|
}
|
|
598
747
|
}
|
|
599
748
|
|