import { type CredentialRef } from '@deepseek-ai/dsh-credentials'; import type { AuthInteraction, OAuthAuth, OAuthCredential } from '@earendil-works/pi-ai'; import type { OpenUrl } from './open-url.js'; export declare const DEFAULT_OAUTH_CREDENTIAL_REF = "OPENAI_CODEX_OAUTH_CREDENTIAL"; export declare const DEFAULT_ACCESS_TOKEN_REF = "OPENAI_CODEX_ACCESS_TOKEN"; export declare const DEFAULT_REFRESH_BEFORE_MS: number; export declare const CALLBACK_PORT = 1455; export declare const CALLBACK_HOST = "127.0.0.1"; export declare const LOGIN_IN_PROGRESS_MESSAGE = "\u53E6\u4E00\u4E2A OpenAI OAuth \u767B\u5F55\u6B63\u5728\u8FDB\u884C\u3002"; export declare const CALLBACK_PORT_BUSY_MESSAGE = "listen EADDRINUSE 127.0.0.1:1455"; export interface CredentialStore { resolve(ref: CredentialRef): Promise<{ value: string; source?: string; } | undefined>; describe(ref: CredentialRef): Promise<{ configured: boolean; writable: boolean; source?: string; }>; set(ref: CredentialRef, value: string): Promise; unset(ref: CredentialRef): Promise; } export interface CodexOAuthRuntimeOptions { readonly credentials: CredentialStore; readonly oauth: Pick; readonly openUrl: OpenUrl; readonly oauthCredentialRef?: CredentialRef; readonly accessTokenRef?: CredentialRef; readonly refreshBeforeMs?: number; readonly callbackHost?: string; readonly callbackPort?: number; readonly ensureCallbackPort?: () => Promise; } export interface CodexOAuthRuntime { loginBrowser(signal?: AbortSignal): Promise; loginWithInteraction(interaction: AuthInteraction): Promise; logout(): Promise; statusText(): Promise; ensureAccessToken(signal: AbortSignal): Promise; } export declare function parseOAuthCredential(raw: string): OAuthCredential; export declare function expiryDescription(credential: OAuthCredential): string; export declare function assertCallbackPortFree(port?: number, host?: string): Promise; export declare function createCodexOAuthRuntime(options: CodexOAuthRuntimeOptions): CodexOAuthRuntime; //# sourceMappingURL=runtime.d.ts.map