/** * Zod schemas for runtime validation. * These are the single source of truth for data structures. * Types are inferred from schemas using z.infer. */ import { z } from "zod"; export declare const PluginConfigSchema: z.ZodObject<{ codexMode: z.ZodOptional; requestTransformMode: z.ZodOptional>; codexTuiV2: z.ZodOptional; codexTuiColorProfile: z.ZodOptional>; codexTuiGlyphMode: z.ZodOptional>; beginnerSafeMode: z.ZodOptional; fastSession: z.ZodOptional; fastSessionStrategy: z.ZodOptional>; fastSessionMaxInputItems: z.ZodOptional; retryProfile: z.ZodOptional>; retryBudgetOverrides: z.ZodOptional; network: z.ZodOptional; server: z.ZodOptional; rateLimitShort: z.ZodOptional; rateLimitGlobal: z.ZodOptional; emptyResponse: z.ZodOptional; }, z.core.$strip>>; retryAllAccountsRateLimited: z.ZodOptional; retryAllAccountsMaxWaitMs: z.ZodOptional; retryAllAccountsMaxRetries: z.ZodOptional; unsupportedCodexPolicy: z.ZodOptional>; fallbackOnUnsupportedCodexModel: z.ZodOptional; fallbackToGpt52OnUnsupportedGpt53: z.ZodOptional; unsupportedCodexFallbackChain: z.ZodOptional>>; tokenRefreshSkewMs: z.ZodOptional; rateLimitToastDebounceMs: z.ZodOptional; toastDurationMs: z.ZodOptional; perProjectAccounts: z.ZodOptional; sessionRecovery: z.ZodOptional; autoResume: z.ZodOptional; parallelProbing: z.ZodOptional; parallelProbingMaxConcurrency: z.ZodOptional; emptyResponseMaxRetries: z.ZodOptional; emptyResponseRetryDelayMs: z.ZodOptional; pidOffsetEnabled: z.ZodOptional; fetchTimeoutMs: z.ZodOptional; streamStallTimeoutMs: z.ZodOptional; }, z.core.$strip>; export type PluginConfigFromSchema = z.infer; /** * Source of the accountId used for ChatGPT requests. */ export declare const AccountIdSourceSchema: z.ZodEnum<{ token: "token"; id_token: "id_token"; org: "org"; manual: "manual"; }>; export type AccountIdSourceFromSchema = z.infer; /** * Cooldown reason for temporary account suspension. */ export declare const CooldownReasonSchema: z.ZodEnum<{ "auth-failure": "auth-failure"; "network-error": "network-error"; }>; export type CooldownReasonFromSchema = z.infer; /** * Last switch reason for account rotation tracking. */ export declare const SwitchReasonSchema: z.ZodEnum<{ "rate-limit": "rate-limit"; initial: "initial"; rotation: "rotation"; }>; export type SwitchReasonFromSchema = z.infer; /** * Rate limit state - maps model family to reset timestamp. */ export declare const RateLimitStateV3Schema: z.ZodRecord>; export type RateLimitStateV3FromSchema = z.infer; /** * Account metadata V3 - current storage format. */ export declare const AccountMetadataV3Schema: z.ZodObject<{ accountId: z.ZodOptional; organizationId: z.ZodOptional; accountIdSource: z.ZodOptional>; accountLabel: z.ZodOptional; accountTags: z.ZodPipe>, z.ZodTransform>; accountNote: z.ZodPipe, z.ZodTransform>; email: z.ZodOptional; refreshToken: z.ZodString; accessToken: z.ZodOptional; expiresAt: z.ZodOptional; enabled: z.ZodOptional; addedAt: z.ZodNumber; lastUsed: z.ZodNumber; lastSwitchReason: z.ZodOptional>; rateLimitResetTimes: z.ZodOptional>>; coolingDownUntil: z.ZodOptional; cooldownReason: z.ZodOptional>; }, z.core.$strip>; export type AccountMetadataV3FromSchema = z.infer; export declare const ActiveIndexByFamilySchema: z.ZodObject<{ "gpt-5-codex": z.ZodOptional>; "codex-max": z.ZodOptional>; codex: z.ZodOptional>; "gpt-5.4": z.ZodOptional>; "gpt-5.4-mini": z.ZodOptional>; "gpt-5.4-pro": z.ZodOptional>; "gpt-5.2": z.ZodOptional>; "gpt-5.1": z.ZodOptional>; }, z.core.$strip>; export type ActiveIndexByFamilyFromSchema = z.infer; /** * Account storage V3 - current storage format with per-family active indices. */ export declare const AccountStorageV3Schema: z.ZodObject<{ version: z.ZodLiteral<3>; accounts: z.ZodArray; organizationId: z.ZodOptional; accountIdSource: z.ZodOptional>; accountLabel: z.ZodOptional; accountTags: z.ZodPipe>, z.ZodTransform>; accountNote: z.ZodPipe, z.ZodTransform>; email: z.ZodOptional; refreshToken: z.ZodString; accessToken: z.ZodOptional; expiresAt: z.ZodOptional; enabled: z.ZodOptional; addedAt: z.ZodNumber; lastUsed: z.ZodNumber; lastSwitchReason: z.ZodOptional>; rateLimitResetTimes: z.ZodOptional>>; coolingDownUntil: z.ZodOptional; cooldownReason: z.ZodOptional>; }, z.core.$strip>>; activeIndex: z.ZodNumber; activeIndexByFamily: z.ZodOptional>; "codex-max": z.ZodOptional>; codex: z.ZodOptional>; "gpt-5.4": z.ZodOptional>; "gpt-5.4-mini": z.ZodOptional>; "gpt-5.4-pro": z.ZodOptional>; "gpt-5.2": z.ZodOptional>; "gpt-5.1": z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; export type AccountStorageV3FromSchema = z.infer; /** * Legacy V1 account metadata for migration support. */ export declare const AccountMetadataV1Schema: z.ZodObject<{ accountId: z.ZodOptional; organizationId: z.ZodOptional; accountIdSource: z.ZodOptional>; accountLabel: z.ZodOptional; accountTags: z.ZodPipe>, z.ZodTransform>; accountNote: z.ZodPipe, z.ZodTransform>; email: z.ZodOptional; refreshToken: z.ZodString; accessToken: z.ZodOptional; expiresAt: z.ZodOptional; enabled: z.ZodOptional; addedAt: z.ZodNumber; lastUsed: z.ZodNumber; lastSwitchReason: z.ZodOptional>; rateLimitResetTime: z.ZodOptional; coolingDownUntil: z.ZodOptional; cooldownReason: z.ZodOptional>; }, z.core.$strip>; export type AccountMetadataV1FromSchema = z.infer; /** * Legacy V1 storage format for migration support. */ export declare const AccountStorageV1Schema: z.ZodObject<{ version: z.ZodLiteral<1>; accounts: z.ZodArray; organizationId: z.ZodOptional; accountIdSource: z.ZodOptional>; accountLabel: z.ZodOptional; accountTags: z.ZodPipe>, z.ZodTransform>; accountNote: z.ZodPipe, z.ZodTransform>; email: z.ZodOptional; refreshToken: z.ZodString; accessToken: z.ZodOptional; expiresAt: z.ZodOptional; enabled: z.ZodOptional; addedAt: z.ZodNumber; lastUsed: z.ZodNumber; lastSwitchReason: z.ZodOptional>; rateLimitResetTime: z.ZodOptional; coolingDownUntil: z.ZodOptional; cooldownReason: z.ZodOptional>; }, z.core.$strip>>; activeIndex: z.ZodNumber; }, z.core.$strip>; export type AccountStorageV1FromSchema = z.infer; /** * Union of V1 and V3 storage formats for migration detection. */ export declare const AnyAccountStorageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ version: z.ZodLiteral<1>; accounts: z.ZodArray; organizationId: z.ZodOptional; accountIdSource: z.ZodOptional>; accountLabel: z.ZodOptional; accountTags: z.ZodPipe>, z.ZodTransform>; accountNote: z.ZodPipe, z.ZodTransform>; email: z.ZodOptional; refreshToken: z.ZodString; accessToken: z.ZodOptional; expiresAt: z.ZodOptional; enabled: z.ZodOptional; addedAt: z.ZodNumber; lastUsed: z.ZodNumber; lastSwitchReason: z.ZodOptional>; rateLimitResetTime: z.ZodOptional; coolingDownUntil: z.ZodOptional; cooldownReason: z.ZodOptional>; }, z.core.$strip>>; activeIndex: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ version: z.ZodLiteral<3>; accounts: z.ZodArray; organizationId: z.ZodOptional; accountIdSource: z.ZodOptional>; accountLabel: z.ZodOptional; accountTags: z.ZodPipe>, z.ZodTransform>; accountNote: z.ZodPipe, z.ZodTransform>; email: z.ZodOptional; refreshToken: z.ZodString; accessToken: z.ZodOptional; expiresAt: z.ZodOptional; enabled: z.ZodOptional; addedAt: z.ZodNumber; lastUsed: z.ZodNumber; lastSwitchReason: z.ZodOptional>; rateLimitResetTimes: z.ZodOptional>>; coolingDownUntil: z.ZodOptional; cooldownReason: z.ZodOptional>; }, z.core.$strip>>; activeIndex: z.ZodNumber; activeIndexByFamily: z.ZodOptional>; "codex-max": z.ZodOptional>; codex: z.ZodOptional>; "gpt-5.4": z.ZodOptional>; "gpt-5.4-mini": z.ZodOptional>; "gpt-5.4-pro": z.ZodOptional>; "gpt-5.2": z.ZodOptional>; "gpt-5.1": z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>], "version">; export type AnyAccountStorageFromSchema = z.infer; /** * Token failure reason codes. */ export declare const TokenFailureReasonSchema: z.ZodEnum<{ unknown: "unknown"; http_error: "http_error"; invalid_response: "invalid_response"; network_error: "network_error"; missing_refresh: "missing_refresh"; }>; export type TokenFailureReasonFromSchema = z.infer; /** * Successful token exchange result. */ export declare const TokenSuccessSchema: z.ZodObject<{ type: z.ZodLiteral<"success">; access: z.ZodString; refresh: z.ZodString; expires: z.ZodNumber; idToken: z.ZodOptional; multiAccount: z.ZodOptional; }, z.core.$strip>; export type TokenSuccessFromSchema = z.infer; /** * Failed token exchange result. */ export declare const TokenFailureSchema: z.ZodObject<{ type: z.ZodLiteral<"failed">; reason: z.ZodOptional>; statusCode: z.ZodOptional; message: z.ZodOptional; }, z.core.$strip>; export type TokenFailureFromSchema = z.infer; /** * Token result - discriminated union of success/failure. */ export declare const TokenResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"success">; access: z.ZodString; refresh: z.ZodString; expires: z.ZodNumber; idToken: z.ZodOptional; multiAccount: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"failed">; reason: z.ZodOptional>; statusCode: z.ZodOptional; message: z.ZodOptional; }, z.core.$strip>], "type">; export type TokenResultFromSchema = z.infer; /** * OAuth token response from OpenAI. */ export declare const OAuthTokenResponseSchema: z.ZodObject<{ access_token: z.ZodString; refresh_token: z.ZodOptional; expires_in: z.ZodNumber; id_token: z.ZodOptional; token_type: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>; export type OAuthTokenResponseFromSchema = z.infer; /** * Safely parse plugin configuration with detailed error logging. * Returns null on failure, allowing graceful degradation. */ export declare function safeParsePluginConfig(data: unknown): PluginConfigFromSchema | null; /** * Safely parse account storage (any version). * Returns null on failure, allowing graceful degradation. */ export declare function safeParseAccountStorage(data: unknown): AnyAccountStorageFromSchema | null; /** * Safely parse V3 account storage specifically. * Returns null on failure. */ export declare function safeParseAccountStorageV3(data: unknown): AccountStorageV3FromSchema | null; /** * Safely parse token result. * Returns null on failure. */ export declare function safeParseTokenResult(data: unknown): TokenResultFromSchema | null; /** * Safely parse OAuth token response from API. * Returns null on failure. */ export declare function safeParseOAuthTokenResponse(data: unknown): OAuthTokenResponseFromSchema | null; /** * Get validation errors as a flat array of strings. * Useful for logging and error messages. */ export declare function getValidationErrors(schema: z.ZodType, data: unknown): string[]; //# sourceMappingURL=schemas.d.ts.map