@codingame/monaco-vscode-chat-service-override 22.1.8 → 23.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 +16 -7
- package/package.json +43 -41
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +57 -48
- 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 +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +26 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +51 -5
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.d.ts → chatNewActions.d.ts} +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.js → chatNewActions.js} +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.d.ts +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +101 -98
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +35 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +43 -25
- 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 +33 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +154 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +250 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsview.css +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +97 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +290 -231
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +7 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.js +113 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimeline.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +646 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +46 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +17 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +44 -34
- 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 +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +46 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +45 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +30 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +60 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.d.ts +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +60 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +29 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +365 -143
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +3 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +58 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +6 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +7 -11
- 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 +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +38 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +83 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +370 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +349 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +787 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +211 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +21 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +54 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +31 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +16 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.js +29 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +37 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.d.ts +15 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +96 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +66 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +77 -71
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +91 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +458 -138
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +212 -150
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +96 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +15 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +33 -17
- 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/languageModelToolsConfirmationService.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +688 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +15 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +126 -135
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +38 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +28 -26
- 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/promptFileActions.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +24 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +25 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +89 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +30 -29
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +10 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +61 -43
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +28 -28
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +254 -165
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.d.ts +10 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +20 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +13 -17
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +51 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +74 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +83 -53
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +136 -78
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +18 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +357 -157
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +55 -28
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +235 -108
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +50 -4
- 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/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +11 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +12 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +18 -30
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +62 -139
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +16 -15
- 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/terminal.chat.contribution.js +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +119 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +6 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +192 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +21 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +8 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +18 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +18 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +31 -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 +24 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +33 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +42 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +14 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +227 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +133 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +75 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +71 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +28 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +366 -363
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +123 -0
- package/vscode/src/vs/base/common/yaml.d.ts +0 -74
- package/vscode/src/vs/base/common/yaml.js +0 -597
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +0 -239
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +0 -102
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +0 -435
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +0 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -380
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +0 -137
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +0 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +0 -176
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +0 -206
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +0 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +0 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +0 -306
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.js +0 -102
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.d.ts +0 -97
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.js +0 -247
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +0 -118
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.js +0 -55
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +0 -66
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js
CHANGED
|
@@ -5,9 +5,12 @@ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/netw
|
|
|
5
5
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
6
6
|
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
7
|
import { getCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
|
|
8
|
+
import { TextEdit } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/edits/textEdit';
|
|
9
|
+
import { StringText } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/text/abstractText';
|
|
8
10
|
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
9
11
|
import { SingleModelEditStackElement } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/editStack';
|
|
10
12
|
import { createTextBufferFactoryFromSnapshot } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
|
|
13
|
+
import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service';
|
|
11
14
|
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
12
15
|
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
13
16
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
@@ -34,6 +37,9 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
34
37
|
get changesCount() {
|
|
35
38
|
return ( this._textModelChangeService.diffInfo.map(diff => diff.changes.length));
|
|
36
39
|
}
|
|
40
|
+
get diffInfo() {
|
|
41
|
+
return this._textModelChangeService.diffInfo;
|
|
42
|
+
}
|
|
37
43
|
get linesAdded() {
|
|
38
44
|
return ( this._textModelChangeService.diffInfo.map(diff => {
|
|
39
45
|
let added = 0;
|
|
@@ -52,16 +58,17 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
52
58
|
return removed;
|
|
53
59
|
}));
|
|
54
60
|
}
|
|
55
|
-
constructor(resourceRef, _multiDiffEntryDelegate, telemetryInfo, kind, initialContent, markerService, modelService, textModelService, languageService, configService, fileConfigService, chatService, _textFileService, fileService, undoRedoService, instantiationService, aiEditTelemetryService) {
|
|
61
|
+
constructor(resourceRef, _multiDiffEntryDelegate, telemetryInfo, kind, initialContent, markerService, modelService, textModelService, languageService, configService, fileConfigService, chatService, _textFileService, fileService, undoRedoService, instantiationService, aiEditTelemetryService, _editorWorkerService) {
|
|
56
62
|
super(resourceRef.object.textEditorModel.uri, telemetryInfo, kind, configService, fileConfigService, chatService, fileService, undoRedoService, instantiationService, aiEditTelemetryService);
|
|
57
63
|
this._multiDiffEntryDelegate = _multiDiffEntryDelegate;
|
|
58
64
|
this._textFileService = _textFileService;
|
|
65
|
+
this._editorWorkerService = _editorWorkerService;
|
|
59
66
|
this._docFileEditorModel = this._register(resourceRef).object;
|
|
60
67
|
this.modifiedModel = resourceRef.object.textEditorModel;
|
|
61
68
|
this.originalURI = ChatEditingTextModelContentProvider.getFileURI(telemetryInfo.sessionId, this.entryId, this.modifiedURI.path);
|
|
62
69
|
this.initialContent = initialContent ?? this.modifiedModel.getValue();
|
|
63
|
-
const docSnapshot = this.originalModel = this._register(modelService.createModel(createTextBufferFactoryFromSnapshot(initialContent ? stringToSnapshot(initialContent) : this.modifiedModel.createSnapshot()), languageService.createById(this.modifiedModel.getLanguageId()), this.originalURI, false));
|
|
64
|
-
this._textModelChangeService = this._register(instantiationService.createInstance(ChatEditingTextModelChangeService, this.originalModel, this.modifiedModel, this._stateObs));
|
|
70
|
+
const docSnapshot = this.originalModel = this._register(modelService.createModel(createTextBufferFactoryFromSnapshot(initialContent !== undefined ? stringToSnapshot(initialContent) : this.modifiedModel.createSnapshot()), languageService.createById(this.modifiedModel.getLanguageId()), this.originalURI, false));
|
|
71
|
+
this._textModelChangeService = this._register(instantiationService.createInstance(ChatEditingTextModelChangeService, this.originalModel, this.modifiedModel, this._stateObs, () => this._isExternalEditInProgress));
|
|
65
72
|
this._register(this._textModelChangeService.onDidAcceptOrRejectAllHunks(action => {
|
|
66
73
|
this._stateObs.set(action, undefined);
|
|
67
74
|
this._notifySessionAction(action === ModifiedFileEntryState.Accepted ? 'accepted' : 'rejected');
|
|
@@ -96,7 +103,7 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
96
103
|
if (inProgress) {
|
|
97
104
|
const res = this._lastModifyingResponseObs.read(r);
|
|
98
105
|
const req = res && res.session.getRequests().find(value => value.id === res.requestId);
|
|
99
|
-
resourceFilter.value = markerService.installResourceFilter(this.modifiedURI, req?.message.text || ( localize(
|
|
106
|
+
resourceFilter.value = markerService.installResourceFilter(this.modifiedURI, req?.message.text || ( localize(5175, "Chat Edits")));
|
|
100
107
|
}
|
|
101
108
|
else {
|
|
102
109
|
resourceFilter.clear();
|
|
@@ -111,17 +118,20 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
111
118
|
this.modifiedModel.getValue() === snapshot.current &&
|
|
112
119
|
this.state.get() === snapshot.state;
|
|
113
120
|
}
|
|
114
|
-
createSnapshot(requestId, undoStop) {
|
|
121
|
+
createSnapshot(sessionId, requestId, undoStop) {
|
|
115
122
|
return {
|
|
116
123
|
resource: this.modifiedURI,
|
|
117
124
|
languageId: this.modifiedModel.getLanguageId(),
|
|
118
|
-
snapshotUri: ChatEditingSnapshotTextModelContentProvider.getSnapshotFileURI(
|
|
125
|
+
snapshotUri: ChatEditingSnapshotTextModelContentProvider.getSnapshotFileURI(sessionId, requestId, undoStop, this.modifiedURI.path),
|
|
119
126
|
original: this.originalModel.getValue(),
|
|
120
127
|
current: this.modifiedModel.getValue(),
|
|
121
128
|
state: this.state.get(),
|
|
122
129
|
telemetryInfo: this._telemetryInfo
|
|
123
130
|
};
|
|
124
131
|
}
|
|
132
|
+
getCurrentContents() {
|
|
133
|
+
return this.modifiedModel.getValue();
|
|
134
|
+
}
|
|
125
135
|
hasModificationAt(location) {
|
|
126
136
|
return ( location.uri.toString()) === ( this.modifiedModel.uri.toString()) && this._textModelChangeService.hasHunkAt(location.range);
|
|
127
137
|
}
|
|
@@ -141,7 +151,7 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
141
151
|
}
|
|
142
152
|
_createUndoRedoElement(response) {
|
|
143
153
|
const request = response.session.getRequests().find(req => req.id === response.requestId);
|
|
144
|
-
const label = request?.message.text ? ( localize(
|
|
154
|
+
const label = request?.message.text ? ( localize(5176, "Chat Edit: '{0}'", request.message.text)) : ( localize(5177, "Chat Edit"));
|
|
145
155
|
return ( new SingleModelEditStackElement(label, 'chat.edit', this.modifiedModel, null));
|
|
146
156
|
}
|
|
147
157
|
async acceptAgentEdits(resource, textEdits, isLastEdits, responseModel) {
|
|
@@ -150,7 +160,6 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
150
160
|
this._waitsForLastEdits.set(!isLastEdits, tx);
|
|
151
161
|
this._stateObs.set(ModifiedFileEntryState.Modified, tx);
|
|
152
162
|
if (!isLastEdits) {
|
|
153
|
-
this._isCurrentlyBeingModifiedByObs.set(responseModel, tx);
|
|
154
163
|
this._rewriteRatioObs.set(result.rewriteRatio, tx);
|
|
155
164
|
}
|
|
156
165
|
else {
|
|
@@ -185,7 +194,8 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
185
194
|
if (this.createdInRequestId === this._telemetryInfo.requestId) {
|
|
186
195
|
if (isTextFileEditorModel(this._docFileEditorModel)) {
|
|
187
196
|
await this._docFileEditorModel.revert({ soft: true });
|
|
188
|
-
await this._fileService.del(this.modifiedURI)
|
|
197
|
+
await this._fileService.del(this.modifiedURI).catch(err => {
|
|
198
|
+
});
|
|
189
199
|
}
|
|
190
200
|
this._onDidDelete.fire();
|
|
191
201
|
}
|
|
@@ -206,6 +216,31 @@ let ChatEditingModifiedDocumentEntry = class ChatEditingModifiedDocumentEntry ex
|
|
|
206
216
|
_shouldAutoSave() {
|
|
207
217
|
return this.modifiedURI.scheme !== Schemas.untitled;
|
|
208
218
|
}
|
|
219
|
+
async computeEditsFromSnapshots(beforeSnapshot, afterSnapshot) {
|
|
220
|
+
const stringEdit = await this._editorWorkerService.computeStringEditFromDiff(beforeSnapshot, afterSnapshot, { maxComputationTimeMs: 5000 }, 'advanced');
|
|
221
|
+
const editorTextEdit = TextEdit.fromStringEdit(stringEdit, ( new StringText(beforeSnapshot)));
|
|
222
|
+
return editorTextEdit.replacements.slice();
|
|
223
|
+
}
|
|
224
|
+
async save() {
|
|
225
|
+
if (this.modifiedModel.uri.scheme === Schemas.untitled) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (this._textFileService.isDirty(this.modifiedModel.uri)) {
|
|
229
|
+
await this._textFileService.save(this.modifiedModel.uri, {
|
|
230
|
+
reason: SaveReason.EXPLICIT,
|
|
231
|
+
skipSaveParticipants: true
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async revertToDisk() {
|
|
236
|
+
if (this.modifiedModel.uri.scheme === Schemas.untitled) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const fileModel = this._textFileService.files.get(this.modifiedModel.uri);
|
|
240
|
+
if (fileModel && !fileModel.isDisposed()) {
|
|
241
|
+
await fileModel.revert({ soft: false });
|
|
242
|
+
}
|
|
243
|
+
}
|
|
209
244
|
};
|
|
210
245
|
ChatEditingModifiedDocumentEntry = ( __decorate([
|
|
211
246
|
( __param(5, IMarkerService)),
|
|
@@ -219,7 +254,8 @@ ChatEditingModifiedDocumentEntry = ( __decorate([
|
|
|
219
254
|
( __param(13, IFileService)),
|
|
220
255
|
( __param(14, IUndoRedoService)),
|
|
221
256
|
( __param(15, IInstantiationService)),
|
|
222
|
-
( __param(16, IAiEditTelemetryService))
|
|
257
|
+
( __param(16, IAiEditTelemetryService)),
|
|
258
|
+
( __param(17, IEditorWorkerService))
|
|
223
259
|
], ChatEditingModifiedDocumentEntry));
|
|
224
260
|
|
|
225
261
|
export { ChatEditingModifiedDocumentEntry };
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { IFilesConfigurationService } from "@codingame/monaco-vscode-api/vscode/
|
|
|
14
14
|
import { IAiEditTelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryService.service";
|
|
15
15
|
import { ICellEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
16
16
|
import { ChatEditKind, IModifiedEntryTelemetryInfo, IModifiedFileEntry, IModifiedFileEntryEditorIntegration, ISnapshotEntry, ModifiedFileEntryState } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
17
|
-
import { IChatResponseModel } from "@codingame/monaco-vscode-
|
|
17
|
+
import { IChatResponseModel } from "@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
18
18
|
import { ChatUserAction } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService";
|
|
19
19
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
20
20
|
declare class AutoAcceptControl {
|
|
@@ -42,8 +42,19 @@ export declare abstract class AbstractChatEditingModifiedFileEntry extends Dispo
|
|
|
42
42
|
readonly state: IObservable<ModifiedFileEntryState>;
|
|
43
43
|
protected readonly _waitsForLastEdits: import("@codingame/monaco-vscode-api/vscode/vs/base/common/observable").ISettableObservable<boolean, void>;
|
|
44
44
|
readonly waitsForLastEdits: IObservable<boolean>;
|
|
45
|
-
protected readonly _isCurrentlyBeingModifiedByObs: import("@codingame/monaco-vscode-api/vscode/vs/base/common/observable").ISettableObservable<
|
|
46
|
-
|
|
45
|
+
protected readonly _isCurrentlyBeingModifiedByObs: import("@codingame/monaco-vscode-api/vscode/vs/base/common/observable").ISettableObservable<{
|
|
46
|
+
responseModel: IChatResponseModel;
|
|
47
|
+
undoStopId: string | undefined;
|
|
48
|
+
} | undefined, void>;
|
|
49
|
+
readonly isCurrentlyBeingModifiedBy: IObservable<{
|
|
50
|
+
responseModel: IChatResponseModel;
|
|
51
|
+
undoStopId: string | undefined;
|
|
52
|
+
} | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Flag to track if we're currently in an external edit operation.
|
|
55
|
+
* When true, file system changes should be treated as agent edits, not user edits.
|
|
56
|
+
*/
|
|
57
|
+
protected _isExternalEditInProgress: boolean;
|
|
47
58
|
protected readonly _lastModifyingResponseObs: import("@codingame/monaco-vscode-api/vscode/vs/base/common/observable").ISettableObservable<IChatResponseModel | undefined, void>;
|
|
48
59
|
readonly lastModifyingResponse: IObservable<IChatResponseModel | undefined>;
|
|
49
60
|
protected readonly _lastModifyingResponseInProgressObs: IObservable<boolean>;
|
|
@@ -67,8 +78,12 @@ export declare abstract class AbstractChatEditingModifiedFileEntry extends Dispo
|
|
|
67
78
|
enableReviewModeUntilSettled(): void;
|
|
68
79
|
updateTelemetryInfo(telemetryInfo: IModifiedEntryTelemetryInfo): void;
|
|
69
80
|
accept(): Promise<void>;
|
|
81
|
+
/** Accepts and returns a function used to transition the state. This MUST be called by the consumer. */
|
|
82
|
+
acceptDeferred(): Promise<((tx: ITransaction) => void) | undefined>;
|
|
70
83
|
protected abstract _doAccept(): Promise<void>;
|
|
71
84
|
reject(): Promise<void>;
|
|
85
|
+
/** Rejects and returns a function used to transition the state. This MUST be called by the consumer. */
|
|
86
|
+
rejectDeferred(): Promise<((tx: ITransaction) => void) | undefined>;
|
|
72
87
|
protected abstract _doReject(): Promise<void>;
|
|
73
88
|
protected _notifySessionAction(outcome: "accepted" | "rejected" | "userModified"): void;
|
|
74
89
|
protected _notifyAction(action: ChatUserAction): void;
|
|
@@ -82,16 +97,40 @@ export declare abstract class AbstractChatEditingModifiedFileEntry extends Dispo
|
|
|
82
97
|
*/
|
|
83
98
|
protected abstract _createEditorIntegration(editor: IEditorPane): IModifiedFileEntryEditorIntegration;
|
|
84
99
|
abstract readonly changesCount: IObservable<number>;
|
|
85
|
-
acceptStreamingEditsStart(responseModel: IChatResponseModel, tx: ITransaction): void;
|
|
100
|
+
acceptStreamingEditsStart(responseModel: IChatResponseModel, undoStopId: string | undefined, tx: ITransaction | undefined): void;
|
|
86
101
|
protected abstract _createUndoRedoElement(response: IChatResponseModel): IUndoRedoElement | undefined;
|
|
87
|
-
abstract acceptAgentEdits(uri: URI, edits: (TextEdit | ICellEditOperation)[], isLastEdits: boolean, responseModel: IChatResponseModel): Promise<void>;
|
|
102
|
+
abstract acceptAgentEdits(uri: URI, edits: (TextEdit | ICellEditOperation)[], isLastEdits: boolean, responseModel: IChatResponseModel | undefined): Promise<void>;
|
|
88
103
|
acceptStreamingEditsEnd(): Promise<void>;
|
|
89
104
|
protected abstract _areOriginalAndModifiedIdentical(): Promise<boolean>;
|
|
90
105
|
protected _resetEditsState(tx: ITransaction | undefined): void;
|
|
91
|
-
abstract createSnapshot(requestId: string | undefined, undoStop: string | undefined): ISnapshotEntry;
|
|
106
|
+
abstract createSnapshot(sessionId: string, requestId: string | undefined, undoStop: string | undefined): ISnapshotEntry;
|
|
92
107
|
abstract equalsSnapshot(snapshot: ISnapshotEntry | undefined): boolean;
|
|
93
108
|
abstract restoreFromSnapshot(snapshot: ISnapshotEntry, restoreToDisk?: boolean): Promise<void>;
|
|
94
109
|
abstract resetToInitialContent(): Promise<void>;
|
|
95
110
|
abstract initialContent: string;
|
|
111
|
+
/**
|
|
112
|
+
* Computes the edits between two snapshots of the file content.
|
|
113
|
+
* @param beforeSnapshot The content before the changes
|
|
114
|
+
* @param afterSnapshot The content after the changes
|
|
115
|
+
* @returns Array of text edits or cell edit operations
|
|
116
|
+
*/
|
|
117
|
+
abstract computeEditsFromSnapshots(beforeSnapshot: string, afterSnapshot: string): Promise<(TextEdit | ICellEditOperation)[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Marks the start of an external edit operation.
|
|
120
|
+
* File system changes will be treated as agent edits until stopExternalEdit is called.
|
|
121
|
+
*/
|
|
122
|
+
startExternalEdit(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Marks the end of an external edit operation.
|
|
125
|
+
*/
|
|
126
|
+
stopExternalEdit(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Saves the current model state to disk.
|
|
129
|
+
*/
|
|
130
|
+
abstract save(): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Reloads the model from disk to ensure it's in sync with file system changes.
|
|
133
|
+
*/
|
|
134
|
+
abstract revertToDisk(): Promise<void>;
|
|
96
135
|
}
|
|
97
136
|
export {};
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js
CHANGED
|
@@ -28,6 +28,7 @@ import { IAiEditTelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
28
28
|
import { EditDeltaInfo } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/textModelEditSource';
|
|
29
29
|
import { ModifiedFileEntryState, ChatEditKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
30
30
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
31
|
+
import { LocalChatSessionUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatUri';
|
|
31
32
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
32
33
|
import { observableValueOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValueOpts';
|
|
33
34
|
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
@@ -42,7 +43,7 @@ class AutoAcceptControl {
|
|
|
42
43
|
this.cancel = cancel;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
const pendingRewriteMinimap = registerColor('minimap.chatEditHighlight', ( transparent(editorBackground, 0.6)), ( localize(
|
|
46
|
+
const pendingRewriteMinimap = registerColor('minimap.chatEditHighlight', ( transparent(editorBackground, 0.6)), ( localize(5178, "Color of pending edit regions in the minimap")));
|
|
46
47
|
let AbstractChatEditingModifiedFileEntry = class AbstractChatEditingModifiedFileEntry extends Disposable {
|
|
47
48
|
static { AbstractChatEditingModifiedFileEntry_1 = this; }
|
|
48
49
|
static { this.scheme = 'modified-file-entry'; }
|
|
@@ -72,6 +73,7 @@ let AbstractChatEditingModifiedFileEntry = class AbstractChatEditingModifiedFile
|
|
|
72
73
|
this.waitsForLastEdits = this._waitsForLastEdits;
|
|
73
74
|
this._isCurrentlyBeingModifiedByObs = observableValue(this, undefined);
|
|
74
75
|
this.isCurrentlyBeingModifiedBy = this._isCurrentlyBeingModifiedByObs;
|
|
76
|
+
this._isExternalEditInProgress = false;
|
|
75
77
|
this._lastModifyingResponseObs = observableValueOpts({ equalsFn: (a, b) => a?.requestId === b?.requestId }, undefined);
|
|
76
78
|
this.lastModifyingResponse = this._lastModifyingResponseObs;
|
|
77
79
|
this._lastModifyingResponseInProgressObs = ( this._lastModifyingResponseObs.map((value, r) => {
|
|
@@ -167,26 +169,38 @@ let AbstractChatEditingModifiedFileEntry = class AbstractChatEditingModifiedFile
|
|
|
167
169
|
this._telemetryInfo = telemetryInfo;
|
|
168
170
|
}
|
|
169
171
|
async accept() {
|
|
172
|
+
const callback = await this.acceptDeferred();
|
|
173
|
+
if (callback) {
|
|
174
|
+
transaction(callback);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async acceptDeferred() {
|
|
170
178
|
if (this._stateObs.get() !== ModifiedFileEntryState.Modified) {
|
|
171
179
|
return;
|
|
172
180
|
}
|
|
173
181
|
await this._doAccept();
|
|
174
|
-
|
|
182
|
+
return (tx) => {
|
|
175
183
|
this._stateObs.set(ModifiedFileEntryState.Accepted, tx);
|
|
176
184
|
this._autoAcceptCtrl.set(undefined, tx);
|
|
177
|
-
|
|
178
|
-
|
|
185
|
+
this._notifySessionAction('accepted');
|
|
186
|
+
};
|
|
179
187
|
}
|
|
180
188
|
async reject() {
|
|
189
|
+
const callback = await this.rejectDeferred();
|
|
190
|
+
if (callback) {
|
|
191
|
+
transaction(callback);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async rejectDeferred() {
|
|
181
195
|
if (this._stateObs.get() !== ModifiedFileEntryState.Modified) {
|
|
182
|
-
return;
|
|
196
|
+
return undefined;
|
|
183
197
|
}
|
|
184
198
|
this._notifySessionAction('rejected');
|
|
185
199
|
await this._doReject();
|
|
186
|
-
|
|
200
|
+
return (tx) => {
|
|
187
201
|
this._stateObs.set(ModifiedFileEntryState.Rejected, tx);
|
|
188
202
|
this._autoAcceptCtrl.set(undefined, tx);
|
|
189
|
-
}
|
|
203
|
+
};
|
|
190
204
|
}
|
|
191
205
|
_notifySessionAction(outcome) {
|
|
192
206
|
this._notifyAction({ kind: 'chatEditingSessionAction', uri: this.modifiedURI, hasRemainingEdits: false, outcome });
|
|
@@ -212,7 +226,7 @@ let AbstractChatEditingModifiedFileEntry = class AbstractChatEditingModifiedFile
|
|
|
212
226
|
modelId: this._telemetryInfo.modelId,
|
|
213
227
|
modeId: this._telemetryInfo.modeId,
|
|
214
228
|
command: this._telemetryInfo.command,
|
|
215
|
-
|
|
229
|
+
sessionResource: LocalChatSessionUri.forSession(this._telemetryInfo.sessionId),
|
|
216
230
|
requestId: this._telemetryInfo.requestId,
|
|
217
231
|
result: this._telemetryInfo.result
|
|
218
232
|
});
|
|
@@ -225,9 +239,9 @@ let AbstractChatEditingModifiedFileEntry = class AbstractChatEditingModifiedFile
|
|
|
225
239
|
}
|
|
226
240
|
return value;
|
|
227
241
|
}
|
|
228
|
-
acceptStreamingEditsStart(responseModel, tx) {
|
|
242
|
+
acceptStreamingEditsStart(responseModel, undoStopId, tx) {
|
|
229
243
|
this._resetEditsState(tx);
|
|
230
|
-
this._isCurrentlyBeingModifiedByObs.set(responseModel, tx);
|
|
244
|
+
this._isCurrentlyBeingModifiedByObs.set({ responseModel, undoStopId }, tx);
|
|
231
245
|
this._lastModifyingResponseObs.set(responseModel, tx);
|
|
232
246
|
this._autoAcceptCtrl.get()?.cancel();
|
|
233
247
|
const undoRedoElement = this._createUndoRedoElement(responseModel);
|
|
@@ -246,6 +260,12 @@ let AbstractChatEditingModifiedFileEntry = class AbstractChatEditingModifiedFile
|
|
|
246
260
|
this._rewriteRatioObs.set(0, tx);
|
|
247
261
|
this._waitsForLastEdits.set(false, tx);
|
|
248
262
|
}
|
|
263
|
+
startExternalEdit() {
|
|
264
|
+
this._isExternalEditInProgress = true;
|
|
265
|
+
}
|
|
266
|
+
stopExternalEdit() {
|
|
267
|
+
this._isExternalEditInProgress = false;
|
|
268
|
+
}
|
|
249
269
|
};
|
|
250
270
|
AbstractChatEditingModifiedFileEntry = AbstractChatEditingModifiedFileEntry_1 = ( __decorate([
|
|
251
271
|
( __param(3, IConfigurationService)),
|
|
@@ -19,7 +19,7 @@ import { INotebookEditorModelResolverService } from "@codingame/monaco-vscode-ap
|
|
|
19
19
|
import { INotebookLoggingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service";
|
|
20
20
|
import { INotebookEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service";
|
|
21
21
|
import { ChatEditKind, IModifiedEntryTelemetryInfo, IModifiedFileEntryEditorIntegration, ISnapshotEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
22
|
-
import { IChatResponseModel } from "@codingame/monaco-vscode-
|
|
22
|
+
import { IChatResponseModel } from "@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
23
23
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
24
24
|
import { AbstractChatEditingModifiedFileEntry } from "./chatEditingModifiedFileEntry.js";
|
|
25
25
|
import { ChatEditingNotebookCellEntry } from "./notebook/chatEditingNotebookCellEntry.js";
|
|
@@ -59,6 +59,7 @@ export declare class ChatEditingModifiedNotebookEntry extends AbstractChatEditin
|
|
|
59
59
|
private modifiedToOriginalCell;
|
|
60
60
|
private readonly _cellsDiffInfo;
|
|
61
61
|
get cellsDiffInfo(): IObservable<ICellDiffInfo[]>;
|
|
62
|
+
get viewType(): string;
|
|
62
63
|
/**
|
|
63
64
|
* List of Cell URIs that are edited,
|
|
64
65
|
* Will be cleared once all edits have been accepted.
|
|
@@ -77,6 +78,7 @@ export declare class ChatEditingModifiedNotebookEntry extends AbstractChatEditin
|
|
|
77
78
|
}, transientOptions: TransientOptions | undefined, telemetryInfo: IModifiedEntryTelemetryInfo, kind: ChatEditKind, initialContent: string, configurationService: IConfigurationService, fileConfigService: IFilesConfigurationService, chatService: IChatService, fileService: IFileService, instantiationService: IInstantiationService, textModelService: ITextModelService, modelService: IModelService, undoRedoService: IUndoRedoService, notebookEditorWorkerService: INotebookEditorWorkerService, loggingService: INotebookLoggingService, notebookResolver: INotebookEditorModelResolverService, aiEditTelemetryService: IAiEditTelemetryService);
|
|
78
79
|
hasModificationAt(location: Location): boolean;
|
|
79
80
|
initializeModelsFromDiffImpl(cellsDiffInfo: CellDiffInfo[]): void;
|
|
81
|
+
getIndexOfCellHandle(handle: number): number;
|
|
80
82
|
private computeRequestId;
|
|
81
83
|
initializeModelsFromDiff(): Promise<void>;
|
|
82
84
|
updateCellDiffInfo(cellsDiffInfo: ICellDiffInfo[], transcation: ITransaction | undefined): void;
|
|
@@ -90,7 +92,7 @@ export declare class ChatEditingModifiedNotebookEntry extends AbstractChatEditin
|
|
|
90
92
|
protected _areOriginalAndModifiedIdentical(): Promise<boolean>;
|
|
91
93
|
private _areOriginalAndModifiedIdenticalImpl;
|
|
92
94
|
private newNotebookEditGenerator?;
|
|
93
|
-
acceptAgentEdits(resource: URI, edits: (TextEdit | ICellEditOperation)[], isLastEdits: boolean, responseModel: IChatResponseModel): Promise<void>;
|
|
95
|
+
acceptAgentEdits(resource: URI, edits: (TextEdit | ICellEditOperation)[], isLastEdits: boolean, responseModel: IChatResponseModel | undefined): Promise<void>;
|
|
94
96
|
private disposeDeletedCellEntries;
|
|
95
97
|
acceptNotebookEdit(edit: ICellEditOperation): void;
|
|
96
98
|
private computeStateAfterAcceptingRejectingChanges;
|
|
@@ -103,12 +105,17 @@ export declare class ChatEditingModifiedNotebookEntry extends AbstractChatEditin
|
|
|
103
105
|
private keepPreviouslyDeletedCell;
|
|
104
106
|
private _applyEdits;
|
|
105
107
|
private _applyEditsSync;
|
|
106
|
-
|
|
108
|
+
getCurrentSnapshot(): string;
|
|
109
|
+
createSnapshot(sessionId: string, requestId: string | undefined, undoStop: string | undefined): ISnapshotEntry;
|
|
107
110
|
equalsSnapshot(snapshot: ISnapshotEntry | undefined): boolean;
|
|
108
111
|
restoreFromSnapshot(snapshot: ISnapshotEntry, restoreToDisk?: boolean): Promise<void>;
|
|
109
112
|
resetToInitialContent(): Promise<void>;
|
|
113
|
+
restoreModifiedModelFromSnapshot(snapshot: string): Promise<void>;
|
|
110
114
|
private restoreSnapshotInModifiedModel;
|
|
111
115
|
private readonly cellTextModelMap;
|
|
112
116
|
private resolveCellModel;
|
|
113
117
|
getOrCreateModifiedTextFileEntryForCell(cell: NotebookCellTextModel, modifiedCellModel: ITextModel, originalCellModel: ITextModel): ChatEditingNotebookCellEntry | undefined;
|
|
118
|
+
computeEditsFromSnapshots(beforeSnapshot: string, afterSnapshot: string): Promise<(TextEdit | ICellEditOperation)[]>;
|
|
119
|
+
save(): Promise<void>;
|
|
120
|
+
revertToDisk(): Promise<void>;
|
|
114
121
|
}
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js
CHANGED
|
@@ -25,9 +25,9 @@ import { UndoRedoElementType } from '@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
25
25
|
import { IUndoRedoService } from '@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo.service';
|
|
26
26
|
import { SaveReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
27
27
|
import { IFilesConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service';
|
|
28
|
-
import { SnapshotContext } from '@codingame/monaco-vscode-
|
|
28
|
+
import { SnapshotContext } from '@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy';
|
|
29
29
|
import { NotebookTextDiffEditor } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor';
|
|
30
|
-
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-
|
|
30
|
+
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
31
31
|
import { CellEditType, NotebookCellsChangeType, NotebookSetting } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
32
32
|
import { computeDiff } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/common/notebookDiff';
|
|
33
33
|
import { INotebookEditorModelResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
|
|
@@ -61,6 +61,9 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
61
61
|
get cellsDiffInfo() {
|
|
62
62
|
return this._cellsDiffInfo;
|
|
63
63
|
}
|
|
64
|
+
get viewType() {
|
|
65
|
+
return this.modifiedModel.viewType;
|
|
66
|
+
}
|
|
64
67
|
static async create(uri, _multiDiffEntryDelegate, telemetryInfo, chatKind, initialContent, instantiationService) {
|
|
65
68
|
return instantiationService.invokeFunction(async (accessor) => {
|
|
66
69
|
const notebookService = accessor.get(INotebookService);
|
|
@@ -76,7 +79,7 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
76
79
|
const disposables = ( new DisposableStore());
|
|
77
80
|
disposables.add(ChatEditingNotebookFileSystemProvider.registerFile(originalUri, buffer));
|
|
78
81
|
const originalRef = await resolver.resolve(originalUri, notebook.viewType);
|
|
79
|
-
if (initialContent) {
|
|
82
|
+
if (initialContent !== undefined) {
|
|
80
83
|
try {
|
|
81
84
|
restoreSnapshot(originalRef.object.notebook, initialContent);
|
|
82
85
|
}
|
|
@@ -168,6 +171,9 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
168
171
|
this._cellsDiffInfo.set(diffs, undefined);
|
|
169
172
|
this._changesCount.set(countChanges(diffs), undefined);
|
|
170
173
|
}
|
|
174
|
+
getIndexOfCellHandle(handle) {
|
|
175
|
+
return this.modifiedModel.cells.findIndex(c => c.handle === handle);
|
|
176
|
+
}
|
|
171
177
|
async initializeModelsFromDiff() {
|
|
172
178
|
const id = ++this.computeRequestId;
|
|
173
179
|
if (this._areOriginalAndModifiedIdenticalImpl()) {
|
|
@@ -202,7 +208,7 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
202
208
|
this._changesCount.set(countChanges(cellsDiffInfo), transcation);
|
|
203
209
|
}
|
|
204
210
|
mirrorNotebookEdits(e) {
|
|
205
|
-
if (this._isEditFromUs || ( Array.from(( this.cellEntryMap.values())).some(entry => entry.isEditFromUs))) {
|
|
211
|
+
if (this._isEditFromUs || this._isExternalEditInProgress || ( Array.from(( this.cellEntryMap.values())).some(entry => entry.isEditFromUs))) {
|
|
206
212
|
return;
|
|
207
213
|
}
|
|
208
214
|
let didResetToOriginalContent = this.initialContentComparer.isEqual(this.modifiedModel);
|
|
@@ -400,7 +406,7 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
400
406
|
}
|
|
401
407
|
_createUndoRedoElement(response) {
|
|
402
408
|
const request = response.session.getRequests().find(req => req.id === response.requestId);
|
|
403
|
-
const label = request?.message.text ? ( localize(
|
|
409
|
+
const label = request?.message.text ? ( localize(5179, "Chat Edit: '{0}'", request.message.text)) : ( localize(5180, "Chat Edit"));
|
|
404
410
|
const transientOptions = this.transientOptions;
|
|
405
411
|
const outputSizeLimit = this.configurationService.getValue(NotebookSetting.outputBackupSizeLimit) * 1024;
|
|
406
412
|
let initial = createSnapshot(this.modifiedModel, transientOptions, outputSizeLimit);
|
|
@@ -507,7 +513,6 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
507
513
|
}
|
|
508
514
|
transaction((tx) => {
|
|
509
515
|
this._stateObs.set(ModifiedFileEntryState.Modified, tx);
|
|
510
|
-
this._isCurrentlyBeingModifiedByObs.set(responseModel, tx);
|
|
511
516
|
if (!isLastEdits) {
|
|
512
517
|
const newRewriteRation = Math.max(this._rewriteRatioObs.get(), calculateNotebookRewriteRatio(this._cellsDiffInfo.get(), this.originalModel, this.modifiedModel));
|
|
513
518
|
this._rewriteRatioObs.set(Math.min(1, newRewriteRation), tx);
|
|
@@ -767,11 +772,14 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
767
772
|
this._isEditFromUs = false;
|
|
768
773
|
}
|
|
769
774
|
}
|
|
770
|
-
|
|
775
|
+
getCurrentSnapshot() {
|
|
776
|
+
return createSnapshot(this.modifiedModel, this.transientOptions, this.configurationService);
|
|
777
|
+
}
|
|
778
|
+
createSnapshot(sessionId, requestId, undoStop) {
|
|
771
779
|
return {
|
|
772
780
|
resource: this.modifiedURI,
|
|
773
781
|
languageId: SnapshotLanguageId,
|
|
774
|
-
snapshotUri: getNotebookSnapshotFileURI(
|
|
782
|
+
snapshotUri: getNotebookSnapshotFileURI(sessionId, requestId, undoStop, this.modifiedURI.path, this.modifiedModel.viewType),
|
|
775
783
|
original: createSnapshot(this.originalModel, this.transientOptions, this.configurationService),
|
|
776
784
|
current: createSnapshot(this.modifiedModel, this.transientOptions, this.configurationService),
|
|
777
785
|
state: this.state.get(),
|
|
@@ -799,6 +807,10 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
799
807
|
this.restoreSnapshotInModifiedModel(this.initialContent);
|
|
800
808
|
this.initializeModelsFromDiff();
|
|
801
809
|
}
|
|
810
|
+
restoreModifiedModelFromSnapshot(snapshot) {
|
|
811
|
+
this.restoreSnapshotInModifiedModel(snapshot);
|
|
812
|
+
return this.initializeModelsFromDiff();
|
|
813
|
+
}
|
|
802
814
|
restoreSnapshotInModifiedModel(snapshot) {
|
|
803
815
|
if (snapshot === createSnapshot(this.modifiedModel, this.transientOptions, this.configurationService)) {
|
|
804
816
|
return;
|
|
@@ -835,7 +847,7 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
835
847
|
return;
|
|
836
848
|
}
|
|
837
849
|
const disposables = ( new DisposableStore());
|
|
838
|
-
cellEntry = this._register(this._instantiationService.createInstance(ChatEditingNotebookCellEntry, this.modifiedResourceRef.object.resource, cell, modifiedCellModel, originalCellModel, disposables));
|
|
850
|
+
cellEntry = this._register(this._instantiationService.createInstance(ChatEditingNotebookCellEntry, this.modifiedResourceRef.object.resource, cell, modifiedCellModel, originalCellModel, () => this._isExternalEditInProgress, disposables));
|
|
839
851
|
this.cellEntryMap.set(cell.uri, cellEntry);
|
|
840
852
|
disposables.add(autorun(r => {
|
|
841
853
|
if (this.modifiedModel.cells.indexOf(cell) === -1) {
|
|
@@ -880,6 +892,45 @@ let ChatEditingModifiedNotebookEntry = class ChatEditingModifiedNotebookEntry ex
|
|
|
880
892
|
}));
|
|
881
893
|
return cellEntry;
|
|
882
894
|
}
|
|
895
|
+
async computeEditsFromSnapshots(beforeSnapshot, afterSnapshot) {
|
|
896
|
+
const beforeData = deserializeSnapshot(beforeSnapshot);
|
|
897
|
+
const afterData = deserializeSnapshot(afterSnapshot);
|
|
898
|
+
const edits = [];
|
|
899
|
+
if (beforeData.data.cells.length > 0) {
|
|
900
|
+
edits.push({
|
|
901
|
+
editType: CellEditType.Replace,
|
|
902
|
+
index: 0,
|
|
903
|
+
count: beforeData.data.cells.length,
|
|
904
|
+
cells: afterData.data.cells
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
else if (afterData.data.cells.length > 0) {
|
|
908
|
+
edits.push({
|
|
909
|
+
editType: CellEditType.Replace,
|
|
910
|
+
index: 0,
|
|
911
|
+
count: 0,
|
|
912
|
+
cells: afterData.data.cells
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
return edits;
|
|
916
|
+
}
|
|
917
|
+
async save() {
|
|
918
|
+
if (this.modifiedModel.uri.scheme === Schemas.untitled) {
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
if (this.notebookResolver.isDirty(this.modifiedModel.uri)) {
|
|
922
|
+
await this.modifiedResourceRef.object.save({
|
|
923
|
+
reason: SaveReason.EXPLICIT,
|
|
924
|
+
skipSaveParticipants: true
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
async revertToDisk() {
|
|
929
|
+
if (this.modifiedModel.uri.scheme === Schemas.untitled) {
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
await this.modifiedResourceRef.object.revert({ soft: false });
|
|
933
|
+
}
|
|
883
934
|
};
|
|
884
935
|
ChatEditingModifiedNotebookEntry = ChatEditingModifiedNotebookEntry_1 = ( __decorate([
|
|
885
936
|
( __param(7, IConfigurationService)),
|