import * as DOM from "../../../../../base/browser/dom.js"; import { ICustomizationMarketplaceService } from "../../../../../platform/customizationMarketplace/common/customizationMarketplaceService.service.js"; import { CancellationToken } from "../../../../../base/common/cancellation.js"; import { IStorageService } from "../../../../../platform/storage/common/storage.service.js"; import { ITelemetryService } from "../../../../../platform/telemetry/common/telemetry.service.js"; import { IThemeService } from "../../../../../platform/theme/common/themeService.service.js"; import { IEditorOptions } from "../../../../../platform/editor/common/editor.js"; import { IFileDialogService } from "../../../../../platform/dialogs/common/dialogs.service.js"; import { IDialogService } from "../../../../../platform/dialogs/common/dialogs.service.js"; import { IContextMenuService } from "../../../../../platform/contextview/browser/contextView.service.js"; import { EditorPane } from "../../../../browser/parts/editor/editorPane.js"; import { IEditorOpenContext } from "../../../../common/editor.js"; import { IEditorGroup } from "../../../../services/editor/common/editorGroupsService.js"; import { IEditorGroupsService } from "../../../../services/editor/common/editorGroupsService.service.js"; import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js"; import { IContextKeyService } from "../../../../../platform/contextkey/common/contextkey.service.js"; import { IOpenerService } from "../../../../../platform/opener/common/opener.service.js"; import { URI } from "../../../../../base/common/uri.js"; import { AICustomizationManagementEditorInput } from "./aiCustomizationManagementEditorInput.js"; import { IAICustomizationManagementSectionWidget } from "./aiCustomizationManagementSectionRegistry.js"; import { IAICustomizationItemsModel } from "./aiCustomizationItemsModel.service.js"; import { AICustomizationManagementSection } from "./aiCustomizationManagement.js"; import { IChatWidgetService } from "../chat.service.js"; import { IChatService } from "../../common/chatService/chatService.service.js"; import { IWorkspaceContextService } from "../../../../../platform/workspace/common/workspace.service.js"; import { ICustomizationMigrationService } from "../../common/promptSyntax/service/customizationMigrationService.service.js"; import { ICustomizationMigrationTelemetryService } from "../../common/promptSyntax/service/customizationMigrationTelemetryService.service.js"; import { IPromptsService } from "../../common/promptSyntax/service/promptsService.service.js"; import { ICommandService } from "../../../../../platform/commands/common/commands.service.js"; import { IAICustomizationWorkspaceService } from "../../common/aiCustomizationWorkspaceService.service.js"; import { IModelService } from "../../../../../editor/common/services/model.service.js"; import { ITextModelService } from "../../../../../editor/common/services/resolverService.service.js"; import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js"; import { IWorkingCopyService } from "../../../../services/workingCopy/common/workingCopyService.service.js"; import { IHoverService } from "../../../../../platform/hover/browser/hover.service.js"; import { IFileService } from "../../../../../platform/files/common/files.service.js"; import { IEnvironmentService } from "../../../../../platform/environment/common/environment.service.js"; import { IMarkdownRendererService } from "../../../../../platform/markdown/browser/markdownRenderer.service.js"; import { INotificationService } from "../../../../../platform/notification/common/notification.service.js"; import { IProgressService } from "../../../../../platform/progress/common/progress.service.js"; import { IQuickInputService } from "../../../../../platform/quickinput/common/quickInput.service.js"; import { IAgentPluginItem } from "../agentPluginEditor/agentPluginItems.js"; import { IAgentPluginService } from "../../common/plugins/agentPluginService.service.js"; import { ICopilotConnectorsService } from "./copilotConnectorsService.service.js"; import { IMcpWorkbenchService } from "../../../mcp/common/mcpTypes.service.js"; import { IMcpService } from "../../../mcp/common/mcpTypes.service.js"; import { ISecretStorageService } from "../../../../../platform/secrets/common/secrets.service.js"; import { IAgentHostCustomizationService } from "../agentSessions/agentHost/agentHostCustomizationService.service.js"; import { IAgentHostActiveClientService } from "../agentSessions/agentHost/agentHostActiveClientService.service.js"; import { ICustomizationHarnessService } from "../../common/customizationHarnessService.service.js"; import { AICustomizationWelcomePage, type IInstalledCustomizationTarget } from "./aiCustomizationWelcomePage.js"; import { ICustomizationMarketplaceInstallService } from "../../common/customizationMarketplaceInstallService.service.js"; import { CustomizationMigrationCategoryId } from "./customizationMigrationCategories.js"; import { IViewsService } from "../../../../services/views/common/viewsService.service.js"; import { IEditorService } from "../../../../services/editor/common/editorService.service.js"; import { ILabelService } from "../../../../../platform/label/common/label.service.js"; export declare function isCurrentPluginContributionNavigation(requestGeneration: number, currentGeneration: number, requestedSection: AICustomizationManagementSection, selectedSection: AICustomizationManagementSection | undefined, isListView: boolean): boolean; export declare function isCurrentConnectorDetailNavigation(requestGeneration: number, currentGeneration: number, requestInput: object | undefined, currentInput: object | undefined): boolean; export declare enum CopilotConnectorDetailOpenResult { Opened = "opened", NotFound = "notFound", Superseded = "superseded" } /** * Editor pane for the AI Customizations Management Editor. * Provides a global view of all AI customizations with a sidebar for navigation * and a content area showing a searchable list of items. */ export declare class AICustomizationManagementEditor extends EditorPane { private readonly storageService; private readonly instantiationService; private readonly openerService; private readonly commandService; private readonly workspaceService; private readonly promptsService; private readonly customizationMigrationService; private readonly textModelService; private readonly configurationService; private readonly workingCopyService; private readonly hoverService; private readonly markdownRendererService; private readonly modelService; private readonly quickInputService; private readonly fileService; private readonly notificationService; private readonly progressService; private readonly fileDialogService; private readonly dialogService; private readonly contextMenuService; private readonly harnessService; private readonly viewsService; private readonly labelService; private readonly itemsModel; private readonly mcpService; private readonly mcpWorkbenchService; private readonly agentHostCustomizationService; private readonly customizationMigrationTelemetryService; private readonly editorService; private readonly marketplaceService; private readonly marketplaceInstallService; private readonly copilotConnectorsService; private readonly agentPluginService; private readonly environmentService; private readonly chatWidgetService; private readonly editorGroupsService; private readonly chatService; private readonly agentHostActiveClientService; private readonly workspaceContextService; private readonly secretStorageService; static readonly ID = "workbench.editor.aiCustomizationManagement"; private container; private splitViewContainer; private splitView; private sidebarContainer; private sectionsListContainer; private sectionsList; private contentContainer; private listWidget; private listWidgetSectionLoad; private mcpListWidget; private pluginListWidget; private modelsWidget; private toolsListWidget; private promptsContentContainer; private mcpContentContainer; private pluginContentContainer; private modelsContentContainer; private toolsContentContainer; private readonly contributedSectionContainers; private readonly contributedSectionWidgets; private readonly contributedSectionWidgetDisposables; private modelsFooterElement; private editorContentContainer; private editorPreviewContainer; private editorPreviewScrollContainer; private editorPreviewIssuesContainer; private editorPreviewFrontMatterSection; private editorPreviewFrontMatterTitle; private editorPreviewFrontMatterContainer; private editorPreviewBodySection; private editorPreviewBodyTitle; private editorPreviewBodyContainer; private embeddedEditorContainer; private embeddedEditor; private editorActionButton; private editorActionButtonHover; private editorActionButtonIcon; private editorModeButton; private editorMigrationDetailActions; private editorMigrationDetailWarning; private editorActionButtonInProgress; private editorDisplayMode; private currentCustomizationDetail; private editorItemMarketplaceIcon; private editorItemIconElement; private editorItemNameElement; private editorItemDescriptionElement; private editorItemPathElement; private editorSaveIndicator; private readonly editorModelChangeDisposables; private readonly editorPreviewDisposables; private readonly editorItemIconDisposables; private readonly editorPreviewRenderScheduler; private readonly builtinEditingSessions; private currentEditingUri; private currentEditingProjectRoot; private currentEditingSource; private currentEditingPromptType; private currentEditingReadOnly; private editorReturnViewMode; private customizationDetailOrigin; private currentModelRef; private viewMode; private migrationContentContainer; private migrationDashboardContainer; private migrationDashboardScrollable; private migrationDashboard; private migrationFlowId; private currentMigrationDetail; private migrationContextKey; private selectedCustomizationMigrationItems; private guidanceMigrations; private selectedMcpServerMigrationItems; private knownMcpServerMigrationItems; private selectedPluginMarketplaceMigrationItems; private knownPluginMarketplaceMigrationItems; private readonly recentlyMigratedCustomizationItems; private agentMigrationRecoveries; private selectedCustomizationMigrationTargets; private readonly explicitlySelectedCustomizationMigrationTargets; private mcpDetailContainer; private embeddedMcpDetail; private mcpDetailScrollable; private mcpDetailInput; private mcpDetailBackButton; private mcpDetailBackHover; private mcpDetailOrigin; private mcpMigrationDetailActions; private readonly mcpDetailDisposables; private readonly mcpDetailScrollUpdate; private connectorDetailContainer; private embeddedConnectorDetail; private connectorDetailBackButton; private connectorDetailBackHover; private marketplaceDetailContainer; private marketplaceDetailScrollable; private embeddedMarketplaceDetail; private marketplaceDetailBackButton; private marketplaceDetailBackHover; private marketplaceDetailOrigin; private marketplaceDetailResource; private readonly marketplaceDetailScrollUpdate; private pluginDetailContainer; private embeddedPluginDetail; private pluginDetailScrollable; private pluginDetailBackButton; private pluginDetailBackHover; private readonly pluginDetailDisposables; private readonly pluginDetailScrollUpdate; private pluginDetailInput; private pluginDetailOrigin; private dimension; private readonly sections; private readonly sectionBadges; private readonly allSections; private selectedSection; private contentNavigationGeneration; private welcomePage; private customizationsByMigrationCategory; private pluginMarketplaceMigrationDiscoveryError; private mcpServerMigrationExclusions; private customizationMigrationTargetFoldersByType; private customizationMigrationRefreshSequence; private readonly customizationMigrationRefreshDelayer; private readonly customizationMigrationRequest; private customizationMigrationLoading; private customizationMigrationLoadError; private customizationMigrationResultsSettled; private customizationMigrationInProgress; private customizationMigrationWritesInProgress; private activeCustomizationMigration; private readonly editorDisposables; private _editorContentChanged; /** * Tracks a save that has not been committed to git yet. Auto save clears the dirty state, so * this is tracked separately from {@link _editorContentChanged} to still commit when leaving the editor. */ private _editorHasUncommittedSave; private readonly customizationCommitSequencer; private _previousActiveHarnessId; private sidebarHeaderContainer; private homeButton; private homeButtonLabel; private migrationShortcutContainer; private migrationShortcutButton; private migrationShortcutCount; private sidebarWidth; private sidebarHeight; private readonly inEditorContextKey; private readonly sectionContextKey; private readonly harnessContextKey; constructor(group: IEditorGroup, telemetryService: ITelemetryService, themeService: IThemeService, storageService: IStorageService, instantiationService: IInstantiationService, contextKeyService: IContextKeyService, openerService: IOpenerService, commandService: ICommandService, workspaceService: IAICustomizationWorkspaceService, promptsService: IPromptsService, customizationMigrationService: ICustomizationMigrationService, textModelService: ITextModelService, configurationService: IConfigurationService, workingCopyService: IWorkingCopyService, hoverService: IHoverService, markdownRendererService: IMarkdownRendererService, modelService: IModelService, quickInputService: IQuickInputService, fileService: IFileService, notificationService: INotificationService, progressService: IProgressService, fileDialogService: IFileDialogService, dialogService: IDialogService, contextMenuService: IContextMenuService, harnessService: ICustomizationHarnessService, viewsService: IViewsService, labelService: ILabelService, itemsModel: IAICustomizationItemsModel, mcpService: IMcpService, mcpWorkbenchService: IMcpWorkbenchService, agentHostCustomizationService: IAgentHostCustomizationService, customizationMigrationTelemetryService: ICustomizationMigrationTelemetryService, editorService: IEditorService, marketplaceService: ICustomizationMarketplaceService, marketplaceInstallService: ICustomizationMarketplaceInstallService, copilotConnectorsService: ICopilotConnectorsService, agentPluginService: IAgentPluginService, environmentService: IEnvironmentService, chatWidgetService: IChatWidgetService, editorGroupsService: IEditorGroupsService, chatService: IChatService, agentHostActiveClientService: IAgentHostActiveClientService, workspaceContextService: IWorkspaceContextService, secretStorageService: ISecretStorageService); protected createEditor(parent: HTMLElement): void; /** * Marks the editor while the latest input was a pointer. Monaco lists focus themselves from script * on mouse down, so controls focused after clicking a row still match `:focus-visible`. Detail page * header controls use this marker to show their focus ring only for keyboard navigation. */ private trackPointerFocus; private createSplitView; private getActiveHarnessLabel; private updateTargetLabelPresentation; /** * Rebuilds the visible sections list based on the active harness's * `hiddenSections`. If the current selection falls into a hidden * section, the first visible section is selected instead. */ private rebuildVisibleSections; private isContributedSectionEnabled; private updateContributedSectionEnablement; private createSidebar; private onDidChangeSidebarSelection; private isMarketplaceSourceEnabled; private layoutSidebar; private createSidebarHeader; private registerSidebarKeyboardNavigation; private updateHomeButtonStyle; private updateHomeButtonHarnessPresentation; private getHomeButtonTooltip; private createSidebarMigrationShortcut; private updateSidebarMigrationSeparator; private createWelcomePage; private runMarketplacePrompt; createCanvas(): Promise; private createBackArrowButton; private createCustomizationMigrationContent; private createContent; private registerCustomizationMigrationSessionRefresh; /** Whether a stored OAuth client secret blocks an MCP server's migration, so refresh when one is set or deleted. */ private registerCustomizationMigrationSecretRefresh; private refreshCustomizationMigrationInfoFromPromptChange; private refreshCustomizationMigrationInfoFromMcpChange; private refreshCustomizationMigrationInfo; private cancelCustomizationMigrationRefresh; private computeCustomizationMigrationInfo; private setCustomizationsToMigrate; private reconcileCustomizationMigrationTargets; private getCustomizationMigrationTargetKey; private createCustomizationMigrationItemMap; private hasCustomizationMigrationItem; private addCustomizationMigrationItem; private isCustomizationSelectedForMigration; private setCustomizationSelectedForMigration; private getCustomizationMigrationCandidateKey; private markCustomizationMigrationsCompleted; private getMigrationCandidates; private getMigrationCandidateStorage; private getMcpMigrationExclusions; private getMcpMigrationExclusionReason; private getAllMigrationCandidates; private startCustomizationMigrationWithAgent; private closeCustomizationEditor; private getMigrationCategorySummaries; private refreshCustomizationMigrationUi; private updateSidebarMigrationShortcut; private migrateSelectedCustomizations; private migrateSelectedMcpServers; private migrateSelectedPluginMarketplaces; private runCustomizationMigrationWithProgress; private getConfiguredLocationSettingsToClear; private getModifiedConfiguredLocationSettingIds; private configuredLocationSettingAppliesTo; private clearConfiguredLocationSettings; /** * Returns the folder a single customization is migrated into. Workspace customizations * of a multi-root workspace are kept inside the workspace folder they come from, instead * of being moved into the target folder of the first workspace folder. */ private getEffectiveCustomizationMigrationTargetFolder; private runCustomizationMigration; private getCustomizationMigrationNameConflictMessage; private renderCustomizationMigrationDashboardState; private renderCustomizationMigrationDashboard; private layoutMigrationDashboard; private openMigrationCustomization; private openMigrationGuidanceSource; private setMigrationDashboardItemSelected; private findMigrationCandidate; private showMigrationItemActions; private getMigrationItemActionState; private migrateMigrationItem; private deleteMigrationItem; private findMigrationMcpWorkbenchServer; private deleteMigrationMcpServer; private deleteCustomizationFile; private ignoreMigrationCategory; private restoreIgnoredMigrationCategories; getMigrationAccessibilityContent(): string | undefined; private getGuidanceMigrationCategories; private getAllGuidanceMigrationCategories; private getCustomizationMigrationDashboardOverview; private getCustomizationMigrationRecoveryRoot; private refreshAgentMigrationRecoveries; private getAgentMigrationRecoveryDashboardItem; private restoreAgentMigration; private deleteAgentMigrationRecovery; private getHomepageMigrationCategory; private getMigrationScopeLabel; private getMigrationCategoryDestination; private getMcpMigrationDestinationLabel; private getMigrationGroupIgnoreKey; private getIgnoredMigrationGroupKeys; private isMigrationCategoryIgnored; private getIgnoredMigrationGroups; private getMigrationDashboardCategoryLabel; private storeIgnoredMigrationGroupKeys; private getCustomizationMigrationDashboardDestinations; private configureCustomizationMigrationLocations; private getCustomizationMigrationDestinationContextLabel; private chooseCustomizationMigrationDestination; private chooseCustomMigrationDestination; private isMigrationCategoryEnabled; private getEnabledMigrationCategories; private resolveCustomizationMigrationTargetFolders; private isCustomizationMigrationSessionActive; private showMissingMigrationTargetFolderNotification; private openMigrationHarnessSession; private pickCustomizationMigrationTargetFolder; private sortCustomizationMigrationFolders; private getCustomizationMigrationFolders; private isRecommendedCustomizationMigrationFolder; private getCustomizationMigrationFolderPickDescription; private getMigrationTargetFolderPlaceholder; private getCustomizationMigrationFolderLabel; private getCustomizationMigrationDestinationLabel; private isPromptsSection; private getCurrentDetailBaseOrigin; private getDetailOriginLabel; private restoreDetailOrigin; /** * Updates the count for a specific section and re-renders the sidebar. */ private updateSectionCount; /** * Shows the badges that contributed sections describe on their navigation entries. */ private registerContributedSectionBadges; /** * Updates the badge of a section, which also applies when the visible sections are rebuilt, and re-renders the sidebar. */ private updateSectionBadge; /** * Opens Discover with fresh filters and optionally applies a search query. */ showDiscover(searchQuery?: string): void; /** * Navigates to the welcome page (no section selected). */ showWelcomePage(options?: { resetFilters?: boolean; preserveFocus?: boolean; }): void; private createCustomization; private selectSection; private ensureSectionsListReflectsActiveSection; private updateContentVisibility; private ensureContributedSectionWidget; private disposeContributedSectionWidget; private initializeContributedSectionWidgets; getActiveSectionWidget(): IAICustomizationManagementSectionWidget | undefined; getWelcomePage(): AICustomizationWelcomePage | undefined; isCustomizationDiscoveryDetailVisible(): boolean; getCustomizationDiscoveryAccessibilityContent(): string; /** * Creates a new customization using the AI-guided flow. */ private createNewItemWithAI; /** * Creates a new prompt file and opens it in the embedded editor. */ private createNewItemManual; updateStyles(): void; setInput(input: AICustomizationManagementEditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise; clearInput(): void; protected setEditorVisible(visible: boolean): void; layout(dimension: DOM.Dimension): void; focus(): void; /** * Moves focus into the visible detail page, if any. Showing a detail hides the element that had * focus, so focus must land inside the page to keep the modal's Escape handling, Tab order, and * screen reader context. Prefers the page's enabled primary action, then a visible editor, then * the back button. Focus arrives programmatically, so the back button's tooltip is suppressed. * @returns Whether a detail page is visible. */ private focusDetailPage; private getVisibleDetailPage; /** * Selects a specific section programmatically. */ selectSectionById(sectionId: AICustomizationManagementSection, options?: { showMarketplace?: boolean; marketplaceSourceId?: string; preserveFocus?: boolean; }): boolean; private showMarketplaceInDiscover; private prepareCustomizationMigrationView; showCustomizationMigrationDashboard(): void; startCustomizationMigration(categoryId?: CustomizationMigrationCategoryId, migrationFlowId?: string): Promise; /** * Refreshes the list widget. */ refreshList(): void; setSearchQuery(query: string, preserveFocus?: boolean): void; /** * Reveals and selects the item backed by `uri` in the current section, * retrying while the list loads. MCP servers and plugins have no * URI-addressable rows, so selecting their section is the whole reveal. */ revealCustomizationByUri(uri: URI): Promise; revealInstalledCustomization(target: IInstalledCustomizationTarget): Promise; showCopilotConnectorDetail(connectorName: string, connectorDisplayName?: string): Promise; showMcpMarketplaceDetail(name: string, registryUrl?: string, preserveFocus?: boolean): Promise; /** * Scrolls the active list widget so the last item is visible. */ revealLastItem(): void; /** * Generates a debug report for the current section. */ generateDebugReport(): Promise; private createEmbeddedEditor; private openCustomizationItem; private showCustomizationDetail; private showEmbeddedEditor; private loadCustomizationEditorModel; private prepareCustomizationView; private openCurrentCustomizationFile; private goBackToList; private renderEditorItemIcon; private getOrCreateBuiltinEditingSession; private createBuiltinPromptSaveRequest; private createExistingCustomizationSaveRequest; private saveBuiltinPromptCopy; private saveExistingCustomization; /** Serializes commits so an explicit save and leaving the editor cannot commit concurrently. Resolves to `false` when the commit failed. */ private commitCustomization; private pickBuiltinPromptSaveTarget; private handleEditorActionButton; private updateEditorActionButton; private shouldShowBuiltinSaveAction; private updateInputDirtyState; private handleSave; /** * Explicit save of the customization open in the embedded editor. The embedded editor is not * handled by the generic save command, so the file is saved and committed here. */ private saveCurrentCustomization; private handleBuiltinSave; private resetEditorSaveIndicator; private isStructuredPreviewSupported; private onStructuredPreviewSettingChanged; private getCurrentEditingModel; private toggleEditorDisplayMode; private updateEditorDisplayMode; private getEditorModeButtonLabel; private getEditorModeButtonTooltip; private canEditCurrentRaw; private canToggleEditorDisplayMode; private registerWorkingCopySaveListener; private scheduleCurrentEditorPreviewRender; private renderCurrentEditorPreview; private renderEditorPreview; private renderPreviewIssues; private renderPreviewFrontMatter; private renderPreviewAttribute; private renderPreviewBody; private stringifyPreviewValue; private toPreviewObject; private clearEditorPreview; private disposeBuiltinEditingSessions; private disposeBuiltinEditingSession; private scheduleDetailScrollableScan; private createMarketplaceDetail; private showMarketplaceDetail; private ensureMarketplaceDetailInstallState; private showGenericMarketplaceDetail; private goBackFromMarketplaceDetail; private openMarketplaceExternal; private createEmbeddedMcpDetail; private showEmbeddedMcpDetail; private goBackFromMcpDetail; /** Keeps an open MCP detail in sync when the agent host reports new metadata for its server. */ private refreshEmbeddedMcpDetail; private refreshMcpDetailMigrationState; private getMcpServerMigrationCandidates; private createMigrationDetailActions; private updateMigrationDetailActions; private updateMigrationDetailWarning; private updateMigrationDetailActionButtons; private migrateCurrentMigrationDetail; private deleteCurrentMigrationDetail; private createEmbeddedConnectorDetail; private showEmbeddedConnectorDetail; private goBackFromConnectorDetail; private createEmbeddedPluginDetail; private showEmbeddedPluginDetail; private updatePluginDetailBackButton; private openSkillFromPluginDetail; private openPromptsItemFromPluginDetail; private openSectionFromPluginDetail; /** * Public method to show a plugin detail from any section (e.g. from "Show Plugin" context menu). * Saves the current section so the back button returns the user to it. */ showPluginDetail(item: IAgentPluginItem): Promise; private goBackFromPluginDetail; }