@codingame/monaco-vscode-chat-service-override 29.1.0 → 30.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 +5 -2
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +37 -39
- package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
- package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +11 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +4 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +132 -42
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +54 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +15 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +5 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +188 -51
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +7 -6
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +7 -2
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.d.ts +6 -0
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +14 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +18 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +37 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +10 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +37 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +20 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +18 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +482 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +43 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +74 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +27 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.d.ts +5 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +86 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +38 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +38 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +427 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +37 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +108 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +28 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +3 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +65 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +64 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +288 -195
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +28 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +19 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +54 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +50 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +86 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +29 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +65 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +24 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +3 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +54 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +24 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +72 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +181 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +37 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +28 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +1 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +148 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +16 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +158 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +8 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +155 -76
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +31 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +228 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +190 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +25 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +130 -107
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +19 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +2 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +169 -266
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +12 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +149 -206
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +27 -22
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +20 -8
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +183 -43
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -11
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +3 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +26 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +4 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +16 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +150 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +66 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +239 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +0 -208
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +0 -637
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +0 -384
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.js +0 -47
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalSkill.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +0 -55
- /package/vscode/src/vs/workbench/contrib/chat/{common → browser}/promptSyntax/promptFileContributions.d.ts +0 -0
|
@@ -98,7 +98,7 @@ let ChatSessionStore = class ChatSessionStore extends Disposable {
|
|
|
98
98
|
}
|
|
99
99
|
e.join(this.storeTask, {
|
|
100
100
|
id: "join.chatSessionStore",
|
|
101
|
-
label: ( localize(
|
|
101
|
+
label: ( localize(7300, "Saving chat history"))
|
|
102
102
|
});
|
|
103
103
|
}));
|
|
104
104
|
}
|
|
@@ -356,14 +356,14 @@ let ChatSessionStore = class ChatSessionStore extends Disposable {
|
|
|
356
356
|
this._didReportIssue = true;
|
|
357
357
|
this.dialogService.prompt({
|
|
358
358
|
custom: true,
|
|
359
|
-
title: ( localize(
|
|
359
|
+
title: ( localize(7301, "Error saving chat session")),
|
|
360
360
|
message: ( localize(
|
|
361
|
-
|
|
361
|
+
7302,
|
|
362
362
|
"Error serializing chat session for storage. The session will be lost if the window is closed. Please report this issue to the VS Code team:\n\n{0}",
|
|
363
363
|
e.stack || toErrorMessage(e)
|
|
364
364
|
)),
|
|
365
365
|
buttons: [{
|
|
366
|
-
label: ( localize(
|
|
366
|
+
label: ( localize(7303, "Report Issue")),
|
|
367
367
|
run: () => this.openerService.open("https://github.com/microsoft/vscode/issues/new?template=bug_report.md")
|
|
368
368
|
}]
|
|
369
369
|
});
|
|
@@ -708,7 +708,7 @@ async function getSessionMetadata(session) {
|
|
|
708
708
|
}
|
|
709
709
|
return {
|
|
710
710
|
sessionId: session.sessionId,
|
|
711
|
-
title: title || ( localize(
|
|
711
|
+
title: title || ( localize(7304, "New Chat")),
|
|
712
712
|
lastMessageDate,
|
|
713
713
|
timing,
|
|
714
714
|
initialLocation: session.initialLocation,
|
|
@@ -716,7 +716,8 @@ async function getSessionMetadata(session) {
|
|
|
716
716
|
isEmpty: session instanceof ChatModel ? session.getRequests().length === 0 : session.requests.length === 0,
|
|
717
717
|
stats,
|
|
718
718
|
isExternal: session instanceof ChatModel && !LocalChatSessionUri.parseLocalSessionId(session.sessionResource),
|
|
719
|
-
lastResponseState
|
|
719
|
+
lastResponseState,
|
|
720
|
+
permissionLevel: session instanceof ChatModel ? session.inputModel.state.get()?.permissionLevel : undefined
|
|
720
721
|
};
|
|
721
722
|
}
|
|
722
723
|
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
2
|
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
3
3
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
4
5
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
6
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
6
7
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
8
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
7
9
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
8
10
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
9
11
|
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
12
|
+
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
10
13
|
import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
|
|
11
14
|
import { IEnablementModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement";
|
|
12
15
|
import { IAgentPluginRepositoryService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service";
|
|
13
|
-
import { IAgentPlugin, IAgentPluginDiscovery } from "./agentPluginService.js";
|
|
16
|
+
import { IAgentPlugin, IAgentPluginDiscovery, IAgentPluginMcpServerDefinition } from "./agentPluginService.js";
|
|
14
17
|
import { IAgentPluginService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service";
|
|
15
18
|
import { IMarketplacePlugin } from "./pluginMarketplaceService.js";
|
|
16
19
|
import { IPluginMarketplaceService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service";
|
|
@@ -32,6 +35,21 @@ export declare function shellQuotePluginRootInCommand(command: string, fsPath: s
|
|
|
32
35
|
* Returns `undefined` when the input is not a usable object.
|
|
33
36
|
*/
|
|
34
37
|
export declare function resolveMcpServersMap(raw: unknown): Record<string, unknown> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Converts bare `${VAR}` environment-variable references found in MCP server
|
|
40
|
+
* definition strings to the VS Code `${env:VAR}` syntax so that the
|
|
41
|
+
* `configurationResolverService` can resolve them later in the pipeline.
|
|
42
|
+
*
|
|
43
|
+
* The MCP ecosystem (Claude Desktop, Copilot CLI) uses bare `${VAR}` to
|
|
44
|
+
* reference environment variables, while VS Code's resolver expects the
|
|
45
|
+
* `${env:VAR}` form. This function bridges that gap for all plugin-provided
|
|
46
|
+
* MCP server definitions.
|
|
47
|
+
*
|
|
48
|
+
* Only references whose name consists of uppercase letters, digits, and
|
|
49
|
+
* underscores are converted — this avoids transforming VS Code's own variable
|
|
50
|
+
* tokens (e.g. `${workspaceFolder}`) which use lowercase/camelCase names.
|
|
51
|
+
*/
|
|
52
|
+
export declare function convertBareEnvVarsToVsCodeSyntax(def: IAgentPluginMcpServerDefinition): IAgentPluginMcpServerDefinition;
|
|
35
53
|
export declare class AgentPluginService extends Disposable implements IAgentPluginService {
|
|
36
54
|
readonly _serviceBrand: undefined;
|
|
37
55
|
readonly plugins: IObservable<readonly IAgentPlugin[]>;
|
|
@@ -138,4 +156,16 @@ export declare class MarketplaceAgentPluginDiscovery extends AbstractAgentPlugin
|
|
|
138
156
|
start(enablementModel: IEnablementModel): void;
|
|
139
157
|
protected _discoverPluginSources(): Promise<readonly IPluginSource[]>;
|
|
140
158
|
}
|
|
159
|
+
export declare class ExtensionAgentPluginDiscovery extends AbstractAgentPluginDiscovery {
|
|
160
|
+
private readonly _commandService;
|
|
161
|
+
private readonly _contextKeyService;
|
|
162
|
+
private readonly _dialogService;
|
|
163
|
+
private readonly _extensionPlugins;
|
|
164
|
+
private readonly _whenKeys;
|
|
165
|
+
constructor(_commandService: ICommandService, _contextKeyService: IContextKeyService, _dialogService: IDialogService, fileService: IFileService, pathService: IPathService, logService: ILogService, instantiationService: IInstantiationService);
|
|
166
|
+
start(enablementModel: IEnablementModel): void;
|
|
167
|
+
private _rebuildWhenKeys;
|
|
168
|
+
protected _discoverPluginSources(): Promise<readonly IPluginSource[]>;
|
|
169
|
+
private _promptUninstallExtension;
|
|
170
|
+
}
|
|
141
171
|
export {};
|
|
@@ -13,15 +13,24 @@ import { joinPath, normalizePath, isEqualOrParent, basename, extname } from '@co
|
|
|
13
13
|
import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
14
14
|
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
15
15
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
16
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
16
17
|
import { ConfigurationTarget, getConfigValueInTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
17
18
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
18
19
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
19
20
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
21
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
22
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
20
23
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
21
24
|
import { McpServerType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes';
|
|
22
25
|
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
23
26
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
24
27
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
28
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
29
|
+
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
30
|
+
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
31
|
+
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
32
|
+
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
|
|
33
|
+
import { ExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
25
34
|
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
26
35
|
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
27
36
|
import { EnablementModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
|
|
@@ -147,6 +156,19 @@ function interpolateMcpPluginRoot(def, fsPath, token, envVar) {
|
|
|
147
156
|
uri: def.uri
|
|
148
157
|
};
|
|
149
158
|
}
|
|
159
|
+
const BARE_ENV_VAR_RE = /\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;
|
|
160
|
+
function convertBareEnvVarsToVsCodeSyntax(def) {
|
|
161
|
+
return cloneAndChange(def, value => {
|
|
162
|
+
if (URI.isUri(value)) {
|
|
163
|
+
return value;
|
|
164
|
+
}
|
|
165
|
+
if (typeof value === "string") {
|
|
166
|
+
const replaced = value.replace(BARE_ENV_VAR_RE, "${env:$1}");
|
|
167
|
+
return replaced !== value ? replaced : undefined;
|
|
168
|
+
}
|
|
169
|
+
return undefined;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
150
172
|
function parsePluginRootHooks(hookURI, json, pluginUri, userHome, workspaceContextService, token, envVar) {
|
|
151
173
|
const fsPath = pluginUri.fsPath;
|
|
152
174
|
const typedJson = json;
|
|
@@ -535,6 +557,7 @@ class AbstractAgentPluginDiscovery extends Disposable {
|
|
|
535
557
|
if (adapter.pluginRootToken && adapter.pluginRootEnvVar) {
|
|
536
558
|
def = interpolateMcpPluginRoot(def, pluginFsPath, adapter.pluginRootToken, adapter.pluginRootEnvVar);
|
|
537
559
|
}
|
|
560
|
+
def = convertBareEnvVarsToVsCodeSyntax(def);
|
|
538
561
|
definitions.push(def);
|
|
539
562
|
}
|
|
540
563
|
return definitions;
|
|
@@ -893,5 +916,209 @@ let MarketplaceAgentPluginDiscovery = class MarketplaceAgentPluginDiscovery exte
|
|
|
893
916
|
}
|
|
894
917
|
};
|
|
895
918
|
MarketplaceAgentPluginDiscovery = ( __decorate([( __param(0, IPluginMarketplaceService)), ( __param(1, IAgentPluginRepositoryService)), ( __param(2, IFileService)), ( __param(3, IPathService)), ( __param(4, ILogService)), ( __param(5, IInstantiationService))], MarketplaceAgentPluginDiscovery));
|
|
919
|
+
const epPlugins = ExtensionsRegistry.registerExtensionPoint({
|
|
920
|
+
extensionPoint: "chatPlugins",
|
|
921
|
+
jsonSchema: {
|
|
922
|
+
description: ( localize(7305, "Contributes agent plugins for chat.")),
|
|
923
|
+
type: "array",
|
|
924
|
+
items: {
|
|
925
|
+
additionalProperties: false,
|
|
926
|
+
type: "object",
|
|
927
|
+
defaultSnippets: [{
|
|
928
|
+
body: {
|
|
929
|
+
path: "./relative/path/to/plugin/"
|
|
930
|
+
}
|
|
931
|
+
}],
|
|
932
|
+
required: ["path"],
|
|
933
|
+
properties: {
|
|
934
|
+
path: {
|
|
935
|
+
description: ( localize(
|
|
936
|
+
7306,
|
|
937
|
+
"Path to the agent plugin root directory relative to the extension root."
|
|
938
|
+
)),
|
|
939
|
+
type: "string"
|
|
940
|
+
},
|
|
941
|
+
when: {
|
|
942
|
+
description: ( localize(7307, "(Optional) A condition which must be true to enable this plugin.")),
|
|
943
|
+
type: "string"
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
let ExtensionAgentPluginDiscovery = class ExtensionAgentPluginDiscovery extends AbstractAgentPluginDiscovery {
|
|
950
|
+
constructor(
|
|
951
|
+
_commandService,
|
|
952
|
+
_contextKeyService,
|
|
953
|
+
_dialogService,
|
|
954
|
+
fileService,
|
|
955
|
+
pathService,
|
|
956
|
+
logService,
|
|
957
|
+
instantiationService
|
|
958
|
+
) {
|
|
959
|
+
super(fileService, pathService, logService, instantiationService);
|
|
960
|
+
this._commandService = _commandService;
|
|
961
|
+
this._contextKeyService = _contextKeyService;
|
|
962
|
+
this._dialogService = _dialogService;
|
|
963
|
+
this._extensionPlugins = ( new Map());
|
|
964
|
+
this._whenKeys = ( new Set());
|
|
965
|
+
}
|
|
966
|
+
start(enablementModel) {
|
|
967
|
+
this._enablementModel = enablementModel;
|
|
968
|
+
const scheduler = this._register(( new RunOnceScheduler(() => this._refreshPlugins(), 0)));
|
|
969
|
+
this._register(this._contextKeyService.onDidChangeContext(e => {
|
|
970
|
+
if (e.affectsSome(this._whenKeys)) {
|
|
971
|
+
scheduler.schedule();
|
|
972
|
+
}
|
|
973
|
+
}));
|
|
974
|
+
epPlugins.setHandler((_extensions, delta) => {
|
|
975
|
+
for (const ext of delta.added) {
|
|
976
|
+
for (const raw of ext.value) {
|
|
977
|
+
if (!raw.path) {
|
|
978
|
+
ext.collector.error(( localize(
|
|
979
|
+
7308,
|
|
980
|
+
"Extension '{0}' cannot register a chatPlugins entry without a path.",
|
|
981
|
+
ext.description.identifier.value
|
|
982
|
+
)));
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
const pluginUri = joinPath(ext.description.extensionLocation, raw.path);
|
|
986
|
+
if (!isEqualOrParent(pluginUri, ext.description.extensionLocation)) {
|
|
987
|
+
ext.collector.error(( localize(
|
|
988
|
+
7309,
|
|
989
|
+
"Extension '{0}' chatPlugins entry '{1}' resolves outside the extension.",
|
|
990
|
+
ext.description.identifier.value,
|
|
991
|
+
raw.path
|
|
992
|
+
)));
|
|
993
|
+
continue;
|
|
994
|
+
}
|
|
995
|
+
let whenExpr;
|
|
996
|
+
if (raw.when) {
|
|
997
|
+
whenExpr = ContextKeyExpr.deserialize(raw.when);
|
|
998
|
+
if (!whenExpr) {
|
|
999
|
+
ext.collector.error(( localize(
|
|
1000
|
+
7310,
|
|
1001
|
+
"Extension '{0}' chatPlugins entry '{1}' has an invalid when clause: '{2}'.",
|
|
1002
|
+
ext.description.identifier.value,
|
|
1003
|
+
raw.path,
|
|
1004
|
+
raw.when
|
|
1005
|
+
)));
|
|
1006
|
+
continue;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
this._extensionPlugins.set(extensionPluginKey(ext.description.identifier, raw.path), {
|
|
1010
|
+
uri: pluginUri,
|
|
1011
|
+
when: whenExpr,
|
|
1012
|
+
extensionId: ext.description.identifier.value
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
for (const ext of delta.removed) {
|
|
1017
|
+
for (const raw of ext.value) {
|
|
1018
|
+
this._extensionPlugins.delete(extensionPluginKey(ext.description.identifier, raw.path));
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
this._rebuildWhenKeys();
|
|
1022
|
+
scheduler.schedule();
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
_rebuildWhenKeys() {
|
|
1026
|
+
this._whenKeys.clear();
|
|
1027
|
+
for (const {
|
|
1028
|
+
when
|
|
1029
|
+
} of ( this._extensionPlugins.values())) {
|
|
1030
|
+
if (when) {
|
|
1031
|
+
for (const key of ( when.keys())) {
|
|
1032
|
+
this._whenKeys.add(key);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
async _discoverPluginSources() {
|
|
1038
|
+
const sources = [];
|
|
1039
|
+
for (const [, entry] of this._extensionPlugins) {
|
|
1040
|
+
if (entry.when && !this._contextKeyService.contextMatchesRules(entry.when)) {
|
|
1041
|
+
continue;
|
|
1042
|
+
}
|
|
1043
|
+
let stat;
|
|
1044
|
+
try {
|
|
1045
|
+
stat = await this._fileService.resolve(entry.uri);
|
|
1046
|
+
} catch {
|
|
1047
|
+
this._logService.debug(
|
|
1048
|
+
`[ExtensionAgentPluginDiscovery] Could not resolve extension plugin path: ${( entry.uri.toString())}`
|
|
1049
|
+
);
|
|
1050
|
+
continue;
|
|
1051
|
+
}
|
|
1052
|
+
if (!stat.isDirectory) {
|
|
1053
|
+
this._logService.debug(
|
|
1054
|
+
`[ExtensionAgentPluginDiscovery] Extension plugin path is not a directory: ${( entry.uri.toString())}`
|
|
1055
|
+
);
|
|
1056
|
+
continue;
|
|
1057
|
+
}
|
|
1058
|
+
sources.push({
|
|
1059
|
+
uri: stat.resource,
|
|
1060
|
+
fromMarketplace: undefined,
|
|
1061
|
+
remove: () => this._promptUninstallExtension(entry.extensionId)
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
return sources;
|
|
1065
|
+
}
|
|
1066
|
+
async _promptUninstallExtension(extensionId) {
|
|
1067
|
+
const {
|
|
1068
|
+
confirmed
|
|
1069
|
+
} = await this._dialogService.confirm({
|
|
1070
|
+
message: ( localize(
|
|
1071
|
+
7311,
|
|
1072
|
+
"This plugin is provided by the extension '{0}'. Do you want to uninstall the extension?",
|
|
1073
|
+
extensionId
|
|
1074
|
+
))
|
|
1075
|
+
});
|
|
1076
|
+
if (confirmed) {
|
|
1077
|
+
await this._commandService.executeCommand("workbench.extensions.uninstallExtension", extensionId);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
1081
|
+
ExtensionAgentPluginDiscovery = ( __decorate([( __param(0, ICommandService)), ( __param(1, IContextKeyService)), ( __param(2, IDialogService)), ( __param(3, IFileService)), ( __param(4, IPathService)), ( __param(5, ILogService)), ( __param(6, IInstantiationService))], ExtensionAgentPluginDiscovery));
|
|
1082
|
+
function extensionPluginKey(extensionId, path) {
|
|
1083
|
+
return `${extensionId.value}/${path}`;
|
|
1084
|
+
}
|
|
1085
|
+
class ChatPluginsDataRenderer extends Disposable {
|
|
1086
|
+
constructor() {
|
|
1087
|
+
super(...arguments);
|
|
1088
|
+
this.type = "table";
|
|
1089
|
+
}
|
|
1090
|
+
shouldRender(manifest) {
|
|
1091
|
+
return !!manifest.contributes?.chatPlugins?.length;
|
|
1092
|
+
}
|
|
1093
|
+
render(manifest) {
|
|
1094
|
+
const contributions = manifest.contributes?.chatPlugins ?? [];
|
|
1095
|
+
if (!contributions.length) {
|
|
1096
|
+
return {
|
|
1097
|
+
data: {
|
|
1098
|
+
headers: [],
|
|
1099
|
+
rows: []
|
|
1100
|
+
},
|
|
1101
|
+
dispose: () => {}
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
const headers = [( localize(7312, "Path")), ( localize(7313, "When"))];
|
|
1105
|
+
const rows = ( contributions.map(d => [d.path, d.when ?? "-"]));
|
|
1106
|
+
return {
|
|
1107
|
+
data: {
|
|
1108
|
+
headers,
|
|
1109
|
+
rows
|
|
1110
|
+
},
|
|
1111
|
+
dispose: () => {}
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
1116
|
+
id: "chatPlugins",
|
|
1117
|
+
label: ( localize(7314, "Chat Plugins")),
|
|
1118
|
+
access: {
|
|
1119
|
+
canToggle: false
|
|
1120
|
+
},
|
|
1121
|
+
renderer: ( new SyncDescriptor(ChatPluginsDataRenderer))
|
|
1122
|
+
});
|
|
896
1123
|
|
|
897
|
-
export { AbstractAgentPluginDiscovery, AgentPluginService, ConfiguredAgentPluginDiscovery, MarketplaceAgentPluginDiscovery, resolveMcpServersMap, shellQuotePluginRootInCommand };
|
|
1124
|
+
export { AbstractAgentPluginDiscovery, AgentPluginService, ConfiguredAgentPluginDiscovery, ExtensionAgentPluginDiscovery, MarketplaceAgentPluginDiscovery, convertBareEnvVarsToVsCodeSyntax, resolveMcpServersMap, shellQuotePluginRootInCommand };
|
package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IObservable, ITransaction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
5
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
6
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
7
|
+
/**
|
|
8
|
+
* In-memory representation of an installed plugin entry.
|
|
9
|
+
*/
|
|
10
|
+
export interface IStoredInstalledPlugin {
|
|
11
|
+
readonly pluginUri: URI;
|
|
12
|
+
readonly marketplace: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* An observable store for installed agent plugins that is backed by a
|
|
16
|
+
* `installed.json` file within the agent-plugins directory. This makes
|
|
17
|
+
* the installed-plugin manifest discoverable by external tools (CLIs,
|
|
18
|
+
* other editors, etc.) without depending on VS Code internals.
|
|
19
|
+
*
|
|
20
|
+
* The on-disk format stores only the plugin URI (as a string) and the
|
|
21
|
+
* marketplace identifier. Plugin metadata (name, description, etc.) is
|
|
22
|
+
* read from the plugin manifest on disk by the discovery layer -
|
|
23
|
+
* keeping a single source of truth.
|
|
24
|
+
*
|
|
25
|
+
* On construction the store:
|
|
26
|
+
* 1. Attempts to read `installed.json` from the agent-plugins directory.
|
|
27
|
+
* 2. If no file exists, migrates data from the legacy {@link StorageService}
|
|
28
|
+
* key (`chat.plugins.installed.v1`), rebasing plugin URIs from the old
|
|
29
|
+
* cache directory to the new agent-plugins directory.
|
|
30
|
+
* 3. Sets up a correlated file watcher so that external edits to
|
|
31
|
+
* `installed.json` are picked up automatically.
|
|
32
|
+
*
|
|
33
|
+
* Write operations update the in-memory observable synchronously and
|
|
34
|
+
* schedule a debounced file write so that rapid successive mutations
|
|
35
|
+
* (e.g. batch enables) are coalesced into a single I/O operation.
|
|
36
|
+
*/
|
|
37
|
+
export declare class FileBackedInstalledPluginsStore extends Disposable {
|
|
38
|
+
private readonly _agentPluginsHome;
|
|
39
|
+
private readonly _oldCacheRoot;
|
|
40
|
+
private readonly _fileService;
|
|
41
|
+
private readonly _logService;
|
|
42
|
+
private readonly _storageService;
|
|
43
|
+
private readonly _installed;
|
|
44
|
+
private readonly _fileUri;
|
|
45
|
+
private readonly _writeDelayer;
|
|
46
|
+
private _suppressFileWatch;
|
|
47
|
+
private _initialized;
|
|
48
|
+
readonly value: IObservable<readonly IStoredInstalledPlugin[]>;
|
|
49
|
+
constructor(_agentPluginsHome: URI, _oldCacheRoot: URI | undefined, _fileService: IFileService, _logService: ILogService, _storageService: IStorageService);
|
|
50
|
+
get(): readonly IStoredInstalledPlugin[];
|
|
51
|
+
set(newValue: readonly IStoredInstalledPlugin[], tx: ITransaction | undefined): void;
|
|
52
|
+
private _initialize;
|
|
53
|
+
private _readFromFile;
|
|
54
|
+
private _scheduleWrite;
|
|
55
|
+
private _writeToFile;
|
|
56
|
+
private _setupFileWatcher;
|
|
57
|
+
private _onFileChanged;
|
|
58
|
+
private _setValue;
|
|
59
|
+
private _migrateFromStorage;
|
|
60
|
+
/**
|
|
61
|
+
* If the plugin URI was under the old cache root, rebase it to the
|
|
62
|
+
* new agent-plugins directory. Otherwise, return `undefined` to keep
|
|
63
|
+
* the original.
|
|
64
|
+
*/
|
|
65
|
+
private _rebasePluginUri;
|
|
66
|
+
}
|
package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
|
|
2
|
+
import { ThrottledDelayer, RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
3
|
+
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
|
|
6
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
7
|
+
import { joinPath, isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
8
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
9
|
+
import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
10
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
11
|
+
|
|
12
|
+
const INSTALLED_JSON_FILENAME = "installed.json";
|
|
13
|
+
const INSTALLED_JSON_VERSION = 1;
|
|
14
|
+
const LEGACY_INSTALLED_PLUGINS_STORAGE_KEY = "chat.plugins.installed.v1";
|
|
15
|
+
const LEGACY_MARKETPLACE_INDEX_STORAGE_KEY = "chat.plugins.marketplaces.index.v1";
|
|
16
|
+
class FileBackedInstalledPluginsStore extends Disposable {
|
|
17
|
+
constructor(
|
|
18
|
+
_agentPluginsHome,
|
|
19
|
+
_oldCacheRoot,
|
|
20
|
+
_fileService,
|
|
21
|
+
_logService,
|
|
22
|
+
_storageService
|
|
23
|
+
) {
|
|
24
|
+
super();
|
|
25
|
+
this._agentPluginsHome = _agentPluginsHome;
|
|
26
|
+
this._oldCacheRoot = _oldCacheRoot;
|
|
27
|
+
this._fileService = _fileService;
|
|
28
|
+
this._logService = _logService;
|
|
29
|
+
this._storageService = _storageService;
|
|
30
|
+
this._installed = observableValue("file/installed.json", []);
|
|
31
|
+
this._suppressFileWatch = false;
|
|
32
|
+
this._initialized = false;
|
|
33
|
+
this.value = this._installed;
|
|
34
|
+
this._fileUri = joinPath(_agentPluginsHome, INSTALLED_JSON_FILENAME);
|
|
35
|
+
this._writeDelayer = this._register(( new ThrottledDelayer(100)));
|
|
36
|
+
void this._initialize();
|
|
37
|
+
}
|
|
38
|
+
get() {
|
|
39
|
+
return this._installed.get();
|
|
40
|
+
}
|
|
41
|
+
set(newValue, tx) {
|
|
42
|
+
this._setValue(newValue, tx, true);
|
|
43
|
+
}
|
|
44
|
+
async _initialize() {
|
|
45
|
+
try {
|
|
46
|
+
const read = await this._readFromFile();
|
|
47
|
+
if (read !== undefined) {
|
|
48
|
+
this._setValue(read, undefined, false);
|
|
49
|
+
} else {
|
|
50
|
+
await this._migrateFromStorage();
|
|
51
|
+
}
|
|
52
|
+
} catch (error) {
|
|
53
|
+
this._logService.error("[FileBackedInstalledPluginsStore] Initialization failed", error);
|
|
54
|
+
}
|
|
55
|
+
this._initialized = true;
|
|
56
|
+
this._setupFileWatcher();
|
|
57
|
+
}
|
|
58
|
+
async _readFromFile() {
|
|
59
|
+
try {
|
|
60
|
+
const exists = await this._fileService.exists(this._fileUri);
|
|
61
|
+
if (!exists) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
const content = await this._fileService.readFile(this._fileUri);
|
|
65
|
+
const json = JSON.parse(( content.value.toString()));
|
|
66
|
+
if (!json || !Array.isArray(json.installed)) {
|
|
67
|
+
this._logService.warn(
|
|
68
|
+
"[FileBackedInstalledPluginsStore] installed.json has unexpected format, ignoring"
|
|
69
|
+
);
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
return ( json.installed.filter(
|
|
73
|
+
entry => typeof entry.pluginUri === "string" && typeof entry.marketplace === "string"
|
|
74
|
+
).map(entry => ({
|
|
75
|
+
pluginUri: ( URI.parse(entry.pluginUri)),
|
|
76
|
+
marketplace: entry.marketplace
|
|
77
|
+
})));
|
|
78
|
+
} catch {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_scheduleWrite() {
|
|
83
|
+
void this._writeDelayer.trigger(async () => {
|
|
84
|
+
await this._writeToFile();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
async _writeToFile() {
|
|
88
|
+
const entries = ( this.get().map(e => ({
|
|
89
|
+
pluginUri: ( e.pluginUri.toString()),
|
|
90
|
+
marketplace: e.marketplace
|
|
91
|
+
})));
|
|
92
|
+
const data = {
|
|
93
|
+
version: INSTALLED_JSON_VERSION,
|
|
94
|
+
installed: entries
|
|
95
|
+
};
|
|
96
|
+
try {
|
|
97
|
+
this._suppressFileWatch = true;
|
|
98
|
+
const content = JSON.stringify(data, undefined, "\t");
|
|
99
|
+
await this._fileService.createFolder(this._agentPluginsHome);
|
|
100
|
+
await this._fileService.writeFile(this._fileUri, VSBuffer.fromString(content));
|
|
101
|
+
return true;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
this._logService.error("[FileBackedInstalledPluginsStore] Failed to write installed.json", error);
|
|
104
|
+
return false;
|
|
105
|
+
} finally {
|
|
106
|
+
this._suppressFileWatch = false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
_setupFileWatcher() {
|
|
110
|
+
if (typeof this._fileService.createWatcher !== "function") {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const dir = this._agentPluginsHome;
|
|
114
|
+
const watcher = this._fileService.createWatcher(dir, {
|
|
115
|
+
recursive: false,
|
|
116
|
+
excludes: []
|
|
117
|
+
});
|
|
118
|
+
this._register(watcher);
|
|
119
|
+
const scheduler = this._register(( new RunOnceScheduler(() => this._onFileChanged(), 100)));
|
|
120
|
+
this._register(watcher.onDidChange(e => {
|
|
121
|
+
if (!this._suppressFileWatch && e.affects(this._fileUri)) {
|
|
122
|
+
scheduler.schedule();
|
|
123
|
+
}
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
async _onFileChanged() {
|
|
127
|
+
const read = await this._readFromFile();
|
|
128
|
+
if (read !== undefined) {
|
|
129
|
+
this._suppressFileWatch = true;
|
|
130
|
+
try {
|
|
131
|
+
this._setValue(read, undefined, false);
|
|
132
|
+
} finally {
|
|
133
|
+
this._suppressFileWatch = false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
_setValue(newValue, tx, scheduleWrite) {
|
|
138
|
+
this._installed.set(newValue, tx);
|
|
139
|
+
if (scheduleWrite && this._initialized && !this._suppressFileWatch) {
|
|
140
|
+
this._scheduleWrite();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async _migrateFromStorage() {
|
|
144
|
+
const raw = this._storageService.get(LEGACY_INSTALLED_PLUGINS_STORAGE_KEY, StorageScope.APPLICATION);
|
|
145
|
+
if (!raw) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
const parsed = JSON.parse(raw);
|
|
150
|
+
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const migrated = ( revive(parsed).map(entry => {
|
|
154
|
+
const uri = URI.revive(entry.pluginUri);
|
|
155
|
+
const rebased = this._rebasePluginUri(uri);
|
|
156
|
+
return {
|
|
157
|
+
pluginUri: rebased ?? uri,
|
|
158
|
+
marketplace: entry.plugin?.marketplaceReference?.rawValue ?? ""
|
|
159
|
+
};
|
|
160
|
+
})).filter(e => !!e.marketplace);
|
|
161
|
+
this._logService.info(
|
|
162
|
+
`[FileBackedInstalledPluginsStore] Migrating ${migrated.length} plugin(s) from storage to installed.json`
|
|
163
|
+
);
|
|
164
|
+
this._setValue(migrated, undefined, false);
|
|
165
|
+
const didPersist = await this._writeToFile();
|
|
166
|
+
if (!didPersist) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
this._storageService.remove(LEGACY_INSTALLED_PLUGINS_STORAGE_KEY, StorageScope.APPLICATION);
|
|
170
|
+
this._storageService.remove(LEGACY_MARKETPLACE_INDEX_STORAGE_KEY, StorageScope.APPLICATION);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
this._logService.error("[FileBackedInstalledPluginsStore] Migration from storage failed", error);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
_rebasePluginUri(uri) {
|
|
176
|
+
if (!this._oldCacheRoot) {
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
const oldRoot = this._oldCacheRoot;
|
|
180
|
+
if (!isEqual(uri, oldRoot) && uri.scheme === oldRoot.scheme && uri.path.startsWith(oldRoot.path + "/")) {
|
|
181
|
+
const relativePart = uri.path.substring(oldRoot.path.length);
|
|
182
|
+
return uri.with({
|
|
183
|
+
path: this._agentPluginsHome.path + relativePart
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { FileBackedInstalledPluginsStore };
|