import type { ProviderQuotaResult, QuotaWindow } from "@penclipai/adapter-utils"; import { type CodexAuthRefreshFailureClass } from "./parse.js"; export declare function codexHomeDir(): string; export interface CodexAuthInfo { accessToken: string; accountId: string | null; refreshToken: string | null; idToken: string | null; email: string | null; planType: string | null; lastRefresh: string | null; } export declare function readCodexAuthInfo(codexHome?: string): Promise; export declare function readCodexToken(): Promise<{ token: string; accountId: string | null; } | null>; /** * Map a window duration in seconds to a human-readable label. * Falls back to the provided fallback string when seconds is null/undefined. */ export declare function secondsToWindowLabel(seconds: number | null | undefined, fallback: string): string; /** fetch with an abort-based timeout so a hanging provider api doesn't block the response indefinitely */ export declare function fetchWithTimeout(url: string, init: RequestInit, ms?: number): Promise; export declare function fetchCodexQuota(token: string, accountId: string | null): Promise; interface CodexRpcWindow { usedPercent?: number | null; windowDurationMins?: number | null; resetsAt?: number | null; } interface CodexRpcCredits { hasCredits?: boolean | null; unlimited?: boolean | null; balance?: string | number | null; } interface CodexRpcLimit { limitId?: string | null; limitName?: string | null; primary?: CodexRpcWindow | null; secondary?: CodexRpcWindow | null; credits?: CodexRpcCredits | null; planType?: string | null; } interface CodexRpcRateLimitsResult { rateLimits?: CodexRpcLimit | null; rateLimitsByLimitId?: Record | null; } interface CodexRpcAccountResult { account?: { type?: string | null; email?: string | null; planType?: string | null; } | null; requiresOpenaiAuth?: boolean | null; } export interface CodexRpcQuotaSnapshot { windows: QuotaWindow[]; email: string | null; planType: string | null; } export declare function mapCodexRpcQuota(result: CodexRpcRateLimitsResult, account?: CodexRpcAccountResult | null): CodexRpcQuotaSnapshot; export declare function fetchCodexRpcQuota(): Promise; export declare function readCodexQuotaErrorFamily(error: unknown): CodexAuthRefreshFailureClass | null; export declare function getQuotaWindows(): Promise; export {}; //# sourceMappingURL=quota.d.ts.map