@codingame/monaco-vscode-katex-common 31.0.1 → 32.0.1
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
package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js
CHANGED
|
@@ -29,6 +29,8 @@ import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/l
|
|
|
29
29
|
import { ResourceContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
30
30
|
import { isStringImplicitContextValue } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
31
31
|
import { IChatContextService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service';
|
|
32
|
+
import { IBrowserViewWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/browserView/common/browserView.service';
|
|
33
|
+
import { BrowserViewUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/browserView/common/browserViewUri';
|
|
32
34
|
|
|
33
35
|
let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget extends Disposable {
|
|
34
36
|
constructor(
|
|
@@ -47,7 +49,8 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
47
49
|
modelService,
|
|
48
50
|
hoverService,
|
|
49
51
|
configService,
|
|
50
|
-
chatContextService
|
|
52
|
+
chatContextService,
|
|
53
|
+
browserViewService
|
|
51
54
|
) {
|
|
52
55
|
super();
|
|
53
56
|
this.widgetRef = widgetRef;
|
|
@@ -66,6 +69,7 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
66
69
|
this.hoverService = hoverService;
|
|
67
70
|
this.configService = configService;
|
|
68
71
|
this.chatContextService = chatContextService;
|
|
72
|
+
this.browserViewService = browserViewService;
|
|
69
73
|
this.renderDisposables = this._register(( new DisposableStore()));
|
|
70
74
|
this.renderedCount = 0;
|
|
71
75
|
this.render();
|
|
@@ -93,12 +97,12 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
93
97
|
contextNode.tabIndex = 0;
|
|
94
98
|
contextNode.classList.toggle("disabled", !context.enabled);
|
|
95
99
|
const file = context.uri;
|
|
96
|
-
const attachmentTypeName = file?.scheme === Schemas.vscodeNotebookCell ? ( localize(
|
|
97
|
-
const contextLabel = context.name ?? (file ? basename(file) : ( localize(
|
|
100
|
+
const attachmentTypeName = file?.scheme === Schemas.vscodeNotebookCell ? ( localize(5741, "cell")) : ( localize(5742, "file"));
|
|
101
|
+
const contextLabel = context.name ?? (file ? basename(file) : ( localize(5743, "context")));
|
|
98
102
|
const isSuggestedEnabled = this.configService.getValue("chat.implicitContext.suggestedContext");
|
|
99
103
|
if (isSuggestedEnabled) {
|
|
100
104
|
if (!isSelection) {
|
|
101
|
-
const buttonMsg = context.enabled ? ( localize(
|
|
105
|
+
const buttonMsg = context.enabled ? ( localize(5744, "Disable {0} context {1}", attachmentTypeName, contextLabel)) : ( localize(5745, "Add {0} to context", contextLabel));
|
|
102
106
|
const toggleButton = this.renderDisposables.add(( new Button(contextNode, {
|
|
103
107
|
supportIcons: true,
|
|
104
108
|
title: buttonMsg
|
|
@@ -113,7 +117,7 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
113
117
|
context.enabled = false;
|
|
114
118
|
}));
|
|
115
119
|
} else {
|
|
116
|
-
const pinButtonMsg = ( localize(
|
|
120
|
+
const pinButtonMsg = ( localize(5746, "Pin selection"));
|
|
117
121
|
const pinButton = this.renderDisposables.add(( new Button(contextNode, {
|
|
118
122
|
supportIcons: true,
|
|
119
123
|
title: pinButtonMsg
|
|
@@ -146,7 +150,7 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
146
150
|
})
|
|
147
151
|
);
|
|
148
152
|
} else {
|
|
149
|
-
const buttonMsg = context.enabled ? ( localize(
|
|
153
|
+
const buttonMsg = context.enabled ? ( localize(5747, "Disable current {0} context", attachmentTypeName)) : ( localize(5748, "Enable current {0} context", attachmentTypeName));
|
|
150
154
|
const toggleButton = this.renderDisposables.add(( new Button(contextNode, {
|
|
151
155
|
supportIcons: true,
|
|
152
156
|
title: buttonMsg
|
|
@@ -170,9 +174,9 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
170
174
|
context.icon,
|
|
171
175
|
context.value.resourceUri,
|
|
172
176
|
markdownTooltip,
|
|
173
|
-
( localize(
|
|
177
|
+
( localize(5749, "Current file context"))
|
|
174
178
|
);
|
|
175
|
-
contextNode.ariaLabel = ( localize(
|
|
179
|
+
contextNode.ariaLabel = ( localize(5750, "Suggested context, {0}", context.name));
|
|
176
180
|
} else {
|
|
177
181
|
title = this.renderResource(context.value, context.isSelection, context.enabled, label, contextNode);
|
|
178
182
|
}
|
|
@@ -229,23 +233,26 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
229
233
|
renderResource(attachmentValue, isSelection, enabled, label, contextNode) {
|
|
230
234
|
const file = URI.isUri(attachmentValue) ? attachmentValue : attachmentValue.uri;
|
|
231
235
|
const range = URI.isUri(attachmentValue) || !isSelection ? undefined : attachmentValue.range;
|
|
232
|
-
|
|
236
|
+
if (file.scheme === Schemas.vscodeBrowser) {
|
|
237
|
+
return this.renderBrowserResource(file, label, contextNode);
|
|
238
|
+
}
|
|
239
|
+
const attachmentTypeName = file.scheme === Schemas.vscodeNotebookCell ? ( localize(5741, "cell")) : ( localize(5742, "file"));
|
|
233
240
|
const fileBasename = basename(file);
|
|
234
241
|
const fileDirname = dirname(file);
|
|
235
242
|
const friendlyName = `${fileBasename} ${fileDirname}`;
|
|
236
243
|
const ariaLabel = range ? ( localize(
|
|
237
|
-
|
|
244
|
+
5751,
|
|
238
245
|
"Suggested context, {0}, {1}, line {2} to line {3}",
|
|
239
246
|
attachmentTypeName,
|
|
240
247
|
friendlyName,
|
|
241
248
|
range.startLineNumber,
|
|
242
249
|
range.endLineNumber
|
|
243
|
-
)) : ( localize(
|
|
250
|
+
)) : ( localize(5752, "Suggested context, {0}, {1}", attachmentTypeName, friendlyName));
|
|
244
251
|
const uriLabel = this.labelService.getUriLabel(file, {
|
|
245
252
|
relative: true
|
|
246
253
|
});
|
|
247
|
-
const currentFile = ( localize(
|
|
248
|
-
const inactive = ( localize(
|
|
254
|
+
const currentFile = ( localize(5753, "Current {0} context", attachmentTypeName));
|
|
255
|
+
const inactive = ( localize(5754, "Enable current {0} context", attachmentTypeName));
|
|
249
256
|
const currentFileHint = enabled || isSelection ? currentFile : inactive;
|
|
250
257
|
const title = `${currentFileHint}\n${uriLabel}`;
|
|
251
258
|
label.setFile(file, {
|
|
@@ -257,6 +264,22 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
257
264
|
contextNode.ariaLabel = ariaLabel;
|
|
258
265
|
return title;
|
|
259
266
|
}
|
|
267
|
+
renderBrowserResource(browserUri, label, contextNode) {
|
|
268
|
+
const id = BrowserViewUri.getId(browserUri);
|
|
269
|
+
const input = id && this.browserViewService.getKnownBrowserViews().get(id);
|
|
270
|
+
if (!input) {
|
|
271
|
+
return undefined;
|
|
272
|
+
}
|
|
273
|
+
const update = () => {
|
|
274
|
+
label.setLabel(input.getName(), undefined, {
|
|
275
|
+
iconPath: Codicon.globe
|
|
276
|
+
});
|
|
277
|
+
contextNode.ariaLabel = ( localize(5755, "Suggested browser context, {0}", input.getName()));
|
|
278
|
+
};
|
|
279
|
+
update();
|
|
280
|
+
this.renderDisposables.add(input.onDidChangeLabel(() => update()));
|
|
281
|
+
return input.getTitle();
|
|
282
|
+
}
|
|
260
283
|
async convertToRegularAttachment(attachment) {
|
|
261
284
|
if (!attachment.value) {
|
|
262
285
|
return;
|
|
@@ -302,6 +325,6 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
302
325
|
this.widgetRef()?.focusInput();
|
|
303
326
|
}
|
|
304
327
|
};
|
|
305
|
-
ImplicitContextAttachmentWidget = ( __decorate([( __param(6, IContextKeyService)), ( __param(7, IContextMenuService)), ( __param(8, ILabelService)), ( __param(9, IMenuService)), ( __param(10, IFileService)), ( __param(11, ILanguageService)), ( __param(12, IModelService)), ( __param(13, IHoverService)), ( __param(14, IConfigurationService)), ( __param(15, IChatContextService))], ImplicitContextAttachmentWidget));
|
|
328
|
+
ImplicitContextAttachmentWidget = ( __decorate([( __param(6, IContextKeyService)), ( __param(7, IContextMenuService)), ( __param(8, ILabelService)), ( __param(9, IMenuService)), ( __param(10, IFileService)), ( __param(11, ILanguageService)), ( __param(12, IModelService)), ( __param(13, IHoverService)), ( __param(14, IConfigurationService)), ( __param(15, IChatContextService)), ( __param(16, IBrowserViewWorkbenchService))], ImplicitContextAttachmentWidget));
|
|
306
329
|
|
|
307
330
|
export { ImplicitContextAttachmentWidget };
|
|
@@ -82,7 +82,7 @@ registerAction2(class OpenFileInDiffAction extends WorkingSetAction {
|
|
|
82
82
|
constructor() {
|
|
83
83
|
super({
|
|
84
84
|
id: "chatEditing.openFileInDiff",
|
|
85
|
-
title: ( localize2(
|
|
85
|
+
title: ( localize2(6304, "Open Changes in Diff Editor")),
|
|
86
86
|
icon: Codicon.diffSingle,
|
|
87
87
|
menu: [{
|
|
88
88
|
id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
|
|
@@ -113,7 +113,7 @@ registerAction2(class AcceptAction extends WorkingSetAction {
|
|
|
113
113
|
constructor() {
|
|
114
114
|
super({
|
|
115
115
|
id: "chatEditing.acceptFile",
|
|
116
|
-
title: ( localize2(
|
|
116
|
+
title: ( localize2(6305, "Keep")),
|
|
117
117
|
icon: Codicon.check,
|
|
118
118
|
menu: [{
|
|
119
119
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("resourceScheme", CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(
|
|
@@ -139,7 +139,7 @@ registerAction2(class DiscardAction extends WorkingSetAction {
|
|
|
139
139
|
constructor() {
|
|
140
140
|
super({
|
|
141
141
|
id: "chatEditing.discardFile",
|
|
142
|
-
title: ( localize2(
|
|
142
|
+
title: ( localize2(6306, "Undo")),
|
|
143
143
|
icon: Codicon.discard,
|
|
144
144
|
menu: [{
|
|
145
145
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("resourceScheme", CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(
|
|
@@ -165,9 +165,9 @@ class ChatEditingAcceptAllAction extends EditingSessionAction {
|
|
|
165
165
|
constructor() {
|
|
166
166
|
super({
|
|
167
167
|
id: "chatEditing.acceptAllFiles",
|
|
168
|
-
title: ( localize(
|
|
168
|
+
title: ( localize(6307, "Keep")),
|
|
169
169
|
icon: Codicon.check,
|
|
170
|
-
tooltip: ( localize(
|
|
170
|
+
tooltip: ( localize(6308, "Keep All Edits")),
|
|
171
171
|
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
172
172
|
keybinding: {
|
|
173
173
|
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
@@ -191,9 +191,9 @@ class ChatEditingDiscardAllAction extends EditingSessionAction {
|
|
|
191
191
|
constructor() {
|
|
192
192
|
super({
|
|
193
193
|
id: "chatEditing.discardAllFiles",
|
|
194
|
-
title: ( localize(
|
|
194
|
+
title: ( localize(6309, "Undo")),
|
|
195
195
|
icon: Codicon.discard,
|
|
196
|
-
tooltip: ( localize(
|
|
196
|
+
tooltip: ( localize(6310, "Undo All Edits")),
|
|
197
197
|
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
198
198
|
menu: [{
|
|
199
199
|
id: MenuId.ChatEditingWidgetToolbar,
|
|
@@ -224,8 +224,8 @@ class ToggleExplanationWidgetAction extends EditingSessionAction {
|
|
|
224
224
|
constructor() {
|
|
225
225
|
super({
|
|
226
226
|
id: ToggleExplanationWidgetAction.ID,
|
|
227
|
-
title: ( localize(
|
|
228
|
-
tooltip: ( localize(
|
|
227
|
+
title: ( localize(6311, "Explain")),
|
|
228
|
+
tooltip: ( localize(6312, "Toggle Change Explanations")),
|
|
229
229
|
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
230
230
|
menu: [{
|
|
231
231
|
id: MenuId.ChatEditingWidgetToolbar,
|
|
@@ -249,17 +249,17 @@ async function discardAllEditsWithConfirmation(accessor, currentEditingSession)
|
|
|
249
249
|
const entries = currentEditingSession.entries.get().filter(e => e.state.get() === ModifiedFileEntryState.Modified);
|
|
250
250
|
if (entries.length > 0) {
|
|
251
251
|
const confirmation = await dialogService.confirm({
|
|
252
|
-
title: ( localize(
|
|
252
|
+
title: ( localize(6313, "Undo all edits?")),
|
|
253
253
|
message: entries.length === 1 ? ( localize(
|
|
254
|
-
|
|
254
|
+
6314,
|
|
255
255
|
"This will undo changes made in {0}. Do you want to proceed?",
|
|
256
256
|
basename(entries[0].modifiedURI)
|
|
257
257
|
)) : ( localize(
|
|
258
|
-
|
|
258
|
+
6315,
|
|
259
259
|
"This will undo changes made in {0} files. Do you want to proceed?",
|
|
260
260
|
entries.length
|
|
261
261
|
)),
|
|
262
|
-
primaryButton: ( localize(
|
|
262
|
+
primaryButton: ( localize(6316, "Yes")),
|
|
263
263
|
type: "info"
|
|
264
264
|
});
|
|
265
265
|
if (!confirmation.confirmed) {
|
|
@@ -274,7 +274,7 @@ class ChatEditingShowChangesAction extends EditingSessionAction {
|
|
|
274
274
|
this.ID = "chatEditing.viewChanges";
|
|
275
275
|
}
|
|
276
276
|
static {
|
|
277
|
-
this.LABEL = ( localize(
|
|
277
|
+
this.LABEL = ( localize(6317, "View All Edits"));
|
|
278
278
|
}
|
|
279
279
|
constructor() {
|
|
280
280
|
super({
|
|
@@ -336,13 +336,13 @@ async function restoreSnapshotWithConfirmationByRequestId(accessor, sessionResou
|
|
|
336
336
|
if (editsToUndo === 1) {
|
|
337
337
|
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
338
338
|
message = ( localize(
|
|
339
|
-
|
|
339
|
+
6318,
|
|
340
340
|
"This will remove your last request and undo the edits made to {0}. Do you want to proceed?",
|
|
341
341
|
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
342
342
|
));
|
|
343
343
|
} else {
|
|
344
344
|
message = ( localize(
|
|
345
|
-
|
|
345
|
+
6319,
|
|
346
346
|
"This will remove your last request and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
347
347
|
entriesModifiedInRequestsToRemove.length
|
|
348
348
|
));
|
|
@@ -350,24 +350,24 @@ async function restoreSnapshotWithConfirmationByRequestId(accessor, sessionResou
|
|
|
350
350
|
} else {
|
|
351
351
|
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
352
352
|
message = ( localize(
|
|
353
|
-
|
|
353
|
+
6320,
|
|
354
354
|
"This will remove all subsequent requests and undo edits made to {0}. Do you want to proceed?",
|
|
355
355
|
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
356
356
|
));
|
|
357
357
|
} else {
|
|
358
358
|
message = ( localize(
|
|
359
|
-
|
|
359
|
+
6321,
|
|
360
360
|
"This will remove all subsequent requests and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
361
361
|
entriesModifiedInRequestsToRemove.length
|
|
362
362
|
));
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
const confirmation = shouldPrompt ? await dialogService.confirm({
|
|
366
|
-
title: editsToUndo === 1 ? ( localize(
|
|
366
|
+
title: editsToUndo === 1 ? ( localize(6322, "Do you want to undo your last edit?")) : ( localize(6323, "Do you want to undo {0} edits?", editsToUndo)),
|
|
367
367
|
message: message,
|
|
368
|
-
primaryButton: ( localize(
|
|
368
|
+
primaryButton: ( localize(6324, "Yes")),
|
|
369
369
|
checkbox: {
|
|
370
|
-
label: ( localize(
|
|
370
|
+
label: ( localize(6325, "Don't ask again")),
|
|
371
371
|
checked: false
|
|
372
372
|
},
|
|
373
373
|
type: "info"
|
|
@@ -397,7 +397,7 @@ registerAction2(class RemoveAction extends Action2 {
|
|
|
397
397
|
constructor() {
|
|
398
398
|
super({
|
|
399
399
|
id: "workbench.action.chat.undoEdits",
|
|
400
|
-
title: ( localize2(
|
|
400
|
+
title: ( localize2(6326, "Undo Requests")),
|
|
401
401
|
f1: false,
|
|
402
402
|
category: CHAT_CATEGORY,
|
|
403
403
|
icon: Codicon.discard,
|
|
@@ -443,8 +443,8 @@ registerAction2(class RestoreCheckpointAction extends Action2 {
|
|
|
443
443
|
constructor() {
|
|
444
444
|
super({
|
|
445
445
|
id: "workbench.action.chat.restoreCheckpoint",
|
|
446
|
-
title: ( localize2(
|
|
447
|
-
tooltip: ( localize2(
|
|
446
|
+
title: ( localize2(6327, "Restore Checkpoint")),
|
|
447
|
+
tooltip: ( localize2(6328, "Restores workspace and chat to this point")),
|
|
448
448
|
f1: false,
|
|
449
449
|
category: CHAT_CATEGORY,
|
|
450
450
|
keybinding: {
|
|
@@ -489,8 +489,8 @@ registerAction2(class StartOverAction extends Action2 {
|
|
|
489
489
|
constructor() {
|
|
490
490
|
super({
|
|
491
491
|
id: "workbench.action.chat.startOver",
|
|
492
|
-
title: ( localize2(
|
|
493
|
-
tooltip: ( localize2(
|
|
492
|
+
title: ( localize2(6329, "Start Over")),
|
|
493
|
+
tooltip: ( localize2(6330, "Clears the chat and undoes all changes")),
|
|
494
494
|
f1: false,
|
|
495
495
|
category: CHAT_CATEGORY,
|
|
496
496
|
menu: [{
|
|
@@ -519,7 +519,7 @@ registerAction2(class RestoreLastCheckpoint extends Action2 {
|
|
|
519
519
|
constructor() {
|
|
520
520
|
super({
|
|
521
521
|
id: "workbench.action.chat.restoreLastCheckpoint",
|
|
522
|
-
title: ( localize2(
|
|
522
|
+
title: ( localize2(6331, "Restore to Last Checkpoint")),
|
|
523
523
|
f1: true,
|
|
524
524
|
category: CHAT_CATEGORY,
|
|
525
525
|
icon: Codicon.discard,
|
|
@@ -544,7 +544,7 @@ registerAction2(class RestoreLastCheckpoint extends Action2 {
|
|
|
544
544
|
}
|
|
545
545
|
const checkpointRequest = chatModel.checkpoint;
|
|
546
546
|
if (!checkpointRequest) {
|
|
547
|
-
alert(( localize(
|
|
547
|
+
alert(( localize(6332, "There is no checkpoint to restore.")));
|
|
548
548
|
return;
|
|
549
549
|
}
|
|
550
550
|
widget?.viewModel?.model.setCheckpoint(checkpointRequest.id);
|
|
@@ -557,7 +557,7 @@ registerAction2(class EditAction extends Action2 {
|
|
|
557
557
|
constructor() {
|
|
558
558
|
super({
|
|
559
559
|
id: "workbench.action.chat.editRequests",
|
|
560
|
-
title: ( localize2(
|
|
560
|
+
title: ( localize2(6333, "Edit Request")),
|
|
561
561
|
f1: false,
|
|
562
562
|
category: CHAT_CATEGORY,
|
|
563
563
|
icon: Codicon.edit,
|
|
@@ -596,7 +596,7 @@ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
|
596
596
|
constructor() {
|
|
597
597
|
super({
|
|
598
598
|
id: OpenWorkingSetHistoryAction.id,
|
|
599
|
-
title: ( localize(
|
|
599
|
+
title: ( localize(6334, "Open File")),
|
|
600
600
|
menu: [{
|
|
601
601
|
id: MenuId.ChatEditingCodeBlockContext,
|
|
602
602
|
group: "navigation",
|
|
@@ -622,7 +622,7 @@ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
|
622
622
|
constructor() {
|
|
623
623
|
super({
|
|
624
624
|
id: OpenWorkingSetHistoryAction.id,
|
|
625
|
-
title: ( localize(
|
|
625
|
+
title: ( localize(6335, "Open File Snapshot")),
|
|
626
626
|
menu: [{
|
|
627
627
|
id: MenuId.ChatEditingCodeBlockContext,
|
|
628
628
|
group: "navigation",
|
|
@@ -646,7 +646,7 @@ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
|
646
646
|
if (snapshot) {
|
|
647
647
|
const editor = await editorService.openEditor({
|
|
648
648
|
resource: snapshot,
|
|
649
|
-
label: ( localize(
|
|
649
|
+
label: ( localize(6336, "{0} (Snapshot)", basename(context.uri))),
|
|
650
650
|
options: {
|
|
651
651
|
activation: EditorActivation.ACTIVATE
|
|
652
652
|
}
|
|
@@ -663,7 +663,7 @@ registerAction2(class ResolveSymbolsContextAction extends EditingSessionAction {
|
|
|
663
663
|
constructor() {
|
|
664
664
|
super({
|
|
665
665
|
id: "workbench.action.edits.addFilesFromReferences",
|
|
666
|
-
title: ( localize2(
|
|
666
|
+
title: ( localize2(6337, "Add Files From References")),
|
|
667
667
|
f1: false,
|
|
668
668
|
category: CHAT_CATEGORY,
|
|
669
669
|
menu: {
|
|
@@ -731,7 +731,7 @@ class ViewPreviousEditsAction extends EditingSessionAction {
|
|
|
731
731
|
this.Id = "chatEditing.viewPreviousEdits";
|
|
732
732
|
}
|
|
733
733
|
static {
|
|
734
|
-
this.Label = ( localize(
|
|
734
|
+
this.Label = ( localize(6338, "View Previous Edits"));
|
|
735
735
|
}
|
|
736
736
|
constructor() {
|
|
737
737
|
super({
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js
CHANGED
|
@@ -151,7 +151,7 @@ let ChatSessionPickerActionItem = class ChatSessionPickerActionItem extends Acti
|
|
|
151
151
|
domChildren.push($(
|
|
152
152
|
"span.chat-session-option-label",
|
|
153
153
|
undefined,
|
|
154
|
-
this.currentOption?.name ?? group?.description ?? ( localize(
|
|
154
|
+
this.currentOption?.name ?? group?.description ?? ( localize(6499, "Pick Option"))
|
|
155
155
|
));
|
|
156
156
|
}
|
|
157
157
|
domChildren.push(...renderLabelWithIcons(`$(chevron-down)`));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
+
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
4
|
+
import { IToolData } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
5
|
+
import { IChatToolRiskAssessmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service";
|
|
6
|
+
export declare enum ToolRiskLevel {
|
|
7
|
+
Green = "green",
|
|
8
|
+
Orange = "orange",
|
|
9
|
+
Red = "red"
|
|
10
|
+
}
|
|
11
|
+
export interface IToolRiskAssessment {
|
|
12
|
+
readonly risk: ToolRiskLevel;
|
|
13
|
+
/** One-sentence natural-language explanation, <= 140 chars. */
|
|
14
|
+
readonly explanation: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class ChatToolRiskAssessmentService implements IChatToolRiskAssessmentService {
|
|
17
|
+
private readonly _configurationService;
|
|
18
|
+
private readonly _languageModelsService;
|
|
19
|
+
readonly _serviceBrand: undefined;
|
|
20
|
+
private readonly _cache;
|
|
21
|
+
private readonly _inFlight;
|
|
22
|
+
constructor(_configurationService: IConfigurationService, _languageModelsService: ILanguageModelsService);
|
|
23
|
+
isEnabled(): boolean;
|
|
24
|
+
getCached(tool: IToolData, parameters: unknown): IToolRiskAssessment | undefined;
|
|
25
|
+
assess(tool: IToolData, parameters: unknown, token: CancellationToken): Promise<IToolRiskAssessment | undefined>;
|
|
26
|
+
private _cacheKey;
|
|
27
|
+
private _invokeModel;
|
|
28
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { LRUCache } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
4
|
+
import { stableStringify } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
5
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
8
|
+
import { ChatMessageRole } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
9
|
+
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
10
|
+
import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
|
|
11
|
+
|
|
12
|
+
var ToolRiskLevel;
|
|
13
|
+
(function(ToolRiskLevel) {
|
|
14
|
+
ToolRiskLevel["Green"] = "green";
|
|
15
|
+
ToolRiskLevel["Orange"] = "orange";
|
|
16
|
+
ToolRiskLevel["Red"] = "red";
|
|
17
|
+
})(ToolRiskLevel || (ToolRiskLevel = {}));
|
|
18
|
+
const MAX_PARAM_BYTES = 2000;
|
|
19
|
+
const CACHE_SIZE = 200;
|
|
20
|
+
let ChatToolRiskAssessmentService = class ChatToolRiskAssessmentService {
|
|
21
|
+
constructor(_configurationService, _languageModelsService) {
|
|
22
|
+
this._configurationService = _configurationService;
|
|
23
|
+
this._languageModelsService = _languageModelsService;
|
|
24
|
+
this._cache = ( new LRUCache(CACHE_SIZE));
|
|
25
|
+
this._inFlight = ( new Map());
|
|
26
|
+
}
|
|
27
|
+
isEnabled() {
|
|
28
|
+
return this._configurationService.getValue(ChatConfiguration.ToolRiskAssessmentEnabled) !== false;
|
|
29
|
+
}
|
|
30
|
+
getCached(tool, parameters) {
|
|
31
|
+
return this._cache.get(this._cacheKey(tool, parameters))?.assessment;
|
|
32
|
+
}
|
|
33
|
+
async assess(tool, parameters, token) {
|
|
34
|
+
if (!this.isEnabled()) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const key = this._cacheKey(tool, parameters);
|
|
38
|
+
const cached = this._cache.get(key);
|
|
39
|
+
if (cached) {
|
|
40
|
+
return cached.assessment;
|
|
41
|
+
}
|
|
42
|
+
const inflight = this._inFlight.get(key);
|
|
43
|
+
if (inflight) {
|
|
44
|
+
return inflight;
|
|
45
|
+
}
|
|
46
|
+
const promise = (async () => {
|
|
47
|
+
try {
|
|
48
|
+
const assessment = await this._invokeModel(tool, parameters, token);
|
|
49
|
+
if (token.isCancellationRequested) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
this._cache.set(key, {
|
|
53
|
+
assessment
|
|
54
|
+
});
|
|
55
|
+
return assessment;
|
|
56
|
+
} catch {
|
|
57
|
+
return undefined;
|
|
58
|
+
} finally {
|
|
59
|
+
this._inFlight.delete(key);
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
this._inFlight.set(key, promise);
|
|
63
|
+
return promise;
|
|
64
|
+
}
|
|
65
|
+
_cacheKey(tool, parameters) {
|
|
66
|
+
return tool.id + "::" + stableStringify(normalizeRiskCacheParameters(tool, parameters));
|
|
67
|
+
}
|
|
68
|
+
async _invokeModel(tool, parameters, token) {
|
|
69
|
+
const modelId = this._configurationService.getValue(ChatConfiguration.ToolRiskAssessmentModel) || "copilot-fast";
|
|
70
|
+
const models = await this._languageModelsService.selectLanguageModels({
|
|
71
|
+
vendor: "copilot",
|
|
72
|
+
id: modelId
|
|
73
|
+
});
|
|
74
|
+
if (!models.length || token.isCancellationRequested) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
const prompt = buildPrompt(tool, parameters);
|
|
78
|
+
const response = await this._languageModelsService.sendChatRequest(models[0], undefined, [{
|
|
79
|
+
role: ChatMessageRole.User,
|
|
80
|
+
content: [{
|
|
81
|
+
type: "text",
|
|
82
|
+
value: prompt
|
|
83
|
+
}]
|
|
84
|
+
}], {}, token);
|
|
85
|
+
let text = "";
|
|
86
|
+
for await (const part of response.stream) {
|
|
87
|
+
if (token.isCancellationRequested) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
if (Array.isArray(part)) {
|
|
91
|
+
for (const p of part) {
|
|
92
|
+
if (p.type === "text") {
|
|
93
|
+
text += p.value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
} else if (part.type === "text") {
|
|
97
|
+
text += part.value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
await response.result;
|
|
101
|
+
if (token.isCancellationRequested) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
return parseAssessment(text, tool);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
ChatToolRiskAssessmentService = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, ILanguageModelsService))], ChatToolRiskAssessmentService));
|
|
108
|
+
function normalizeRiskCacheParameters(tool, parameters) {
|
|
109
|
+
if (tool.id === TerminalToolId.RunInTerminal && parameters && typeof parameters === "object") {
|
|
110
|
+
const p = parameters;
|
|
111
|
+
return {
|
|
112
|
+
command: p.command
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return parameters;
|
|
116
|
+
}
|
|
117
|
+
function buildPrompt(tool, parameters) {
|
|
118
|
+
let argsJson;
|
|
119
|
+
try {
|
|
120
|
+
argsJson = JSON.stringify(parameters ?? {});
|
|
121
|
+
} catch {
|
|
122
|
+
argsJson = "{}";
|
|
123
|
+
}
|
|
124
|
+
if (argsJson.length > MAX_PARAM_BYTES) {
|
|
125
|
+
argsJson = argsJson.slice(0, MAX_PARAM_BYTES) + "...[truncated]";
|
|
126
|
+
}
|
|
127
|
+
return [
|
|
128
|
+
`You assess what one terminal command does for a code-editing AI agent, and how risky it is.`,
|
|
129
|
+
`Reply with STRICT JSON only (no prose, no markdown fences):`,
|
|
130
|
+
`{`,
|
|
131
|
+
` "risk": "green" | "orange" | "red",`,
|
|
132
|
+
` "explanation": "<one short sentence, <=18 words>"`,
|
|
133
|
+
`}`,
|
|
134
|
+
``,
|
|
135
|
+
`Rules for "risk" — apply in order; take the FIRST match:`,
|
|
136
|
+
` 1. irreversible deletion of source code or user data (rm -rf on $HOME / source paths,`,
|
|
137
|
+
` find ... -delete on source globs), force-push, drop, format, npm publish -> red`,
|
|
138
|
+
` 2. arbitrary code execution from a remote source (curl ... | bash) -> red`,
|
|
139
|
+
` 3. modifies remote state (git push, deploy, post) -> orange`,
|
|
140
|
+
` 4. modifies local files or installs packages, including recoverable deletions`,
|
|
141
|
+
` such as rm -rf of build output, caches, or node_modules -> orange`,
|
|
142
|
+
` 5. otherwise (read-only, listing, status, diagnostics, GET requests) -> green`,
|
|
143
|
+
``,
|
|
144
|
+
`Read-only commands are always GREEN. "rm -rf" is RED only when the target is`,
|
|
145
|
+
`source code or user data; deleting recoverable build artifacts (node_modules,`,
|
|
146
|
+
`dist, .cache) is ORANGE.`,
|
|
147
|
+
``,
|
|
148
|
+
`Examples:`,
|
|
149
|
+
` ls -lh -> green`,
|
|
150
|
+
` cat README.md -> green`,
|
|
151
|
+
` git status -> green`,
|
|
152
|
+
` git log --oneline -20 -> green`,
|
|
153
|
+
` npm ls -> green`,
|
|
154
|
+
` az vm list -> green`,
|
|
155
|
+
` kubectl get pods --all-namespaces -> green`,
|
|
156
|
+
` npm install lodash -> orange`,
|
|
157
|
+
` rm -rf node_modules -> orange (recoverable: reinstall)`,
|
|
158
|
+
` rm -rf dist -> orange (recoverable: rebuild)`,
|
|
159
|
+
` git push origin feature -> orange`,
|
|
160
|
+
` rm -rf $HOME -> red`,
|
|
161
|
+
` rm -rf src -> red (irreplaceable source code)`,
|
|
162
|
+
` find . -name '*.test.ts' -delete -> red`,
|
|
163
|
+
` git push --force origin main -> red`,
|
|
164
|
+
` npm publish -> red`,
|
|
165
|
+
` curl -fsSL https://x.sh | bash -> red`,
|
|
166
|
+
``,
|
|
167
|
+
`Write "explanation" in this exact shape:`,
|
|
168
|
+
` - green : "<verb> <target>." e.g. "Lists running VMs in the current Azure subscription."`,
|
|
169
|
+
` - orange: "<verb> <target> — <consequence>." e.g. "Installs lodash into node_modules."`,
|
|
170
|
+
` - red : "<verb> <target> — <irreversible consequence>." e.g. "Force-pushes main — overwrites public history."`,
|
|
171
|
+
``,
|
|
172
|
+
`Strict explanation rules:`,
|
|
173
|
+
` - Cite the ACTUAL paths, commands, URLs, branches, globs from the arguments below.`,
|
|
174
|
+
` - Decode cryptic flags (e.g. -f, -rf, --no-verify).`,
|
|
175
|
+
` - Never use generic phrases like "may have side effects". Always name WHAT is read or changed.`,
|
|
176
|
+
` - Plain prose. No quotes around the sentence. No markdown fences.`,
|
|
177
|
+
``,
|
|
178
|
+
`Tool: ${tool.displayName} (id: ${tool.id})`,
|
|
179
|
+
`Description: ${tool.modelDescription || tool.userDescription || ""}`,
|
|
180
|
+
`Arguments (JSON): ${argsJson}`
|
|
181
|
+
].join("\n");
|
|
182
|
+
}
|
|
183
|
+
function parseAssessment(rawText, tool) {
|
|
184
|
+
let text = rawText.trim();
|
|
185
|
+
if (text.startsWith("```")) {
|
|
186
|
+
text = text.replace(/^```(?:json)?\n?/, "").replace(/\n?```$/, "");
|
|
187
|
+
}
|
|
188
|
+
const firstBrace = text.indexOf("{");
|
|
189
|
+
const lastBrace = text.lastIndexOf("}");
|
|
190
|
+
if (firstBrace > 0 && lastBrace > firstBrace) {
|
|
191
|
+
text = text.slice(firstBrace, lastBrace + 1);
|
|
192
|
+
}
|
|
193
|
+
let parsed;
|
|
194
|
+
try {
|
|
195
|
+
parsed = JSON.parse(text);
|
|
196
|
+
} catch {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
if (!parsed || typeof parsed !== "object") {
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
202
|
+
const obj = parsed;
|
|
203
|
+
const risk = normalizeRisk(obj.risk);
|
|
204
|
+
if (!risk) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
const explanation = typeof obj.explanation === "string" ? truncate(obj.explanation, 140) : defaultExplanationFor(risk, tool);
|
|
208
|
+
return {
|
|
209
|
+
risk,
|
|
210
|
+
explanation
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function normalizeRisk(value) {
|
|
214
|
+
if (typeof value !== "string") {
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
const v = value.toLowerCase();
|
|
218
|
+
if (v === "green") {
|
|
219
|
+
return ToolRiskLevel.Green;
|
|
220
|
+
}
|
|
221
|
+
if (v === "orange" || v === "yellow") {
|
|
222
|
+
return ToolRiskLevel.Orange;
|
|
223
|
+
}
|
|
224
|
+
if (v === "red") {
|
|
225
|
+
return ToolRiskLevel.Red;
|
|
226
|
+
}
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
function truncate(s, max) {
|
|
230
|
+
if (s.length <= max) {
|
|
231
|
+
return s;
|
|
232
|
+
}
|
|
233
|
+
return s.slice(0, max - 1) + "…";
|
|
234
|
+
}
|
|
235
|
+
function defaultExplanationFor(risk, tool) {
|
|
236
|
+
switch (risk) {
|
|
237
|
+
case ToolRiskLevel.Green:
|
|
238
|
+
return localize(6955, "{0} appears to have no observable side effects.", tool.displayName);
|
|
239
|
+
case ToolRiskLevel.Orange:
|
|
240
|
+
return localize(
|
|
241
|
+
6956,
|
|
242
|
+
"{0} may modify your workspace or send data over the network.",
|
|
243
|
+
tool.displayName
|
|
244
|
+
);
|
|
245
|
+
case ToolRiskLevel.Red:
|
|
246
|
+
return localize(6957, "{0} performs an action that is hard to undo.", tool.displayName);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export { ChatToolRiskAssessmentService, ToolRiskLevel };
|