/** * Spider.cloud Quota Capability. * * Maps the Spider.cloud GET /data/credits response into one normalized * `QuotaCategory` with `unit:"credits"` and `name:"credits"` for * dashboard display. The authority policy is always-unknown: the * balance is absolute with an unknown limit, not a percentage plan * signal, so the quota-mapping scorer treats Spider as * non-authoritative (no CAPABILITY_MAPPINGS row). The normalizer is pure; * the capability factory owns configuration resolution, the single * direct transport attempt, and failure normalization. Shared execution * owns retry policy. * * Credits shape: the endpoint surfaces a remaining credit count ONLY * (`{ "credits": 84520 }`). There is no plan limit and no billing * window on the wire, so the window is built via the unknown-limit * path — `remaining` alone; no fabricated `limit`, `used`, or * `remainingPercent`. * * Boundary rules (ARCHITECTURE.md §2): * - May import the quota contract, Adapter-local config, Adapter-local * quota client, and normalized errors. * - Must NOT import command presentation or another Provider's Adapter. */ import type { QuotaCategory } from "../../capabilities/quota.js"; import { type SpiderTransportDeps } from "./client.js"; /** * Local success type: identical to the shared `ProviderQuotaSuccess` * except `provider` is the `"spider"` literal. Assignable to the shared * contract once `"spider"` joins `PROVIDER_IDS` during registry wiring. */ export interface SpiderQuotaSuccess { readonly provider: "spider"; readonly status: "ok"; readonly categories: QuotaCategory[]; } /** * Normalize a raw /data/credits payload into the shared Interface. * Builds one "credits" category (`unit:"credits"`) on the unknown-limit * window: `remaining` only, omitting fabricated percent/limit values. * Throws `ApiError` 500 when the payload is not a plain object carrying * a finite numeric `credits` field. */ export declare function normalizeSpiderQuota(raw: unknown): SpiderQuotaSuccess; export interface SpiderQuotaCapabilityOptions { readonly env: NodeJS.ProcessEnv; readonly transport?: SpiderTransportDeps; } /** Local Quota contract — see the module header. */ export interface SpiderQuotaCapability { invoke(): Promise; } /** * Build the Spider.cloud QuotaCapability. `invoke` resolves the API key, * performs one direct /data/credits attempt, and normalizes the response * into a single "credits" category on the unknown-limit window. Shared * execution wraps this in the retry policy; quota never uses the * response cache. */ export declare function createSpiderQuotaCapability(options: SpiderQuotaCapabilityOptions): SpiderQuotaCapability; //# sourceMappingURL=quota.d.ts.map