@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,672 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
+
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
5
|
+
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
6
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
|
|
8
|
+
import { isEqualOrParent, isEqual, joinPath, normalizePath, relativePath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
9
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
10
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
12
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
13
|
+
import { observableMemento } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/observableMemento';
|
|
14
|
+
import { asJson } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request';
|
|
15
|
+
import { IRequestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request.service';
|
|
16
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
17
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
18
|
+
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
19
|
+
import { IAgentPluginRepositoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service';
|
|
20
|
+
|
|
21
|
+
var MarketplaceType;
|
|
22
|
+
(function(MarketplaceType) {
|
|
23
|
+
MarketplaceType["Copilot"] = "copilot";
|
|
24
|
+
MarketplaceType["Claude"] = "claude";
|
|
25
|
+
})(MarketplaceType || (MarketplaceType = {}));
|
|
26
|
+
var MarketplaceReferenceKind;
|
|
27
|
+
(function(MarketplaceReferenceKind) {
|
|
28
|
+
MarketplaceReferenceKind["GitHubShorthand"] = "githubShorthand";
|
|
29
|
+
MarketplaceReferenceKind["GitUri"] = "gitUri";
|
|
30
|
+
MarketplaceReferenceKind["LocalFileUri"] = "localFileUri";
|
|
31
|
+
})(MarketplaceReferenceKind || (MarketplaceReferenceKind = {}));
|
|
32
|
+
var PluginSourceKind;
|
|
33
|
+
(function(PluginSourceKind) {
|
|
34
|
+
PluginSourceKind["RelativePath"] = "relativePath";
|
|
35
|
+
PluginSourceKind["GitHub"] = "github";
|
|
36
|
+
PluginSourceKind["GitUrl"] = "url";
|
|
37
|
+
PluginSourceKind["Npm"] = "npm";
|
|
38
|
+
PluginSourceKind["Pip"] = "pip";
|
|
39
|
+
})(PluginSourceKind || (PluginSourceKind = {}));
|
|
40
|
+
const MARKETPLACE_DEFINITIONS = [{
|
|
41
|
+
type: MarketplaceType.Copilot,
|
|
42
|
+
path: ".github/plugin/marketplace.json"
|
|
43
|
+
}, {
|
|
44
|
+
type: MarketplaceType.Claude,
|
|
45
|
+
path: ".claude-plugin/marketplace.json"
|
|
46
|
+
}];
|
|
47
|
+
const GITHUB_MARKETPLACE_CACHE_TTL_MS = 8 * 60 * 60 * 1000;
|
|
48
|
+
const GITHUB_MARKETPLACE_CACHE_STORAGE_KEY = "chat.plugins.marketplaces.githubCache.v1";
|
|
49
|
+
function ensureSourceDescriptor(plugin) {
|
|
50
|
+
if (plugin.sourceDescriptor) {
|
|
51
|
+
return plugin;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
...plugin,
|
|
55
|
+
sourceDescriptor: {
|
|
56
|
+
kind: PluginSourceKind.RelativePath,
|
|
57
|
+
path: plugin.source
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const installedPluginsMemento = observableMemento({
|
|
62
|
+
defaultValue: [],
|
|
63
|
+
key: "chat.plugins.installed.v1",
|
|
64
|
+
toStorage: value => JSON.stringify(value),
|
|
65
|
+
fromStorage: value => {
|
|
66
|
+
const parsed = JSON.parse(value);
|
|
67
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const trustedMarketplacesMemento = observableMemento({
|
|
71
|
+
defaultValue: [],
|
|
72
|
+
key: "chat.plugins.trustedMarketplaces.v1",
|
|
73
|
+
toStorage: value => JSON.stringify(value),
|
|
74
|
+
fromStorage: value => {
|
|
75
|
+
const parsed = JSON.parse(value);
|
|
76
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
let PluginMarketplaceService = class PluginMarketplaceService extends Disposable {
|
|
80
|
+
constructor(
|
|
81
|
+
_configurationService,
|
|
82
|
+
_requestService,
|
|
83
|
+
_fileService,
|
|
84
|
+
_pluginRepositoryService,
|
|
85
|
+
_logService,
|
|
86
|
+
_storageService
|
|
87
|
+
) {
|
|
88
|
+
super();
|
|
89
|
+
this._configurationService = _configurationService;
|
|
90
|
+
this._requestService = _requestService;
|
|
91
|
+
this._fileService = _fileService;
|
|
92
|
+
this._pluginRepositoryService = _pluginRepositoryService;
|
|
93
|
+
this._logService = _logService;
|
|
94
|
+
this._storageService = _storageService;
|
|
95
|
+
this._gitHubMarketplaceCache = ( new Lazy(() => this._loadPersistedGitHubMarketplaceCache()));
|
|
96
|
+
this._installedPluginsStore = this._register(
|
|
97
|
+
installedPluginsMemento(StorageScope.APPLICATION, StorageTarget.MACHINE, _storageService)
|
|
98
|
+
);
|
|
99
|
+
this._trustedMarketplacesStore = this._register(
|
|
100
|
+
trustedMarketplacesMemento(StorageScope.APPLICATION, StorageTarget.MACHINE, _storageService)
|
|
101
|
+
);
|
|
102
|
+
this.installedPlugins = ( this._installedPluginsStore.map(s => ( revive(s).map(e => ({
|
|
103
|
+
...e,
|
|
104
|
+
plugin: ensureSourceDescriptor(e.plugin)
|
|
105
|
+
})))));
|
|
106
|
+
this.onDidChangeMarketplaces = Event.filter(
|
|
107
|
+
_configurationService.onDidChangeConfiguration,
|
|
108
|
+
e => e.affectsConfiguration(ChatConfiguration.PluginsEnabled) || e.affectsConfiguration(ChatConfiguration.PluginMarketplaces)
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
async fetchMarketplacePlugins(token) {
|
|
112
|
+
if (!this._configurationService.getValue(ChatConfiguration.PluginsEnabled)) {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
const configuredRefs = this._configurationService.getValue(ChatConfiguration.PluginMarketplaces) ?? [];
|
|
116
|
+
const refs = parseMarketplaceReferences(configuredRefs);
|
|
117
|
+
for (const value of configuredRefs) {
|
|
118
|
+
if (typeof value !== "string" || !parseMarketplaceReference(value)) {
|
|
119
|
+
this._logService.debug(
|
|
120
|
+
`[PluginMarketplaceService] Ignoring invalid marketplace entry: ${String(value)}`
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const results = await Promise.all(( refs.map(ref => {
|
|
125
|
+
if (ref.kind === MarketplaceReferenceKind.GitHubShorthand && ref.githubRepo) {
|
|
126
|
+
return this._fetchFromGitHubRepo(ref, ref.githubRepo, token);
|
|
127
|
+
}
|
|
128
|
+
return this._fetchFromClonedRepo(ref, token);
|
|
129
|
+
})));
|
|
130
|
+
return results.flat();
|
|
131
|
+
}
|
|
132
|
+
async _fetchFromGitHubRepo(reference, repo, token) {
|
|
133
|
+
const cache = this._gitHubMarketplaceCache.value;
|
|
134
|
+
const cached = this._getCachedGitHubMarketplacePlugins(cache, reference.canonicalId);
|
|
135
|
+
if (cached) {
|
|
136
|
+
return cached;
|
|
137
|
+
}
|
|
138
|
+
let repoMayBePrivate = true;
|
|
139
|
+
for (const def of MARKETPLACE_DEFINITIONS) {
|
|
140
|
+
if (token.isCancellationRequested) {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
const url = `https://raw.githubusercontent.com/${repo}/main/${def.path}`;
|
|
144
|
+
try {
|
|
145
|
+
const context = await this._requestService.request({
|
|
146
|
+
type: "GET",
|
|
147
|
+
url
|
|
148
|
+
}, token);
|
|
149
|
+
const statusCode = context.res.statusCode;
|
|
150
|
+
if (statusCode !== 200) {
|
|
151
|
+
repoMayBePrivate &&= statusCode !== undefined && statusCode >= 400 && statusCode < 500;
|
|
152
|
+
this._logService.debug(
|
|
153
|
+
`[PluginMarketplaceService] ${url} returned status ${statusCode}, skipping`
|
|
154
|
+
);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const json = await asJson(context);
|
|
158
|
+
if (!json?.plugins || !Array.isArray(json.plugins)) {
|
|
159
|
+
this._logService.debug(
|
|
160
|
+
`[PluginMarketplaceService] ${url} did not contain a valid plugins array, skipping`
|
|
161
|
+
);
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const plugins = json.plugins.filter(p => typeof p.name === "string" && !!p.name).flatMap(p => {
|
|
165
|
+
const sourceDescriptor = parsePluginSource(p.source, json.metadata?.pluginRoot, {
|
|
166
|
+
pluginName: p.name,
|
|
167
|
+
logService: this._logService,
|
|
168
|
+
logPrefix: `[PluginMarketplaceService]`
|
|
169
|
+
});
|
|
170
|
+
if (!sourceDescriptor) {
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
const source = sourceDescriptor.kind === PluginSourceKind.RelativePath ? sourceDescriptor.path : "";
|
|
174
|
+
return [{
|
|
175
|
+
name: p.name,
|
|
176
|
+
description: p.description ?? "",
|
|
177
|
+
version: p.version ?? "",
|
|
178
|
+
source,
|
|
179
|
+
sourceDescriptor,
|
|
180
|
+
marketplace: reference.displayLabel,
|
|
181
|
+
marketplaceReference: reference,
|
|
182
|
+
marketplaceType: def.type,
|
|
183
|
+
readmeUri: getMarketplaceReadmeUri(repo, source)
|
|
184
|
+
}];
|
|
185
|
+
});
|
|
186
|
+
cache.set(reference.canonicalId, {
|
|
187
|
+
plugins,
|
|
188
|
+
expiresAt: Date.now() + GITHUB_MARKETPLACE_CACHE_TTL_MS,
|
|
189
|
+
referenceRawValue: reference.rawValue
|
|
190
|
+
});
|
|
191
|
+
this._savePersistedGitHubMarketplaceCache(cache);
|
|
192
|
+
return plugins;
|
|
193
|
+
} catch (err) {
|
|
194
|
+
this._logService.debug(
|
|
195
|
+
`[PluginMarketplaceService] Failed to fetch marketplace.json from ${url}:`,
|
|
196
|
+
err
|
|
197
|
+
);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (repoMayBePrivate) {
|
|
202
|
+
this._logService.debug(
|
|
203
|
+
`[PluginMarketplaceService] ${repo} may be private, attempting clone-based marketplace discovery`
|
|
204
|
+
);
|
|
205
|
+
return this._fetchFromClonedRepo(reference, token);
|
|
206
|
+
}
|
|
207
|
+
this._logService.debug(`[PluginMarketplaceService] No marketplace.json found in ${repo}`);
|
|
208
|
+
return [];
|
|
209
|
+
}
|
|
210
|
+
_getCachedGitHubMarketplacePlugins(cache, cacheKey) {
|
|
211
|
+
const cached = cache.get(cacheKey);
|
|
212
|
+
if (!cached) {
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
215
|
+
if (cached.expiresAt <= Date.now()) {
|
|
216
|
+
cache.delete(cacheKey);
|
|
217
|
+
this._savePersistedGitHubMarketplaceCache(cache);
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
return [...cached.plugins];
|
|
221
|
+
}
|
|
222
|
+
_loadPersistedGitHubMarketplaceCache() {
|
|
223
|
+
const cache = ( new Map());
|
|
224
|
+
const now = Date.now();
|
|
225
|
+
const stored = this._storageService.getObject(GITHUB_MARKETPLACE_CACHE_STORAGE_KEY, StorageScope.APPLICATION);
|
|
226
|
+
if (!stored) {
|
|
227
|
+
return cache;
|
|
228
|
+
}
|
|
229
|
+
const revived = revive(stored);
|
|
230
|
+
for (const [cacheKey, entry] of Object.entries(revived)) {
|
|
231
|
+
if (!entry || !Array.isArray(entry.plugins) || typeof entry.expiresAt !== "number" || entry.expiresAt <= now || typeof entry.referenceRawValue !== "string") {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
const reference = parseMarketplaceReference(entry.referenceRawValue);
|
|
235
|
+
if (!reference) {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
const plugins = ( entry.plugins.map(plugin => ensureSourceDescriptor({
|
|
239
|
+
...plugin,
|
|
240
|
+
marketplace: reference.displayLabel,
|
|
241
|
+
marketplaceReference: reference
|
|
242
|
+
})));
|
|
243
|
+
cache.set(cacheKey, {
|
|
244
|
+
plugins,
|
|
245
|
+
expiresAt: entry.expiresAt,
|
|
246
|
+
referenceRawValue: entry.referenceRawValue
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
return cache;
|
|
250
|
+
}
|
|
251
|
+
_savePersistedGitHubMarketplaceCache(cache) {
|
|
252
|
+
const serialized = {};
|
|
253
|
+
for (const [cacheKey, entry] of cache) {
|
|
254
|
+
if (!entry.plugins.length || entry.expiresAt <= Date.now()) {
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
serialized[cacheKey] = {
|
|
258
|
+
expiresAt: entry.expiresAt,
|
|
259
|
+
referenceRawValue: entry.referenceRawValue,
|
|
260
|
+
plugins: entry.plugins
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
if (( Object.keys(serialized)).length === 0) {
|
|
264
|
+
this._storageService.remove(GITHUB_MARKETPLACE_CACHE_STORAGE_KEY, StorageScope.APPLICATION);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
this._storageService.store(
|
|
268
|
+
GITHUB_MARKETPLACE_CACHE_STORAGE_KEY,
|
|
269
|
+
JSON.stringify(serialized),
|
|
270
|
+
StorageScope.APPLICATION,
|
|
271
|
+
StorageTarget.MACHINE
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
getMarketplacePluginMetadata(pluginUri) {
|
|
275
|
+
const installed = this.installedPlugins.get();
|
|
276
|
+
return installed.find(e => isEqualOrParent(pluginUri, e.pluginUri))?.plugin;
|
|
277
|
+
}
|
|
278
|
+
addInstalledPlugin(pluginUri, plugin) {
|
|
279
|
+
const current = this.installedPlugins.get();
|
|
280
|
+
if (( current.some(e => isEqual(e.pluginUri, pluginUri)))) {
|
|
281
|
+
this._installedPluginsStore.set([...current], undefined);
|
|
282
|
+
} else {
|
|
283
|
+
this._installedPluginsStore.set([...current, {
|
|
284
|
+
pluginUri,
|
|
285
|
+
plugin,
|
|
286
|
+
enabled: true
|
|
287
|
+
}], undefined);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
removeInstalledPlugin(pluginUri) {
|
|
291
|
+
const current = this.installedPlugins.get();
|
|
292
|
+
this._installedPluginsStore.set(current.filter(e => !isEqual(e.pluginUri, pluginUri)), undefined);
|
|
293
|
+
}
|
|
294
|
+
setInstalledPluginEnabled(pluginUri, enabled) {
|
|
295
|
+
const current = this.installedPlugins.get();
|
|
296
|
+
this._installedPluginsStore.set(( current.map(e => isEqual(e.pluginUri, pluginUri) ? {
|
|
297
|
+
...e,
|
|
298
|
+
enabled
|
|
299
|
+
} : e)), undefined);
|
|
300
|
+
}
|
|
301
|
+
isMarketplaceTrusted(ref) {
|
|
302
|
+
return this._trustedMarketplacesStore.get().includes(ref.canonicalId);
|
|
303
|
+
}
|
|
304
|
+
trustMarketplace(ref) {
|
|
305
|
+
const current = this._trustedMarketplacesStore.get();
|
|
306
|
+
if (!current.includes(ref.canonicalId)) {
|
|
307
|
+
this._trustedMarketplacesStore.set([...current, ref.canonicalId], undefined);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
async _fetchFromClonedRepo(reference, token) {
|
|
311
|
+
let repoDir;
|
|
312
|
+
try {
|
|
313
|
+
repoDir = await this._pluginRepositoryService.ensureRepository(reference);
|
|
314
|
+
} catch (err) {
|
|
315
|
+
this._logService.debug(
|
|
316
|
+
`[PluginMarketplaceService] Failed to prepare marketplace repository ${reference.rawValue}:`,
|
|
317
|
+
err
|
|
318
|
+
);
|
|
319
|
+
return [];
|
|
320
|
+
}
|
|
321
|
+
for (const def of MARKETPLACE_DEFINITIONS) {
|
|
322
|
+
if (token.isCancellationRequested) {
|
|
323
|
+
return [];
|
|
324
|
+
}
|
|
325
|
+
const definitionUri = joinPath(repoDir, def.path);
|
|
326
|
+
let json;
|
|
327
|
+
try {
|
|
328
|
+
const contents = await this._fileService.readFile(definitionUri);
|
|
329
|
+
json = parse(( contents.value.toString()));
|
|
330
|
+
} catch {
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
if (!json?.plugins || !Array.isArray(json.plugins)) {
|
|
334
|
+
this._logService.debug(`[PluginMarketplaceService] ${( definitionUri.toString())} did not contain a valid plugins array, skipping`);
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
return json.plugins.filter(p => typeof p.name === "string" && !!p.name).flatMap(p => {
|
|
338
|
+
const sourceDescriptor = parsePluginSource(p.source, json.metadata?.pluginRoot, {
|
|
339
|
+
pluginName: p.name,
|
|
340
|
+
logService: this._logService,
|
|
341
|
+
logPrefix: `[PluginMarketplaceService]`
|
|
342
|
+
});
|
|
343
|
+
if (!sourceDescriptor) {
|
|
344
|
+
return [];
|
|
345
|
+
}
|
|
346
|
+
const source = sourceDescriptor.kind === PluginSourceKind.RelativePath ? sourceDescriptor.path : "";
|
|
347
|
+
return [{
|
|
348
|
+
name: p.name,
|
|
349
|
+
description: p.description ?? "",
|
|
350
|
+
version: p.version ?? "",
|
|
351
|
+
source,
|
|
352
|
+
sourceDescriptor,
|
|
353
|
+
marketplace: reference.displayLabel,
|
|
354
|
+
marketplaceReference: reference,
|
|
355
|
+
marketplaceType: def.type,
|
|
356
|
+
readmeUri: getMarketplaceReadmeFileUri(repoDir, source)
|
|
357
|
+
}];
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
this._logService.debug(
|
|
361
|
+
`[PluginMarketplaceService] No marketplace.json found in ${reference.rawValue}`
|
|
362
|
+
);
|
|
363
|
+
return [];
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
PluginMarketplaceService = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IRequestService)), ( __param(2, IFileService)), ( __param(3, IAgentPluginRepositoryService)), ( __param(4, ILogService)), ( __param(5, IStorageService))], PluginMarketplaceService));
|
|
367
|
+
function parseMarketplaceReferences(values) {
|
|
368
|
+
const byCanonicalId = ( new Map());
|
|
369
|
+
for (const value of values) {
|
|
370
|
+
if (typeof value !== "string") {
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
const parsed = parseMarketplaceReference(value);
|
|
374
|
+
if (!parsed) {
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
if (!( byCanonicalId.has(parsed.canonicalId))) {
|
|
378
|
+
byCanonicalId.set(parsed.canonicalId, parsed);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return [...( byCanonicalId.values())];
|
|
382
|
+
}
|
|
383
|
+
function parseMarketplaceReference(value) {
|
|
384
|
+
const rawValue = value.trim();
|
|
385
|
+
if (!rawValue) {
|
|
386
|
+
return undefined;
|
|
387
|
+
}
|
|
388
|
+
const uriReference = parseUriMarketplaceReference(rawValue);
|
|
389
|
+
if (uriReference) {
|
|
390
|
+
return uriReference;
|
|
391
|
+
}
|
|
392
|
+
const scpReference = parseScpMarketplaceReference(rawValue);
|
|
393
|
+
if (scpReference) {
|
|
394
|
+
return scpReference;
|
|
395
|
+
}
|
|
396
|
+
const shorthandMatch = /^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/.exec(rawValue);
|
|
397
|
+
if (shorthandMatch) {
|
|
398
|
+
const owner = shorthandMatch[1];
|
|
399
|
+
const repo = shorthandMatch[2];
|
|
400
|
+
return {
|
|
401
|
+
rawValue,
|
|
402
|
+
displayLabel: `${owner}/${repo}`,
|
|
403
|
+
cloneUrl: `https://github.com/${owner}/${repo}.git`,
|
|
404
|
+
canonicalId: getGitHubCanonicalId(owner, repo),
|
|
405
|
+
cacheSegments: ["github.com", owner, repo],
|
|
406
|
+
kind: MarketplaceReferenceKind.GitHubShorthand,
|
|
407
|
+
githubRepo: `${owner}/${repo}`
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
return undefined;
|
|
411
|
+
}
|
|
412
|
+
function parseUriMarketplaceReference(rawValue) {
|
|
413
|
+
let uri;
|
|
414
|
+
try {
|
|
415
|
+
uri = ( URI.parse(rawValue));
|
|
416
|
+
} catch {
|
|
417
|
+
return undefined;
|
|
418
|
+
}
|
|
419
|
+
const scheme = uri.scheme.toLowerCase();
|
|
420
|
+
if (scheme === "file" && /^file:\/\//i.test(rawValue)) {
|
|
421
|
+
const localRepositoryUri = URI.file(uri.fsPath);
|
|
422
|
+
return {
|
|
423
|
+
rawValue,
|
|
424
|
+
displayLabel: localRepositoryUri.fsPath,
|
|
425
|
+
cloneUrl: rawValue,
|
|
426
|
+
canonicalId: `file:${( localRepositoryUri.toString()).toLowerCase()}`,
|
|
427
|
+
cacheSegments: [],
|
|
428
|
+
kind: MarketplaceReferenceKind.LocalFileUri,
|
|
429
|
+
localRepositoryUri
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
if (scheme !== "http" && scheme !== "https" && scheme !== "ssh") {
|
|
433
|
+
return undefined;
|
|
434
|
+
}
|
|
435
|
+
if (!uri.authority) {
|
|
436
|
+
return undefined;
|
|
437
|
+
}
|
|
438
|
+
const normalizedPath = normalizeGitRepoPath(uri.path);
|
|
439
|
+
if (!normalizedPath) {
|
|
440
|
+
return undefined;
|
|
441
|
+
}
|
|
442
|
+
const sanitizedAuthority = sanitizePathSegment(uri.authority.toLowerCase());
|
|
443
|
+
const pathSegments = ( normalizedPath.slice(1, -4).split("/").map(sanitizePathSegment));
|
|
444
|
+
return {
|
|
445
|
+
rawValue,
|
|
446
|
+
displayLabel: rawValue,
|
|
447
|
+
cloneUrl: rawValue,
|
|
448
|
+
canonicalId: `git:${uri.authority.toLowerCase()}/${normalizedPath.slice(1).toLowerCase()}`,
|
|
449
|
+
cacheSegments: [sanitizedAuthority, ...pathSegments],
|
|
450
|
+
kind: MarketplaceReferenceKind.GitUri
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function parseScpMarketplaceReference(rawValue) {
|
|
454
|
+
const match = /^([^@\s]+)@([^:\s]+):(.+\.git)$/i.exec(rawValue);
|
|
455
|
+
if (!match) {
|
|
456
|
+
return undefined;
|
|
457
|
+
}
|
|
458
|
+
const authority = match[2];
|
|
459
|
+
const pathWithGit = match[3].replace(/^\/+/, "");
|
|
460
|
+
if (!pathWithGit.toLowerCase().endsWith(".git")) {
|
|
461
|
+
return undefined;
|
|
462
|
+
}
|
|
463
|
+
const pathSegments = ( pathWithGit.slice(0, -4).split("/").map(sanitizePathSegment));
|
|
464
|
+
return {
|
|
465
|
+
rawValue,
|
|
466
|
+
displayLabel: rawValue,
|
|
467
|
+
cloneUrl: rawValue,
|
|
468
|
+
canonicalId: `git:${authority.toLowerCase()}/${pathWithGit.toLowerCase()}`,
|
|
469
|
+
cacheSegments: [sanitizePathSegment(authority.toLowerCase()), ...pathSegments],
|
|
470
|
+
kind: MarketplaceReferenceKind.GitUri
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
function normalizeGitRepoPath(path) {
|
|
474
|
+
const trimmed = path.replace(/\/+/g, "/").replace(/\/+$/g, "");
|
|
475
|
+
if (!trimmed.toLowerCase().endsWith(".git")) {
|
|
476
|
+
return undefined;
|
|
477
|
+
}
|
|
478
|
+
const withLeadingSlash = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
479
|
+
const pathWithoutGit = withLeadingSlash.slice(1, -4);
|
|
480
|
+
if (!pathWithoutGit || !pathWithoutGit.includes("/")) {
|
|
481
|
+
return undefined;
|
|
482
|
+
}
|
|
483
|
+
return withLeadingSlash;
|
|
484
|
+
}
|
|
485
|
+
function getGitHubCanonicalId(owner, repo) {
|
|
486
|
+
return `github:${owner.toLowerCase()}/${repo.toLowerCase()}`;
|
|
487
|
+
}
|
|
488
|
+
function sanitizePathSegment(value) {
|
|
489
|
+
return value.replace(/[\\/:*?"<>|]/g, "_");
|
|
490
|
+
}
|
|
491
|
+
function normalizeMarketplacePath(value) {
|
|
492
|
+
let normalized = value.trim().replace(/\\/g, "/");
|
|
493
|
+
normalized = normalized.replace(/^\.?\/+/, "").replace(/\/+$/g, "");
|
|
494
|
+
return normalized;
|
|
495
|
+
}
|
|
496
|
+
function resolvePluginSource(pluginRoot, source) {
|
|
497
|
+
const normalizedRoot = pluginRoot ? normalizeMarketplacePath(pluginRoot) : "";
|
|
498
|
+
const normalizedSource = normalizeMarketplacePath(source);
|
|
499
|
+
const repoRoot = URI.file("/");
|
|
500
|
+
const pluginRootUri = normalizedRoot ? normalizePath(joinPath(repoRoot, normalizedRoot)) : repoRoot;
|
|
501
|
+
if (!normalizedSource) {
|
|
502
|
+
return normalizedRoot || undefined;
|
|
503
|
+
}
|
|
504
|
+
if (normalizedRoot && (normalizedSource === normalizedRoot || normalizedSource.startsWith(`${normalizedRoot}/`))) {
|
|
505
|
+
return normalizedSource;
|
|
506
|
+
}
|
|
507
|
+
const resolvedUri = normalizePath(joinPath(pluginRootUri, normalizedSource));
|
|
508
|
+
return relativePath(repoRoot, resolvedUri) ?? undefined;
|
|
509
|
+
}
|
|
510
|
+
function parsePluginSource(rawSource, pluginRoot, logContext) {
|
|
511
|
+
if (rawSource === undefined || rawSource === null) {
|
|
512
|
+
const resolved = resolvePluginSource(pluginRoot, "");
|
|
513
|
+
if (resolved === undefined) {
|
|
514
|
+
return undefined;
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
kind: PluginSourceKind.RelativePath,
|
|
518
|
+
path: resolved
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
if (typeof rawSource === "string") {
|
|
522
|
+
const resolved = resolvePluginSource(pluginRoot, rawSource);
|
|
523
|
+
if (resolved === undefined) {
|
|
524
|
+
return undefined;
|
|
525
|
+
}
|
|
526
|
+
return {
|
|
527
|
+
kind: PluginSourceKind.RelativePath,
|
|
528
|
+
path: resolved
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
if (typeof rawSource !== "object" || typeof rawSource.source !== "string") {
|
|
532
|
+
logContext.logService.warn(
|
|
533
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': source object is missing a 'source' discriminant`
|
|
534
|
+
);
|
|
535
|
+
return undefined;
|
|
536
|
+
}
|
|
537
|
+
switch (rawSource.source) {
|
|
538
|
+
case "github":
|
|
539
|
+
{
|
|
540
|
+
if (typeof rawSource.repo !== "string" || !rawSource.repo) {
|
|
541
|
+
logContext.logService.warn(
|
|
542
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source is missing required 'repo' field`
|
|
543
|
+
);
|
|
544
|
+
return undefined;
|
|
545
|
+
}
|
|
546
|
+
if (!isValidGitHubRepo(rawSource.repo)) {
|
|
547
|
+
logContext.logService.warn(
|
|
548
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source repo must be in 'owner/repo' format`
|
|
549
|
+
);
|
|
550
|
+
return undefined;
|
|
551
|
+
}
|
|
552
|
+
if (!isOptionalString(rawSource.ref)) {
|
|
553
|
+
logContext.logService.warn(
|
|
554
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source 'ref' must be a string when provided`
|
|
555
|
+
);
|
|
556
|
+
return undefined;
|
|
557
|
+
}
|
|
558
|
+
if (!isOptionalGitSha(rawSource.sha)) {
|
|
559
|
+
logContext.logService.warn(
|
|
560
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source 'sha' must be a full 40-character commit hash when provided`
|
|
561
|
+
);
|
|
562
|
+
return undefined;
|
|
563
|
+
}
|
|
564
|
+
return {
|
|
565
|
+
kind: PluginSourceKind.GitHub,
|
|
566
|
+
repo: rawSource.repo,
|
|
567
|
+
ref: rawSource.ref,
|
|
568
|
+
sha: rawSource.sha
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
case "url":
|
|
572
|
+
{
|
|
573
|
+
if (typeof rawSource.url !== "string" || !rawSource.url) {
|
|
574
|
+
logContext.logService.warn(
|
|
575
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': url source is missing required 'url' field`
|
|
576
|
+
);
|
|
577
|
+
return undefined;
|
|
578
|
+
}
|
|
579
|
+
if (!rawSource.url.toLowerCase().endsWith(".git")) {
|
|
580
|
+
logContext.logService.warn(
|
|
581
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': url source must end with '.git'`
|
|
582
|
+
);
|
|
583
|
+
return undefined;
|
|
584
|
+
}
|
|
585
|
+
if (!isOptionalString(rawSource.ref)) {
|
|
586
|
+
logContext.logService.warn(
|
|
587
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': url source 'ref' must be a string when provided`
|
|
588
|
+
);
|
|
589
|
+
return undefined;
|
|
590
|
+
}
|
|
591
|
+
if (!isOptionalGitSha(rawSource.sha)) {
|
|
592
|
+
logContext.logService.warn(
|
|
593
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': url source 'sha' must be a full 40-character commit hash when provided`
|
|
594
|
+
);
|
|
595
|
+
return undefined;
|
|
596
|
+
}
|
|
597
|
+
return {
|
|
598
|
+
kind: PluginSourceKind.GitUrl,
|
|
599
|
+
url: rawSource.url,
|
|
600
|
+
ref: rawSource.ref,
|
|
601
|
+
sha: rawSource.sha
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
case "npm":
|
|
605
|
+
{
|
|
606
|
+
if (typeof rawSource.package !== "string" || !rawSource.package) {
|
|
607
|
+
logContext.logService.warn(
|
|
608
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': npm source is missing required 'package' field`
|
|
609
|
+
);
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
if (!isOptionalString(rawSource.version) || !isOptionalString(rawSource.registry)) {
|
|
613
|
+
logContext.logService.warn(
|
|
614
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': npm source 'version' and 'registry' must be strings when provided`
|
|
615
|
+
);
|
|
616
|
+
return undefined;
|
|
617
|
+
}
|
|
618
|
+
return {
|
|
619
|
+
kind: PluginSourceKind.Npm,
|
|
620
|
+
package: rawSource.package,
|
|
621
|
+
version: rawSource.version,
|
|
622
|
+
registry: rawSource.registry
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
case "pip":
|
|
626
|
+
{
|
|
627
|
+
if (typeof rawSource.package !== "string" || !rawSource.package) {
|
|
628
|
+
logContext.logService.warn(
|
|
629
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': pip source is missing required 'package' field`
|
|
630
|
+
);
|
|
631
|
+
return undefined;
|
|
632
|
+
}
|
|
633
|
+
if (!isOptionalString(rawSource.version) || !isOptionalString(rawSource.registry)) {
|
|
634
|
+
logContext.logService.warn(
|
|
635
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': pip source 'version' and 'registry' must be strings when provided`
|
|
636
|
+
);
|
|
637
|
+
return undefined;
|
|
638
|
+
}
|
|
639
|
+
return {
|
|
640
|
+
kind: PluginSourceKind.Pip,
|
|
641
|
+
package: rawSource.package,
|
|
642
|
+
version: rawSource.version,
|
|
643
|
+
registry: rawSource.registry
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
default:
|
|
647
|
+
logContext.logService.warn(
|
|
648
|
+
`${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': unknown source kind '${rawSource.source}'`
|
|
649
|
+
);
|
|
650
|
+
return undefined;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
function isOptionalString(value) {
|
|
654
|
+
return value === undefined || typeof value === "string";
|
|
655
|
+
}
|
|
656
|
+
function isOptionalGitSha(value) {
|
|
657
|
+
return value === undefined || (typeof value === "string" && /^[0-9a-fA-F]{40}$/.test(value));
|
|
658
|
+
}
|
|
659
|
+
function isValidGitHubRepo(repo) {
|
|
660
|
+
return /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(repo);
|
|
661
|
+
}
|
|
662
|
+
function getMarketplaceReadmeUri(repo, source) {
|
|
663
|
+
const normalizedSource = source.trim().replace(/^\.?\/+|\/+$/g, "");
|
|
664
|
+
const readmePath = normalizedSource ? `${normalizedSource}/README.md` : "README.md";
|
|
665
|
+
return ( URI.parse(`https://github.com/${repo}/blob/main/${readmePath}`));
|
|
666
|
+
}
|
|
667
|
+
function getMarketplaceReadmeFileUri(repoDir, source) {
|
|
668
|
+
const normalizedSource = source.trim().replace(/^\.?\/+|\/+$/g, "");
|
|
669
|
+
return normalizedSource ? joinPath(repoDir, normalizedSource, "README.md") : joinPath(repoDir, "README.md");
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export { MarketplaceReferenceKind, MarketplaceType, PluginMarketplaceService, PluginSourceKind, parseMarketplaceReference, parseMarketplaceReferences, parsePluginSource };
|