import { type H3Event } from "h3"; import * as jose from "jose"; import { type OAuthCredential } from "../oauth-tokens/index.js"; export declare const CHATGPT_SUBSCRIPTION_OAUTH_PROVIDER = "openai-codex"; interface ChatGPTSubscriptionCredential extends OAuthCredential { clientId: string; subject: string; email?: string; displayName?: string; chatgptAccountId?: string; idToken: string; extAgentHostId: string; grantedScopes: string[]; } interface ChatGPTTokenResponse { access_token?: unknown; refresh_token?: unknown; id_token?: unknown; token_type?: unknown; expires_in?: unknown; scope?: unknown; } export interface ChatGPTSubscriptionAccountSummary { id: string; email: string | null; label: string; connected: boolean; reconnectRequired: boolean; planUsageEnabled: boolean; active: boolean; } export interface ChatGPTSubscriptionStatus { supported: boolean; localLoopback: boolean; supportReason: "requires_local_loopback" | "requires_personal_scope" | "scope_unresolved" | "requires_lab" | null; connected: boolean; reconnectRequired: boolean; /** Retained for callers that used the former ChatGPT account header value. */ accountId: string | null; activeAccountId: string | null; activeAccount: ChatGPTSubscriptionAccountSummary | null; accounts: ChatGPTSubscriptionAccountSummary[]; legacyRegistrationCleanupAvailable: boolean; } export declare function removeLegacyChatGPTSubscriptionCredential(email: string): Promise<{ removed: boolean; remoteRevocationConfirmed: false; }>; export declare function parseChatGPTSubscriptionScopes(value: unknown): string[]; export declare function isChatGPTSubscriptionLoopbackCallbackUri(value: unknown): value is string; export declare function verifyChatGPTSubscriptionIdToken(token: string, clientId: string, nonce: string, keySet?: { (protectedHeader?: jose.JWSHeaderParameters, token?: jose.FlattenedJWSInput): Promise; coolingDown: boolean; fresh: boolean; reloading: boolean; reload: () => Promise; jwks: () => jose.JSONWebKeySet | undefined; }): Promise<{ subject: string; email?: string; displayName?: string; chatgptAccountId?: string; }>; export declare function hasChatGPTSubscriptionCredential(email: string): Promise; export declare function getChatGPTSubscriptionStatus(email: string): Promise; export declare function listChatGPTSubscriptionAccounts(email: string): Promise<{ accounts: ChatGPTSubscriptionAccountSummary[]; activeAccountId: string | null; }>; export declare function selectChatGPTSubscriptionAccount(email: string, accountId: string): Promise<{ activeAccountId: string; connected: boolean; }>; export declare function getChatGPTSubscriptionAccess(email: string): Promise<{ accessToken: string; accountId?: string; }>; export declare function markChatGPTSubscriptionReconnectRequired(email: string): Promise; export declare function disconnectChatGPTSubscription(email: string, requestedAccountId?: string): Promise<{ disconnectedAccountId: string | null; activeAccountId: string | null; connected: boolean; remoteRevocationConfirmed: boolean; }>; export declare function requestTokens(body: Record): Promise; export declare function parseChatGPTSubscriptionRevocationEndpoint(configuration: unknown): string; export declare function tokenCredential(tokens: ChatGPTTokenResponse, identity: { clientId: string; hostId: string; subject: string; email?: string; displayName?: string; chatgptAccountId?: string; idToken: string; }, previous?: ChatGPTSubscriptionCredential): ChatGPTSubscriptionCredential; export declare function createChatGPTSubscriptionOAuthStartHandler(): (event: H3Event) => Promise; export declare function createChatGPTSubscriptionOAuthCallbackHandler(): (event: H3Event) => Promise; export {};