import type { Api, FetchImpl, Model } from "../types.js"; /** * The one fetch every inference request goes through. Per call it applies, in * order: the inference User-Agent default, `NODE_EXTRA_CA_CERTS`, the * per-provider proxy, and `PI_REQ_DEBUG` request/response recording — then * calls `fetchImpl` (or the model's default fetch) exactly once. * * `beforeDispatch` runs for every HTTP attempt, including retries, before * dispatch bookkeeping; a thrown refusal prevents that attempt. * * Idempotent: the built fetch is stamped and returned as-is on later passes. * `streamSimple` re-enters `stream`, and `streamSimpleRequest` re-enters itself * on auth retries, so without the stamp each entry point would add another * layer (three PI_REQ_DEBUG dumps for one request). */ export declare function transportFetch(model: Model, fetchImpl: FetchImpl | undefined, beforeDispatch?: () => void): FetchImpl; /** * Origin of the last inference request {@link model} actually sent, after * every dispatch-time rewrite (credential endpoints, env overrides, regional * hosts); `undefined` before its first request. */ export declare function lastDispatchOrigin(model: Model): string | undefined; /** Test hook: forgets every recorded dispatch origin. */ export declare function resetDispatchOriginsForTesting(): void; /** Options-bag form of {@link transportFetch}; returns `options` untouched when its fetch is already built. */ export declare function withTransportFetch(model: Model, options: T): T;