@codingame/monaco-vscode-chat-service-override 19.1.4 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +20 -8
- package/package.json +36 -31
- package/vscode/src/vs/base/common/policy.d.ts +14 -0
- package/vscode/src/vs/base/common/policy.js +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +53 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +54 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +37 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +23 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +83 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +421 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +215 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +18 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +11 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +16 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +7 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +58 -326
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +33 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +39 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +380 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +44 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +145 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +36 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +407 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.js +738 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +142 -151
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +54 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +23 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +13 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/media/apple-dark.svg +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/apple-light.svg +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.js +52 -90
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +137 -30
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +44 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/configMigration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/filePromptContentsProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/promptContentsProviderBase.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/promptContentsProviderBase.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderDiagnosticsProvider.js +3 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderHovers.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkDiagnosticsProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptPathAutocompletion.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/providerInstanceManagerBase.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/headerBase.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/instructionsHeader.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/applyTo.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/enum.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/string.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/tools.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/modeHeader.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/promptHeader.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/promptHeader.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/topError.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +9 -9
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +104 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +667 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +14 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css +56 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +111 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +262 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +129 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.js +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +30 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +72 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +411 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +59 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/bufferOutputPolling.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/bufferOutputPolling.js +163 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +164 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +101 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +71 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +94 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/getTerminalOutputTool.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/getTerminalOutputTool.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +13 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.js +603 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +113 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/createAndRunTaskTool.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/createAndRunTaskTool.js +227 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/getTaskOutputTool.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/getTaskOutputTool.js +88 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/runTaskTool.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/runTaskTool.js +140 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.js +80 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task.chatAgentTools.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task.chatAgentTools.contribution.js +40 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/google-mono-dark.svg +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/media/google-mono-light.svg +0 -3
|
@@ -0,0 +1,738 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
+
import * as chatSessions from './media/chatSessions.css';
|
|
5
|
+
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
8
|
+
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
9
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
11
|
+
import { IProgressService } from '@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress.service';
|
|
12
|
+
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
13
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
14
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
15
|
+
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
16
|
+
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
17
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
18
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
19
|
+
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
20
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
21
|
+
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
22
|
+
import { ViewPaneContainer } from '@codingame/monaco-vscode-a8d3bd74-e63e-5327-96e8-4f931661e329-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
23
|
+
import { ViewPane } from '@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
24
|
+
import { Extensions, ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
25
|
+
import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
|
|
26
|
+
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
27
|
+
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
28
|
+
import { WorkbenchAsyncDataTree } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
|
|
29
|
+
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
30
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
31
|
+
import { ResourceLabels } from '@codingame/monaco-vscode-d941ac7b-412f-57e3-b1bf-f6b0eb253b21-common/vscode/vs/workbench/browser/labels';
|
|
32
|
+
import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
33
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
34
|
+
import { getActiveWindow, append, $, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
35
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
36
|
+
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
37
|
+
import { GroupModelChangeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
38
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
39
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
40
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
41
|
+
import { ChatEditorInput } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
42
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
43
|
+
import { ChatConfiguration, ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
44
|
+
import { MenuRegistry, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
45
|
+
import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/iconRegistry';
|
|
46
|
+
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
47
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
48
|
+
import { ChatSessionUri } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/common/chatUri';
|
|
49
|
+
|
|
50
|
+
var LocalChatSessionsProvider_1, SessionsRenderer_1;
|
|
51
|
+
registerCss(chatSessions);
|
|
52
|
+
const VIEWLET_ID = 'workbench.view.chat.sessions';
|
|
53
|
+
let ChatSessionsView = class ChatSessionsView extends Disposable {
|
|
54
|
+
static { this.ID = 'workbench.contrib.chatSessions'; }
|
|
55
|
+
constructor(configurationService) {
|
|
56
|
+
super();
|
|
57
|
+
this.configurationService = configurationService;
|
|
58
|
+
this.isViewContainerRegistered = false;
|
|
59
|
+
this.updateViewContainerRegistration();
|
|
60
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
61
|
+
if (e.affectsConfiguration(ChatConfiguration.AgentSessionsViewLocation)) {
|
|
62
|
+
this.updateViewContainerRegistration();
|
|
63
|
+
}
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
updateViewContainerRegistration() {
|
|
67
|
+
const location = this.configurationService.getValue(ChatConfiguration.AgentSessionsViewLocation);
|
|
68
|
+
if (location === 'view' && !this.isViewContainerRegistered) {
|
|
69
|
+
this.registerViewContainer();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
registerViewContainer() {
|
|
73
|
+
if (this.isViewContainerRegistered) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
|
|
77
|
+
id: VIEWLET_ID,
|
|
78
|
+
title: ( localize2(5080, "Chat Sessions")),
|
|
79
|
+
ctorDescriptor: ( new SyncDescriptor(ChatSessionsViewPaneContainer)),
|
|
80
|
+
hideIfEmpty: false,
|
|
81
|
+
icon: registerIcon('chat-sessions-icon', Codicon.commentDiscussion, 'Icon for Chat Sessions View'),
|
|
82
|
+
order: 10
|
|
83
|
+
}, ViewContainerLocation.Sidebar);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
ChatSessionsView = ( __decorate([
|
|
87
|
+
( __param(0, IConfigurationService))
|
|
88
|
+
], ChatSessionsView));
|
|
89
|
+
let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposable {
|
|
90
|
+
static { LocalChatSessionsProvider_1 = this; }
|
|
91
|
+
static { this.CHAT_WIDGET_VIEW_ID = 'workbench.panel.chat.view.copilot'; }
|
|
92
|
+
constructor(editorGroupService, chatWidgetService) {
|
|
93
|
+
super();
|
|
94
|
+
this.editorGroupService = editorGroupService;
|
|
95
|
+
this.chatWidgetService = chatWidgetService;
|
|
96
|
+
this.chatSessionType = 'local';
|
|
97
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
98
|
+
this.onDidChange = this._onDidChange.event;
|
|
99
|
+
this.currentEditorSet = ( new Set());
|
|
100
|
+
this.editorOrder = [];
|
|
101
|
+
this.initializeCurrentEditorSet();
|
|
102
|
+
this.registerEditorListeners();
|
|
103
|
+
this.registerWidgetListeners();
|
|
104
|
+
}
|
|
105
|
+
registerWidgetListeners() {
|
|
106
|
+
this._register(this.chatWidgetService.onDidAddWidget(widget => {
|
|
107
|
+
if (widget.location === ChatAgentLocation.Panel &&
|
|
108
|
+
typeof widget.viewContext === 'object' &&
|
|
109
|
+
'viewId' in widget.viewContext &&
|
|
110
|
+
widget.viewContext.viewId === LocalChatSessionsProvider_1.CHAT_WIDGET_VIEW_ID) {
|
|
111
|
+
this._onDidChange.fire();
|
|
112
|
+
this._register(widget.onDidChangeViewModel(() => {
|
|
113
|
+
this._onDidChange.fire();
|
|
114
|
+
}));
|
|
115
|
+
this.registerModelTitleListener(widget);
|
|
116
|
+
}
|
|
117
|
+
}));
|
|
118
|
+
const existingWidgets = this.chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Panel)
|
|
119
|
+
.filter(widget => typeof widget.viewContext === 'object' && 'viewId' in widget.viewContext && widget.viewContext.viewId === LocalChatSessionsProvider_1.CHAT_WIDGET_VIEW_ID);
|
|
120
|
+
existingWidgets.forEach(widget => {
|
|
121
|
+
this._register(widget.onDidChangeViewModel(() => {
|
|
122
|
+
this._onDidChange.fire();
|
|
123
|
+
this.registerModelTitleListener(widget);
|
|
124
|
+
}));
|
|
125
|
+
this.registerModelTitleListener(widget);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
registerModelTitleListener(widget) {
|
|
129
|
+
const model = widget.viewModel?.model;
|
|
130
|
+
if (model) {
|
|
131
|
+
this._register(model.onDidChange(() => {
|
|
132
|
+
this._onDidChange.fire();
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
initializeCurrentEditorSet() {
|
|
137
|
+
this.currentEditorSet.clear();
|
|
138
|
+
this.editorOrder = [];
|
|
139
|
+
this.editorGroupService.groups.forEach(group => {
|
|
140
|
+
group.editors.forEach(editor => {
|
|
141
|
+
if (this.isLocalChatSession(editor)) {
|
|
142
|
+
const key = this.getEditorKey(editor, group);
|
|
143
|
+
this.currentEditorSet.add(key);
|
|
144
|
+
this.editorOrder.push(key);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
getEditorKey(editor, group) {
|
|
150
|
+
return `${group.id}-${editor.typeId}-${editor.resource?.toString() || editor.getName()}`;
|
|
151
|
+
}
|
|
152
|
+
registerEditorListeners() {
|
|
153
|
+
this.editorGroupService.groups.forEach(group => this.registerGroupListeners(group));
|
|
154
|
+
this._register(this.editorGroupService.onDidAddGroup(group => {
|
|
155
|
+
this.registerGroupListeners(group);
|
|
156
|
+
this.initializeCurrentEditorSet();
|
|
157
|
+
this._onDidChange.fire();
|
|
158
|
+
}));
|
|
159
|
+
this._register(this.editorGroupService.onDidRemoveGroup(() => {
|
|
160
|
+
this.initializeCurrentEditorSet();
|
|
161
|
+
this._onDidChange.fire();
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
isLocalChatSession(editor) {
|
|
165
|
+
if (!(editor instanceof ChatEditorInput)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
return editor.resource?.scheme === 'vscode-chat-editor';
|
|
169
|
+
}
|
|
170
|
+
registerGroupListeners(group) {
|
|
171
|
+
this._register(group.onDidModelChange(e => {
|
|
172
|
+
if (!this.isLocalChatSession(e.editor)) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
switch (e.kind) {
|
|
176
|
+
case GroupModelChangeKind.EDITOR_OPEN:
|
|
177
|
+
if (e.editor) {
|
|
178
|
+
const editorKey = this.getEditorKey(e.editor, group);
|
|
179
|
+
if (!( this.currentEditorSet.has(editorKey))) {
|
|
180
|
+
this.currentEditorSet.add(editorKey);
|
|
181
|
+
this.editorOrder.push(editorKey);
|
|
182
|
+
this._onDidChange.fire();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case GroupModelChangeKind.EDITOR_CLOSE:
|
|
187
|
+
if (e.editor) {
|
|
188
|
+
const editorKey = this.getEditorKey(e.editor, group);
|
|
189
|
+
this.currentEditorSet.delete(editorKey);
|
|
190
|
+
const index = this.editorOrder.indexOf(editorKey);
|
|
191
|
+
if (index > -1) {
|
|
192
|
+
this.editorOrder.splice(index, 1);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
this._onDidChange.fire();
|
|
196
|
+
break;
|
|
197
|
+
case GroupModelChangeKind.EDITOR_MOVE:
|
|
198
|
+
this.currentEditorSet.clear();
|
|
199
|
+
this.editorGroupService.groups.forEach(group => {
|
|
200
|
+
group.editors.forEach(editor => {
|
|
201
|
+
const key = this.getEditorKey(editor, group);
|
|
202
|
+
this.currentEditorSet.add(key);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
this._onDidChange.fire();
|
|
206
|
+
break;
|
|
207
|
+
case GroupModelChangeKind.EDITOR_ACTIVE:
|
|
208
|
+
break;
|
|
209
|
+
case GroupModelChangeKind.EDITOR_LABEL:
|
|
210
|
+
this._onDidChange.fire();
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
async provideChatSessionItems(token) {
|
|
216
|
+
const sessions = [];
|
|
217
|
+
const editorMap = ( new Map());
|
|
218
|
+
this.editorGroupService.groups.forEach(group => {
|
|
219
|
+
group.editors.forEach(editor => {
|
|
220
|
+
if (editor instanceof ChatEditorInput) {
|
|
221
|
+
const key = this.getEditorKey(editor, group);
|
|
222
|
+
editorMap.set(key, { editor, group });
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
const chatWidget = this.chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Panel)
|
|
227
|
+
.find(widget => typeof widget.viewContext === 'object' && 'viewId' in widget.viewContext && widget.viewContext.viewId === LocalChatSessionsProvider_1.CHAT_WIDGET_VIEW_ID);
|
|
228
|
+
if (chatWidget) {
|
|
229
|
+
sessions.push({
|
|
230
|
+
id: LocalChatSessionsProvider_1.CHAT_WIDGET_VIEW_ID,
|
|
231
|
+
label: chatWidget.viewModel?.model.title || ( localize2(5081, "Chat")).value,
|
|
232
|
+
description: ( localize(5082, "Chat View")),
|
|
233
|
+
iconPath: Codicon.chatSparkle,
|
|
234
|
+
widget: chatWidget,
|
|
235
|
+
sessionType: 'widget'
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
this.editorOrder.forEach((editorKey, index) => {
|
|
239
|
+
const editorInfo = editorMap.get(editorKey);
|
|
240
|
+
if (editorInfo) {
|
|
241
|
+
const sessionId = `local-${editorInfo.group.id}-${index}`;
|
|
242
|
+
sessions.push({
|
|
243
|
+
id: sessionId,
|
|
244
|
+
label: editorInfo.editor.getName(),
|
|
245
|
+
iconPath: Codicon.commentDiscussion,
|
|
246
|
+
editor: editorInfo.editor,
|
|
247
|
+
group: editorInfo.group,
|
|
248
|
+
sessionType: 'editor'
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
return sessions;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
LocalChatSessionsProvider = LocalChatSessionsProvider_1 = ( __decorate([
|
|
256
|
+
( __param(0, IEditorGroupsService)),
|
|
257
|
+
( __param(1, IChatWidgetService))
|
|
258
|
+
], LocalChatSessionsProvider));
|
|
259
|
+
let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends ViewPaneContainer {
|
|
260
|
+
constructor(instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService, logService, chatSessionsService) {
|
|
261
|
+
super(VIEWLET_ID, {
|
|
262
|
+
mergeViewWithContainerWhenSingleView: false,
|
|
263
|
+
}, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService, logService);
|
|
264
|
+
this.chatSessionsService = chatSessionsService;
|
|
265
|
+
this.registeredViewDescriptors = ( new Map());
|
|
266
|
+
this.localProvider = this._register(this.instantiationService.createInstance(LocalChatSessionsProvider));
|
|
267
|
+
this._register(this.chatSessionsService.registerChatSessionItemProvider(this.localProvider));
|
|
268
|
+
this.updateViewRegistration();
|
|
269
|
+
this._register(this.chatSessionsService.onDidChangeItemsProviders(() => {
|
|
270
|
+
this.updateViewRegistration();
|
|
271
|
+
}));
|
|
272
|
+
this._register(this.chatSessionsService.onDidChangeSessionItems((chatSessionType) => {
|
|
273
|
+
this.refreshProviderTree(chatSessionType);
|
|
274
|
+
}));
|
|
275
|
+
this._register(this.chatSessionsService.onDidChangeAvailability(() => {
|
|
276
|
+
this.updateViewRegistration();
|
|
277
|
+
}));
|
|
278
|
+
}
|
|
279
|
+
getTitle() {
|
|
280
|
+
const title = ( localize(5083, "Chat Sessions"));
|
|
281
|
+
return title;
|
|
282
|
+
}
|
|
283
|
+
getAllChatSessionProviders() {
|
|
284
|
+
if (this.localProvider) {
|
|
285
|
+
return [this.localProvider, ...this.chatSessionsService.getChatSessionItemProviders()];
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
return this.chatSessionsService.getChatSessionItemProviders();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
refreshProviderTree(chatSessionType) {
|
|
292
|
+
const providers = this.getAllChatSessionProviders();
|
|
293
|
+
const targetProvider = providers.find(provider => provider.chatSessionType === chatSessionType);
|
|
294
|
+
if (targetProvider) {
|
|
295
|
+
const viewId = `${VIEWLET_ID}.${chatSessionType}`;
|
|
296
|
+
const view = this.getView(viewId);
|
|
297
|
+
if (view) {
|
|
298
|
+
view.refreshTree();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
async updateViewRegistration() {
|
|
303
|
+
const contributions = await this.chatSessionsService.getChatSessionContributions();
|
|
304
|
+
await Promise.all(( contributions.map(contrib => this.chatSessionsService.canResolveItemProvider(contrib.type))));
|
|
305
|
+
const currentProviders = this.getAllChatSessionProviders();
|
|
306
|
+
const currentProviderIds = ( new Set(( currentProviders.map(p => p.chatSessionType))));
|
|
307
|
+
const viewsToUnregister = [];
|
|
308
|
+
for (const [providerId, viewDescriptor] of this.registeredViewDescriptors.entries()) {
|
|
309
|
+
if (!( currentProviderIds.has(providerId))) {
|
|
310
|
+
viewsToUnregister.push(viewDescriptor);
|
|
311
|
+
this.registeredViewDescriptors.delete(providerId);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (viewsToUnregister.length > 0) {
|
|
315
|
+
const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(VIEWLET_ID);
|
|
316
|
+
if (container) {
|
|
317
|
+
( Registry.as(Extensions.ViewsRegistry)).deregisterViews(viewsToUnregister, container);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
this.registerViews(contributions);
|
|
321
|
+
}
|
|
322
|
+
async registerViews(extensionPointContributions) {
|
|
323
|
+
const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(VIEWLET_ID);
|
|
324
|
+
const providers = this.getAllChatSessionProviders();
|
|
325
|
+
if (container && providers.length > 0) {
|
|
326
|
+
const viewDescriptorsToRegister = [];
|
|
327
|
+
let index = 1;
|
|
328
|
+
providers.forEach(provider => {
|
|
329
|
+
if (!( this.registeredViewDescriptors.has(provider.chatSessionType))) {
|
|
330
|
+
let displayName = '';
|
|
331
|
+
if (provider.chatSessionType === 'local') {
|
|
332
|
+
displayName = 'Local Chat Sessions';
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
const extContribution = extensionPointContributions.find(c => c.type === provider.chatSessionType);
|
|
336
|
+
if (!extContribution) {
|
|
337
|
+
this.logService.warn(`No extension contribution found for chat session type: ${provider.chatSessionType}`);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
displayName = extContribution.displayName;
|
|
341
|
+
}
|
|
342
|
+
const viewDescriptor = {
|
|
343
|
+
id: `${VIEWLET_ID}.${provider.chatSessionType}`,
|
|
344
|
+
name: {
|
|
345
|
+
value: displayName,
|
|
346
|
+
original: displayName,
|
|
347
|
+
},
|
|
348
|
+
ctorDescriptor: ( new SyncDescriptor(SessionsViewPane, [provider])),
|
|
349
|
+
canToggleVisibility: true,
|
|
350
|
+
canMoveView: true,
|
|
351
|
+
order: provider.chatSessionType === 'local' ? 0 : index++,
|
|
352
|
+
};
|
|
353
|
+
viewDescriptorsToRegister.push(viewDescriptor);
|
|
354
|
+
this.registeredViewDescriptors.set(provider.chatSessionType, viewDescriptor);
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
if (viewDescriptorsToRegister.length > 0) {
|
|
358
|
+
( Registry.as(Extensions.ViewsRegistry)).registerViews(viewDescriptorsToRegister, container);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
dispose() {
|
|
363
|
+
if (this.registeredViewDescriptors.size > 0) {
|
|
364
|
+
const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(VIEWLET_ID);
|
|
365
|
+
if (container) {
|
|
366
|
+
const allRegisteredViews = Array.from(( this.registeredViewDescriptors.values()));
|
|
367
|
+
( Registry.as(Extensions.ViewsRegistry)).deregisterViews(allRegisteredViews, container);
|
|
368
|
+
}
|
|
369
|
+
this.registeredViewDescriptors.clear();
|
|
370
|
+
}
|
|
371
|
+
super.dispose();
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
ChatSessionsViewPaneContainer = ( __decorate([
|
|
375
|
+
( __param(0, IInstantiationService)),
|
|
376
|
+
( __param(1, IConfigurationService)),
|
|
377
|
+
( __param(2, IWorkbenchLayoutService)),
|
|
378
|
+
( __param(3, IContextMenuService)),
|
|
379
|
+
( __param(4, ITelemetryService)),
|
|
380
|
+
( __param(5, IExtensionService)),
|
|
381
|
+
( __param(6, IThemeService)),
|
|
382
|
+
( __param(7, IStorageService)),
|
|
383
|
+
( __param(8, IWorkspaceContextService)),
|
|
384
|
+
( __param(9, IViewDescriptorService)),
|
|
385
|
+
( __param(10, ILogService)),
|
|
386
|
+
( __param(11, IChatSessionsService))
|
|
387
|
+
], ChatSessionsViewPaneContainer));
|
|
388
|
+
class SessionsDataSource {
|
|
389
|
+
constructor(provider) {
|
|
390
|
+
this.provider = provider;
|
|
391
|
+
}
|
|
392
|
+
hasChildren(element) {
|
|
393
|
+
return element === this.provider;
|
|
394
|
+
}
|
|
395
|
+
async getChildren(element) {
|
|
396
|
+
if (element === this.provider) {
|
|
397
|
+
try {
|
|
398
|
+
const items = await this.provider.provideChatSessionItems(CancellationToken.None);
|
|
399
|
+
return ( items.map(item => ({ ...item, provider: this.provider })));
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
return [];
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return [];
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
class SessionsDelegate {
|
|
409
|
+
static { this.ITEM_HEIGHT = 22; }
|
|
410
|
+
getHeight(element) {
|
|
411
|
+
return SessionsDelegate.ITEM_HEIGHT;
|
|
412
|
+
}
|
|
413
|
+
getTemplateId(element) {
|
|
414
|
+
return SessionsRenderer.TEMPLATE_ID;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
let SessionsRenderer = class SessionsRenderer extends Disposable {
|
|
418
|
+
static { SessionsRenderer_1 = this; }
|
|
419
|
+
static { this.TEMPLATE_ID = 'session'; }
|
|
420
|
+
constructor(labels, themeService, logService) {
|
|
421
|
+
super();
|
|
422
|
+
this.labels = labels;
|
|
423
|
+
this.themeService = themeService;
|
|
424
|
+
this.logService = logService;
|
|
425
|
+
this.appliedIconColorStyles = ( new Set());
|
|
426
|
+
this._register(this.themeService.onDidColorThemeChange(() => {
|
|
427
|
+
this.appliedIconColorStyles.clear();
|
|
428
|
+
}));
|
|
429
|
+
}
|
|
430
|
+
applyIconColorStyle(iconId, colorId) {
|
|
431
|
+
const styleKey = `${iconId}-${colorId}`;
|
|
432
|
+
if (( this.appliedIconColorStyles.has(styleKey))) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
const colorTheme = this.themeService.getColorTheme();
|
|
436
|
+
const color = colorTheme.getColor(colorId);
|
|
437
|
+
if (color) {
|
|
438
|
+
const css = `.monaco-workbench .chat-session-item .monaco-icon-label.codicon-${iconId}::before { color: ${color} !important; }`;
|
|
439
|
+
const activeWindow = getActiveWindow();
|
|
440
|
+
const styleId = `chat-sessions-icon-${styleKey}`;
|
|
441
|
+
const existingStyle = activeWindow.document.getElementById(styleId);
|
|
442
|
+
if (existingStyle) {
|
|
443
|
+
existingStyle.textContent = css;
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
const styleElement = activeWindow.document.createElement('style');
|
|
447
|
+
styleElement.setAttribute('data-vscode', 'true');
|
|
448
|
+
styleElement.id = styleId;
|
|
449
|
+
styleElement.textContent = css;
|
|
450
|
+
activeWindow.document.head.appendChild(styleElement);
|
|
451
|
+
this._register({
|
|
452
|
+
dispose: () => {
|
|
453
|
+
const activeWin = getActiveWindow();
|
|
454
|
+
const style = activeWin.document.getElementById(styleId);
|
|
455
|
+
if (style) {
|
|
456
|
+
style.remove();
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
this.appliedIconColorStyles.add(styleKey);
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
this.logService.debug('No color found for colorId:', colorId);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
get templateId() {
|
|
468
|
+
return SessionsRenderer_1.TEMPLATE_ID;
|
|
469
|
+
}
|
|
470
|
+
renderTemplate(container) {
|
|
471
|
+
const element = append(container, $('.chat-session-item'));
|
|
472
|
+
const resourceLabel = this.labels.create(element, { supportHighlights: true });
|
|
473
|
+
const actionBar = ( new ActionBar(container));
|
|
474
|
+
return {
|
|
475
|
+
container: element,
|
|
476
|
+
resourceLabel,
|
|
477
|
+
actionBar
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
renderElement(element, index, templateData) {
|
|
481
|
+
const session = element.element;
|
|
482
|
+
let iconResource;
|
|
483
|
+
let iconTheme;
|
|
484
|
+
let iconUri;
|
|
485
|
+
if (session.iconPath) {
|
|
486
|
+
if (session.iconPath instanceof URI) {
|
|
487
|
+
if (session.iconPath.scheme === 'data') {
|
|
488
|
+
iconUri = session.iconPath;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
iconResource = session.iconPath;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
else if (ThemeIcon.isThemeIcon(session.iconPath)) {
|
|
495
|
+
iconTheme = session.iconPath;
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
iconResource = session.iconPath.light;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
if (iconTheme?.color?.id) {
|
|
502
|
+
this.applyIconColorStyle(iconTheme.id, iconTheme.color.id);
|
|
503
|
+
}
|
|
504
|
+
templateData.resourceLabel.setResource({
|
|
505
|
+
name: session.label,
|
|
506
|
+
description: 'description' in session && typeof session.description === 'string' ? session.description : '',
|
|
507
|
+
resource: iconResource
|
|
508
|
+
}, {
|
|
509
|
+
fileKind: undefined,
|
|
510
|
+
icon: iconTheme || iconUri
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
disposeTemplate(templateData) {
|
|
514
|
+
templateData.resourceLabel.dispose();
|
|
515
|
+
templateData.actionBar.dispose();
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
SessionsRenderer = SessionsRenderer_1 = ( __decorate([
|
|
519
|
+
( __param(1, IThemeService)),
|
|
520
|
+
( __param(2, ILogService))
|
|
521
|
+
], SessionsRenderer));
|
|
522
|
+
let SessionsViewPane = class SessionsViewPane extends ViewPane {
|
|
523
|
+
constructor(provider, options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService, editorService, viewsService, logService, progressService, chatSessionsService) {
|
|
524
|
+
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService);
|
|
525
|
+
this.provider = provider;
|
|
526
|
+
this.instantiationService = instantiationService;
|
|
527
|
+
this.editorService = editorService;
|
|
528
|
+
this.viewsService = viewsService;
|
|
529
|
+
this.logService = logService;
|
|
530
|
+
this.progressService = progressService;
|
|
531
|
+
this.chatSessionsService = chatSessionsService;
|
|
532
|
+
if (provider instanceof LocalChatSessionsProvider) {
|
|
533
|
+
this._register(provider.onDidChange(() => {
|
|
534
|
+
if (this.tree && this.isBodyVisible()) {
|
|
535
|
+
this.refreshTreeWithProgress();
|
|
536
|
+
}
|
|
537
|
+
}));
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
isLocalChatSessionItem(item) {
|
|
541
|
+
return ('editor' in item && 'group' in item) || ('widget' in item && 'sessionType' in item);
|
|
542
|
+
}
|
|
543
|
+
refreshTree() {
|
|
544
|
+
if (this.tree && this.isBodyVisible()) {
|
|
545
|
+
this.refreshTreeWithProgress();
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
getProviderDisplayName() {
|
|
549
|
+
const contributions = this.chatSessionsService.getChatSessionContributions();
|
|
550
|
+
const contribution = contributions.find(c => c.type === this.provider.chatSessionType);
|
|
551
|
+
if (contribution) {
|
|
552
|
+
return contribution.displayName;
|
|
553
|
+
}
|
|
554
|
+
return '';
|
|
555
|
+
}
|
|
556
|
+
showEmptyMessage() {
|
|
557
|
+
if (!this.messageElement) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (this.provider.chatSessionType === 'local') {
|
|
561
|
+
this.hideMessage();
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
const providerName = this.getProviderDisplayName();
|
|
565
|
+
if (!providerName) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
const messageText = ( localize(5084, "No sessions found from {0}", providerName));
|
|
569
|
+
clearNode(this.messageElement);
|
|
570
|
+
const messageContainer = append(this.messageElement, $('.no-sessions-message'));
|
|
571
|
+
append(messageContainer, $('.codicon.codicon-info'));
|
|
572
|
+
const textElement = append(messageContainer, $('span'));
|
|
573
|
+
textElement.textContent = messageText;
|
|
574
|
+
this.messageElement.style.display = 'block';
|
|
575
|
+
if (this.treeContainer) {
|
|
576
|
+
this.treeContainer.style.display = 'none';
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
hideMessage() {
|
|
580
|
+
if (this.messageElement) {
|
|
581
|
+
this.messageElement.style.display = 'none';
|
|
582
|
+
}
|
|
583
|
+
if (this.treeContainer) {
|
|
584
|
+
this.treeContainer.style.display = 'block';
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
updateEmptyStateMessage() {
|
|
588
|
+
try {
|
|
589
|
+
if (this.tree?.hasNode(this.provider)) {
|
|
590
|
+
const providerNode = this.tree.getNode(this.provider);
|
|
591
|
+
const childCount = providerNode.children?.length || 0;
|
|
592
|
+
if (childCount === 0) {
|
|
593
|
+
this.showEmptyMessage();
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
this.hideMessage();
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
catch (error) {
|
|
601
|
+
this.logService.error('Error checking tree data for empty state:', error);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
async refreshTreeWithProgress() {
|
|
605
|
+
if (!this.tree) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
try {
|
|
609
|
+
await this.progressService.withProgress({
|
|
610
|
+
location: this.id,
|
|
611
|
+
title: ( localize(5085, 'Refreshing chat sessions...')),
|
|
612
|
+
}, async () => {
|
|
613
|
+
await this.tree.updateChildren(this.provider);
|
|
614
|
+
});
|
|
615
|
+
this.updateEmptyStateMessage();
|
|
616
|
+
}
|
|
617
|
+
catch (error) {
|
|
618
|
+
this.logService.error('Error refreshing chat sessions tree:', error);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
async loadDataWithProgress() {
|
|
622
|
+
if (!this.tree) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
try {
|
|
626
|
+
await this.progressService.withProgress({
|
|
627
|
+
location: this.id,
|
|
628
|
+
title: ( localize(5086, 'Loading chat sessions...')),
|
|
629
|
+
}, async () => {
|
|
630
|
+
await this.tree.setInput(this.provider);
|
|
631
|
+
});
|
|
632
|
+
this.updateEmptyStateMessage();
|
|
633
|
+
}
|
|
634
|
+
catch (error) {
|
|
635
|
+
this.logService.error('Error loading chat sessions data:', error);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
renderBody(container) {
|
|
639
|
+
super.renderBody(container);
|
|
640
|
+
this.messageElement = append(container, $('.chat-sessions-message'));
|
|
641
|
+
this.messageElement.style.display = 'none';
|
|
642
|
+
this.treeContainer = append(container, $('.chat-sessions-tree.show-file-icons'));
|
|
643
|
+
this.treeContainer.classList.add('file-icon-themable-tree');
|
|
644
|
+
this.labels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility });
|
|
645
|
+
this._register(this.labels);
|
|
646
|
+
this.dataSource = ( new SessionsDataSource(this.provider));
|
|
647
|
+
const delegate = ( new SessionsDelegate());
|
|
648
|
+
const renderer = ( new SessionsRenderer(this.labels, this.themeService, this.logService));
|
|
649
|
+
this._register(renderer);
|
|
650
|
+
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'SessionsTree', this.treeContainer, delegate, [renderer], this.dataSource, {
|
|
651
|
+
horizontalScrolling: false,
|
|
652
|
+
setRowLineHeight: false,
|
|
653
|
+
transformOptimization: false,
|
|
654
|
+
identityProvider: {
|
|
655
|
+
getId: (element) => element.id
|
|
656
|
+
},
|
|
657
|
+
accessibilityProvider: {
|
|
658
|
+
getAriaLabel: (element) => element.label,
|
|
659
|
+
getWidgetAriaLabel: () => ( localize(5087, "Chat Sessions"))
|
|
660
|
+
},
|
|
661
|
+
hideTwistiesOfChildlessElements: true,
|
|
662
|
+
allowNonCollapsibleParents: true
|
|
663
|
+
});
|
|
664
|
+
this.logService.debug('Tree created with hideTwistiesOfChildlessElements: true');
|
|
665
|
+
this._register(this.tree);
|
|
666
|
+
this._register(this.tree.onDidOpen(async (e) => {
|
|
667
|
+
const element = e.element;
|
|
668
|
+
if (element && this.isLocalChatSessionItem(element)) {
|
|
669
|
+
if (element.sessionType === 'editor' && element.editor && element.group) {
|
|
670
|
+
await this.editorService.openEditor(element.editor, element.group);
|
|
671
|
+
}
|
|
672
|
+
else if (element.sessionType === 'widget' && element.widget) {
|
|
673
|
+
this.viewsService.openView(element.id, true);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
const ckey = this.contextKeyService.createKey('chatSessionType', element.provider.chatSessionType);
|
|
678
|
+
ckey.reset();
|
|
679
|
+
const options = {
|
|
680
|
+
pinned: true,
|
|
681
|
+
preferredTitle: element.label
|
|
682
|
+
};
|
|
683
|
+
await this.editorService.openEditor({
|
|
684
|
+
resource: ChatSessionUri.forSession(element.provider.chatSessionType, element.id),
|
|
685
|
+
options,
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
}));
|
|
689
|
+
this._register(this.onDidChangeBodyVisibility(async (visible) => {
|
|
690
|
+
if (visible && this.tree) {
|
|
691
|
+
await this.loadDataWithProgress();
|
|
692
|
+
}
|
|
693
|
+
}));
|
|
694
|
+
if (this.isBodyVisible() && this.tree) {
|
|
695
|
+
this.loadDataWithProgress();
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
layoutBody(height, width) {
|
|
699
|
+
super.layoutBody(height, width);
|
|
700
|
+
if (this.tree) {
|
|
701
|
+
this.tree.layout(height, width);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
focus() {
|
|
705
|
+
super.focus();
|
|
706
|
+
if (this.tree) {
|
|
707
|
+
this.tree.domFocus();
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
SessionsViewPane = ( __decorate([
|
|
712
|
+
( __param(2, IKeybindingService)),
|
|
713
|
+
( __param(3, IContextMenuService)),
|
|
714
|
+
( __param(4, IConfigurationService)),
|
|
715
|
+
( __param(5, IContextKeyService)),
|
|
716
|
+
( __param(6, IViewDescriptorService)),
|
|
717
|
+
( __param(7, IInstantiationService)),
|
|
718
|
+
( __param(8, IOpenerService)),
|
|
719
|
+
( __param(9, IThemeService)),
|
|
720
|
+
( __param(10, IHoverService)),
|
|
721
|
+
( __param(11, IEditorService)),
|
|
722
|
+
( __param(12, IViewsService)),
|
|
723
|
+
( __param(13, ILogService)),
|
|
724
|
+
( __param(14, IProgressService)),
|
|
725
|
+
( __param(15, IChatSessionsService))
|
|
726
|
+
], SessionsViewPane));
|
|
727
|
+
MenuRegistry.appendMenuItem(MenuId.ViewTitle, {
|
|
728
|
+
command: {
|
|
729
|
+
id: 'workbench.action.openChat',
|
|
730
|
+
title: ( localize2(5088, "New Chat Editor")),
|
|
731
|
+
icon: Codicon.plus
|
|
732
|
+
},
|
|
733
|
+
group: 'navigation',
|
|
734
|
+
order: 1,
|
|
735
|
+
when: ( ContextKeyExpr.equals('view', `${VIEWLET_ID}.local`)),
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
export { ChatSessionsView, VIEWLET_ID };
|