@codingame/monaco-vscode-katex-common 31.0.0 → 32.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +15 -3
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +6 -5
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +5 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +45 -14
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +15 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +51 -54
- 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 +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +45 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +13 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +46 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +155 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +37 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +250 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +14 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- 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.js +7 -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/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +51 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +56 -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/buffers/paragraphBuffer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +4 -0
- 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.js +68 -10
- 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 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +653 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +28 -10
- 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 +91 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +53 -51
- 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.js +11 -11
- 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 +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +42 -22
- 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.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +93 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +169 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +60 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +13 -6
- 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 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +125 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +29 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +119 -10
- 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/chatToolInvocationPart.js +1 -1
- 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/media/toolRiskBadge.css +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +125 -0
- 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 +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +132 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +156 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +133 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +53 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +288 -125
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +23 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +699 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +12 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +120 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +191 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatPhoneInputPresenter.css +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +9 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +89 -108
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +3 -3
- 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 +521 -9
- 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/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +19 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +82 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +44 -17
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +3 -46
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.d.ts → inlineChatAffordanceWidget.d.ts} +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.js → inlineChatAffordanceWidget.js} +6 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +19 -400
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -9
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +5 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +47 -133
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +103 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +29 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +3 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -92
- 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/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +99 -32
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +13 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +76 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +89 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +11 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +7 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +11 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +59 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +24 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +111 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +60 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +455 -171
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +49 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +302 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +118 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +34 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +233 -48
- package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +0 -16
- package/vscode/src/vs/platform/actions/browser/actionbar.js +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +0 -539
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +0 -386
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +0 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +0 -509
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +0 -130
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +0 -276
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +0 -93
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +0 -39
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +0 -617
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +0 -231
|
@@ -10,8 +10,10 @@ import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
10
10
|
import { IPreferencesService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service";
|
|
11
11
|
import { ITerminalChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
|
|
12
12
|
import { IChatToolInvocation, type IChatTerminalToolInvocationData, type ILegacyChatTerminalToolInvocationData } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
13
|
+
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
|
|
13
14
|
import { IChatCodeBlockInfo } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
14
15
|
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
16
|
+
import { IChatToolRiskAssessmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service";
|
|
15
17
|
import { EditorPool } from "../chatContentCodePools.js";
|
|
16
18
|
import { IChatContentPartRenderContext } from "../chatContentParts.js";
|
|
17
19
|
import { BaseChatToolInvocationSubPart } from "./chatToolInvocationSubPart.js";
|
|
@@ -54,10 +56,13 @@ export declare class ChatTerminalToolConfirmationSubPart extends BaseChatToolInv
|
|
|
54
56
|
private readonly preferencesService;
|
|
55
57
|
private readonly storageService;
|
|
56
58
|
private readonly terminalChatService;
|
|
59
|
+
private readonly languageModelToolsService;
|
|
60
|
+
private readonly riskAssessmentService;
|
|
57
61
|
readonly domNode: HTMLElement;
|
|
58
62
|
readonly codeblocks: IChatCodeBlockInfo[];
|
|
59
|
-
constructor(toolInvocation: IChatToolInvocation, terminalData: IChatTerminalToolInvocationData | ILegacyChatTerminalToolInvocationData, context: IChatContentPartRenderContext, renderer: IMarkdownRenderer, editorPool: EditorPool, currentWidthDelegate: () => number, codeBlockStartIndex: number, instantiationService: IInstantiationService, dialogService: IDialogService, keybindingService: IKeybindingService, languageService: ILanguageService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, chatWidgetService: IChatWidgetService, preferencesService: IPreferencesService, storageService: IStorageService, terminalChatService: ITerminalChatService, hoverService: IHoverService);
|
|
63
|
+
constructor(toolInvocation: IChatToolInvocation, terminalData: IChatTerminalToolInvocationData | ILegacyChatTerminalToolInvocationData, context: IChatContentPartRenderContext, renderer: IMarkdownRenderer, editorPool: EditorPool, currentWidthDelegate: () => number, codeBlockStartIndex: number, instantiationService: IInstantiationService, dialogService: IDialogService, keybindingService: IKeybindingService, languageService: ILanguageService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, chatWidgetService: IChatWidgetService, preferencesService: IPreferencesService, storageService: IStorageService, terminalChatService: ITerminalChatService, hoverService: IHoverService, languageModelToolsService: ILanguageModelToolsService, riskAssessmentService: IChatToolRiskAssessmentService);
|
|
60
64
|
private _createButtons;
|
|
61
65
|
private _showAutoApproveWarning;
|
|
66
|
+
private _createRiskBadge;
|
|
62
67
|
private _appendMarkdownPart;
|
|
63
68
|
}
|
|
@@ -5,9 +5,10 @@ import { HoverStyle } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/
|
|
|
5
5
|
import { HoverPosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
6
6
|
import { Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
7
7
|
import { asArray } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
8
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
8
9
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
9
10
|
import { ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
10
|
-
import { MarkdownString, createCommandUri } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
11
|
+
import { MarkdownString, escapeMarkdownSyntaxTokens, createCommandUri } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
11
12
|
import { toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
12
13
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
13
14
|
import { isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
@@ -28,12 +29,15 @@ import { TerminalContribSettingId, TerminalContribCommandId } from '@codingame/m
|
|
|
28
29
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
29
30
|
import { migrateLegacyTerminalToolSpecificData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
|
|
30
31
|
import { IChatToolInvocation, ToolConfirmKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
32
|
+
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
31
33
|
import { AcceptToolConfirmationActionId, SkipToolConfirmationActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
|
|
32
34
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
35
|
+
import { IChatToolRiskAssessmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service';
|
|
33
36
|
import { ChatCustomConfirmationWidget } from '../chatConfirmationWidget.js';
|
|
34
37
|
import { ChatMarkdownContentPart } from '../chatMarkdownContentPart.js';
|
|
35
38
|
import { CodeBlockPart } from '../codeBlockPart.js';
|
|
36
39
|
import { BaseChatToolInvocationSubPart } from './chatToolInvocationSubPart.js';
|
|
40
|
+
import { ToolRiskBadgeWidget } from './toolRiskBadgeWidget.js';
|
|
37
41
|
|
|
38
42
|
var TerminalToolConfirmationStorageKeys;
|
|
39
43
|
(function(TerminalToolConfirmationStorageKeys) {
|
|
@@ -60,7 +64,9 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
60
64
|
preferencesService,
|
|
61
65
|
storageService,
|
|
62
66
|
terminalChatService,
|
|
63
|
-
hoverService
|
|
67
|
+
hoverService,
|
|
68
|
+
languageModelToolsService,
|
|
69
|
+
riskAssessmentService
|
|
64
70
|
) {
|
|
65
71
|
super(toolInvocation);
|
|
66
72
|
this.context = context;
|
|
@@ -78,6 +84,8 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
78
84
|
this.preferencesService = preferencesService;
|
|
79
85
|
this.storageService = storageService;
|
|
80
86
|
this.terminalChatService = terminalChatService;
|
|
87
|
+
this.languageModelToolsService = languageModelToolsService;
|
|
88
|
+
this.riskAssessmentService = riskAssessmentService;
|
|
81
89
|
this.codeblocks = [];
|
|
82
90
|
const state = toolInvocation.state.get();
|
|
83
91
|
if (state.type !== IChatToolInvocation.StateKind.WaitingForConfirmation || !state.confirmationMessages?.title) {
|
|
@@ -104,7 +112,7 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
104
112
|
moreActions = [];
|
|
105
113
|
if (!autoApproveWarningAccepted) {
|
|
106
114
|
moreActions.push({
|
|
107
|
-
label: ( localize(
|
|
115
|
+
label: ( localize(7310, "Enable Auto Approve...")),
|
|
108
116
|
data: {
|
|
109
117
|
type: "enable"
|
|
110
118
|
}
|
|
@@ -179,33 +187,89 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
179
187
|
hoverPosition: HoverPosition.LEFT
|
|
180
188
|
}
|
|
181
189
|
}));
|
|
190
|
+
const riskBadge = this._createRiskBadge(state.parameters);
|
|
182
191
|
const confirmWidget = this._register(
|
|
183
192
|
this.instantiationService.createInstance(ChatCustomConfirmationWidget, this.context, {
|
|
184
193
|
title,
|
|
185
194
|
icon: Codicon.terminal,
|
|
186
195
|
message: elements.root,
|
|
196
|
+
footerBanner: riskBadge?.domNode,
|
|
187
197
|
buttons: this._createButtons(moreActions)
|
|
188
198
|
})
|
|
189
199
|
);
|
|
200
|
+
const detailParts = [];
|
|
190
201
|
if (terminalData.requestUnsandboxedExecution) {
|
|
191
202
|
const reasonText = (terminalData.requestUnsandboxedExecutionReason && terminalData.requestUnsandboxedExecutionReason.trim()) || ( localize(
|
|
192
|
-
|
|
203
|
+
7311,
|
|
193
204
|
"The model did not provide a reason for requesting unsandboxed execution."
|
|
194
205
|
));
|
|
195
|
-
const
|
|
206
|
+
const inline = ( new MarkdownString(undefined, {
|
|
196
207
|
supportThemeIcons: true
|
|
197
208
|
}));
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
209
|
+
inline.appendMarkdown(`$(${Codicon.info.id}) `);
|
|
210
|
+
inline.appendText(reasonText);
|
|
211
|
+
detailParts.push({
|
|
212
|
+
inline,
|
|
213
|
+
hoverLabel: ( localize(7312, "Sandbox insufficient:")),
|
|
214
|
+
hoverBody: escapeMarkdownSyntaxTokens(reasonText),
|
|
215
|
+
isTrusted: undefined
|
|
216
|
+
});
|
|
201
217
|
}
|
|
202
218
|
if (disclaimer) {
|
|
203
|
-
|
|
219
|
+
const inline = typeof disclaimer === "string" ? ( new MarkdownString(disclaimer)) : disclaimer;
|
|
220
|
+
const hoverBody = inline.value.replace(/^\s*\$\([^)]+\)\s*/, "");
|
|
221
|
+
detailParts.push({
|
|
222
|
+
inline,
|
|
223
|
+
hoverLabel: ( localize(7313, "Approval needed:")),
|
|
224
|
+
hoverBody,
|
|
225
|
+
isTrusted: inline.isTrusted
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
const renderInlineDisclaimers = () => {
|
|
229
|
+
elements.disclaimer.replaceChildren();
|
|
230
|
+
for (const part of detailParts) {
|
|
231
|
+
this._appendMarkdownPart(elements.disclaimer, part.inline, codeBlockRenderOptions);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
if (riskBadge && detailParts.length) {
|
|
235
|
+
const combined = ( new MarkdownString(undefined, {
|
|
236
|
+
supportThemeIcons: true,
|
|
237
|
+
isTrusted: detailParts.reduce((acc, part) => {
|
|
238
|
+
if (part.isTrusted === true || acc === true) {
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
if (typeof part.isTrusted === "object" && part.isTrusted) {
|
|
242
|
+
const enabled = ( new Set([
|
|
243
|
+
...(typeof acc === "object" && acc?.enabledCommands ? acc.enabledCommands : []),
|
|
244
|
+
...part.isTrusted.enabledCommands
|
|
245
|
+
]));
|
|
246
|
+
return {
|
|
247
|
+
enabledCommands: [...enabled]
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return acc;
|
|
251
|
+
}, undefined)
|
|
252
|
+
}));
|
|
253
|
+
detailParts.forEach((part, i) => {
|
|
254
|
+
if (i > 0) {
|
|
255
|
+
combined.appendMarkdown("\n\n");
|
|
256
|
+
}
|
|
257
|
+
combined.appendMarkdown(`**${escapeMarkdownSyntaxTokens(part.hoverLabel)}** ${part.hoverBody}`);
|
|
258
|
+
});
|
|
259
|
+
riskBadge.setDetails(combined);
|
|
260
|
+
this._register(riskBadge.onDidHide(() => renderInlineDisclaimers()));
|
|
261
|
+
} else {
|
|
262
|
+
renderInlineDisclaimers();
|
|
204
263
|
}
|
|
205
264
|
const hasToolConfirmationKey = ChatContextKeys.Editing.hasToolConfirmation.bindTo(this.contextKeyService);
|
|
206
265
|
hasToolConfirmationKey.set(true);
|
|
207
266
|
this._register(toDisposable(() => hasToolConfirmationKey.reset()));
|
|
208
|
-
this._register(confirmWidget.onDidClick(async
|
|
267
|
+
this._register(confirmWidget.onDidClick(async (
|
|
268
|
+
{
|
|
269
|
+
button,
|
|
270
|
+
isTouchClick
|
|
271
|
+
}
|
|
272
|
+
) => {
|
|
209
273
|
let doComplete = true;
|
|
210
274
|
const data = button.data;
|
|
211
275
|
let toolConfirmKind = ToolConfirmKind.Denied;
|
|
@@ -315,7 +379,7 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
315
379
|
}
|
|
316
380
|
const target = scope === "workspace" ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER;
|
|
317
381
|
const settingsUri = createCommandUri(TerminalContribCommandId.OpenTerminalSettingsLink, target);
|
|
318
|
-
return `[\`${e.key}\`](${( settingsUri.toString())} "${( localize(
|
|
382
|
+
return `[\`${e.key}\`](${( settingsUri.toString())} "${( localize(7314, "View rule in settings"))}")`;
|
|
319
383
|
})).join(", ");
|
|
320
384
|
}
|
|
321
385
|
const mdTrustSettings = {
|
|
@@ -326,33 +390,33 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
326
390
|
const parts = [];
|
|
327
391
|
if (sessionRules.length > 0) {
|
|
328
392
|
parts.push(sessionRules.length === 1 ? ( localize(
|
|
329
|
-
|
|
393
|
+
7315,
|
|
330
394
|
"Session auto approve rule {0} added",
|
|
331
395
|
formatRuleLinks(sessionRules, "session")
|
|
332
396
|
)) : ( localize(
|
|
333
|
-
|
|
397
|
+
7316,
|
|
334
398
|
"Session auto approve rules {0} added",
|
|
335
399
|
formatRuleLinks(sessionRules, "session")
|
|
336
400
|
)));
|
|
337
401
|
}
|
|
338
402
|
if (workspaceRules.length > 0) {
|
|
339
403
|
parts.push(workspaceRules.length === 1 ? ( localize(
|
|
340
|
-
|
|
404
|
+
7317,
|
|
341
405
|
"Workspace auto approve rule {0} added",
|
|
342
406
|
formatRuleLinks(workspaceRules, "workspace")
|
|
343
407
|
)) : ( localize(
|
|
344
|
-
|
|
408
|
+
7318,
|
|
345
409
|
"Workspace auto approve rules {0} added",
|
|
346
410
|
formatRuleLinks(workspaceRules, "workspace")
|
|
347
411
|
)));
|
|
348
412
|
}
|
|
349
413
|
if (userRules.length > 0) {
|
|
350
414
|
parts.push(userRules.length === 1 ? ( localize(
|
|
351
|
-
|
|
415
|
+
7319,
|
|
352
416
|
"User auto approve rule {0} added",
|
|
353
417
|
formatRuleLinks(userRules, "user")
|
|
354
418
|
)) : ( localize(
|
|
355
|
-
|
|
419
|
+
7320,
|
|
356
420
|
"User auto approve rules {0} added",
|
|
357
421
|
formatRuleLinks(userRules, "user")
|
|
358
422
|
)));
|
|
@@ -382,7 +446,7 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
382
446
|
enabledCommands: [TerminalContribCommandId.DisableSessionAutoApproval]
|
|
383
447
|
}
|
|
384
448
|
};
|
|
385
|
-
terminalData.autoApproveInfo = ( new MarkdownString(`${( localize(
|
|
449
|
+
terminalData.autoApproveInfo = ( new MarkdownString(`${( localize(7321, "All commands will be auto approved for this session"))} ([${( localize(7322, "Disable"))}](${( disableUri.toString())}))`, mdTrustSettings));
|
|
386
450
|
toolConfirmKind = ToolConfirmKind.UserAction;
|
|
387
451
|
break;
|
|
388
452
|
}
|
|
@@ -392,7 +456,9 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
392
456
|
IChatToolInvocation.confirmWith(toolInvocation, {
|
|
393
457
|
type: toolConfirmKind
|
|
394
458
|
});
|
|
395
|
-
|
|
459
|
+
if (!isTouchClick) {
|
|
460
|
+
this.chatWidgetService.getWidgetBySessionResource(this.context.element.sessionResource)?.focusInput();
|
|
461
|
+
}
|
|
396
462
|
}
|
|
397
463
|
}));
|
|
398
464
|
this.domNode = confirmWidget.domNode;
|
|
@@ -406,11 +472,11 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
406
472
|
};
|
|
407
473
|
};
|
|
408
474
|
return [{
|
|
409
|
-
...getLabelAndTooltip(( localize(
|
|
475
|
+
...getLabelAndTooltip(( localize(7323, "Allow")), AcceptToolConfirmationActionId),
|
|
410
476
|
data: true,
|
|
411
477
|
moreActions
|
|
412
478
|
}, {
|
|
413
|
-
...getLabelAndTooltip(( localize(
|
|
479
|
+
...getLabelAndTooltip(( localize(7324, "Skip")), SkipToolConfirmationActionId, ( localize(7325, "Proceed without executing this command"))),
|
|
414
480
|
data: {
|
|
415
481
|
type: "skip"
|
|
416
482
|
},
|
|
@@ -420,9 +486,9 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
420
486
|
async _showAutoApproveWarning() {
|
|
421
487
|
const promptResult = await this.dialogService.prompt({
|
|
422
488
|
type: Severity.Info,
|
|
423
|
-
message: ( localize(
|
|
489
|
+
message: ( localize(7326, "Enable terminal auto approve?")),
|
|
424
490
|
buttons: [{
|
|
425
|
-
label: ( localize(
|
|
491
|
+
label: ( localize(7327, "Enable")),
|
|
426
492
|
run: () => true
|
|
427
493
|
}],
|
|
428
494
|
cancelButton: true,
|
|
@@ -430,16 +496,49 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
430
496
|
icon: Codicon.shield,
|
|
431
497
|
markdownDetails: [{
|
|
432
498
|
markdown: ( new MarkdownString(( localize(
|
|
433
|
-
|
|
499
|
+
7328,
|
|
434
500
|
"This will enable a configurable subset of commands to run in the terminal autonomously. It provides *best effort protections* and assumes the agent is not acting maliciously."
|
|
435
501
|
))))
|
|
436
502
|
}, {
|
|
437
|
-
markdown: ( new MarkdownString(`[${( localize(
|
|
503
|
+
markdown: ( new MarkdownString(`[${( localize(7329, "Learn more about the potential risks and how to avoid them."))}](https://code.visualstudio.com/docs/copilot/security#_security-considerations)`))
|
|
438
504
|
}]
|
|
439
505
|
}
|
|
440
506
|
});
|
|
441
507
|
return promptResult.result === true;
|
|
442
508
|
}
|
|
509
|
+
_createRiskBadge(parameters) {
|
|
510
|
+
if (!this.riskAssessmentService.isEnabled()) {
|
|
511
|
+
return undefined;
|
|
512
|
+
}
|
|
513
|
+
const tool = this.languageModelToolsService.getTool(this.toolInvocation.toolId);
|
|
514
|
+
if (!tool) {
|
|
515
|
+
return undefined;
|
|
516
|
+
}
|
|
517
|
+
const widget = this._register(this.instantiationService.createInstance(ToolRiskBadgeWidget));
|
|
518
|
+
const cached = this.riskAssessmentService.getCached(tool, parameters);
|
|
519
|
+
if (cached) {
|
|
520
|
+
widget.setAssessment(cached);
|
|
521
|
+
} else {
|
|
522
|
+
widget.setLoading();
|
|
523
|
+
const cts = this._register(( new CancellationTokenSource()));
|
|
524
|
+
(async () => {
|
|
525
|
+
try {
|
|
526
|
+
const result = await this.riskAssessmentService.assess(tool, parameters, cts.token);
|
|
527
|
+
if (cts.token.isCancellationRequested) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (!result) {
|
|
531
|
+
widget.setHidden();
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
widget.setAssessment(result);
|
|
535
|
+
} catch {
|
|
536
|
+
widget.setHidden();
|
|
537
|
+
}
|
|
538
|
+
})();
|
|
539
|
+
}
|
|
540
|
+
return widget;
|
|
541
|
+
}
|
|
443
542
|
_appendMarkdownPart(container, message, codeBlockRenderOptions) {
|
|
444
543
|
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart, {
|
|
445
544
|
kind: "markdownContent",
|
|
@@ -450,6 +549,6 @@ let ChatTerminalToolConfirmationSubPart = class ChatTerminalToolConfirmationSubP
|
|
|
450
549
|
append(container, part.domNode);
|
|
451
550
|
}
|
|
452
551
|
};
|
|
453
|
-
ChatTerminalToolConfirmationSubPart = ( __decorate([( __param(7, IInstantiationService)), ( __param(8, IDialogService)), ( __param(9, IKeybindingService)), ( __param(10, ILanguageService)), ( __param(11, IConfigurationService)), ( __param(12, IContextKeyService)), ( __param(13, IChatWidgetService)), ( __param(14, IPreferencesService)), ( __param(15, IStorageService)), ( __param(16, ITerminalChatService)), ( __param(17, IHoverService))], ChatTerminalToolConfirmationSubPart));
|
|
552
|
+
ChatTerminalToolConfirmationSubPart = ( __decorate([( __param(7, IInstantiationService)), ( __param(8, IDialogService)), ( __param(9, IKeybindingService)), ( __param(10, ILanguageService)), ( __param(11, IConfigurationService)), ( __param(12, IContextKeyService)), ( __param(13, IChatWidgetService)), ( __param(14, IPreferencesService)), ( __param(15, IStorageService)), ( __param(16, ITerminalChatService)), ( __param(17, IHoverService)), ( __param(18, ILanguageModelToolsService)), ( __param(19, IChatToolRiskAssessmentService))], ChatTerminalToolConfirmationSubPart));
|
|
454
553
|
|
|
455
554
|
export { ChatTerminalToolConfirmationSubPart, TerminalToolConfirmationStorageKeys };
|
|
@@ -147,7 +147,8 @@ export declare class ChatTerminalThinkingCollapsibleWrapper extends ChatCollapsi
|
|
|
147
147
|
private readonly _commandText;
|
|
148
148
|
private readonly _isSandboxWrapped;
|
|
149
149
|
private _isComplete;
|
|
150
|
-
|
|
150
|
+
private readonly _isSkipped;
|
|
151
|
+
constructor(commandText: string, isSandboxWrapped: boolean, contentElement: HTMLElement, context: IChatContentPartRenderContext, initialExpanded: boolean, isComplete: boolean, isSkipped: boolean, hoverService: IHoverService, configurationService: IConfigurationService);
|
|
151
152
|
private _setCodeFormattedTitle;
|
|
152
153
|
markComplete(): void;
|
|
153
154
|
protected initContent(): HTMLElement;
|
|
@@ -7,7 +7,7 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
7
7
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
8
|
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
9
9
|
import { migrateLegacyTerminalToolSpecificData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
|
|
10
|
-
import { IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
10
|
+
import { IChatToolInvocation, ToolConfirmKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
11
11
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
12
12
|
import { ChatQueryTitlePart } from '../chatConfirmationWidget.js';
|
|
13
13
|
import { ChatMarkdownContentPart } from '../chatMarkdownContentPart.js';
|
|
@@ -325,7 +325,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
|
|
|
325
325
|
const markdownOptions = {
|
|
326
326
|
codeBlockRenderOptions,
|
|
327
327
|
accessibilityOptions: pastTenseMessage ? {
|
|
328
|
-
statusMessage: ( localize(
|
|
328
|
+
statusMessage: ( localize(7330, "{0}", stripIcons(pastTenseMessage)))
|
|
329
329
|
} : undefined
|
|
330
330
|
};
|
|
331
331
|
this.markdownPart = this._register(_instantiationService.createInstance(
|
|
@@ -411,6 +411,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
|
|
|
411
411
|
_createCollapsibleWrapper(contentElement, commandText, toolInvocation, context) {
|
|
412
412
|
const truncatedCommand = commandText.length > MAX_COMMAND_TITLE_LENGTH ? commandText.substring(0, MAX_COMMAND_TITLE_LENGTH) + "..." : commandText;
|
|
413
413
|
const isComplete = IChatToolInvocation.isComplete(toolInvocation);
|
|
414
|
+
const isSkipped = IChatToolInvocation.executionConfirmedOrDenied(toolInvocation)?.type === ToolConfirmKind.Skipped;
|
|
414
415
|
const autoExpandFailures = this._configurationService.getValue(ChatConfiguration.AutoExpandToolFailures);
|
|
415
416
|
const hasError = autoExpandFailures && this._terminalData.terminalCommandState?.exitCode !== undefined && this._terminalData.terminalCommandState.exitCode !== 0;
|
|
416
417
|
const initialExpanded = !isComplete || hasError;
|
|
@@ -421,7 +422,8 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
|
|
|
421
422
|
contentElement,
|
|
422
423
|
context,
|
|
423
424
|
initialExpanded,
|
|
424
|
-
isComplete
|
|
425
|
+
isComplete,
|
|
426
|
+
isSkipped
|
|
425
427
|
));
|
|
426
428
|
this._thinkingCollapsibleWrapper = wrapper;
|
|
427
429
|
let isFirstRun = true;
|
|
@@ -529,12 +531,12 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
|
|
|
529
531
|
this._actionBarActions.clear();
|
|
530
532
|
const actions = [];
|
|
531
533
|
if (this._toolbarCanContinueInBackground) {
|
|
532
|
-
const action = ( new Action(TerminalContribCommandId.ContinueInBackground, ( localize(
|
|
534
|
+
const action = ( new Action(TerminalContribCommandId.ContinueInBackground, ( localize(7331, "Continue in Background")), ThemeIcon.asClassName(Codicon.debugContinue), true, () => this.continueInBackground()));
|
|
533
535
|
this._actionBarActions.add(action);
|
|
534
536
|
actions.push(action);
|
|
535
537
|
}
|
|
536
538
|
if (this._toolbarHasInstance) {
|
|
537
|
-
const focusLabel = this._toolbarIsHiddenTerminal ? ( localize(
|
|
539
|
+
const focusLabel = this._toolbarIsHiddenTerminal ? ( localize(7332, "Show and Focus Terminal")) : ( localize(7333, "Focus Terminal"));
|
|
538
540
|
const action = ( new Action(
|
|
539
541
|
TerminalContribCommandId.FocusChatInstanceAction,
|
|
540
542
|
focusLabel,
|
|
@@ -547,7 +549,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
|
|
|
547
549
|
}
|
|
548
550
|
if (this._toolbarHasOutput && !this._usesCollapsibleWrapper) {
|
|
549
551
|
const toggleIcon = this._toolbarOutputExpanded ? Codicon.chevronDown : Codicon.chevronRight;
|
|
550
|
-
const toggleLabel = this._toolbarOutputExpanded ? ( localize(
|
|
552
|
+
const toggleLabel = this._toolbarOutputExpanded ? ( localize(7334, "Hide Output")) : ( localize(7335, "Show Output"));
|
|
551
553
|
const action = ( new Action(
|
|
552
554
|
TerminalContribCommandId.ToggleChatTerminalOutput,
|
|
553
555
|
toggleLabel,
|
|
@@ -933,8 +935,10 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
|
|
|
933
935
|
EventType.FOCUS_OUT,
|
|
934
936
|
event => this._onDidBlurEmitter.fire(event)
|
|
935
937
|
));
|
|
936
|
-
const resizeObserver = this._register(
|
|
937
|
-
|
|
938
|
+
const resizeObserver = this._register(
|
|
939
|
+
new DisposableResizeObserver("ChatTerminalToolProgressPart.handleResize", () => this._handleResize())
|
|
940
|
+
);
|
|
941
|
+
this._register(resizeObserver.observe(this.domNode));
|
|
938
942
|
this._applyBackgroundColor();
|
|
939
943
|
this._register(
|
|
940
944
|
this._themeService.onDidColorThemeChange(() => this._applyBackgroundColor())
|
|
@@ -978,7 +982,7 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
|
|
|
978
982
|
if (!commandText) {
|
|
979
983
|
return;
|
|
980
984
|
}
|
|
981
|
-
const ariaLabel = ( localize(
|
|
985
|
+
const ariaLabel = ( localize(7336, "Terminal output for {0}", commandText));
|
|
982
986
|
const scrollableDomNode = this._scrollableContainer.getDomNode();
|
|
983
987
|
scrollableDomNode.setAttribute("role", "region");
|
|
984
988
|
const accessibleViewHint = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.TerminalChatOutput);
|
|
@@ -991,26 +995,26 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
|
|
|
991
995
|
if (!commandText) {
|
|
992
996
|
return undefined;
|
|
993
997
|
}
|
|
994
|
-
const commandHeader = ( localize(
|
|
998
|
+
const commandHeader = ( localize(7337, "Command: {0}", commandText));
|
|
995
999
|
if (command) {
|
|
996
1000
|
const rawOutput = command.getOutput();
|
|
997
1001
|
if (!rawOutput || rawOutput.trim().length === 0) {
|
|
998
|
-
return `${commandHeader}\n${( localize(
|
|
1002
|
+
return `${commandHeader}\n${( localize(7338, "No output was produced by the command."))}`;
|
|
999
1003
|
}
|
|
1000
1004
|
const lines = rawOutput.split("\n");
|
|
1001
1005
|
return `${commandHeader}\n${lines.join("\n").trimEnd()}`;
|
|
1002
1006
|
}
|
|
1003
1007
|
const snapshot = this._getTerminalCommandOutput();
|
|
1004
1008
|
if (!snapshot) {
|
|
1005
|
-
return `${commandHeader}\n${( localize(
|
|
1009
|
+
return `${commandHeader}\n${( localize(7339, "Command output is no longer available."))}`;
|
|
1006
1010
|
}
|
|
1007
1011
|
const plain = removeAnsiEscapeCodes((snapshot.text ?? ""));
|
|
1008
1012
|
if (!plain.trim().length) {
|
|
1009
|
-
return `${commandHeader}\n${( localize(
|
|
1013
|
+
return `${commandHeader}\n${( localize(7338, "No output was produced by the command."))}`;
|
|
1010
1014
|
}
|
|
1011
1015
|
let outputText = plain.trimEnd();
|
|
1012
1016
|
if (snapshot.truncated) {
|
|
1013
|
-
outputText += `\n${( localize(
|
|
1017
|
+
outputText += `\n${( localize(7340, "Output truncated."))}`;
|
|
1014
1018
|
}
|
|
1015
1019
|
return `${commandHeader}\n${outputText}`;
|
|
1016
1020
|
}
|
|
@@ -1122,7 +1126,7 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
|
|
|
1122
1126
|
}
|
|
1123
1127
|
if (!hasOutput) {
|
|
1124
1128
|
if (commandFinished) {
|
|
1125
|
-
this._showEmptyMessage(( localize(
|
|
1129
|
+
this._showEmptyMessage(( localize(7338, "No output was produced by the command.")));
|
|
1126
1130
|
}
|
|
1127
1131
|
} else {
|
|
1128
1132
|
this._hideEmptyMessage();
|
|
@@ -1149,7 +1153,7 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
|
|
|
1149
1153
|
if (hasText) {
|
|
1150
1154
|
this._hideEmptyMessage();
|
|
1151
1155
|
} else {
|
|
1152
|
-
this._showEmptyMessage(( localize(
|
|
1156
|
+
this._showEmptyMessage(( localize(7338, "No output was produced by the command.")));
|
|
1153
1157
|
}
|
|
1154
1158
|
const lineCount = result?.lineCount ?? snapshot.lineCount ?? 0;
|
|
1155
1159
|
this._layoutOutput(lineCount);
|
|
@@ -1158,9 +1162,9 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
|
|
|
1158
1162
|
clearNode(this._terminalContainer);
|
|
1159
1163
|
this._lastRenderedLineCount = undefined;
|
|
1160
1164
|
if (!liveTerminalInstance) {
|
|
1161
|
-
this._showEmptyMessage(( localize(
|
|
1165
|
+
this._showEmptyMessage(( localize(7341, "Terminal is no longer available.")));
|
|
1162
1166
|
} else {
|
|
1163
|
-
this._showEmptyMessage(( localize(
|
|
1167
|
+
this._showEmptyMessage(( localize(7342, "Command information is not available.")));
|
|
1164
1168
|
}
|
|
1165
1169
|
}
|
|
1166
1170
|
async _resolveLiveTerminal() {
|
|
@@ -1281,15 +1285,17 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
|
|
|
1281
1285
|
context,
|
|
1282
1286
|
initialExpanded,
|
|
1283
1287
|
isComplete,
|
|
1288
|
+
isSkipped,
|
|
1284
1289
|
hoverService,
|
|
1285
1290
|
configurationService
|
|
1286
1291
|
) {
|
|
1287
|
-
const title = isComplete ? ( localize(
|
|
1292
|
+
const title = isSkipped ? ( localize(7343, "Skipped {0}", commandText)) : isComplete ? ( localize(7344, "Ran {0}", commandText)) : ( localize(7345, "Running {0}", commandText));
|
|
1288
1293
|
super(title, context, undefined, hoverService, configurationService);
|
|
1289
1294
|
this._terminalContentElement = contentElement;
|
|
1290
1295
|
this._commandText = commandText;
|
|
1291
1296
|
this._isSandboxWrapped = isSandboxWrapped;
|
|
1292
1297
|
this._isComplete = isComplete;
|
|
1298
|
+
this._isSkipped = isSkipped;
|
|
1293
1299
|
this.domNode.classList.add("chat-terminal-thinking-collapsible");
|
|
1294
1300
|
if (isComplete) {
|
|
1295
1301
|
this.icon = Codicon.check;
|
|
@@ -1304,8 +1310,8 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
|
|
|
1304
1310
|
const labelElement = this._collapseButton.labelElement;
|
|
1305
1311
|
labelElement.textContent = "";
|
|
1306
1312
|
if (this._isSandboxWrapped) {
|
|
1307
|
-
const prefixText = this._isComplete ? ( localize(
|
|
1308
|
-
const suffixText = ( localize(
|
|
1313
|
+
const prefixText = this._isSkipped ? ( localize(7346, "Skipped ")) : this._isComplete ? ( localize(7347, "Ran ")) : ( localize(7348, "Running "));
|
|
1314
|
+
const suffixText = ( localize(7349, " in sandbox"));
|
|
1309
1315
|
labelElement.appendChild(createTextNode(prefixText));
|
|
1310
1316
|
const codeElement = createElement("code");
|
|
1311
1317
|
codeElement.textContent = this._commandText;
|
|
@@ -1313,7 +1319,7 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
|
|
|
1313
1319
|
labelElement.appendChild(createTextNode(suffixText));
|
|
1314
1320
|
return;
|
|
1315
1321
|
}
|
|
1316
|
-
const prefixText = this._isComplete ? ( localize(
|
|
1322
|
+
const prefixText = this._isSkipped ? ( localize(7350, "Skipped ")) : this._isComplete ? ( localize(7351, "Ran ")) : ( localize(7352, "Running "));
|
|
1317
1323
|
const ranText = createTextNode(prefixText);
|
|
1318
1324
|
const codeElement = createElement("code");
|
|
1319
1325
|
codeElement.textContent = this._commandText;
|
|
@@ -1340,6 +1346,6 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
|
|
|
1340
1346
|
return false;
|
|
1341
1347
|
}
|
|
1342
1348
|
};
|
|
1343
|
-
ChatTerminalThinkingCollapsibleWrapper = ( __decorate([( __param(
|
|
1349
|
+
ChatTerminalThinkingCollapsibleWrapper = ( __decorate([( __param(7, IHoverService)), ( __param(8, IConfigurationService))], ChatTerminalThinkingCollapsibleWrapper));
|
|
1344
1350
|
|
|
1345
1351
|
export { ChatTerminalThinkingCollapsibleWrapper, ChatTerminalToolProgressPart };
|
|
@@ -21,8 +21,13 @@ export declare class ChatToolConfirmationCarouselPart extends Disposable {
|
|
|
21
21
|
private readonly prevButton;
|
|
22
22
|
private readonly nextButton;
|
|
23
23
|
private readonly allowAllButton;
|
|
24
|
+
private readonly expandContentButton;
|
|
24
25
|
private readonly dismissButton;
|
|
25
26
|
private readonly activeContentDisposables;
|
|
27
|
+
private readonly contentResizeObserver;
|
|
28
|
+
private readonly updateContentExpansionStateScheduler;
|
|
29
|
+
private _isContentExpanded;
|
|
30
|
+
private canExpandContent;
|
|
26
31
|
private maxHeight;
|
|
27
32
|
constructor(toolPartFactory: ToolInvocationPartFactory, initialTools: IChatToolInvocation[], scrollToSubagent?: ScrollToSubagentCallback | undefined, initialSubAgentInvocationId?: string | undefined, initialAgentName?: string | undefined);
|
|
28
33
|
get pendingCount(): number;
|
|
@@ -40,7 +45,16 @@ export declare class ChatToolConfirmationCarouselPart extends Disposable {
|
|
|
40
45
|
private focusActiveContent;
|
|
41
46
|
private updateUI;
|
|
42
47
|
private renderActiveContent;
|
|
48
|
+
private toggleContentExpanded;
|
|
49
|
+
private updateContentExpansionState;
|
|
43
50
|
private updateMaxHeightStyle;
|
|
51
|
+
private updateExpandContentButton;
|
|
52
|
+
private isActiveContentLargerThanCollapsedLimit;
|
|
53
|
+
private hasInnerContentLargerThanCollapsedLimit;
|
|
54
|
+
private isExpandableContentElement;
|
|
55
|
+
private observeExpandableContentElements;
|
|
56
|
+
private getElementHeight;
|
|
57
|
+
private getExpandableContentHeightLimit;
|
|
44
58
|
private getCollapsedMaxHeight;
|
|
45
59
|
allowAll(): void;
|
|
46
60
|
private skipAll;
|