import type { UsageReport, UsageResetCredit, UsageResetCredits } from "../usage.js"; import type { FetchImpl } from "../types.js"; /** Return the block scopes healed by a partial Claude reset, without mutating stored blocks. */ export declare function claudeResetClearedBlockScopes(cleared: readonly string[], report: UsageReport): (string | undefined)[]; /** OAuth credential and transport used for an account's Claude reset operations. */ export interface ClaudeResetAuth { accessToken: string; /** Observe a safe discovery read's throttle without retrying any mutation. */ onRateLimited?: (retryAfterMs: number | undefined) => void; accountId?: string; email?: string; orgId?: string; baseUrl?: string; fetch: FetchImpl; signal?: AbortSignal; } /** Live reset eligibility plus the exact organization and host used for redemption. */ export interface ClaudeResetCreditList extends UsageResetCredits { credits: UsageResetCredit[]; /** Quota evidence parsed from the same successful discovery response. */ report?: UsageReport; orgId?: string; /** OAuth API base that answered discovery; pass back as consume `baseUrl`. */ baseUrl?: string; } /** Confirmed reset outcome; transport uncertainty never reports a successful spend. */ export interface ClaudeResetConsumeResult { ok: boolean; code: string; status: number; cleared?: string[]; reason?: string; raw?: unknown; } /** * Reuse program blocks when a normal usage response actually evaluated them. * Anthropic lists every promo program as a key on the plain `/usage` body and * leaves the value `null` until the matching probe query (`?cedar_ember=1`, * `?at_wall=1`) asks for an evaluation, so a `null` block is "unknown", never * "no resets". Only an object block is an answer; anything else returns `null` * so the caller falls through to {@link listClaudeResetCredits}. A lone * non-redeemable Cedar block is likewise inconclusive because Juniper requires * the separate at-wall read. * * @internal */ export declare function parseClaudeResetCreditsFromUsagePayload(payload: unknown, orgId?: string, baseUrl?: string): ClaudeResetCreditList | null; /** * Discover Claude's saved Cedar grant first, then its Juniper session reset. * `null` means discovery failed; a zero-count object is an authoritative answer. */ export declare function listClaudeResetCredits(auth: ClaudeResetAuth): Promise; /** Spend exactly the server-selected Claude reset. Mutation requests are never retried. */ export declare function consumeClaudeResetCredit(auth: ClaudeResetAuth & { credit: UsageResetCredit; redeemRequestId?: string; }): Promise;