import { type ChatGPTCodexTokenSet, type CodexAuthJsonWriter } from "./codexAuthPersistence.js";
import { type CredentialRef } from "./credentialRef.js";
import type { CredentialStore } from "./credentialStore.js";
import { type ProviderProfile } from "./providerProfile.js";
import { type ProviderCarrier } from "../providerAccessLayer/providerCarrier.js";
export declare const CHATGPT_CODEX_LOGIN_DEFAULT_ISSUER: "https://auth.openai.com";
export declare const CHATGPT_CODEX_LOGIN_CLIENT_ID: "app_EMoamEEZ73f0CkXaXp7hrann";
export declare const CHATGPT_CODEX_LOGIN_DEFAULT_ORIGINATOR: "codex_cli_rs";
export declare const CHATGPT_CODEX_LOGIN_SCOPE: "openid profile email offline_access api.connectors.read api.connectors.invoke";
export type ChatGPTCodexLoginSession = {
    issuer: string;
    clientId: string;
    redirectUri: string;
    codeVerifier: string;
    codeChallenge: string;
    state: string;
    forcedWorkspaceId?: string;
    createdAt: string;
    publicSafe: false;
};
export type ChatGPTCodexLoginStartResult = {
    ok: true;
    login: {
        authUrl: string;
        issuer: string;
        redirectUri: string;
        state: string;
        publicSafe: true;
    };
    session: ChatGPTCodexLoginSession;
    events: readonly string[];
} | {
    ok: false;
    error: {
        code: "MISSING_REDIRECT_URI" | "INVALID_LOGIN_INPUT";
        message: string;
        publicSafe: true;
    };
    events: readonly string[];
};
export type ChatGPTCodexTokenExchange = (request: {
    issuer: string;
    clientId: string;
    redirectUri: string;
    codeVerifier: string;
    code: string;
}) => Promise<ChatGPTCodexTokenSet>;
export type ChatGPTCodexLoginCompleteResult = {
    ok: true;
    credentialRef: CredentialRef;
    profile: ProviderProfile;
    carrier: ProviderCarrier;
    authFilePath?: string;
    publicSnapshot: unknown;
    publicSafe: true;
    events: readonly string[];
} | {
    ok: false;
    error: {
        code: "MISSING_LOGIN_SESSION" | "MISSING_CALLBACK_CODE" | "STATE_MISMATCH" | "PERSISTENCE_REQUIRED" | "TOKEN_EXCHANGE_FAILED" | "PROFILE_BUILD_FAILED";
        message: string;
        boundary: "input" | "oauth" | "persistence" | "profile";
        publicSafe: true;
    };
    events: readonly string[];
};
export declare function startChatGPTCodexLogin(input?: {
    redirectUri?: string;
    issuer?: string;
    clientId?: string;
    originator?: string;
    forcedWorkspaceId?: string;
    forceState?: string;
    now?: Date | (() => Date);
}): ChatGPTCodexLoginStartResult;
export declare const exchangeChatGPTCodexOAuthCode: ChatGPTCodexTokenExchange;
export declare function completeChatGPTCodexLogin(input: {
    session?: ChatGPTCodexLoginSession;
    callbackUrl?: string;
    code?: string;
    state?: string;
    exchange?: ChatGPTCodexTokenExchange;
    credentialId?: string;
    profileId?: string;
    carrierId?: string;
    authFilePath?: string;
    store?: CredentialStore;
    writeAuthJson?: CodexAuthJsonWriter;
    now?: Date | (() => Date);
}): Promise<ChatGPTCodexLoginCompleteResult>;
