/** * Search engine clients + tenant-aware config plumbing. * * Two classes of code live here: * 1. Config resolution — env-var + tenant config loaders, with a SSRF guard * on SEARXNG_URL so arbitrary user-supplied URLs can't be coerced into * probing internal services. * 2. Provider clients — thin wrappers over SearXNG and Brave Search JSON * endpoints (web, news, images). Each returns the shared result shapes * so orchestrators.ts can compose them without knowing the provider. */ export interface SearchResult { title: string; url: string; snippet: string; source?: string; } export interface ImageResult { title: string; url: string; thumbnailUrl?: string; source?: string; width?: number; height?: number; } export interface SearchResponse { results: SearchResult[]; query: string; engine: string; totalResults?: number; } export interface ImageSearchResponse { results: ImageResult[]; query: string; engine: string; } export type WebEngine = 'auto' | 'searxng' | 'brave' | 'exa' | 'tavily'; export type NewsEngine = 'auto' | 'searxng' | 'brave' | 'tavily'; /** * SSRF guard: validate that a SearXNG URL points at a public host, not * internal network resources (localhost, 127.0.0.0/8, 10.0.0.0/8, * 172.16.0.0/12, 192.168.0.0/16, link-local). In SaaS mode, tenants * supply arbitrary URLs via suite_setup — an attacker could otherwise * coerce the server to probe internal services. * * Allows common dev/self-host cases (localhost) ONLY when SEARXNG_ALLOW_LOCAL=1 * (admin opt-in for dev environments). */ export declare function validateSearxngUrl(rawUrl: string | undefined): string | undefined; export declare function getConfig(): { searxngUrl: string | undefined; braveApiKey: string | undefined; }; /** * Tenant-aware config loader for new providers (Exa, Tavily). * In SaaS mode reads ps_tenant_config; in stdio mode reads ~/.personal-suite/config.json. * Falls back to env vars if tenant hasn't configured. */ export declare function getProviderConfig(): Promise<{ exaApiKey?: string; tavilyApiKey?: string; }>; export declare function hasAnyEngine(): boolean; /** Async check: true if ANY provider (including Exa/Tavily tenant keys) is usable. */ export declare function hasAnyProvider(): Promise; export declare function searchSearXNG(query: string, categories: string, maxResults: number): Promise; export declare function searchSearXNGImages(query: string, maxResults: number): Promise; export declare function searchBrave(query: string, endpoint: string, maxResults: number): Promise; export declare function searchBraveImages(query: string, maxResults: number): Promise; //# sourceMappingURL=engines.d.ts.map