import { type ProviderAuthMaterial, type ResolvedAuthEnvelope } from "./authEnvelope.js";
import type { CredentialRef } from "./credentialRef.js";
export type ChatGPTCodexPlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_usage_based" | "business" | "enterprise_cbp_usage_based" | "enterprise" | "education" | "edu" | "unknown" | (string & {});
export type ChatGPTCodexJwtClaims = {
    email?: string;
    chatgptPlanType?: ChatGPTCodexPlanType;
    chatgptUserId?: string;
    chatgptAccountId?: string;
    chatgptAccountIsFedramp: boolean;
    expiresAt?: string;
};
export type ChatGPTCodexAuthSnapshot = {
    sourceShape: "codex-auth-json" | "chatgpt-auth-tokens";
    authMode?: "chatgpt" | "unknown";
    accessToken: string;
    refreshTokenPresent: boolean;
    idTokenPresent: boolean;
    accountId?: string;
    planType?: ChatGPTCodexPlanType;
    email?: string;
    chatgptUserId?: string;
    accountIsFedramp: boolean;
    lastRefresh?: string;
    expiresAt?: string;
    publicSafe: false;
};
export type ChatGPTCodexPublicSnapshot = Omit<ChatGPTCodexAuthSnapshot, "accessToken" | "publicSafe"> & {
    accessTokenPresent: boolean;
    publicSafe: true;
};
export type ParseChatGPTCodexAuthResult = {
    ok: true;
    snapshot: ChatGPTCodexAuthSnapshot;
    publicSnapshot: ChatGPTCodexPublicSnapshot;
    events: readonly string[];
} | {
    ok: false;
    error: {
        code: "INVALID_JSON" | "INVALID_AUTH_RECORD" | "NOT_CHATGPT_AUTH" | "MISSING_ACCESS_TOKEN";
        message: string;
        publicSafe: true;
    };
    events: readonly string[];
};
export declare function parseChatGPTCodexJwtClaims(jwt: string | undefined): ChatGPTCodexJwtClaims | undefined;
export declare function parseChatGPTCodexAuthJson(text: string): ParseChatGPTCodexAuthResult;
export declare function createChatGPTCodexRedactedIdentity(snapshot: Pick<ChatGPTCodexAuthSnapshot, "accountId" | "planType" | "email">): string;
export declare function createChatGPTCodexAuthMaterial(snapshot: ChatGPTCodexAuthSnapshot, extraHeaders?: Readonly<Record<string, string>>): ProviderAuthMaterial;
export declare function createChatGPTCodexAuthEnvelope(input: {
    credentialRef: CredentialRef;
    snapshot: ChatGPTCodexAuthSnapshot;
    extraHeaders?: Readonly<Record<string, string>>;
}): ResolvedAuthEnvelope;
export declare function toPublicChatGPTCodexAuthSnapshot(snapshot: ChatGPTCodexAuthSnapshot): ChatGPTCodexPublicSnapshot;
