import type { Socket } from "node:net";
import { Duplex, PassThrough } from "node:stream";
import type { RpcPublicEndpoint } from "./rpc-public-key.ts";
/** Filters public input before it can reach either the proxy or the bare host's router. */
export declare class PublicRpcConnection {
    readonly input: PassThrough;
    private readonly raw;
    private readonly timer;
    private bytes;
    private active;
    private failed;
    private first;
    private challenge;
    private protocolPending;
    /**
     * The admitted connection as one duplex for a router that reads and writes a single stream: it reads only
     * frames this filter released and writes through `response()`, so the challenge answer gains its proof.
     */
    get stream(): Duplex;
    private view;
    private readonly socket;
    private readonly endpoint;
    /** Enforcement: refuse an unauthenticated client. Off by default for one release of logged grace. */
    private readonly requireToken;
    constructor(socket: Socket, endpoint: RpcPublicEndpoint, requireToken?: boolean);
    private duplex;
    private line;
    private forward;
    private grace;
    /** Every pre-auth drop says why on stderr, by reason code only: never a frame, a nonce or key material. */
    private logDrop;
    private drop;
    private refuse;
    /**
     * Writer/proxy batches contain whole JSONL records; ordinary authenticated bytes stay untouched. Before
     * admission only the challenge answer leaves an enforcing host; a grace host keeps delivering records (the
     * lifecycle broadcasts a passive legacy observer relies on).
     */
    response(chunk: string): string;
}
//# sourceMappingURL=rpc-public-auth.d.ts.map