/** * Linkup Quota Capability. * * Maps the Linkup `GET /v1/credits/balance` response into the * normalized Provider-quota interface. Linkup is metered USD billing * (per-call costs of $0.005–$2.50 against a prepaid dollar balance): * the endpoint reports ONLY a remaining `balance`, never a limit, so * the single "credits" category publishes the exact `remaining` with * `unit: "USD"` — the number is dollars, "credits" is Linkup's * branding — and omits `used`, `limit`, and `remainingPercent` * (GitHub #49 unknown-limit window); nothing is fabricated against an * invented ceiling or percentage. * * Structurally cloned from the Jina quota pattern (non-destructive * GET, IMPLEMENTATION-CONTRACT analog-adapter table): one direct GET * per invoke, shared execution owns retry policy, quota never uses * the response cache. * * Boundary rules (ARCHITECTURE.md §2): * - May import the quota capability contract, Adapter-local * credentials, Adapter-local quota transport, and normalized * errors. * - Must NOT import command presentation or another Provider's * Adapter. */ import type { ProviderQuotaSuccess, QuotaCapability } from "../../capabilities/quota.js"; import { type LinkupTransportDeps } from "./client.js"; /** * Normalize a raw Linkup credit-balance payload * (`{ balance: }`) into the shared quota interface. The * balance is USD-denominated (Linkup bills per-call dollar amounts * against a prepaid dollar balance), hence `unit: "USD"`. * * A missing or non-finite `balance` is a malformed response and throws * `ApiError` 500. A valid balance flows through * `buildQuotaWindow({ remaining: balance })`, which publishes the * exact remaining count and omits `used`, `limit`, and * `remainingPercent` — the limit is unknown and no percentage is * invented. */ export declare function normalizeLinkupQuota(raw: unknown): ProviderQuotaSuccess; /** * Options for the Linkup QuotaCapability. The API key is resolved * from `env`; transport dependencies (`fetch`, timers) are injectable * for deterministic tests through the unified `transport` seam. */ export interface LinkupQuotaCapabilityOptions { readonly env: NodeJS.ProcessEnv; readonly transport?: LinkupTransportDeps; } /** * Build the Linkup QuotaCapability. `invoke` resolves the API key * (required — the credit-balance endpoint authenticates the Bearer * header), performs one non-destructive GET, and normalizes the * balance into the shared interface. Shared execution wraps this in * the retry policy; quota never uses the response cache. */ export declare function createLinkupQuotaCapability(options: LinkupQuotaCapabilityOptions): QuotaCapability; //# sourceMappingURL=quota.d.ts.map