/**
 * Extension API Implementation
 *
 *  Complete extension API with strong typing, security, and provider support.
 */
import type { AgentTool } from '@earendil-works/pi-agent-core';
import type { Command } from 'commander';
import type { ExtensionApi, ExtensionLogger, ExtensionRuntime, GatewayMethodHandler, HttpRequestHandler, ExtensionCommand, ExtensionCommandHandler, ExtensionReloadHandler, ExtensionService, FlagConfig, FlagValue, ShortcutConfig, HookHandlerMap, ExtensionHookEvent, TuiExtensionRegistrar } from './types/index.js';
import type { CommandContribution } from './types/manifest.js';
import type { ChannelPlugin } from '../channels/plugin-types.js';
import type { Config } from '../config/config-surface.js';
import { EventEmitter } from 'events';
import { TypedEventBus } from './typed-event-bus.js';
import { ExtensionRegistryImpl } from './extension-registry-impl.js';
import type { SpeechProviderPlugin } from '../voice/tts/speech-provider-types.js';
import type { MediaUnderstandingProvider } from '../media-understanding/types.js';
export declare class ExtensionApiImpl implements ExtensionApi {
    readonly id: string;
    readonly name: string;
    readonly version: string | undefined;
    readonly source: string;
    readonly config: Config;
    readonly extensionConfig: Record<string, unknown>;
    private readonly _logger;
    private readonly _resolvePath;
    private readonly _coreRegistry?;
    private _tools;
    private _hooks;
    private _typedHooks;
    private _eventBus;
    private _typedEventBus;
    private _registry;
    private readonly _runtime;
    private _reloadConfigPrefixes;
    private _registeredCommandIds;
    private _registeredSpeechProviderIds;
    private _registeredMediaUnderstandingProviderIds;
    private _registeredMarketplaceAdapterIds;
    private readonly _manifestCommands;
    constructor(id: string, name: string, version: string | undefined, source: string, config: Config, extensionConfig: Record<string, unknown>, _logger: ExtensionLogger, _resolvePath: (input: string) => string, _coreRegistry?: ExtensionRegistryImpl, runtime?: ExtensionRuntime);
    get logger(): ExtensionLogger;
    get runtime(): ExtensionRuntime;
    registerTool(tool: AgentTool): void;
    registerHook(event: string, handler: Function, opts?: {
        priority?: number;
        once?: boolean;
    }): void;
    /**
     *  Strongly typed hook registration
     * Provides compile-time type checking and IDE autocomplete
     *
     * @example
     * api.on('before_agent_start', async (event, ctx) => {
     *   console.log('Agent starting with prompt:', event.prompt);
     *   return { systemPrompt: event.systemPrompt };
     * });
     */
    onHook<K extends ExtensionHookEvent>(hookName: K, handler: HookHandlerMap[K], _opts?: {
        priority?: number;
    }): void;
    /**
     *  Get typed hooks for a specific event
     */
    _getTypedHooks<K extends ExtensionHookEvent>(hookName: K): HookHandlerMap[K][];
    /** Adds a ChannelPlugin to the extension registry; emits `channel:register` for observability. */
    registerChannel(registration: {
        plugin: ChannelPlugin;
    }): void;
    registerHttpRoute(path: string, handler: HttpRequestHandler): void;
    registerCommand(command: ExtensionCommand): void;
    /** Injected from manifest `ui.contributions.commands` by the loader. */
    _setManifestCommands(commands: CommandContribution[]): void;
    onCommand(commandId: string, handler: ExtensionCommandHandler): void;
    registerReload(handler: ExtensionReloadHandler): void;
    /** Called from loader when manifest declares `reload.configPrefixes`. */
    _setReloadConfigPrefixes(prefixes: string[]): void;
    registerService(service: ExtensionService): void;
    registerGatewayMethod(method: string, handler: GatewayMethodHandler): void;
    registerCli(factory: (ctx: {
        program: Command;
    }) => void, opts?: {
        commands: string[];
    }): void;
    resolvePath(input: string): string;
    emit(event: string, data: unknown): void;
    on(event: string, handler: (data: unknown) => void): void;
    off(event: string, handler: (data: unknown) => void): void;
    get events(): TypedEventBus;
    /**
     * Register a full ProviderPlugin
     */
    registerProvider(plugin: import('./types/providers.js').ProviderPlugin): void;
    /**
     * Register a full ProviderPlugin (alias for registerProvider)
     */
    registerProviderPlugin(plugin: import('./types/providers.js').ProviderPlugin): void;
    registerSpeechProvider(plugin: SpeechProviderPlugin): void;
    /** Speech provider ids registered through this extension API instance. */
    getRegisteredSpeechProviderIds(): readonly string[];
    registerMediaUnderstandingProvider(plugin: MediaUnderstandingProvider): void;
    /** Media understanding provider ids registered through this extension API instance. */
    getRegisteredMediaUnderstandingProviderIds(): readonly string[];
    /**
     * Register a skills marketplace adapter so it appears in the UI provider picker.
     */
    registerMarketplaceAdapter(registration: {
        adapter: import('../agent/skills/marketplace/adapter.types.js').SkillsMarketplaceAdapter;
        displayName?: string;
    }): void;
    registerFlag(_name: string, _config: FlagConfig): void;
    getFlag(_name: string): FlagValue;
    registerShortcut(_key: string, _config: ShortcutConfig): void;
    registerTui(register: TuiExtensionRegistrar): void;
    _getTools(): Map<string, AgentTool>;
    _getHooks(): Map<string, Set<Function>>;
    _getEventBus(): EventEmitter;
    _cleanup(): void;
}
export declare function createExtensionLogger(prefix: string): ExtensionLogger;
export declare function createPathResolver(extensionDir: string, workspaceDir: string): (input: string) => string;
