/**
 * Abstract I/O layer for JSON-RPC message exchange.
 *
 * Physical transports such as stdio, WebSocket, or domain sockets implement
 * this interface so protocol handlers do not depend on a concrete process
 * entry point.
 */
export interface Transport {
    /** Register the message handler, called for each parsed incoming message. */
    onMessage(handler: (msg: unknown) => void): void;
    /** Register the close handler, called when the transport closes. */
    onClose(handler: () => void): void;
    /** Send a JSON-RPC message. Implementations serialize as needed. */
    send(msg: unknown): void;
    /** Start listening for incoming messages. */
    start(): void;
    /** Close the transport gracefully. */
    close(): void;
}
