import { ToolResult } from '../types/index.js';
export type SearchProvider = 'brave' | 'perplexity' | 'serper' | 'duckduckgo' | 'brave-mcp';
export interface WebSearchOptions {
    maxResults?: number;
    safeSearch?: boolean;
    /** 2-letter country code for region-specific results (e.g., 'DE', 'US'). */
    country?: string;
    /** ISO language code for search results (e.g., 'de', 'en', 'fr'). */
    search_lang?: string;
    /** ISO language code for UI elements. */
    ui_lang?: string;
    /**
     * Filter results by discovery time (Brave only).
     * Values: 'pd' (past 24h), 'pw' (past week), 'pm' (past month),
     * 'py' (past year), or date range 'YYYY-MM-DDtoYYYY-MM-DD'.
     */
    freshness?: string;
    /** Force a specific provider instead of auto-fallback. */
    provider?: SearchProvider;
}
export interface SearchResult {
    title: string;
    url: string;
    snippet: string;
    /** Hostname extracted from URL */
    siteName?: string;
    /** Age/published info (Brave only) */
    published?: string;
}
export interface PerplexitySearchResult {
    content: string;
    citations: string[];
    model: string;
}
declare function normalizeFreshness(value: string | undefined): string | undefined;
declare function resolveSiteName(url: string | undefined): string | undefined;
declare function resolvePerplexityBaseUrl(apiKey?: string): string;
/**
 * Web Search Tool — OpenClaw-aligned provider chain
 *
 * Provider resolution (auto mode):
 *   Brave MCP → Brave API → Perplexity → Serper → DuckDuckGo
 *
 * Supports country, search_lang, ui_lang, freshness (Brave), Perplexity AI search.
 */
export declare class WebSearchTool {
    private cache;
    private perplexityCache;
    private cacheTTL;
    private serperApiKey;
    private braveApiKey;
    private perplexityApiKey;
    constructor();
    private failedQueries;
    private static readonly FAILED_QUERY_TTL;
    search(query: string, options?: WebSearchOptions): Promise<ToolResult>;
    /**
     * Perplexity AI search — returns synthesized answer with citations
     */
    searchPerplexity(query: string, options?: WebSearchOptions): Promise<ToolResult>;
    private buildProviderChain;
    private searchWithProvider;
    private buildCacheKey;
    private isBraveMCPAvailable;
    private searchViaBraveMCP;
    private searchBraveAPI;
    private runPerplexitySearch;
    private searchSerper;
    private searchDuckDuckGo;
    fetchPage(url: string, _prompt?: string): Promise<ToolResult>;
    private formatPerplexityResult;
    private isWeatherQuery;
    private getWeatherEmoji;
    private formatWeatherResults;
    private formatResults;
    private extractTextFromHtml;
    private stripHtml;
    private decodeHtmlEntities;
    clearCache(): void;
}
export declare const __testing: {
    readonly normalizeFreshness: typeof normalizeFreshness;
    readonly resolveSiteName: typeof resolveSiteName;
    readonly resolvePerplexityBaseUrl: typeof resolvePerplexityBaseUrl;
};
export {};
