/** * Storage migration utilities for account data format upgrades. * Extracted from storage.ts to reduce module size. */ import { type ModelFamily } from "../prompts/codex.js"; import type { AccountIdSource } from "../types.js"; export type CooldownReason = "auth-failure" | "network-error"; export interface RateLimitStateV3 { [key: string]: number | undefined; } export interface AccountMetadataV1 { accountId?: string; organizationId?: string; accountIdSource?: AccountIdSource; accountLabel?: string; accountTags?: string[]; accountNote?: string; email?: string; refreshToken: string; /** Optional cached access token (Codex CLI parity). */ accessToken?: string; /** Optional access token expiry timestamp (ms since epoch). */ expiresAt?: number; enabled?: boolean; addedAt: number; lastUsed: number; lastSwitchReason?: "rate-limit" | "initial" | "rotation"; rateLimitResetTime?: number; coolingDownUntil?: number; cooldownReason?: CooldownReason; } export interface AccountStorageV1 { version: 1; accounts: AccountMetadataV1[]; activeIndex: number; } export interface AccountMetadataV3 { accountId?: string; organizationId?: string; accountIdSource?: AccountIdSource; accountLabel?: string; accountTags?: string[]; accountNote?: string; email?: string; refreshToken: string; /** Optional cached access token (Codex CLI parity). */ accessToken?: string; /** Optional access token expiry timestamp (ms since epoch). */ expiresAt?: number; enabled?: boolean; addedAt: number; lastUsed: number; lastSwitchReason?: "rate-limit" | "initial" | "rotation"; rateLimitResetTimes?: RateLimitStateV3; coolingDownUntil?: number; cooldownReason?: CooldownReason; } export interface AccountStorageV3 { version: 3; accounts: AccountMetadataV3[]; activeIndex: number; activeIndexByFamily?: Partial>; } export declare function migrateV1ToV3(v1: AccountStorageV1): AccountStorageV3; //# sourceMappingURL=migrations.d.ts.map