import type { WebSearchProvider, WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web'; import type { SearxngResponse } from './types.js'; /** Stable id this provider registers under, and the value `web.searchProvider` selects. */ export declare const SEARXNG_PROVIDER_ID = "searxng"; /** * Resource backstop for one search. This is NOT the model-facing tool-call * budget — `@deepseek-ai/dsh-tool-call-timeout-policy` owns that via * `searchTimeoutMs` and arms the caller's signal. A deployment should leave * this below the tool budget so a slow instance surfaces as a provider * timeout rather than a tool timeout. */ export declare const SEARXNG_DEFAULT_TIMEOUT_MS = 10000; /** * Cap on one source's snippet. SearXNG snippets are engine-supplied and * occasionally carry a whole lead paragraph; the seam has no snippet bound of * its own, so an uncapped provider would let one verbose engine dominate the * result budget. */ export declare const SEARXNG_DEFAULT_MAX_SNIPPET_CHARS = 500; /** Time filter values SearXNG accepts on `time_range`. */ export type SearxngTimeRange = 'day' | 'week' | 'month' | 'year'; /** Resolved provider options; the plugin's `apply` fills every default. */ export interface SearxngSearchProviderOptions { /** * Instance base URL (`/search` is appended). `undefined` or unparseable * makes the provider report unavailable instead of failing every search. */ readonly baseURL?: string; /** `categories=` filter, e.g. `['news']`. Omitted leaves the instance default. */ readonly categories?: readonly string[]; /** `engines=` filter, e.g. `['duckduckgo', 'brave']`. */ readonly engines?: readonly string[]; /** `language=` filter, e.g. `ja`, `en-US`. */ readonly language?: string; /** `time_range=` filter. */ readonly timeRange?: SearxngTimeRange; /** `safesearch=` level: 0 off, 1 moderate, 2 strict. */ readonly safesearch?: 0 | 1 | 2; /** Resource backstop in milliseconds. */ readonly timeoutMs: number; /** Per-source snippet cap in characters. */ readonly maxSnippetChars: number; /** Extra headers, e.g. an auth header for an instance behind a proxy. */ readonly headers?: Readonly>; } /** * Map one instance response to the seam's normalized result. * * Sources are deduplicated by URL because a metasearch merges engines that * routinely return the same page. `truncated` is always `false`: the seam owns * `maxResults` enforcement, and reporting our own truncation here would make it * lie about whose bound cut the list. * * @param body - the parsed `format=json` response. * @param maxSnippetChars - per-source snippet cap. * @returns the normalized search outcome. */ export declare function mapSearxngResponse(body: SearxngResponse, maxSnippetChars: number): WebSearchResult; /** * The SearXNG-backed search provider. Redirects are refused as `WEB_PROVIDER_ERROR`. * * Options arrive as a THUNK, not a captured object: the settings section is * projected per operation so a user-layer edit reaches the NEXT search without * a restart, and the seam's provider selection never flickers on a config * change (the registration itself is stable — only the values it reads move). */ export declare class SearxngSearchProvider implements WebSearchProvider { private readonly options; readonly id = "searxng"; constructor(options: () => SearxngSearchProviderOptions); /** Cheap local check: a parseable http(s) base URL. Never touches the network. */ available(): boolean; search(request: WebSearchRequest, signal?: AbortSignal): Promise; }