@codingame/monaco-vscode-katex-common 33.0.9 → 34.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 +2 -2
- package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.css +169 -0
- package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.d.ts +28 -0
- package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.js +61 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +1 -1
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +18 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +40 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.d.ts +1 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.js +4 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.d.ts +16 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.js +81 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.js +5 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionUri.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionUri.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css +18 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -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 +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +177 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +69 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +25 -1
- 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/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/chatCollapsibleContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +4 -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.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.d.ts +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.js +140 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.js +134 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +49 -117
- 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.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +47 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +52 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +18 -14
- 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 +23 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +13 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +87 -11
- 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 +21 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +102 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- 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.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +6 -2
- 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/chatInputOutputMarkdownProgressPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +21 -2
- 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 +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +35 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +62 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
- 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.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +15 -12
- 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/chatToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +13 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +4 -4
- 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 +19 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +154 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +17 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +113 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.js +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +18 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +361 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +11 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +133 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +13 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatGoalBannerWidget.css +81 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +32 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +39 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +23 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +66 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +373 -32
- 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 +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +18 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +54 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +30 -30
- 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/platform/actionWidget/browser/actionWidgetDropdown.d.ts +0 -76
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +0 -191
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +0 -50
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +0 -138
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +0 -12
- package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -14
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +0 -18
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -13
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +0 -87
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminal/terminalContribChatExports.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +0 -142
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +0 -232
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +0 -225
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +0 -143
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +0 -205
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +0 -174
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +0 -43
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +0 -260
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +0 -98
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +0 -225
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +0 -392
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +0 -243
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +0 -53
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +0 -310
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +0 -177
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +0 -33
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +0 -102
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +0 -29
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +0 -33
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +0 -53
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +0 -177
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +0 -512
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +0 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -258
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +0 -2623
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +0 -43
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +0 -58
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +0 -223
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +0 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +0 -302
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +0 -114
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +0 -788
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
class SedFileWriteParser {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.commandName = 'sed';
|
|
6
|
-
}
|
|
7
|
-
canHandle(commandText) {
|
|
8
|
-
if (!commandText.match(/^sed\s+/)) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
const inPlaceRegex = /(?:^|\s)(-[a-zA-Z]*[iI][a-zA-Z]*\S*|--in-place(?:=\S*)?|(-i|-I)\s*'[^']*'|(-i|-I)\s*"[^"]*")(?:\s|$)/;
|
|
12
|
-
return inPlaceRegex.test(commandText);
|
|
13
|
-
}
|
|
14
|
-
extractFileWrites(commandText) {
|
|
15
|
-
const tokens = this._tokenizeCommand(commandText);
|
|
16
|
-
return this._extractFileTargets(tokens);
|
|
17
|
-
}
|
|
18
|
-
_tokenizeCommand(commandText) {
|
|
19
|
-
const tokens = [];
|
|
20
|
-
let current = '';
|
|
21
|
-
let inSingleQuote = false;
|
|
22
|
-
let inDoubleQuote = false;
|
|
23
|
-
let escaped = false;
|
|
24
|
-
for (let i = 0; i < commandText.length; i++) {
|
|
25
|
-
const char = commandText[i];
|
|
26
|
-
if (escaped) {
|
|
27
|
-
current += char;
|
|
28
|
-
escaped = false;
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
if (char === '\\' && !inSingleQuote) {
|
|
32
|
-
escaped = true;
|
|
33
|
-
current += char;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (char === '\'' && !inDoubleQuote) {
|
|
37
|
-
inSingleQuote = !inSingleQuote;
|
|
38
|
-
current += char;
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
if (char === '"' && !inSingleQuote) {
|
|
42
|
-
inDoubleQuote = !inDoubleQuote;
|
|
43
|
-
current += char;
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
if (/\s/.test(char) && !inSingleQuote && !inDoubleQuote) {
|
|
47
|
-
if (current) {
|
|
48
|
-
tokens.push(current);
|
|
49
|
-
current = '';
|
|
50
|
-
}
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
current += char;
|
|
54
|
-
}
|
|
55
|
-
if (current) {
|
|
56
|
-
tokens.push(current);
|
|
57
|
-
}
|
|
58
|
-
return tokens;
|
|
59
|
-
}
|
|
60
|
-
_extractFileTargets(tokens) {
|
|
61
|
-
if (tokens.length === 0 || tokens[0] !== 'sed') {
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
const files = [];
|
|
65
|
-
let i = 1;
|
|
66
|
-
let foundScript = false;
|
|
67
|
-
while (i < tokens.length) {
|
|
68
|
-
const token = tokens[i];
|
|
69
|
-
if (token.startsWith('--')) {
|
|
70
|
-
if (token === '--in-place' || token.startsWith('--in-place=')) {
|
|
71
|
-
i++;
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
if (token === '--expression' || token === '--file') {
|
|
75
|
-
i += 2;
|
|
76
|
-
foundScript = true;
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (token.startsWith('--expression=') || token.startsWith('--file=')) {
|
|
80
|
-
i++;
|
|
81
|
-
foundScript = true;
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
i++;
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
if (token.startsWith('-') && token.length > 1 && token[1] !== '-') {
|
|
88
|
-
const flags = token.slice(1);
|
|
89
|
-
const iIndex = flags.indexOf('i');
|
|
90
|
-
const IIndex = flags.indexOf('I');
|
|
91
|
-
const inPlaceIndex = iIndex >= 0 ? iIndex : IIndex;
|
|
92
|
-
if (inPlaceIndex >= 0 && inPlaceIndex < flags.length - 1) {
|
|
93
|
-
i++;
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
if ((flags.endsWith('i') || flags.endsWith('I')) && i + 1 < tokens.length) {
|
|
97
|
-
const nextToken = tokens[i + 1];
|
|
98
|
-
if (nextToken === '\'\'' || nextToken === '""') {
|
|
99
|
-
i += 2;
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
if ((nextToken.startsWith('\'') && nextToken.endsWith('\'')) || (nextToken.startsWith('"') && nextToken.endsWith('"'))) {
|
|
103
|
-
const unquoted = nextToken.slice(1, -1);
|
|
104
|
-
if (unquoted.startsWith('.') && unquoted.length <= 10 && !unquoted.includes('/')) {
|
|
105
|
-
i += 2;
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (flags.includes('e') || flags.includes('f')) {
|
|
111
|
-
const eIndex = flags.indexOf('e');
|
|
112
|
-
const fIndex = flags.indexOf('f');
|
|
113
|
-
const optIndex = eIndex >= 0 ? eIndex : fIndex;
|
|
114
|
-
if (optIndex < flags.length - 1) {
|
|
115
|
-
foundScript = true;
|
|
116
|
-
i++;
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
foundScript = true;
|
|
120
|
-
i += 2;
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
i++;
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
if (!foundScript) {
|
|
127
|
-
foundScript = true;
|
|
128
|
-
i++;
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
let file = token;
|
|
132
|
-
if ((file.startsWith('\'') && file.endsWith('\'')) || (file.startsWith('"') && file.endsWith('"'))) {
|
|
133
|
-
file = file.slice(1, -1);
|
|
134
|
-
}
|
|
135
|
-
files.push(file);
|
|
136
|
-
i++;
|
|
137
|
-
}
|
|
138
|
-
return files;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export { SedFileWriteParser };
|
|
@@ -1,52 +0,0 @@
|
|
|
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 ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
|
8
|
-
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
9
|
-
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
10
|
-
/**
|
|
11
|
-
* This strategy is used when shell integration is enabled, but rich command detection was not
|
|
12
|
-
* declared by the shell script. This is the large spectrum between rich command detection and no
|
|
13
|
-
* shell integration, here are some problems that are expected:
|
|
14
|
-
*
|
|
15
|
-
* - `133;C` command executed may not happen.
|
|
16
|
-
* - `633;E` comamnd line reporting will likely not happen, so the command line contained in the
|
|
17
|
-
* execution start and end events will be of low confidence and chances are it will be wrong.
|
|
18
|
-
* - Execution tracking may be incorrect, particularly when `executeCommand` calls are overlapped,
|
|
19
|
-
* such as Python activating the environment at the same time as Copilot executing a command. So
|
|
20
|
-
* the end event for the execution may actually correspond to a different command.
|
|
21
|
-
*
|
|
22
|
-
* This strategy focuses on trying to get the most accurate output given these limitations and
|
|
23
|
-
* unknowns. Basically we cannot fully trust the extension APIs in this case, so polling of the data
|
|
24
|
-
* stream is used to detect idling, and we listen to the terminal's data stream instead of the
|
|
25
|
-
* execution's data stream.
|
|
26
|
-
*
|
|
27
|
-
* This is best effort with the goal being the output is accurate, though it may contain some
|
|
28
|
-
* content above and below the command output, such as prompts or even possibly other command
|
|
29
|
-
* output. We lean on the LLM to be able to differentiate the actual output from prompts and bad
|
|
30
|
-
* output when it's not ideal.
|
|
31
|
-
*/
|
|
32
|
-
export declare class BasicExecuteStrategy extends Disposable implements ITerminalExecuteStrategy {
|
|
33
|
-
private readonly _instance;
|
|
34
|
-
private readonly _hasReceivedUserInput;
|
|
35
|
-
private readonly _commandDetection;
|
|
36
|
-
private readonly _configurationService;
|
|
37
|
-
private readonly _logService;
|
|
38
|
-
readonly type = "basic";
|
|
39
|
-
private readonly _startMarker;
|
|
40
|
-
private readonly _onDidCreateStartMarker;
|
|
41
|
-
onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
42
|
-
/**
|
|
43
|
-
* Tracks per-execute() DisposableStores so they can be cleaned up if the
|
|
44
|
-
* strategy is disposed mid-flight, AND removed from this collection on
|
|
45
|
-
* successful completion to avoid accumulating stale references when
|
|
46
|
-
* execute() is invoked many times on the same strategy instance.
|
|
47
|
-
*/
|
|
48
|
-
private readonly _executionStores;
|
|
49
|
-
constructor(_instance: ITerminalInstance, _hasReceivedUserInput: () => boolean, _commandDetection: ICommandDetectionCapability, _configurationService: IConfigurationService, _logService: ITerminalLogService);
|
|
50
|
-
execute(commandLine: string, token: CancellationToken, commandId?: string, _commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
51
|
-
private _log;
|
|
52
|
-
}
|
|
@@ -1,232 +0,0 @@
|
|
|
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
|
-
import { isMultilineCommand } from '../runInTerminalHelpers.js';
|
|
14
|
-
|
|
15
|
-
function isTerminalLaunchError(value) {
|
|
16
|
-
return typeof value === "object" && value !== null && "message" in value;
|
|
17
|
-
}
|
|
18
|
-
function formatExitCodeOrError(exitCodeOrError) {
|
|
19
|
-
if (isTerminalLaunchError(exitCodeOrError)) {
|
|
20
|
-
return `launch error: ${exitCodeOrError.message}${exitCodeOrError.code !== undefined ? `, code=${exitCodeOrError.code}` : ""}`;
|
|
21
|
-
}
|
|
22
|
-
return `code=${exitCodeOrError}`;
|
|
23
|
-
}
|
|
24
|
-
function extractExitCode(exitCodeOrError) {
|
|
25
|
-
if (isNumber(exitCodeOrError)) {
|
|
26
|
-
return exitCodeOrError;
|
|
27
|
-
}
|
|
28
|
-
if (isTerminalLaunchError(exitCodeOrError)) {
|
|
29
|
-
return exitCodeOrError.code;
|
|
30
|
-
}
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
let BasicExecuteStrategy = class BasicExecuteStrategy extends Disposable {
|
|
34
|
-
constructor(
|
|
35
|
-
_instance,
|
|
36
|
-
_hasReceivedUserInput,
|
|
37
|
-
_commandDetection,
|
|
38
|
-
_configurationService,
|
|
39
|
-
_logService
|
|
40
|
-
) {
|
|
41
|
-
super();
|
|
42
|
-
this._instance = _instance;
|
|
43
|
-
this._hasReceivedUserInput = _hasReceivedUserInput;
|
|
44
|
-
this._commandDetection = _commandDetection;
|
|
45
|
-
this._configurationService = _configurationService;
|
|
46
|
-
this._logService = _logService;
|
|
47
|
-
this.type = "basic";
|
|
48
|
-
this._startMarker = this._register(( new MutableDisposable()));
|
|
49
|
-
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
50
|
-
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
51
|
-
this._executionStores = this._register(( new DisposableStore()));
|
|
52
|
-
}
|
|
53
|
-
async execute(commandLine, token, commandId, _commandLineForMetadata) {
|
|
54
|
-
const store = ( new DisposableStore());
|
|
55
|
-
this._executionStores.add(store);
|
|
56
|
-
try {
|
|
57
|
-
if (this._instance.isDisposed) {
|
|
58
|
-
this._log("Terminal already disposed at strategy entry");
|
|
59
|
-
throw ( new Error("The terminal was closed"));
|
|
60
|
-
}
|
|
61
|
-
if (this._instance.exitCode !== undefined) {
|
|
62
|
-
this._log(
|
|
63
|
-
`Terminal pty already exited at strategy entry (code=${this._instance.exitCode})`
|
|
64
|
-
);
|
|
65
|
-
return {
|
|
66
|
-
output: undefined,
|
|
67
|
-
exitCode: this._instance.exitCode,
|
|
68
|
-
additionalInformation: `Command exited with code ${this._instance.exitCode}`
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
72
|
-
const staleMarker = this._commandDetection.executingCommandObject?.marker;
|
|
73
|
-
const onCommandFinishedFiltered = staleMarker ? Event.filter(
|
|
74
|
-
this._commandDetection.onCommandFinished,
|
|
75
|
-
e => e.marker !== staleMarker,
|
|
76
|
-
store
|
|
77
|
-
) : this._commandDetection.onCommandFinished;
|
|
78
|
-
const idlePromptPromise = trackIdleOnPrompt(
|
|
79
|
-
this._instance,
|
|
80
|
-
idlePollInterval,
|
|
81
|
-
store,
|
|
82
|
-
idlePollInterval,
|
|
83
|
-
this._logService
|
|
84
|
-
);
|
|
85
|
-
const onDone = Promise.race([Event.toPromise(onCommandFinishedFiltered, store).then(e => {
|
|
86
|
-
this._log("onDone 1 of 2 via end event, waiting for short idle prompt");
|
|
87
|
-
return idlePromptPromise.then(() => {
|
|
88
|
-
this._log("onDone 2 of 2 via short idle prompt");
|
|
89
|
-
return {
|
|
90
|
-
"type": "success",
|
|
91
|
-
command: e
|
|
92
|
-
};
|
|
93
|
-
});
|
|
94
|
-
}), Event.toPromise(token.onCancellationRequested, store).then(() => {
|
|
95
|
-
this._log("onDone via cancellation");
|
|
96
|
-
}), Event.toPromise(this._instance.onDisposed, store).then(() => {
|
|
97
|
-
this._log("onDone via terminal disposal");
|
|
98
|
-
return {
|
|
99
|
-
type: "disposal"
|
|
100
|
-
};
|
|
101
|
-
}), Event.toPromise(this._instance.onExit, store).then(exitCodeOrError => {
|
|
102
|
-
this._log(`onDone via process exit (${formatExitCodeOrError(exitCodeOrError)})`);
|
|
103
|
-
return {
|
|
104
|
-
type: "processExit",
|
|
105
|
-
exitCodeOrError
|
|
106
|
-
};
|
|
107
|
-
}),
|
|
108
|
-
trackIdleOnPrompt(
|
|
109
|
-
this._instance,
|
|
110
|
-
idlePollInterval * 3,
|
|
111
|
-
store,
|
|
112
|
-
idlePollInterval,
|
|
113
|
-
this._logService
|
|
114
|
-
).then(() => {
|
|
115
|
-
this._log("onDone long idle prompt");
|
|
116
|
-
})]);
|
|
117
|
-
this._log("Waiting for xterm");
|
|
118
|
-
const xterm = await this._instance.xtermReadyPromise;
|
|
119
|
-
if (!xterm) {
|
|
120
|
-
throw ( new Error("Xterm is not available"));
|
|
121
|
-
}
|
|
122
|
-
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
123
|
-
this._log("Waiting for idle");
|
|
124
|
-
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
125
|
-
const markerRecreation = setupRecreatingStartMarker(
|
|
126
|
-
xterm,
|
|
127
|
-
this._startMarker,
|
|
128
|
-
m => this._onDidCreateStartMarker.fire(m),
|
|
129
|
-
store,
|
|
130
|
-
this._log.bind(this)
|
|
131
|
-
);
|
|
132
|
-
if (this._hasReceivedUserInput()) {
|
|
133
|
-
if (this._commandDetection.executingCommandObject !== undefined) {
|
|
134
|
-
this._log(
|
|
135
|
-
"Previous command still executing with pending input, sending SIGINT before retrying"
|
|
136
|
-
);
|
|
137
|
-
await this._instance.sendText("\u0003", false);
|
|
138
|
-
await waitForIdle(this._instance.onData, 100);
|
|
139
|
-
} else {
|
|
140
|
-
this._log("Prompt is idle; clearing pending input with Ctrl+U instead of SIGINT");
|
|
141
|
-
await this._instance.sendText("\u0015", false);
|
|
142
|
-
await waitForIdle(this._instance.onData, 100);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
if (commandId) {
|
|
146
|
-
this._log(
|
|
147
|
-
`In basic execute strategy: skipping pre-bound command id ${commandId} because basic shell integration executes via sendText`
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
this._log(`Executing command line \`${commandLine}\``);
|
|
151
|
-
markerRecreation.dispose();
|
|
152
|
-
const forceBracketedPasteMode = isMacintosh || isMultilineCommand(commandLine);
|
|
153
|
-
this._instance.sendText(commandLine, true, forceBracketedPasteMode);
|
|
154
|
-
this._log("Waiting for done event");
|
|
155
|
-
const onDoneResult = await Promise.race([onDone, alternateBufferPromise.then(() => ({
|
|
156
|
-
type: "alternateBuffer"
|
|
157
|
-
}))]);
|
|
158
|
-
if (onDoneResult && onDoneResult.type === "disposal") {
|
|
159
|
-
throw ( new Error("The terminal was closed"));
|
|
160
|
-
}
|
|
161
|
-
if (onDoneResult && onDoneResult.type === "alternateBuffer") {
|
|
162
|
-
this._log("Detected alternate buffer entry, skipping output capture");
|
|
163
|
-
return {
|
|
164
|
-
output: undefined,
|
|
165
|
-
exitCode: undefined,
|
|
166
|
-
error: "alternateBuffer",
|
|
167
|
-
didEnterAltBuffer: true
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
const finishedCommand = onDoneResult && onDoneResult.type === "success" ? onDoneResult.command : undefined;
|
|
171
|
-
if (finishedCommand) {
|
|
172
|
-
this._log(
|
|
173
|
-
`Finished command id=${finishedCommand.id ?? "none"} for requested=${commandId ?? "none"}`
|
|
174
|
-
);
|
|
175
|
-
} else if (commandId) {
|
|
176
|
-
this._log(`No finished command surfaced for requested=${commandId}`);
|
|
177
|
-
}
|
|
178
|
-
if (!(onDoneResult && onDoneResult.type === "processExit")) {
|
|
179
|
-
this._log("Waiting for idle");
|
|
180
|
-
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
181
|
-
}
|
|
182
|
-
if (token.isCancellationRequested) {
|
|
183
|
-
throw ( new CancellationError());
|
|
184
|
-
}
|
|
185
|
-
const endMarker = store.add(xterm.raw.registerMarker());
|
|
186
|
-
let output;
|
|
187
|
-
const additionalInformationLines = [];
|
|
188
|
-
if (finishedCommand) {
|
|
189
|
-
const commandOutput = finishedCommand?.getOutput();
|
|
190
|
-
if (commandOutput !== undefined) {
|
|
191
|
-
this._log("Fetched output via finished command");
|
|
192
|
-
output = stripCommandEchoAndPrompt(commandOutput, commandLine, this._log.bind(this));
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
if (output === undefined) {
|
|
196
|
-
try {
|
|
197
|
-
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
198
|
-
this._log("Fetched output via markers");
|
|
199
|
-
if (output !== undefined) {
|
|
200
|
-
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
201
|
-
}
|
|
202
|
-
} catch {
|
|
203
|
-
this._log("Failed to fetch output via markers");
|
|
204
|
-
additionalInformationLines.push("Failed to retrieve command output");
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
if (output !== undefined && output.trim().length === 0) {
|
|
208
|
-
additionalInformationLines.push("Command produced no output");
|
|
209
|
-
}
|
|
210
|
-
let exitCode = finishedCommand?.exitCode;
|
|
211
|
-
if (exitCode === undefined && onDoneResult && onDoneResult.type === "processExit") {
|
|
212
|
-
exitCode = extractExitCode(onDoneResult.exitCodeOrError);
|
|
213
|
-
}
|
|
214
|
-
if (isNumber(exitCode) && exitCode > 0) {
|
|
215
|
-
additionalInformationLines.push(`Command exited with code ${exitCode}`);
|
|
216
|
-
}
|
|
217
|
-
return {
|
|
218
|
-
output,
|
|
219
|
-
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
220
|
-
exitCode
|
|
221
|
-
};
|
|
222
|
-
} finally {
|
|
223
|
-
this._executionStores.delete(store);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
_log(message) {
|
|
227
|
-
this._logService.debug(`RunInTerminalTool#Basic: ${message}`);
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
BasicExecuteStrategy = ( __decorate([( __param(3, IConfigurationService)), ( __param(4, ITerminalLogService))], BasicExecuteStrategy));
|
|
231
|
-
|
|
232
|
-
export { BasicExecuteStrategy };
|
|
@@ -1,65 +0,0 @@
|
|
|
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 { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
5
|
-
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
6
|
-
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
7
|
-
export interface ITerminalExecuteStrategy extends IDisposable {
|
|
8
|
-
readonly type: "rich" | "basic" | "none";
|
|
9
|
-
/**
|
|
10
|
-
* Executes a command line and gets a result designed to be passed directly to an LLM. The
|
|
11
|
-
* result will include information about the exit code.
|
|
12
|
-
* @param commandLine The command line to execute
|
|
13
|
-
* @param token Cancellation token
|
|
14
|
-
* @param commandId Optional predefined command ID to link the command
|
|
15
|
-
* @param commandLineForMetadata Optional command line to report in terminal execution metadata.
|
|
16
|
-
* This can differ from the command line that is sent to the shell, for example when the command
|
|
17
|
-
* is wrapped for sandbox execution.
|
|
18
|
-
*/
|
|
19
|
-
execute(commandLine: string, token: CancellationToken, commandId?: string, commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
20
|
-
readonly onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
21
|
-
}
|
|
22
|
-
export interface ITerminalExecuteStrategyResult {
|
|
23
|
-
output: string | undefined;
|
|
24
|
-
additionalInformation?: string;
|
|
25
|
-
exitCode?: number;
|
|
26
|
-
error?: string;
|
|
27
|
-
didEnterAltBuffer?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare function waitForIdle(onData: Event<unknown>, idleDurationMs: number): Promise<void>;
|
|
30
|
-
export interface IPromptDetectionResult {
|
|
31
|
-
/**
|
|
32
|
-
* Whether a prompt was detected.
|
|
33
|
-
*/
|
|
34
|
-
detected: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The reason for logging.
|
|
37
|
-
*/
|
|
38
|
-
reason?: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Detects if the given text content appears to end with a common prompt pattern.
|
|
42
|
-
*/
|
|
43
|
-
export declare function detectsCommonPromptPattern(cursorLine: string): IPromptDetectionResult;
|
|
44
|
-
/**
|
|
45
|
-
* Enhanced version of {@link waitForIdle} that uses prompt detection heuristics. After the terminal
|
|
46
|
-
* idles for the specified period, checks if the terminal's cursor line looks like a common prompt.
|
|
47
|
-
* If not, extends the timeout to give the command more time to complete.
|
|
48
|
-
*/
|
|
49
|
-
export declare function waitForIdleWithPromptHeuristics(onData: Event<unknown>, instance: ITerminalInstance, idlePollIntervalMs: number, extendedTimeoutMs: number): Promise<IPromptDetectionResult>;
|
|
50
|
-
/**
|
|
51
|
-
* Tracks the terminal for being idle on a prompt input. This must be called before `executeCommand`
|
|
52
|
-
* is called.
|
|
53
|
-
*/
|
|
54
|
-
export interface ITrackIdleOnPromptOptions {
|
|
55
|
-
/**
|
|
56
|
-
* When true, disables all fallback schedulers: the initial prompt fallback,
|
|
57
|
-
* the data-idle executing fallback, and the hard-cap safety net. Use this
|
|
58
|
-
* for sync (foreground) commands that should block until the command truly
|
|
59
|
-
* finishes rather than being abandoned after an idle period. In sync mode
|
|
60
|
-
* the overall chat-request timeout or user-specified timeout is the safety
|
|
61
|
-
* net instead.
|
|
62
|
-
*/
|
|
63
|
-
disableFallbacks?: boolean;
|
|
64
|
-
}
|
|
65
|
-
export declare function trackIdleOnPrompt(instance: ITerminalInstance, idleDurationMs: number, store: DisposableStore, promptFallbackMs?: number, logService?: ITerminalLogService, options?: ITrackIdleOnPromptOptions): Promise<void>;
|