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'; import { type ApiCallOperation } from '../api-call-operations.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[]; credentialQueryParams?: readonly string[]; schemePriority?: readonly string[]; /** * The documented operations agents may reach on this API's hosts; see `apiCallOperationsOf`. * Undefined puts no path restriction on the API. */ operations?: readonly ApiCallOperation[]; }; 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; beforeSend?: () => Promise; clientIp?: string; /** Upper-case methods that may reach the network (`mcp.apiCalls.allowedHttpMethods`); undefined allows all. */ allowedHttpMethods?: readonly string[]; }; /** Build the host-side `fetch` the gateway sandbox calls. */ export declare function buildFetchBridge({ allowedHosts, apis, authorization, onAuthRequired, fetchImpl, dispatcher, timeoutMs, maxResponseBytes, maxFetchesPerExec, beforeSend, clientIp, allowedHttpMethods, }: FetchBridgeOptions): SandboxFetch; export declare function readCappedBody(response: Response, maxBytes: number): Promise; export {}; //# sourceMappingURL=fetch-bridge.d.ts.map