/**
 * Transport-agnostic RPC handler.
 *
 * Extracted from rpc-mode.ts so the same RPC protocol can run over:
 * - stdin/stdout (original rpc-mode)
 * - WebSocket (serve-mode)
 * - Any other bidirectional transport
 */
import type { AgentSession } from "../../core/agent-session.js";
/**
 * A bidirectional message transport.
 */
export interface RpcTransport {
    /** Send a string message to the remote end */
    send(data: string): void;
    /** Register a handler for incoming messages */
    onMessage(handler: (data: string) => void): void;
    /** Register a handler for connection close */
    onClose(handler: () => void): void;
}
/**
 * Run the full RPC protocol over an arbitrary transport.
 * Returns when the transport closes.
 */
export declare function runRpcOverTransport(session: AgentSession, transport: RpcTransport): Promise<void>;
//# sourceMappingURL=rpc-transport.d.ts.map