export declare const CODEX_PLAN_ENTITLEMENT_MAX_MODELS = 64; /** How long one proven refusal keeps an account out of allocation for a model. */ export declare const CODEX_PLAN_ENTITLEMENT_EXCLUSION_TTL_MS: number; export type CodexPlanEntitlementExcludedModel = { /** Product model id (`codex/`). */ modelId: string; /** When the refusal for this model was last proven under `planType`. */ excludedAt: Date; }; export type CodexPlanEntitlementExclusion = { /** Normalized plan key the refusals were observed under. */ planType: string; models: CodexPlanEntitlementExcludedModel[]; }; type ExclusionAccount = { planType: string | null; planEntitlementExclusion?: CodexPlanEntitlementExclusion | null | undefined; }; /** Strict reader for the stored jsonb value; malformed state is ignored. */ export declare function readCodexPlanEntitlementExclusion(value: unknown): CodexPlanEntitlementExclusion | null; /** jsonb value for storage (ISO timestamps, stable model order). */ export declare function serializeCodexPlanEntitlementExclusion(exclusion: CodexPlanEntitlementExclusion): { planType: string; models: { modelId: string; excludedAt: string; }[]; }; /** When one excluded model becomes eligible again for a single probe request. */ export declare function codexPlanExclusionExpiresAt(entry: CodexPlanEntitlementExcludedModel): Date; /** * True when the credential's CURRENT plan is the plan a model refusal was * observed under, that refusal covered `modelId`, and it has not expired. */ export declare function codexPlanExcludesModel(account: ExclusionAccount, modelId: string | null | undefined, now: Date): boolean; /** * True when the current plan refused `modelId` before, expired or not. Used * only as evidence when the same plan answers the same model with an * ambiguous (empty) rejection again. */ export declare function codexPlanPreviouslyExcludedModel(account: ExclusionAccount, modelId: string | null | undefined): boolean; /** Models the current plan excludes right now, for account projections. */ export declare function activeCodexPlanExclusions(account: ExclusionAccount, now: Date): { modelId: string; excludedAt: Date; expiresAt: Date; }[]; /** * Record one proven refusal of `modelId` under `planType` at `now`, replacing * any exclusion for another plan. The oldest entries fall off past the bound. */ export declare function mergeCodexPlanEntitlementExclusion(existing: CodexPlanEntitlementExclusion | null, planType: string | null, modelId: string, now: Date): CodexPlanEntitlementExclusion; export {};