import type { ProviderQuotaFetch } from "../types.js"; /** Injectable transport dependencies (fetch, timers, env). */ export interface SpiderTransportDeps { readonly fetch?: ProviderQuotaFetch; readonly setTimeout?: typeof setTimeout; readonly clearTimeout?: typeof clearTimeout; readonly env?: NodeJS.ProcessEnv; } /** * Provider-native search request body fields (Spider.cloud API field * names). The Adapter maps the Provider-neutral `SearchControls` into * these before calling {@link fetchSpiderSearch}; the transport never * imports a capability contract. * * The search term itself rides the `search` field — NOT `query`. */ export interface SpiderSearchParams { /** Search term (Provider-neutral `query` maps here). */ readonly search: string; /** `markdown` (SCHEMA §1 canonical default), `raw`, or `text`. */ readonly return_format?: "markdown" | "raw" | "text"; /** Ask the API to attach `metadata` (title/description) to each page. */ readonly metadata?: boolean; /** Country code mapped from `controls.location`. */ readonly country_code?: string; /** Google-style recency filter mapped from `controls.recency`. */ readonly tbs?: string; /** Domain allowlist mapped from `controls.domain`. */ readonly whitelist?: readonly string[]; } /** `SPIDER_TIMEOUT` override, clamped through the shared seam (#234). */ export declare function resolveTimeoutMs(env: NodeJS.ProcessEnv): number; /** * Perform ONE POST against the Spider.cloud /search endpoint. No retry; * no response body in public errors. Returns the parsed JSON value (raw; * the Adapter post-processes into normalized search sources). * * `params` carries Spider-native API fields already mapped from * `SearchControls` by the Adapter. */ export declare function fetchSpiderSearch(apiKey: string, params: SpiderSearchParams, deps?: SpiderTransportDeps): Promise; /** * Provider-native scrape request body fields (Spider.cloud API field * names). The Adapter maps the Provider-neutral `ReaderFetchRequest` * into these before calling {@link fetchSpiderScrape}; the transport * never imports a capability contract. The locked canonical body is * exactly `url` + `return_format` + `filter_output_main_only` + * `stealth` (SPEC §Reader) — no undocumented field is ever sent. */ export interface SpiderScrapeParams { /** Page URL to scrape. */ readonly url: string; /** `markdown` (canonical default) or `text`, mapped from `format`. */ readonly return_format: "markdown" | "text"; /** Spider's main-content filter (locked body field). */ readonly filter_output_main_only: true; /** Spider's stealth proxy flag (locked body field). */ readonly stealth: true; } /** * Perform ONE POST against the Spider.cloud /scrape endpoint. No retry; * no response body in public errors. Returns the parsed JSON value (raw; * the Adapter post-processes into a normalized `ReaderFetchResult`). * * `params` carries Spider-native API fields already mapped from the * Provider-neutral `ReaderFetchRequest` by the Adapter. */ export declare function fetchSpiderScrape(apiKey: string, params: SpiderScrapeParams, deps?: SpiderTransportDeps, signal?: AbortSignal): Promise; /** * Provider-native crawl request body fields (Spider.cloud API field * names). The Adapter maps the Provider-neutral `CrawlRequest` into * these before calling {@link fetchSpiderCrawl}; the transport never * imports a capability contract. * * The crawl endpoint is SYNCHRONOUS (locked contract): the response is * the final JSON array of crawled pages — there is no job id to poll * and no async-job state file. */ export interface SpiderCrawlParams { /** Root URL to crawl. */ readonly url: string; /** Total pages to process, mapped from `limit`. */ readonly limit?: number; /** Crawl depth, mapped from `depth`. */ readonly depth?: number; /** `markdown` (canonical default) or `text`, mapped from `format`. */ readonly return_format: "markdown" | "text"; } /** * Perform ONE POST against the Spider.cloud /crawl endpoint. No retry, * no poll loop; no response body in public errors. Returns the parsed * JSON value (raw; the Adapter post-processes into a normalized * `CrawlResult`). */ export declare function fetchSpiderCrawl(apiKey: string, params: SpiderCrawlParams, deps?: SpiderTransportDeps): Promise; /** * Provider-native links (map) request body fields (Spider.cloud API * field names). The Adapter maps the Provider-neutral `MapRequest` into * these before calling {@link fetchSpiderLinks}; the transport never * imports a capability contract. The documented /links wire body is * exactly `url` + `limit`. */ export interface SpiderLinksParams { /** Root URL to map. */ readonly url: string; /** Total URLs to discover, mapped from `limit`. */ readonly limit?: number; } /** * Perform ONE POST against the Spider.cloud /links endpoint. No retry; * no response body in public errors. Returns the parsed JSON value * (raw; the Adapter post-processes into a normalized `MapResult`). */ export declare function fetchSpiderLinks(apiKey: string, params: SpiderLinksParams, deps?: SpiderTransportDeps): Promise; /** * Perform ONE GET against the Spider.cloud /data/credits endpoint. No * retry; no response body in public errors. Returns the parsed JSON * value (raw; the quota Adapter post-processes into a normalized * `ProviderQuotaSuccess`). This is the cheapest credible probe — it * costs no credit — so both the Quota capability and the Diagnostics * probe ride this same transport. */ export declare function fetchSpiderCredits(apiKey: string, deps?: SpiderTransportDeps): Promise; //# sourceMappingURL=client.d.ts.map