import { type Dispatcher } from 'undici'; /** Default deadline kept below the Harness web-search tool deadline. */ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 25000; /** Maximum bytes accepted from any external JSON response. */ export declare const MAX_RESPONSE_BYTES: number; /** Per-request transport controls shared by every backend. */ export interface FetchJsonOptions { readonly signal?: AbortSignal; readonly timeoutMs?: number; } /** Fetch and parse an untrusted JSON response with shared web error codes. */ export declare function fetchJson(provider: string, url: string | URL, init: RequestInit, options?: FetchJsonOptions): Promise; /** * Resolve the plugin-only outbound proxy. This deliberately does not install a * global dispatcher, so model providers and other DSH plugins keep their own * network policy. Private and explicitly excluded hosts stay direct for local * SearXNG deployments. */ export declare function dispatcherFor(input: string | URL): Dispatcher | undefined; /** Resolve a non-empty credential for one API request without caching it. */ export declare function resolveCredential(provider: string, reference: string, resolve: () => Promise, signal?: AbortSignal): Promise; /** True when a parsed JSON value is a plain record. */ export declare function isRecord(value: unknown): value is Record; /** Validate one absolute HTTP(S) URL returned by an external provider. */ export declare function requiredHttpUrl(value: unknown, path: string): string; /** Return a trimmed optional string or omit blank values. */ export declare function optionalString(value: unknown, path: string): string | undefined; /** Cap a provider request to its supported result-count range. */ export declare function resultLimit(value: number | undefined, maximum: number, fallback: number): number; /** Convert a validated provider response and normalize all field errors. */ export declare function decodeResponse(provider: string, value: unknown, decode: (input: unknown) => T): T; /** Remove MediaWiki result markup and decode its common entities. */ export declare function plainText(value: string): string;