/** * OpenAI Codex (ChatGPT) OAuth. * * Mirrors the parameters stock senpi uses for its `openai-codex` provider, so * the tokens minted here are the same ones stock would mint. senpi does not * export its Codex OAuth flow to extensions (only the Anthropic one), hence * this local implementation. */ export declare const CODEX_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann"; export interface CodexTokens { access: string; refresh: string; /** Epoch millis. */ expires: number; /** ChatGPT account id embedded in the access token. */ accountId?: string; email?: string; } export interface CodexLoginCallbacks { onAuth(info: { url: string; instructions?: string; }): void; onProgress?(message: string): void; onPrompt(prompt: { message: string; placeholder?: string; }): Promise; signal?: AbortSignal; } export declare class CodexAuthError extends Error { readonly permanent: boolean; readonly status?: number; constructor(message: string, options?: { permanent?: boolean; status?: number; }); } export declare function accountIdFromToken(access: string): string | undefined; export declare function emailFromToken(access: string): string | undefined; export declare function loginCodex(callbacks: CodexLoginCallbacks): Promise; export declare function refreshCodex(tokens: CodexTokens): Promise;