/** OpenAI request-body keys core owns; `extraBody` cannot override these. */
export declare const OPENAI_RESERVED: ReadonlySet<string>;
/** Anthropic request-body keys core owns; `extraBody` cannot override these. (Note the asymmetry vs
 *  OpenAI — e.g. `stop`/`stop_sequences` is NOT reserved here because the Anthropic brain never sets it.) */
export declare const ANTHROPIC_RESERVED: ReadonlySet<string>;
/**
 * Open Responses request-body keys core owns; `extraBody` cannot override these (design/163).
 *
 * The last three are NOT keys the adapter sets — they are keys it must be IMPOSSIBLE to set. The
 * Open Responses lane is stateless by contract (this engine is the transcript authority), and
 * `extraBody` is the only other path to the request body, so `store` / `previous_response_id` /
 * `conversation` are reserved purely to close it. A deployment that sets one gets the design/40
 * collision warning at load and a stripped key on the wire, never a silently server-linked turn.
 */
export declare const RESPONSES_RESERVED: ReadonlySet<string>;
/** Reserved set for a model's API. */
export declare function reservedFor(api: string): ReadonlySet<string>;
/**
 * Merge `extraBody` into a brain's already-built request `body`, dropping any key the brain owns so core
 * always wins. Returns a NEW object (passthrough keys first, then core keys) when `extraBody` is set; the
 * exact `body` reference (no allocation, byte-identical serialization) when it isn't — so an existing
 * deployment with no `extraBody` is unaffected.
 */
export declare function applyExtraBody(body: Record<string, unknown>, extraBody: Record<string, unknown> | undefined, reserved: ReadonlySet<string>): Record<string, unknown>;
/** The auth-bearing header names (case-fold), single-sourced for the credential enforcement
 *  (`applyRouteCredentialHeaders`, route-adjudicator.ts — the ONE authority over auth spelling: a
 *  per-model winner strips every carrier, any case, and re-asserts the winning bag's own),
 *  {@link mergeHeaders} (which EXEMPTS them — see there), and the route credential resolver (which
 *  reads carrier PRESENCE per bag to classify a headers-borne credential). The former per-call
 *  strip helper that lived here (`stripAuthHeaders` — "per-call auth replaces construction-time
 *  auth", triggered on `options.apiKey` presence) is retired: the three brains now run the
 *  route-credential resolution instead, whose per-model arm strips a strict superset of what the
 *  helper did. */
export declare const AUTH_CARRIER_NAMES: ReadonlySet<string>;
/**
 * #343 — the shared USER-HEADER merge layer (`model.headers` → construction `config.headers` →
 * per-call `options.headers`, later bag wins), CASE-FOLD deduplicated: HTTP header field names are
 * case-insensitive (RFC 9110), but a plain-object spread keys by exact spelling, so an `X-Tenant`
 * in one bag and an `x-tenant` in another both reach the wire, where fetch's Headers folds them
 * into one comma-joined value ("a, b") — neither writer's value, the later layer's documented
 * override silently defeated. A later bag's entry replaces an earlier case-variant instead; the
 * WINNER'S spelling and value survive (a single-spelling config is byte-identical on the wire).
 *
 * EXEMPT: the auth carriers (`authorization` / `x-api-key`, any case) pass through with plain
 * spread semantics (same-spelling override only, no case-fold dedup), so that the credential
 * enforcement (`applyRouteCredentialHeaders`, route-adjudicator.ts) stays the ONE authority over
 * auth spelling and this layer never becomes a second, subtly different one.
 *
 * The exemption is NOT what keeps a header-only `ANTHROPIC_AUTH_TOKEN` alive: dedup keeps the
 * winner's spelling, a lone `Authorization` has nothing to dedup against, and the credential
 * enforcement already deletes every spelling present when a per-model credential wins. What the
 * exemption really costs is measured, not reasoned:
 * `mergeHeaders({Authorization:A},{authorization:B})` keeps BOTH, and the platform `Headers` fold
 * sends `authorization: A, B`.
 *
 * STATED RESIDUAL (deliberately not fixed here), NARROWED by the credential enforcement: where a
 * PER-MODEL credential wins (an options- or entry-bag carrier), every carrier is stripped and only
 * the winning bag's re-asserted, so a cross-layer double spelling now folds to the winner. What
 * remains is the DEPLOYMENT-CONFIG arm — its bytes ride untouched by design — so a config bag that
 * itself spells the SAME auth carrier two ways still ships both, comma-folded. Held, not denied, on
 * severity: no server accepts a comma-joined credential, so that failure is a LOUD 401 attributable
 * to the misconfiguration, while the non-auth case this function exists for produces a silently
 * WRONG value (`X-Tenant: a, b`). Tightening it changes which credential reaches the wire, so it
 * belongs in a window that discloses an auth-face behavior change.
 */
/**
 * #343 — assign a STRUCTURAL locked header under its canonical lowercase name, deleting every
 * case-variant spelling first. The brains hard-lock `content-type` / `anthropic-version` AFTER the
 * user-bag merge precisely so they "can NEVER be overridden" (council design/40) — and without the
 * delete a user bag carrying `Content-Type: text/plain` survives BESIDE the lowercase lock, the
 * platform `Headers` fold turning the pair into `text/plain, application/json` on the wire: a lock
 * that decides nothing. Auth carriers are deliberately NOT routed through here (credential replacement + the
 * header-only boot flow are the pinned jurisdiction of `applyRouteCredentialHeaders`,
 * route-adjudicator.ts).
 */
export declare function lockHeader(headers: Record<string, string>, lowerName: string, value: string): void;
/**
 * #343 (review r4) — case-fold READ-AND-CLAIM for an AUGMENTABLE structural header (`anthropic-beta`):
 * returns the current value under whatever spelling the user bag carried and deletes that spelling,
 * so the caller's canonical lowercase write REPLACES it instead of duplicating beside it (the
 * read-modify-write used to key the read by the exact lowercase name and miss `Anthropic-Beta`,
 * losing the user's betas from the merge AND double-sending the header).
 */
export declare function takeHeaderCasefold(headers: Record<string, string>, lowerName: string): string | undefined;
export declare function mergeHeaders(...bags: Array<Record<string, string> | undefined>): Record<string, string>;
/**
 * The output-cap key(s) each lane's wire form uses. A lane's set is exactly the keys THAT lane's
 * endpoint reads — a stray cap key belonging to another wire form is inert there and must not be
 * mistaken for a bound this request carries.
 */
export declare const OUTPUT_CAP_KEYS: Readonly<Record<"openai" | "anthropic" | "responses", readonly string[]>>;
/**
 * The per-request output cap a FINAL (post-`extraBody`) request body actually carries — the SMALLEST
 * of the lane's cap keys that is present and usable, or `undefined` when none is.
 *
 * Read off the merged body rather than off the knob the adapter set, because those are not the same
 * thing: `extraBody` can contribute a cap under a spelling the adapter did not choose, and a
 * consumer that treats the adapter's own number as "the cap on the wire" would be wrong about a
 * request that carries two. Smallest wins so a consumer reasoning about the bound stays conservative.
 */
export declare function effectiveOutputCap(body: Record<string, unknown>, keys: readonly string[]): number | undefined;
/** Names in `extraBody` that collide with a reserved (core-owned) key — for a load-time warning. */
export declare function reservedCollisions(extraBody: Record<string, unknown> | undefined, reserved: ReadonlySet<string>): string[];
