@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
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
5
|
+
import { LineRange } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/ranges/lineRange';
|
|
6
|
+
import { DetailedLineRangeMapping } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/diff/rangeMapping';
|
|
7
|
+
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
8
|
+
import { createTextBufferFactoryFromSnapshot } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
|
|
9
|
+
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
10
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
12
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
|
+
import { UndoRedoElementType } from '@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo';
|
|
14
|
+
import { IUndoRedoService } from '@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo.service';
|
|
15
|
+
import { IFilesConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service';
|
|
16
|
+
import { stringToSnapshot } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles';
|
|
17
|
+
import { IAiEditTelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryService.service';
|
|
18
|
+
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
19
|
+
import { ChatEditKind, ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
|
|
20
|
+
import { AbstractChatEditingModifiedFileEntry } from './chatEditingModifiedFileEntry.js';
|
|
21
|
+
import { ChatEditingTextModelContentProvider } from './chatEditingTextModelContentProviders.js';
|
|
22
|
+
import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
|
|
23
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
24
|
+
import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
|
|
25
|
+
|
|
26
|
+
let ChatEditingDeletedFileEntry = class ChatEditingDeletedFileEntry extends AbstractChatEditingModifiedFileEntry {
|
|
27
|
+
constructor(
|
|
28
|
+
resource,
|
|
29
|
+
originalContent,
|
|
30
|
+
_multiDiffEntryDelegate,
|
|
31
|
+
telemetryInfo,
|
|
32
|
+
_languageId,
|
|
33
|
+
_modelService,
|
|
34
|
+
_languageService,
|
|
35
|
+
configService,
|
|
36
|
+
fileConfigService,
|
|
37
|
+
chatService,
|
|
38
|
+
fileService,
|
|
39
|
+
undoRedoService,
|
|
40
|
+
instantiationService,
|
|
41
|
+
aiEditTelemetryService
|
|
42
|
+
) {
|
|
43
|
+
super(
|
|
44
|
+
resource,
|
|
45
|
+
telemetryInfo,
|
|
46
|
+
ChatEditKind.Deleted,
|
|
47
|
+
configService,
|
|
48
|
+
fileConfigService,
|
|
49
|
+
chatService,
|
|
50
|
+
fileService,
|
|
51
|
+
undoRedoService,
|
|
52
|
+
instantiationService,
|
|
53
|
+
aiEditTelemetryService
|
|
54
|
+
);
|
|
55
|
+
this._multiDiffEntryDelegate = _multiDiffEntryDelegate;
|
|
56
|
+
this._languageId = _languageId;
|
|
57
|
+
this._modelService = _modelService;
|
|
58
|
+
this._languageService = _languageService;
|
|
59
|
+
this.linesAdded = constObservable(0);
|
|
60
|
+
this._changesCount = observableValue(this, 1);
|
|
61
|
+
this.changesCount = this._changesCount;
|
|
62
|
+
this.isDeletion = true;
|
|
63
|
+
this._originalContent = originalContent;
|
|
64
|
+
this.initialContent = originalContent;
|
|
65
|
+
this.originalURI = ChatEditingTextModelContentProvider.getFileURI(telemetryInfo.sessionResource, this.entryId, resource.path);
|
|
66
|
+
this.diffInfo = constObservable(this._diffInfo());
|
|
67
|
+
this.linesRemoved = constObservable(this._getOrCreateOriginalModel().getLineCount());
|
|
68
|
+
}
|
|
69
|
+
dispose() {
|
|
70
|
+
this._originalModel?.dispose();
|
|
71
|
+
this._modifiedModel?.dispose();
|
|
72
|
+
super.dispose();
|
|
73
|
+
}
|
|
74
|
+
_getOrCreateOriginalModel() {
|
|
75
|
+
if (!this._originalModel || this._originalModel.isDisposed()) {
|
|
76
|
+
this._originalModel = this._modelService.createModel(
|
|
77
|
+
createTextBufferFactoryFromSnapshot(stringToSnapshot(this._originalContent)),
|
|
78
|
+
this._languageService.createById(this._languageId),
|
|
79
|
+
this.originalURI,
|
|
80
|
+
false
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return this._originalModel;
|
|
84
|
+
}
|
|
85
|
+
_getOrCreateModifiedModel() {
|
|
86
|
+
if (!this._modifiedModel || this._modifiedModel.isDisposed()) {
|
|
87
|
+
this._modifiedModel = this._modelService.createModel(
|
|
88
|
+
"",
|
|
89
|
+
this._languageService.createById(this._languageId),
|
|
90
|
+
this.modifiedURI.with({
|
|
91
|
+
scheme: "deleted-file"
|
|
92
|
+
}),
|
|
93
|
+
false
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return this._modifiedModel;
|
|
97
|
+
}
|
|
98
|
+
_diffInfo() {
|
|
99
|
+
const originalModel = this._getOrCreateOriginalModel();
|
|
100
|
+
this._getOrCreateModifiedModel();
|
|
101
|
+
const originalLineCount = originalModel.getLineCount();
|
|
102
|
+
return {
|
|
103
|
+
changes: [( new DetailedLineRangeMapping(( new LineRange(1, originalLineCount + 1)), ( new LineRange(1, 1)), undefined))],
|
|
104
|
+
quitEarly: false,
|
|
105
|
+
identical: false,
|
|
106
|
+
moves: []
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
getDiffInfo() {
|
|
110
|
+
return Promise.resolve(this._diffInfo());
|
|
111
|
+
}
|
|
112
|
+
equalsSnapshot(snapshot) {
|
|
113
|
+
return !!snapshot && ( this.modifiedURI.toString()) === ( snapshot.resource.toString()) && this._languageId === snapshot.languageId && this._originalContent === snapshot.original && snapshot.current === "" && this.state.get() === snapshot.state;
|
|
114
|
+
}
|
|
115
|
+
createSnapshot(chatSessionResource, requestId, undoStop) {
|
|
116
|
+
return {
|
|
117
|
+
resource: this.modifiedURI,
|
|
118
|
+
languageId: this._languageId,
|
|
119
|
+
snapshotUri: this.originalURI,
|
|
120
|
+
original: this._originalContent,
|
|
121
|
+
current: "",
|
|
122
|
+
state: this.state.get(),
|
|
123
|
+
telemetryInfo: this._telemetryInfo,
|
|
124
|
+
isDeleted: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
async restoreFromSnapshot(snapshot, restoreToDisk = true) {
|
|
128
|
+
this._stateObs.set(snapshot.state, undefined);
|
|
129
|
+
if (restoreToDisk && snapshot.current !== "") {
|
|
130
|
+
await this._fileService.writeFile(this.modifiedURI, VSBuffer.fromString(snapshot.current));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async resetToInitialContent() {
|
|
134
|
+
await this._fileService.writeFile(this.modifiedURI, VSBuffer.fromString(this._originalContent));
|
|
135
|
+
}
|
|
136
|
+
async _areOriginalAndModifiedIdentical() {
|
|
137
|
+
return this._originalContent === "";
|
|
138
|
+
}
|
|
139
|
+
_createUndoRedoElement(response) {
|
|
140
|
+
return {
|
|
141
|
+
type: UndoRedoElementType.Resource,
|
|
142
|
+
resource: this.modifiedURI,
|
|
143
|
+
label: "Chat File Deletion",
|
|
144
|
+
code: "chat.delete",
|
|
145
|
+
undo: async () => {
|
|
146
|
+
await this._fileService.writeFile(this.modifiedURI, VSBuffer.fromString(this._originalContent));
|
|
147
|
+
},
|
|
148
|
+
redo: async () => {
|
|
149
|
+
await this._fileService.del(this.modifiedURI, {
|
|
150
|
+
useTrash: false
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async acceptAgentEdits(_uri, _edits, isLastEdits, _responseModel) {
|
|
156
|
+
transaction(tx => {
|
|
157
|
+
this._waitsForLastEdits.set(!isLastEdits, tx);
|
|
158
|
+
this._stateObs.set(ModifiedFileEntryState.Modified, tx);
|
|
159
|
+
if (isLastEdits) {
|
|
160
|
+
this._resetEditsState(tx);
|
|
161
|
+
this._rewriteRatioObs.set(1, tx);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
async _doAccept() {
|
|
166
|
+
this._multiDiffEntryDelegate.collapse(undefined);
|
|
167
|
+
}
|
|
168
|
+
async _doReject() {
|
|
169
|
+
await this._fileService.writeFile(this.modifiedURI, VSBuffer.fromString(this._originalContent));
|
|
170
|
+
this._multiDiffEntryDelegate.collapse(undefined);
|
|
171
|
+
}
|
|
172
|
+
_createEditorIntegration(_editor) {
|
|
173
|
+
return {
|
|
174
|
+
currentIndex: observableValue(this, 0),
|
|
175
|
+
reveal: () => {},
|
|
176
|
+
next: () => false,
|
|
177
|
+
previous: () => false,
|
|
178
|
+
enableAccessibleDiffView: () => {},
|
|
179
|
+
acceptNearestChange: async () => {},
|
|
180
|
+
rejectNearestChange: async () => {},
|
|
181
|
+
toggleDiff: async () => {},
|
|
182
|
+
dispose: () => {}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
async computeEditsFromSnapshots(_beforeSnapshot, _afterSnapshot) {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
async save() {}
|
|
189
|
+
async revertToDisk() {}
|
|
190
|
+
};
|
|
191
|
+
ChatEditingDeletedFileEntry = ( __decorate([( __param(5, IModelService)), ( __param(6, ILanguageService)), ( __param(7, IConfigurationService)), ( __param(8, IFilesConfigurationService)), ( __param(9, IChatService)), ( __param(10, IFileService)), ( __param(11, IUndoRedoService)), ( __param(12, IInstantiationService)), ( __param(13, IAiEditTelemetryService))], ChatEditingDeletedFileEntry));
|
|
192
|
+
|
|
193
|
+
export { ChatEditingDeletedFileEntry };
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js
CHANGED
|
@@ -10,10 +10,16 @@ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base
|
|
|
10
10
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
11
11
|
|
|
12
12
|
let ChatEditingEditorAccessibility = class ChatEditingEditorAccessibility {
|
|
13
|
-
static {
|
|
13
|
+
static {
|
|
14
|
+
this.ID = "chat.edits.accessibilty";
|
|
15
|
+
}
|
|
14
16
|
constructor(chatEditingService, editorService, accessibilityService) {
|
|
15
17
|
this._store = ( new DisposableStore());
|
|
16
|
-
const activeUri = observableFromEvent(
|
|
18
|
+
const activeUri = observableFromEvent(
|
|
19
|
+
this,
|
|
20
|
+
editorService.onDidActiveEditorChange,
|
|
21
|
+
() => editorService.activeEditorPane?.input.resource
|
|
22
|
+
);
|
|
17
23
|
this._store.add(autorun(r => {
|
|
18
24
|
const editor = activeUri.read(r);
|
|
19
25
|
if (!editor) {
|
|
@@ -29,10 +35,6 @@ let ChatEditingEditorAccessibility = class ChatEditingEditorAccessibility {
|
|
|
29
35
|
this._store.dispose();
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
|
-
ChatEditingEditorAccessibility = ( __decorate([
|
|
33
|
-
( __param(0, IChatEditingService)),
|
|
34
|
-
( __param(1, IEditorService)),
|
|
35
|
-
( __param(2, IAccessibilitySignalService))
|
|
36
|
-
], ChatEditingEditorAccessibility));
|
|
38
|
+
ChatEditingEditorAccessibility = ( __decorate([( __param(0, IChatEditingService)), ( __param(1, IEditorService)), ( __param(2, IAccessibilitySignalService))], ChatEditingEditorAccessibility));
|
|
37
39
|
|
|
38
40
|
export { ChatEditingEditorAccessibility };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { ResourceMap } from "@codingame/monaco-vscode-api/vscode/vs/base/common/map";
|
|
4
|
+
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
5
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
6
|
+
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
7
|
+
import { DetailedLineRangeMapping, LineRangeMapping } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/diff/rangeMapping";
|
|
8
|
+
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
9
|
+
import { IChatEditingExplanationModelManager } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.service";
|
|
10
|
+
/**
|
|
11
|
+
* Simple diff info interface for explanation generation
|
|
12
|
+
*/
|
|
13
|
+
export interface IExplanationDiffInfo {
|
|
14
|
+
readonly changes: readonly (LineRangeMapping | DetailedLineRangeMapping)[];
|
|
15
|
+
readonly identical: boolean;
|
|
16
|
+
readonly originalModel: ITextModel;
|
|
17
|
+
readonly modifiedModel: ITextModel;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A single explanation for a change
|
|
21
|
+
*/
|
|
22
|
+
export interface IChangeExplanation {
|
|
23
|
+
readonly uri: URI;
|
|
24
|
+
readonly startLineNumber: number;
|
|
25
|
+
readonly endLineNumber: number;
|
|
26
|
+
readonly originalText: string;
|
|
27
|
+
readonly modifiedText: string;
|
|
28
|
+
readonly explanation: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Progress state for explanation generation
|
|
32
|
+
*/
|
|
33
|
+
export type ExplanationProgress = "idle" | "loading" | "complete" | "error";
|
|
34
|
+
/**
|
|
35
|
+
* Explanation state for a single URI
|
|
36
|
+
*/
|
|
37
|
+
export interface IExplanationState {
|
|
38
|
+
readonly progress: ExplanationProgress;
|
|
39
|
+
readonly explanations: readonly IChangeExplanation[];
|
|
40
|
+
readonly diffInfo: IExplanationDiffInfo;
|
|
41
|
+
readonly chatSessionResource: URI | undefined;
|
|
42
|
+
readonly errorMessage?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Handle returned when generating explanations
|
|
46
|
+
*/
|
|
47
|
+
export interface IExplanationGenerationHandle extends IDisposable {
|
|
48
|
+
/**
|
|
49
|
+
* The URIs being explained
|
|
50
|
+
*/
|
|
51
|
+
readonly uris: readonly URI[];
|
|
52
|
+
/**
|
|
53
|
+
* Promise that resolves when generation is complete
|
|
54
|
+
*/
|
|
55
|
+
readonly completed: Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export declare class ChatEditingExplanationModelManager extends Disposable implements IChatEditingExplanationModelManager {
|
|
58
|
+
private readonly _languageModelsService;
|
|
59
|
+
readonly _serviceBrand: undefined;
|
|
60
|
+
private readonly _state;
|
|
61
|
+
readonly state: IObservable<ResourceMap<IExplanationState>>;
|
|
62
|
+
constructor(_languageModelsService: ILanguageModelsService);
|
|
63
|
+
private _updateUriState;
|
|
64
|
+
private _updateUriStatePartial;
|
|
65
|
+
private _removeUris;
|
|
66
|
+
generateExplanations(diffInfos: readonly IExplanationDiffInfo[], chatSessionResource: URI | undefined, token: CancellationToken): IExplanationGenerationHandle;
|
|
67
|
+
private _doGenerateExplanations;
|
|
68
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
6
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
7
|
+
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
8
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
9
|
+
import { ChatMessageRole } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
10
|
+
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
11
|
+
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
12
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
13
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
14
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
15
|
+
|
|
16
|
+
function getChangeTexts(change, diffInfo) {
|
|
17
|
+
const originalLines = [];
|
|
18
|
+
const modifiedLines = [];
|
|
19
|
+
for (let i = change.original.startLineNumber; i < change.original.endLineNumberExclusive; i++) {
|
|
20
|
+
const line = diffInfo.originalModel.getLineContent(i);
|
|
21
|
+
originalLines.push(line);
|
|
22
|
+
}
|
|
23
|
+
for (let i = change.modified.startLineNumber; i < change.modified.endLineNumberExclusive; i++) {
|
|
24
|
+
const line = diffInfo.modifiedModel.getLineContent(i);
|
|
25
|
+
modifiedLines.push(line);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
originalText: originalLines.join("\n"),
|
|
29
|
+
modifiedText: modifiedLines.join("\n")
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
let ChatEditingExplanationModelManager = class ChatEditingExplanationModelManager extends Disposable {
|
|
33
|
+
constructor(_languageModelsService) {
|
|
34
|
+
super();
|
|
35
|
+
this._languageModelsService = _languageModelsService;
|
|
36
|
+
this._state = observableValue(this, ( new ResourceMap()));
|
|
37
|
+
this.state = this._state;
|
|
38
|
+
}
|
|
39
|
+
_updateUriState(uri, uriState) {
|
|
40
|
+
const current = this._state.get();
|
|
41
|
+
const newState = ( new ResourceMap(current));
|
|
42
|
+
newState.set(uri, uriState);
|
|
43
|
+
this._state.set(newState, undefined);
|
|
44
|
+
}
|
|
45
|
+
_updateUriStatePartial(uri, partial) {
|
|
46
|
+
const current = this._state.get();
|
|
47
|
+
const existing = current.get(uri);
|
|
48
|
+
if (existing) {
|
|
49
|
+
const newState = ( new ResourceMap(current));
|
|
50
|
+
newState.set(uri, {
|
|
51
|
+
...existing,
|
|
52
|
+
...partial
|
|
53
|
+
});
|
|
54
|
+
this._state.set(newState, undefined);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
_removeUris(uris) {
|
|
58
|
+
const current = this._state.get();
|
|
59
|
+
const newState = ( new ResourceMap(current));
|
|
60
|
+
for (const uri of uris) {
|
|
61
|
+
newState.delete(uri);
|
|
62
|
+
}
|
|
63
|
+
this._state.set(newState, undefined);
|
|
64
|
+
}
|
|
65
|
+
generateExplanations(diffInfos, chatSessionResource, token) {
|
|
66
|
+
const uris = ( diffInfos.map(d => d.modifiedModel.uri));
|
|
67
|
+
const cts = ( new CancellationTokenSource(token));
|
|
68
|
+
for (const diffInfo of diffInfos) {
|
|
69
|
+
this._updateUriState(diffInfo.modifiedModel.uri, {
|
|
70
|
+
progress: "loading",
|
|
71
|
+
explanations: [],
|
|
72
|
+
diffInfo,
|
|
73
|
+
chatSessionResource
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const completed = this._doGenerateExplanations(diffInfos, cts.token);
|
|
77
|
+
return {
|
|
78
|
+
uris,
|
|
79
|
+
completed,
|
|
80
|
+
dispose: () => {
|
|
81
|
+
cts.dispose(true);
|
|
82
|
+
this._removeUris(uris);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async _doGenerateExplanations(diffInfos, cancellationToken) {
|
|
87
|
+
const nonEmptyDiffs = [];
|
|
88
|
+
for (const diffInfo of diffInfos) {
|
|
89
|
+
if (diffInfo.changes.length === 0 || diffInfo.identical) {
|
|
90
|
+
this._updateUriStatePartial(diffInfo.modifiedModel.uri, {
|
|
91
|
+
progress: "complete",
|
|
92
|
+
explanations: []
|
|
93
|
+
});
|
|
94
|
+
} else {
|
|
95
|
+
nonEmptyDiffs.push(diffInfo);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (nonEmptyDiffs.length === 0) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const fileChanges = ( nonEmptyDiffs.map(diffInfo => {
|
|
102
|
+
const uri = diffInfo.modifiedModel.uri;
|
|
103
|
+
const fileName = basename(uri);
|
|
104
|
+
const changes = ( diffInfo.changes.map(change => {
|
|
105
|
+
const {
|
|
106
|
+
originalText,
|
|
107
|
+
modifiedText
|
|
108
|
+
} = getChangeTexts(change, diffInfo);
|
|
109
|
+
return {
|
|
110
|
+
startLineNumber: change.modified.startLineNumber,
|
|
111
|
+
endLineNumber: change.modified.endLineNumberExclusive - 1,
|
|
112
|
+
originalText,
|
|
113
|
+
modifiedText
|
|
114
|
+
};
|
|
115
|
+
}));
|
|
116
|
+
return {
|
|
117
|
+
uri,
|
|
118
|
+
fileName,
|
|
119
|
+
changes
|
|
120
|
+
};
|
|
121
|
+
}));
|
|
122
|
+
const totalChanges = fileChanges.reduce((sum, f) => sum + f.changes.length, 0);
|
|
123
|
+
try {
|
|
124
|
+
let models = await this._languageModelsService.selectLanguageModels({
|
|
125
|
+
vendor: "copilot",
|
|
126
|
+
family: "claude-3.5-sonnet"
|
|
127
|
+
});
|
|
128
|
+
if (!models.length) {
|
|
129
|
+
models = await this._languageModelsService.selectLanguageModels({
|
|
130
|
+
vendor: "copilot",
|
|
131
|
+
family: "gpt-4o"
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
if (!models.length) {
|
|
135
|
+
models = await this._languageModelsService.selectLanguageModels({
|
|
136
|
+
vendor: "copilot",
|
|
137
|
+
family: "gpt-4"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (!models.length) {
|
|
141
|
+
models = await this._languageModelsService.selectLanguageModels({
|
|
142
|
+
vendor: "copilot"
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (!models.length) {
|
|
146
|
+
for (const fileData of fileChanges) {
|
|
147
|
+
this._updateUriStatePartial(fileData.uri, {
|
|
148
|
+
progress: "error",
|
|
149
|
+
explanations: [],
|
|
150
|
+
errorMessage: ( localize(5322, "No language model available"))
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (cancellationToken.isCancellationRequested) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
let changeIndex = 0;
|
|
159
|
+
const changesDescription = ( fileChanges.map(fileData => {
|
|
160
|
+
return ( fileData.changes.map(data => {
|
|
161
|
+
const desc = `=== CHANGE ${changeIndex} (File: ${fileData.fileName}, Lines ${data.startLineNumber}-${data.endLineNumber}) ===
|
|
162
|
+
BEFORE:
|
|
163
|
+
${data.originalText || "(empty)"}
|
|
164
|
+
|
|
165
|
+
AFTER:
|
|
166
|
+
${data.modifiedText || "(empty)"}`;
|
|
167
|
+
changeIndex++;
|
|
168
|
+
return desc;
|
|
169
|
+
})).join("\n\n");
|
|
170
|
+
})).join("\n\n");
|
|
171
|
+
const fileCount = fileChanges.length;
|
|
172
|
+
const prompt = `Analyze these ${totalChanges} code changes across ${fileCount} file${fileCount > 1 ? "s" : ""} and provide a brief explanation for each one.
|
|
173
|
+
These changes are part of a single coherent modification, so consider how they relate to each other.
|
|
174
|
+
|
|
175
|
+
${changesDescription}
|
|
176
|
+
|
|
177
|
+
Respond with a JSON array containing exactly ${totalChanges} objects, one for each change in order.
|
|
178
|
+
Each object should have an "explanation" field with a brief sentence (max 15 words) explaining what changed and why.
|
|
179
|
+
Be specific about the actual code changes. Return ONLY valid JSON, no markdown.
|
|
180
|
+
|
|
181
|
+
Example response format:
|
|
182
|
+
[{"explanation": "Added null check to prevent crash"}, {"explanation": "Renamed variable for clarity"}]`;
|
|
183
|
+
const response = await this._languageModelsService.sendChatRequest(models[0], ( new ExtensionIdentifier("core")), [{
|
|
184
|
+
role: ChatMessageRole.User,
|
|
185
|
+
content: [{
|
|
186
|
+
type: "text",
|
|
187
|
+
value: prompt
|
|
188
|
+
}]
|
|
189
|
+
}], {}, cancellationToken);
|
|
190
|
+
let responseText = "";
|
|
191
|
+
for await (const part of response.stream) {
|
|
192
|
+
if (cancellationToken.isCancellationRequested) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (Array.isArray(part)) {
|
|
196
|
+
for (const p of part) {
|
|
197
|
+
if (p.type === "text") {
|
|
198
|
+
responseText += p.value;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
} else if (part.type === "text") {
|
|
202
|
+
responseText += part.value;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
await response.result;
|
|
206
|
+
if (cancellationToken.isCancellationRequested) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
let parsed = [];
|
|
210
|
+
try {
|
|
211
|
+
let jsonText = responseText.trim();
|
|
212
|
+
if (jsonText.startsWith("```")) {
|
|
213
|
+
jsonText = jsonText.replace(/^```(?:json)?\n?/, "").replace(/\n?```$/, "");
|
|
214
|
+
}
|
|
215
|
+
parsed = JSON.parse(jsonText);
|
|
216
|
+
} catch {}
|
|
217
|
+
let parsedIndex = 0;
|
|
218
|
+
for (const fileData of fileChanges) {
|
|
219
|
+
const explanations = [];
|
|
220
|
+
for (const data of fileData.changes) {
|
|
221
|
+
const parsedExplanation = parsed[parsedIndex]?.explanation?.trim() || ( localize(5323, "Code was modified."));
|
|
222
|
+
explanations.push({
|
|
223
|
+
uri: fileData.uri,
|
|
224
|
+
startLineNumber: data.startLineNumber,
|
|
225
|
+
endLineNumber: data.endLineNumber,
|
|
226
|
+
originalText: data.originalText,
|
|
227
|
+
modifiedText: data.modifiedText,
|
|
228
|
+
explanation: parsedExplanation
|
|
229
|
+
});
|
|
230
|
+
parsedIndex++;
|
|
231
|
+
}
|
|
232
|
+
this._updateUriStatePartial(fileData.uri, {
|
|
233
|
+
progress: "complete",
|
|
234
|
+
explanations
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
} catch (e) {
|
|
238
|
+
if (!cancellationToken.isCancellationRequested) {
|
|
239
|
+
const errorMessage = e instanceof Error ? e.message : ( localize(5324, "Failed to generate explanations"));
|
|
240
|
+
for (const fileData of fileChanges) {
|
|
241
|
+
this._updateUriStatePartial(fileData.uri, {
|
|
242
|
+
progress: "error",
|
|
243
|
+
explanations: [],
|
|
244
|
+
errorMessage
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
ChatEditingExplanationModelManager = ( __decorate([( __param(0, ILanguageModelsService))], ChatEditingExplanationModelManager));
|
|
252
|
+
|
|
253
|
+
export { ChatEditingExplanationModelManager };
|
|
@@ -2,7 +2,7 @@ import { IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
2
2
|
import { ITransaction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
3
3
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
4
|
import { IDocumentDiff } from "../../../../../editor/common/diff/documentDiffProvider.js";
|
|
5
|
-
import {
|
|
5
|
+
import { TextEdit } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
|
|
6
6
|
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
7
7
|
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
8
8
|
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
|
|
@@ -20,9 +20,9 @@ import { IFilesConfigurationService } from "@codingame/monaco-vscode-api/vscode/
|
|
|
20
20
|
import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
|
|
21
21
|
import { IAiEditTelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryService.service";
|
|
22
22
|
import { ICellEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
23
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
23
24
|
import { ChatEditKind, IModifiedEntryTelemetryInfo, IModifiedFileEntry, IModifiedFileEntryEditorIntegration, ISnapshotEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService";
|
|
24
25
|
import { IChatResponseModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel";
|
|
25
|
-
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
26
26
|
import { AbstractChatEditingModifiedFileEntry } from "./chatEditingModifiedFileEntry.js";
|
|
27
27
|
interface IMultiDiffEntryDelegate {
|
|
28
28
|
collapse: (transaction: ITransaction | undefined) => void;
|
|
@@ -32,8 +32,8 @@ export declare class ChatEditingModifiedDocumentEntry extends AbstractChatEditin
|
|
|
32
32
|
private readonly _textFileService;
|
|
33
33
|
private readonly _editorWorkerService;
|
|
34
34
|
readonly initialContent: string;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
readonly originalModel: ITextModel;
|
|
36
|
+
readonly modifiedModel: ITextModel;
|
|
37
37
|
private readonly _docFileEditorModel;
|
|
38
38
|
get changesCount(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/observable").IObservable<number>;
|
|
39
39
|
get diffInfo(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/observable").IObservable<{
|
|
@@ -55,7 +55,6 @@ export declare class ChatEditingModifiedDocumentEntry extends AbstractChatEditin
|
|
|
55
55
|
equalsSnapshot(snapshot: ISnapshotEntry | undefined): boolean;
|
|
56
56
|
createSnapshot(chatSessionResource: URI, requestId: string | undefined, undoStop: string | undefined): ISnapshotEntry;
|
|
57
57
|
getCurrentContents(): string;
|
|
58
|
-
hasModificationAt(location: Location): boolean;
|
|
59
58
|
restoreFromSnapshot(snapshot: ISnapshotEntry, restoreToDisk?: boolean): Promise<void>;
|
|
60
59
|
resetToInitialContent(): Promise<void>;
|
|
61
60
|
protected _areOriginalAndModifiedIdentical(): Promise<boolean>;
|