import { refreshCodexToken } from "@opengeni/codex"; import type { SubscriptionCoreAdapter } from "@opengeni/subscriptions"; import type { SubscriptionCoreProvider } from "./subscription-core/provider.js"; /** The decoded Codex credential. */ export type SubscriptionCoreCodexTokens = { accessToken: string; refreshToken: string; idToken: string; }; /** How long a connection Codex refused (forbidden) stays quarantined. */ export declare const SUBSCRIPTION_CORE_CODEX_FORBIDDEN_QUARANTINE_MS: number; /** How long a model the Codex plan is not entitled to stays cooled down. */ export declare const SUBSCRIPTION_CORE_CODEX_ENTITLEMENT_COOLDOWN_MS: number; /** The `credential_format` of a Codex connection: OAuth tokens, which renew. */ export declare const SUBSCRIPTION_CORE_CODEX_CREDENTIAL_FORMAT = "v1"; /** * Rest of a rate-limited or exhausted Codex connection without a provider * time: the worker's legacy backpressure delay and allowance fallback. */ export declare const SUBSCRIPTION_CORE_CODEX_RATE_LIMIT_FALLBACK_MS: number; export declare const SUBSCRIPTION_CORE_CODEX_EXHAUSTED_FALLBACK_MS: number; /** * How long a Codex session keeps its account after its last request * (SUB-STICK-04). OpenAI documents in-memory prompt-cache entries as active * for about 5 to 10 minutes of inactivity and at most one hour, and newer * models as reusable for at least 30 minutes after the last write or reuse * (https://developers.openai.com/api/docs/guides/prompt-caching). The Codex * backend publishes no retention of its own, so the documented one-hour * maximum is the conservative cut-off until measured cut-offs exist. */ export declare const SUBSCRIPTION_CORE_CODEX_CACHE_IDLE_CUTOFF_MS: number; export type SubscriptionCoreCodexAdapterDeps = { /** The OAuth token refresh call (tests inject a scripted upstream). */ refresh?: typeof refreshCodexToken; }; export declare function subscriptionCoreCodexAdapter(deps?: SubscriptionCoreCodexAdapterDeps): SubscriptionCoreAdapter; /** Codex's database binding on the shared core. */ export declare function subscriptionCoreCodexProvider(deps?: SubscriptionCoreCodexAdapterDeps): SubscriptionCoreProvider; /** The registered Codex binding (the production refresh call). */ export declare const SUBSCRIPTION_CORE_CODEX: SubscriptionCoreProvider;