/**
 * Extension testing helpers (Phase 2): mock API + minimal HTTP gateway fixture.
 */
import type { AgentTool } from '@earendil-works/pi-agent-core';
import type { ChannelPlugin } from '../../channels/plugin-types.js';
import type { Config } from '../../config/config-surface.js';
import type { ExtensionApi, ExtensionCommand, ExtensionCommandContext, ExtensionLogger, ExtensionReloadHandler, ExtensionService, GatewayMethodHandler, HttpRequestHandler } from '../types/core.js';
import type { ExtensionHookEvent } from '../types/hooks.js';
import type { CommandContribution } from '../types/manifest.js';
export interface MockExtensionApiOptions {
    id?: string;
    name?: string;
    version?: string;
    source?: string;
    extensionConfig?: Record<string, unknown>;
    config?: Partial<Config>;
    logger?: ExtensionLogger;
    /** Pretend manifest `ui.contributions.commands` for `onCommand` tests. */
    manifestCommands?: CommandContribution[];
}
export interface MockExtensionApi extends ExtensionApi {
    getRegisteredTools(): AgentTool[];
    getRegisteredHooks(): Array<{
        event: ExtensionHookEvent;
        handler: unknown;
    }>;
    getRegisteredCommands(): ExtensionCommand[];
    getRegisteredHttpRoutes(): Array<{
        path: string;
        handler: HttpRequestHandler;
    }>;
    getRegisteredServices(): ExtensionService[];
    getRegisteredGatewayMethods(): Array<{
        method: string;
        handler: GatewayMethodHandler;
    }>;
    getRegisteredChannelPlugins(): ChannelPlugin[];
    getRegisteredReloadHandlers(): ExtensionReloadHandler[];
    getEmittedEvents(): Array<{
        event: string;
        data: unknown;
    }>;
}
export declare function createMockExtensionApi(options?: MockExtensionApiOptions): MockExtensionApi;
export interface TestGateway {
    baseUrl: string;
    fetch: (path: string, init?: RequestInit) => Promise<Response>;
    close: () => Promise<void>;
}
export declare function createTestGateway(): Promise<TestGateway>;
export type { ExtensionCommandContext };
