import type { PageCallbackRouter } from './ai_overlay_dialog.mojom-webui.js';
import type { ApiSessionDelegate, ToolCall } from './api_session.js';
import type { PageContext } from './page_context_manager.js';
import type { AiOverlayToolsRemote } from './tools.mojom-webui.js';
/**
 * Information about how to initialize the model's personality. Corresponds to
 * the persona JSON defined in the bundle.
 */
export interface Persona {
    id: string;
    name: string;
    nicknames: string[];
    persona: string;
    voice: string;
}
/**
 * Information about setup for the model connection. Corresponds to the
 * api_config JSON defined in the bundle.
 */
export interface ApiConfig {
    endpointUrl: string;
    model: string;
    apiKey: string;
}
/**
 * Configuration information used to initialize a Conversation object.
 */
export interface ConversationConfig {
    system_instruction: string;
    persona: Persona;
    api_config: ApiConfig;
}
/**
 * States for the conversation.
 */
export declare enum State {
    STOPPED = "stopped",
    LISTENING = "listening",
    TALKING = "talking"
}
export interface OutputTranscriptionMessage {
    type: 'outputTranscription';
    text: string;
}
interface UiDelegate {
    sendToUI: (msg: OutputTranscriptionMessage) => void;
    onStateChange: (state: State, oldState: State) => void;
    onResponse: (audioData: string) => void;
}
/**
 * Conversation is the central "brains" of the AI Overlay. It manages the
 * conversation state and bridges the UI with the API session.
 */
export declare class Conversation implements ApiSessionDelegate {
    private readonly uiDelegate;
    private readonly toolExecutor;
    private readonly pageContextManager;
    private readonly config;
    private readonly journal;
    private session;
    private toolDefinitions;
    private state;
    private currentInput;
    private currentOutput;
    private mockAudioEndTime;
    constructor(config: ConversationConfig, uiDelegate: UiDelegate, toolsRemote: AiOverlayToolsRemote, router: PageCallbackRouter, initialPageContext?: PageContext);
    get connected(): boolean;
    get pageContext(): PageContext | null;
    /**
     * ApiSessionDelegate interface
     */
    onResponse(audioData: string): void;
    onTranscription(text: string, isInput: boolean): void;
    onTurnComplete(): void;
    interrupt(): void;
    onConnectionChanged(connected: boolean): void;
    /**
     * Conversation
     */
    sendAudio(sampleRate: number, data: string): void;
    sendText(text: string): void;
    /**
     * Connects to the server and establishes a new session, moves the
     * conversation into a live state once the connection is ready.
     */
    start(): Promise<void>;
    onToolCall(toolCall: ToolCall): Promise<void>;
    markMockAudioEndTime(time: number): void;
    /**
     * Tears down the session with the server and moves into a stopped state
     * where nothing should be happening.
     */
    stop(): void;
    private setState;
    private createNewApiSession;
    private onPageContextChange;
}
export {};
