import type { AnyAgentTool } from "../agents/tools/common.js";
import type { ChannelDock } from "../channels/dock.js";
import type { ChannelPlugin } from "../channels/plugins/types.js";
import type { OperatorScope } from "../gateway/method-scopes.js";
import type { GatewayRequestHandler, GatewayRequestHandlers } from "../gateway/server-methods/types.js";
import { registerInternalHook } from "../hooks/internal-hooks.js";
import type { HookEntry } from "../hooks/types.js";
import type { PluginRuntime } from "./runtime/types.js";
import type { FasedAgentPluginApi, FasedAgentPluginChannelRegistration, FasedAgentPluginCliRegistrar, FasedAgentPluginCommandDefinition, FasedAgentPluginHttpHandler, FasedAgentPluginHttpRouteHandler, FasedAgentPluginHookOptions, ImageGenerationProviderPlugin, ProviderPlugin, RealtimeTranscriptionProviderPlugin, RealtimeVoiceProviderPlugin, FasedAgentPluginService, FasedAgentPluginToolFactory, WebSearchProviderPlugin, PluginConfigUiHint, PluginDiagnostic, VideoGenerationProviderPlugin, PluginLogger, PluginOrigin, PluginKind, PluginHookName, PluginHookHandlerMap, PluginHookRegistration as TypedPluginHookRegistration } from "./types.js";
export type PluginToolRegistration = {
    pluginId: string;
    factory: FasedAgentPluginToolFactory;
    names: string[];
    optional: boolean;
    source: string;
};
export type PluginCliRegistration = {
    pluginId: string;
    register: FasedAgentPluginCliRegistrar;
    commands: string[];
    source: string;
};
export type PluginHttpRegistration = {
    pluginId: string;
    handler: FasedAgentPluginHttpHandler;
    source: string;
};
export type PluginHttpRouteRegistration = {
    pluginId?: string;
    path: string;
    handler: FasedAgentPluginHttpRouteHandler;
    source?: string;
};
export type PluginChannelRegistration = {
    pluginId: string;
    plugin: ChannelPlugin;
    dock?: ChannelDock;
    source: string;
};
export type PluginProviderRegistration = {
    pluginId: string;
    provider: ProviderPlugin;
    source: string;
};
export type PluginWebSearchProviderRegistration = {
    pluginId: string;
    provider: WebSearchProviderPlugin;
    source: string;
};
export type PluginImageGenerationProviderRegistration = {
    pluginId: string;
    provider: ImageGenerationProviderPlugin;
    source: string;
};
export type PluginVideoGenerationProviderRegistration = {
    pluginId: string;
    provider: VideoGenerationProviderPlugin;
    source: string;
};
export type PluginRealtimeTranscriptionProviderRegistration = {
    pluginId: string;
    provider: RealtimeTranscriptionProviderPlugin;
    source: string;
};
export type PluginRealtimeVoiceProviderRegistration = {
    pluginId: string;
    provider: RealtimeVoiceProviderPlugin;
    source: string;
};
export type PluginHookRegistration = {
    pluginId: string;
    entry: HookEntry;
    events: string[];
    source: string;
};
export type PluginServiceRegistration = {
    pluginId: string;
    service: FasedAgentPluginService;
    source: string;
};
export type PluginCommandRegistration = {
    pluginId: string;
    command: FasedAgentPluginCommandDefinition;
    source: string;
};
export type PluginRecord = {
    id: string;
    name: string;
    version?: string;
    description?: string;
    kind?: PluginKind;
    source: string;
    origin: PluginOrigin;
    workspaceDir?: string;
    enabled: boolean;
    status: "loaded" | "disabled" | "error";
    error?: string;
    toolNames: string[];
    hookNames: string[];
    channelIds: string[];
    providerIds: string[];
    webSearchProviderIds?: string[];
    gatewayMethods: string[];
    cliCommands: string[];
    services: string[];
    commands: string[];
    httpHandlers: number;
    hookCount: number;
    configSchema: boolean;
    configUiHints?: Record<string, PluginConfigUiHint>;
    configJsonSchema?: Record<string, unknown>;
};
export type PluginRegistry = {
    plugins: PluginRecord[];
    tools: PluginToolRegistration[];
    hooks: PluginHookRegistration[];
    typedHooks: TypedPluginHookRegistration[];
    channels: PluginChannelRegistration[];
    providers: PluginProviderRegistration[];
    webSearchProviders: PluginWebSearchProviderRegistration[];
    imageGenerationProviders: PluginImageGenerationProviderRegistration[];
    videoGenerationProviders: PluginVideoGenerationProviderRegistration[];
    realtimeTranscriptionProviders: PluginRealtimeTranscriptionProviderRegistration[];
    realtimeVoiceProviders: PluginRealtimeVoiceProviderRegistration[];
    gatewayHandlers: GatewayRequestHandlers;
    gatewayMethodScopes: Partial<Record<string, OperatorScope>>;
    httpHandlers: PluginHttpRegistration[];
    httpRoutes: PluginHttpRouteRegistration[];
    cliRegistrars: PluginCliRegistration[];
    services: PluginServiceRegistration[];
    commands: PluginCommandRegistration[];
    diagnostics: PluginDiagnostic[];
};
export type PluginRegistryParams = {
    logger: PluginLogger;
    coreGatewayHandlers?: GatewayRequestHandlers;
    runtime: PluginRuntime;
};
export declare function createEmptyPluginRegistry(): PluginRegistry;
export declare function createPluginRegistry(registryParams: PluginRegistryParams): {
    registry: PluginRegistry;
    createApi: (record: PluginRecord, params: {
        config: FasedAgentPluginApi["config"];
        pluginConfig?: Record<string, unknown>;
    }) => FasedAgentPluginApi;
    pushDiagnostic: (diag: PluginDiagnostic) => void;
    registerTool: (record: PluginRecord, tool: AnyAgentTool | FasedAgentPluginToolFactory, opts?: {
        name?: string;
        names?: string[];
        optional?: boolean;
    }) => void;
    registerChannel: (record: PluginRecord, registration: FasedAgentPluginChannelRegistration | ChannelPlugin) => void;
    registerProvider: (record: PluginRecord, provider: ProviderPlugin) => void;
    registerWebSearchProvider: (record: PluginRecord, provider: WebSearchProviderPlugin) => void;
    registerImageGenerationProvider: (record: PluginRecord, provider: ImageGenerationProviderPlugin) => void;
    registerVideoGenerationProvider: (record: PluginRecord, provider: VideoGenerationProviderPlugin) => void;
    registerRealtimeTranscriptionProvider: (record: PluginRecord, provider: RealtimeTranscriptionProviderPlugin) => void;
    registerRealtimeVoiceProvider: (record: PluginRecord, provider: RealtimeVoiceProviderPlugin) => void;
    registerGatewayMethod: (record: PluginRecord, method: string, handler: GatewayRequestHandler, opts?: {
        scope?: OperatorScope;
    }) => void;
    registerCli: (record: PluginRecord, registrar: FasedAgentPluginCliRegistrar, opts?: {
        commands?: string[];
    }) => void;
    registerService: (record: PluginRecord, service: FasedAgentPluginService) => void;
    registerCommand: (record: PluginRecord, command: FasedAgentPluginCommandDefinition) => void;
    registerHook: (record: PluginRecord, events: string | string[], handler: Parameters<typeof registerInternalHook>[1], opts: FasedAgentPluginHookOptions | undefined, config: FasedAgentPluginApi["config"]) => void;
    registerTypedHook: <K extends PluginHookName>(record: PluginRecord, hookName: K, handler: PluginHookHandlerMap[K], opts?: {
        priority?: number;
    }) => void;
};
