/** * You.com Provider Adapter (SPEC: dual-host — `ydc-index.io` for * Search/Contents, `api.you.com` for Research). * * Implements the You.com Provider Descriptor. The Adapter owns * credentials, transport lifecycle, Provider field mapping, and failure * normalization; shared execution owns cache and retry policy. This * module wires the Search, Reader, Research, and Diagnostics capabilities. * * Boundary rules (same as the Exa adapter): * - May import capability types, normalized errors, Provider identity * types, and the Adapter-local credential and client Modules. * - Must NOT import command presentation, output mode, or another * Provider's Adapter. * * Control mapping (SearchControls → You.com-native request fields): * domain -> include_domains: [domain] * recency -> freshness: day|week|month|year * (oneDay/oneWeek/oneMonth/oneYear); noLimit omits * freshness entirely * location -> country: "US"|"CN" (us|cn) * contentSize -> extraction.extraction_mode: "full_page" (high) | * "highlights" (medium) * topic -> query keyword appendage (shared `applySearchTopic`, * same approach as the Z.AI and MiniMax adapters) * type -> rejected (no You.com-native mapping; it is Brave-only * and routes to its video endpoint). Rejection happens * in `validate`, before credential resolution or any * transport call, so option-level provider fallback can * continue past You.com to the capable Provider. */ import type { ProviderAdapter, ProviderContext, ProviderDescriptor } from "../types.js"; import type { SearchCacheIdentity, SearchCapability, SearchRequest } from "../../capabilities/search.js"; import type { ReaderCacheIdentity, ReaderFetchRequest, ReaderFetchResult, ReaderOperation } from "../../capabilities/reader.js"; import type { ResearchOperation, ResearchRequest, ResearchResult } from "../../capabilities/research.js"; import type { DiagnosticsCapability } from "../../capabilities/diagnostics.js"; import type { CacheIdentity } from "../../lib/execution.js"; import type { YouTransportDeps } from "./client.js"; export type { YouTransportDeps } from "./client.js"; /** Dependencies the You.com Adapter accepts. */ export interface YouAdapterDependencies { /** Optional transport injection (fetch, timers). */ readonly transport?: YouTransportDeps; } /** * You.com capability and cache identity types implementing the shared * `ProviderDescriptor` and `ProviderAdapter` contracts. */ export type YouSearchCacheIdentity = Omit & { readonly provider: "you"; }; export type YouSearchCapability = Omit & { cacheIdentity(request: SearchRequest, compatibility?: { readonly legacyCount?: number; }): YouSearchCacheIdentity; }; export type YouReaderCacheIdentity = Omit, "provider"> & { readonly provider: "you"; }; export type YouReaderFetchOperation = Omit, "cacheIdentity"> & { cacheIdentity(request: ReaderFetchRequest): YouReaderCacheIdentity; }; export type YouReaderCapability = { readonly fetch: YouReaderFetchOperation; }; export type YouResearchCacheIdentity = Omit, "provider"> & { readonly provider: "you"; }; export type YouResearchOperation = Omit & { cacheIdentity(request: ResearchRequest): YouResearchCacheIdentity; }; export type YouResearchCapability = { readonly run: YouResearchOperation; }; export type YouAdapter = Omit & { readonly search: YouSearchCapability; readonly reader: YouReaderCapability; readonly research: YouResearchCapability; readonly diagnostics: DiagnosticsCapability; }; export type YouDescriptor = Omit & { create(context: ProviderContext): YouAdapter; }; /** * Build the You.com Provider Descriptor. Construction is * side-effect-free; `create()` captures the injected environment but * reads no credentials, constructs no transport, and performs no I/O — * credential resolution and transport calls happen only inside * Capability invocation after validation. */ export declare function createYouDescriptor(dependencies?: YouAdapterDependencies): YouDescriptor; //# sourceMappingURL=adapter.d.ts.map