import type { CodexServiceClient } from "./client.js"; import type { CodexV6DeviceBinding } from "./protocol.js"; export type CodexV6OnlineCredentialStatus = "HEALTHY" | "TOKEN_REVOKED" | "AUTH_REJECTED" | "CONNECTOR_TOKEN_REVOKED" | "CONNECTOR_AUTH_REJECTED" | "SUBSCRIPTION_FREE" | "FORBIDDEN" | "UNREACHABLE" | "LOCAL_UNAVAILABLE"; export interface CodexV6OnlineCredentialHealth { status: CodexV6OnlineCredentialStatus; codexApi: "HEALTHY" | "REJECTED" | "UNKNOWN"; connectorOauth: "HEALTHY" | "TOKEN_REVOKED" | "REJECTED" | "UNKNOWN"; observedAt: string; codexApiHttpStatus?: number; connectorHttpStatus?: number; safeErrorCode?: string; planType?: string; allowed?: boolean; limitReached?: boolean; primary?: CodexV6UsageWindow; secondary?: CodexV6UsageWindow; credits?: CodexV6UsageCredits; } export interface CodexV6UsageWindow { usedPercent?: number; windowMinutes?: number; resetAt?: number; } export interface CodexV6UsageCredits { hasCredits?: boolean; unlimited?: boolean; balance?: string; } export interface CodexV6HealthReportResult { reported: boolean; replacementRequired?: boolean; replacementPending?: boolean; currentBinding?: CodexV6DeviceBinding; replacementBinding?: CodexV6DeviceBinding; warningCode?: string; warningStatus?: number; } /** * Probes the authenticated account usage endpoint. This gives us the * subscription and rate-limit state in one request and avoids the connector * endpoint, which is unrelated to whether a Codex Token Set can be used. No * refresh token, ID token, response body, token digest, prompt, or account * metadata is persisted or returned. */ export declare function probeCodexV6OnlineCredentialHealth(input?: { env?: NodeJS.ProcessEnv; now?: () => number; fetch?: typeof fetch; usageEndpoint?: string; /** @deprecated kept as a source-compatible alias for older integrations. */ codexEndpoint?: string; /** @deprecated connector probing is intentionally no longer performed. */ connectorEndpoint?: string; timeoutMs?: number; }): Promise; export declare function reportCodexV6OnlineCredentialHealth(input: { client: Pick; health: CodexV6OnlineCredentialHealth; env?: NodeJS.ProcessEnv; newId?: () => string; }): Promise; export declare function reportCodexV6LocalCredentialLoss(input: { client: Pick; env?: NodeJS.ProcessEnv; now?: () => number; newId?: () => string; }): Promise;