import type { AgentEvent } from "@prestyj/agent";
export interface BusEventMap {
    text_delta: {
        text: string;
    };
    thinking_delta: {
        text: string;
    };
    tool_call_start: {
        toolCallId: string;
        name: string;
        args: Record<string, unknown>;
    };
    tool_call_update: {
        toolCallId: string;
        update: unknown;
    };
    tool_call_end: {
        toolCallId: string;
        result: string;
        isError: boolean;
        durationMs: number;
        /** Tool-specific extras (e.g. screenshot/read image previews). */
        details?: unknown;
    };
    turn_end: {
        turn: number;
        stopReason: string;
        usage: {
            inputTokens: number;
            outputTokens: number;
            cacheRead?: number;
            cacheWrite?: number;
        };
    };
    agent_done: {
        totalTurns: number;
        totalUsage: {
            inputTokens: number;
            outputTokens: number;
            cacheRead?: number;
            cacheWrite?: number;
        };
    };
    error: {
        error: Error;
    };
    server_tool_call: {
        id: string;
        name: string;
        input: unknown;
    };
    server_tool_result: {
        toolUseId: string;
        resultType: string;
        data: unknown;
    };
    hook: {
        kind: "ideal" | "loop_break" | "regrounding";
    };
    session_start: {
        sessionId: string;
    };
    model_change: {
        provider: string;
        model: string;
        supportsVideo?: boolean;
    };
    compaction_start: {
        messageCount: number;
    };
    compaction_end: {
        originalCount: number;
        newCount: number;
    };
    branch_created: {
        leafId: string;
        messagesKept: number;
    };
    user_input: {
        content: string;
    };
    slash_command: {
        name: string;
        args: string;
    };
}
type EventKey = keyof BusEventMap;
type EventHandler<K extends EventKey> = (payload: BusEventMap[K]) => void;
export declare class EventBus {
    private listeners;
    on<K extends EventKey>(event: K, handler: EventHandler<K>): () => void;
    off<K extends EventKey>(event: K, handler: EventHandler<K>): void;
    emit<K extends EventKey>(event: K, payload: BusEventMap[K]): void;
    once<K extends EventKey>(event: K, handler: EventHandler<K>): () => void;
    /** Remove all listeners, freeing closures that may retain large scopes. */
    removeAllListeners(): void;
    forwardAgentEvent(event: AgentEvent): void;
}
export {};
//# sourceMappingURL=event-bus.d.ts.map