export type SearchProviderId = "brave" | "tavily" | "duckduckgo" | "exa"; export declare const searchProviderIds: readonly SearchProviderId[]; export type ExaSearchType = "instant" | "fast" | "auto" | "deep-lite" | "deep" | "deep-reasoning"; export declare const exaSearchTypes: readonly ExaSearchType[]; export declare const DEFAULT_EXA_SEARCH_TYPE: ExaSearchType; export declare const exaSearchTypeDescriptions: Record; export declare function asExaSearchType(value: string): ExaSearchType | undefined; export interface WebSearchArgs { query: string; maxResults?: number; } export declare const DEFAULT_MAX_RESULTS = 5; export declare const MIN_MAX_RESULTS = 1; export declare const MAX_MAX_RESULTS = 20; export declare const MIN_QUERY_LENGTH = 1; export declare const MAX_QUERY_LENGTH = 400; export interface SearchResult { title: string; url: string; snippet: string; } export declare const MIN_TITLE_LENGTH = 1; export declare const MAX_TITLE_LENGTH = 512; export declare const MIN_SNIPPET_LENGTH = 0; export declare const MAX_SNIPPET_LENGTH = 2048; export type WebSearchErrorKind = "auth" | "rate-limit" | "network" | "parse" | "server" | "http" | "timeout" | "missing-key" | "validation"; export interface WebSearchError { kind: WebSearchErrorKind; provider: SearchProviderId; status?: number; message: string; } export interface WebSearchOutcome { ok: boolean; provider: SearchProviderId; results: SearchResult[]; error?: WebSearchError; } export type ResponseMode = "readable" | "raw"; export type ResponsePart = "full" | "headers" | "body"; export declare const RESPONSE_MODES: readonly ResponseMode[]; /** * Arguments accepted by the `web.fetch` tool. * * Defaults applied when an optional argument is omitted: * - `maxBytes` → {@link DEFAULT_MAX_BYTES} (Requirement 2.2) * - `includeHeaders` → `false` * - `includeTls` → `false` * - `includeTiming` → `false` * - `includeRedirectChain` → `false` * - `responseMode` → `"readable"` (Requirement 2.19) * - `redactSensitive` → `true` (Requirement 2.20) */ export interface WebFetchArgs { url: string; maxBytes?: number; timeoutMs?: number; includeHeaders?: boolean; includeTls?: boolean; includeTiming?: boolean; includeRedirectChain?: boolean; responseMode?: ResponseMode; responsePart?: ResponsePart; topLines?: number; bottomLines?: number; maxOutputBytes?: number; redactSensitive?: boolean; } export declare const DEFAULT_MAX_BYTES = 262144; export declare const MIN_MAX_BYTES = 1024; export declare const MAX_MAX_BYTES = 1048576; export declare const DEFAULT_INCLUDE_HEADERS = false; export declare const DEFAULT_INCLUDE_TIMING = false; export declare const DEFAULT_INCLUDE_REDIRECT_CHAIN = false; export declare const DEFAULT_RESPONSE_MODE: ResponseMode; /** Default value applied when `WebFetchArgs.redactSensitive` is omitted. */ export declare const DEFAULT_REDACT_SENSITIVE = true; export declare const MAX_REDIRECT_HOPS = 5; export declare const MAX_COOKIES_CAPTURED = 32; export declare const MAX_HEADER_VALUE_LENGTH = 4096; export declare const TRUNCATION_MARKER = "[...truncated]"; /** Literal placeholder used wherever sensitive values are redacted. */ export declare const REDACTED_PLACEHOLDER = "[REDACTED]"; export declare const METADATA_BUDGET_BYTES = 65536; export declare const HTTP_ERROR_BODY_PREVIEW_BYTES = 4096; export declare const FETCH_TIMEOUT_MS = 40000; export declare const MIN_FETCH_TIMEOUT_MS = 1000; export declare const MAX_FETCH_TIMEOUT_MS = 1800000; export declare const SEARCH_TIMEOUT_MS = 40000; export type HeaderMap = Record; export interface TlsInfo { protocol: string; cipher: string; subjectCN: string; issuerCN: string; subjectAltNames: string[]; notBefore: string; notAfter: string; fingerprintSha256: string; } export interface RedirectHop { url: string; status: number; location?: string; } export type RedirectChain = RedirectHop[]; export interface TimingInfo { dnsMs: number; tcpMs: number; tlsMs?: number; ttfbMs: number; totalMs: number; } export type CookieSameSite = "Strict" | "Lax" | "None"; /** * Public-attribute view of a cookie observed in a `Set-Cookie` header during * the fetch. Cookie values are replaced with {@link REDACTED_PLACEHOLDER} * when `redactSensitive=true` (Requirement 2.32). */ export interface CookieInfo { name: string; /** Raw cookie value; equals {@link REDACTED_PLACEHOLDER} when redacted. */ value: string; domain?: string; path?: string; expires?: string; maxAge?: number; httpOnly?: boolean; secure?: boolean; sameSite?: CookieSameSite; } export interface WebFetchMetadata { requestedUrl: string; finalUrl: string; status: number; contentType?: string; resolvedIp: string; finalHostname: string; mode: ResponseMode; bytesReceived: number; truncated: boolean; truncatedAt?: number; headers?: HeaderMap; tls?: TlsInfo; timing?: TimingInfo; redirectChain?: RedirectChain; cookies?: CookieInfo[]; budget: { metadataBytes: number; cap: typeof METADATA_BUDGET_BYTES; }; } export type WebFetchErrorKind = "validation" | "blocked-scheme" | "blocked-address" | "binary-content" | "redirect-limit" | "timeout" | "http-error" | "network" | "decode"; export interface WebFetchError { kind: WebFetchErrorKind; message: string; status?: number; url?: string; bodyPreview?: string; } export interface WebFetchOutcome { ok: boolean; metadata: WebFetchMetadata; body: string; error?: WebFetchError; }