import type { OpenAiIdTokenClaims, OpenAiOAuthCredential, OpenAiOAuthLoginOptions, OpenAiOAuthRefreshOptions, OpenAiOAuthTokenResponse, PkceCodes } from './types.js';
export declare const OPENAI_CODEX_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
export declare const OPENAI_AUTH_ISSUER = "https://auth.openai.com";
export declare const OPENAI_CODEX_RESPONSES_ENDPOINT = "https://chatgpt.com/backend-api/codex/responses";
export declare const OPENAI_OAUTH_CALLBACK_PATH = "/auth/callback";
export declare const DEFAULT_OPENAI_OAUTH_PORT = 1455;
/**
 * OpenAI account sign-in service. It owns OAuth URL construction, callback
 * handling, token exchange/refresh, credential creation, and browser launch.
 */
export declare class OpenAiOAuthService {
    static generatePkceCodes(): PkceCodes;
    static generateState(): string;
    static buildAuthorizeUrl(args: {
        redirectUri: string;
        pkce: PkceCodes;
        state: string;
        originator?: string;
    }): string;
    static runBrowserLogin(options?: OpenAiOAuthLoginOptions): Promise<OpenAiOAuthCredential>;
    static refreshCredential(credential: OpenAiOAuthCredential, options?: {
        fetchImpl?: typeof fetch;
    }): Promise<OpenAiOAuthCredential>;
    static exchangeCode(args: {
        code: string;
        redirectUri: string;
        codeVerifier: string;
        fetchImpl?: typeof fetch;
    }): Promise<OpenAiOAuthTokenResponse>;
    static refreshToken(options: OpenAiOAuthRefreshOptions): Promise<OpenAiOAuthTokenResponse>;
    static createCredential(tokens: OpenAiOAuthTokenResponse, now?: number): OpenAiOAuthCredential;
    static parseJwtClaims(token: string): OpenAiIdTokenClaims | undefined;
    static extractAccountId(tokens: Pick<OpenAiOAuthTokenResponse, 'id_token' | 'access_token'>): string | undefined;
    static extractAccountIdFromClaims(claims: OpenAiIdTokenClaims): string | undefined;
    static buildOpenUrlCommand(url: string, platform?: NodeJS.Platform): {
        command: string;
        args: string[];
    };
    private static startCallbackServer;
    private static normalizeTokenResponse;
    private static base64UrlEncode;
    private static getServerPort;
    private static openUrlInBrowser;
    private static escapePowerShellSingleQuotedString;
    private static renderCallbackHtml;
    private static escapeHtml;
}
//# sourceMappingURL=openai-oauth.d.ts.map