/** * Tavily Provider Adapter (DESIGN.md §5, §7, tech-plan §7). * * Implements the Tavily Provider Descriptor with Search, Reader, and * Crawl capabilities on top of the direct-HTTP transport (`./client.ts`). The * Adapter owns credentials, transport lifecycle, Provider field mapping, * and failure normalization; shared execution owns cache and retry * policy. * * 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. * * Field mapping (tech-plan §7 Tavily mapping): * Search results[].title -> title * Search results[].url -> url * Search results[].content -> summary * Search results[].score -> (dropped) * * Extract results[0].raw_content -> content * Extract results[0].url -> finalUrl * Extract results[0] -> title: null (Tavily doesn't return one) * * Control mapping (SearchControls → Tavily-native API params): * domain -> include_domains: [domain] * recency -> time_range (oneDay→"day", oneWeek→"week", * oneMonth→"month", oneYear→"year", noLimit→omit) * contentSize -> search_depth (medium→"basic", high→"advanced") * topic -> topic (native, pass as-is) * location -> REJECTED (UnsupportedOptionError) */ import type { ProviderDescriptor } from "../types.js"; import type { AsyncJobStateFile } from "../../lib/async-job-state.js"; import { type TavilyTransportDeps } from "./client.js"; /** * Dependencies the Tavily Adapter accepts. The unified `transport` * seam carries `fetch` and timer injection; `researchStateFile` is the * state-file port the Research Capability uses for resume-on-restart * (tech-plan §3). Production defaults to the on-disk implementation * under `~/.scoutline/research/`; tests inject in-memory doubles to * exercise the lifecycle deterministically. */ export interface TavilyAdapterDependencies { /** Optional transport injection (fetch, timers, env). */ readonly transport?: TavilyTransportDeps; /** Optional Research state-file port (tech-plan §3). */ readonly researchStateFile?: AsyncJobStateFile; /** Disk dir for the research create-lock; undefined in tests (no-op lock). */ readonly researchStateDir?: string; } /** * Build the Tavily Provider Descriptor. The descriptor advertises the * full Tavily capability set and constructs an Adapter whose `search` * and `reader` Capabilities 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 createTavilyDescriptor(dependencies?: TavilyAdapterDependencies): ProviderDescriptor; //# sourceMappingURL=adapter.d.ts.map