import { AgentSession as pb } from '@livekit/protocol';
import { AudioFrame } from '@livekit/rtc-node';
import type { AgentSession } from './agent_session.js';
import { AudioInput, AudioOutput } from './io.js';
import type { SessionTransport } from './remote_session.js';
/**
 * Audio input fed by inbound `audio_input` console messages. Frames arrive at
 * the wire rate, are resampled to the agent rate, and pushed into the base
 * {@link AudioInput} stream that the STT pipeline reads from.
 *
 * Unlike the python port, no cross-thread queue is needed: the JS console job
 * runs in-process on a single event loop, so a stream channel is sufficient.
 *
 * @experimental
 */
export declare class TcpAudioInput extends AudioInput {
    private readonly channel;
    private readonly resampler;
    private closed;
    constructor();
    pushFrame(frame: pb.AgentSessionMessage_ConsoleIO_AudioFrame): void;
    close(): Promise<void>;
}
/**
 * Audio output that streams the agent's TTS frames to the broker as
 * `audio_output` console messages (resampled to the wire rate) and drives the
 * flush/clear playout handshake. A flush blocks the agent turn until the broker
 * reports `audio_playback_finished` (or the buffer is cleared on interruption).
 *
 * @experimental
 */
export declare class TcpAudioOutput extends AudioOutput {
    private readonly transport;
    private readonly resampler;
    private pushedDurationMs;
    private captureStartedAt;
    private flushTask?;
    private playoutDone;
    private interrupted;
    constructor(transport: SessionTransport);
    captureFrame(frame: AudioFrame): Promise<void>;
    flush(): void;
    clearBuffer(): void;
    /** Called by {@link SessionHost} when the broker reports playout finished. */
    notifyPlayoutFinished(): void;
    private runPlayoutHandshake;
}
/**
 * Process-wide singleton that carries the console transport (and audio IO) from
 * the `console` CLI runner into the {@link AgentSession} that starts inside the
 * agent entrypoint. Mirrors python `AgentsConsole`.
 *
 * The runner sets {@link enabled} and the transport; `AgentSession._startImpl`
 * then calls {@link acquireIo} to wire the session and build its `SessionHost`.
 *
 * @experimental
 */
export declare class AgentsConsole {
    private static _instance?;
    static getInstance(): AgentsConsole;
    /** @internal — reset the process-wide singleton (test only). */
    static _reset(): void;
    enabled: boolean;
    record: boolean;
    transport?: SessionTransport;
    audioInput?: TcpAudioInput;
    audioOutput?: TcpAudioOutput;
    /**
     * Directory where console recordings (audio + session report) are written,
     * relative to the working directory. Mirrors python's `AgentsConsole`.
     */
    readonly sessionDirectory: string;
    private acquired;
    private constructor();
    get ioAcquired(): boolean;
    /** Wire the session's IO for console mode. */
    acquireIo(session: AgentSession): void;
}
//# sourceMappingURL=console_io.d.ts.map