/** * Firecrawl Quota Capability (firecrawl tech-plan D8, critique C4). * * Maps the Firecrawl /v2/team/credit-usage response into one normalized * `QuotaCategory` with `unit:"credits"` and `name:"Credits"`. The * normalizer is pure; the capability factory owns configuration * resolution, the single direct transport attempt, and failure * normalization. Shared execution owns retry policy. * * Credit-usage shape: the live endpoint surfaces "remaining credits" * (investigation §1.2). The exact field names are a non-gating verify * item (tech-plan §7 #4), so the normalizer extracts `remaining` + `used` * defensively across common variants and derives `limit = used + * remaining`. Field names are tuned during live verification (FC-06). * * 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 { ProviderQuotaSuccess, QuotaCapability } from "../../capabilities/quota.js"; import { type FirecrawlTransportDeps } from "./client.js"; /** * Normalize a raw credit-usage payload into the shared Interface. Builds * one "Credits" category (`unit:"credits"`). * * Live-confirmed shape (FC-06): `data.{ remainingCredits, planCredits, * billingPeriodStart, billingPeriodEnd }`. Firecrawl reports a remaining * balance against a per-period plan allotment — `remainingCredits` may * exceed `planCredits` (banked credits), so the window is built against * the plan allotment and `used` is clamped ≥ 0. Throws `ApiError` 500 when * `remainingCredits`/`planCredits` are absent or invalid. */ export declare function normalizeFirecrawlQuota(raw: unknown): ProviderQuotaSuccess; export interface FirecrawlQuotaCapabilityOptions { readonly env: NodeJS.ProcessEnv; readonly transport?: FirecrawlTransportDeps; } /** * Build the Firecrawl QuotaCapability. `invoke` resolves the API key, * performs one direct /team/credit-usage attempt, and normalizes the * response into a single "Credits" category. Shared execution wraps this * in the retry policy; quota never uses the response cache. */ export declare function createFirecrawlQuotaCapability(options: FirecrawlQuotaCapabilityOptions): QuotaCapability; //# sourceMappingURL=quota.d.ts.map