import { CodexResponsesState } from "./state.js"; export declare const DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api/codex"; export declare const DEFAULT_OPENAI_COMPATIBLE_BASE_URL = "https://openai-oauth.local/v1"; export declare const DEFAULT_OPENAI_OAUTH_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann"; export declare const DEFAULT_OPENAI_OAUTH_ISSUER = "https://auth.openai.com"; export declare const DEFAULT_OPENAI_OAUTH_SCOPE = "openid profile email offline_access"; export type FetchFunction = typeof fetch; export type OpenAIOAuthSession = { accessToken: string; accountId: string; isFedRamp?: boolean; idToken?: string; refreshToken?: string; expiresAt?: string; lastRefresh?: string; }; export type OpenAIOAuthSessionInput = OpenAIOAuthSession | (() => Promise); export type OpenAIOAuth = { kind: "openai-oauth"; getSession(): Promise; baseURL?: string; fetch?: FetchFunction; headers?: Record; instructions?: string; openAIBaseURL?: string; }; export type SessionStore = { get(): Promise; set(session: OpenAIOAuthSession): Promise; clear(): Promise; }; export type OpenAIOAuthRequestOptions = { clientId?: string; issuer?: string; redirectUri: string; scope?: string; state?: string; codeVerifier?: string; simplifiedFlow?: boolean; idTokenAddOrganizations?: boolean; extraParams?: Record; }; export type OpenAIOAuthRequest = { authorizationUrl: string; state: string; codeVerifier: string; codeChallenge: string; redirectUri: string; }; export type OpenAIOAuthTokenResponse = { accessToken: string; refreshToken?: string; idToken?: string; expiresIn?: number; accountId?: string; isFedRamp?: boolean; raw: unknown; }; export type ExchangeOpenAIOAuthCodeOptions = { code: string; codeVerifier: string; redirectUri: string; clientId?: string; issuer?: string; tokenUrl?: string; fetch?: FetchFunction; signal?: AbortSignal; }; export type RefreshOpenAIOAuthTokensOptions = { refreshToken: string; clientId?: string; issuer?: string; tokenUrl?: string; fetch?: FetchFunction; signal?: AbortSignal; }; type CodexOAuthRuntimeSettings = { auth: OpenAIOAuthSessionInput; baseURL?: string; codexVersion?: string; fetch?: FetchFunction; headers?: Record; instructions?: string; responsesState?: CodexResponsesState | false; }; export type OpenAIOAuthTransportOptions = Omit & { openAIBaseURL?: string; responsesState?: false; }; export type OpenAIOAuthTransport = { kind: "openai-compatible"; baseURL: string; fetch: FetchFunction; request: (path: string, init?: RequestInit) => Promise; }; export type NormalizeCodexResponsesBodyOptions = { instructions?: string; forceStream?: boolean; }; export declare const usesServerReplayState: (value: Record) => boolean; export declare const parseJwtClaims: (token: string | undefined) => Record | undefined; export declare const deriveAccountId: (idToken: string | undefined) => string | undefined; export declare const deriveChatGptAccountIsFedRamp: (token: string | undefined) => boolean; export declare const createOpenAIOAuthRequest: (options: OpenAIOAuthRequestOptions) => Promise; export declare const exchangeOpenAIOAuthCode: (options: ExchangeOpenAIOAuthCodeOptions) => Promise; export declare const refreshOpenAIOAuthTokens: (options: RefreshOpenAIOAuthTokensOptions) => Promise; export declare const getDefaultCodexInstructions: () => string; export declare const normalizeCodexResponsesBody: (body: Record, options?: NormalizeCodexResponsesBodyOptions) => Record; export declare const createOpenAIOAuthTransport: (settings: OpenAIOAuthTransportOptions) => OpenAIOAuthTransport; export {}; //# sourceMappingURL=runtime.d.ts.map