@codingame/monaco-vscode-chat-service-override 19.1.4 → 20.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/index.js +20 -8
- package/package.json +36 -31
- package/vscode/src/vs/base/common/policy.d.ts +14 -0
- package/vscode/src/vs/base/common/policy.js +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +53 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +54 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +37 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +23 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +83 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +421 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +215 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +18 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +11 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +16 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +7 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +58 -326
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +33 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +39 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +380 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +44 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +145 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +36 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +407 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.js +738 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +142 -151
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +54 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +23 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +13 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/media/apple-dark.svg +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/apple-light.svg +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.js +52 -90
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +137 -30
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +44 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/configMigration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/filePromptContentsProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/promptContentsProviderBase.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/promptContentsProviderBase.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderDiagnosticsProvider.js +3 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderHovers.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkDiagnosticsProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptPathAutocompletion.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/providerInstanceManagerBase.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/headerBase.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/instructionsHeader.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/applyTo.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/enum.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/string.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/tools.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/modeHeader.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/promptHeader.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/promptHeader.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/topError.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +9 -9
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +104 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +667 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +14 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css +56 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +111 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +262 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +129 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.js +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +30 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +72 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +411 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +59 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/bufferOutputPolling.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/bufferOutputPolling.js +163 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +164 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +101 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +71 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +94 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/getTerminalOutputTool.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/getTerminalOutputTool.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +13 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.js +603 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +113 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/createAndRunTaskTool.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/createAndRunTaskTool.js +227 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/getTaskOutputTool.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/getTaskOutputTool.js +88 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/runTaskTool.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/runTaskTool.js +140 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.js +80 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task.chatAgentTools.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task.chatAgentTools.contribution.js +40 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/google-mono-dark.svg +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/media/google-mono-light.svg +0 -3
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
|
-
import {
|
|
4
|
+
import { hashAsync } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
5
5
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
6
6
|
import { joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
7
7
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -51,11 +51,11 @@ let ChatEditingSessionStorage = class ChatEditingSessionStorage {
|
|
|
51
51
|
if ('stops' in snapshot) {
|
|
52
52
|
return snapshot;
|
|
53
53
|
}
|
|
54
|
-
return { requestId: snapshot.requestId, stops: [{ stopId: undefined, entries: snapshot.entries }]
|
|
54
|
+
return { requestId: snapshot.requestId, stops: [{ stopId: undefined, entries: snapshot.entries }] };
|
|
55
55
|
};
|
|
56
56
|
const deserializeChatEditingSessionSnapshot = async (startIndex, snapshot) => {
|
|
57
57
|
const stops = await Promise.all(( snapshot.stops.map(deserializeChatEditingStopDTO)));
|
|
58
|
-
return { startIndex, requestId: snapshot.requestId, stops
|
|
58
|
+
return { startIndex, requestId: snapshot.requestId, stops };
|
|
59
59
|
};
|
|
60
60
|
const deserializeSnapshotEntry = async (entry) => {
|
|
61
61
|
return {
|
|
@@ -127,36 +127,44 @@ let ChatEditingSessionStorage = class ChatEditingSessionStorage {
|
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
const contentWritePromises = ( new Map());
|
|
131
|
+
const writeContent = async (content) => {
|
|
132
|
+
const buffer = VSBuffer.fromString(content);
|
|
133
|
+
const hash = (await hashAsync(buffer)).substring(0, 7);
|
|
134
|
+
if (!( existingContents.has(hash))) {
|
|
135
|
+
await this._fileService.writeFile(joinPath(contentsFolder, hash), buffer);
|
|
136
|
+
}
|
|
137
|
+
return hash;
|
|
138
|
+
};
|
|
139
|
+
const addFileContent = async (content) => {
|
|
140
|
+
let storedContentHash = contentWritePromises.get(content);
|
|
141
|
+
if (!storedContentHash) {
|
|
142
|
+
storedContentHash = writeContent(content);
|
|
143
|
+
contentWritePromises.set(content, storedContentHash);
|
|
144
|
+
}
|
|
145
|
+
return storedContentHash;
|
|
137
146
|
};
|
|
138
|
-
const serializeResourceMap = (resourceMap, serialize) => {
|
|
139
|
-
return ( Array.from(resourceMap.entries()).map(([resourceURI, value]) => [( resourceURI.toString()), serialize(value)]));
|
|
147
|
+
const serializeResourceMap = async (resourceMap, serialize) => {
|
|
148
|
+
return await Promise.all(( Array.from(resourceMap.entries()).map(async ([resourceURI, value]) => [( resourceURI.toString()), await serialize(value)])));
|
|
140
149
|
};
|
|
141
|
-
const serializeChatEditingSessionStop = (stop) => {
|
|
150
|
+
const serializeChatEditingSessionStop = async (stop) => {
|
|
142
151
|
return {
|
|
143
152
|
stopId: stop.stopId,
|
|
144
|
-
entries: ( Array.from(( stop.entries.values())).map(serializeSnapshotEntry))
|
|
153
|
+
entries: await Promise.all(( Array.from(( stop.entries.values())).map(serializeSnapshotEntry)))
|
|
145
154
|
};
|
|
146
155
|
};
|
|
147
|
-
const serializeChatEditingSessionSnapshot = (snapshot) => {
|
|
156
|
+
const serializeChatEditingSessionSnapshot = async (snapshot) => {
|
|
148
157
|
return {
|
|
149
158
|
requestId: snapshot.requestId,
|
|
150
|
-
stops: ( snapshot.stops.map(serializeChatEditingSessionStop)),
|
|
151
|
-
postEdit: snapshot.postEdit ? ( Array.from(( snapshot.postEdit.values())).map(serializeSnapshotEntry)) : undefined
|
|
159
|
+
stops: await Promise.all(( snapshot.stops.map(serializeChatEditingSessionStop))),
|
|
152
160
|
};
|
|
153
161
|
};
|
|
154
|
-
const serializeSnapshotEntry = (entry) => {
|
|
162
|
+
const serializeSnapshotEntry = async (entry) => {
|
|
155
163
|
return {
|
|
156
164
|
resource: ( entry.resource.toString()),
|
|
157
165
|
languageId: entry.languageId,
|
|
158
|
-
originalHash: addFileContent(entry.original),
|
|
159
|
-
currentHash: addFileContent(entry.current),
|
|
166
|
+
originalHash: await addFileContent(entry.original),
|
|
167
|
+
currentHash: await addFileContent(entry.current),
|
|
160
168
|
state: entry.state,
|
|
161
169
|
snapshotUri: ( entry.snapshotUri.toString()),
|
|
162
170
|
telemetryInfo: { requestId: entry.telemetryInfo.requestId, agentId: entry.telemetryInfo.agentId, command: entry.telemetryInfo.command }
|
|
@@ -166,18 +174,13 @@ let ChatEditingSessionStorage = class ChatEditingSessionStorage {
|
|
|
166
174
|
const data = {
|
|
167
175
|
version: STORAGE_VERSION,
|
|
168
176
|
sessionId: this.chatSessionId,
|
|
169
|
-
linearHistory: ( state.linearHistory.map(serializeChatEditingSessionSnapshot)),
|
|
177
|
+
linearHistory: await Promise.all(( state.linearHistory.map(serializeChatEditingSessionSnapshot))),
|
|
170
178
|
linearHistoryIndex: state.linearHistoryIndex,
|
|
171
|
-
initialFileContents: serializeResourceMap(state.initialFileContents, value => addFileContent(value)),
|
|
172
|
-
pendingSnapshot: state.pendingSnapshot ? serializeChatEditingSessionStop(state.pendingSnapshot) : undefined,
|
|
173
|
-
recentSnapshot: serializeChatEditingSessionStop(state.recentSnapshot),
|
|
179
|
+
initialFileContents: await serializeResourceMap(state.initialFileContents, value => addFileContent(value)),
|
|
180
|
+
pendingSnapshot: state.pendingSnapshot ? await serializeChatEditingSessionStop(state.pendingSnapshot) : undefined,
|
|
181
|
+
recentSnapshot: await serializeChatEditingSessionStop(state.recentSnapshot),
|
|
174
182
|
};
|
|
175
|
-
this._logService.debug(`chatEditingSession: Storing editing session at ${( storageFolder.toString())}: ${
|
|
176
|
-
for (const [hash, content] of fileContents) {
|
|
177
|
-
if (!( existingContents.has(hash))) {
|
|
178
|
-
await this._fileService.writeFile(joinPath(contentsFolder, hash), VSBuffer.fromString(content));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
183
|
+
this._logService.debug(`chatEditingSession: Storing editing session at ${( storageFolder.toString())}: ${contentWritePromises.size} files`);
|
|
181
184
|
await this._fileService.writeFile(joinPath(storageFolder, STORAGE_STATE_FILE), VSBuffer.fromString(JSON.stringify(data)));
|
|
182
185
|
}
|
|
183
186
|
catch (e) {
|
|
@@ -8,7 +8,12 @@ import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/edi
|
|
|
8
8
|
import { IAccessibilitySignalService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service";
|
|
9
9
|
import { ICellEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
10
10
|
import { ModifiedFileEntryState } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
11
|
-
import { IChatResponseModel } from "@codingame/monaco-vscode-
|
|
11
|
+
import { IChatResponseModel } from "@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
12
|
+
type acceptedOrRejectedLines = {
|
|
13
|
+
state: "accepted" | "rejected";
|
|
14
|
+
lineCount: number;
|
|
15
|
+
hasRemainingEdits: boolean;
|
|
16
|
+
};
|
|
12
17
|
export declare class ChatEditingTextModelChangeService extends Disposable {
|
|
13
18
|
private readonly originalModel;
|
|
14
19
|
private readonly modifiedModel;
|
|
@@ -39,10 +44,15 @@ export declare class ChatEditingTextModelChangeService extends Disposable {
|
|
|
39
44
|
private _editDecorations;
|
|
40
45
|
private readonly _didAcceptOrRejectAllHunks;
|
|
41
46
|
readonly onDidAcceptOrRejectAllHunks: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<ModifiedFileEntryState.Accepted | ModifiedFileEntryState.Rejected>;
|
|
47
|
+
private readonly _didAcceptOrRejectLines;
|
|
48
|
+
readonly onDidAcceptOrRejectLines: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<acceptedOrRejectedLines>;
|
|
49
|
+
private notifyHunkAction;
|
|
42
50
|
private readonly _didUserEditModel;
|
|
43
51
|
readonly onDidUserEditModel: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
44
52
|
private _originalToModifiedEdit;
|
|
53
|
+
private lineChangeCount;
|
|
45
54
|
constructor(originalModel: ITextModel, modifiedModel: ITextModel, state: IObservable<ModifiedFileEntryState>, _editorWorkerService: IEditorWorkerService, _accessibilitySignalService: IAccessibilitySignalService);
|
|
55
|
+
private updateLineChangeCount;
|
|
46
56
|
clearCurrentEditLineDecoration(): void;
|
|
47
57
|
areOriginalAndModifiedIdentical(): Promise<boolean>;
|
|
48
58
|
acceptAgentEdits(resource: URI, textEdits: (TextEdit | ICellEditOperation)[], isLastEdits: boolean, responseModel: IChatResponseModel): Promise<{
|
|
@@ -59,3 +69,4 @@ export declare class ChatEditingTextModelChangeService extends Disposable {
|
|
|
59
69
|
private _updateDiffInfoSeq;
|
|
60
70
|
private _updateDiffInfo;
|
|
61
71
|
}
|
|
72
|
+
export {};
|
|
@@ -18,7 +18,7 @@ import { OverviewRulerLane, MinimapPosition } from '@codingame/monaco-vscode-api
|
|
|
18
18
|
import { ModelDecorationOptions } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
|
|
19
19
|
import { offsetEditFromContentChanges, offsetEditToEditOperations, offsetEditFromLineRangeMapping } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModelStringEdit';
|
|
20
20
|
import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service';
|
|
21
|
-
import {
|
|
21
|
+
import { EditSources } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/textModelEditSource';
|
|
22
22
|
import { AccessibilitySignal } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
23
23
|
import { IAccessibilitySignalService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
24
24
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
@@ -35,6 +35,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/sear
|
|
|
35
35
|
import { ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
36
36
|
import { pendingRewriteMinimap } from './chatEditingModifiedFileEntry.js';
|
|
37
37
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
38
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
38
39
|
|
|
39
40
|
var ChatEditingTextModelChangeService_1;
|
|
40
41
|
let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService extends Disposable {
|
|
@@ -84,6 +85,11 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
84
85
|
};
|
|
85
86
|
}));
|
|
86
87
|
}
|
|
88
|
+
notifyHunkAction(state, lineCount, hasRemainingEdits) {
|
|
89
|
+
if (lineCount > 0) {
|
|
90
|
+
this._didAcceptOrRejectLines.fire({ state, lineCount, hasRemainingEdits });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
87
93
|
constructor(originalModel, modifiedModel, state, _editorWorkerService, _accessibilitySignalService) {
|
|
88
94
|
super();
|
|
89
95
|
this.originalModel = originalModel;
|
|
@@ -102,15 +108,27 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
102
108
|
this._editDecorations = [];
|
|
103
109
|
this._didAcceptOrRejectAllHunks = this._register(( new Emitter()));
|
|
104
110
|
this.onDidAcceptOrRejectAllHunks = this._didAcceptOrRejectAllHunks.event;
|
|
111
|
+
this._didAcceptOrRejectLines = this._register(( new Emitter()));
|
|
112
|
+
this.onDidAcceptOrRejectLines = this._didAcceptOrRejectLines.event;
|
|
105
113
|
this._didUserEditModel = this._register(( new Emitter()));
|
|
106
114
|
this.onDidUserEditModel = this._didUserEditModel.event;
|
|
107
115
|
this._originalToModifiedEdit = StringEdit.empty;
|
|
116
|
+
this.lineChangeCount = 0;
|
|
108
117
|
this._register(this.modifiedModel.onDidChangeContent(e => {
|
|
109
118
|
this._mirrorEdits(e);
|
|
110
119
|
}));
|
|
111
120
|
this._register(toDisposable(() => {
|
|
112
121
|
this.clearCurrentEditLineDecoration();
|
|
113
122
|
}));
|
|
123
|
+
this._register(autorun(r => this.updateLineChangeCount(this._diffInfo.read(r))));
|
|
124
|
+
}
|
|
125
|
+
updateLineChangeCount(diff) {
|
|
126
|
+
this.lineChangeCount = 0;
|
|
127
|
+
for (const change of diff.changes) {
|
|
128
|
+
const modifiedRange = change.modified.endLineNumberExclusive - change.modified.startLineNumber;
|
|
129
|
+
const originalRange = change.original.endLineNumberExclusive - change.original.startLineNumber;
|
|
130
|
+
this.lineChangeCount += Math.max(modifiedRange, originalRange);
|
|
131
|
+
}
|
|
114
132
|
}
|
|
115
133
|
clearCurrentEditLineDecoration() {
|
|
116
134
|
this._editDecorations = this.modifiedModel.deltaDecorations(this._editDecorations, []);
|
|
@@ -125,12 +143,13 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
125
143
|
const isAtomicEdits = textEdits.length > 0 && isLastEdits;
|
|
126
144
|
let maxLineNumber = 0;
|
|
127
145
|
let rewriteRatio = 0;
|
|
128
|
-
const
|
|
129
|
-
const
|
|
146
|
+
const sessionId = responseModel.session.sessionId;
|
|
147
|
+
const request = responseModel.session.getRequests().at(-1);
|
|
148
|
+
const source = EditSources.chatApplyEdits({ modelId: request?.modelId, requestId: request?.id, sessionId: sessionId });
|
|
130
149
|
if (isAtomicEdits) {
|
|
131
150
|
const minimalEdits = (await this._editorWorkerService.computeMoreMinimalEdits(this.modifiedModel.uri, textEdits)) ?? textEdits;
|
|
132
151
|
const ops = ( minimalEdits.map(TextEdit.asEditOperation));
|
|
133
|
-
const undoEdits = this._applyEdits(ops,
|
|
152
|
+
const undoEdits = this._applyEdits(ops, source);
|
|
134
153
|
if (undoEdits.length > 0) {
|
|
135
154
|
let range;
|
|
136
155
|
for (let i = 0; i < undoEdits.length; i++) {
|
|
@@ -161,7 +180,7 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
161
180
|
}
|
|
162
181
|
else {
|
|
163
182
|
const ops = ( textEdits.map(TextEdit.asEditOperation));
|
|
164
|
-
const undoEdits = this._applyEdits(ops,
|
|
183
|
+
const undoEdits = this._applyEdits(ops, source);
|
|
165
184
|
maxLineNumber = undoEdits.reduce((max, op) => Math.max(max, op.range.startLineNumber), 0);
|
|
166
185
|
rewriteRatio = Math.min(1, maxLineNumber / this.modifiedModel.getLineCount());
|
|
167
186
|
const newDecorations = [
|
|
@@ -184,17 +203,14 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
184
203
|
}
|
|
185
204
|
return { rewriteRatio, maxLineNumber };
|
|
186
205
|
}
|
|
187
|
-
_applyEdits(edits,
|
|
188
|
-
if (!reason) {
|
|
189
|
-
reason = EditReasons.chatApplyEdits({ modelId: undefined });
|
|
190
|
-
}
|
|
206
|
+
_applyEdits(edits, source) {
|
|
191
207
|
try {
|
|
192
208
|
this._isEditFromUs = true;
|
|
193
209
|
let result = [];
|
|
194
210
|
this.modifiedModel.pushEditOperations(null, edits, (undoEdits) => {
|
|
195
211
|
result = undoEdits;
|
|
196
212
|
return null;
|
|
197
|
-
}, undefined,
|
|
213
|
+
}, undefined, source);
|
|
198
214
|
return result;
|
|
199
215
|
}
|
|
200
216
|
finally {
|
|
@@ -202,13 +218,15 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
202
218
|
}
|
|
203
219
|
}
|
|
204
220
|
keep() {
|
|
221
|
+
this.notifyHunkAction('accepted', this.lineChangeCount, false);
|
|
205
222
|
this.originalModel.setValue(this.modifiedModel.createSnapshot());
|
|
206
223
|
this._diffInfo.set(nullDocumentDiff, undefined);
|
|
207
224
|
this._originalToModifiedEdit = StringEdit.empty;
|
|
208
225
|
}
|
|
209
226
|
undo() {
|
|
227
|
+
this.notifyHunkAction('rejected', this.lineChangeCount, false);
|
|
210
228
|
this.modifiedModel.pushStackElement();
|
|
211
|
-
this._applyEdits([(EditOperation.replace(this.modifiedModel.getFullModelRange(), this.originalModel.getValue()))]);
|
|
229
|
+
this._applyEdits([(EditOperation.replace(this.modifiedModel.getFullModelRange(), this.originalModel.getValue()))], EditSources.chatUndoEdits());
|
|
212
230
|
this.modifiedModel.pushStackElement();
|
|
213
231
|
this._originalToModifiedEdit = StringEdit.empty;
|
|
214
232
|
this._diffInfo.set(nullDocumentDiff, undefined);
|
|
@@ -221,7 +239,7 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
221
239
|
}
|
|
222
240
|
if (newModified !== undefined && this.modifiedModel.getValue() !== newModified) {
|
|
223
241
|
this.modifiedModel.pushStackElement();
|
|
224
|
-
this._applyEdits([(EditOperation.replace(this.modifiedModel.getFullModelRange(), newModified))]);
|
|
242
|
+
this._applyEdits([(EditOperation.replace(this.modifiedModel.getFullModelRange(), newModified))], EditSources.chatReset());
|
|
225
243
|
this.modifiedModel.pushStackElement();
|
|
226
244
|
didChange = true;
|
|
227
245
|
}
|
|
@@ -239,14 +257,14 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
239
257
|
else {
|
|
240
258
|
const e_ai = this._originalToModifiedEdit;
|
|
241
259
|
const e_user = edit;
|
|
242
|
-
const e_user_r = e_user.tryRebase(e_ai.inverse(this.originalModel.getValue())
|
|
260
|
+
const e_user_r = e_user.tryRebase(e_ai.inverse(this.originalModel.getValue()));
|
|
243
261
|
if (e_user_r === undefined) {
|
|
244
262
|
this._originalToModifiedEdit = e_ai.compose(e_user);
|
|
245
263
|
}
|
|
246
264
|
else {
|
|
247
265
|
const edits = offsetEditToEditOperations(e_user_r, this.originalModel);
|
|
248
266
|
this.originalModel.applyEdits(edits);
|
|
249
|
-
this._originalToModifiedEdit = e_ai.
|
|
267
|
+
this._originalToModifiedEdit = e_ai.rebaseSkipConflicting(e_user_r);
|
|
250
268
|
}
|
|
251
269
|
this._allEditsAreFromUs = false;
|
|
252
270
|
this._updateDiffInfoSeq();
|
|
@@ -263,7 +281,7 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
263
281
|
edits.push(EditOperation.replace(edit.originalRange, newText));
|
|
264
282
|
}
|
|
265
283
|
this.originalModel.pushEditOperations(null, edits, _ => null);
|
|
266
|
-
await this._updateDiffInfoSeq();
|
|
284
|
+
await this._updateDiffInfoSeq('accepted');
|
|
267
285
|
if (this._diffInfo.get().identical) {
|
|
268
286
|
this._didAcceptOrRejectAllHunks.fire(ModifiedFileEntryState.Accepted);
|
|
269
287
|
}
|
|
@@ -280,20 +298,24 @@ let ChatEditingTextModelChangeService = class ChatEditingTextModelChangeService
|
|
|
280
298
|
edits.push(EditOperation.replace(edit.modifiedRange, newText));
|
|
281
299
|
}
|
|
282
300
|
this.modifiedModel.pushEditOperations(null, edits, _ => null);
|
|
283
|
-
await this._updateDiffInfoSeq();
|
|
301
|
+
await this._updateDiffInfoSeq('rejected');
|
|
284
302
|
if (this._diffInfo.get().identical) {
|
|
285
303
|
this._didAcceptOrRejectAllHunks.fire(ModifiedFileEntryState.Rejected);
|
|
286
304
|
}
|
|
287
305
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.editsUndone, { allowManyInParallel: true });
|
|
288
306
|
return true;
|
|
289
307
|
}
|
|
290
|
-
async _updateDiffInfoSeq() {
|
|
308
|
+
async _updateDiffInfoSeq(notifyAction = undefined) {
|
|
291
309
|
const myDiffOperationId = ++this._diffOperationIds;
|
|
292
310
|
await Promise.resolve(this._diffOperation);
|
|
311
|
+
const previousCount = this.lineChangeCount;
|
|
293
312
|
if (this._diffOperationIds === myDiffOperationId) {
|
|
294
313
|
const thisDiffOperation = this._updateDiffInfo();
|
|
295
314
|
this._diffOperation = thisDiffOperation;
|
|
296
315
|
await thisDiffOperation;
|
|
316
|
+
if (notifyAction) {
|
|
317
|
+
this.notifyHunkAction(notifyAction, previousCount - this.lineChangeCount, this.lineChangeCount > 0);
|
|
318
|
+
}
|
|
297
319
|
}
|
|
298
320
|
}
|
|
299
321
|
async _updateDiffInfo() {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IObservable, ITransaction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
2
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
+
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
|
|
4
|
+
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
5
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
6
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
7
|
+
import { IEditSessionEntryDiff } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
8
|
+
import { IChatRequestDisablement } from "@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
9
|
+
import { AbstractChatEditingModifiedFileEntry } from "./chatEditingModifiedFileEntry.js";
|
|
10
|
+
import { IChatEditingSessionSnapshot, IChatEditingSessionStop } from "./chatEditingSessionStorage.js";
|
|
11
|
+
export declare class ChatEditingTimeline {
|
|
12
|
+
private readonly _editorWorkerService;
|
|
13
|
+
private readonly _instantiationService;
|
|
14
|
+
private readonly _textModelService;
|
|
15
|
+
static readonly POST_EDIT_STOP_ID = "d19944f6-f46c-4e17-911b-79a8e843c7c0";
|
|
16
|
+
static createEmptySnapshot(undoStop: string | undefined): IChatEditingSessionStop;
|
|
17
|
+
private readonly _linearHistory;
|
|
18
|
+
private readonly _linearHistoryIndex;
|
|
19
|
+
private readonly _diffsBetweenStops;
|
|
20
|
+
private readonly _fullDiffs;
|
|
21
|
+
private readonly _ignoreTrimWhitespaceObservable;
|
|
22
|
+
readonly canUndo: IObservable<boolean>;
|
|
23
|
+
readonly canRedo: IObservable<boolean>;
|
|
24
|
+
readonly requestDisablement: IObservable<IChatRequestDisablement[]>;
|
|
25
|
+
constructor(_editorWorkerService: IEditorWorkerService, _instantiationService: IInstantiationService, configurationService: IConfigurationService, _textModelService: ITextModelService);
|
|
26
|
+
restoreFromState(state: {
|
|
27
|
+
history: readonly IChatEditingSessionSnapshot[];
|
|
28
|
+
index: number;
|
|
29
|
+
}, tx: ITransaction): void;
|
|
30
|
+
getSnapshotForRestore(requestId: string | undefined, stopId: string | undefined): {
|
|
31
|
+
stop: IChatEditingSessionStop;
|
|
32
|
+
apply(): void;
|
|
33
|
+
} | undefined;
|
|
34
|
+
ensureEditInUndoStopMatches(requestId: string, undoStop: string | undefined, entry: Pick<AbstractChatEditingModifiedFileEntry, "modifiedURI" | "createSnapshot" | "equalsSnapshot">, next: boolean, tx: ITransaction | undefined): void;
|
|
35
|
+
getUndoSnapshot(): {
|
|
36
|
+
stop: IChatEditingSessionStop;
|
|
37
|
+
apply(): void;
|
|
38
|
+
} | undefined;
|
|
39
|
+
getRedoSnapshot(): {
|
|
40
|
+
stop: IChatEditingSessionStop;
|
|
41
|
+
apply(): void;
|
|
42
|
+
} | undefined;
|
|
43
|
+
private getUndoRedoSnapshot;
|
|
44
|
+
getStateForPersistence(): {
|
|
45
|
+
history: readonly IChatEditingSessionSnapshot[];
|
|
46
|
+
index: number;
|
|
47
|
+
};
|
|
48
|
+
private findSnapshot;
|
|
49
|
+
private findEditStop;
|
|
50
|
+
private getHistoryEntryByLinearIndex;
|
|
51
|
+
pushSnapshot(requestId: string, undoStop: string | undefined, snapshot: IChatEditingSessionStop): void;
|
|
52
|
+
private _entryDiffBetweenTextStops;
|
|
53
|
+
private _createDiffBetweenStopsObservable;
|
|
54
|
+
getEntryDiffBetweenStops(uri: URI, requestId: string | undefined, stopId: string | undefined): IObservable<IEditSessionEntryDiff | undefined>;
|
|
55
|
+
}
|