/** Opt-in versioned transport integration. Kept outside the server kernel's bare dependency graph. */ import type { TransportCodec, TransportCodecRegistry } from "../transport-codec.js"; import { type ProtoPoisoning } from "./proto-guard.js"; import type { IdentityPlugin } from "./server.js"; interface TransportBodySource { readonly headers: Pick; readonly body: ReadableStream | null; arrayBuffer(): Promise; } export type TransportDecodeResult = { readonly matched: false; } | { readonly matched: true; readonly value: unknown; } | { readonly matched: true; readonly response: Response; }; export interface TransportRuntime { responseCodec(accept: string | null): TransportCodec; decodeRequest(source: TransportBodySource, contentType: string, maxBytes: number): Promise; } export interface TransportCodecsOptions { /** Maximum encoded request bytes. Keep aligned with `server({ maxBodyBytes })`. */ readonly maxBytes?: number; /** * Prototype-poisoning policy for decoded request bodies, mirroring * `server({ protoPoisoning })` - this lane parses with the codec's own decoder, so the body * lane's guard never sees the raw text and the policy must be enforced here. Default `"reject"`: * a poisoned payload answers the same flat 400 as an undecodable one. */ readonly protoPoisoning?: ProtoPoisoning; } export declare function transportCodecs(registry: TransportCodecRegistry, options?: TransportCodecsOptions): IdentityPlugin; export {}; //# sourceMappingURL=transport-lane.d.ts.map