import type { WebSearchProvider, WebSearchRequest, WebSearchResult } from "@deepseek-ai/dsh-web"; import type { TinyFishOptions, TinyFishSearchResponse } from "./types.ts"; /** Check whether a hostname is localhost, loopback, private or reserved address. */ export declare function isPrivateOrLocalHost(rawHostname: string): boolean; /** * Map a TinyFish search response to a normalized search result, deduped by * URL and capped early to `maxResults`. */ export declare function mapTinyFishResponse(payload: TinyFishSearchResponse, maxResults: number | undefined): WebSearchResult; /** A programmatic snapshot that still needs its `apiKeyEnv` / `baseURL` defaults applied. */ export interface TinyFishProviderSnapshot { readonly apiKey?: string; readonly apiKeyEnv?: string; readonly baseURL?: string; readonly location?: string; readonly language?: string; readonly resolveApiKey?: undefined; } /** * Options accepted by programmatic construction: a finished * {@link TinyFishOptions}, a snapshot object that still needs its defaults, or * a thunk for the former. The plugin's own path always passes a thunk that * rebuilds a finished `TinyFishOptions` from the current config snapshot. */ export type TinyFishProviderInput = (() => TinyFishOptions) | TinyFishOptions | TinyFishProviderSnapshot; export declare class TinyFishSearchProvider implements WebSearchProvider { readonly id = "tinyfish"; private readonly resolve; constructor(resolve: TinyFishProviderInput); private opts; available(): boolean; /** * Whether a search made for a model request on `llmProvider` has a credential * to send. TinyFish uses one key for every model route, so the route id never * changes the answer. Configuration only — the credential planes are read * locally and no network request is made. A credential store that cannot be * read answers false, because the search would fail on that read instead of * finding a key. * @param _llmProvider - the provider route of the model request, unused here. * @returns false when the next search could not authenticate. */ ready(_llmProvider: string | undefined): Promise; search(request: WebSearchRequest, signal?: AbortSignal): Promise; }