import type { ServiceRegistry } from '../../config/service-registry.js'; import { type FetchOutput, type FetchUrlResult } from '../../tools/fetch/index.js'; import type { FetchAuthInput, FetchInput } from '../../tools/fetch/schema.js'; import type { WebSearchEvidence, WebSearchProviderDescriptor, WebSearchResult } from '../types.js'; type EnvMap = Record; type FetchExecutor = (input: FetchInput) => Promise; export interface SearchProviderContext { readonly fetcher?: FetchExecutor | undefined; readonly env: EnvMap; readonly serviceRegistry: Pick; } export interface SearchProviderConfig { readonly id: string; readonly label: string; readonly note: string; readonly envKeyCandidates?: readonly string[] | undefined; readonly serviceName?: string | undefined; readonly baseUrlEnvCandidates?: readonly string[] | undefined; readonly defaultBaseUrl?: string | undefined; readonly requiresAuth?: boolean | undefined; } export interface JsonRequestConfig { readonly url: string; readonly method?: 'GET' | 'POST' | undefined; readonly params?: Record | undefined; readonly body?: Record | undefined; readonly headers?: Record | undefined; readonly service?: string | undefined; readonly auth?: FetchAuthInput | undefined; readonly fetcher?: FetchExecutor | undefined; readonly maxContentLength?: number | undefined; } export interface JsonRequestResult { readonly payload: T; readonly response: FetchUrlResult; } export declare function resolveDomain(url: string): string | undefined; export declare function trimSnippet(value: unknown, limit?: number): string | undefined; export declare function makeEvidence(url: string, content: unknown, metadata?: Record, extract?: 'raw' | 'text' | 'json' | 'markdown' | 'readable' | 'code_blocks' | 'links' | 'metadata' | 'structured' | 'tables' | 'pdf' | 'summary'): WebSearchEvidence[] | undefined; export declare function withInlineApiKey(env: EnvMap, envKeys: readonly string[] | undefined, headerName: string): FetchAuthInput | undefined; export declare function withInlineBearer(env: EnvMap, envKeys: readonly string[] | undefined): FetchAuthInput | undefined; export declare function hasConfiguredCredential(serviceRegistry: Pick, env: EnvMap, envKeys: readonly string[] | undefined, serviceName?: string): boolean; export declare function resolveBaseUrl(serviceRegistry: Pick, env: EnvMap, envKeys: readonly string[] | undefined, serviceName: string | undefined, defaultBaseUrl?: string): string | null; export declare function buildDescriptor(config: SearchProviderConfig, context: SearchProviderContext): WebSearchProviderDescriptor; export declare function executeJsonRequest(config: JsonRequestConfig): Promise>; export declare function resultFromRecord(providerId: string, rank: number, record: Record, options?: { readonly urlKeys?: readonly string[] | undefined; readonly titleKeys?: readonly string[] | undefined; readonly snippetKeys?: readonly string[] | undefined; readonly displayUrlKeys?: readonly string[] | undefined; readonly evidenceKeys?: readonly string[] | undefined; readonly metadata?: Record | undefined; }): WebSearchResult | null; export declare function firstString(record: Record, keys: readonly string[]): string | undefined; export {}; //# sourceMappingURL=shared.d.ts.map