/** * Brave Search adapter for `web.search`. * * Implements the {@link SearchProvider} contract from `./provider.ts` and * registers itself in the {@link searchProviders} registry on import. The * adapter performs exactly one outbound HTTPS request per invocation * (Requirement 6.7), forwards the caller-provided {@link AbortSignal} to * the underlying transport so the 15-second `web.search` timeout is * honored (Requirement 1.8), and returns a {@link RawProviderResponse} * describing the HTTP outcome plus the raw hit list. * * Status-to-error-kind classification (`401/403 → auth`, `429 → rate-limit`, * `5xx → server`, non-JSON → `parse`, other non-2xx → `http`) is the * responsibility of the `web.search` handler; this adapter only exposes * the raw HTTP `status` and the parsed (or `parseError`-flagged) hit list * so that mapping can be applied uniformly across providers (Requirements * 6.1, 6.2, 6.5, 6.6). * * Endpoint and request shape match the design's "Per-provider notes → * Brave Search" section (`.kiro/specs/web-search-and-fetch/design.md`). */ import https from "node:https"; import { type SearchProvider } from "./provider.js"; /** * Inject point for the underlying HTTPS transport so unit/property tests * in epic 7.x can drive the adapter without touching the network. The * default mirrors the standard `node:https.request` signature. * * Kept module-private (not exported) because the public adapter contract * intentionally takes no transport argument — `web.search` always uses * the default transport in production. */ type HttpsRequestFn = typeof https.request; /** * Test-only seam: swap the HTTPS transport used by the adapter. * Production callers never invoke this; tests in 7.x use it to inject a * stubbed `request` implementation that emits scripted responses. */ export declare function __setBraveHttpsRequestForTesting(fn: HttpsRequestFn | undefined): void; /** * Brave Search adapter. Registered in {@link searchProviders} as a * side-effect of importing this module — `web.search` resolves the active * provider via the registry. */ export declare const braveProvider: SearchProvider; export {};