/** * SearchApi Provider Adapter. * * T2 wires the Search Capability; T3 adds the Quota and Diagnostics * Capabilities (both backed by the non-destructive `GET /api/v1/me` * probe). The descriptor advertises `"search"`, `"diagnostics"`, and * `"quota"`, and `create()` returns an Adapter whose slots own * credentials, transport, Provider field mapping, and failure * normalization. * * Engine routing (SPEC, locked): `topic:"news"` โ†’ `engine=google_news`; * every other topic (and no topic) โ†’ `engine=google`. Unlike the Z.AI/ * MiniMax/Parallel/Jina adapters there is NO topic keyword appendage โ€” * SearchApi routing is engine-only. * * Boundary rules (ARCHITECTURE.md ยง2): * - May import capability types, normalized errors, Provider identity * types, and the Adapter-local credential and transport Modules. * - Must NOT import command presentation, output mode, or another * Provider's Adapter. */ import type { ProviderDescriptor } from "../types.js"; import type { SearchSource } from "../../capabilities/search.js"; import { type SearchApiTransportDeps } from "./client.js"; /** Dependencies the SearchApi Adapter accepts. */ export interface SearchApiAdapterDependencies { /** Optional transport injection (fetch, timers, env). */ readonly transport?: SearchApiTransportDeps; } /** * Normalize a raw SearchApi.io search response into `SearchSource[]`. * Reads `raw.organic_results[]`: * * title -> title * link -> url * snippet -> summary ("" when absent) * date -> date (only when present and string) * * A malformed shape (non-object root, `organic_results` not an array, * non-string title/link) is a retryable `ApiError` 500. */ export declare function normalizeSearchApiResults(raw: unknown): readonly SearchSource[]; /** * Build the SearchApi Provider Descriptor. The descriptor advertises * Search, Diagnostics, and Quota; `create()` returns an Adapter whose * slots own credentials, transport, Provider field mapping, and failure * normalization. Construction is side-effect-free; the transport is * invoked per Capability call. Tests pass `transport` (typically a * fake-fetch wrapper); production uses the no-argument factory which * resolves to the global `fetch` and timers inside the transport * Module. */ export declare function createSearchApiDescriptor(dependencies?: SearchApiAdapterDependencies): ProviderDescriptor; //# sourceMappingURL=adapter.d.ts.map