@codingame/monaco-vscode-katex-common 30.0.1 → 31.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +16 -0
- package/vscode/src/vs/platform/actions/browser/actionbar.js +22 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +50 -0
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +138 -0
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +12 -0
- package/vscode/src/vs/platform/networkFilter/common/settings.js +14 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +18 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +13 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +73 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +51 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +64 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +17 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +73 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +20 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +73 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +41 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +13 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +14 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +11 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +339 -161
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +33 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +43 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +147 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +55 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +42 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animation.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.js +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/buffer.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/media/chatIncrementalRendering.css +112 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +24 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +111 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +425 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +16 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +68 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +101 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +36 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +217 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +23 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +168 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +18 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +7 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +7 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +24 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +104 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +11 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +257 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +286 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +25 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +29 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +258 -321
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +392 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +24 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +38 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +577 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +4 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +1 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +58 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +44 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +362 -188
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +42 -95
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +9 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +57 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +21 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/{modelPickerActionItem2.js → modelPickerActionItem.js} +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +38 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +94 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +218 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +12 -21
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +355 -156
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +2 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +72 -65
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +4 -43
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +238 -204
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +4 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +128 -115
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +6 -9
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +152 -49
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +64 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +40 -40
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/terminalContribChatExports.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +165 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +163 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +144 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +174 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +43 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +256 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +94 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +221 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +392 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +243 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +10 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +310 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +168 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +32 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +108 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +412 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +192 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +2258 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +43 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +118 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +141 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +608 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +0 -196
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +0 -215
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +0 -107
|
@@ -0,0 +1,144 @@
|
|
|
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 { isMacintosh, isCI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
9
|
+
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
10
|
+
import { trackIdleOnPrompt } from './executeStrategy.js';
|
|
11
|
+
import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
|
|
12
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
13
|
+
|
|
14
|
+
let RichExecuteStrategy = class RichExecuteStrategy extends Disposable {
|
|
15
|
+
constructor(_instance, _commandDetection, _configurationService, _logService) {
|
|
16
|
+
super();
|
|
17
|
+
this._instance = _instance;
|
|
18
|
+
this._commandDetection = _commandDetection;
|
|
19
|
+
this._configurationService = _configurationService;
|
|
20
|
+
this._logService = _logService;
|
|
21
|
+
this.type = "rich";
|
|
22
|
+
this._startMarker = this._register(( new MutableDisposable()));
|
|
23
|
+
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
24
|
+
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
25
|
+
}
|
|
26
|
+
async execute(commandLine, token, commandId, commandLineForMetadata) {
|
|
27
|
+
const store = ( new DisposableStore());
|
|
28
|
+
this._register(store);
|
|
29
|
+
try {
|
|
30
|
+
this._log("Waiting for xterm");
|
|
31
|
+
const xterm = await this._instance.xtermReadyPromise;
|
|
32
|
+
if (!xterm) {
|
|
33
|
+
throw ( new Error("Xterm is not available"));
|
|
34
|
+
}
|
|
35
|
+
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
36
|
+
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
37
|
+
const onDone = Promise.race([
|
|
38
|
+
Event.toPromise(this._commandDetection.onCommandFinished, store).then(e => {
|
|
39
|
+
this._log("onDone via end event");
|
|
40
|
+
return {
|
|
41
|
+
"type": "success",
|
|
42
|
+
command: e
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
Event.toPromise(token.onCancellationRequested, store).then(() => {
|
|
46
|
+
this._log("onDone via cancellation");
|
|
47
|
+
}),
|
|
48
|
+
Event.toPromise(this._instance.onDisposed, store).then(() => {
|
|
49
|
+
this._log("onDone via terminal disposal");
|
|
50
|
+
return {
|
|
51
|
+
type: "disposal"
|
|
52
|
+
};
|
|
53
|
+
}),
|
|
54
|
+
trackIdleOnPrompt(this._instance, idlePollInterval, store, idlePollInterval).then(() => {
|
|
55
|
+
this._log("onDone via idle prompt");
|
|
56
|
+
})
|
|
57
|
+
]);
|
|
58
|
+
const markerRecreation = setupRecreatingStartMarker(
|
|
59
|
+
xterm,
|
|
60
|
+
this._startMarker,
|
|
61
|
+
m => this._onDidCreateStartMarker.fire(m),
|
|
62
|
+
store,
|
|
63
|
+
this._log.bind(this)
|
|
64
|
+
);
|
|
65
|
+
this._log(`Executing command line \`${commandLine}\``);
|
|
66
|
+
markerRecreation.dispose();
|
|
67
|
+
const forceBracketedPasteMode = isMacintosh;
|
|
68
|
+
this._instance.runCommand(
|
|
69
|
+
commandLine,
|
|
70
|
+
true,
|
|
71
|
+
commandId,
|
|
72
|
+
forceBracketedPasteMode,
|
|
73
|
+
commandLineForMetadata
|
|
74
|
+
);
|
|
75
|
+
this._log("Waiting for done event");
|
|
76
|
+
const onDoneResult = await Promise.race([onDone, alternateBufferPromise.then(() => ({
|
|
77
|
+
type: "alternateBuffer"
|
|
78
|
+
}))]);
|
|
79
|
+
if (onDoneResult && onDoneResult.type === "disposal") {
|
|
80
|
+
throw ( new Error("The terminal was closed"));
|
|
81
|
+
}
|
|
82
|
+
if (onDoneResult && onDoneResult.type === "alternateBuffer") {
|
|
83
|
+
this._log("Detected alternate buffer entry, skipping output capture");
|
|
84
|
+
return {
|
|
85
|
+
output: undefined,
|
|
86
|
+
exitCode: undefined,
|
|
87
|
+
error: "alternateBuffer",
|
|
88
|
+
didEnterAltBuffer: true
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const finishedCommand = onDoneResult && onDoneResult.type === "success" ? onDoneResult.command : undefined;
|
|
92
|
+
if (token.isCancellationRequested) {
|
|
93
|
+
throw ( new CancellationError());
|
|
94
|
+
}
|
|
95
|
+
const endMarker = store.add(xterm.raw.registerMarker());
|
|
96
|
+
let output;
|
|
97
|
+
const additionalInformationLines = [];
|
|
98
|
+
if (finishedCommand) {
|
|
99
|
+
const commandOutput = finishedCommand?.getOutput();
|
|
100
|
+
if (commandOutput !== undefined) {
|
|
101
|
+
this._log("Fetched output via finished command");
|
|
102
|
+
output = stripCommandEchoAndPrompt(commandOutput, commandLine, this._log.bind(this));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (output === undefined) {
|
|
106
|
+
try {
|
|
107
|
+
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
108
|
+
this._log("Fetched output via markers");
|
|
109
|
+
if (output !== undefined) {
|
|
110
|
+
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
111
|
+
}
|
|
112
|
+
} catch {
|
|
113
|
+
this._log("Failed to fetch output via markers");
|
|
114
|
+
additionalInformationLines.push("Failed to retrieve command output");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (output !== undefined && output.trim().length === 0) {
|
|
118
|
+
additionalInformationLines.push("Command produced no output");
|
|
119
|
+
}
|
|
120
|
+
const exitCode = finishedCommand?.exitCode;
|
|
121
|
+
if (isNumber(exitCode) && exitCode > 0) {
|
|
122
|
+
additionalInformationLines.push(`Command exited with code ${exitCode}`);
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
output,
|
|
126
|
+
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
127
|
+
exitCode
|
|
128
|
+
};
|
|
129
|
+
} finally {
|
|
130
|
+
store.dispose();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
_log(message) {
|
|
134
|
+
const msg = `RunInTerminalTool#Rich: ${message}`;
|
|
135
|
+
if (isCI) {
|
|
136
|
+
this._logService.info(msg);
|
|
137
|
+
} else {
|
|
138
|
+
this._logService.debug(msg);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
RichExecuteStrategy = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ITerminalLogService))], RichExecuteStrategy));
|
|
143
|
+
|
|
144
|
+
export { RichExecuteStrategy };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DisposableStore, MutableDisposable, type IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
3
|
+
/**
|
|
4
|
+
* Sets up a recreating start marker which is resilient to prompts that clear/re-render (eg. transient
|
|
5
|
+
* or powerlevel10k style prompts). The marker is recreated at the cursor position whenever the
|
|
6
|
+
* existing marker is disposed. The caller is responsible for adding the startMarker to the store.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setupRecreatingStartMarker(xterm: {
|
|
9
|
+
raw: {
|
|
10
|
+
registerMarker(): IXtermMarker | undefined;
|
|
11
|
+
};
|
|
12
|
+
}, startMarker: MutableDisposable<IXtermMarker>, fire: (marker: IXtermMarker | undefined) => void, store: DisposableStore, log?: (message: string) => void): IDisposable;
|
|
13
|
+
export declare function createAltBufferPromise(xterm: {
|
|
14
|
+
raw: {
|
|
15
|
+
buffer: {
|
|
16
|
+
active: unknown;
|
|
17
|
+
alternate: unknown;
|
|
18
|
+
onBufferChange: (callback: () => void) => IDisposable;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}, store: DisposableStore, log?: (message: string) => void): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Strips the command echo and trailing prompt lines from marker-based terminal output.
|
|
24
|
+
* Without shell integration (or when `getOutput()` is unavailable), `getContentsAsText`
|
|
25
|
+
* captures the entire terminal buffer between the start and end markers, which includes:
|
|
26
|
+
* 1. The command echo line (what `sendText` wrote)
|
|
27
|
+
* 2. The actual command output
|
|
28
|
+
* 3. The next shell prompt line(s)
|
|
29
|
+
*
|
|
30
|
+
* This function removes (1) and (3) to isolate the actual output.
|
|
31
|
+
*/
|
|
32
|
+
export declare function stripCommandEchoAndPrompt(output: string, commandLine: string, log?: (message: string) => void): string;
|
|
33
|
+
export declare function findCommandEcho(output: string, commandLine: string, allowSuffixMatch?: boolean): {
|
|
34
|
+
contentBefore: string;
|
|
35
|
+
linesAfter: string[];
|
|
36
|
+
} | undefined;
|
|
37
|
+
export declare function stripNewLinesAndBuildMapping(output: string): {
|
|
38
|
+
strippedOutput: string;
|
|
39
|
+
indexMapping: number[];
|
|
40
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
|
|
2
|
+
import { DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
3
|
+
import { MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
|
|
5
|
+
function setupRecreatingStartMarker(xterm, startMarker, fire, store, log) {
|
|
6
|
+
const markerListener = ( new MutableDisposable());
|
|
7
|
+
const recreateStartMarker = () => {
|
|
8
|
+
if (store.isDisposed) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const marker = xterm.raw.registerMarker();
|
|
12
|
+
startMarker.value = marker ?? undefined;
|
|
13
|
+
fire(marker);
|
|
14
|
+
if (!marker) {
|
|
15
|
+
markerListener.clear();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
markerListener.value = marker.onDispose(() => {
|
|
19
|
+
log?.("Start marker was disposed, recreating");
|
|
20
|
+
recreateStartMarker();
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
recreateStartMarker();
|
|
24
|
+
store.add(toDisposable(() => {
|
|
25
|
+
markerListener.dispose();
|
|
26
|
+
startMarker.clear();
|
|
27
|
+
fire(undefined);
|
|
28
|
+
}));
|
|
29
|
+
store.add(startMarker);
|
|
30
|
+
return toDisposable(() => markerListener.dispose());
|
|
31
|
+
}
|
|
32
|
+
function createAltBufferPromise(xterm, store, log) {
|
|
33
|
+
const deferred = ( new DeferredPromise());
|
|
34
|
+
const complete = () => {
|
|
35
|
+
if (!deferred.isSettled) {
|
|
36
|
+
log?.("Detected alternate buffer entry");
|
|
37
|
+
deferred.complete();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
if (xterm.raw.buffer.active === xterm.raw.buffer.alternate) {
|
|
41
|
+
complete();
|
|
42
|
+
} else {
|
|
43
|
+
store.add(xterm.raw.buffer.onBufferChange(() => {
|
|
44
|
+
if (xterm.raw.buffer.active === xterm.raw.buffer.alternate) {
|
|
45
|
+
complete();
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
return deferred.p;
|
|
50
|
+
}
|
|
51
|
+
function stripCommandEchoAndPrompt(output, commandLine, log) {
|
|
52
|
+
log?.(
|
|
53
|
+
`stripCommandEchoAndPrompt input: output length=${output.length}, commandLine length=${commandLine.length}`
|
|
54
|
+
);
|
|
55
|
+
const result = _stripCommandEchoAndPromptOnce(output, commandLine, log);
|
|
56
|
+
if (result.trim().length > 0 && findCommandEcho(result, commandLine)) {
|
|
57
|
+
return _stripCommandEchoAndPromptOnce(result, commandLine, log);
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
function _stripCommandEchoAndPromptOnce(output, commandLine, log) {
|
|
62
|
+
const echoResult = findCommandEcho(output, commandLine, true);
|
|
63
|
+
const lines = echoResult ? echoResult.linesAfter : output.split("\n");
|
|
64
|
+
const startIndex = 0;
|
|
65
|
+
const promptBefore = echoResult?.contentBefore ?? "";
|
|
66
|
+
const isUnixAt = /\w+@[\w.-]+:/.test(promptBefore);
|
|
67
|
+
const isUnixHost = !isUnixAt && /[\w.-]+:\S/.test(promptBefore);
|
|
68
|
+
const isUnix = isUnixAt || isUnixHost;
|
|
69
|
+
const isPowerShell = /^PS\s/i.test(promptBefore);
|
|
70
|
+
const isCmd = !isPowerShell && /^[A-Z]:\\/.test(promptBefore);
|
|
71
|
+
const isStarship = /\u276f/.test(promptBefore);
|
|
72
|
+
const isPython = />>>/.test(promptBefore);
|
|
73
|
+
const knownPrompt = isUnix || isPowerShell || isCmd || isStarship || isPython;
|
|
74
|
+
let endIndex = lines.length;
|
|
75
|
+
let trailingStrippedCount = 0;
|
|
76
|
+
const maxTrailingPromptLines = 2;
|
|
77
|
+
while (endIndex > startIndex) {
|
|
78
|
+
const line = lines[endIndex - 1].trimEnd();
|
|
79
|
+
if (line.length === 0) {
|
|
80
|
+
endIndex--;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (trailingStrippedCount >= maxTrailingPromptLines) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
const isCompletePrompt =
|
|
87
|
+
((!knownPrompt || isUnixAt) && /^\s*\w+@[\w.-]+:.*[#$]\s*$/.test(line)) || ((!knownPrompt || isUnixHost) && /^\s*[\w.-]+:\S.*\s\w+[#$]\s*$/.test(line)) || ((!knownPrompt || isPowerShell) && /^PS\s+[A-Z]:\\.*>\s*$/.test(line)) || ((!knownPrompt || isCmd) && /^[A-Z]:\\.*>\s*$/.test(line)) || ((!knownPrompt || isStarship) && /\u276f\s*$/.test(line)) || ((!knownPrompt || isPython) && /^>>>\s*$/.test(line));
|
|
88
|
+
const isPromptFragment =
|
|
89
|
+
((!knownPrompt || isUnix) && /^\s*[\w/.-]+[#$]\s*$/.test(line)) || ((!knownPrompt || isUnix) && /^\[\s*[\w.-]+(@[\w.-]+)?:[~\/]/.test(line)) || ((!knownPrompt || isUnix) && trailingStrippedCount > 0 && /^\s*[\w][-\w.]*(@[\w.-]+)?:\S/.test(line)) || ((!knownPrompt || isUnix) && /\]\s*[#$]\s*$/.test(line));
|
|
90
|
+
if (isCompletePrompt) {
|
|
91
|
+
endIndex--;
|
|
92
|
+
trailingStrippedCount++;
|
|
93
|
+
break;
|
|
94
|
+
} else if (isPromptFragment) {
|
|
95
|
+
endIndex--;
|
|
96
|
+
trailingStrippedCount++;
|
|
97
|
+
} else {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const result = lines.slice(startIndex, endIndex).join("\n");
|
|
102
|
+
log?.(
|
|
103
|
+
`stripCommandEchoAndPrompt result: length=${result.length} (startIndex=${startIndex}, endIndex=${endIndex}, totalLines=${lines.length})`
|
|
104
|
+
);
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
function findCommandEcho(output, commandLine, allowSuffixMatch) {
|
|
108
|
+
const trimmedCommand = commandLine.trim();
|
|
109
|
+
if (trimmedCommand.length === 0) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const {
|
|
113
|
+
strippedOutput,
|
|
114
|
+
indexMapping
|
|
115
|
+
} = stripNewLinesAndBuildMapping(output);
|
|
116
|
+
const matchIndex = strippedOutput.indexOf(trimmedCommand);
|
|
117
|
+
let matchEndInStripped;
|
|
118
|
+
let contentBefore;
|
|
119
|
+
if (matchIndex !== -1) {
|
|
120
|
+
contentBefore = strippedOutput.substring(0, matchIndex).trim();
|
|
121
|
+
matchEndInStripped = matchIndex + trimmedCommand.length - 1;
|
|
122
|
+
} else if (allowSuffixMatch) {
|
|
123
|
+
let suffixLen = 0;
|
|
124
|
+
for (let len = trimmedCommand.length - 1; len >= 1; len--) {
|
|
125
|
+
const suffix = trimmedCommand.substring(trimmedCommand.length - len);
|
|
126
|
+
if (strippedOutput.startsWith(suffix)) {
|
|
127
|
+
const charBefore = trimmedCommand[trimmedCommand.length - len - 1];
|
|
128
|
+
if (charBefore !== undefined && charBefore !== " " && charBefore !== "\t") {
|
|
129
|
+
suffixLen = len;
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (suffixLen === 0) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
contentBefore = "";
|
|
138
|
+
matchEndInStripped = suffixLen - 1;
|
|
139
|
+
} else {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
const originalEnd = indexMapping[matchEndInStripped];
|
|
143
|
+
const lines = output.split("\n");
|
|
144
|
+
let echoEndLine = 0;
|
|
145
|
+
let offset = 0;
|
|
146
|
+
for (let i = 0; i < lines.length; i++) {
|
|
147
|
+
const lineEnd = offset + lines[i].length;
|
|
148
|
+
if (offset <= originalEnd && originalEnd <= lineEnd) {
|
|
149
|
+
echoEndLine = i + 1;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
offset = lineEnd + 1;
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
contentBefore,
|
|
156
|
+
linesAfter: lines.slice(echoEndLine)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function stripNewLinesAndBuildMapping(output) {
|
|
160
|
+
const indexMapping = [];
|
|
161
|
+
const strippedChars = [];
|
|
162
|
+
for (let i = 0; i < output.length; i++) {
|
|
163
|
+
if (output[i] !== "\n") {
|
|
164
|
+
strippedChars.push(output[i]);
|
|
165
|
+
indexMapping.push(i);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
strippedOutput: strippedChars.join(""),
|
|
170
|
+
indexMapping
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export { createAltBufferPromise, findCommandEcho, setupRecreatingStartMarker, stripCommandEchoAndPrompt, stripNewLinesAndBuildMapping };
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
2
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
3
|
+
export interface IGetOutputOptions {
|
|
4
|
+
/** When set, only return the last N non-empty lines from the bottom of the buffer. */
|
|
5
|
+
lastNLines?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function getOutput(instance: ITerminalInstance, startMarker?: IXtermMarker, options?: IGetOutputOptions): string;
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
import { truncateOutputKeepingTail } from './runInTerminalHelpers.js';
|
|
3
|
+
|
|
4
|
+
const MAX_OUTPUT_LENGTH = 16000;
|
|
5
|
+
function getOutput(instance, startMarker, options) {
|
|
6
|
+
if (!instance.xterm || !instance.xterm.raw) {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
const buffer = instance.xterm.raw.buffer.active;
|
|
10
|
+
let startLine = Math.max(startMarker?.line ?? 0, 0);
|
|
11
|
+
while (startLine > 0 && buffer.getLine(startLine)?.isWrapped) {
|
|
12
|
+
startLine--;
|
|
13
|
+
}
|
|
14
|
+
const endLine = buffer.length;
|
|
15
|
+
const lines = [];
|
|
16
|
+
let currentLine = '';
|
|
17
|
+
for (let y = startLine; y < endLine; y++) {
|
|
18
|
+
const line = buffer.getLine(y);
|
|
19
|
+
if (!line) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const isWrapped = !!buffer.getLine(y + 1)?.isWrapped;
|
|
23
|
+
currentLine += line.translateToString(!isWrapped);
|
|
24
|
+
if (!isWrapped) {
|
|
25
|
+
lines.push(currentLine);
|
|
26
|
+
currentLine = '';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (currentLine) {
|
|
30
|
+
lines.push(currentLine);
|
|
31
|
+
}
|
|
32
|
+
if (options?.lastNLines !== undefined) {
|
|
33
|
+
const nonEmpty = lines.filter(l => l.trim().length > 0);
|
|
34
|
+
return nonEmpty.slice(-options.lastNLines).join('\n');
|
|
35
|
+
}
|
|
36
|
+
let output = lines.join('\n');
|
|
37
|
+
if (output.length > MAX_OUTPUT_LENGTH) {
|
|
38
|
+
output = truncateOutputKeepingTail(output, MAX_OUTPUT_LENGTH);
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { getOutput };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
2
|
+
import type { ToolConfirmationAction } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
3
|
+
import type { ICommandApprovalResultWithReason } from "./tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js";
|
|
4
|
+
export declare function isPowerShell(envShell: string, os: OperatingSystem): boolean;
|
|
5
|
+
export declare function isWindowsPowerShell(envShell: string): boolean;
|
|
6
|
+
export declare function isZsh(envShell: string, os: OperatingSystem): boolean;
|
|
7
|
+
export declare function isBash(envShell: string, os: OperatingSystem): boolean;
|
|
8
|
+
export declare function isFish(envShell: string, os: OperatingSystem): boolean;
|
|
9
|
+
export declare const TRUNCATION_MESSAGE = "\n\n[... PREVIOUS OUTPUT TRUNCATED ...]\n\n";
|
|
10
|
+
export declare function truncateOutputKeepingTail(output: string, maxLength: number): string;
|
|
11
|
+
export declare function sanitizeTerminalOutput(output: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Normalizes command text for UI display by removing unnecessary quote and forward slash
|
|
14
|
+
* escaping artifacts (for example: \" \' \/) commonly produced in streamed tool-call JSON.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeTerminalCommandForDisplay(commandLine: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Builds a single-line display string for a terminal command, suitable for UI messages.
|
|
19
|
+
* Normalizes escape artifacts, collapses newlines to spaces, and truncates to 80 characters.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildCommandDisplayText(command: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes a terminal command for execution by collapsing newlines to spaces.
|
|
24
|
+
* This prevents multi-line input from being sent as multiple commands via sendText.
|
|
25
|
+
*/
|
|
26
|
+
export declare function normalizeCommandForExecution(command: string): string;
|
|
27
|
+
export declare function generateAutoApproveActions(commandLine: string, subCommands: string[], autoApproveResult: {
|
|
28
|
+
subCommandResults: ICommandApprovalResultWithReason[];
|
|
29
|
+
commandLineResult: ICommandApprovalResultWithReason;
|
|
30
|
+
}): ToolConfirmationAction[];
|
|
31
|
+
export declare function dedupeRules(rules: ICommandApprovalResultWithReason[]): ICommandApprovalResultWithReason[];
|
|
32
|
+
export interface IExtractedCdPrefix {
|
|
33
|
+
/** The directory path that was extracted from the cd command */
|
|
34
|
+
directory: string;
|
|
35
|
+
/** The command to run after the cd */
|
|
36
|
+
command: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Extracts a cd prefix from a command line, returning the directory and remaining command.
|
|
40
|
+
* Does not check if the directory matches the current cwd - just extracts the pattern.
|
|
41
|
+
*/
|
|
42
|
+
export declare function extractCdPrefix(commandLine: string, shell: string, os: OperatingSystem): IExtractedCdPrefix | undefined;
|