@codingame/monaco-vscode-katex-common 33.0.7 → 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 +3 -3
- 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,177 +0,0 @@
|
|
|
1
|
-
import { 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 { IToolInvocationContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
5
|
-
import { ITaskService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskService.service";
|
|
6
|
-
import { IExecution, IPollingResult, OutputMonitorState } from "./types.js";
|
|
7
|
-
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
8
|
-
export interface IOutputMonitor extends Disposable {
|
|
9
|
-
readonly pollingResult: IPollingResult & {
|
|
10
|
-
pollDurationMs: number;
|
|
11
|
-
} | undefined;
|
|
12
|
-
readonly outputMonitorTelemetryCounters: IOutputMonitorTelemetryCounters;
|
|
13
|
-
readonly onDidFinishCommand: Event<void>;
|
|
14
|
-
readonly onDidDetectInputNeeded: Event<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Fires when the terminal is detected to be waiting for sensitive input
|
|
17
|
-
* (e.g. a password, passphrase, token, secret or verification code). This
|
|
18
|
-
* is fired *instead of* {@link onDidDetectInputNeeded} so callers can show
|
|
19
|
-
* UI that focuses the terminal rather than routing the prompt through the
|
|
20
|
-
* agent.
|
|
21
|
-
*/
|
|
22
|
-
readonly onDidDetectSensitiveInputNeeded: Event<void>;
|
|
23
|
-
}
|
|
24
|
-
export interface IOutputMonitorTelemetryCounters {
|
|
25
|
-
inputToolManualAcceptCount: number;
|
|
26
|
-
inputToolManualRejectCount: number;
|
|
27
|
-
inputToolManualChars: number;
|
|
28
|
-
inputToolAutoAcceptCount: number;
|
|
29
|
-
inputToolAutoChars: number;
|
|
30
|
-
inputToolManualShownCount: number;
|
|
31
|
-
inputToolFreeFormInputShownCount: number;
|
|
32
|
-
inputToolFreeFormInputCount: number;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Returns the last visible line from terminal output after trimming trailing line breaks.
|
|
36
|
-
*/
|
|
37
|
-
export declare function getLastLine(output: string | undefined): string;
|
|
38
|
-
export declare class OutputMonitor extends Disposable implements IOutputMonitor {
|
|
39
|
-
private readonly _execution;
|
|
40
|
-
private readonly _pollFn;
|
|
41
|
-
private readonly _taskService;
|
|
42
|
-
private readonly _logService;
|
|
43
|
-
private _state;
|
|
44
|
-
get state(): OutputMonitorState;
|
|
45
|
-
private _formatLastLineForLog;
|
|
46
|
-
private _pollingResult;
|
|
47
|
-
get pollingResult(): IPollingResult & {
|
|
48
|
-
pollDurationMs: number;
|
|
49
|
-
} | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Flag to track if user has inputted since idle was detected.
|
|
52
|
-
* This is used to skip showing prompts if the user already provided input.
|
|
53
|
-
*/
|
|
54
|
-
private _userInputtedSinceIdleDetected;
|
|
55
|
-
private readonly _userInputListener;
|
|
56
|
-
private readonly _outputMonitorTelemetryCounters;
|
|
57
|
-
get outputMonitorTelemetryCounters(): Readonly<IOutputMonitorTelemetryCounters>;
|
|
58
|
-
private readonly _onDidFinishCommand;
|
|
59
|
-
readonly onDidFinishCommand: Event<void>;
|
|
60
|
-
private readonly _onDidDetectInputNeeded;
|
|
61
|
-
readonly onDidDetectInputNeeded: Event<void>;
|
|
62
|
-
private readonly _onDidDetectSensitiveInputNeeded;
|
|
63
|
-
readonly onDidDetectSensitiveInputNeeded: Event<void>;
|
|
64
|
-
private _asyncMode;
|
|
65
|
-
private _command;
|
|
66
|
-
private _invocationContext;
|
|
67
|
-
private _currentMonitoringCts;
|
|
68
|
-
/**
|
|
69
|
-
* Tracks whether onDidFinishCommand has fired so the event is delivered at
|
|
70
|
-
* most once. The event must fire synchronously during dispose so consumers
|
|
71
|
-
* awaiting `Event.toPromise(onDidFinishCommand)` are unblocked before the
|
|
72
|
-
* underlying emitter is torn down by super.dispose().
|
|
73
|
-
*/
|
|
74
|
-
private _didFinish;
|
|
75
|
-
private _fireFinishedOnce;
|
|
76
|
-
dispose(): void;
|
|
77
|
-
constructor(_execution: IExecution, _pollFn: ((execution: IExecution, token: CancellationToken, taskService: ITaskService) => Promise<IPollingResult | undefined>) | undefined, invocationContext: IToolInvocationContext | undefined, token: CancellationToken, command: string, _taskService: ITaskService, _logService: ITerminalLogService);
|
|
78
|
-
private _startMonitoring;
|
|
79
|
-
/**
|
|
80
|
-
* Continues monitoring in background mode with a new cancellation token.
|
|
81
|
-
* In background mode, the monitor re-polls for idle and handles prompts
|
|
82
|
-
* whenever new terminal data arrives, rather than stopping after the first
|
|
83
|
-
* idle detection. Resource cost is bounded because the monitor only wakes
|
|
84
|
-
* on new terminal data (via {@link _waitForNewData}) and each idle cycle
|
|
85
|
-
* is capped by the standard polling timeouts.
|
|
86
|
-
*/
|
|
87
|
-
continueMonitoringAsync(token: CancellationToken): void;
|
|
88
|
-
/**
|
|
89
|
-
* Waits for new terminal data or cancellation. Used in background mode
|
|
90
|
-
* to avoid polling and LLM calls while the terminal is quiet.
|
|
91
|
-
*/
|
|
92
|
-
private _waitForNewData;
|
|
93
|
-
private _handleIdleState;
|
|
94
|
-
private _handleTimeoutState;
|
|
95
|
-
/**
|
|
96
|
-
* Single bounded polling pass that returns when:
|
|
97
|
-
* - terminal becomes inactive/idle, or
|
|
98
|
-
* - timeout window elapses.
|
|
99
|
-
*/
|
|
100
|
-
private _waitForIdle;
|
|
101
|
-
/**
|
|
102
|
-
* Sets up a listener for user input that triggers immediately when idle is detected.
|
|
103
|
-
* This ensures we catch any input that happens between idle detection and prompt creation.
|
|
104
|
-
*/
|
|
105
|
-
private _setupIdleInputListener;
|
|
106
|
-
/**
|
|
107
|
-
* Cleans up the idle input listener and resets the flag.
|
|
108
|
-
*/
|
|
109
|
-
private _cleanupIdleInputListener;
|
|
110
|
-
private _isSensitivePrompt;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Returns true when the terminal's last visible line looks like a prompt for
|
|
114
|
-
* a sensitive secret (password, passphrase, token, API key, OTP, etc.). Used
|
|
115
|
-
* to short-circuit the normal "input needed → return to agent" flow so that
|
|
116
|
-
* the secret is never routed through the model — instead the user is asked
|
|
117
|
-
* via UI to focus the terminal and type the secret directly.
|
|
118
|
-
*/
|
|
119
|
-
export declare function detectsSensitiveInputPrompt(cursorLine: string): boolean;
|
|
120
|
-
export declare function matchTerminalPromptOption(options: readonly string[], suggestedOption: string): {
|
|
121
|
-
option: string | undefined;
|
|
122
|
-
index: number;
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* High-confidence patterns that reliably indicate the terminal is waiting for
|
|
126
|
-
* input. These are safe to use as a fast-path in `_waitForIdle` to skip normal
|
|
127
|
-
* idle detection, because they are specific enough to avoid false positives on
|
|
128
|
-
* normal command output (build logs, headers, etc.).
|
|
129
|
-
*/
|
|
130
|
-
export declare function detectsHighConfidenceInputPattern(cursorLine: string): boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Strict input-required detection. Returns true only for patterns that are
|
|
133
|
-
* specific enough to avoid false positives on normal command output (build
|
|
134
|
-
* logs, status lines, error messages). Safe to call from any code path,
|
|
135
|
-
* including unconditionally on the last line of a finished command.
|
|
136
|
-
*
|
|
137
|
-
* For the broader heuristics (bare `:` / `?` with trailing space), use
|
|
138
|
-
* {@link detectsLikelyInputRequiredPattern} — but only from a call site that
|
|
139
|
-
* has independent evidence the command is still running and consuming stdin
|
|
140
|
-
* (e.g. `execution.isActive() === true`). Those broad patterns cannot
|
|
141
|
-
* reliably distinguish a real prompt like `Enter your name: ` from log
|
|
142
|
-
* output like `Last Command: ` on a single line.
|
|
143
|
-
*/
|
|
144
|
-
export declare function detectsInputRequiredPattern(cursorLine: string): boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Strict patterns plus broader heuristics (bare `:` and `?` with trailing
|
|
147
|
-
* space). These broad patterns may produce false positives on normal command
|
|
148
|
-
* output that happens to end with those characters (e.g. `Last Command: `,
|
|
149
|
-
* `[INFO] Starting: `, `find: /tmp/x: No such file: `). They are
|
|
150
|
-
* syntactically indistinguishable from real prompts like `Enter your name: `
|
|
151
|
-
* on a single cursor line.
|
|
152
|
-
*
|
|
153
|
-
* Therefore this function is only safe to call when the caller has
|
|
154
|
-
* independent evidence that the terminal is currently consuming stdin —
|
|
155
|
-
* specifically, `execution.isActive() === true` at a moment when the output
|
|
156
|
-
* stream has been quiet (idle) for several poll intervals. `_waitForIdle`
|
|
157
|
-
* applies that gate; new call sites should preserve it.
|
|
158
|
-
*
|
|
159
|
-
* For unconditional checks (e.g. on the last line of a finished command),
|
|
160
|
-
* use {@link detectsInputRequiredPattern} instead.
|
|
161
|
-
*/
|
|
162
|
-
export declare function detectsLikelyInputRequiredPattern(cursorLine: string): boolean;
|
|
163
|
-
export declare function detectsNonInteractiveHelpPattern(cursorLine: string): boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Detects VS Code's specific task completion messages like:
|
|
166
|
-
* - "Press any key to close the terminal."
|
|
167
|
-
* - "Terminal will be reused by tasks, press any key to close it."
|
|
168
|
-
* These appear when a task finishes and should be ignored if the task is done.
|
|
169
|
-
* Note: These messages may be prefixed with " * " by VS Code and may have line wrapping
|
|
170
|
-
* that can split words across lines (e.g., "t\no" instead of "to").
|
|
171
|
-
*/
|
|
172
|
-
export declare function detectsVSCodeTaskFinishMessage(cursorLine: string): boolean;
|
|
173
|
-
/**
|
|
174
|
-
* Detects generic "press any key" prompts from scripts (not VS Code task messages).
|
|
175
|
-
* These should prompt the user to interact with the terminal.
|
|
176
|
-
*/
|
|
177
|
-
export declare function detectsGenericPressAnyKeyPattern(cursorLine: string): boolean;
|
|
@@ -1,512 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
-
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
5
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { Disposable, MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
|
-
import { ITaskService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskService.service';
|
|
9
|
-
import { OutputMonitorState, PollingConsts } from './types.js';
|
|
10
|
-
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
11
|
-
|
|
12
|
-
function getLastLine(output) {
|
|
13
|
-
if (!output) {
|
|
14
|
-
return "";
|
|
15
|
-
}
|
|
16
|
-
const trimmedOutput = output.replace(/[\r\n]+$/, "");
|
|
17
|
-
if (!trimmedOutput) {
|
|
18
|
-
return "";
|
|
19
|
-
}
|
|
20
|
-
const lastLineFeed = trimmedOutput.lastIndexOf("\n");
|
|
21
|
-
const lastLine = lastLineFeed === -1 ? trimmedOutput : trimmedOutput.slice(lastLineFeed + 1);
|
|
22
|
-
const lastCarriageReturn = lastLine.lastIndexOf("\r");
|
|
23
|
-
return lastCarriageReturn === -1 ? lastLine : lastLine.slice(lastCarriageReturn + 1);
|
|
24
|
-
}
|
|
25
|
-
let OutputMonitor = class OutputMonitor extends Disposable {
|
|
26
|
-
get state() {
|
|
27
|
-
return this._state;
|
|
28
|
-
}
|
|
29
|
-
_formatLastLineForLog(output) {
|
|
30
|
-
if (!output) {
|
|
31
|
-
return "<empty>";
|
|
32
|
-
}
|
|
33
|
-
const lastLine = getLastLine(output).trimEnd();
|
|
34
|
-
if (!lastLine) {
|
|
35
|
-
return "<empty>";
|
|
36
|
-
}
|
|
37
|
-
if (this._isSensitivePrompt(lastLine)) {
|
|
38
|
-
return "<redacted>";
|
|
39
|
-
}
|
|
40
|
-
return lastLine.length > 200 ? lastLine.slice(0, 200) + "…" : lastLine;
|
|
41
|
-
}
|
|
42
|
-
get pollingResult() {
|
|
43
|
-
return this._pollingResult;
|
|
44
|
-
}
|
|
45
|
-
get outputMonitorTelemetryCounters() {
|
|
46
|
-
return this._outputMonitorTelemetryCounters;
|
|
47
|
-
}
|
|
48
|
-
_fireFinishedOnce() {
|
|
49
|
-
if (this._didFinish) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
this._didFinish = true;
|
|
53
|
-
this._onDidFinishCommand.fire();
|
|
54
|
-
}
|
|
55
|
-
dispose() {
|
|
56
|
-
if (!this._didFinish) {
|
|
57
|
-
this._pollingResult ??= {
|
|
58
|
-
state: OutputMonitorState.Cancelled,
|
|
59
|
-
output: this._execution.getOutput(),
|
|
60
|
-
pollDurationMs: 0,
|
|
61
|
-
resources: undefined
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
this._fireFinishedOnce();
|
|
65
|
-
super.dispose();
|
|
66
|
-
}
|
|
67
|
-
constructor(
|
|
68
|
-
_execution,
|
|
69
|
-
_pollFn,
|
|
70
|
-
invocationContext,
|
|
71
|
-
token,
|
|
72
|
-
command,
|
|
73
|
-
_taskService,
|
|
74
|
-
_logService
|
|
75
|
-
) {
|
|
76
|
-
super();
|
|
77
|
-
this._execution = _execution;
|
|
78
|
-
this._pollFn = _pollFn;
|
|
79
|
-
this._taskService = _taskService;
|
|
80
|
-
this._logService = _logService;
|
|
81
|
-
this._state = OutputMonitorState.PollingForIdle;
|
|
82
|
-
this._userInputtedSinceIdleDetected = false;
|
|
83
|
-
this._userInputListener = this._register(( new MutableDisposable()));
|
|
84
|
-
this._outputMonitorTelemetryCounters = {
|
|
85
|
-
inputToolManualAcceptCount: 0,
|
|
86
|
-
inputToolManualRejectCount: 0,
|
|
87
|
-
inputToolManualChars: 0,
|
|
88
|
-
inputToolAutoAcceptCount: 0,
|
|
89
|
-
inputToolAutoChars: 0,
|
|
90
|
-
inputToolManualShownCount: 0,
|
|
91
|
-
inputToolFreeFormInputShownCount: 0,
|
|
92
|
-
inputToolFreeFormInputCount: 0
|
|
93
|
-
};
|
|
94
|
-
this._onDidFinishCommand = this._register(( new Emitter()));
|
|
95
|
-
this.onDidFinishCommand = this._onDidFinishCommand.event;
|
|
96
|
-
this._onDidDetectInputNeeded = this._register(( new Emitter()));
|
|
97
|
-
this.onDidDetectInputNeeded = this._onDidDetectInputNeeded.event;
|
|
98
|
-
this._onDidDetectSensitiveInputNeeded = this._register(( new Emitter()));
|
|
99
|
-
this.onDidDetectSensitiveInputNeeded = this._onDidDetectSensitiveInputNeeded.event;
|
|
100
|
-
this._asyncMode = false;
|
|
101
|
-
this._command = "";
|
|
102
|
-
this._didFinish = false;
|
|
103
|
-
this._command = command;
|
|
104
|
-
this._invocationContext = invocationContext;
|
|
105
|
-
const cts = ( new CancellationTokenSource(token));
|
|
106
|
-
this._currentMonitoringCts = cts;
|
|
107
|
-
this._register(toDisposable(() => {
|
|
108
|
-
this._currentMonitoringCts?.cancel();
|
|
109
|
-
this._currentMonitoringCts?.dispose();
|
|
110
|
-
}));
|
|
111
|
-
timeout(0).then(() => {
|
|
112
|
-
if (this._currentMonitoringCts !== cts) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
this._startMonitoring(command, invocationContext, cts.token);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
async _startMonitoring(command, invocationContext, token) {
|
|
119
|
-
const pollStartTime = Date.now();
|
|
120
|
-
let resources;
|
|
121
|
-
let output;
|
|
122
|
-
let extended = false;
|
|
123
|
-
try {
|
|
124
|
-
while (!token.isCancellationRequested) {
|
|
125
|
-
switch (this._state) {
|
|
126
|
-
case OutputMonitorState.PollingForIdle:
|
|
127
|
-
{
|
|
128
|
-
this._logService.trace(`OutputMonitor: Entering PollingForIdle (extended=${extended})`);
|
|
129
|
-
this._state = await this._waitForIdle(this._execution, extended, token);
|
|
130
|
-
this._logService.trace(
|
|
131
|
-
`OutputMonitor: PollingForIdle completed -> state=${OutputMonitorState[this._state]}`
|
|
132
|
-
);
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
case OutputMonitorState.Timeout:
|
|
136
|
-
{
|
|
137
|
-
this._logService.trace(`OutputMonitor: Entering Timeout state (extended=${extended})`);
|
|
138
|
-
const shouldContinuePolling = await this._handleTimeoutState(command, invocationContext, extended, token);
|
|
139
|
-
if (shouldContinuePolling) {
|
|
140
|
-
extended = true;
|
|
141
|
-
this._state = OutputMonitorState.PollingForIdle;
|
|
142
|
-
continue;
|
|
143
|
-
} else if (this._asyncMode) {
|
|
144
|
-
this._logService.trace(
|
|
145
|
-
"OutputMonitor: Async mode - timeout reached, waiting for new terminal data"
|
|
146
|
-
);
|
|
147
|
-
extended = false;
|
|
148
|
-
await this._waitForNewData(token);
|
|
149
|
-
if (token.isCancellationRequested) {
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
this._state = OutputMonitorState.PollingForIdle;
|
|
153
|
-
continue;
|
|
154
|
-
} else {
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
case OutputMonitorState.Cancelled:
|
|
159
|
-
break;
|
|
160
|
-
case OutputMonitorState.Idle:
|
|
161
|
-
{
|
|
162
|
-
this._logService.trace("OutputMonitor: Entering Idle handler");
|
|
163
|
-
const idleResult = await this._handleIdleState(token);
|
|
164
|
-
if (idleResult.shouldContinuePolling) {
|
|
165
|
-
this._logService.trace("OutputMonitor: Idle handler -> continue polling");
|
|
166
|
-
this._state = OutputMonitorState.PollingForIdle;
|
|
167
|
-
continue;
|
|
168
|
-
} else if (this._asyncMode) {
|
|
169
|
-
this._logService.trace(
|
|
170
|
-
"OutputMonitor: Async mode - waiting for new terminal data before next monitoring cycle"
|
|
171
|
-
);
|
|
172
|
-
await this._waitForNewData(token);
|
|
173
|
-
if (token.isCancellationRequested) {
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
176
|
-
this._state = OutputMonitorState.PollingForIdle;
|
|
177
|
-
continue;
|
|
178
|
-
} else {
|
|
179
|
-
this._logService.trace(
|
|
180
|
-
`OutputMonitor: Idle handler -> stop polling (hasResources=${!!idleResult.resources}, outputLen=${idleResult.output?.length ?? 0})`
|
|
181
|
-
);
|
|
182
|
-
resources = idleResult.resources;
|
|
183
|
-
output = idleResult.output;
|
|
184
|
-
}
|
|
185
|
-
break;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (this._state === OutputMonitorState.Idle || this._state === OutputMonitorState.Cancelled || this._state === OutputMonitorState.Timeout) {
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
if (token.isCancellationRequested) {
|
|
193
|
-
this._state = OutputMonitorState.Cancelled;
|
|
194
|
-
}
|
|
195
|
-
} finally {
|
|
196
|
-
this._logService.trace(
|
|
197
|
-
`OutputMonitor: Monitoring finished (state=${OutputMonitorState[this._state]}, duration=${Date.now() - pollStartTime}ms)`
|
|
198
|
-
);
|
|
199
|
-
this._pollingResult = {
|
|
200
|
-
state: this._state,
|
|
201
|
-
output: output ?? this._execution.getOutput(),
|
|
202
|
-
pollDurationMs: Date.now() - pollStartTime,
|
|
203
|
-
resources
|
|
204
|
-
};
|
|
205
|
-
this._userInputListener.clear();
|
|
206
|
-
this._fireFinishedOnce();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
continueMonitoringAsync(token) {
|
|
210
|
-
this._asyncMode = true;
|
|
211
|
-
const currentMonitoringCts = this._currentMonitoringCts;
|
|
212
|
-
currentMonitoringCts?.cancel();
|
|
213
|
-
currentMonitoringCts?.dispose();
|
|
214
|
-
this._currentMonitoringCts = ( new CancellationTokenSource(token));
|
|
215
|
-
this._state = OutputMonitorState.PollingForIdle;
|
|
216
|
-
this._startMonitoring(this._command, this._invocationContext, this._currentMonitoringCts.token);
|
|
217
|
-
}
|
|
218
|
-
_waitForNewData(token) {
|
|
219
|
-
return ( new Promise(resolve => {
|
|
220
|
-
if (token.isCancellationRequested) {
|
|
221
|
-
resolve();
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
const cleanup = () => {
|
|
225
|
-
dataListener.dispose();
|
|
226
|
-
tokenListener.dispose();
|
|
227
|
-
disposedListener.dispose();
|
|
228
|
-
};
|
|
229
|
-
const dataListener = this._execution.instance.onData(() => {
|
|
230
|
-
cleanup();
|
|
231
|
-
resolve();
|
|
232
|
-
});
|
|
233
|
-
const tokenListener = token.onCancellationRequested(() => {
|
|
234
|
-
cleanup();
|
|
235
|
-
resolve();
|
|
236
|
-
});
|
|
237
|
-
const disposedListener = this._execution.instance.onDisposed(() => {
|
|
238
|
-
cleanup();
|
|
239
|
-
resolve();
|
|
240
|
-
});
|
|
241
|
-
}));
|
|
242
|
-
}
|
|
243
|
-
async _handleIdleState(token) {
|
|
244
|
-
const output = this._execution.getOutput();
|
|
245
|
-
const outputTail = output.slice(-1e3);
|
|
246
|
-
const outputLastLine = getLastLine(outputTail);
|
|
247
|
-
this._logService.trace(
|
|
248
|
-
`OutputMonitor: Idle output summary: len=${output.length}, lastLine=${this._formatLastLineForLog(outputTail)}`
|
|
249
|
-
);
|
|
250
|
-
if (detectsNonInteractiveHelpPattern(outputLastLine)) {
|
|
251
|
-
this._logService.trace("OutputMonitor: Idle -> non-interactive help pattern detected, stopping");
|
|
252
|
-
return {
|
|
253
|
-
shouldContinuePolling: false,
|
|
254
|
-
output
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
const isTask = this._execution.task !== undefined;
|
|
258
|
-
if (isTask && detectsVSCodeTaskFinishMessage(outputTail)) {
|
|
259
|
-
this._logService.trace("OutputMonitor: Idle -> VS Code task finish message detected, stopping");
|
|
260
|
-
return {
|
|
261
|
-
shouldContinuePolling: false,
|
|
262
|
-
output
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
if (!isTask && detectsGenericPressAnyKeyPattern(outputTail)) {
|
|
266
|
-
this._logService.trace(
|
|
267
|
-
"OutputMonitor: Idle -> generic \"press any key\" detected, signaling agent"
|
|
268
|
-
);
|
|
269
|
-
this._onDidDetectInputNeeded.fire();
|
|
270
|
-
this._cleanupIdleInputListener();
|
|
271
|
-
return {
|
|
272
|
-
shouldContinuePolling: false,
|
|
273
|
-
output
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
if (this._userInputtedSinceIdleDetected) {
|
|
277
|
-
this._logService.trace(
|
|
278
|
-
"OutputMonitor: User input detected since idle; skipping prompt and continuing polling"
|
|
279
|
-
);
|
|
280
|
-
this._cleanupIdleInputListener();
|
|
281
|
-
return {
|
|
282
|
-
shouldContinuePolling: true
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
let shouldFireInputNeeded = detectsInputRequiredPattern(outputLastLine);
|
|
286
|
-
if (!shouldFireInputNeeded && detectsLikelyInputRequiredPattern(outputLastLine)) {
|
|
287
|
-
const isActive = this._execution.isActive ? await this._execution.isActive() : undefined;
|
|
288
|
-
if (isActive === true) {
|
|
289
|
-
shouldFireInputNeeded = true;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
if (shouldFireInputNeeded && this._userInputtedSinceIdleDetected) {
|
|
293
|
-
this._logService.trace(
|
|
294
|
-
"OutputMonitor: User input detected during isActive await; skipping prompt and continuing polling"
|
|
295
|
-
);
|
|
296
|
-
this._cleanupIdleInputListener();
|
|
297
|
-
return {
|
|
298
|
-
shouldContinuePolling: true
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
if (this._asyncMode) {
|
|
302
|
-
if (shouldFireInputNeeded) {
|
|
303
|
-
if (detectsSensitiveInputPrompt(outputLastLine)) {
|
|
304
|
-
this._logService.trace(
|
|
305
|
-
"OutputMonitor: Async mode - sensitive input prompt detected, signaling sensitive UI"
|
|
306
|
-
);
|
|
307
|
-
this._onDidDetectSensitiveInputNeeded.fire();
|
|
308
|
-
} else {
|
|
309
|
-
this._logService.trace(
|
|
310
|
-
"OutputMonitor: Async mode - input-required pattern detected, signaling agent"
|
|
311
|
-
);
|
|
312
|
-
this._onDidDetectInputNeeded.fire();
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
this._cleanupIdleInputListener();
|
|
316
|
-
return {
|
|
317
|
-
shouldContinuePolling: false,
|
|
318
|
-
output
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
if (shouldFireInputNeeded) {
|
|
322
|
-
if (detectsSensitiveInputPrompt(outputLastLine)) {
|
|
323
|
-
this._logService.trace("OutputMonitor: Sensitive input prompt detected, signaling sensitive UI");
|
|
324
|
-
this._onDidDetectSensitiveInputNeeded.fire();
|
|
325
|
-
} else {
|
|
326
|
-
this._logService.trace("OutputMonitor: Input-required pattern detected, signaling agent");
|
|
327
|
-
this._onDidDetectInputNeeded.fire();
|
|
328
|
-
}
|
|
329
|
-
this._cleanupIdleInputListener();
|
|
330
|
-
return {
|
|
331
|
-
shouldContinuePolling: false,
|
|
332
|
-
output
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
this._cleanupIdleInputListener();
|
|
336
|
-
const custom = await this._pollFn?.(this._execution, token, this._taskService);
|
|
337
|
-
this._logService.trace(`OutputMonitor: Custom poller result: ${custom ? "provided" : "none"}`);
|
|
338
|
-
const resources = custom?.resources;
|
|
339
|
-
return {
|
|
340
|
-
resources,
|
|
341
|
-
shouldContinuePolling: false,
|
|
342
|
-
output: custom?.output ?? output
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
async _handleTimeoutState(_command, _invocationContext, _extended, _token) {
|
|
346
|
-
if (_extended) {
|
|
347
|
-
this._logService.info(
|
|
348
|
-
"OutputMonitor: Extended polling timeout reached after 2 minutes, signaling potential input needed"
|
|
349
|
-
);
|
|
350
|
-
this._onDidDetectInputNeeded.fire();
|
|
351
|
-
this._state = OutputMonitorState.Cancelled;
|
|
352
|
-
return false;
|
|
353
|
-
}
|
|
354
|
-
return true;
|
|
355
|
-
}
|
|
356
|
-
async _waitForIdle(execution, extendedPolling, token) {
|
|
357
|
-
const maxWaitMs = extendedPolling ? PollingConsts.ExtendedPollingMaxDuration : PollingConsts.FirstPollingMaxDuration;
|
|
358
|
-
const maxInterval = PollingConsts.MaxPollingIntervalDuration;
|
|
359
|
-
let currentInterval = PollingConsts.MinPollingDuration;
|
|
360
|
-
let waited = 0;
|
|
361
|
-
let consecutiveIdleEvents = 0;
|
|
362
|
-
let hasReceivedData = false;
|
|
363
|
-
const onDataDisposable = execution.instance.onData(_data => {
|
|
364
|
-
hasReceivedData = true;
|
|
365
|
-
});
|
|
366
|
-
try {
|
|
367
|
-
while (!token.isCancellationRequested && waited < maxWaitMs) {
|
|
368
|
-
const waitTime = Math.min(currentInterval, maxWaitMs - waited);
|
|
369
|
-
try {
|
|
370
|
-
await timeout(waitTime, token);
|
|
371
|
-
} catch (err) {
|
|
372
|
-
if (token.isCancellationRequested) {
|
|
373
|
-
return OutputMonitorState.Cancelled;
|
|
374
|
-
}
|
|
375
|
-
throw err;
|
|
376
|
-
}
|
|
377
|
-
waited += waitTime;
|
|
378
|
-
currentInterval = Math.min(currentInterval * 2, maxInterval);
|
|
379
|
-
const currentOutput = execution.getOutput();
|
|
380
|
-
const currentTail = currentOutput.slice(-1000);
|
|
381
|
-
const currentLastLine = getLastLine(currentTail);
|
|
382
|
-
if (detectsNonInteractiveHelpPattern(currentLastLine)) {
|
|
383
|
-
this._logService.trace(
|
|
384
|
-
`OutputMonitor: waitForIdle -> non-interactive help detected (waited=${waited}ms)`
|
|
385
|
-
);
|
|
386
|
-
this._state = OutputMonitorState.Idle;
|
|
387
|
-
this._setupIdleInputListener();
|
|
388
|
-
return this._state;
|
|
389
|
-
}
|
|
390
|
-
const promptResult = detectsHighConfidenceInputPattern(currentLastLine);
|
|
391
|
-
if (promptResult) {
|
|
392
|
-
this._logService.trace(
|
|
393
|
-
`OutputMonitor: waitForIdle -> high-confidence input pattern detected (waited=${waited}ms, lastLine=${this._formatLastLineForLog(currentTail)})`
|
|
394
|
-
);
|
|
395
|
-
this._state = OutputMonitorState.Idle;
|
|
396
|
-
this._setupIdleInputListener();
|
|
397
|
-
return this._state;
|
|
398
|
-
}
|
|
399
|
-
if (hasReceivedData) {
|
|
400
|
-
consecutiveIdleEvents = 0;
|
|
401
|
-
hasReceivedData = false;
|
|
402
|
-
} else {
|
|
403
|
-
consecutiveIdleEvents++;
|
|
404
|
-
}
|
|
405
|
-
const recentlyIdle = consecutiveIdleEvents >= PollingConsts.MinIdleEvents;
|
|
406
|
-
const isActive = execution.isActive ? await execution.isActive() : undefined;
|
|
407
|
-
this._logService.trace(
|
|
408
|
-
`OutputMonitor: waitForIdle check: waited=${waited}ms, recentlyIdle=${recentlyIdle}, isActive=${isActive}`
|
|
409
|
-
);
|
|
410
|
-
if (recentlyIdle && isActive !== true) {
|
|
411
|
-
this._logService.trace(
|
|
412
|
-
`OutputMonitor: waitForIdle -> recentlyIdle && !active (waited=${waited}ms, lastLine=${this._formatLastLineForLog(currentTail)})`
|
|
413
|
-
);
|
|
414
|
-
this._state = OutputMonitorState.Idle;
|
|
415
|
-
this._setupIdleInputListener();
|
|
416
|
-
return this._state;
|
|
417
|
-
}
|
|
418
|
-
if (recentlyIdle && isActive === true && detectsLikelyInputRequiredPattern(currentLastLine)) {
|
|
419
|
-
this._logService.trace(
|
|
420
|
-
`OutputMonitor: waitForIdle -> broad input pattern detected while active+idle (waited=${waited}ms, lastLine=${this._formatLastLineForLog(currentTail)})`
|
|
421
|
-
);
|
|
422
|
-
this._state = OutputMonitorState.Idle;
|
|
423
|
-
this._setupIdleInputListener();
|
|
424
|
-
return this._state;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
} finally {
|
|
428
|
-
onDataDisposable.dispose();
|
|
429
|
-
}
|
|
430
|
-
if (token.isCancellationRequested) {
|
|
431
|
-
return OutputMonitorState.Cancelled;
|
|
432
|
-
}
|
|
433
|
-
return OutputMonitorState.Timeout;
|
|
434
|
-
}
|
|
435
|
-
_setupIdleInputListener() {
|
|
436
|
-
if (this._store.isDisposed) {
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
this._userInputtedSinceIdleDetected = false;
|
|
440
|
-
this._logService.trace("OutputMonitor: Setting up idle input listener");
|
|
441
|
-
this._userInputListener.value = this._execution.instance.onDidInputData(() => {
|
|
442
|
-
this._userInputtedSinceIdleDetected = true;
|
|
443
|
-
this._logService.trace("OutputMonitor: Detected user terminal input while idle");
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
_cleanupIdleInputListener() {
|
|
447
|
-
this._userInputtedSinceIdleDetected = false;
|
|
448
|
-
this._userInputListener.clear();
|
|
449
|
-
}
|
|
450
|
-
_isSensitivePrompt(prompt) {
|
|
451
|
-
return detectsSensitiveInputPrompt(prompt);
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
OutputMonitor = ( __decorate([( __param(5, ITaskService)), ( __param(6, ITerminalLogService))], OutputMonitor));
|
|
455
|
-
function detectsSensitiveInputPrompt(cursorLine) {
|
|
456
|
-
return /(password|passphrase|token|api\s*key|secret|verification code|otp\b|one[\s-]?time (?:code|password)|2fa|mfa|pin\s*(?:code|number)?[: ]?\s*$|authentication code)/i.test(cursorLine);
|
|
457
|
-
}
|
|
458
|
-
function detectsHighConfidenceInputPattern(cursorLine) {
|
|
459
|
-
return ([
|
|
460
|
-
/\s*(?:\[[^\]]\][^\[]*)+(?:\(default is\s+"[^"]+"\):)?\s+$/,
|
|
461
|
-
/(?:\(|\[)\s*(?:y(?:es)?\s*\/\s*n(?:o)?|n(?:o)?\s*\/\s*y(?:es)?)\s*(?:\]|\))\s+$/i,
|
|
462
|
-
/[?:]\s*(?:\(|\[)?\s*y(?:es)?\s*\/\s*n(?:o)?\s*(?:\]|\))?\s+$/i,
|
|
463
|
-
/\(y\) +$/i,
|
|
464
|
-
/:\s+\([^)]*\) +$/,
|
|
465
|
-
/\(END\)$/,
|
|
466
|
-
/password(?: for [^:]+)?:\s*$/i,
|
|
467
|
-
/press a(?:ny)? key/i,
|
|
468
|
-
/^(?:\s|\x1b\[[0-9;]*m)*\?.*[›❯▸▶]\s*$/
|
|
469
|
-
].some(e => e.test(cursorLine)));
|
|
470
|
-
}
|
|
471
|
-
function detectsInputRequiredPattern(cursorLine) {
|
|
472
|
-
return detectsHighConfidenceInputPattern(cursorLine);
|
|
473
|
-
}
|
|
474
|
-
function detectsLikelyInputRequiredPattern(cursorLine) {
|
|
475
|
-
if (detectsHighConfidenceInputPattern(cursorLine)) {
|
|
476
|
-
return true;
|
|
477
|
-
}
|
|
478
|
-
return ([
|
|
479
|
-
/: +$/,
|
|
480
|
-
/\? *(?:\([a-z\s]+\))? +$/i
|
|
481
|
-
].some(e => e.test(cursorLine)));
|
|
482
|
-
}
|
|
483
|
-
function detectsNonInteractiveHelpPattern(cursorLine) {
|
|
484
|
-
return ([
|
|
485
|
-
/press [h?]\s*(?:\+\s*enter)?\s*to (?:show|open|display|get|see)\s*(?:available )?(?:help|commands|options)/i,
|
|
486
|
-
/press h\s*(?:or\s*\?)?\s*(?:\+\s*enter)?\s*for (?:help|commands|options)/i,
|
|
487
|
-
/press \?\s*(?:\+\s*enter)?\s*(?:to|for)?\s*(?:help|commands|options|list)/i,
|
|
488
|
-
/type\s*[h?]\s*(?:\+\s*enter)?\s*(?:for|to see|to show)\s*(?:help|commands|options)/i,
|
|
489
|
-
/hit\s*[h?]\s*(?:\+\s*enter)?\s*(?:for|to see|to show)\s*(?:help|commands|options)/i,
|
|
490
|
-
/press o\s*(?:\+\s*enter)?\s*(?:to|for)?\s*(?:open|launch)(?:\s*(?:the )?(?:app|application|browser)|\s+in\s+(?:the\s+)?browser)?/i,
|
|
491
|
-
/press r\s*(?:\+\s*enter)?\s*(?:to|for)?\s*(?:restart|reload|refresh)(?:\s*(?:the )?(?:server|dev server|service))?/i,
|
|
492
|
-
/press q\s*(?:\+\s*enter)?\s*(?:to|for)?\s*(?:quit|exit|stop)(?:\s*(?:the )?(?:server|app|process))?/i,
|
|
493
|
-
/press u\s*(?:\+\s*enter)?\s*(?:to|for)?\s*(?:show|print|display)\s*(?:the )?(?:server )?urls?/i
|
|
494
|
-
].some(e => e.test(cursorLine)));
|
|
495
|
-
}
|
|
496
|
-
const taskFinishMessages = [(
|
|
497
|
-
localize(14475, "Terminal will be reused by tasks, press any key to close it.")), ( localize(14476, "Terminal will be reused by tasks, press any key to close it.")), (
|
|
498
|
-
localize(14477, "Press any key to close the terminal.")), ( localize(14478, "Press any key to close the terminal.")), (
|
|
499
|
-
localize(14479, "The terminal will be reused by tasks. Press any key to close."))];
|
|
500
|
-
const normalizedTaskFinishMessages = ( taskFinishMessages.map(msg => msg.replace(/[\s.,:;!?"'`()[\]{}<>\-_/\\]+/g, "").toLowerCase()));
|
|
501
|
-
function detectsVSCodeTaskFinishMessage(cursorLine) {
|
|
502
|
-
const compact = cursorLine.replace(/[\s.,:;!?"'`()[\]{}<>\-_/\\]+/g, "").toLowerCase();
|
|
503
|
-
return ( normalizedTaskFinishMessages.some(msg => compact.includes(msg)));
|
|
504
|
-
}
|
|
505
|
-
function detectsGenericPressAnyKeyPattern(cursorLine) {
|
|
506
|
-
if (detectsVSCodeTaskFinishMessage(cursorLine)) {
|
|
507
|
-
return false;
|
|
508
|
-
}
|
|
509
|
-
return /press a(?:ny)? key/i.test(cursorLine);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
export { OutputMonitor, detectsGenericPressAnyKeyPattern, detectsHighConfidenceInputPattern, detectsInputRequiredPattern, detectsLikelyInputRequiredPattern, detectsNonInteractiveHelpPattern, detectsSensitiveInputPrompt, detectsVSCodeTaskFinishMessage, getLastLine };
|