/** * Kagi direct HTTP transport. * * GET https://kagi.com/api/v1/search (q, limit) for general search; * GET https://kagi.com/api/v0/enrich/news for topic:"news". Auth is * `Authorization: Bot ` (Kagi wire truth — not Bearer). The * envelope is `{ meta, data: [...] }`; adapter.ts owns result * filtering (t === 0). This module owns the HTTP status mapping. */ import { type ProviderQuotaFetchResponse } from "../types.js"; /** Shared default result count for search + news requests (#239). */ export declare const DEFAULT_SEARCH_LIMIT = 10; export interface KagiTransportDeps { readonly fetch?: (input: string, init: Record) => Promise; readonly setTimeout?: typeof setTimeout; readonly clearTimeout?: typeof clearTimeout; readonly env?: NodeJS.ProcessEnv; } /** One row inside `data[]`. `t: 1` rows are related-query suggestions. */ export interface KagiResultItem { readonly t?: number; readonly rank?: number; readonly title?: string; readonly url?: string; readonly snippet?: string; readonly published?: string; } /** Kagi search envelope. Results live at `data[]`. */ export interface KagiSearchResponse { readonly meta?: unknown; readonly data?: readonly KagiResultItem[]; } export interface KagiSearchParams { readonly query: string; readonly limit?: number; } export declare function resolveTimeoutMs(env: NodeJS.ProcessEnv): number; export declare function fetchKagiSearch(apiKey: string, params: KagiSearchParams, deps?: KagiTransportDeps): Promise; /** Topic:"news" GET — same q/limit params, v0 enrich/news endpoint. */ export declare function fetchKagiNews(apiKey: string, params: KagiSearchParams, deps?: KagiTransportDeps): Promise; //# sourceMappingURL=client.d.ts.map