/**
 * Voice backend - manages the Python voice server process.
 * Communicates via JSON-line protocol over stdin/stdout.
 */
import { EventEmitter } from "events";
export interface VoiceTranscription {
    text: string;
    verified: boolean;
    confidence: number;
    sttLatencyUs?: number;
}
export type VoiceEvent = {
    event: "ready";
    has_profile: boolean;
    profile_path: string | null;
} | {
    event: "recording";
    duration: number;
} | {
    event: "enrolled";
    profile: string;
} | {
    event: "listening";
} | {
    event: "speech_start";
} | {
    event: "speech_end";
} | {
    event: "transcription";
    text: string;
    verified: boolean;
    confidence: number;
    stt_latency_us?: number;
} | {
    event: "rejected";
    reason: string;
    confidence?: number;
    duration?: number;
} | {
    event: "speaking";
    text: string;
} | {
    event: "tts_timing";
    stage: string;
    latency_us: number;
} | {
    event: "speak_done";
    tts_total_us?: number;
} | {
    event: "speak_interrupted";
    tts_total_us?: number;
} | {
    event: "error";
    message: string;
} | {
    event: "stopped";
} | {
    event: "status";
    has_profile: boolean;
    listening: boolean;
    speaking: boolean;
};
export interface VoiceBackendEvents {
    ready: (hasProfile: boolean) => void;
    recording: (duration: number) => void;
    enrolled: (profilePath: string) => void;
    listening: () => void;
    speech_start: () => void;
    speech_end: () => void;
    transcription: (data: VoiceTranscription) => void;
    rejected: (reason: string, confidence: number) => void;
    speaking: (text: string) => void;
    tts_timing: (stage: string, latencyUs: number) => void;
    speak_done: (ttsTotalUs?: number) => void;
    speak_interrupted: (ttsTotalUs?: number) => void;
    error: (message: string) => void;
    stopped: () => void;
    exit: (code: number | null) => void;
}
export declare class VoiceBackend extends EventEmitter {
    private process;
    private readline;
    private _ready;
    private _hasProfile;
    private _listening;
    private _speaking;
    private _installing;
    get ready(): boolean;
    get hasProfile(): boolean;
    get listening(): boolean;
    get speaking(): boolean;
    get installing(): boolean;
    /**
     * Ensure the Python virtual environment and dependencies are installed.
     */
    ensureInstalled(): Promise<boolean>;
    private runCommand;
    /**
     * Start the voice backend process.
     */
    start(): Promise<boolean>;
    private handleEvent;
    private send;
    /**
     * Enroll voice profile by recording a sample.
     */
    enroll(duration?: number): void;
    /**
     * Start listening for voice input.
     */
    listen(): void;
    /**
     * Stop listening.
     */
    stopListening(): void;
    /**
     * Speak text via Hume AI TTS.
     */
    speak(text: string): void;
    /**
     * Interrupt TTS playback.
     */
    stopSpeaking(): void;
    /**
     * Shut down the voice backend.
     */
    shutdown(): Promise<void>;
}
//# sourceMappingURL=voice-backend.d.ts.map