import { Agent, type Dispatcher } from 'undici'; import type { SandboxFetch } from '../../codemode/types.js'; import type { UpstreamAuthRequiredEvent } from '../upstream-auth.js'; import type { StoredSecret } from '../secret-store.js'; export declare function getDefaultAgent(): Agent; export type FetchBridgeRoute = { pattern: RegExp; method: string; schemes: readonly string[]; }; export type FetchBridgeApi = { slug: string; name: string; matchers: readonly RegExp[]; secrets?: Readonly>; defaultScheme?: string; routes?: readonly FetchBridgeRoute[]; credentialHeaders?: readonly string[]; schemePriority?: readonly string[]; }; type FetchBridgeOptions = { allowedHosts: readonly RegExp[]; apis?: readonly FetchBridgeApi[]; authorization?: string; onAuthRequired?: (event: UpstreamAuthRequiredEvent) => void; fetchImpl?: typeof fetch; dispatcher?: Dispatcher; timeoutMs?: number; maxResponseBytes?: number; maxFetchesPerExec?: number; clientIp?: string; }; /** Build the host-side `fetch` the gateway sandbox calls. */ export declare function buildFetchBridge({ allowedHosts, apis, authorization, onAuthRequired, fetchImpl, dispatcher, timeoutMs, maxResponseBytes, maxFetchesPerExec, clientIp, }: FetchBridgeOptions): SandboxFetch; export declare function readCappedBody(response: Response, maxBytes: number): Promise; export {}; //# sourceMappingURL=fetch-bridge.d.ts.map