@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
|
@@ -23,9 +23,9 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/mini
|
|
|
23
23
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
|
|
24
24
|
import { quickInputBackground, quickInputForeground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
25
25
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
26
|
-
import { showChatView } from '@codingame/monaco-vscode-
|
|
27
|
-
import { ChatWidget } from '@codingame/monaco-vscode-
|
|
28
|
-
import { isCellTextEditOperation } from '@codingame/monaco-vscode-
|
|
26
|
+
import { showChatView } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
27
|
+
import { ChatWidget } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
28
|
+
import { isCellTextEditOperation } from '@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/common/chatModel';
|
|
29
29
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
30
30
|
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
31
31
|
import { EDITOR_DRAG_AND_DROP_BACKGROUND } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/theme';
|
|
@@ -3,7 +3,7 @@ import { AccessibleViewProviderId, AccessibleViewType, IAccessibleViewContentPro
|
|
|
3
3
|
import { IAccessibleViewImplementation } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleViewRegistry";
|
|
4
4
|
import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
5
|
import { AccessibilityVerbositySettingId } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration";
|
|
6
|
-
import { ChatTreeItem, IChatWidget } from "@codingame/monaco-vscode-
|
|
6
|
+
import { ChatTreeItem, IChatWidget } from "@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
7
7
|
export declare class ChatResponseAccessibleView implements IAccessibleViewImplementation {
|
|
8
8
|
readonly priority = 100;
|
|
9
9
|
readonly name = "panelChat";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
2
|
+
import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
3
|
+
import { isMarkdownString, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
4
4
|
import { stripIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iconLabels';
|
|
5
5
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
6
|
import { AccessibleViewType, AccessibleViewProviderId } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleView';
|
|
7
7
|
import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
8
|
+
import { migrateLegacyTerminalToolSpecificData } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/chat/common/chat';
|
|
8
9
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
9
|
-
import { isResponseVM } from '@codingame/monaco-vscode-
|
|
10
|
+
import { isResponseVM } from '@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
10
11
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
11
12
|
|
|
12
13
|
class ChatResponseAccessibleView {
|
|
@@ -53,18 +54,42 @@ class ChatResponseAccessibleProvider extends Disposable {
|
|
|
53
54
|
responseContent = item.errorDetails.message;
|
|
54
55
|
}
|
|
55
56
|
if (isResponseVM(item)) {
|
|
57
|
+
item.response.value.filter(item => item.kind === 'elicitation').forEach(elicitation => {
|
|
58
|
+
const title = elicitation.title;
|
|
59
|
+
if (typeof title === 'string') {
|
|
60
|
+
responseContent += `${title}\n`;
|
|
61
|
+
}
|
|
62
|
+
else if (isMarkdownString(title)) {
|
|
63
|
+
responseContent += renderAsPlaintext(title, { includeCodeBlocksFences: true }) + '\n';
|
|
64
|
+
}
|
|
65
|
+
const message = elicitation.message;
|
|
66
|
+
if (isMarkdownString(message)) {
|
|
67
|
+
responseContent += renderAsPlaintext(message, { includeCodeBlocksFences: true });
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
responseContent += message;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
56
73
|
const toolInvocations = item.response.value.filter(item => item.kind === 'toolInvocation');
|
|
57
74
|
for (const toolInvocation of toolInvocations) {
|
|
58
75
|
if (toolInvocation.confirmationMessages) {
|
|
59
76
|
const title = typeof toolInvocation.confirmationMessages.title === 'string' ? toolInvocation.confirmationMessages.title : toolInvocation.confirmationMessages.title.value;
|
|
60
|
-
const message = typeof toolInvocation.confirmationMessages.message === 'string' ? toolInvocation.confirmationMessages.message : stripIcons(
|
|
77
|
+
const message = typeof toolInvocation.confirmationMessages.message === 'string' ? toolInvocation.confirmationMessages.message : stripIcons(renderAsPlaintext(toolInvocation.confirmationMessages.message));
|
|
61
78
|
let input = '';
|
|
62
79
|
if (toolInvocation.toolSpecificData) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
80
|
+
if (toolInvocation.toolSpecificData?.kind === 'terminal') {
|
|
81
|
+
const terminalData = migrateLegacyTerminalToolSpecificData(toolInvocation.toolSpecificData);
|
|
82
|
+
input = terminalData.commandLine.userEdited ?? terminalData.commandLine.toolEdited ?? terminalData.commandLine.original;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
input = toolInvocation.toolSpecificData?.kind === 'extensions'
|
|
66
86
|
? JSON.stringify(toolInvocation.toolSpecificData.extensions)
|
|
67
|
-
:
|
|
87
|
+
: toolInvocation.toolSpecificData?.kind === 'todoList'
|
|
88
|
+
? JSON.stringify(toolInvocation.toolSpecificData.todoList)
|
|
89
|
+
: toolInvocation.toolSpecificData?.kind === 'pullRequest'
|
|
90
|
+
? JSON.stringify(toolInvocation.toolSpecificData)
|
|
91
|
+
: JSON.stringify(toolInvocation.toolSpecificData.rawInput);
|
|
92
|
+
}
|
|
68
93
|
}
|
|
69
94
|
responseContent += `${title}`;
|
|
70
95
|
if (input) {
|
|
@@ -74,19 +99,19 @@ class ChatResponseAccessibleProvider extends Disposable {
|
|
|
74
99
|
}
|
|
75
100
|
else if (toolInvocation.isComplete && toolInvocation.resultDetails && 'input' in toolInvocation.resultDetails) {
|
|
76
101
|
responseContent += '\n' + toolInvocation.resultDetails.isError ? 'Errored ' : 'Completed ';
|
|
77
|
-
responseContent += `${`${typeof toolInvocation.invocationMessage === 'string' ? toolInvocation.invocationMessage : stripIcons(
|
|
102
|
+
responseContent += `${`${typeof toolInvocation.invocationMessage === 'string' ? toolInvocation.invocationMessage : stripIcons(renderAsPlaintext(toolInvocation.invocationMessage))} with input: ${toolInvocation.resultDetails.input}`}\n`;
|
|
78
103
|
}
|
|
79
104
|
}
|
|
80
105
|
const pastConfirmations = item.response.value.filter(item => item.kind === 'toolInvocationSerialized');
|
|
81
106
|
for (const pastConfirmation of pastConfirmations) {
|
|
82
107
|
if (pastConfirmation.isComplete && pastConfirmation.resultDetails && 'input' in pastConfirmation.resultDetails) {
|
|
83
108
|
if (pastConfirmation.pastTenseMessage) {
|
|
84
|
-
responseContent += `\n${`${typeof pastConfirmation.pastTenseMessage === 'string' ? pastConfirmation.pastTenseMessage : stripIcons(
|
|
109
|
+
responseContent += `\n${`${typeof pastConfirmation.pastTenseMessage === 'string' ? pastConfirmation.pastTenseMessage : stripIcons(renderAsPlaintext(pastConfirmation.pastTenseMessage))} with input: ${pastConfirmation.resultDetails.input}`}\n`;
|
|
85
110
|
}
|
|
86
111
|
}
|
|
87
112
|
}
|
|
88
113
|
}
|
|
89
|
-
return
|
|
114
|
+
return renderAsPlaintext(( new MarkdownString(responseContent)), { includeCodeBlocksFences: true });
|
|
90
115
|
}
|
|
91
116
|
onClose() {
|
|
92
117
|
this._widget.reveal(this._focusedItem);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
+
import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
5
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
7
|
+
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
8
|
+
import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
|
|
9
|
+
import { ChatSession, IChatSessionContentProvider, IChatSessionItem, IChatSessionItemProvider, IChatSessionsExtensionPoint } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
|
|
10
|
+
import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
|
|
11
|
+
export declare class ChatSessionsService extends Disposable implements IChatSessionsService {
|
|
12
|
+
private readonly _logService;
|
|
13
|
+
private readonly _instantiationService;
|
|
14
|
+
private readonly _chatAgentService;
|
|
15
|
+
private readonly _extensionService;
|
|
16
|
+
private readonly _contextKeyService;
|
|
17
|
+
readonly _serviceBrand: undefined;
|
|
18
|
+
private readonly _itemsProviders;
|
|
19
|
+
private readonly _onDidChangeItemsProviders;
|
|
20
|
+
readonly onDidChangeItemsProviders: Event<IChatSessionItemProvider>;
|
|
21
|
+
private readonly _contentProviders;
|
|
22
|
+
private readonly _contributions;
|
|
23
|
+
private readonly _dynamicAgentDisposables;
|
|
24
|
+
private readonly _contextKeys;
|
|
25
|
+
private readonly _onDidChangeSessionItems;
|
|
26
|
+
readonly onDidChangeSessionItems: Event<string>;
|
|
27
|
+
private readonly _onDidChangeAvailability;
|
|
28
|
+
readonly onDidChangeAvailability: Event<void>;
|
|
29
|
+
constructor(_logService: ILogService, _instantiationService: IInstantiationService, _chatAgentService: IChatAgentService, _extensionService: IExtensionService, _contextKeyService: IContextKeyService);
|
|
30
|
+
registerContribution(contribution: IChatSessionsExtensionPoint): IDisposable;
|
|
31
|
+
private _isContributionAvailable;
|
|
32
|
+
private _registerDynamicAgentIfAvailable;
|
|
33
|
+
private _disposeDynamicAgent;
|
|
34
|
+
private _evaluateAvailability;
|
|
35
|
+
private _disposeSessionsForContribution;
|
|
36
|
+
private _registerDynamicAgent;
|
|
37
|
+
getChatSessionContributions(): IChatSessionsExtensionPoint[];
|
|
38
|
+
getChatSessionItemProviders(): IChatSessionItemProvider[];
|
|
39
|
+
canResolveItemProvider(chatViewType: string): Promise<boolean>;
|
|
40
|
+
notifySessionItemsChange(chatSessionType: string): void;
|
|
41
|
+
canResolveContentProvider(chatViewType: string): Promise<boolean>;
|
|
42
|
+
provideChatSessionItems(chatSessionType: string, token: CancellationToken): Promise<IChatSessionItem[]>;
|
|
43
|
+
registerChatSessionItemProvider(provider: IChatSessionItemProvider): IDisposable;
|
|
44
|
+
registerChatSessionContentProvider(provider: IChatSessionContentProvider): IDisposable;
|
|
45
|
+
private readonly _sessions;
|
|
46
|
+
provideChatSessionContent(chatSessionType: string, id: string, token: CancellationToken): Promise<ChatSession>;
|
|
47
|
+
private _onWillDisposeSession;
|
|
48
|
+
get hasChatSessionItemProviders(): boolean;
|
|
49
|
+
}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
5
|
+
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
+
import { DisposableStore, Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
8
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
9
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
10
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
11
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
12
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
14
|
+
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
15
|
+
import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
16
|
+
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
17
|
+
import { ExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
18
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
19
|
+
import { ChatEditorInput } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
20
|
+
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
21
|
+
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
22
|
+
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
23
|
+
import { ChatSessionUri } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/common/chatUri';
|
|
24
|
+
import { ChatModeKind, ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
25
|
+
|
|
26
|
+
const CODING_AGENT_DOCS = 'https://code.visualstudio.com/docs/copilot/copilot-coding-agent';
|
|
27
|
+
const extensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
28
|
+
extensionPoint: 'chatSessions',
|
|
29
|
+
jsonSchema: {
|
|
30
|
+
description: ( localize(5073, 'Contributes chat session integrations to the chat widget.')),
|
|
31
|
+
type: 'array',
|
|
32
|
+
items: {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
type: {
|
|
36
|
+
description: ( localize(5074, 'Unique identifier for the type of chat session.')),
|
|
37
|
+
type: 'string',
|
|
38
|
+
},
|
|
39
|
+
name: {
|
|
40
|
+
description: ( localize(5075, 'Name shown in the chat widget. (eg: @agent)')),
|
|
41
|
+
type: 'string',
|
|
42
|
+
},
|
|
43
|
+
displayName: {
|
|
44
|
+
description: ( localize(5076, 'A longer name for this item which is used for display in menus.')),
|
|
45
|
+
type: 'string',
|
|
46
|
+
},
|
|
47
|
+
description: {
|
|
48
|
+
description: ( localize(5077, 'Description of the chat session for use in menus and tooltips.')),
|
|
49
|
+
type: 'string'
|
|
50
|
+
},
|
|
51
|
+
when: {
|
|
52
|
+
description: ( localize(5078, 'Condition which must be true to show this item.')),
|
|
53
|
+
type: 'string'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
required: ['id', 'name', 'displayName', 'description'],
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
activationEventsGenerator: (contribs, results) => {
|
|
60
|
+
for (const contrib of contribs) {
|
|
61
|
+
results.push(`onChatSession:${contrib.type}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
class ContributedChatSessionData {
|
|
66
|
+
constructor(session, chatSessionType, id, onWillDispose) {
|
|
67
|
+
this.session = session;
|
|
68
|
+
this.chatSessionType = chatSessionType;
|
|
69
|
+
this.id = id;
|
|
70
|
+
this.onWillDispose = onWillDispose;
|
|
71
|
+
this._disposableStore = ( new DisposableStore());
|
|
72
|
+
this._disposableStore.add(this.session.onWillDispose(() => {
|
|
73
|
+
this.onWillDispose(this.session, this.chatSessionType, this.id);
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
dispose() {
|
|
77
|
+
this._disposableStore.dispose();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
81
|
+
constructor(_logService, _instantiationService, _chatAgentService, _extensionService, _contextKeyService) {
|
|
82
|
+
super();
|
|
83
|
+
this._logService = _logService;
|
|
84
|
+
this._instantiationService = _instantiationService;
|
|
85
|
+
this._chatAgentService = _chatAgentService;
|
|
86
|
+
this._extensionService = _extensionService;
|
|
87
|
+
this._contextKeyService = _contextKeyService;
|
|
88
|
+
this._itemsProviders = ( new Map());
|
|
89
|
+
this._onDidChangeItemsProviders = this._register(( new Emitter()));
|
|
90
|
+
this.onDidChangeItemsProviders = this._onDidChangeItemsProviders.event;
|
|
91
|
+
this._contentProviders = ( new Map());
|
|
92
|
+
this._contributions = ( new Map());
|
|
93
|
+
this._dynamicAgentDisposables = ( new Map());
|
|
94
|
+
this._contextKeys = ( new Set());
|
|
95
|
+
this._onDidChangeSessionItems = this._register(( new Emitter()));
|
|
96
|
+
this.onDidChangeSessionItems = this._onDidChangeSessionItems.event;
|
|
97
|
+
this._onDidChangeAvailability = this._register(( new Emitter()));
|
|
98
|
+
this.onDidChangeAvailability = this._onDidChangeAvailability.event;
|
|
99
|
+
this._sessions = ( new Map());
|
|
100
|
+
this._register(extensionPoint.setHandler(extensions => {
|
|
101
|
+
for (const ext of extensions) {
|
|
102
|
+
if (!isProposedApiEnabled(ext.description, 'chatSessionsProvider')) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (!Array.isArray(ext.value)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
for (const contribution of ext.value) {
|
|
109
|
+
const c = {
|
|
110
|
+
id: contribution.id,
|
|
111
|
+
type: contribution.type,
|
|
112
|
+
name: contribution.name,
|
|
113
|
+
displayName: contribution.displayName,
|
|
114
|
+
description: contribution.description,
|
|
115
|
+
when: contribution.when,
|
|
116
|
+
extensionDescription: ext.description,
|
|
117
|
+
};
|
|
118
|
+
this._logService.info(`Registering chat session from extension contribution: ${c.displayName} (id='${c.type}' name='${c.name}')`);
|
|
119
|
+
this._register(this.registerContribution(c));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
this._register(Event.filter(this._contextKeyService.onDidChangeContext, e => e.affectsSome(this._contextKeys))(() => {
|
|
124
|
+
this._evaluateAvailability();
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
registerContribution(contribution) {
|
|
128
|
+
if (( this._contributions.has(contribution.type))) {
|
|
129
|
+
this._logService.warn(`Chat session contribution with id '${contribution.type}' is already registered.`);
|
|
130
|
+
return { dispose: () => { } };
|
|
131
|
+
}
|
|
132
|
+
if (contribution.when) {
|
|
133
|
+
const whenExpr = ContextKeyExpr.deserialize(contribution.when);
|
|
134
|
+
if (whenExpr) {
|
|
135
|
+
for (const key of ( whenExpr.keys())) {
|
|
136
|
+
this._contextKeys.add(key);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
this._contributions.set(contribution.type, contribution);
|
|
141
|
+
this._registerDynamicAgentIfAvailable(contribution);
|
|
142
|
+
return {
|
|
143
|
+
dispose: () => {
|
|
144
|
+
this._contributions.delete(contribution.type);
|
|
145
|
+
this._disposeDynamicAgent(contribution.type);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
_isContributionAvailable(contribution) {
|
|
150
|
+
if (!contribution.when) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
const whenExpr = ContextKeyExpr.deserialize(contribution.when);
|
|
154
|
+
return !whenExpr || this._contextKeyService.contextMatchesRules(whenExpr);
|
|
155
|
+
}
|
|
156
|
+
_registerDynamicAgentIfAvailable(contribution) {
|
|
157
|
+
if (this._isContributionAvailable(contribution)) {
|
|
158
|
+
const disposable = this._registerDynamicAgent(contribution);
|
|
159
|
+
this._dynamicAgentDisposables.set(contribution.type, disposable);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
_disposeDynamicAgent(contributionId) {
|
|
163
|
+
const disposable = this._dynamicAgentDisposables.get(contributionId);
|
|
164
|
+
if (disposable) {
|
|
165
|
+
disposable.dispose();
|
|
166
|
+
this._dynamicAgentDisposables.delete(contributionId);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_evaluateAvailability() {
|
|
170
|
+
let hasChanges = false;
|
|
171
|
+
for (const contribution of ( this._contributions.values())) {
|
|
172
|
+
const isCurrentlyRegistered = ( this._dynamicAgentDisposables.has(contribution.type));
|
|
173
|
+
const shouldBeRegistered = this._isContributionAvailable(contribution);
|
|
174
|
+
if (isCurrentlyRegistered && !shouldBeRegistered) {
|
|
175
|
+
this._disposeDynamicAgent(contribution.type);
|
|
176
|
+
this._disposeSessionsForContribution(contribution.type);
|
|
177
|
+
hasChanges = true;
|
|
178
|
+
}
|
|
179
|
+
else if (!isCurrentlyRegistered && shouldBeRegistered) {
|
|
180
|
+
this._registerDynamicAgentIfAvailable(contribution);
|
|
181
|
+
hasChanges = true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (hasChanges) {
|
|
185
|
+
this._onDidChangeAvailability.fire();
|
|
186
|
+
for (const provider of ( this._itemsProviders.values())) {
|
|
187
|
+
this._onDidChangeItemsProviders.fire(provider);
|
|
188
|
+
}
|
|
189
|
+
for (const contribution of ( this._contributions.values())) {
|
|
190
|
+
this._onDidChangeSessionItems.fire(contribution.type);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
_disposeSessionsForContribution(contributionId) {
|
|
195
|
+
const sessionsToDispose = [];
|
|
196
|
+
for (const [sessionKey, sessionData] of this._sessions) {
|
|
197
|
+
if (sessionData.chatSessionType === contributionId) {
|
|
198
|
+
sessionsToDispose.push(sessionKey);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (sessionsToDispose.length > 0) {
|
|
202
|
+
this._logService.info(`Disposing ${sessionsToDispose.length} cached sessions for contribution '${contributionId}' due to when clause change`);
|
|
203
|
+
}
|
|
204
|
+
for (const sessionKey of sessionsToDispose) {
|
|
205
|
+
const sessionData = this._sessions.get(sessionKey);
|
|
206
|
+
if (sessionData) {
|
|
207
|
+
sessionData.dispose();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
_registerDynamicAgent(contribution) {
|
|
212
|
+
const { type: id, name, displayName, description, extensionDescription } = contribution;
|
|
213
|
+
const { identifier: extensionId, name: extensionName, displayName: extensionDisplayName, publisher: extensionPublisherId } = extensionDescription;
|
|
214
|
+
const agentData = {
|
|
215
|
+
id,
|
|
216
|
+
name,
|
|
217
|
+
fullName: displayName,
|
|
218
|
+
description: description,
|
|
219
|
+
isDefault: false,
|
|
220
|
+
isCore: false,
|
|
221
|
+
isDynamic: true,
|
|
222
|
+
isCodingAgent: true,
|
|
223
|
+
slashCommands: [],
|
|
224
|
+
locations: [ChatAgentLocation.Panel],
|
|
225
|
+
modes: [ChatModeKind.Agent, ChatModeKind.Ask],
|
|
226
|
+
disambiguation: [],
|
|
227
|
+
metadata: {
|
|
228
|
+
themeIcon: Codicon.sendToRemoteAgent,
|
|
229
|
+
isSticky: false,
|
|
230
|
+
},
|
|
231
|
+
extensionId,
|
|
232
|
+
extensionDisplayName: extensionDisplayName || extensionName,
|
|
233
|
+
extensionPublisherId,
|
|
234
|
+
};
|
|
235
|
+
const agentImpl = this._instantiationService.createInstance(CodingAgentChatImplementation, contribution);
|
|
236
|
+
const disposable = this._chatAgentService.registerDynamicAgent(agentData, agentImpl);
|
|
237
|
+
return disposable;
|
|
238
|
+
}
|
|
239
|
+
getChatSessionContributions() {
|
|
240
|
+
return Array.from(( this._contributions.values())).filter(contribution => this._isContributionAvailable(contribution));
|
|
241
|
+
}
|
|
242
|
+
getChatSessionItemProviders() {
|
|
243
|
+
return [...( this._itemsProviders.values())].filter(provider => {
|
|
244
|
+
const contribution = this._contributions.get(provider.chatSessionType);
|
|
245
|
+
return !contribution || this._isContributionAvailable(contribution);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
async canResolveItemProvider(chatViewType) {
|
|
249
|
+
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
250
|
+
const contribution = this._contributions.get(chatViewType);
|
|
251
|
+
if (contribution && !this._isContributionAvailable(contribution)) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
if (( this._itemsProviders.has(chatViewType))) {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
await this._extensionService.activateByEvent(`onChatSession:${chatViewType}`);
|
|
258
|
+
return ( this._itemsProviders.has(chatViewType));
|
|
259
|
+
}
|
|
260
|
+
notifySessionItemsChange(chatSessionType) {
|
|
261
|
+
this._onDidChangeSessionItems.fire(chatSessionType);
|
|
262
|
+
}
|
|
263
|
+
async canResolveContentProvider(chatViewType) {
|
|
264
|
+
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
265
|
+
const contribution = this._contributions.get(chatViewType);
|
|
266
|
+
if (contribution && !this._isContributionAvailable(contribution)) {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
if (( this._contentProviders.has(chatViewType))) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
await this._extensionService.activateByEvent(`onChatSession:${chatViewType}`);
|
|
273
|
+
return ( this._contentProviders.has(chatViewType));
|
|
274
|
+
}
|
|
275
|
+
async provideChatSessionItems(chatSessionType, token) {
|
|
276
|
+
if (!(await this.canResolveItemProvider(chatSessionType))) {
|
|
277
|
+
throw Error(`Can not find provider for ${chatSessionType}`);
|
|
278
|
+
}
|
|
279
|
+
const provider = this._itemsProviders.get(chatSessionType);
|
|
280
|
+
if (provider?.provideChatSessionItems) {
|
|
281
|
+
const sessions = await provider.provideChatSessionItems(token);
|
|
282
|
+
return sessions;
|
|
283
|
+
}
|
|
284
|
+
return [];
|
|
285
|
+
}
|
|
286
|
+
registerChatSessionItemProvider(provider) {
|
|
287
|
+
const chatSessionType = provider.chatSessionType;
|
|
288
|
+
this._itemsProviders.set(chatSessionType, provider);
|
|
289
|
+
this._onDidChangeItemsProviders.fire(provider);
|
|
290
|
+
return {
|
|
291
|
+
dispose: () => {
|
|
292
|
+
const provider = this._itemsProviders.get(chatSessionType);
|
|
293
|
+
if (provider) {
|
|
294
|
+
this._itemsProviders.delete(chatSessionType);
|
|
295
|
+
this._onDidChangeItemsProviders.fire(provider);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
registerChatSessionContentProvider(provider) {
|
|
301
|
+
this._contentProviders.set(provider.chatSessionType, provider);
|
|
302
|
+
return {
|
|
303
|
+
dispose: () => {
|
|
304
|
+
this._contentProviders.delete(provider.chatSessionType);
|
|
305
|
+
for (const [key, session] of this._sessions) {
|
|
306
|
+
if (session.chatSessionType === provider.chatSessionType) {
|
|
307
|
+
session.dispose();
|
|
308
|
+
this._sessions.delete(key);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
async provideChatSessionContent(chatSessionType, id, token) {
|
|
315
|
+
if (!(await this.canResolveContentProvider(chatSessionType))) {
|
|
316
|
+
throw Error(`Can not find provider for ${chatSessionType}`);
|
|
317
|
+
}
|
|
318
|
+
const provider = this._contentProviders.get(chatSessionType);
|
|
319
|
+
if (!provider) {
|
|
320
|
+
throw Error(`Can not find provider for ${chatSessionType}`);
|
|
321
|
+
}
|
|
322
|
+
const sessionKey = `${chatSessionType}_${id}`;
|
|
323
|
+
const existingSessionData = this._sessions.get(sessionKey);
|
|
324
|
+
if (existingSessionData) {
|
|
325
|
+
return existingSessionData.session;
|
|
326
|
+
}
|
|
327
|
+
const session = await provider.provideChatSessionContent(id, token);
|
|
328
|
+
const sessionData = ( new ContributedChatSessionData(session, chatSessionType, id, this._onWillDisposeSession.bind(this)));
|
|
329
|
+
this._sessions.set(sessionKey, sessionData);
|
|
330
|
+
return session;
|
|
331
|
+
}
|
|
332
|
+
_onWillDisposeSession(session, chatSessionType, id) {
|
|
333
|
+
const sessionKey = `${chatSessionType}_${id}`;
|
|
334
|
+
this._sessions.delete(sessionKey);
|
|
335
|
+
}
|
|
336
|
+
get hasChatSessionItemProviders() {
|
|
337
|
+
return this._itemsProviders.size > 0;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
ChatSessionsService = ( __decorate([
|
|
341
|
+
( __param(0, ILogService)),
|
|
342
|
+
( __param(1, IInstantiationService)),
|
|
343
|
+
( __param(2, IChatAgentService)),
|
|
344
|
+
( __param(3, IExtensionService)),
|
|
345
|
+
( __param(4, IContextKeyService))
|
|
346
|
+
], ChatSessionsService));
|
|
347
|
+
let CodingAgentChatImplementation = class CodingAgentChatImplementation extends Disposable {
|
|
348
|
+
constructor(chatSession, chatService, chatWidgetService, editorGroupService, chatSessionService) {
|
|
349
|
+
super();
|
|
350
|
+
this.chatSession = chatSession;
|
|
351
|
+
this.chatService = chatService;
|
|
352
|
+
this.chatWidgetService = chatWidgetService;
|
|
353
|
+
this.editorGroupService = editorGroupService;
|
|
354
|
+
this.chatSessionService = chatSessionService;
|
|
355
|
+
}
|
|
356
|
+
async invoke(request, progress, history, token) {
|
|
357
|
+
const widget = this.chatWidgetService.getWidgetBySessionId(request.sessionId);
|
|
358
|
+
if (!widget) {
|
|
359
|
+
return {};
|
|
360
|
+
}
|
|
361
|
+
let chatSession;
|
|
362
|
+
for (const group of this.editorGroupService.groups) {
|
|
363
|
+
if (chatSession) {
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
for (const editor of group.editors) {
|
|
367
|
+
if (editor instanceof ChatEditorInput) {
|
|
368
|
+
try {
|
|
369
|
+
const chatModel = await this.chatService.loadSessionForResource(editor.resource, request.location, CancellationToken.None);
|
|
370
|
+
if (chatModel?.sessionId === request.sessionId) {
|
|
371
|
+
const identifier = ChatSessionUri.parse(editor.resource);
|
|
372
|
+
if (identifier) {
|
|
373
|
+
chatSession = await this.chatSessionService.provideChatSessionContent(this.chatSession.type, identifier.sessionId, token);
|
|
374
|
+
}
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (chatSession?.requestHandler) {
|
|
384
|
+
await chatSession.requestHandler(request, progress, [], token);
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
const content = ( new MarkdownString(( localize(
|
|
388
|
+
5079,
|
|
389
|
+
"Use `#copilotCodingAgent` to begin a new [coding agent session]({0}).",
|
|
390
|
+
CODING_AGENT_DOCS
|
|
391
|
+
))));
|
|
392
|
+
progress([{
|
|
393
|
+
kind: 'markdownContent',
|
|
394
|
+
content,
|
|
395
|
+
}]);
|
|
396
|
+
}
|
|
397
|
+
return {};
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
CodingAgentChatImplementation = ( __decorate([
|
|
401
|
+
( __param(1, IChatService)),
|
|
402
|
+
( __param(2, IChatWidgetService)),
|
|
403
|
+
( __param(3, IEditorGroupsService)),
|
|
404
|
+
( __param(4, IChatSessionsService))
|
|
405
|
+
], CodingAgentChatImplementation));
|
|
406
|
+
|
|
407
|
+
export { ChatSessionsService };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
4
|
+
export declare const VIEWLET_ID = "workbench.view.chat.sessions";
|
|
5
|
+
export declare class ChatSessionsView extends Disposable implements IWorkbenchContribution {
|
|
6
|
+
private readonly configurationService;
|
|
7
|
+
static readonly ID = "workbench.contrib.chatSessions";
|
|
8
|
+
private isViewContainerRegistered;
|
|
9
|
+
constructor(configurationService: IConfigurationService);
|
|
10
|
+
private updateViewContainerRegistration;
|
|
11
|
+
private registerViewContainer;
|
|
12
|
+
}
|