import type { PendingServerRequest, RuntimeOperation } from '../types/codex.js'; import { type BridgedOperationResult } from './app-server-client.js'; import { type ModelInfo } from './model-catalog.js'; import type { ReasoningEffortLevel } from './reasoning-options.js'; interface RuntimeRequestOptions { timeoutMs?: number | undefined; } interface RuntimeBridgeOptions extends RuntimeRequestOptions { threadId?: string | undefined; bridgeTimeoutMs?: number | undefined; } interface RuntimeCommandOptions { command?: string | undefined; args?: string[] | undefined; env?: NodeJS.ProcessEnv | undefined; } export interface ModelResolutionResult { resolvedModel: string; remappedFrom?: string | undefined; allowedModels: string[]; } export declare class CodexRuntime { private readonly profileManager; private readonly command; private readonly args; private readonly env; private readonly clients; private readonly clientStarting; private readonly effectiveCodexHomes; private modelCatalog?; private readonly knownThreadIds; private readonly loadedThreadIds; constructor(commandOptions?: RuntimeCommandOptions); shutdown(): Promise; getPendingServerRequests(includeResolved?: boolean): PendingServerRequest[]; getPendingServerRequest(id: string | number): PendingServerRequest | undefined; respondToServerRequest(id: string | number, payload: unknown): Promise; waitForOperation(operationId: string, timeoutMs: number, pollIntervalMs: number): Promise; getOperation(operationId: string): RuntimeOperation | undefined; request(method: string, params: unknown, options?: RuntimeRequestOptions): Promise; requestWithBridge(method: string, params: unknown, options?: RuntimeBridgeOptions): Promise; listModels(includeHidden?: boolean): Promise; /** * Resolve a model only when the caller explicitly provided one. * When `requestedModel` is undefined the app-server will use the * model from its own config.toml – we must NOT pick one for it. */ private resolveModelIfRequested; resolveRequestedModel(requestedModel?: string | undefined): Promise; listVisibleModelIds(): Promise; buildThreadStartParams(input: { model?: string | undefined; effort?: ReasoningEffortLevel | undefined; cwd?: string | undefined; developerInstructions?: string | undefined; }): Promise<{ params: Record; remappedFrom?: string | undefined; }>; buildThreadResumeParams(input: { threadId: string; model?: string | undefined; effort?: ReasoningEffortLevel | undefined; cwd?: string | undefined; developerInstructions?: string | undefined; }): Promise<{ params: Record; remappedFrom?: string | undefined; }>; buildTurnStartParams(input: { threadId: string; userInput: string; model?: string | undefined; effort?: ReasoningEffortLevel | undefined; }): Promise<{ params: Record; remappedFrom?: string | undefined; }>; buildTurnSteerParams(input: { threadId: string; expectedTurnId: string; userInput: string; }): Record; getOperationsForThread(threadId: string): RuntimeOperation[]; getAllOperations(): RuntimeOperation[]; getThreadEvents(threadId: string): Promise; rememberThreadId(threadId: string): void; listKnownThreadIds(): string[]; ensureThreadLoaded(threadId: string, model?: string | undefined, effort?: ReasoningEffortLevel | undefined): Promise; private withFailover; private getCurrentClient; private getClient; private activateCompatibilityClient; private createCompatibilityHome; private trackLoadedThread; } export {};