import { CancellationToken, PreferenceService } from '@theia/core'; import { WorkspaceService } from '@theia/workspace/lib/browser'; import type { ThreadEvent } from '@openai/codex-sdk'; import { CodexClient, CodexRequest, CodexService } from '../common'; export declare class CodexClientImpl implements CodexClient { protected tokenHandlers: Map void>; protected errorHandlers: Map void>; /** * `undefined` token signals end of stream per RPC protocol. */ sendToken(streamId: string, token?: ThreadEvent): void; sendError(streamId: string, error: Error): void; registerTokenHandler(streamId: string, handler: (token?: ThreadEvent) => void): void; registerErrorHandler(streamId: string, handler: (error: Error) => void): void; unregisterHandlers(streamId: string): void; } interface StreamState { id: string; tokens: (ThreadEvent | undefined)[]; isComplete: boolean; hasError: boolean; error?: Error; pendingResolve?: () => void; pendingReject?: (error: Error) => void; } export declare class CodexFrontendService { protected readonly backendService: CodexService; protected readonly client: CodexClientImpl; protected readonly preferenceService: PreferenceService; protected readonly workspaceService: WorkspaceService; protected streams: Map; send(request: CodexRequest, cancellationToken?: CancellationToken): Promise>; protected generateStreamId(): string; protected setupStreamHandlers(streamState: StreamState): void; protected createAsyncIterable(streamState: StreamState): AsyncIterable; protected cleanup(streamId: string): void; /** * Fallback hierarchy: * 1. Codex-specific API key (highest priority) * 2. Shared OpenAI API key * 3. undefined (backend will check OPENAI_API_KEY env var) */ protected getApiKey(): string | undefined; protected getWorkspaceRoot(): Promise; } export {}; //# sourceMappingURL=codex-frontend-service.d.ts.map