import { Action, IAction, IActionChangeEvent } from "../../../../base/common/actions.js"; import { Emitter } from "../../../../base/common/event.js"; import { ActionViewItem, IActionViewItemOptions } from "../../../../base/browser/ui/actionbar/actionViewItems.js"; import { ActionWithDropdownActionViewItem, IActionWithDropdownActionViewItemOptions } from "../../../../base/browser/ui/dropdown/dropdownActionViewItem.js"; import { IContextMenuProvider } from "../../../../base/browser/contextmenu.js"; import { ICommandService } from "../../../../platform/commands/common/commands.service.js"; import { INotificationService } from "../../../../platform/notification/common/notification.service.js"; import { IHoverService } from "../../../../platform/hover/browser/hover.service.js"; import { IOpenerService } from "../../../../platform/opener/common/opener.service.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { ICustomizationMarketplaceInstallService } from "../common/customizationMarketplaceInstallService.service.js"; import { IWorkspaceContextService } from "../../../../platform/workspace/common/workspace.service.js"; import { IEnablementModel } from "../common/enablement.js"; import { IAgentPlugin } from "../common/plugins/agentPluginService.js"; import { IAgentPluginService } from "../common/plugins/agentPluginService.service.js"; import { IPluginInstallService } from "../common/plugins/pluginInstallService.service.js"; import { IMarketplacePluginItem } from "./agentPluginEditor/agentPluginItems.js"; import { URI } from "../../../../base/common/uri.js"; import { CustomizationEnablementKind, type PluginCustomization } from "../../../../platform/agentHost/common/state/protocol/state.js"; import { type ICustomizationItemAction } from "../common/customizationHarnessService.js"; import { IAgentHostCustomizationService } from "./agentSessions/agentHost/agentHostCustomizationService.service.js"; import { IReader } from "../../../../base/common/observable.js"; export declare class InstallPluginAction extends Action { constructor(item: IMarketplacePluginItem, pluginInstallService: IPluginInstallService); } export declare class UninstallPluginAction extends Action { private readonly removePlugin; readonly requiredByOrganization: boolean; constructor(removePlugin: () => Promise, requiredByOrganization?: boolean); /** The accessible name, which includes the reason when the organization requires the plugin. */ get ariaLabel(): string; run(): Promise; runAndGetResult(): Promise; } /** * Renders the Uninstall action of a plugin the organization requires. It stays * keyboard-reachable in action bars that skip disabled items, its accessible name * includes the reason, and hovering or pressing Enter or Space shows the reason. * The action itself stays disabled, so it never runs. */ export declare class OrganizationRequiredUninstallActionViewItem extends ActionViewItem { private readonly uninstallAction; private readonly hoverService; constructor(uninstallAction: UninstallPluginAction, options: IActionViewItemOptions, hoverService: IHoverService); isEnabled(): boolean; render(container: HTMLElement): void; protected getHoverContents(): undefined; protected updateAriaLabel(): void; } /** * Creates the Uninstall action for a removable plugin. A plugin that the * organization requires keeps a visible but disabled action that explains why. */ export declare function createUninstallPluginAction(plugin: IAgentPlugin, removePlugin?: () => Promise): UninstallPluginAction | undefined; export declare function removePluginWithMarketplaceOwnership(plugin: IAgentPlugin, marketplaceInstallService: ICustomizationMarketplaceInstallService): Promise; export declare class OpenPluginFolderAction extends Action { constructor(plugin: IAgentPlugin, commandService: ICommandService, openerService: IOpenerService); } export declare class OpenPluginReadmeAction extends Action { constructor(readmeUri: import("../../../../base/common/uri.js").URI, openerService: IOpenerService); } export declare function getPluginPolicyEnablement(plugin: IAgentPlugin, reader?: IReader): boolean | undefined; /** Whether the plugin is blocked by enterprise policy and cannot be enabled by the user. */ export declare function isPluginPolicyBlocked(plugin: IAgentPlugin): boolean; /** Whether the plugin is required by enterprise policy and cannot be disabled or uninstalled by the user. */ export declare function isPluginRequiredByPolicy(plugin: IAgentPlugin, reader?: IReader): boolean; /** Whether the installed plugin at `uri`, or containing `uri`, is required by enterprise policy. */ export declare function isPluginUriRequiredByPolicy(agentPluginService: Pick, uri: URI): boolean; /** Explains that a plugin's state is controlled by the user's organization. */ export declare function getPluginManagedByOrganizationMessage(): string; /** Notifies the user that a plugin is managed by their organization and cannot be enabled. */ export declare function notifyPluginPolicyBlocked(notificationService: INotificationService, pluginName: string): void; /** * An "Enable" action for a policy-blocked plugin: instead of enabling, it * explains via a notification that the plugin is managed by the organization. */ export declare function createPolicyBlockedEnableAction(plugin: IAgentPlugin, notificationService: INotificationService): Action; export declare function createPolicyManagedEnablementAction(plugin: IAgentPlugin, notificationService: INotificationService): Action | undefined; /** * Builds the standard context menu action groups for an installed plugin. */ export declare function getInstalledPluginContextMenuActions(plugin: IAgentPlugin, instantiationService: IInstantiationService, removePlugin?: () => Promise): IAction[][]; /** * Builds enablement actions for a plugin customization published by an agent host. * Legacy VS Code-owned plugin menus continue to use {@link getInstalledPluginContextMenuActions}. */ export declare function getAgentHostPluginEnablementActions(agentHostCustomizations: IAgentHostCustomizationService, agentPluginService: IAgentPluginService | undefined, sessionResource: URI, customization: PluginCustomization, hasWorkspace: boolean): ICustomizationItemAction[]; type AgentHostPluginEnablementTarget = { readonly id: string; readonly uri: string; readonly clientId?: string; readonly enablement?: readonly NonNullable[number][]; }; /** * Routes a plugin enablement change to the client that owns its global decision * or to the agent host for all other scopes. */ export declare function setAgentHostPluginEnablement(agentHostCustomizations: IAgentHostCustomizationService, agentPluginService: IAgentPluginService | undefined, sessionResource: URI, plugin: AgentHostPluginEnablementTarget, kind: CustomizationEnablementKind, enabled: boolean): Promise; /** Creates the container action used by a child blocked by a disabled plugin. */ export declare function createAgentHostEnablePluginAction(agentHostCustomizations: IAgentHostCustomizationService, agentPluginService: IAgentPluginService | undefined, sessionResource: URI, plugin: AgentHostPluginEnablementTarget, kind: CustomizationEnablementKind): ICustomizationItemAction; /** * Sub-action base class that auto-hides when disabled, for use inside * {@link EnablementDropDownAction}. */ declare class EnablementSubAction extends Action { private _hidden; get hidden(): boolean; set hidden(v: boolean); constructor(id: string, label: string, cssClass: string, enabled: boolean, actionCallback: () => Promise); protected _setEnabled(value: boolean): void; } interface IEnablementActionChangeEvent extends IActionChangeEvent { readonly menuActions?: IAction[]; } /** * Dropdown action that aggregates enablement sub-actions and shows the * first visible one as the primary button, with others in the dropdown. * Hides itself entirely when all sub-actions are hidden. */ export declare class EnablementDropDownAction extends Action { readonly menuActionClassNames: string[]; private _menuActions; get menuActions(): IAction[]; private _isHidden; get isHidden(): boolean; protected readonly _onDidChange: Emitter; get onDidChange(): import("../../../../base/common/event.js").Event; private readonly subActions; constructor(id: string, subActions: EnablementSubAction[]); private _updateDropdown; run(): Promise; dispose(): void; } /** * View item for {@link EnablementDropDownAction} that properly hides * the dropdown chevron when there are no secondary actions. */ export declare class EnablementDropdownActionViewItem extends ActionWithDropdownActionViewItem { constructor(action: EnablementDropDownAction, options: IActionViewItemOptions & IActionWithDropdownActionViewItemOptions, contextMenuProvider: IContextMenuProvider); render(container: HTMLElement): void; protected updateClass(): void; } /** * Creates the enable dropdown action for a plugin, containing Enable * and Enable (Workspace) sub-actions. */ export declare function createEnablePluginDropDown(plugin: IAgentPlugin, enablementModel: IEnablementModel, workspaceContextService: IWorkspaceContextService): EnablementDropDownAction; /** * Creates the disable dropdown action for a plugin, containing Disable * and Disable (Workspace) sub-actions. */ export declare function createDisablePluginDropDown(plugin: IAgentPlugin, enablementModel: IEnablementModel, workspaceContextService: IWorkspaceContextService): EnablementDropDownAction; export {};