/**
 * chat-transport daemon RPC server (T-CHAT-AS-TERMINAL CAT.1b).
 *
 * Runs INSIDE the daemon worker. Listens on the platform-correct socket
 * address (Unix socket / named pipe) and dispatches JSON-RPC method calls to
 * the in-process `ChatGateway`. Ported from `src.legacy/chat/daemon/
 * rpc-server.ts`, minus the dropped subscribe/unsubscribe broker (see
 * `./protocol.ts` — the file-tail watcher replaced inbound push).
 *
 * Connection model: stateless. Each newline-delimited line is one request; the
 * response goes back on the same connection. Connections may pipeline; the
 * server buffers per-connection until `\n`.
 *
 * The `send` result shape `{ok:true, platform, message_id, delivered_at}` and
 * the method names are LOAD-BEARING — `src/mcp/chat-bridge-server.ts` +
 * `src/runtime/agent_bridge/tools/chat_send.ts` parse them. Do not change them.
 *
 * Imports from: node:net, node:fs, ../gateway, ./protocol.
 * Imported by: ./worker.ts + tests.
 */
import type { ChatGateway } from '../gateway.js';
export interface RpcServerOptions {
    gateway: ChatGateway;
    startedAt?: number;
    /** Daemon process version string — surfaced by `ping`. */
    version?: string;
    /** Pid surfaced by `ping`. Defaults to process.pid. */
    pid?: number;
    /** Hook for tests: fires when a request is dispatched. */
    onRequest?: (method: string) => void;
}
export declare class RpcServer {
    private readonly opts;
    private readonly server;
    private listening;
    private readonly address;
    private readonly startedAt;
    constructor(opts: RpcServerOptions);
    /** The resolved socket address (for diagnostics / tests). */
    get socketAddress(): string;
    listen(): Promise<void>;
    close(): Promise<void>;
    private handleConnection;
    private dispatchLine;
    private respond;
    private handle;
}
//# sourceMappingURL=rpc_server.d.ts.map