export declare const CODEX_RESPONSES_URL = "https://chatgpt.com/backend-api/codex/responses"; export declare const OPENAI_TOKEN_URL = "https://auth.openai.com/oauth/token"; export declare const OPENAI_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann"; export type ReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh"; export type AgentModelTool = { type: "function"; function: { name: string; description: string; parameters: Record; }; }; export type AgentModelToolCall = { id: string; type: "function"; function: { name: string; arguments: string; }; }; export type AgentModelMessage = { role: "system" | "user" | "assistant" | "tool"; content: string | null; tool_calls?: AgentModelToolCall[]; tool_call_id?: string; }; export type AccumulatedToolCall = { id: string; name: string; arguments: string; }; export type AgentModelUsage = { promptTokens: number; completionTokens: number; totalTokens: number; cachedTokens: number; reasoningTokens: number; }; export type AgentStreamChunk = { type: "text_delta"; content: string; } | { type: "tool_call_start"; index: number; id: string; name: string; } | { type: "tool_call_delta"; index: number; arguments: string; } | { type: "done"; content: string; toolCalls: AccumulatedToolCall[]; usage?: AgentModelUsage; }; export type CodexAuthStatus = { loggedIn: boolean; provider: "chatgpt" | "none"; accountId?: string; expiresAt?: number; raw: string; }; export type CodexResponsesClientOptions = { model?: string; homeDir?: string; authFilePath?: string; timeoutMs?: number; fetchImpl?: typeof fetch; originator?: string; userAgent?: string; }; export type CodexResponsesCallOptions = { messages: AgentModelMessage[]; tools?: AgentModelTool[]; model?: string; reasoningEffort?: ReasoningEffort; signal?: AbortSignal; }; type ResponsesInputItem = Record; export declare class CodexResponsesClient { readonly model: string; readonly timeoutMs: number; readonly authFilePath: string; private readonly fetchImpl; private readonly originator; private readonly userAgent; private credentials?; private readonly sessionId; constructor(options?: CodexResponsesClientOptions); getAuthStatus(): Promise; assertChatGptOAuth(): Promise; call(options: CodexResponsesCallOptions): Promise<{ content: string; toolCalls: AccumulatedToolCall[]; usage?: AgentModelUsage; }>; callStreaming(options: CodexResponsesCallOptions): AsyncGenerator; private performRequest; private buildHeaders; private ensureValidToken; private loadCredentials; } export declare function extractInstructionsAndInput(messages: AgentModelMessage[]): { instructions: string; input: ResponsesInputItem[]; }; export declare function convertToolsForResponsesAPI(tools?: AgentModelTool[]): Array> | undefined; export declare function parseResponsesSSE(body: ReadableStream): AsyncGenerator<{ type: string; data: Record; }>; export declare function decodeJwtPayload(token: string): Record; export declare function getTokenExpiryMs(token: string): number; export {};