import { IDisposable } from "../../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../../base/common/observable.js"; import { URI } from "../../../../../base/common/uri.js"; import { SyncDescriptor0 } from "../../../../../platform/instantiation/common/descriptors.js"; import { type INamedPluginResource, type IMcpServerDefinition, type IParsedHookCommand, type PluginFormat } from "../../../../../platform/agentPlugins/common/pluginParsers.js"; import { ContributionEnablementState, IEnablementModel } from "../enablement.js"; import { IAutomationBlueprint } from "../automations/automationBlueprint.js"; import { HookType } from "../promptSyntax/hookTypes.js"; import { IMarketplacePlugin } from "./pluginMarketplaceService.js"; export interface IAgentPluginHook { readonly type: HookType; readonly hooks: readonly IParsedHookCommand[]; /** URI where this hook is defined -- not unique, multiple hooks may be in a manifest */ readonly uri: URI; readonly originalId: string; } export type IAgentPluginCommand = INamedPluginResource; export type IAgentPluginSkill = INamedPluginResource; export type IAgentPluginAgent = INamedPluginResource; export type IAgentPluginInstruction = INamedPluginResource; export type IAgentPluginMcpServerDefinition = IMcpServerDefinition; export interface IAgentPluginAutomation { readonly uri: URI; readonly blueprint: IAutomationBlueprint; } export type CopilotCliPluginInstallSource = { readonly kind: "github"; readonly repository: string; readonly ref?: string; readonly sha?: string; readonly path?: string; } | { readonly kind: "url"; readonly url: string; readonly ref?: string; readonly sha?: string; readonly path?: string; } | { readonly kind: "local"; readonly path: string; }; export interface ICopilotCliPluginInstallation { readonly name: string; readonly marketplace: string; readonly directSourceId?: string; readonly source?: CopilotCliPluginInstallSource; } export interface IAgentPlugin { readonly uri: URI; readonly format: PluginFormat; /** Human-readable display name for the plugin. */ readonly label: string; /** Version declared by the plugin manifest, falling back to marketplace metadata. */ readonly version?: IObservable; readonly enablement: IObservable; /** Explicit managed enablement for this plugin. Undefined when policy does not mention it. */ readonly policyEnablement?: IObservable; /** Compatibility view for consumers that only distinguish policy-blocked plugins. */ readonly policyBlocked?: IObservable; /** Removes this plugin from its discovery source (config or installed storage). */ remove?(): Promise; /** Persists global enablement through the runtime that owns this installation. */ setEnabled?(enabled: boolean): Promise; readonly hooks: IObservable; readonly commands: IObservable; readonly skills: IObservable; readonly agents: IObservable; readonly instructions: IObservable; readonly mcpServerDefinitions: IObservable; readonly automations: IObservable; /** Set when the plugin was installed from a marketplace repository. */ readonly fromMarketplace?: IMarketplacePlugin; /** Set when the Copilot SDK owns this plugin installation. */ readonly copilotCliInstallation?: ICopilotCliPluginInstallation; } /** Commits global runtime enablement before publishing the client's decision; workspace overrides stay local. */ export declare function setAgentPluginEnablement(plugin: IAgentPlugin, model: IEnablementModel, state: ContributionEnablementState): Promise; export interface IAgentPluginDiscovery extends IDisposable { readonly plugins: IObservable; start(enablementModel: IEnablementModel): void; } export declare enum AgentPluginDiscoveryPriority { Configured = 10, Marketplace = 20, Extension = 30, CopilotCli = 40 } export declare function getCanonicalPluginCommandId(plugin: { readonly uri: URI; readonly label?: string; }, commandName: string): string; declare class AgentPluginDiscoveryRegistry { private readonly _discovery; private _order; register(descriptor: SyncDescriptor0, priority: AgentPluginDiscoveryPriority): IDisposable; getAll(): readonly { readonly descriptor: SyncDescriptor0; readonly priority: AgentPluginDiscoveryPriority; readonly order: number; }[]; } export declare const agentPluginDiscoveryRegistry: AgentPluginDiscoveryRegistry; export {};