@codingame/monaco-vscode-katex-common 30.0.1 → 31.0.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 +3 -3
- package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +16 -0
- package/vscode/src/vs/platform/actions/browser/actionbar.js +22 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +50 -0
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +138 -0
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +12 -0
- package/vscode/src/vs/platform/networkFilter/common/settings.js +14 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +18 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +13 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +73 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +51 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +64 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +17 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +73 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +20 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +73 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +41 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +13 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +14 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +11 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +339 -161
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +33 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +43 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +147 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +55 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +42 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animation.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.js +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/buffer.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/media/chatIncrementalRendering.css +112 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +24 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +111 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +425 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +16 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +68 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +101 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +36 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +217 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +23 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +168 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +18 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +7 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +7 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +24 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +104 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +11 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +257 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +286 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +25 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +29 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +258 -321
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +392 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +24 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +38 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +577 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +4 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +1 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +58 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +44 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +362 -188
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +42 -95
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +9 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +57 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +21 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/{modelPickerActionItem2.js → modelPickerActionItem.js} +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +38 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +94 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +218 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +12 -21
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +355 -156
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +2 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +72 -65
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +4 -43
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +238 -204
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +4 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +128 -115
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +6 -9
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +152 -49
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +64 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +40 -40
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/terminalContribChatExports.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +165 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +163 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +144 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +174 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +43 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +256 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +94 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +221 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +392 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +243 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +10 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +310 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +168 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +32 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +108 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +412 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +42 -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/outputAnalyzer.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +192 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +2258 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +43 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +118 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +141 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +608 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +0 -196
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +0 -215
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +0 -107
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
4
|
+
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
+
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { isNumber } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
|
+
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
9
|
+
import { trackIdleOnPrompt, waitForIdle } from './executeStrategy.js';
|
|
10
|
+
import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
|
|
11
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
12
|
+
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
13
|
+
|
|
14
|
+
let BasicExecuteStrategy = class BasicExecuteStrategy extends Disposable {
|
|
15
|
+
constructor(
|
|
16
|
+
_instance,
|
|
17
|
+
_hasReceivedUserInput,
|
|
18
|
+
_commandDetection,
|
|
19
|
+
_configurationService,
|
|
20
|
+
_logService
|
|
21
|
+
) {
|
|
22
|
+
super();
|
|
23
|
+
this._instance = _instance;
|
|
24
|
+
this._hasReceivedUserInput = _hasReceivedUserInput;
|
|
25
|
+
this._commandDetection = _commandDetection;
|
|
26
|
+
this._configurationService = _configurationService;
|
|
27
|
+
this._logService = _logService;
|
|
28
|
+
this.type = "basic";
|
|
29
|
+
this._startMarker = this._register(( new MutableDisposable()));
|
|
30
|
+
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
31
|
+
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
32
|
+
}
|
|
33
|
+
async execute(commandLine, token, commandId, _commandLineForMetadata) {
|
|
34
|
+
const store = ( new DisposableStore());
|
|
35
|
+
this._register(store);
|
|
36
|
+
try {
|
|
37
|
+
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
38
|
+
const idlePromptPromise = trackIdleOnPrompt(this._instance, idlePollInterval, store, idlePollInterval);
|
|
39
|
+
const onDone = Promise.race([
|
|
40
|
+
Event.toPromise(this._commandDetection.onCommandFinished, store).then(e => {
|
|
41
|
+
this._log("onDone 1 of 2 via end event, waiting for short idle prompt");
|
|
42
|
+
return idlePromptPromise.then(() => {
|
|
43
|
+
this._log("onDone 2 of 2 via short idle prompt");
|
|
44
|
+
return {
|
|
45
|
+
"type": "success",
|
|
46
|
+
command: e
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}),
|
|
50
|
+
Event.toPromise(token.onCancellationRequested, store).then(() => {
|
|
51
|
+
this._log("onDone via cancellation");
|
|
52
|
+
}),
|
|
53
|
+
Event.toPromise(this._instance.onDisposed, store).then(() => {
|
|
54
|
+
this._log("onDone via terminal disposal");
|
|
55
|
+
return {
|
|
56
|
+
type: "disposal"
|
|
57
|
+
};
|
|
58
|
+
}),
|
|
59
|
+
trackIdleOnPrompt(this._instance, idlePollInterval * 3, store, idlePollInterval).then(() => {
|
|
60
|
+
this._log("onDone long idle prompt");
|
|
61
|
+
})
|
|
62
|
+
]);
|
|
63
|
+
this._log("Waiting for xterm");
|
|
64
|
+
const xterm = await this._instance.xtermReadyPromise;
|
|
65
|
+
if (!xterm) {
|
|
66
|
+
throw ( new Error("Xterm is not available"));
|
|
67
|
+
}
|
|
68
|
+
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
69
|
+
this._log("Waiting for idle");
|
|
70
|
+
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
71
|
+
const markerRecreation = setupRecreatingStartMarker(
|
|
72
|
+
xterm,
|
|
73
|
+
this._startMarker,
|
|
74
|
+
m => this._onDidCreateStartMarker.fire(m),
|
|
75
|
+
store,
|
|
76
|
+
this._log.bind(this)
|
|
77
|
+
);
|
|
78
|
+
if (this._hasReceivedUserInput()) {
|
|
79
|
+
this._log("Command timed out, sending SIGINT and retrying");
|
|
80
|
+
await this._instance.sendText("\u0003", false);
|
|
81
|
+
await waitForIdle(this._instance.onData, 100);
|
|
82
|
+
}
|
|
83
|
+
if (commandId) {
|
|
84
|
+
this._log(
|
|
85
|
+
`In basic execute strategy: skipping pre-bound command id ${commandId} because basic shell integration executes via sendText`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
this._log(`Executing command line \`${commandLine}\``);
|
|
89
|
+
markerRecreation.dispose();
|
|
90
|
+
const forceBracketedPasteMode = isMacintosh;
|
|
91
|
+
this._instance.sendText(commandLine, true, forceBracketedPasteMode);
|
|
92
|
+
this._log("Waiting for done event");
|
|
93
|
+
const onDoneResult = await Promise.race([onDone, alternateBufferPromise.then(() => ({
|
|
94
|
+
type: "alternateBuffer"
|
|
95
|
+
}))]);
|
|
96
|
+
if (onDoneResult && onDoneResult.type === "disposal") {
|
|
97
|
+
throw ( new Error("The terminal was closed"));
|
|
98
|
+
}
|
|
99
|
+
if (onDoneResult && onDoneResult.type === "alternateBuffer") {
|
|
100
|
+
this._log("Detected alternate buffer entry, skipping output capture");
|
|
101
|
+
return {
|
|
102
|
+
output: undefined,
|
|
103
|
+
exitCode: undefined,
|
|
104
|
+
error: "alternateBuffer",
|
|
105
|
+
didEnterAltBuffer: true
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
const finishedCommand = onDoneResult && onDoneResult.type === "success" ? onDoneResult.command : undefined;
|
|
109
|
+
if (finishedCommand) {
|
|
110
|
+
this._log(
|
|
111
|
+
`Finished command id=${finishedCommand.id ?? "none"} for requested=${commandId ?? "none"}`
|
|
112
|
+
);
|
|
113
|
+
} else if (commandId) {
|
|
114
|
+
this._log(`No finished command surfaced for requested=${commandId}`);
|
|
115
|
+
}
|
|
116
|
+
this._log("Waiting for idle");
|
|
117
|
+
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
118
|
+
if (token.isCancellationRequested) {
|
|
119
|
+
throw ( new CancellationError());
|
|
120
|
+
}
|
|
121
|
+
const endMarker = store.add(xterm.raw.registerMarker());
|
|
122
|
+
let output;
|
|
123
|
+
const additionalInformationLines = [];
|
|
124
|
+
if (finishedCommand) {
|
|
125
|
+
const commandOutput = finishedCommand?.getOutput();
|
|
126
|
+
if (commandOutput !== undefined) {
|
|
127
|
+
this._log("Fetched output via finished command");
|
|
128
|
+
output = stripCommandEchoAndPrompt(commandOutput, commandLine, this._log.bind(this));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (output === undefined) {
|
|
132
|
+
try {
|
|
133
|
+
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
134
|
+
this._log("Fetched output via markers");
|
|
135
|
+
if (output !== undefined) {
|
|
136
|
+
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
137
|
+
}
|
|
138
|
+
} catch {
|
|
139
|
+
this._log("Failed to fetch output via markers");
|
|
140
|
+
additionalInformationLines.push("Failed to retrieve command output");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (output !== undefined && output.trim().length === 0) {
|
|
144
|
+
additionalInformationLines.push("Command produced no output");
|
|
145
|
+
}
|
|
146
|
+
const exitCode = finishedCommand?.exitCode;
|
|
147
|
+
if (isNumber(exitCode) && exitCode > 0) {
|
|
148
|
+
additionalInformationLines.push(`Command exited with code ${exitCode}`);
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
output,
|
|
152
|
+
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
153
|
+
exitCode
|
|
154
|
+
};
|
|
155
|
+
} finally {
|
|
156
|
+
store.dispose();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
_log(message) {
|
|
160
|
+
this._logService.debug(`RunInTerminalTool#Basic: ${message}`);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
BasicExecuteStrategy = ( __decorate([( __param(3, IConfigurationService)), ( __param(4, ITerminalLogService))], BasicExecuteStrategy));
|
|
164
|
+
|
|
165
|
+
export { BasicExecuteStrategy };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import type { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
+
import { DisposableStore, type IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
5
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
6
|
+
export interface ITerminalExecuteStrategy extends IDisposable {
|
|
7
|
+
readonly type: "rich" | "basic" | "none";
|
|
8
|
+
/**
|
|
9
|
+
* Executes a command line and gets a result designed to be passed directly to an LLM. The
|
|
10
|
+
* result will include information about the exit code.
|
|
11
|
+
* @param commandLine The command line to execute
|
|
12
|
+
* @param token Cancellation token
|
|
13
|
+
* @param commandId Optional predefined command ID to link the command
|
|
14
|
+
* @param commandLineForMetadata Optional command line to report in terminal execution metadata.
|
|
15
|
+
* This can differ from the command line that is sent to the shell, for example when the command
|
|
16
|
+
* is wrapped for sandbox execution.
|
|
17
|
+
*/
|
|
18
|
+
execute(commandLine: string, token: CancellationToken, commandId?: string, commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
19
|
+
readonly onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
20
|
+
}
|
|
21
|
+
export interface ITerminalExecuteStrategyResult {
|
|
22
|
+
output: string | undefined;
|
|
23
|
+
additionalInformation?: string;
|
|
24
|
+
exitCode?: number;
|
|
25
|
+
error?: string;
|
|
26
|
+
didEnterAltBuffer?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function waitForIdle(onData: Event<unknown>, idleDurationMs: number): Promise<void>;
|
|
29
|
+
export interface IPromptDetectionResult {
|
|
30
|
+
/**
|
|
31
|
+
* Whether a prompt was detected.
|
|
32
|
+
*/
|
|
33
|
+
detected: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The reason for logging.
|
|
36
|
+
*/
|
|
37
|
+
reason?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Detects if the given text content appears to end with a common prompt pattern.
|
|
41
|
+
*/
|
|
42
|
+
export declare function detectsCommonPromptPattern(cursorLine: string): IPromptDetectionResult;
|
|
43
|
+
/**
|
|
44
|
+
* Enhanced version of {@link waitForIdle} that uses prompt detection heuristics. After the terminal
|
|
45
|
+
* idles for the specified period, checks if the terminal's cursor line looks like a common prompt.
|
|
46
|
+
* If not, extends the timeout to give the command more time to complete.
|
|
47
|
+
*/
|
|
48
|
+
export declare function waitForIdleWithPromptHeuristics(onData: Event<unknown>, instance: ITerminalInstance, idlePollIntervalMs: number, extendedTimeoutMs: number): Promise<IPromptDetectionResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Tracks the terminal for being idle on a prompt input. This must be called before `executeCommand`
|
|
51
|
+
* is called.
|
|
52
|
+
*/
|
|
53
|
+
export declare function trackIdleOnPrompt(instance: ITerminalInstance, idleDurationMs: number, store: DisposableStore, promptFallbackMs?: number): Promise<void>;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
|
|
2
|
+
import { DeferredPromise, RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
3
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
|
|
5
|
+
async function waitForIdle(onData, idleDurationMs) {
|
|
6
|
+
const store = ( new DisposableStore());
|
|
7
|
+
const deferred = ( new DeferredPromise());
|
|
8
|
+
const scheduler = store.add(( new RunOnceScheduler(() => deferred.complete(), idleDurationMs)));
|
|
9
|
+
store.add(onData(() => scheduler.schedule()));
|
|
10
|
+
scheduler.schedule();
|
|
11
|
+
return deferred.p.finally(() => store.dispose());
|
|
12
|
+
}
|
|
13
|
+
function detectsCommonPromptPattern(cursorLine) {
|
|
14
|
+
if (cursorLine.trim().length === 0) {
|
|
15
|
+
return {
|
|
16
|
+
detected: false,
|
|
17
|
+
reason: "Content is empty or contains only whitespace"
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (/PS\s+[A-Z]:\\.*>\s*$/.test(cursorLine)) {
|
|
21
|
+
return {
|
|
22
|
+
detected: true,
|
|
23
|
+
reason: `PowerShell prompt pattern detected: "${cursorLine}"`
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (/^[A-Z]:\\.*>\s*$/.test(cursorLine)) {
|
|
27
|
+
return {
|
|
28
|
+
detected: true,
|
|
29
|
+
reason: `Command Prompt pattern detected: "${cursorLine}"`
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (/\$\s*$/.test(cursorLine)) {
|
|
33
|
+
return {
|
|
34
|
+
detected: true,
|
|
35
|
+
reason: `Bash-style prompt pattern detected: "${cursorLine}"`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (/#\s*$/.test(cursorLine)) {
|
|
39
|
+
return {
|
|
40
|
+
detected: true,
|
|
41
|
+
reason: `Root prompt pattern detected: "${cursorLine}"`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (/^>>>\s*$/.test(cursorLine)) {
|
|
45
|
+
return {
|
|
46
|
+
detected: true,
|
|
47
|
+
reason: `Python REPL prompt pattern detected: "${cursorLine}"`
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if (/\u276f\s*$/.test(cursorLine)) {
|
|
51
|
+
return {
|
|
52
|
+
detected: true,
|
|
53
|
+
reason: `Starship prompt pattern detected: "${cursorLine}"`
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (/[>%]\s*$/.test(cursorLine)) {
|
|
57
|
+
return {
|
|
58
|
+
detected: true,
|
|
59
|
+
reason: `Generic prompt pattern detected: "${cursorLine}"`
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
detected: false,
|
|
64
|
+
reason: `No common prompt pattern found in last line: "${cursorLine}"`
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
async function waitForIdleWithPromptHeuristics(onData, instance, idlePollIntervalMs, extendedTimeoutMs) {
|
|
68
|
+
await waitForIdle(onData, idlePollIntervalMs);
|
|
69
|
+
const xterm = await instance.xtermReadyPromise;
|
|
70
|
+
if (!xterm) {
|
|
71
|
+
return {
|
|
72
|
+
detected: false,
|
|
73
|
+
reason: `Xterm not available, using ${idlePollIntervalMs}ms timeout`
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const startTime = Date.now();
|
|
77
|
+
while (Date.now() - startTime < extendedTimeoutMs) {
|
|
78
|
+
try {
|
|
79
|
+
let content = "";
|
|
80
|
+
const buffer = xterm.raw.buffer.active;
|
|
81
|
+
const line = buffer.getLine(buffer.baseY + buffer.cursorY);
|
|
82
|
+
if (line) {
|
|
83
|
+
content = line.translateToString(true);
|
|
84
|
+
}
|
|
85
|
+
const promptResult = detectsCommonPromptPattern(content);
|
|
86
|
+
if (promptResult.detected) {
|
|
87
|
+
return promptResult;
|
|
88
|
+
}
|
|
89
|
+
} catch (error) {}
|
|
90
|
+
await waitForIdle(
|
|
91
|
+
onData,
|
|
92
|
+
Math.min(idlePollIntervalMs, extendedTimeoutMs - (Date.now() - startTime))
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
let content = "";
|
|
97
|
+
const buffer = xterm.raw.buffer.active;
|
|
98
|
+
const line = buffer.getLine(buffer.baseY + buffer.cursorY);
|
|
99
|
+
if (line) {
|
|
100
|
+
content = line.translateToString(true) + "\n";
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
detected: false,
|
|
104
|
+
reason: `Extended timeout reached without prompt detection. Last line: "${content.trim()}"`
|
|
105
|
+
};
|
|
106
|
+
} catch (error) {
|
|
107
|
+
return {
|
|
108
|
+
detected: false,
|
|
109
|
+
reason: `Extended timeout reached. Error reading terminal content: ${error}`
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async function trackIdleOnPrompt(instance, idleDurationMs, store, promptFallbackMs) {
|
|
114
|
+
const idleOnPrompt = ( new DeferredPromise());
|
|
115
|
+
const onData = instance.onData;
|
|
116
|
+
const scheduler = store.add(( new RunOnceScheduler(() => {
|
|
117
|
+
idleOnPrompt.complete();
|
|
118
|
+
}, idleDurationMs)));
|
|
119
|
+
let state = 0 ;
|
|
120
|
+
const promptFallbackScheduler = store.add(( new RunOnceScheduler(() => {
|
|
121
|
+
if (state === 2 || state === 3 ) {
|
|
122
|
+
promptFallbackScheduler.cancel();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
state = 3 ;
|
|
126
|
+
scheduler.schedule();
|
|
127
|
+
}, promptFallbackMs ?? 1000)));
|
|
128
|
+
let TerminalState;
|
|
129
|
+
(function(TerminalState) {
|
|
130
|
+
TerminalState[TerminalState["Initial"] = 0] = "Initial";
|
|
131
|
+
TerminalState[TerminalState["Prompt"] = 1] = "Prompt";
|
|
132
|
+
TerminalState[TerminalState["Executing"] = 2] = "Executing";
|
|
133
|
+
TerminalState[TerminalState["PromptAfterExecuting"] = 3] = "PromptAfterExecuting";
|
|
134
|
+
})(TerminalState || (TerminalState = {}));
|
|
135
|
+
store.add(onData(e => {
|
|
136
|
+
const matches = e.matchAll(/(?:\x1b\]|\x9d)[16]33;(?<type>[ACD])(?:;.*)?(?:\x1b\\|\x07|\x9c)/g);
|
|
137
|
+
for (const match of matches) {
|
|
138
|
+
if (match.groups?.type === "A") {
|
|
139
|
+
if (state === 0 ) {
|
|
140
|
+
state = 1 ;
|
|
141
|
+
} else if (state === 2 ) {
|
|
142
|
+
state = 3 ;
|
|
143
|
+
}
|
|
144
|
+
} else if (match.groups?.type === "C" || match.groups?.type === "D") {
|
|
145
|
+
state = 2 ;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (state === 3 ) {
|
|
149
|
+
promptFallbackScheduler.cancel();
|
|
150
|
+
scheduler.schedule();
|
|
151
|
+
} else {
|
|
152
|
+
scheduler.cancel();
|
|
153
|
+
if (state === 0 || state === 1 ) {
|
|
154
|
+
promptFallbackScheduler.schedule();
|
|
155
|
+
} else {
|
|
156
|
+
promptFallbackScheduler.cancel();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}));
|
|
160
|
+
return idleOnPrompt.p;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { detectsCommonPromptPattern, trackIdleOnPrompt, waitForIdle, waitForIdleWithPromptHeuristics };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
6
|
+
import { type ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
|
7
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
8
|
+
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
9
|
+
/**
|
|
10
|
+
* This strategy is used when no shell integration is available. There are very few extension APIs
|
|
11
|
+
* available in this case. This uses similar strategies to the basic integration strategy, but
|
|
12
|
+
* with `sendText` instead of `shellIntegration.executeCommand` and relying on idle events instead
|
|
13
|
+
* of execution events.
|
|
14
|
+
*/
|
|
15
|
+
export declare class NoneExecuteStrategy extends Disposable implements ITerminalExecuteStrategy {
|
|
16
|
+
private readonly _instance;
|
|
17
|
+
private readonly _hasReceivedUserInput;
|
|
18
|
+
private readonly _configurationService;
|
|
19
|
+
private readonly _logService;
|
|
20
|
+
readonly type = "none";
|
|
21
|
+
private readonly _startMarker;
|
|
22
|
+
private readonly _onDidCreateStartMarker;
|
|
23
|
+
onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
24
|
+
constructor(_instance: ITerminalInstance, _hasReceivedUserInput: () => boolean, _configurationService: IConfigurationService, _logService: ITerminalLogService);
|
|
25
|
+
execute(commandLine: string, token: CancellationToken, _commandId?: string, _commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
26
|
+
private _log;
|
|
27
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
4
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
+
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
8
|
+
import { waitForIdle, waitForIdleWithPromptHeuristics } from './executeStrategy.js';
|
|
9
|
+
import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
|
|
10
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
11
|
+
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
12
|
+
|
|
13
|
+
let NoneExecuteStrategy = class NoneExecuteStrategy extends Disposable {
|
|
14
|
+
constructor(_instance, _hasReceivedUserInput, _configurationService, _logService) {
|
|
15
|
+
super();
|
|
16
|
+
this._instance = _instance;
|
|
17
|
+
this._hasReceivedUserInput = _hasReceivedUserInput;
|
|
18
|
+
this._configurationService = _configurationService;
|
|
19
|
+
this._logService = _logService;
|
|
20
|
+
this.type = "none";
|
|
21
|
+
this._startMarker = this._register(( new MutableDisposable()));
|
|
22
|
+
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
23
|
+
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
24
|
+
}
|
|
25
|
+
async execute(commandLine, token, _commandId, _commandLineForMetadata) {
|
|
26
|
+
const store = ( new DisposableStore());
|
|
27
|
+
try {
|
|
28
|
+
if (token.isCancellationRequested) {
|
|
29
|
+
throw ( new CancellationError());
|
|
30
|
+
}
|
|
31
|
+
this._log("Waiting for xterm");
|
|
32
|
+
const xterm = await this._instance.xtermReadyPromise;
|
|
33
|
+
if (!xterm) {
|
|
34
|
+
throw ( new Error("Xterm is not available"));
|
|
35
|
+
}
|
|
36
|
+
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
37
|
+
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
38
|
+
this._log("Waiting for idle");
|
|
39
|
+
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
40
|
+
if (token.isCancellationRequested) {
|
|
41
|
+
throw ( new CancellationError());
|
|
42
|
+
}
|
|
43
|
+
const markerRecreation = setupRecreatingStartMarker(
|
|
44
|
+
xterm,
|
|
45
|
+
this._startMarker,
|
|
46
|
+
m => this._onDidCreateStartMarker.fire(m),
|
|
47
|
+
store,
|
|
48
|
+
this._log.bind(this)
|
|
49
|
+
);
|
|
50
|
+
if (this._hasReceivedUserInput()) {
|
|
51
|
+
this._log("Command timed out, sending SIGINT and retrying");
|
|
52
|
+
await this._instance.sendText("\u0003", false);
|
|
53
|
+
await waitForIdle(this._instance.onData, 100);
|
|
54
|
+
}
|
|
55
|
+
this._log(`Executing command line \`${commandLine}\``);
|
|
56
|
+
markerRecreation.dispose();
|
|
57
|
+
const startLine = this._startMarker.value?.line;
|
|
58
|
+
const forceBracketedPasteMode = isMacintosh;
|
|
59
|
+
this._instance.sendText(commandLine, true, forceBracketedPasteMode);
|
|
60
|
+
if (startLine !== undefined) {
|
|
61
|
+
this._log("Waiting for cursor to move past start line");
|
|
62
|
+
const cursorMovedPromise = ( new Promise(resolve => {
|
|
63
|
+
const check = () => {
|
|
64
|
+
const buffer = xterm.raw.buffer.active;
|
|
65
|
+
const cursorLine = buffer.baseY + buffer.cursorY;
|
|
66
|
+
if (cursorLine > startLine) {
|
|
67
|
+
resolve();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const listener = this._instance.onData(() => check());
|
|
71
|
+
store.add(listener);
|
|
72
|
+
check();
|
|
73
|
+
}));
|
|
74
|
+
const cursorMoveTimeout = ( new Promise(resolve => {
|
|
75
|
+
const handle = setTimeout(() => resolve("timeout"), 1000);
|
|
76
|
+
store.add({
|
|
77
|
+
dispose: () => clearTimeout(handle)
|
|
78
|
+
});
|
|
79
|
+
}));
|
|
80
|
+
const raceResult = await Promise.race([cursorMovedPromise, cursorMoveTimeout]);
|
|
81
|
+
if (raceResult === "timeout") {
|
|
82
|
+
this._log(
|
|
83
|
+
"Cursor did not move past start line before timeout, proceeding with idle detection"
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
this._log("Waiting for idle with prompt heuristics");
|
|
88
|
+
const promptResultOrAltBuffer = await Promise.race([waitForIdleWithPromptHeuristics(
|
|
89
|
+
this._instance.onData,
|
|
90
|
+
this._instance,
|
|
91
|
+
idlePollInterval,
|
|
92
|
+
idlePollInterval * 10
|
|
93
|
+
), alternateBufferPromise.then(() => "alternateBuffer")]);
|
|
94
|
+
if (promptResultOrAltBuffer === "alternateBuffer") {
|
|
95
|
+
this._log("Detected alternate buffer entry, skipping output capture");
|
|
96
|
+
return {
|
|
97
|
+
output: undefined,
|
|
98
|
+
additionalInformation: undefined,
|
|
99
|
+
exitCode: undefined,
|
|
100
|
+
error: "alternateBuffer",
|
|
101
|
+
didEnterAltBuffer: true
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const promptResult = promptResultOrAltBuffer;
|
|
105
|
+
this._log(
|
|
106
|
+
`Prompt detection result: ${promptResult.detected ? "detected" : "not detected"} - ${promptResult.reason}`
|
|
107
|
+
);
|
|
108
|
+
if (token.isCancellationRequested) {
|
|
109
|
+
throw ( new CancellationError());
|
|
110
|
+
}
|
|
111
|
+
const endMarker = store.add(xterm.raw.registerMarker());
|
|
112
|
+
let output;
|
|
113
|
+
const additionalInformationLines = [];
|
|
114
|
+
try {
|
|
115
|
+
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
116
|
+
this._log("Fetched output via markers");
|
|
117
|
+
if (output !== undefined) {
|
|
118
|
+
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
119
|
+
}
|
|
120
|
+
} catch {
|
|
121
|
+
this._log("Failed to fetch output via markers");
|
|
122
|
+
additionalInformationLines.push("Failed to retrieve command output");
|
|
123
|
+
}
|
|
124
|
+
if (output !== undefined && output.trim().length === 0) {
|
|
125
|
+
additionalInformationLines.push("Command produced no output");
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
output,
|
|
129
|
+
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
130
|
+
exitCode: undefined
|
|
131
|
+
};
|
|
132
|
+
} finally {
|
|
133
|
+
store.dispose();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
_log(message) {
|
|
137
|
+
this._logService.debug(`RunInTerminalTool#None: ${message}`);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
NoneExecuteStrategy = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ITerminalLogService))], NoneExecuteStrategy));
|
|
141
|
+
|
|
142
|
+
export { NoneExecuteStrategy };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import type { ICommandDetectionCapability } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
|
|
6
|
+
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
7
|
+
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
8
|
+
import { type ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
|
9
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
10
|
+
/**
|
|
11
|
+
* This strategy is used when the terminal has rich shell integration/command detection is
|
|
12
|
+
* available, meaning every sequence we rely upon should be exactly where we expect it to be. In
|
|
13
|
+
* particular (`633;`) `A, B, E, C, D` all happen in exactly that order. While things still could go
|
|
14
|
+
* wrong in this state, minimal verification is done in this mode since rich command detection is a
|
|
15
|
+
* strong signal that it's behaving correctly.
|
|
16
|
+
*/
|
|
17
|
+
export declare class RichExecuteStrategy extends Disposable implements ITerminalExecuteStrategy {
|
|
18
|
+
private readonly _instance;
|
|
19
|
+
private readonly _commandDetection;
|
|
20
|
+
private readonly _configurationService;
|
|
21
|
+
private readonly _logService;
|
|
22
|
+
readonly type = "rich";
|
|
23
|
+
private readonly _startMarker;
|
|
24
|
+
private readonly _onDidCreateStartMarker;
|
|
25
|
+
onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
26
|
+
constructor(_instance: ITerminalInstance, _commandDetection: ICommandDetectionCapability, _configurationService: IConfigurationService, _logService: ITerminalLogService);
|
|
27
|
+
execute(commandLine: string, token: CancellationToken, commandId?: string, commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
28
|
+
private _log;
|
|
29
|
+
}
|