/** * OpenAI Codex (ChatGPT OAuth) flow — browser and device-code flows. */ import type { AfterExchangeHook } from "../hooks/types.js"; import type { OAuthController, OAuthCredentials } from "./types.js"; export declare function decodeJwt>(token: string): T | null; /** Enriches declaratively exchanged Codex credentials from access/id-token JWT claims. */ export declare const openAICodexProfileHook: AfterExchangeHook; /** * Formats OpenAI Codex OAuth token endpoint errors for login and refresh failures. */ export declare function formatOpenAICodexTokenEndpointError(status: number, bodyText: string): string; /** Builds the Codex browser OAuth URL used by browser login; exported for auth regression tests. */ export declare function createOpenAICodexAuthorizationUrl(args: { state: string; redirectUri: string; challenge: string; originator?: string; }): string; /** * Login with OpenAI Codex using the device-code (headless) flow. * * Avoids a local callback server entirely — useful when port 1455 is unavailable * or when the browser callback flow fails with 403 (e.g. network/proxy issues). */ export declare function loginOpenAICodexDevice(ctrl: OAuthController): Promise;