@codingame/monaco-vscode-chat-service-override 22.1.8 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +16 -7
- package/package.json +43 -41
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +57 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +26 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +51 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.d.ts → chatNewActions.d.ts} +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.js → chatNewActions.js} +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.d.ts +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +101 -98
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +35 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +43 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +33 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +154 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +250 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsview.css +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +97 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +290 -231
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +7 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.js +113 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimeline.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +646 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +46 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +17 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +44 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +46 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +45 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +30 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +60 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.d.ts +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +60 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +29 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +365 -143
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +3 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +58 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +6 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +7 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +38 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +83 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +370 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +349 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +787 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +211 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +21 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +54 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +31 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +16 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.js +29 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +37 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.d.ts +15 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +96 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +66 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +77 -71
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +91 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +458 -138
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +212 -150
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +96 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +15 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +33 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +688 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +15 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +126 -135
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +38 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +28 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +24 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +25 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +89 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +30 -29
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +10 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +61 -43
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +28 -28
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +254 -165
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.d.ts +10 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +20 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +13 -17
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +51 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +74 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +83 -53
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +136 -78
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +18 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +357 -157
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +55 -28
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +235 -108
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +50 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +11 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +12 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +18 -30
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +62 -139
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +16 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +119 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +6 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +192 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +21 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +8 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +18 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +18 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +24 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +33 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +42 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +14 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +227 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +133 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +75 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +71 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +28 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +366 -363
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +123 -0
- package/vscode/src/vs/base/common/yaml.d.ts +0 -74
- package/vscode/src/vs/base/common/yaml.js +0 -597
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +0 -239
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +0 -102
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +0 -435
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +0 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -380
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +0 -137
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +0 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +0 -176
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +0 -206
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +0 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +0 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +0 -306
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.js +0 -102
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.d.ts +0 -97
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.js +0 -247
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +0 -118
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.js +0 -55
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +0 -66
|
@@ -15,11 +15,11 @@ import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
15
15
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
16
16
|
import { ExtensionEditorTab } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
17
17
|
import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
|
|
18
|
-
import { McpCommandIds } from '@codingame/monaco-vscode-
|
|
18
|
+
import { McpCommandIds } from '@codingame/monaco-vscode-7b19b93e-7a49-5c48-81f5-091a64f468d2-common/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
|
|
19
19
|
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
20
20
|
import { McpServerEditorTab, McpConnectionState, McpServerCacheState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
21
21
|
import { IMcpService, IMcpWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
22
|
-
import { startServerAndWaitForLiveTools } from '@codingame/monaco-vscode-
|
|
22
|
+
import { startServerAndWaitForLiveTools } from '@codingame/monaco-vscode-7b19b93e-7a49-5c48-81f5-091a64f468d2-common/vscode/vs/workbench/contrib/mcp/common/mcpTypesUtils';
|
|
23
23
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
24
24
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
25
25
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
@@ -77,7 +77,7 @@ function createToolSetTreeItem(toolset, checked, editorService) {
|
|
|
77
77
|
const resource = toolset.source.file;
|
|
78
78
|
buttons.push({
|
|
79
79
|
iconClass: ThemeIcon.asClassName(Codicon.edit),
|
|
80
|
-
tooltip: ( localize(
|
|
80
|
+
tooltip: ( localize(4775, "Edit Tool Set")),
|
|
81
81
|
action: () => editorService.openEditor({ resource })
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -158,14 +158,14 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
158
158
|
if (collection?.source) {
|
|
159
159
|
buttons.push({
|
|
160
160
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
161
|
-
tooltip: ( localize(
|
|
161
|
+
tooltip: ( localize(4776, "Configure {0}", collection.label)),
|
|
162
162
|
action: () => collection.source ? collection.source instanceof ExtensionIdentifier ? extensionsWorkbenchService.open(collection.source.value, { tab: ExtensionEditorTab.Features, feature: 'mcp' }) : mcpWorkbenchService.open(collection.source, { tab: McpServerEditorTab.Configuration }) : undefined
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
else if (collection?.presentation?.origin) {
|
|
166
166
|
buttons.push({
|
|
167
167
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
168
|
-
tooltip: ( localize(
|
|
168
|
+
tooltip: ( localize(4776, "Configure {0}", collection.label)),
|
|
169
169
|
action: () => editorService.openEditor({
|
|
170
170
|
resource: collection.presentation.origin,
|
|
171
171
|
})
|
|
@@ -174,7 +174,7 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
174
174
|
if (mcpServer.connectionState.get().state === McpConnectionState.Kind.Error) {
|
|
175
175
|
buttons.push({
|
|
176
176
|
iconClass: ThemeIcon.asClassName(Codicon.warning),
|
|
177
|
-
tooltip: ( localize(
|
|
177
|
+
tooltip: ( localize(4777, "Show Output")),
|
|
178
178
|
action: () => mcpServer.showOutput(),
|
|
179
179
|
});
|
|
180
180
|
}
|
|
@@ -186,7 +186,7 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
186
186
|
children.push({
|
|
187
187
|
itemType: 'callback',
|
|
188
188
|
iconClass: ThemeIcon.asClassName(Codicon.sync),
|
|
189
|
-
label: ( localize(
|
|
189
|
+
label: ( localize(4778, "Update Tools")),
|
|
190
190
|
pickable: false,
|
|
191
191
|
run: () => {
|
|
192
192
|
treePicker.busy = true;
|
|
@@ -208,15 +208,16 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
208
208
|
itemType: 'bucket',
|
|
209
209
|
ordinal: BucketOrdinal.Mcp,
|
|
210
210
|
id: key,
|
|
211
|
-
label:
|
|
211
|
+
label: source.label,
|
|
212
212
|
checked: undefined,
|
|
213
213
|
collapsed,
|
|
214
214
|
children,
|
|
215
215
|
buttons,
|
|
216
|
+
sortOrder: 2,
|
|
216
217
|
};
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
bucket.iconPath =
|
|
218
|
+
const iconPath = mcpServer.serverMetadata.get()?.icons.getUrl(22);
|
|
219
|
+
if (iconPath) {
|
|
220
|
+
bucket.iconPath = iconPath;
|
|
220
221
|
}
|
|
221
222
|
else {
|
|
222
223
|
bucket.iconClass = ThemeIcon.asClassName(Codicon.mcp);
|
|
@@ -228,12 +229,13 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
228
229
|
itemType: 'bucket',
|
|
229
230
|
ordinal: BucketOrdinal.Extension,
|
|
230
231
|
id: key,
|
|
231
|
-
label:
|
|
232
|
+
label: source.label,
|
|
232
233
|
checked: undefined,
|
|
233
234
|
children: [],
|
|
234
235
|
buttons: [],
|
|
235
236
|
collapsed: true,
|
|
236
|
-
iconClass: ThemeIcon.asClassName(Codicon.extensions)
|
|
237
|
+
iconClass: ThemeIcon.asClassName(Codicon.extensions),
|
|
238
|
+
sortOrder: 3,
|
|
237
239
|
};
|
|
238
240
|
}
|
|
239
241
|
else if (source.type === 'internal') {
|
|
@@ -241,11 +243,12 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
241
243
|
itemType: 'bucket',
|
|
242
244
|
ordinal: BucketOrdinal.BuiltIn,
|
|
243
245
|
id: key,
|
|
244
|
-
label: ( localize(
|
|
246
|
+
label: ( localize(4779, "Built-In")),
|
|
245
247
|
checked: undefined,
|
|
246
248
|
children: [],
|
|
247
249
|
buttons: [],
|
|
248
|
-
collapsed: false
|
|
250
|
+
collapsed: false,
|
|
251
|
+
sortOrder: 1,
|
|
249
252
|
};
|
|
250
253
|
}
|
|
251
254
|
else {
|
|
@@ -253,11 +256,12 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
253
256
|
itemType: 'bucket',
|
|
254
257
|
ordinal: BucketOrdinal.User,
|
|
255
258
|
id: key,
|
|
256
|
-
label: ( localize(
|
|
259
|
+
label: ( localize(4780, "User Defined Tool Sets")),
|
|
257
260
|
checked: undefined,
|
|
258
261
|
children: [],
|
|
259
262
|
buttons: [],
|
|
260
|
-
collapsed: true
|
|
263
|
+
collapsed: true,
|
|
264
|
+
sortOrder: 4,
|
|
261
265
|
};
|
|
262
266
|
}
|
|
263
267
|
};
|
|
@@ -319,10 +323,23 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
319
323
|
getBucket({ type: 'mcp', definitionId: server.definition.id, label: server.definition.label, instructions: '', serverLabel: '', collectionId: server.collection.id });
|
|
320
324
|
}
|
|
321
325
|
}
|
|
322
|
-
const sortedBuckets = Array.from(( bucketMap.values())).sort((a, b) =>
|
|
323
|
-
|
|
326
|
+
const sortedBuckets = Array.from(( bucketMap.values())).sort((a, b) => {
|
|
327
|
+
if (a.sortOrder !== b.sortOrder) {
|
|
328
|
+
return a.sortOrder - b.sortOrder;
|
|
329
|
+
}
|
|
330
|
+
return a.label.localeCompare(b.label);
|
|
331
|
+
});
|
|
332
|
+
for (const bucket of sortedBuckets) {
|
|
333
|
+
treeItems.push(bucket);
|
|
334
|
+
bucket.children.sort((a, b) => a.label.localeCompare(b.label));
|
|
335
|
+
for (const child of bucket.children) {
|
|
336
|
+
if (isToolSetTreeItem(child) && child.children) {
|
|
337
|
+
child.children.sort((a, b) => a.label.localeCompare(b.label));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
324
341
|
if (treeItems.length === 0) {
|
|
325
|
-
treePicker.placeholder = ( localize(
|
|
342
|
+
treePicker.placeholder = ( localize(4781, "Add tools to chat"));
|
|
326
343
|
}
|
|
327
344
|
else {
|
|
328
345
|
treePicker.placeholder = placeHolder;
|
|
@@ -336,6 +353,7 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
336
353
|
treePicker.description = description;
|
|
337
354
|
treePicker.matchOnDescription = true;
|
|
338
355
|
treePicker.matchOnLabel = true;
|
|
356
|
+
treePicker.sortByLabel = false;
|
|
339
357
|
computeItems();
|
|
340
358
|
store.add(treePicker.onDidTriggerItemButton(e => {
|
|
341
359
|
if (e.button && typeof e.button.action === 'function') {
|
|
@@ -362,7 +380,7 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
362
380
|
if (count > toolLimit) {
|
|
363
381
|
treePicker.severity = Severity.Warning;
|
|
364
382
|
treePicker.validationMessage = ( localize(
|
|
365
|
-
|
|
383
|
+
4782,
|
|
366
384
|
"{0} tools are enabled. You may experience degraded tool calling above {1} tools.",
|
|
367
385
|
count,
|
|
368
386
|
markdownCommandLink({ title: String(toolLimit), id: '_chat.toolPicker.closeAndOpenVirtualThreshold' })
|
|
@@ -425,17 +443,17 @@ async function showToolsPicker(accessor, placeHolder, description, getToolsEntri
|
|
|
425
443
|
}));
|
|
426
444
|
const addMcpServerButton = {
|
|
427
445
|
iconClass: ThemeIcon.asClassName(Codicon.mcp),
|
|
428
|
-
tooltip: ( localize(
|
|
446
|
+
tooltip: ( localize(4783, 'Add MCP Server...'))
|
|
429
447
|
};
|
|
430
448
|
const installExtension = {
|
|
431
449
|
iconClass: ThemeIcon.asClassName(Codicon.extensions),
|
|
432
|
-
tooltip: ( localize(
|
|
450
|
+
tooltip: ( localize(4784, 'Install Extension...'))
|
|
433
451
|
};
|
|
434
452
|
const configureToolSets = {
|
|
435
453
|
iconClass: ThemeIcon.asClassName(Codicon.gear),
|
|
436
|
-
tooltip: ( localize(
|
|
454
|
+
tooltip: ( localize(4785, 'Configure Tool Sets...'))
|
|
437
455
|
};
|
|
438
|
-
treePicker.title = ( localize(
|
|
456
|
+
treePicker.title = ( localize(4786, "Configure Tools"));
|
|
439
457
|
treePicker.buttons = [addMcpServerButton, installExtension, configureToolSets];
|
|
440
458
|
store.add(treePicker.onDidTriggerButton(button => {
|
|
441
459
|
if (button === addMcpServerButton) {
|
|
@@ -14,7 +14,7 @@ import { IAiEditTelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/
|
|
|
14
14
|
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
15
15
|
import { ICodeMapperService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatCodeMapperService.service";
|
|
16
16
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
17
|
-
import { ICodeBlockActionContext } from "@codingame/monaco-vscode-
|
|
17
|
+
import { ICodeBlockActionContext } from "@codingame/monaco-vscode-a793b3ee-7ba9-5176-a019-30ec806fdd95-common/vscode/vs/workbench/contrib/chat/browser/codeBlockPart";
|
|
18
18
|
export declare class InsertCodeBlockOperation {
|
|
19
19
|
private readonly editorService;
|
|
20
20
|
private readonly textFileService;
|
|
@@ -28,12 +28,13 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
28
28
|
import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
29
29
|
import { IAiEditTelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryService.service';
|
|
30
30
|
import { reviewEdits, reviewNotebookEdits } from '@codingame/monaco-vscode-a793b3ee-7ba9-5176-a019-30ec806fdd95-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
31
|
-
import { insertCell } from '@codingame/monaco-vscode-
|
|
31
|
+
import { insertCell } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/controller/cellOperations';
|
|
32
32
|
import { CellKind, NOTEBOOK_EDITOR_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
33
33
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
34
34
|
import { ICodeMapperService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatCodeMapperService.service';
|
|
35
35
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
36
|
-
import {
|
|
36
|
+
import { chatSessionResourceToId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatUri';
|
|
37
|
+
import { isResponseVM, isRequestVM } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
37
38
|
|
|
38
39
|
let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
39
40
|
constructor(editorService, textFileService, bulkEditService, codeEditorService, chatService, languageService, dialogService, aiEditTelemetryService) {
|
|
@@ -58,7 +59,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
58
59
|
}
|
|
59
60
|
else {
|
|
60
61
|
this.notify(( localize(
|
|
61
|
-
|
|
62
|
+
4787,
|
|
62
63
|
"To insert the code block, open a code editor or notebook editor and set the cursor at the location where to insert the code block."
|
|
63
64
|
)));
|
|
64
65
|
}
|
|
@@ -91,7 +92,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
91
92
|
}
|
|
92
93
|
async handleNotebookEditor(notebookEditor, codeBlockContext) {
|
|
93
94
|
if (notebookEditor.isReadOnly) {
|
|
94
|
-
this.notify(( localize(
|
|
95
|
+
this.notify(( localize(4788, "Cannot insert the code block to read-only notebook editor.")));
|
|
95
96
|
return false;
|
|
96
97
|
}
|
|
97
98
|
const focusRange = notebookEditor.getFocus();
|
|
@@ -102,7 +103,7 @@ let InsertCodeBlockOperation = class InsertCodeBlockOperation {
|
|
|
102
103
|
async handleTextEditor(codeEditor, codeBlockContext) {
|
|
103
104
|
const activeModel = codeEditor.getModel();
|
|
104
105
|
if (isReadOnly(activeModel, this.textFileService)) {
|
|
105
|
-
this.notify(( localize(
|
|
106
|
+
this.notify(( localize(4789, "Cannot insert the code block to read-only code editor.")));
|
|
106
107
|
return false;
|
|
107
108
|
}
|
|
108
109
|
const range = codeEditor.getSelection() ?? ( new Range(activeModel.getLineCount(), 1, activeModel.getLineCount(), 1));
|
|
@@ -156,7 +157,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
156
157
|
activeEditorControl = codeEditor;
|
|
157
158
|
}
|
|
158
159
|
else {
|
|
159
|
-
this.notify(( localize(
|
|
160
|
+
this.notify(( localize(4790, "Failed to open {0} in a code editor.", (codemapperUri.toString()))));
|
|
160
161
|
return;
|
|
161
162
|
}
|
|
162
163
|
}
|
|
@@ -174,15 +175,15 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
174
175
|
}
|
|
175
176
|
let result = undefined;
|
|
176
177
|
if (activeEditorControl && !this.notebookService.hasSupportedNotebooks(codemapperUri)) {
|
|
177
|
-
result = await this.handleTextEditor(activeEditorControl, context.
|
|
178
|
+
result = await this.handleTextEditor(activeEditorControl, context.chatSessionResource, context.code, codeBlockSuggestionId);
|
|
178
179
|
}
|
|
179
180
|
else {
|
|
180
181
|
const activeNotebookEditor = getActiveNotebookEditor(this.editorService);
|
|
181
182
|
if (activeNotebookEditor) {
|
|
182
|
-
result = await this.handleNotebookEditor(activeNotebookEditor, context.
|
|
183
|
+
result = await this.handleNotebookEditor(activeNotebookEditor, context.chatSessionResource, context.code);
|
|
183
184
|
}
|
|
184
185
|
else {
|
|
185
|
-
this.notify(( localize(
|
|
186
|
+
this.notify(( localize(4791, "To apply this code block, open a code or notebook editor.")));
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
if (isResponseVM(context.element)) {
|
|
@@ -205,15 +206,15 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
205
206
|
return resource;
|
|
206
207
|
}
|
|
207
208
|
const activeEditorOption = activeEditorControl?.getModel().uri ? { label: ( localize(
|
|
208
|
-
|
|
209
|
+
4792,
|
|
209
210
|
"Active editor '{0}'",
|
|
210
211
|
this.labelService.getUriLabel(activeEditorControl.getModel().uri, { relative: true })
|
|
211
212
|
)), id: 'activeEditor' } : undefined;
|
|
212
|
-
const untitledEditorOption = { label: ( localize(
|
|
213
|
+
const untitledEditorOption = { label: ( localize(4793, "New untitled editor")), id: 'newUntitledFile' };
|
|
213
214
|
const options = [];
|
|
214
215
|
if (resource) {
|
|
215
216
|
options.push({ label: ( localize(
|
|
216
|
-
|
|
217
|
+
4794,
|
|
217
218
|
"New file '{0}'",
|
|
218
219
|
this.labelService.getUriLabel(resource, { relative: true })
|
|
219
220
|
)), id: 'createFile' });
|
|
@@ -228,7 +229,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
228
229
|
}
|
|
229
230
|
options.push(untitledEditorOption);
|
|
230
231
|
}
|
|
231
|
-
const selected = options.length > 1 ? await this.quickInputService.pick(options, { placeHolder: ( localize(
|
|
232
|
+
const selected = options.length > 1 ? await this.quickInputService.pick(options, { placeHolder: ( localize(4795, "Select where to apply the code block")) }) : options[0];
|
|
232
233
|
if (selected) {
|
|
233
234
|
switch (selected.id) {
|
|
234
235
|
case 'createFile':
|
|
@@ -237,7 +238,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
237
238
|
await this.fileService.writeFile(resource, VSBuffer.fromString(''));
|
|
238
239
|
}
|
|
239
240
|
catch (error) {
|
|
240
|
-
this.notify(( localize(
|
|
241
|
+
this.notify(( localize(4796, "Failed to create file: {0}", error.message)));
|
|
241
242
|
return ( URI.from({ scheme: 'untitled', path: resource.path }));
|
|
242
243
|
}
|
|
243
244
|
}
|
|
@@ -250,31 +251,31 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
250
251
|
}
|
|
251
252
|
return undefined;
|
|
252
253
|
}
|
|
253
|
-
async handleNotebookEditor(notebookEditor,
|
|
254
|
+
async handleNotebookEditor(notebookEditor, chatSessionResource, code) {
|
|
254
255
|
if (notebookEditor.isReadOnly) {
|
|
255
|
-
this.notify(( localize(
|
|
256
|
+
this.notify(( localize(4797, "Cannot apply code block to read-only notebook editor.")));
|
|
256
257
|
return undefined;
|
|
257
258
|
}
|
|
258
259
|
const uri = notebookEditor.textModel.uri;
|
|
259
260
|
const codeBlock = { code, resource: uri, markdownBeforeBlock: undefined };
|
|
260
261
|
const codeMapper = this.codeMapperService.providers[0]?.displayName;
|
|
261
262
|
if (!codeMapper) {
|
|
262
|
-
this.notify(( localize(
|
|
263
|
+
this.notify(( localize(4798, "No code mapper available.")));
|
|
263
264
|
return undefined;
|
|
264
265
|
}
|
|
265
266
|
let editsProposed = false;
|
|
266
267
|
const cancellationTokenSource = ( new CancellationTokenSource());
|
|
267
268
|
try {
|
|
268
269
|
const iterable = await this.progressService.withProgress({ location: ProgressLocation.Notification, delay: 500, sticky: true, cancellable: true }, async (progress) => {
|
|
269
|
-
progress.report({ message: ( localize(
|
|
270
|
-
const editsIterable = this.getNotebookEdits(codeBlock,
|
|
270
|
+
progress.report({ message: ( localize(4799, "Applying code block using {0}...", codeMapper)) });
|
|
271
|
+
const editsIterable = this.getNotebookEdits(codeBlock, chatSessionResource, cancellationTokenSource.token);
|
|
271
272
|
return await this.waitForFirstElement(editsIterable);
|
|
272
273
|
}, () => cancellationTokenSource.cancel());
|
|
273
274
|
editsProposed = await this.applyNotebookEditsWithInlinePreview(iterable, uri, cancellationTokenSource);
|
|
274
275
|
}
|
|
275
276
|
catch (e) {
|
|
276
277
|
if (!isCancellationError(e)) {
|
|
277
|
-
this.notify(( localize(
|
|
278
|
+
this.notify(( localize(4800, "Failed to apply code block: {0}", e.message)));
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
281
|
finally {
|
|
@@ -285,31 +286,31 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
285
286
|
codeMapper
|
|
286
287
|
};
|
|
287
288
|
}
|
|
288
|
-
async handleTextEditor(codeEditor,
|
|
289
|
+
async handleTextEditor(codeEditor, chatSessionResource, code, applyCodeBlockSuggestionId) {
|
|
289
290
|
const activeModel = codeEditor.getModel();
|
|
290
291
|
if (isReadOnly(activeModel, this.textFileService)) {
|
|
291
|
-
this.notify(( localize(
|
|
292
|
+
this.notify(( localize(4801, "Cannot apply code block to read-only file.")));
|
|
292
293
|
return undefined;
|
|
293
294
|
}
|
|
294
|
-
const codeBlock = { code, resource: activeModel.uri,
|
|
295
|
+
const codeBlock = { code, resource: activeModel.uri, chatSessionResource, markdownBeforeBlock: undefined };
|
|
295
296
|
const codeMapper = this.codeMapperService.providers[0]?.displayName;
|
|
296
297
|
if (!codeMapper) {
|
|
297
|
-
this.notify(( localize(
|
|
298
|
+
this.notify(( localize(4798, "No code mapper available.")));
|
|
298
299
|
return undefined;
|
|
299
300
|
}
|
|
300
301
|
let editsProposed = false;
|
|
301
302
|
const cancellationTokenSource = ( new CancellationTokenSource());
|
|
302
303
|
try {
|
|
303
304
|
const iterable = await this.progressService.withProgress({ location: ProgressLocation.Notification, delay: 500, sticky: true, cancellable: true }, async (progress) => {
|
|
304
|
-
progress.report({ message: ( localize(
|
|
305
|
-
const editsIterable = this.getTextEdits(codeBlock,
|
|
305
|
+
progress.report({ message: ( localize(4799, "Applying code block using {0}...", codeMapper)) });
|
|
306
|
+
const editsIterable = this.getTextEdits(codeBlock, chatSessionResource, cancellationTokenSource.token);
|
|
306
307
|
return await this.waitForFirstElement(editsIterable);
|
|
307
308
|
}, () => cancellationTokenSource.cancel());
|
|
308
309
|
editsProposed = await this.applyWithInlinePreview(iterable, codeEditor, cancellationTokenSource, applyCodeBlockSuggestionId);
|
|
309
310
|
}
|
|
310
311
|
catch (e) {
|
|
311
312
|
if (!isCancellationError(e)) {
|
|
312
|
-
this.notify(( localize(
|
|
313
|
+
this.notify(( localize(4800, "Failed to apply code block: {0}", e.message)));
|
|
313
314
|
}
|
|
314
315
|
}
|
|
315
316
|
finally {
|
|
@@ -320,11 +321,11 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
320
321
|
codeMapper
|
|
321
322
|
};
|
|
322
323
|
}
|
|
323
|
-
getTextEdits(codeBlock,
|
|
324
|
+
getTextEdits(codeBlock, chatSessionResource, token) {
|
|
324
325
|
return ( new AsyncIterableObject(async (executor) => {
|
|
325
326
|
const request = {
|
|
326
327
|
codeBlocks: [codeBlock],
|
|
327
|
-
chatSessionId
|
|
328
|
+
chatSessionId: chatSessionResource && chatSessionResourceToId(chatSessionResource),
|
|
328
329
|
};
|
|
329
330
|
const response = {
|
|
330
331
|
textEdit: (target, edit) => {
|
|
@@ -339,11 +340,11 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
|
|
|
339
340
|
}
|
|
340
341
|
}));
|
|
341
342
|
}
|
|
342
|
-
getNotebookEdits(codeBlock,
|
|
343
|
+
getNotebookEdits(codeBlock, chatSessionResource, token) {
|
|
343
344
|
return ( new AsyncIterableObject(async (executor) => {
|
|
344
345
|
const request = {
|
|
345
346
|
codeBlocks: [codeBlock],
|
|
346
|
-
chatSessionId,
|
|
347
|
+
chatSessionId: chatSessionResource && chatSessionResourceToId(chatSessionResource),
|
|
347
348
|
location: 'panel'
|
|
348
349
|
};
|
|
349
350
|
const response = {
|
|
@@ -417,7 +418,7 @@ function notifyUserAction(chatService, context, action) {
|
|
|
417
418
|
chatService.notifyUserAction({
|
|
418
419
|
agentId: context.element.agent?.id,
|
|
419
420
|
command: context.element.slashCommand?.name,
|
|
420
|
-
|
|
421
|
+
sessionResource: context.element.sessionResource,
|
|
421
422
|
requestId: context.element.requestId,
|
|
422
423
|
result: context.element.result,
|
|
423
424
|
action
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
+
import { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
|
|
3
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { ThemeIcon } from "@codingame/monaco-vscode-api/vscode/vs/base/common/themables";
|
|
5
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
6
|
+
import { ILifecycleService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service";
|
|
7
|
+
import { ChatSessionStatus, IChatSessionItemProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
|
|
8
|
+
import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
|
|
9
|
+
export interface IAgentSessionsViewModel {
|
|
10
|
+
readonly onWillResolve: Event<void>;
|
|
11
|
+
readonly onDidResolve: Event<void>;
|
|
12
|
+
readonly onDidChangeSessions: Event<void>;
|
|
13
|
+
readonly sessions: IAgentSessionViewModel[];
|
|
14
|
+
resolve(provider: string | string[] | undefined): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface IAgentSessionViewModel {
|
|
17
|
+
readonly provider: IChatSessionItemProvider;
|
|
18
|
+
readonly providerLabel: string;
|
|
19
|
+
readonly resource: URI;
|
|
20
|
+
readonly status?: ChatSessionStatus;
|
|
21
|
+
readonly tooltip?: string | IMarkdownString;
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly description: string | IMarkdownString;
|
|
24
|
+
readonly icon: ThemeIcon;
|
|
25
|
+
readonly timing: {
|
|
26
|
+
readonly startTime: number;
|
|
27
|
+
readonly endTime?: number;
|
|
28
|
+
};
|
|
29
|
+
readonly statistics?: {
|
|
30
|
+
readonly insertions: number;
|
|
31
|
+
readonly deletions: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export declare function isLocalAgentSessionItem(session: IAgentSessionViewModel): boolean;
|
|
35
|
+
export declare function isAgentSession(obj: IAgentSessionsViewModel | IAgentSessionViewModel): obj is IAgentSessionViewModel;
|
|
36
|
+
export declare function isAgentSessionsViewModel(obj: IAgentSessionsViewModel | IAgentSessionViewModel): obj is IAgentSessionsViewModel;
|
|
37
|
+
export declare class AgentSessionsViewModel extends Disposable implements IAgentSessionsViewModel {
|
|
38
|
+
private readonly chatSessionsService;
|
|
39
|
+
private readonly lifecycleService;
|
|
40
|
+
readonly sessions: IAgentSessionViewModel[];
|
|
41
|
+
private readonly _onWillResolve;
|
|
42
|
+
readonly onWillResolve: Event<void>;
|
|
43
|
+
private readonly _onDidResolve;
|
|
44
|
+
readonly onDidResolve: Event<void>;
|
|
45
|
+
private readonly _onDidChangeSessions;
|
|
46
|
+
readonly onDidChangeSessions: Event<void>;
|
|
47
|
+
private readonly resolver;
|
|
48
|
+
private readonly providersToResolve;
|
|
49
|
+
constructor(chatSessionsService: IChatSessionsService, lifecycleService: ILifecycleService);
|
|
50
|
+
private registerListeners;
|
|
51
|
+
resolve(provider: string | string[] | undefined): Promise<void>;
|
|
52
|
+
private doResolve;
|
|
53
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { ThrottledDelayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
5
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
8
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
9
|
+
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
10
|
+
import { localChatSessionType, ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
11
|
+
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
12
|
+
import { AgentSessionProviders } from './agentSessions.js';
|
|
13
|
+
|
|
14
|
+
function isLocalAgentSessionItem(session) {
|
|
15
|
+
return session.provider.chatSessionType === localChatSessionType;
|
|
16
|
+
}
|
|
17
|
+
function isAgentSession(obj) {
|
|
18
|
+
const session = obj;
|
|
19
|
+
return URI.isUri(session?.resource);
|
|
20
|
+
}
|
|
21
|
+
function isAgentSessionsViewModel(obj) {
|
|
22
|
+
const sessionsViewModel = obj;
|
|
23
|
+
return Array.isArray(sessionsViewModel?.sessions);
|
|
24
|
+
}
|
|
25
|
+
let AgentSessionsViewModel = class AgentSessionsViewModel extends Disposable {
|
|
26
|
+
constructor(chatSessionsService, lifecycleService) {
|
|
27
|
+
super();
|
|
28
|
+
this.chatSessionsService = chatSessionsService;
|
|
29
|
+
this.lifecycleService = lifecycleService;
|
|
30
|
+
this.sessions = [];
|
|
31
|
+
this._onWillResolve = this._register(( new Emitter()));
|
|
32
|
+
this.onWillResolve = this._onWillResolve.event;
|
|
33
|
+
this._onDidResolve = this._register(( new Emitter()));
|
|
34
|
+
this.onDidResolve = this._onDidResolve.event;
|
|
35
|
+
this._onDidChangeSessions = this._register(( new Emitter()));
|
|
36
|
+
this.onDidChangeSessions = this._onDidChangeSessions.event;
|
|
37
|
+
this.resolver = this._register(( new ThrottledDelayer(100)));
|
|
38
|
+
this.providersToResolve = ( new Set());
|
|
39
|
+
this.registerListeners();
|
|
40
|
+
this.resolve(undefined);
|
|
41
|
+
}
|
|
42
|
+
registerListeners() {
|
|
43
|
+
this._register(this.chatSessionsService.onDidChangeItemsProviders(({ chatSessionType: provider }) => this.resolve(provider)));
|
|
44
|
+
this._register(this.chatSessionsService.onDidChangeAvailability(() => this.resolve(undefined)));
|
|
45
|
+
this._register(this.chatSessionsService.onDidChangeSessionItems(provider => this.resolve(provider)));
|
|
46
|
+
}
|
|
47
|
+
async resolve(provider) {
|
|
48
|
+
if (Array.isArray(provider)) {
|
|
49
|
+
for (const p of provider) {
|
|
50
|
+
this.providersToResolve.add(p);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.providersToResolve.add(provider);
|
|
55
|
+
}
|
|
56
|
+
return this.resolver.trigger(async (token) => {
|
|
57
|
+
if (token.isCancellationRequested || this.lifecycleService.willShutdown) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
this._onWillResolve.fire();
|
|
62
|
+
return await this.doResolve(token);
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
this._onDidResolve.fire();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async doResolve(token) {
|
|
70
|
+
const providersToResolve = Array.from(this.providersToResolve);
|
|
71
|
+
this.providersToResolve.clear();
|
|
72
|
+
const mapSessionContributionToType = ( new Map());
|
|
73
|
+
for (const contribution of this.chatSessionsService.getAllChatSessionContributions()) {
|
|
74
|
+
mapSessionContributionToType.set(contribution.type, contribution);
|
|
75
|
+
}
|
|
76
|
+
const newSessions = [];
|
|
77
|
+
for (const provider of this.chatSessionsService.getAllChatSessionItemProviders()) {
|
|
78
|
+
if (!providersToResolve.includes(undefined) && !providersToResolve.includes(provider.chatSessionType)) {
|
|
79
|
+
newSessions.push(...this.sessions.filter(session => session.provider.chatSessionType === provider.chatSessionType));
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const sessions = await provider.provideChatSessionItems(token);
|
|
83
|
+
if (token.isCancellationRequested) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
for (const session of sessions) {
|
|
87
|
+
if (session.id === 'show-history' || session.id === 'workbench.panel.chat.view.copilot') {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
let description;
|
|
91
|
+
if (session.description) {
|
|
92
|
+
description = session.description;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
switch (session.status) {
|
|
96
|
+
case ChatSessionStatus.InProgress:
|
|
97
|
+
description = ( localize(4803, "Working..."));
|
|
98
|
+
break;
|
|
99
|
+
case ChatSessionStatus.Failed:
|
|
100
|
+
description = ( localize(4804, "Failed"));
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
description = ( localize(4805, "Finished"));
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
let icon;
|
|
108
|
+
let providerLabel;
|
|
109
|
+
switch ((provider.chatSessionType)) {
|
|
110
|
+
case localChatSessionType:
|
|
111
|
+
providerLabel = ( localize(4806, "Local"));
|
|
112
|
+
icon = Codicon.window;
|
|
113
|
+
break;
|
|
114
|
+
case AgentSessionProviders.Background:
|
|
115
|
+
providerLabel = ( localize(4807, "Background"));
|
|
116
|
+
icon = Codicon.layers;
|
|
117
|
+
break;
|
|
118
|
+
case AgentSessionProviders.Cloud:
|
|
119
|
+
providerLabel = ( localize(4808, "Cloud"));
|
|
120
|
+
icon = Codicon.cloud;
|
|
121
|
+
break;
|
|
122
|
+
default: {
|
|
123
|
+
providerLabel = mapSessionContributionToType.get(provider.chatSessionType)?.name ?? provider.chatSessionType;
|
|
124
|
+
icon = session.iconPath ?? Codicon.terminal;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
newSessions.push({
|
|
128
|
+
provider,
|
|
129
|
+
providerLabel,
|
|
130
|
+
resource: session.resource,
|
|
131
|
+
label: session.label,
|
|
132
|
+
description,
|
|
133
|
+
icon,
|
|
134
|
+
tooltip: session.tooltip,
|
|
135
|
+
status: session.status,
|
|
136
|
+
timing: {
|
|
137
|
+
startTime: session.timing.startTime,
|
|
138
|
+
endTime: session.timing.endTime
|
|
139
|
+
},
|
|
140
|
+
statistics: session.statistics
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
this.sessions.length = 0;
|
|
145
|
+
this.sessions.push(...newSessions);
|
|
146
|
+
this._onDidChangeSessions.fire();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
AgentSessionsViewModel = ( __decorate([
|
|
150
|
+
( __param(0, IChatSessionsService)),
|
|
151
|
+
( __param(1, ILifecycleService))
|
|
152
|
+
], AgentSessionsViewModel));
|
|
153
|
+
|
|
154
|
+
export { AgentSessionsViewModel, isAgentSession, isAgentSessionsViewModel, isLocalAgentSessionItem };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const AGENT_SESSIONS_VIEW_CONTAINER_ID = "workbench.viewContainer.agentSessions";
|
|
2
|
+
export declare const AGENT_SESSIONS_VIEW_ID = "workbench.view.agentSessions";
|
|
3
|
+
export declare enum AgentSessionProviders {
|
|
4
|
+
Local = "local",
|
|
5
|
+
Background = "copilotcli",
|
|
6
|
+
Cloud = "copilot-cloud-agent"
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
3
|
+
|
|
4
|
+
const AGENT_SESSIONS_VIEW_CONTAINER_ID = 'workbench.viewContainer.agentSessions';
|
|
5
|
+
const AGENT_SESSIONS_VIEW_ID = 'workbench.view.agentSessions';
|
|
6
|
+
var AgentSessionProviders;
|
|
7
|
+
(function (AgentSessionProviders) {
|
|
8
|
+
AgentSessionProviders["Local"] = "local";
|
|
9
|
+
AgentSessionProviders["Background"] = "copilotcli";
|
|
10
|
+
AgentSessionProviders["Cloud"] = "copilot-cloud-agent";
|
|
11
|
+
})(AgentSessionProviders || (AgentSessionProviders = {}));
|
|
12
|
+
|
|
13
|
+
export { AGENT_SESSIONS_VIEW_CONTAINER_ID, AGENT_SESSIONS_VIEW_ID, AgentSessionProviders };
|