@codingame/monaco-vscode-chat-service-override 26.2.2 → 28.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 +35 -2
- package/package.json +5 -5
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.d.ts +53 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.js +219 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +89 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +251 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +123 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.js +278 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.d.ts +76 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.js +299 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.d.ts +67 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.js +263 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.d.ts +85 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.js +397 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +27 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +74 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +54 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +87 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +71 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +43 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +13 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +22 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +154 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -8
- 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 +53 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +18 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +49 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +537 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.js +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/media/agentPluginEditor.css +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +282 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +634 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +10 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +74 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +27 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +4 -2
- 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 +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +90 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +20 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +43 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +84 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/{localAgentSessionsProvider.d.ts → localAgentSessionsController.d.ts} +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/{localAgentSessionsProvider.js → localAgentSessionsController.js} +24 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +179 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +987 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +246 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +878 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +165 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +692 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +936 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +702 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +30 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +36 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +622 -391
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +419 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.js +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +198 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +314 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +611 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +504 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +914 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +128 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +467 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +113 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +126 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +279 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +788 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +32 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +6 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditorController.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +16 -15
- 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 +63 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +26 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +2 -2
- 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.d.ts +24 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +40 -413
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +38 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +56 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +15 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +138 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +166 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +37 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +394 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +118 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +245 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.js +234 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +88 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +624 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.js +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +88 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +28 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/createSlashCommandsUsageTracker.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/createSlashCommandsUsageTracker.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/exploreAgentDefaultModel.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/exploreAgentDefaultModel.js +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/planAgentDefaultModel.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planAgentDefaultModel.js +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +175 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +99 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +489 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +19 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +364 -279
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +18 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +69 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +76 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +67 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +187 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +242 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +311 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +29 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +8 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +126 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +9 -5
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +46 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +65 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +16 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewTitleControl.css +15 -6
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.js +28 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +190 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +208 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +19 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +261 -105
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +21 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +7 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +5 -6
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +16 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +13 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +144 -11
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +36 -3
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +119 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +748 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +146 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +672 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +35 -16
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +3 -16
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +7 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +4 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +10 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +26 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +293 -94
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +86 -30
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +121 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +1422 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +48 -14
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +404 -132
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +17 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +40 -28
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +14 -2
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +54 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +12 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +27 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +265 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.d.ts +6 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +18 -81
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +10 -10
- 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 +10 -10
- 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/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css +6 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +35 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +1 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +13 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +3 -1
- 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/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +302 -69
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +63 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +31 -0
- 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 +7 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +46 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.js +0 -587
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -51
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.d.ts +0 -71
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +0 -293
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/utils.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/utils.js +0 -31
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
5
|
+
import { untildify } from '@codingame/monaco-vscode-api/vscode/vs/base/common/labels';
|
|
6
|
+
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
8
|
+
import { cloneAndChange } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
9
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
10
|
+
import { win32, posix } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
11
|
+
import { joinPath, basename, extname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
12
|
+
import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
13
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
14
|
+
import { ConfigurationTarget, getConfigValueInTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
15
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
16
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
17
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
18
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
19
|
+
import { McpServerType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes';
|
|
20
|
+
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
21
|
+
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
22
|
+
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
23
|
+
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
24
|
+
import { parseClaudeHooks } from '../promptSyntax/hookClaudeCompat.js';
|
|
25
|
+
import { parseCopilotHooks } from '../promptSyntax/hookCompatibility.js';
|
|
26
|
+
import { agentPluginDiscoveryRegistry } from './agentPluginService.js';
|
|
27
|
+
import { IAgentPluginRepositoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service';
|
|
28
|
+
import { IPluginMarketplaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service';
|
|
29
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
30
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
31
|
+
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
32
|
+
|
|
33
|
+
const COMMAND_FILE_SUFFIX = ".md";
|
|
34
|
+
var AgentPluginFormat;
|
|
35
|
+
(function(AgentPluginFormat) {
|
|
36
|
+
AgentPluginFormat[AgentPluginFormat["Copilot"] = 0] = "Copilot";
|
|
37
|
+
AgentPluginFormat[AgentPluginFormat["Claude"] = 1] = "Claude";
|
|
38
|
+
})(AgentPluginFormat || (AgentPluginFormat = {}));
|
|
39
|
+
function mapParsedHooks(parsed) {
|
|
40
|
+
return ( [...parsed.entries()].map((
|
|
41
|
+
[type, {
|
|
42
|
+
hooks,
|
|
43
|
+
originalId
|
|
44
|
+
}]
|
|
45
|
+
) => ({
|
|
46
|
+
type,
|
|
47
|
+
hooks,
|
|
48
|
+
originalId
|
|
49
|
+
})));
|
|
50
|
+
}
|
|
51
|
+
function resolveWorkspaceRoot(pluginUri, workspaceContextService) {
|
|
52
|
+
const defaultFolder = workspaceContextService.getWorkspace().folders[0];
|
|
53
|
+
const folder = workspaceContextService.getWorkspaceFolder(pluginUri) ?? defaultFolder;
|
|
54
|
+
return folder?.uri;
|
|
55
|
+
}
|
|
56
|
+
let CopilotPluginFormatAdapter = class CopilotPluginFormatAdapter {
|
|
57
|
+
constructor(_workspaceContextService) {
|
|
58
|
+
this._workspaceContextService = _workspaceContextService;
|
|
59
|
+
this.format = AgentPluginFormat.Copilot;
|
|
60
|
+
this.manifestPaths = ["plugin.json"];
|
|
61
|
+
this.hookConfigPaths = ["hooks.json"];
|
|
62
|
+
this.hookWatchPaths = ["hooks.json"];
|
|
63
|
+
}
|
|
64
|
+
parseHooks(json, pluginUri, userHome) {
|
|
65
|
+
const workspaceRoot = resolveWorkspaceRoot(pluginUri, this._workspaceContextService);
|
|
66
|
+
return mapParsedHooks(parseCopilotHooks(json, workspaceRoot, userHome));
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
CopilotPluginFormatAdapter = ( __decorate([( __param(0, IWorkspaceContextService))], CopilotPluginFormatAdapter));
|
|
70
|
+
const shellUnsafeChars = /[\s&|<>()^;!`"']/;
|
|
71
|
+
function shellQuotePluginRootInCommand(command, fsPath, token = "${CLAUDE_PLUGIN_ROOT}") {
|
|
72
|
+
if (!command.includes(token)) {
|
|
73
|
+
return command;
|
|
74
|
+
}
|
|
75
|
+
if (!shellUnsafeChars.test(fsPath)) {
|
|
76
|
+
return command.replaceAll(token, fsPath);
|
|
77
|
+
}
|
|
78
|
+
const escapedToken = escapeRegExpCharacters(token);
|
|
79
|
+
const pattern = ( new RegExp(
|
|
80
|
+
`(["']?)` + escapedToken + `([\\w./\\\\~:-]*)`, "g"));
|
|
81
|
+
return command.replace(pattern, (_match, leadingQuote, suffix) => {
|
|
82
|
+
const fullPath = fsPath + suffix;
|
|
83
|
+
if (leadingQuote) {
|
|
84
|
+
return leadingQuote + fullPath;
|
|
85
|
+
}
|
|
86
|
+
return "\"" + fullPath.replace(/"/g, "\\\"") + "\"";
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
let ClaudePluginFormatAdapter = class ClaudePluginFormatAdapter {
|
|
90
|
+
constructor(_workspaceContextService) {
|
|
91
|
+
this._workspaceContextService = _workspaceContextService;
|
|
92
|
+
this.format = AgentPluginFormat.Claude;
|
|
93
|
+
this.manifestPaths = [".claude-plugin/plugin.json"];
|
|
94
|
+
this.hookConfigPaths = ["hooks/hooks.json"];
|
|
95
|
+
this.hookWatchPaths = ["hooks"];
|
|
96
|
+
}
|
|
97
|
+
parseHooks(json, pluginUri, userHome) {
|
|
98
|
+
const token = "${CLAUDE_PLUGIN_ROOT}";
|
|
99
|
+
const fsPath = pluginUri.fsPath;
|
|
100
|
+
const typedJson = json;
|
|
101
|
+
const mutateHookCommand = hook => {
|
|
102
|
+
for (const field of ["command", "windows", "linux", "osx"]) {
|
|
103
|
+
if (typeof hook[field] === "string") {
|
|
104
|
+
hook[field] = shellQuotePluginRootInCommand(hook[field], fsPath, token);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
hook.env ??= {};
|
|
108
|
+
hook.env.CLAUDE_PLUGIN_ROOT = fsPath;
|
|
109
|
+
};
|
|
110
|
+
for (const lifecycle of ( Object.values(typedJson.hooks ?? {}))) {
|
|
111
|
+
if (!Array.isArray(lifecycle)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
for (const lifecycleEntry of lifecycle) {
|
|
115
|
+
if (!lifecycleEntry || typeof lifecycleEntry !== "object") {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const entry = lifecycleEntry;
|
|
119
|
+
if (Array.isArray(entry.hooks)) {
|
|
120
|
+
for (const hook of entry.hooks) {
|
|
121
|
+
mutateHookCommand(hook);
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
mutateHookCommand(entry);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const replacer = v => {
|
|
129
|
+
return typeof v === "string" ? v.replaceAll("${CLAUDE_PLUGIN_ROOT}", pluginUri.fsPath) : undefined;
|
|
130
|
+
};
|
|
131
|
+
const workspaceRoot = resolveWorkspaceRoot(pluginUri, this._workspaceContextService);
|
|
132
|
+
const {
|
|
133
|
+
hooks,
|
|
134
|
+
disabledAllHooks
|
|
135
|
+
} = parseClaudeHooks(cloneAndChange(json, replacer), workspaceRoot, userHome);
|
|
136
|
+
if (disabledAllHooks) {
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
return mapParsedHooks(hooks);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
ClaudePluginFormatAdapter = ( __decorate([( __param(0, IWorkspaceContextService))], ClaudePluginFormatAdapter));
|
|
143
|
+
let AgentPluginService = class AgentPluginService extends Disposable {
|
|
144
|
+
constructor(instantiationService, configurationService) {
|
|
145
|
+
super();
|
|
146
|
+
const pluginsEnabled = observableConfigValue(ChatConfiguration.PluginsEnabled, true, configurationService);
|
|
147
|
+
const discoveries = [];
|
|
148
|
+
for (const descriptor of agentPluginDiscoveryRegistry.getAll()) {
|
|
149
|
+
const discovery = instantiationService.createInstance(descriptor);
|
|
150
|
+
this._register(discovery);
|
|
151
|
+
discoveries.push(discovery);
|
|
152
|
+
discovery.start();
|
|
153
|
+
}
|
|
154
|
+
this.allPlugins = derived(read => {
|
|
155
|
+
if (!pluginsEnabled.read(read)) {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
return this._dedupeAndSort(discoveries.flatMap(d => d.plugins.read(read)));
|
|
159
|
+
});
|
|
160
|
+
this.plugins = derived(reader => {
|
|
161
|
+
const all = this.allPlugins.read(reader);
|
|
162
|
+
return all.filter(p => p.enabled.read(reader));
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
setPluginEnabled(pluginUri, enabled) {
|
|
166
|
+
const plugin = this.allPlugins.get().find(p => ( p.uri.toString()) === ( pluginUri.toString()));
|
|
167
|
+
if (plugin) {
|
|
168
|
+
plugin.setEnabled(enabled);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
_dedupeAndSort(plugins) {
|
|
172
|
+
const unique = [];
|
|
173
|
+
const seen = ( new ResourceSet());
|
|
174
|
+
for (const plugin of plugins) {
|
|
175
|
+
if (( seen.has(plugin.uri))) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
seen.add(plugin.uri);
|
|
179
|
+
unique.push(plugin);
|
|
180
|
+
}
|
|
181
|
+
unique.sort((a, b) => ( a.uri.toString()).localeCompare(( b.uri.toString())));
|
|
182
|
+
return unique;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
AgentPluginService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IConfigurationService))], AgentPluginService));
|
|
186
|
+
class AbstractAgentPluginDiscovery extends Disposable {
|
|
187
|
+
constructor(_fileService, _pathService, _logService, _instantiationService) {
|
|
188
|
+
super();
|
|
189
|
+
this._fileService = _fileService;
|
|
190
|
+
this._pathService = _pathService;
|
|
191
|
+
this._logService = _logService;
|
|
192
|
+
this._instantiationService = _instantiationService;
|
|
193
|
+
this._pluginEntries = ( new Map());
|
|
194
|
+
this._plugins = observableValue("discoveredAgentPlugins", []);
|
|
195
|
+
this.plugins = this._plugins;
|
|
196
|
+
this._discoverVersion = 0;
|
|
197
|
+
}
|
|
198
|
+
async _refreshPlugins() {
|
|
199
|
+
const version = ++this._discoverVersion;
|
|
200
|
+
const plugins = await this._discoverAndBuildPlugins();
|
|
201
|
+
if (version !== this._discoverVersion || this._store.isDisposed) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
this._plugins.set(plugins, undefined);
|
|
205
|
+
}
|
|
206
|
+
async _discoverAndBuildPlugins() {
|
|
207
|
+
const sources = await this._discoverPluginSources();
|
|
208
|
+
const plugins = [];
|
|
209
|
+
const seenPluginUris = ( new Set());
|
|
210
|
+
for (const source of sources) {
|
|
211
|
+
const key = ( source.uri.toString());
|
|
212
|
+
if (!( seenPluginUris.has(key))) {
|
|
213
|
+
seenPluginUris.add(key);
|
|
214
|
+
const adapter = await this._detectPluginFormatAdapter(source.uri);
|
|
215
|
+
plugins.push(this._toPlugin(
|
|
216
|
+
source.uri,
|
|
217
|
+
source.enabled,
|
|
218
|
+
adapter,
|
|
219
|
+
source.fromMarketplace,
|
|
220
|
+
value => source.setEnabled(value),
|
|
221
|
+
() => source.remove()
|
|
222
|
+
));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
this._disposePluginEntriesExcept(seenPluginUris);
|
|
226
|
+
plugins.sort((a, b) => ( a.uri.toString()).localeCompare(( b.uri.toString())));
|
|
227
|
+
return plugins;
|
|
228
|
+
}
|
|
229
|
+
async _detectPluginFormatAdapter(pluginUri) {
|
|
230
|
+
const isInClaudeDirectory = pluginUri.path.split("/").includes(".claude");
|
|
231
|
+
if (isInClaudeDirectory || (await this._pathExists(joinPath(pluginUri, ".claude-plugin", "plugin.json")))) {
|
|
232
|
+
return this._instantiationService.createInstance(ClaudePluginFormatAdapter);
|
|
233
|
+
}
|
|
234
|
+
return this._instantiationService.createInstance(CopilotPluginFormatAdapter);
|
|
235
|
+
}
|
|
236
|
+
async _pathExists(resource) {
|
|
237
|
+
try {
|
|
238
|
+
await this._fileService.resolve(resource);
|
|
239
|
+
return true;
|
|
240
|
+
} catch {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
_toPlugin(
|
|
245
|
+
uri,
|
|
246
|
+
initialEnabled,
|
|
247
|
+
adapter,
|
|
248
|
+
fromMarketplace,
|
|
249
|
+
setEnabledCallback,
|
|
250
|
+
removeCallback
|
|
251
|
+
) {
|
|
252
|
+
const key = ( uri.toString());
|
|
253
|
+
const existing = this._pluginEntries.get(key);
|
|
254
|
+
if (existing) {
|
|
255
|
+
if (existing.adapter.format !== adapter.format) {
|
|
256
|
+
existing.store.dispose();
|
|
257
|
+
this._pluginEntries.delete(key);
|
|
258
|
+
} else {
|
|
259
|
+
existing.plugin.enabled.set(initialEnabled, undefined);
|
|
260
|
+
return existing.plugin;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const store = ( new DisposableStore());
|
|
264
|
+
const commands = observableValue("agentPluginCommands", []);
|
|
265
|
+
const skills = observableValue("agentPluginSkills", []);
|
|
266
|
+
const agents = observableValue("agentPluginAgents", []);
|
|
267
|
+
const hooks = observableValue("agentPluginHooks", []);
|
|
268
|
+
const mcpServerDefinitions = observableValue("agentPluginMcpServerDefinitions", []);
|
|
269
|
+
const enabled = observableValue("agentPluginEnabled", initialEnabled);
|
|
270
|
+
const commandsDir = joinPath(uri, "commands");
|
|
271
|
+
const skillsDir = joinPath(uri, "skills");
|
|
272
|
+
const agentsDir = joinPath(uri, "agents");
|
|
273
|
+
const commandsScheduler = store.add(( new RunOnceScheduler(async () => {
|
|
274
|
+
commands.set(await this._readCommands(uri), undefined);
|
|
275
|
+
}, 200)));
|
|
276
|
+
const skillsScheduler = store.add(( new RunOnceScheduler(async () => {
|
|
277
|
+
skills.set(await this._readSkills(uri), undefined);
|
|
278
|
+
}, 200)));
|
|
279
|
+
const agentsScheduler = store.add(( new RunOnceScheduler(async () => {
|
|
280
|
+
agents.set(await this._readAgents(uri), undefined);
|
|
281
|
+
}, 200)));
|
|
282
|
+
const hooksScheduler = store.add(( new RunOnceScheduler(async () => {
|
|
283
|
+
hooks.set(await this._readHooks(uri, adapter), undefined);
|
|
284
|
+
}, 200)));
|
|
285
|
+
const mcpScheduler = store.add(( new RunOnceScheduler(async () => {
|
|
286
|
+
mcpServerDefinitions.set(await this._readMcpDefinitions(uri, adapter), undefined);
|
|
287
|
+
}, 200)));
|
|
288
|
+
store.add(this._fileService.watch(uri, {
|
|
289
|
+
recursive: true,
|
|
290
|
+
excludes: []
|
|
291
|
+
}));
|
|
292
|
+
store.add(this._fileService.onDidFilesChange(e => {
|
|
293
|
+
if (e.affects(commandsDir)) {
|
|
294
|
+
commandsScheduler.schedule();
|
|
295
|
+
}
|
|
296
|
+
if (e.affects(skillsDir)) {
|
|
297
|
+
skillsScheduler.schedule();
|
|
298
|
+
}
|
|
299
|
+
if (e.affects(agentsDir)) {
|
|
300
|
+
agentsScheduler.schedule();
|
|
301
|
+
}
|
|
302
|
+
if (( adapter.hookWatchPaths.some(path => e.affects(joinPath(uri, path))))) {
|
|
303
|
+
hooksScheduler.schedule();
|
|
304
|
+
}
|
|
305
|
+
if (e.affects(joinPath(uri, ".mcp.json")) || ( adapter.manifestPaths.some(path => e.affects(joinPath(uri, path))))) {
|
|
306
|
+
mcpScheduler.schedule();
|
|
307
|
+
hooksScheduler.schedule();
|
|
308
|
+
}
|
|
309
|
+
}));
|
|
310
|
+
commandsScheduler.schedule();
|
|
311
|
+
skillsScheduler.schedule();
|
|
312
|
+
agentsScheduler.schedule();
|
|
313
|
+
hooksScheduler.schedule();
|
|
314
|
+
mcpScheduler.schedule();
|
|
315
|
+
const plugin = {
|
|
316
|
+
uri,
|
|
317
|
+
label: fromMarketplace?.name ?? basename(uri),
|
|
318
|
+
enabled,
|
|
319
|
+
setEnabled: setEnabledCallback,
|
|
320
|
+
remove: removeCallback,
|
|
321
|
+
hooks,
|
|
322
|
+
commands,
|
|
323
|
+
skills,
|
|
324
|
+
agents,
|
|
325
|
+
mcpServerDefinitions,
|
|
326
|
+
fromMarketplace
|
|
327
|
+
};
|
|
328
|
+
this._pluginEntries.set(key, {
|
|
329
|
+
store,
|
|
330
|
+
plugin,
|
|
331
|
+
adapter
|
|
332
|
+
});
|
|
333
|
+
return plugin;
|
|
334
|
+
}
|
|
335
|
+
async _readMcpDefinitions(pluginUri, adapter) {
|
|
336
|
+
const mcpUri = joinPath(pluginUri, ".mcp.json");
|
|
337
|
+
const mcpFileConfig = await this._readJsonFile(mcpUri);
|
|
338
|
+
const fileDefinitions = this._parseMcpServerDefinitionMap(mcpFileConfig);
|
|
339
|
+
const pluginJsonDefinitions = await this._readInlinePluginJsonMcpDefinitions(pluginUri, adapter);
|
|
340
|
+
const merged = ( new Map());
|
|
341
|
+
for (const definition of fileDefinitions) {
|
|
342
|
+
merged.set(definition.name, definition.configuration);
|
|
343
|
+
}
|
|
344
|
+
for (const definition of pluginJsonDefinitions) {
|
|
345
|
+
if (!( merged.has(definition.name))) {
|
|
346
|
+
merged.set(definition.name, definition.configuration);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const definitions = ( [...merged.entries()].map(([name, configuration]) => ({
|
|
350
|
+
name,
|
|
351
|
+
configuration
|
|
352
|
+
}))).sort((a, b) => a.name.localeCompare(b.name));
|
|
353
|
+
return definitions;
|
|
354
|
+
}
|
|
355
|
+
async _readInlinePluginJsonMcpDefinitions(pluginUri, adapter) {
|
|
356
|
+
for (const manifestPath of ( adapter.manifestPaths.map(path => joinPath(pluginUri, path)))) {
|
|
357
|
+
const manifest = await this._readJsonFile(manifestPath);
|
|
358
|
+
if (!manifest || typeof manifest !== "object") {
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
const definitions = this._parseMcpServerDefinitionMap(manifest);
|
|
362
|
+
if (definitions.length > 0) {
|
|
363
|
+
return definitions;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return [];
|
|
367
|
+
}
|
|
368
|
+
_parseMcpServerDefinitionMap(raw) {
|
|
369
|
+
if (!raw || typeof raw !== "object" || !raw.hasOwnProperty("mcpServers")) {
|
|
370
|
+
return [];
|
|
371
|
+
}
|
|
372
|
+
const definitions = [];
|
|
373
|
+
for (const [name, configValue] of Object.entries(raw.mcpServers)) {
|
|
374
|
+
const configuration = this._normalizeMcpServerConfiguration(configValue);
|
|
375
|
+
if (!configuration) {
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
definitions.push({
|
|
379
|
+
name,
|
|
380
|
+
configuration
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
return definitions;
|
|
384
|
+
}
|
|
385
|
+
_normalizeMcpServerConfiguration(rawConfig) {
|
|
386
|
+
if (!rawConfig || typeof rawConfig !== "object") {
|
|
387
|
+
return undefined;
|
|
388
|
+
}
|
|
389
|
+
const candidate = rawConfig;
|
|
390
|
+
const type = typeof candidate["type"] === "string" ? candidate["type"] : undefined;
|
|
391
|
+
const command = typeof candidate["command"] === "string" ? candidate["command"] : undefined;
|
|
392
|
+
const url = typeof candidate["url"] === "string" ? candidate["url"] : undefined;
|
|
393
|
+
const args = Array.isArray(candidate["args"]) ? candidate["args"].filter(value => typeof value === "string") : undefined;
|
|
394
|
+
const env = candidate["env"] && typeof candidate["env"] === "object" ? Object.fromEntries(( Object.entries(candidate["env"]).filter(
|
|
395
|
+
([, value]) => typeof value === "string" || typeof value === "number" || value === null
|
|
396
|
+
).map(([key, value]) => [key, value]))) : undefined;
|
|
397
|
+
const envFile = typeof candidate["envFile"] === "string" ? candidate["envFile"] : undefined;
|
|
398
|
+
const cwd = typeof candidate["cwd"] === "string" ? candidate["cwd"] : undefined;
|
|
399
|
+
const headers = candidate["headers"] && typeof candidate["headers"] === "object" ? Object.fromEntries(( Object.entries(candidate["headers"]).filter(([, value]) => typeof value === "string").map(([key, value]) => [key, value]))) : undefined;
|
|
400
|
+
const dev = candidate["dev"] && typeof candidate["dev"] === "object" ? candidate["dev"] : undefined;
|
|
401
|
+
if (type === "ws") {
|
|
402
|
+
return undefined;
|
|
403
|
+
}
|
|
404
|
+
if (type === McpServerType.LOCAL || (!type && command)) {
|
|
405
|
+
if (!command) {
|
|
406
|
+
return undefined;
|
|
407
|
+
}
|
|
408
|
+
return {
|
|
409
|
+
type: McpServerType.LOCAL,
|
|
410
|
+
command,
|
|
411
|
+
args,
|
|
412
|
+
env,
|
|
413
|
+
envFile,
|
|
414
|
+
cwd,
|
|
415
|
+
dev
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
if (type === McpServerType.REMOTE || type === "sse" || (!type && url)) {
|
|
419
|
+
if (!url) {
|
|
420
|
+
return undefined;
|
|
421
|
+
}
|
|
422
|
+
return {
|
|
423
|
+
type: McpServerType.REMOTE,
|
|
424
|
+
url,
|
|
425
|
+
headers,
|
|
426
|
+
dev
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
return undefined;
|
|
430
|
+
}
|
|
431
|
+
async _readHooks(pluginUri, adapter) {
|
|
432
|
+
const userHome = (await this._pathService.userHome()).fsPath;
|
|
433
|
+
for (const hooksUri of ( adapter.hookConfigPaths.map(path => joinPath(pluginUri, path)))) {
|
|
434
|
+
const json = await this._readJsonFile(hooksUri);
|
|
435
|
+
if (json) {
|
|
436
|
+
try {
|
|
437
|
+
return adapter.parseHooks(json, pluginUri, userHome);
|
|
438
|
+
} catch (e) {
|
|
439
|
+
this._logService.info(
|
|
440
|
+
`[ConfiguredAgentPluginDiscovery] Failed to parse hooks from ${( hooksUri.toString())}:`,
|
|
441
|
+
e
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
for (const manifestPath of ( adapter.manifestPaths.map(path => joinPath(pluginUri, path)))) {
|
|
447
|
+
const manifest = await this._readJsonFile(manifestPath);
|
|
448
|
+
if (manifest && typeof manifest === "object") {
|
|
449
|
+
const hooks = manifest["hooks"];
|
|
450
|
+
if (hooks && typeof hooks === "object") {
|
|
451
|
+
try {
|
|
452
|
+
return adapter.parseHooks({
|
|
453
|
+
hooks
|
|
454
|
+
}, pluginUri, userHome);
|
|
455
|
+
} catch (e) {
|
|
456
|
+
this._logService.info(
|
|
457
|
+
`[ConfiguredAgentPluginDiscovery] Failed to parse hooks from manifest ${( manifestPath.toString())}:`,
|
|
458
|
+
e
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return [];
|
|
465
|
+
}
|
|
466
|
+
async _readJsonFile(uri) {
|
|
467
|
+
try {
|
|
468
|
+
const fileContents = await this._fileService.readFile(uri);
|
|
469
|
+
return parse(( fileContents.value.toString()));
|
|
470
|
+
} catch {
|
|
471
|
+
return undefined;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
async _readSkills(uri) {
|
|
475
|
+
const skillsDir = joinPath(uri, "skills");
|
|
476
|
+
let stat;
|
|
477
|
+
try {
|
|
478
|
+
stat = await this._fileService.resolve(skillsDir);
|
|
479
|
+
} catch {
|
|
480
|
+
return [];
|
|
481
|
+
}
|
|
482
|
+
if (!stat.isDirectory || !stat.children) {
|
|
483
|
+
return [];
|
|
484
|
+
}
|
|
485
|
+
const skills = [];
|
|
486
|
+
for (const child of stat.children) {
|
|
487
|
+
const skillMd = URI.joinPath(child.resource, "SKILL.md");
|
|
488
|
+
if (!(await this._pathExists(skillMd))) {
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
skills.push({
|
|
492
|
+
uri: skillMd,
|
|
493
|
+
name: basename(child.resource)
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
497
|
+
return skills;
|
|
498
|
+
}
|
|
499
|
+
async _readAgents(uri) {
|
|
500
|
+
const agentsDir = joinPath(uri, "agents");
|
|
501
|
+
let stat;
|
|
502
|
+
try {
|
|
503
|
+
stat = await this._fileService.resolve(agentsDir);
|
|
504
|
+
} catch {
|
|
505
|
+
return [];
|
|
506
|
+
}
|
|
507
|
+
if (!stat.isDirectory || !stat.children) {
|
|
508
|
+
return [];
|
|
509
|
+
}
|
|
510
|
+
const agents = [];
|
|
511
|
+
for (const child of stat.children) {
|
|
512
|
+
if (!child.isFile || extname(child.resource).toLowerCase() !== COMMAND_FILE_SUFFIX) {
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
const name = basename(child.resource).slice(0, -COMMAND_FILE_SUFFIX.length);
|
|
516
|
+
agents.push({
|
|
517
|
+
uri: child.resource,
|
|
518
|
+
name
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
agents.sort((a, b) => a.name.localeCompare(b.name));
|
|
522
|
+
return agents;
|
|
523
|
+
}
|
|
524
|
+
async _readCommands(uri) {
|
|
525
|
+
const commandsDir = joinPath(uri, "commands");
|
|
526
|
+
let stat;
|
|
527
|
+
try {
|
|
528
|
+
stat = await this._fileService.resolve(commandsDir);
|
|
529
|
+
} catch {
|
|
530
|
+
return [];
|
|
531
|
+
}
|
|
532
|
+
if (!stat.isDirectory || !stat.children) {
|
|
533
|
+
return [];
|
|
534
|
+
}
|
|
535
|
+
const commands = [];
|
|
536
|
+
for (const child of stat.children) {
|
|
537
|
+
if (!child.isFile || extname(child.resource).toLowerCase() !== COMMAND_FILE_SUFFIX) {
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
const name = basename(child.resource).slice(0, -COMMAND_FILE_SUFFIX.length);
|
|
541
|
+
commands.push({
|
|
542
|
+
uri: child.resource,
|
|
543
|
+
name
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
commands.sort((a, b) => a.name.localeCompare(b.name));
|
|
547
|
+
return commands;
|
|
548
|
+
}
|
|
549
|
+
_disposePluginEntriesExcept(keep) {
|
|
550
|
+
for (const [key, entry] of this._pluginEntries) {
|
|
551
|
+
if (!( keep.has(key))) {
|
|
552
|
+
entry.store.dispose();
|
|
553
|
+
this._pluginEntries.delete(key);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
dispose() {
|
|
558
|
+
this._disposePluginEntriesExcept(( new Set()));
|
|
559
|
+
super.dispose();
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
let ConfiguredAgentPluginDiscovery = class ConfiguredAgentPluginDiscovery extends AbstractAgentPluginDiscovery {
|
|
563
|
+
constructor(
|
|
564
|
+
_configurationService,
|
|
565
|
+
fileService,
|
|
566
|
+
_pluginMarketplaceService,
|
|
567
|
+
_workspaceContextService,
|
|
568
|
+
pathService,
|
|
569
|
+
logService,
|
|
570
|
+
instantiationService
|
|
571
|
+
) {
|
|
572
|
+
super(fileService, pathService, logService, instantiationService);
|
|
573
|
+
this._configurationService = _configurationService;
|
|
574
|
+
this._pluginMarketplaceService = _pluginMarketplaceService;
|
|
575
|
+
this._workspaceContextService = _workspaceContextService;
|
|
576
|
+
this._pluginLocationsConfig = observableConfigValue(ChatConfiguration.PluginLocations, {}, _configurationService);
|
|
577
|
+
}
|
|
578
|
+
start() {
|
|
579
|
+
const scheduler = this._register(( new RunOnceScheduler(() => this._refreshPlugins(), 0)));
|
|
580
|
+
this._register(autorun(reader => {
|
|
581
|
+
this._pluginLocationsConfig.read(reader);
|
|
582
|
+
scheduler.schedule();
|
|
583
|
+
}));
|
|
584
|
+
scheduler.schedule();
|
|
585
|
+
}
|
|
586
|
+
async _discoverPluginSources() {
|
|
587
|
+
const sources = [];
|
|
588
|
+
const config = this._pluginLocationsConfig.get();
|
|
589
|
+
const userHome = await this._getUserHome();
|
|
590
|
+
for (const [path, enabled] of Object.entries(config)) {
|
|
591
|
+
if (!path.trim()) {
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
const resources = this._resolvePluginPath(path.trim(), userHome);
|
|
595
|
+
for (const resource of resources) {
|
|
596
|
+
let stat;
|
|
597
|
+
try {
|
|
598
|
+
stat = await this._fileService.resolve(resource);
|
|
599
|
+
} catch {
|
|
600
|
+
this._logService.debug(
|
|
601
|
+
`[ConfiguredAgentPluginDiscovery] Could not resolve plugin path: ${( resource.toString())}`
|
|
602
|
+
);
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
if (!stat.isDirectory) {
|
|
606
|
+
this._logService.debug(
|
|
607
|
+
`[ConfiguredAgentPluginDiscovery] Plugin path is not a directory: ${( resource.toString())}`
|
|
608
|
+
);
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
const fromMarketplace = this._pluginMarketplaceService.getMarketplacePluginMetadata(stat.resource);
|
|
612
|
+
const configKey = path;
|
|
613
|
+
sources.push({
|
|
614
|
+
uri: stat.resource,
|
|
615
|
+
enabled,
|
|
616
|
+
fromMarketplace,
|
|
617
|
+
setEnabled: value => this._updatePluginPathEnabled(configKey, value),
|
|
618
|
+
remove: () => this._removePluginPath(configKey)
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return sources;
|
|
623
|
+
}
|
|
624
|
+
async _getUserHome() {
|
|
625
|
+
const userHome = await this._pathService.userHome();
|
|
626
|
+
return userHome.scheme === "file" ? userHome.fsPath : userHome.path;
|
|
627
|
+
}
|
|
628
|
+
_resolvePluginPath(path, userHome) {
|
|
629
|
+
if (path.startsWith("~")) {
|
|
630
|
+
path = untildify(path, userHome);
|
|
631
|
+
}
|
|
632
|
+
if (win32.isAbsolute(path) || posix.isAbsolute(path)) {
|
|
633
|
+
return [URI.file(path)];
|
|
634
|
+
}
|
|
635
|
+
return ( this._workspaceContextService.getWorkspace().folders.map(folder => joinPath(folder.uri, path)));
|
|
636
|
+
}
|
|
637
|
+
_updatePluginPathEnabled(configKey, value) {
|
|
638
|
+
const inspected = this._configurationService.inspect(ChatConfiguration.PluginLocations);
|
|
639
|
+
const targets = [
|
|
640
|
+
ConfigurationTarget.WORKSPACE_FOLDER,
|
|
641
|
+
ConfigurationTarget.WORKSPACE,
|
|
642
|
+
ConfigurationTarget.USER_LOCAL,
|
|
643
|
+
ConfigurationTarget.USER_REMOTE,
|
|
644
|
+
ConfigurationTarget.USER,
|
|
645
|
+
ConfigurationTarget.APPLICATION
|
|
646
|
+
];
|
|
647
|
+
for (const target of targets) {
|
|
648
|
+
const mapping = getConfigValueInTarget(inspected, target);
|
|
649
|
+
if (mapping && Object.prototype.hasOwnProperty.call(mapping, configKey)) {
|
|
650
|
+
this._configurationService.updateValue(ChatConfiguration.PluginLocations, {
|
|
651
|
+
...mapping,
|
|
652
|
+
[configKey]: value
|
|
653
|
+
}, target);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
const current = getConfigValueInTarget(inspected, ConfigurationTarget.USER_LOCAL) ?? {};
|
|
658
|
+
this._configurationService.updateValue(ChatConfiguration.PluginLocations, {
|
|
659
|
+
...current,
|
|
660
|
+
[configKey]: value
|
|
661
|
+
}, ConfigurationTarget.USER_LOCAL);
|
|
662
|
+
}
|
|
663
|
+
_removePluginPath(configKey) {
|
|
664
|
+
const inspected = this._configurationService.inspect(ChatConfiguration.PluginLocations);
|
|
665
|
+
const targets = [
|
|
666
|
+
ConfigurationTarget.WORKSPACE_FOLDER,
|
|
667
|
+
ConfigurationTarget.WORKSPACE,
|
|
668
|
+
ConfigurationTarget.USER_LOCAL,
|
|
669
|
+
ConfigurationTarget.USER_REMOTE,
|
|
670
|
+
ConfigurationTarget.USER,
|
|
671
|
+
ConfigurationTarget.APPLICATION
|
|
672
|
+
];
|
|
673
|
+
for (const target of targets) {
|
|
674
|
+
const mapping = getConfigValueInTarget(inspected, target);
|
|
675
|
+
if (mapping && Object.prototype.hasOwnProperty.call(mapping, configKey)) {
|
|
676
|
+
const updated = {
|
|
677
|
+
...mapping
|
|
678
|
+
};
|
|
679
|
+
delete updated[configKey];
|
|
680
|
+
this._configurationService.updateValue(ChatConfiguration.PluginLocations, updated, target);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
ConfiguredAgentPluginDiscovery = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IFileService)), ( __param(2, IPluginMarketplaceService)), ( __param(3, IWorkspaceContextService)), ( __param(4, IPathService)), ( __param(5, ILogService)), ( __param(6, IInstantiationService))], ConfiguredAgentPluginDiscovery));
|
|
687
|
+
let MarketplaceAgentPluginDiscovery = class MarketplaceAgentPluginDiscovery extends AbstractAgentPluginDiscovery {
|
|
688
|
+
constructor(
|
|
689
|
+
_pluginMarketplaceService,
|
|
690
|
+
_pluginRepositoryService,
|
|
691
|
+
fileService,
|
|
692
|
+
pathService,
|
|
693
|
+
logService,
|
|
694
|
+
instantiationService
|
|
695
|
+
) {
|
|
696
|
+
super(fileService, pathService, logService, instantiationService);
|
|
697
|
+
this._pluginMarketplaceService = _pluginMarketplaceService;
|
|
698
|
+
this._pluginRepositoryService = _pluginRepositoryService;
|
|
699
|
+
}
|
|
700
|
+
start() {
|
|
701
|
+
const scheduler = this._register(( new RunOnceScheduler(() => this._refreshPlugins(), 0)));
|
|
702
|
+
this._register(autorun(reader => {
|
|
703
|
+
this._pluginMarketplaceService.installedPlugins.read(reader);
|
|
704
|
+
scheduler.schedule();
|
|
705
|
+
}));
|
|
706
|
+
scheduler.schedule();
|
|
707
|
+
}
|
|
708
|
+
async _discoverPluginSources() {
|
|
709
|
+
const installed = this._pluginMarketplaceService.installedPlugins.get();
|
|
710
|
+
const sources = [];
|
|
711
|
+
for (const entry of installed) {
|
|
712
|
+
let stat;
|
|
713
|
+
try {
|
|
714
|
+
stat = await this._fileService.resolve(entry.pluginUri);
|
|
715
|
+
} catch {
|
|
716
|
+
this._logService.debug(
|
|
717
|
+
`[MarketplaceAgentPluginDiscovery] Could not resolve installed plugin: ${( entry.pluginUri.toString())}`
|
|
718
|
+
);
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
if (!stat.isDirectory) {
|
|
722
|
+
this._logService.debug(
|
|
723
|
+
`[MarketplaceAgentPluginDiscovery] Installed plugin path is not a directory: ${( entry.pluginUri.toString())}`
|
|
724
|
+
);
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
sources.push({
|
|
728
|
+
uri: stat.resource,
|
|
729
|
+
enabled: entry.enabled,
|
|
730
|
+
fromMarketplace: entry.plugin,
|
|
731
|
+
setEnabled: value => this._pluginMarketplaceService.setInstalledPluginEnabled(entry.pluginUri, value),
|
|
732
|
+
remove: () => {
|
|
733
|
+
this._pluginMarketplaceService.removeInstalledPlugin(entry.pluginUri);
|
|
734
|
+
this._pluginRepositoryService.cleanupPluginSource(entry.plugin).catch(error => {
|
|
735
|
+
this._logService.error(
|
|
736
|
+
"[MarketplaceAgentPluginDiscovery] Failed to clean up plugin source",
|
|
737
|
+
error
|
|
738
|
+
);
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
return sources;
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
MarketplaceAgentPluginDiscovery = ( __decorate([( __param(0, IPluginMarketplaceService)), ( __param(1, IAgentPluginRepositoryService)), ( __param(2, IFileService)), ( __param(3, IPathService)), ( __param(4, ILogService)), ( __param(5, IInstantiationService))], MarketplaceAgentPluginDiscovery));
|
|
747
|
+
|
|
748
|
+
export { AbstractAgentPluginDiscovery, AgentPluginService, ConfiguredAgentPluginDiscovery, MarketplaceAgentPluginDiscovery, shellQuotePluginRootInCommand };
|