@codingame/monaco-vscode-chat-service-override 25.1.2 → 26.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 +24 -3
- package/package.json +5 -5
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +23 -3
- package/vscode/src/vs/platform/browserElements/common/browserElements.js +13 -6
- package/vscode/src/vs/platform/domWidget/browser/domWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +42 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +218 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatTerminalOutputAccessibleView.js +6 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +14 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +165 -168
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +27 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +141 -140
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +189 -121
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +14 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.js +435 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +28 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +10 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +37 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +54 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +73 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +71 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +151 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +12 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +39 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +90 -125
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +263 -143
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +188 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +37 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +21 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +392 -226
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +31 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +25 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +319 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +215 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.d.ts +179 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +951 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agentsessionprojection.css +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +388 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/unifiedQuickAccess.css +195 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.d.ts +120 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +394 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +95 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.js +31 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +49 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/media/simpleBrowserOverlay.css +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +188 -151
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +1012 -639
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +256 -151
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +182 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.d.ts +79 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +253 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +69 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +52 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +5 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +274 -155
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +2 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +130 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +385 -160
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +53 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +112 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +19 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditorController.css +31 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +39 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNewNotebookContentEdits.js +10 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +25 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +265 -203
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +29 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +114 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.js +16 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +44 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +119 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +152 -136
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +12 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +51 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +323 -217
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +653 -401
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +52 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +22 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +43 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +182 -136
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +548 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +222 -138
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +151 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +453 -217
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +162 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/chatSetup.css +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +1 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +309 -233
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +55 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +35 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.d.ts +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +73 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +333 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +39 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +23 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +20 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +65 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +48 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +20 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +155 -159
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +24 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +521 -246
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +107 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +28 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.js +10 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputStateCache.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputStateCache.js +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatLayoutService.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +56 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +37 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatEditorInputContentProvider.js +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +1284 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +179 -125
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +9 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/editorHoverWrapper.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +96 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +58 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +25 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +484 -292
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +65 -92
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +16 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewTitleControl.css +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +331 -189
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +81 -93
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +6 -7
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.d.ts +36 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +169 -31
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +141 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +218 -144
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatTransferService.js +20 -10
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +109 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +349 -0
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +139 -36
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +3 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +64 -51
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +49 -34
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +21 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +125 -97
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +91 -131
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +8 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +488 -222
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +32 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +58 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +717 -200
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +79 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +371 -130
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.js +3 -7
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +79 -61
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +27 -21
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +7 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +26 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +8 -60
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +115 -426
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +127 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -37
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +21 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +334 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +424 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +195 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +368 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +7 -0
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +23 -25
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/common/remoteCodingAgentsService.js +7 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +34 -38
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +8 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +103 -95
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +28 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +4 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +12 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +65 -54
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +86 -60
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +13 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +56 -46
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +63 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +35 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +44 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +3 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +70 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +26 -394
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +85 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +68 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +67 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +106 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +177 -97
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +136 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +128 -112
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +51 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +25 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +21 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +5 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +2 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +30 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +16 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +19 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +58 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +31 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +325 -199
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +33 -38
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +45 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +746 -456
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +145 -98
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +88 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +120 -51
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +25 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +58 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.js +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +47 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +0 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +0 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +0 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +0 -243
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +0 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +0 -166
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +0 -607
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +0 -255
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +0 -396
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +0 -379
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +0 -117
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -141
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -961
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -447
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +0 -251
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +0 -42
|
@@ -23,6 +23,7 @@ import { AccessibilitySignal } from '@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
23
23
|
import { IAccessibilitySignalService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
24
24
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
25
25
|
import { EditorActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor';
|
|
26
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
26
27
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
27
28
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
28
29
|
import { DiffEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/diffEditorInput';
|
|
@@ -34,19 +35,23 @@ import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workben
|
|
|
34
35
|
import { ChatEditingSessionState, ModifiedFileEntryState, getMultiDiffSourceUri, chatEditingSessionIsReady, ChatEditKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
|
|
35
36
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
36
37
|
import { ChatEditingCheckpointTimelineImpl } from './chatEditingCheckpointTimelineImpl.js';
|
|
38
|
+
import { ChatEditingDeletedFileEntry } from './chatEditingDeletedFileEntry.js';
|
|
37
39
|
import { ChatEditingModifiedDocumentEntry } from './chatEditingModifiedDocumentEntry.js';
|
|
38
40
|
import { AbstractChatEditingModifiedFileEntry } from './chatEditingModifiedFileEntry.js';
|
|
39
41
|
import { ChatEditingModifiedNotebookEntry } from './chatEditingModifiedNotebookEntry.js';
|
|
40
42
|
import { FileOperationType } from './chatEditingOperations.js';
|
|
43
|
+
import { IChatEditingExplanationModelManager } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.service';
|
|
41
44
|
import { ChatEditingSessionStorage } from './chatEditingSessionStorage.js';
|
|
42
45
|
import { ChatEditingTextModelContentProvider } from './chatEditingTextModelContentProviders.js';
|
|
46
|
+
import { getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
47
|
+
import { AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
43
48
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
44
49
|
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
45
50
|
import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
|
|
46
51
|
|
|
47
52
|
var ChatEditingSession_1;
|
|
48
53
|
var NotExistBehavior;
|
|
49
|
-
(function
|
|
54
|
+
(function(NotExistBehavior) {
|
|
50
55
|
NotExistBehavior[NotExistBehavior["Create"] = 0] = "Create";
|
|
51
56
|
NotExistBehavior[NotExistBehavior["Abort"] = 1] = "Abort";
|
|
52
57
|
})(NotExistBehavior || (NotExistBehavior = {}));
|
|
@@ -63,50 +68,40 @@ class ThrottledSequencer extends Sequencer {
|
|
|
63
68
|
return super.queue(async () => {
|
|
64
69
|
try {
|
|
65
70
|
const p1 = promiseTask();
|
|
66
|
-
const p2 = noDelay
|
|
67
|
-
? Promise.resolve(undefined)
|
|
68
|
-
: timeout(this._minDuration, CancellationToken.None);
|
|
71
|
+
const p2 = noDelay ? Promise.resolve(undefined) : timeout(this._minDuration, CancellationToken.None);
|
|
69
72
|
const [result] = await Promise.all([p1, p2]);
|
|
70
73
|
return result;
|
|
71
|
-
}
|
|
72
|
-
finally {
|
|
74
|
+
} finally {
|
|
73
75
|
this._size -= 1;
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
function createOpeningEditCodeBlock(uri, isNotebook, undoStopId) {
|
|
79
|
-
return [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
kind: 'textEdit',
|
|
104
|
-
uri,
|
|
105
|
-
edits: [],
|
|
106
|
-
done: false,
|
|
107
|
-
isExternalEdit: true
|
|
108
|
-
},
|
|
109
|
-
];
|
|
81
|
+
return [{
|
|
82
|
+
kind: "markdownContent",
|
|
83
|
+
content: ( new MarkdownString("\n````\n"))
|
|
84
|
+
}, {
|
|
85
|
+
kind: "codeblockUri",
|
|
86
|
+
uri,
|
|
87
|
+
isEdit: true,
|
|
88
|
+
undoStopId
|
|
89
|
+
}, {
|
|
90
|
+
kind: "markdownContent",
|
|
91
|
+
content: ( new MarkdownString("\n````\n"))
|
|
92
|
+
}, isNotebook ? {
|
|
93
|
+
kind: "notebookEdit",
|
|
94
|
+
uri,
|
|
95
|
+
edits: [],
|
|
96
|
+
done: false,
|
|
97
|
+
isExternalEdit: true
|
|
98
|
+
} : {
|
|
99
|
+
kind: "textEdit",
|
|
100
|
+
uri,
|
|
101
|
+
edits: [],
|
|
102
|
+
done: false,
|
|
103
|
+
isExternalEdit: true
|
|
104
|
+
}];
|
|
110
105
|
}
|
|
111
106
|
let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends Disposable {
|
|
112
107
|
get state() {
|
|
@@ -119,7 +114,25 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
119
114
|
this._assertNotDisposed();
|
|
120
115
|
return this._onDidDispose.event;
|
|
121
116
|
}
|
|
122
|
-
constructor(
|
|
117
|
+
constructor(
|
|
118
|
+
chatSessionResource,
|
|
119
|
+
isGlobalEditingSession,
|
|
120
|
+
_lookupExternalEntry,
|
|
121
|
+
transferFrom,
|
|
122
|
+
_instantiationService,
|
|
123
|
+
_modelService,
|
|
124
|
+
_languageService,
|
|
125
|
+
_textModelService,
|
|
126
|
+
_bulkEditService,
|
|
127
|
+
_editorGroupsService,
|
|
128
|
+
_editorService,
|
|
129
|
+
_notebookService,
|
|
130
|
+
_accessibilitySignalService,
|
|
131
|
+
_logService,
|
|
132
|
+
configurationService,
|
|
133
|
+
_fileService,
|
|
134
|
+
_explanationModelManager
|
|
135
|
+
) {
|
|
123
136
|
super();
|
|
124
137
|
this.chatSessionResource = chatSessionResource;
|
|
125
138
|
this.isGlobalEditingSession = isGlobalEditingSession;
|
|
@@ -135,6 +148,8 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
135
148
|
this._accessibilitySignalService = _accessibilitySignalService;
|
|
136
149
|
this._logService = _logService;
|
|
137
150
|
this.configurationService = configurationService;
|
|
151
|
+
this._fileService = _fileService;
|
|
152
|
+
this._explanationModelManager = _explanationModelManager;
|
|
138
153
|
this._state = observableValue(this, ChatEditingSessionState.Initial);
|
|
139
154
|
this._initialFileContents = ( new ResourceMap());
|
|
140
155
|
this._baselineCreationLocks = ( new SequencerByKey());
|
|
@@ -145,13 +160,16 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
145
160
|
const state = this._state.read(reader);
|
|
146
161
|
if (state === ChatEditingSessionState.Disposed || state === ChatEditingSessionState.Initial) {
|
|
147
162
|
return [];
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
163
|
+
} else {
|
|
150
164
|
return this._entriesObs.read(reader);
|
|
151
165
|
}
|
|
152
166
|
});
|
|
153
167
|
this._onDidDispose = ( new Emitter());
|
|
154
|
-
this._timeline = this._instantiationService.createInstance(
|
|
168
|
+
this._timeline = this._instantiationService.createInstance(
|
|
169
|
+
ChatEditingCheckpointTimelineImpl,
|
|
170
|
+
chatSessionResource,
|
|
171
|
+
this._getTimelineDelegate()
|
|
172
|
+
);
|
|
155
173
|
this.canRedo = ( this._timeline.canRedo.map(
|
|
156
174
|
(hasHistory, reader) => hasHistory && this._state.read(reader) === ChatEditingSessionState.Idle
|
|
157
175
|
));
|
|
@@ -165,24 +183,36 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
165
183
|
createFile: (uri, content) => {
|
|
166
184
|
return this._bulkEditService.apply({
|
|
167
185
|
edits: [{
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
186
|
+
newResource: uri,
|
|
187
|
+
options: {
|
|
188
|
+
overwrite: true,
|
|
189
|
+
contents: content ? Promise.resolve(VSBuffer.fromString(content)) : undefined
|
|
190
|
+
}
|
|
191
|
+
}]
|
|
174
192
|
});
|
|
175
193
|
},
|
|
176
|
-
deleteFile: async
|
|
194
|
+
deleteFile: async uri => {
|
|
177
195
|
const entries = this._entriesObs.get().filter(e => !isEqual(e.modifiedURI, uri));
|
|
178
196
|
this._entriesObs.set(entries, undefined);
|
|
179
|
-
await this._bulkEditService.apply({
|
|
197
|
+
await this._bulkEditService.apply({
|
|
198
|
+
edits: [{
|
|
199
|
+
oldResource: uri,
|
|
200
|
+
options: {
|
|
201
|
+
ignoreIfNotExists: true
|
|
202
|
+
}
|
|
203
|
+
}]
|
|
204
|
+
});
|
|
180
205
|
},
|
|
181
206
|
renameFile: async (fromUri, toUri) => {
|
|
182
207
|
const entries = this._entriesObs.get();
|
|
183
208
|
const previousEntry = entries.find(e => isEqual(e.modifiedURI, fromUri));
|
|
184
209
|
if (previousEntry) {
|
|
185
|
-
const newEntry = await this._getOrCreateModifiedFileEntry(
|
|
210
|
+
const newEntry = await this._getOrCreateModifiedFileEntry(
|
|
211
|
+
toUri,
|
|
212
|
+
NotExistBehavior.Create,
|
|
213
|
+
previousEntry.telemetryInfo,
|
|
214
|
+
this._getCurrentTextOrNotebookSnapshot(previousEntry)
|
|
215
|
+
);
|
|
186
216
|
previousEntry.dispose();
|
|
187
217
|
this._entriesObs.set(( entries.map(e => e === previousEntry ? newEntry : e)), undefined);
|
|
188
218
|
}
|
|
@@ -192,9 +222,11 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
192
222
|
const state = entry.state.get();
|
|
193
223
|
if (entry instanceof ChatEditingModifiedNotebookEntry) {
|
|
194
224
|
await entry.restoreModifiedModelFromSnapshot(content);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
225
|
+
} else {
|
|
226
|
+
await entry.acceptAgentEdits(uri, [{
|
|
227
|
+
range: ( new Range(1, 1, Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)),
|
|
228
|
+
text: content
|
|
229
|
+
}], true, undefined);
|
|
198
230
|
}
|
|
199
231
|
if (state !== ModifiedFileEntryState.Modified) {
|
|
200
232
|
await entry.accept();
|
|
@@ -207,10 +239,12 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
207
239
|
let restoredSessionState;
|
|
208
240
|
if (transferFrom instanceof ChatEditingSession_1) {
|
|
209
241
|
restoredSessionState = transferFrom._getStoredState(this.chatSessionResource);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
242
|
+
} else {
|
|
212
243
|
restoredSessionState = await storage.restoreState().catch(err => {
|
|
213
|
-
this._logService.error(
|
|
244
|
+
this._logService.error(
|
|
245
|
+
`Error restoring chat editing session state for ${this.chatSessionResource}`,
|
|
246
|
+
err
|
|
247
|
+
);
|
|
214
248
|
return undefined;
|
|
215
249
|
});
|
|
216
250
|
if (this._store.isDisposed) {
|
|
@@ -246,12 +280,18 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
246
280
|
_getStoredState(sessionResource = this.chatSessionResource) {
|
|
247
281
|
const entries = ( new ResourceMap());
|
|
248
282
|
for (const entry of this._entriesObs.get()) {
|
|
249
|
-
entries.set(
|
|
283
|
+
entries.set(
|
|
284
|
+
entry.modifiedURI,
|
|
285
|
+
entry.createSnapshot(sessionResource, undefined, undefined)
|
|
286
|
+
);
|
|
250
287
|
}
|
|
251
288
|
const state = {
|
|
252
289
|
initialFileContents: this._initialFileContents,
|
|
253
290
|
timeline: this._timeline.getStateForPersistence(),
|
|
254
|
-
recentSnapshot: {
|
|
291
|
+
recentSnapshot: {
|
|
292
|
+
entries,
|
|
293
|
+
stopId: undefined
|
|
294
|
+
}
|
|
255
295
|
};
|
|
256
296
|
return state;
|
|
257
297
|
}
|
|
@@ -279,7 +319,7 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
279
319
|
}
|
|
280
320
|
async getSnapshotContents(requestId, uri, stopId) {
|
|
281
321
|
const content = await this._timeline.getContentAtStop(requestId, uri, stopId);
|
|
282
|
-
return typeof content ===
|
|
322
|
+
return typeof content === "string" ? VSBuffer.fromString(content) : content;
|
|
283
323
|
}
|
|
284
324
|
async getSnapshotModel(requestId, undoStop, snapshotUri) {
|
|
285
325
|
await this._baselineCreationLocks.peek(snapshotUri.path);
|
|
@@ -287,11 +327,18 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
287
327
|
if (content === undefined) {
|
|
288
328
|
return null;
|
|
289
329
|
}
|
|
290
|
-
const contentStr = typeof content ===
|
|
291
|
-
const model = this._modelService.createModel(
|
|
330
|
+
const contentStr = typeof content === "string" ? content : ( content.toString());
|
|
331
|
+
const model = this._modelService.createModel(
|
|
332
|
+
contentStr,
|
|
333
|
+
this._languageService.createByFilepathOrFirstLine(snapshotUri),
|
|
334
|
+
snapshotUri,
|
|
335
|
+
false
|
|
336
|
+
);
|
|
292
337
|
const store = ( new DisposableStore());
|
|
293
338
|
store.add(model.onWillDispose(() => store.dispose()));
|
|
294
|
-
store.add(
|
|
339
|
+
store.add(
|
|
340
|
+
this._timeline.onDidChangeContentsAtStop(requestId, snapshotUri, undoStop, c => model.setValue(c))
|
|
341
|
+
);
|
|
295
342
|
return model;
|
|
296
343
|
}
|
|
297
344
|
getSnapshotUri(requestId, uri, stopId) {
|
|
@@ -309,25 +356,26 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
309
356
|
}
|
|
310
357
|
}
|
|
311
358
|
async accept(...uris) {
|
|
312
|
-
if (await this._operateEntry(
|
|
313
|
-
this._accessibilitySignalService.playSignal(AccessibilitySignal.editsKept, {
|
|
359
|
+
if (await this._operateEntry("accept", uris)) {
|
|
360
|
+
this._accessibilitySignalService.playSignal(AccessibilitySignal.editsKept, {
|
|
361
|
+
allowManyInParallel: true
|
|
362
|
+
});
|
|
314
363
|
}
|
|
315
364
|
}
|
|
316
365
|
async reject(...uris) {
|
|
317
|
-
if (await this._operateEntry(
|
|
318
|
-
this._accessibilitySignalService.playSignal(AccessibilitySignal.editsUndone, {
|
|
366
|
+
if (await this._operateEntry("reject", uris)) {
|
|
367
|
+
this._accessibilitySignalService.playSignal(AccessibilitySignal.editsUndone, {
|
|
368
|
+
allowManyInParallel: true
|
|
369
|
+
});
|
|
319
370
|
}
|
|
320
371
|
}
|
|
321
372
|
async _operateEntry(action, uris) {
|
|
322
373
|
this._assertNotDisposed();
|
|
323
|
-
const applicableEntries = this._entriesObs.get()
|
|
324
|
-
.filter(e => uris.length === 0 || ( uris.some(u => isEqual(u, e.modifiedURI))))
|
|
325
|
-
.filter(e => !e.isCurrentlyBeingModifiedBy.get())
|
|
326
|
-
.filter(e => e.state.get() === ModifiedFileEntryState.Modified);
|
|
374
|
+
const applicableEntries = this._entriesObs.get().filter(e => uris.length === 0 || ( uris.some(u => isEqual(u, e.modifiedURI)))).filter(e => !e.isCurrentlyBeingModifiedBy.get()).filter(e => e.state.get() === ModifiedFileEntryState.Modified);
|
|
327
375
|
if (applicableEntries.length === 0) {
|
|
328
376
|
return 0;
|
|
329
377
|
}
|
|
330
|
-
const method = action ===
|
|
378
|
+
const method = action === "accept" ? "acceptDeferred" : "rejectDeferred";
|
|
331
379
|
const transitionCallbacks = await Promise.all(( applicableEntries.map(entry => entry[method]().catch(err => {
|
|
332
380
|
this._logService.error(`Error calling ${method} on entry ${entry.modifiedURI}`, err);
|
|
333
381
|
}))));
|
|
@@ -341,31 +389,38 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
341
389
|
if (this._editorPane) {
|
|
342
390
|
if (this._editorPane.isVisible()) {
|
|
343
391
|
return;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
392
|
+
} else if (this._editorPane.input) {
|
|
393
|
+
await this._editorGroupsService.activeGroup.openEditor(this._editorPane.input, {
|
|
394
|
+
pinned: true,
|
|
395
|
+
activation: EditorActivation.ACTIVATE
|
|
396
|
+
});
|
|
347
397
|
return;
|
|
348
398
|
}
|
|
349
399
|
}
|
|
350
400
|
const input = MultiDiffEditorInput.fromResourceMultiDiffEditorInput({
|
|
351
401
|
multiDiffSource: getMultiDiffSourceUri(this, previousChanges),
|
|
352
|
-
label: ( localize(
|
|
402
|
+
label: ( localize(5346, "Suggested Edits"))
|
|
353
403
|
}, this._instantiationService);
|
|
354
|
-
this._editorPane = await this._editorGroupsService.activeGroup.openEditor(input, {
|
|
404
|
+
this._editorPane = await this._editorGroupsService.activeGroup.openEditor(input, {
|
|
405
|
+
pinned: true,
|
|
406
|
+
activation: EditorActivation.ACTIVATE
|
|
407
|
+
});
|
|
355
408
|
}
|
|
356
409
|
async stop(clearState = false) {
|
|
357
|
-
this._stopPromise ??= Promise.allSettled([this._performStop(), this.storeState()]).then(() => {
|
|
410
|
+
this._stopPromise ??= Promise.allSettled([this._performStop(), this.storeState()]).then(() => {});
|
|
358
411
|
await this._stopPromise;
|
|
359
412
|
if (clearState) {
|
|
360
413
|
await this._instantiationService.createInstance(ChatEditingSessionStorage, this.chatSessionResource).clearState();
|
|
361
414
|
}
|
|
362
415
|
}
|
|
363
416
|
async _performStop() {
|
|
364
|
-
const schemes = [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
417
|
+
const schemes = [
|
|
418
|
+
AbstractChatEditingModifiedFileEntry.scheme,
|
|
419
|
+
ChatEditingTextModelContentProvider.scheme
|
|
420
|
+
];
|
|
421
|
+
await Promise.allSettled(this._editorGroupsService.groups.flatMap(async g => {
|
|
422
|
+
return ( g.editors.map(async e => {
|
|
423
|
+
if ((e instanceof MultiDiffEditorInput && e.initialResources?.some(r => r.originalUri && schemes.indexOf(r.originalUri.scheme) !== -1)) || (e instanceof DiffEditorInput && e.original.resource && schemes.indexOf(e.original.resource.scheme) !== -1)) {
|
|
369
424
|
await g.closeEditor(e);
|
|
370
425
|
}
|
|
371
426
|
}));
|
|
@@ -373,6 +428,7 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
373
428
|
}
|
|
374
429
|
dispose() {
|
|
375
430
|
this._assertNotDisposed();
|
|
431
|
+
this.clearExplanations();
|
|
376
432
|
dispose(this._entriesObs.get());
|
|
377
433
|
super.dispose();
|
|
378
434
|
this._state.set(ChatEditingSessionState.Disposed, undefined);
|
|
@@ -431,9 +487,64 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
431
487
|
completePromise.complete();
|
|
432
488
|
}
|
|
433
489
|
});
|
|
434
|
-
}
|
|
490
|
+
}
|
|
435
491
|
};
|
|
436
492
|
}
|
|
493
|
+
startDeletion(resource, responseModel, undoStopId) {
|
|
494
|
+
this._assertNotDisposed();
|
|
495
|
+
this._streamingEditLocks.queue(( resource.toString()), async () => {
|
|
496
|
+
if (this.isDisposed) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
await chatEditingSessionIsReady(this);
|
|
500
|
+
let fileContent;
|
|
501
|
+
try {
|
|
502
|
+
const content = await this._fileService.readFile(resource);
|
|
503
|
+
fileContent = ( content.value.toString());
|
|
504
|
+
} catch (e) {
|
|
505
|
+
this._logService.warn(`Cannot delete file ${( resource.toString())}: file does not exist`);
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
const existingEntry = this._getEntry(resource);
|
|
509
|
+
if (existingEntry) {
|
|
510
|
+
existingEntry.dispose();
|
|
511
|
+
const entries = this._entriesObs.get().filter(e => e !== existingEntry);
|
|
512
|
+
this._entriesObs.set(entries, undefined);
|
|
513
|
+
}
|
|
514
|
+
if (!( this._initialFileContents.has(resource))) {
|
|
515
|
+
this._initialFileContents.set(resource, fileContent);
|
|
516
|
+
}
|
|
517
|
+
await this._bulkEditService.apply({
|
|
518
|
+
edits: [{
|
|
519
|
+
oldResource: resource,
|
|
520
|
+
options: {
|
|
521
|
+
ignoreIfNotExists: true
|
|
522
|
+
}
|
|
523
|
+
}]
|
|
524
|
+
});
|
|
525
|
+
this._timeline.recordFileOperation({
|
|
526
|
+
type: FileOperationType.Delete,
|
|
527
|
+
uri: resource,
|
|
528
|
+
requestId: responseModel.requestId,
|
|
529
|
+
epoch: this._timeline.incrementEpoch(),
|
|
530
|
+
finalContent: fileContent
|
|
531
|
+
});
|
|
532
|
+
const telemetryInfo = this._getTelemetryInfoForModel(responseModel);
|
|
533
|
+
const languageSelection = this._languageService.createByFilepathOrFirstLine(resource);
|
|
534
|
+
const entry = this._instantiationService.createInstance(ChatEditingDeletedFileEntry, resource, fileContent, {
|
|
535
|
+
collapse: tx => this._collapse(resource, tx)
|
|
536
|
+
}, telemetryInfo, languageSelection.languageId);
|
|
537
|
+
const entries = [...this._entriesObs.get(), entry];
|
|
538
|
+
this._entriesObs.set(entries, undefined);
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
applyWorkspaceEdit(edit, responseModel, undoStopId) {
|
|
542
|
+
for (const fileEdit of edit.edits) {
|
|
543
|
+
if (fileEdit.oldResource && !fileEdit.newResource) {
|
|
544
|
+
this.startDeletion(fileEdit.oldResource, responseModel, undoStopId);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
437
548
|
async startExternalEdits(responseModel, operationId, resources, undoStopId) {
|
|
438
549
|
const snapshots = ( new ResourceMap());
|
|
439
550
|
const acquiredLockPromises = [];
|
|
@@ -456,7 +567,11 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
456
567
|
await this._acceptStreamingEditsStart(responseModel, undoStopId, resource);
|
|
457
568
|
}
|
|
458
569
|
const notebookUri = CellUri.parse(resource)?.notebook || resource;
|
|
459
|
-
progress.push(...createOpeningEditCodeBlock(
|
|
570
|
+
progress.push(...createOpeningEditCodeBlock(
|
|
571
|
+
resource,
|
|
572
|
+
this._notebookService.hasSupportedNotebooks(notebookUri),
|
|
573
|
+
undoStopId
|
|
574
|
+
));
|
|
460
575
|
await entry?.save();
|
|
461
576
|
snapshots.set(resource, entry && this._getCurrentTextOrNotebookSnapshot(entry));
|
|
462
577
|
entry?.startExternalEdit();
|
|
@@ -486,7 +601,12 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
486
601
|
for (const [resource, beforeSnapshot] of operation.snapshots) {
|
|
487
602
|
let entry = this._getEntry(resource);
|
|
488
603
|
if (!entry && beforeSnapshot === undefined) {
|
|
489
|
-
entry = await this._getOrCreateModifiedFileEntry(
|
|
604
|
+
entry = await this._getOrCreateModifiedFileEntry(
|
|
605
|
+
resource,
|
|
606
|
+
NotExistBehavior.Abort,
|
|
607
|
+
this._getTelemetryInfoForModel(responseModel),
|
|
608
|
+
""
|
|
609
|
+
);
|
|
490
610
|
if (entry) {
|
|
491
611
|
entry.startExternalEdit();
|
|
492
612
|
entry.acceptStreamingEditsStart(responseModel, operation.undoStopId, undefined);
|
|
@@ -505,31 +625,32 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
505
625
|
requestId: responseModel.requestId,
|
|
506
626
|
epoch: this._timeline.incrementEpoch(),
|
|
507
627
|
initialContent: afterSnapshot,
|
|
508
|
-
telemetryInfo: entry.telemetryInfo
|
|
628
|
+
telemetryInfo: entry.telemetryInfo
|
|
509
629
|
});
|
|
510
|
-
}
|
|
511
|
-
else {
|
|
630
|
+
} else {
|
|
512
631
|
edits = await entry.computeEditsFromSnapshots(beforeSnapshot, afterSnapshot);
|
|
513
632
|
this._recordEditOperations(entry, resource, edits, responseModel);
|
|
514
633
|
}
|
|
515
634
|
progress.push(entry instanceof ChatEditingModifiedNotebookEntry ? {
|
|
516
|
-
kind:
|
|
635
|
+
kind: "notebookEdit",
|
|
517
636
|
uri: resource,
|
|
518
637
|
edits: edits,
|
|
519
638
|
done: true,
|
|
520
639
|
isExternalEdit: true
|
|
521
640
|
} : {
|
|
522
|
-
kind:
|
|
641
|
+
kind: "textEdit",
|
|
523
642
|
uri: resource,
|
|
524
643
|
edits: edits,
|
|
525
644
|
done: true,
|
|
526
645
|
isExternalEdit: true
|
|
527
646
|
});
|
|
528
647
|
await entry.acceptStreamingEditsEnd();
|
|
648
|
+
if (getChatSessionType(this.chatSessionResource) === AgentSessionProviders.Background) {
|
|
649
|
+
await entry.accept();
|
|
650
|
+
}
|
|
529
651
|
entry.stopExternalEdit();
|
|
530
652
|
}
|
|
531
|
-
}
|
|
532
|
-
finally {
|
|
653
|
+
} finally {
|
|
533
654
|
operation.releaseLocks();
|
|
534
655
|
const hasOtherTasks = ( Iterable.some(( this._streamingEditLocks.keys()), k => !( operation.snapshots.has(( URI.parse(k))))));
|
|
535
656
|
if (!hasOtherTasks) {
|
|
@@ -544,8 +665,39 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
544
665
|
async redoInteraction() {
|
|
545
666
|
await this._timeline.redoToNextCheckpoint();
|
|
546
667
|
}
|
|
668
|
+
async triggerExplanationGeneration() {
|
|
669
|
+
this.clearExplanations();
|
|
670
|
+
const entries = this._entriesObs.get();
|
|
671
|
+
const diffInfos = [];
|
|
672
|
+
for (const entry of entries) {
|
|
673
|
+
if (entry instanceof ChatEditingModifiedDocumentEntry) {
|
|
674
|
+
const diff = await entry.getDiffInfo();
|
|
675
|
+
diffInfos.push({
|
|
676
|
+
changes: diff.changes,
|
|
677
|
+
identical: diff.identical,
|
|
678
|
+
originalModel: entry.originalModel,
|
|
679
|
+
modifiedModel: entry.modifiedModel
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
if (diffInfos.length > 0) {
|
|
684
|
+
this._explanationHandle = this._explanationModelManager.generateExplanations(diffInfos, this.chatSessionResource, CancellationToken.None);
|
|
685
|
+
await this._explanationHandle.completed;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
clearExplanations() {
|
|
689
|
+
if (this._explanationHandle) {
|
|
690
|
+
this._explanationHandle.dispose();
|
|
691
|
+
this._explanationHandle = undefined;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
hasExplanations() {
|
|
695
|
+
return this._explanationHandle !== undefined;
|
|
696
|
+
}
|
|
547
697
|
_recordEditOperations(entry, resource, edits, responseModel) {
|
|
548
|
-
const isNotebookEdits = edits.length > 0 && hasKey(edits[0], {
|
|
698
|
+
const isNotebookEdits = edits.length > 0 && hasKey(edits[0], {
|
|
699
|
+
cells: true
|
|
700
|
+
});
|
|
549
701
|
if (isNotebookEdits) {
|
|
550
702
|
const notebookEdits = edits;
|
|
551
703
|
this._timeline.recordFileOperation({
|
|
@@ -555,8 +707,7 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
555
707
|
epoch: this._timeline.incrementEpoch(),
|
|
556
708
|
cellEdits: notebookEdits
|
|
557
709
|
});
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
710
|
+
} else {
|
|
560
711
|
let cellIndex;
|
|
561
712
|
if (entry instanceof ChatEditingModifiedNotebookEntry) {
|
|
562
713
|
const cellUri = CellUri.parse(resource);
|
|
@@ -574,23 +725,27 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
574
725
|
requestId: responseModel.requestId,
|
|
575
726
|
epoch: this._timeline.incrementEpoch(),
|
|
576
727
|
edits: textEdits,
|
|
577
|
-
cellIndex
|
|
728
|
+
cellIndex
|
|
578
729
|
});
|
|
579
730
|
}
|
|
580
731
|
}
|
|
581
732
|
_getCurrentTextOrNotebookSnapshot(entry) {
|
|
582
733
|
if (entry instanceof ChatEditingModifiedNotebookEntry) {
|
|
583
734
|
return entry.getCurrentSnapshot();
|
|
584
|
-
}
|
|
585
|
-
else if (entry instanceof ChatEditingModifiedDocumentEntry) {
|
|
735
|
+
} else if (entry instanceof ChatEditingModifiedDocumentEntry) {
|
|
586
736
|
return entry.getCurrentContents();
|
|
587
|
-
}
|
|
588
|
-
|
|
737
|
+
} else if (entry instanceof ChatEditingDeletedFileEntry) {
|
|
738
|
+
return "";
|
|
739
|
+
} else {
|
|
589
740
|
throw ( new Error(`unknown entry type for ${entry.modifiedURI}`));
|
|
590
741
|
}
|
|
591
742
|
}
|
|
592
743
|
async _acceptStreamingEditsStart(responseModel, undoStop, resource) {
|
|
593
|
-
const entry = await this._getOrCreateModifiedFileEntry(
|
|
744
|
+
const entry = await this._getOrCreateModifiedFileEntry(
|
|
745
|
+
resource,
|
|
746
|
+
NotExistBehavior.Create,
|
|
747
|
+
this._getTelemetryInfoForModel(responseModel)
|
|
748
|
+
);
|
|
594
749
|
if (!this._timeline.hasFileBaseline(resource, responseModel.requestId)) {
|
|
595
750
|
this._timeline.recordFileBaseline({
|
|
596
751
|
uri: resource,
|
|
@@ -598,16 +753,20 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
598
753
|
content: this._getCurrentTextOrNotebookSnapshot(entry),
|
|
599
754
|
epoch: this._timeline.incrementEpoch(),
|
|
600
755
|
telemetryInfo: entry.telemetryInfo,
|
|
601
|
-
notebookViewType: entry instanceof ChatEditingModifiedNotebookEntry ? entry.viewType : undefined
|
|
756
|
+
notebookViewType: entry instanceof ChatEditingModifiedNotebookEntry ? entry.viewType : undefined
|
|
602
757
|
});
|
|
603
758
|
}
|
|
604
|
-
transaction(
|
|
759
|
+
transaction(tx => {
|
|
605
760
|
this._state.set(ChatEditingSessionState.StreamingEdits, tx);
|
|
606
761
|
entry.acceptStreamingEditsStart(responseModel, undoStop, tx);
|
|
607
762
|
});
|
|
608
763
|
return entry;
|
|
609
764
|
}
|
|
610
|
-
async _initEntries(
|
|
765
|
+
async _initEntries(
|
|
766
|
+
{
|
|
767
|
+
entries
|
|
768
|
+
}
|
|
769
|
+
) {
|
|
611
770
|
for (const entry of this._entriesObs.get()) {
|
|
612
771
|
const snapshotEntry = entries.get(entry.modifiedURI);
|
|
613
772
|
if (!snapshotEntry) {
|
|
@@ -617,17 +776,42 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
617
776
|
}
|
|
618
777
|
const entriesArr = [];
|
|
619
778
|
for (const snapshotEntry of ( entries.values())) {
|
|
620
|
-
|
|
779
|
+
let entry;
|
|
780
|
+
if (snapshotEntry.isDeleted) {
|
|
781
|
+
entry = this._instantiationService.createInstance(
|
|
782
|
+
ChatEditingDeletedFileEntry,
|
|
783
|
+
snapshotEntry.resource,
|
|
784
|
+
snapshotEntry.original,
|
|
785
|
+
{
|
|
786
|
+
collapse: tx => this._collapse(snapshotEntry.resource, tx)
|
|
787
|
+
},
|
|
788
|
+
snapshotEntry.telemetryInfo,
|
|
789
|
+
snapshotEntry.languageId
|
|
790
|
+
);
|
|
791
|
+
await entry.restoreFromSnapshot(snapshotEntry, false);
|
|
792
|
+
} else {
|
|
793
|
+
entry = await this._getOrCreateModifiedFileEntry(
|
|
794
|
+
snapshotEntry.resource,
|
|
795
|
+
NotExistBehavior.Abort,
|
|
796
|
+
snapshotEntry.telemetryInfo
|
|
797
|
+
);
|
|
798
|
+
if (entry) {
|
|
799
|
+
const restoreToDisk = snapshotEntry.state === ModifiedFileEntryState.Modified;
|
|
800
|
+
await entry.restoreFromSnapshot(snapshotEntry, restoreToDisk);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
621
803
|
if (entry) {
|
|
622
|
-
const restoreToDisk = snapshotEntry.state === ModifiedFileEntryState.Modified;
|
|
623
|
-
await entry.restoreFromSnapshot(snapshotEntry, restoreToDisk);
|
|
624
804
|
entriesArr.push(entry);
|
|
625
805
|
}
|
|
626
806
|
}
|
|
627
807
|
this._entriesObs.set(entriesArr, undefined);
|
|
628
808
|
}
|
|
629
809
|
async _acceptEdits(resource, textEdits, isLastEdits, responseModel) {
|
|
630
|
-
const entry = await this._getOrCreateModifiedFileEntry(
|
|
810
|
+
const entry = await this._getOrCreateModifiedFileEntry(
|
|
811
|
+
resource,
|
|
812
|
+
NotExistBehavior.Create,
|
|
813
|
+
this._getTelemetryInfoForModel(responseModel)
|
|
814
|
+
);
|
|
631
815
|
if (textEdits.length > 0) {
|
|
632
816
|
this._recordEditOperations(entry, resource, textEdits, responseModel);
|
|
633
817
|
}
|
|
@@ -635,24 +819,39 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
635
819
|
}
|
|
636
820
|
_getTelemetryInfoForModel(responseModel) {
|
|
637
821
|
return new class {
|
|
638
|
-
get agentId() {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
get
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
get
|
|
645
|
-
|
|
822
|
+
get agentId() {
|
|
823
|
+
return responseModel.agent?.id;
|
|
824
|
+
}
|
|
825
|
+
get modelId() {
|
|
826
|
+
return responseModel.request?.modelId;
|
|
827
|
+
}
|
|
828
|
+
get modeId() {
|
|
829
|
+
return responseModel.request?.modeInfo?.modeId;
|
|
830
|
+
}
|
|
831
|
+
get command() {
|
|
832
|
+
return responseModel.slashCommand?.name;
|
|
833
|
+
}
|
|
834
|
+
get sessionResource() {
|
|
835
|
+
return responseModel.session.sessionResource;
|
|
836
|
+
}
|
|
837
|
+
get requestId() {
|
|
838
|
+
return responseModel.requestId;
|
|
839
|
+
}
|
|
840
|
+
get result() {
|
|
841
|
+
return responseModel.result;
|
|
842
|
+
}
|
|
843
|
+
get applyCodeBlockSuggestionId() {
|
|
844
|
+
return responseModel.request?.modeInfo?.applyCodeBlockSuggestionId;
|
|
845
|
+
}
|
|
646
846
|
get feature() {
|
|
647
847
|
if (responseModel.session.initialLocation === ChatAgentLocation.Chat) {
|
|
648
|
-
return
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
return 'inlineChat';
|
|
848
|
+
return "sideBarChat";
|
|
849
|
+
} else if (responseModel.session.initialLocation === ChatAgentLocation.EditorInline) {
|
|
850
|
+
return "inlineChat";
|
|
652
851
|
}
|
|
653
852
|
return undefined;
|
|
654
853
|
}
|
|
655
|
-
};
|
|
854
|
+
}();
|
|
656
855
|
}
|
|
657
856
|
async _resolve(requestId, undoStop, resource) {
|
|
658
857
|
const hasOtherTasks = ( Iterable.some(( this._streamingEditLocks.keys()), k => k !== ( resource.toString())));
|
|
@@ -671,10 +870,20 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
671
870
|
resource = CellUri.parse(resource)?.notebook ?? resource;
|
|
672
871
|
const existingEntry = this._entriesObs.get().find(e => isEqual(e.modifiedURI, resource));
|
|
673
872
|
if (existingEntry) {
|
|
674
|
-
if (
|
|
675
|
-
existingEntry.
|
|
873
|
+
if (existingEntry instanceof ChatEditingDeletedFileEntry) {
|
|
874
|
+
const initialContentFromDeleted = existingEntry.state.get() === ModifiedFileEntryState.Modified ? existingEntry.initialContent : undefined;
|
|
875
|
+
existingEntry.dispose();
|
|
876
|
+
const entries = this._entriesObs.get().filter(e => e !== existingEntry);
|
|
877
|
+
this._entriesObs.set(entries, undefined);
|
|
878
|
+
if (initialContentFromDeleted !== undefined) {
|
|
879
|
+
_initialContent = initialContentFromDeleted;
|
|
880
|
+
}
|
|
881
|
+
} else {
|
|
882
|
+
if (telemetryInfo.requestId !== existingEntry.telemetryInfo.requestId) {
|
|
883
|
+
existingEntry.updateTelemetryInfo(telemetryInfo);
|
|
884
|
+
}
|
|
885
|
+
return existingEntry;
|
|
676
886
|
}
|
|
677
|
-
return existingEntry;
|
|
678
887
|
}
|
|
679
888
|
let entry;
|
|
680
889
|
const existingExternalEntry = this._lookupExternalEntry(resource);
|
|
@@ -683,8 +892,7 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
683
892
|
if (telemetryInfo.requestId !== entry.telemetryInfo.requestId) {
|
|
684
893
|
entry.updateTelemetryInfo(telemetryInfo);
|
|
685
894
|
}
|
|
686
|
-
}
|
|
687
|
-
else {
|
|
895
|
+
} else {
|
|
688
896
|
const initialContent = _initialContent ?? this._initialFileContents.get(resource);
|
|
689
897
|
const maybeEntry = await this._createModifiedFileEntry(resource, telemetryInfo, ifNotExists, initialContent);
|
|
690
898
|
if (!maybeEntry) {
|
|
@@ -711,45 +919,74 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
711
919
|
}
|
|
712
920
|
async _createModifiedFileEntry(resource, telemetryInfo, ifNotExists, initialContent) {
|
|
713
921
|
const multiDiffEntryDelegate = {
|
|
714
|
-
collapse:
|
|
715
|
-
recordOperation:
|
|
922
|
+
collapse: transaction => this._collapse(resource, transaction),
|
|
923
|
+
recordOperation: operation => {
|
|
716
924
|
operation.epoch = this._timeline.incrementEpoch();
|
|
717
925
|
this._timeline.recordFileOperation(operation);
|
|
718
|
-
}
|
|
926
|
+
}
|
|
719
927
|
};
|
|
720
928
|
const notebookUri = CellUri.parse(resource)?.notebook || resource;
|
|
721
|
-
const doCreate = async
|
|
929
|
+
const doCreate = async chatKind => {
|
|
722
930
|
if (this._notebookService.hasSupportedNotebooks(notebookUri)) {
|
|
723
|
-
return await ChatEditingModifiedNotebookEntry.create(
|
|
724
|
-
|
|
725
|
-
|
|
931
|
+
return await ChatEditingModifiedNotebookEntry.create(
|
|
932
|
+
notebookUri,
|
|
933
|
+
multiDiffEntryDelegate,
|
|
934
|
+
telemetryInfo,
|
|
935
|
+
chatKind,
|
|
936
|
+
initialContent,
|
|
937
|
+
this._instantiationService
|
|
938
|
+
);
|
|
939
|
+
} else {
|
|
726
940
|
const ref = await this._textModelService.createModelReference(resource);
|
|
727
|
-
return this._instantiationService.createInstance(
|
|
941
|
+
return this._instantiationService.createInstance(
|
|
942
|
+
ChatEditingModifiedDocumentEntry,
|
|
943
|
+
ref,
|
|
944
|
+
multiDiffEntryDelegate,
|
|
945
|
+
telemetryInfo,
|
|
946
|
+
chatKind,
|
|
947
|
+
initialContent
|
|
948
|
+
);
|
|
728
949
|
}
|
|
729
950
|
};
|
|
730
951
|
try {
|
|
731
952
|
return await doCreate(ChatEditKind.Modified);
|
|
732
|
-
}
|
|
733
|
-
catch (err) {
|
|
953
|
+
} catch (err) {
|
|
734
954
|
if (ifNotExists === NotExistBehavior.Abort) {
|
|
735
955
|
return undefined;
|
|
736
956
|
}
|
|
737
|
-
await this._bulkEditService.apply({
|
|
738
|
-
|
|
739
|
-
|
|
957
|
+
await this._bulkEditService.apply({
|
|
958
|
+
edits: [{
|
|
959
|
+
newResource: resource
|
|
960
|
+
}]
|
|
961
|
+
});
|
|
962
|
+
if (this.configurationService.getValue("accessibility.openChatEditedFiles")) {
|
|
963
|
+
this._editorService.openEditor({
|
|
964
|
+
resource,
|
|
965
|
+
options: {
|
|
966
|
+
inactive: true,
|
|
967
|
+
preserveFocus: true,
|
|
968
|
+
pinned: true
|
|
969
|
+
}
|
|
970
|
+
});
|
|
740
971
|
}
|
|
741
972
|
this._timeline.recordFileOperation({
|
|
742
973
|
type: FileOperationType.Create,
|
|
743
974
|
uri: resource,
|
|
744
975
|
requestId: telemetryInfo.requestId,
|
|
745
976
|
epoch: this._timeline.incrementEpoch(),
|
|
746
|
-
initialContent: initialContent ||
|
|
747
|
-
telemetryInfo
|
|
977
|
+
initialContent: initialContent || "",
|
|
978
|
+
telemetryInfo
|
|
748
979
|
});
|
|
749
980
|
if (this._notebookService.hasSupportedNotebooks(notebookUri)) {
|
|
750
|
-
return await ChatEditingModifiedNotebookEntry.create(
|
|
751
|
-
|
|
752
|
-
|
|
981
|
+
return await ChatEditingModifiedNotebookEntry.create(
|
|
982
|
+
resource,
|
|
983
|
+
multiDiffEntryDelegate,
|
|
984
|
+
telemetryInfo,
|
|
985
|
+
ChatEditKind.Created,
|
|
986
|
+
initialContent,
|
|
987
|
+
this._instantiationService
|
|
988
|
+
);
|
|
989
|
+
} else {
|
|
753
990
|
return await doCreate(ChatEditKind.Created);
|
|
754
991
|
}
|
|
755
992
|
}
|
|
@@ -757,24 +994,12 @@ let ChatEditingSession = ChatEditingSession_1 = class ChatEditingSession extends
|
|
|
757
994
|
_collapse(resource, transaction) {
|
|
758
995
|
const multiDiffItem = this._editorPane?.findDocumentDiffItem(resource);
|
|
759
996
|
if (multiDiffItem) {
|
|
760
|
-
this._editorPane?.viewModel?.items.get().find(
|
|
761
|
-
isEqual(documentDiffItem.modifiedUri, multiDiffItem.modifiedUri)
|
|
762
|
-
|
|
997
|
+
this._editorPane?.viewModel?.items.get().find(
|
|
998
|
+
documentDiffItem => isEqual(documentDiffItem.originalUri, multiDiffItem.originalUri) && isEqual(documentDiffItem.modifiedUri, multiDiffItem.modifiedUri)
|
|
999
|
+
)?.collapsed.set(true, transaction);
|
|
763
1000
|
}
|
|
764
1001
|
}
|
|
765
1002
|
};
|
|
766
|
-
ChatEditingSession = ChatEditingSession_1 = ( __decorate([
|
|
767
|
-
( __param(4, IInstantiationService)),
|
|
768
|
-
( __param(5, IModelService)),
|
|
769
|
-
( __param(6, ILanguageService)),
|
|
770
|
-
( __param(7, ITextModelService)),
|
|
771
|
-
( __param(8, IBulkEditService)),
|
|
772
|
-
( __param(9, IEditorGroupsService)),
|
|
773
|
-
( __param(10, IEditorService)),
|
|
774
|
-
( __param(11, INotebookService)),
|
|
775
|
-
( __param(12, IAccessibilitySignalService)),
|
|
776
|
-
( __param(13, ILogService)),
|
|
777
|
-
( __param(14, IConfigurationService))
|
|
778
|
-
], ChatEditingSession));
|
|
1003
|
+
ChatEditingSession = ChatEditingSession_1 = ( __decorate([( __param(4, IInstantiationService)), ( __param(5, IModelService)), ( __param(6, ILanguageService)), ( __param(7, ITextModelService)), ( __param(8, IBulkEditService)), ( __param(9, IEditorGroupsService)), ( __param(10, IEditorService)), ( __param(11, INotebookService)), ( __param(12, IAccessibilitySignalService)), ( __param(13, ILogService)), ( __param(14, IConfigurationService)), ( __param(15, IFileService)), ( __param(16, IChatEditingExplanationModelManager))], ChatEditingSession));
|
|
779
1004
|
|
|
780
1005
|
export { ChatEditingSession };
|