import { type HostToolBridge, type PromptResult, type SessionPolicyStatus } from './model-runner.js'; import type { PromptCallbacks } from './types.js'; export interface CodexAppServerProcessOptions { sessionKey: string; model: string; systemPrompt: string; cwd: string; sandbox: 'read-only' | 'workspace-write' | 'danger-full-access'; command?: string; requestTimeout?: number; codexHome?: string; isolatedHome?: string; registryRoot?: string; mcpConfigPath?: string; /** Stable identity/rules fingerprint; dynamic conversation context must be excluded. */ policyFingerprint?: string; } export interface CodexAppServerPromptOptions { sessionKey?: string; model?: string; systemPrompt?: string; cwd?: string; sandbox?: 'read-only' | 'workspace-write' | 'danger-full-access'; requestTimeout?: number; policyFingerprint?: string; resumeSession?: boolean; hostToolBridge?: HostToolBridge; /** * Full instructions to re-supply when this call has to resume a durable thread. * `thread/resume` accepts `baseInstructions` (ThreadResumeParams), so a rehydrated * thread can be re-anchored through the protocol instead of the turn-text * `` workaround. Lazy on purpose: rebuilding the composed prompt * costs an embedding search, and a live thread never resumes - the callback runs * only inside the resume branch. Omit it to keep the legacy bootstrap behaviour. */ resumeInstructions?: () => Promise; } export declare class CodexAppServerProcess { private readonly options; private readonly registry; private child; private stdout; private stderr; private nextId; private pending; private lateTurnStarts; private turnStartReconciliations; private turns; private sessions; private sessionQueues; private connectionQueue; private startPromise; private shutdownPromise; private stopped; private stderrTail; private secrets; private authFingerprint; private authFingerprintInitialized; private authSourceSignature; private managedConfigFingerprint; private managedConfigSignature; private secretLaunchFingerprint; private secretLaunchFingerprintInitialized; private killTimer; private finalKillTimer; constructor(options: CodexAppServerProcessOptions); prompt(text: string, callbacks?: PromptCallbacks, overrides?: CodexAppServerPromptOptions): Promise; reset(sessionKey?: string): Promise; getSessionPolicyStatus(overrides?: CodexAppServerPromptOptions): SessionPolicyStatus; stop(): Promise; executeSandboxedCommand(command: string, cwd: string, roots: readonly string[], signal?: AbortSignal): Promise<{ exitCode: number; stdout: string; stderr: string; }>; getThreadId(sessionKey?: string): string | undefined; getStatus(): { running: boolean; childPid?: number; pendingRequestCount: number; hasActiveTurn: boolean; stdoutListenerCount: number; stderrListenerCount: number; shutdownTimerActive: boolean; }; private resolveSessionPolicy; private enqueueSession; private prepareConnection; private assertRegistryPolicy; private registryPolicyMatches; private prepareManagedFiles; private ensureStarted; private start; private openThread; private policyFingerprint; private validateInstructionMetadata; private validateResponsePolicy; private startTurn; private request; private requestOnce; private notify; private handleLine; private handleNotification; private resolveTurn; private handleServerRequest; private handleDynamicToolRequest; private failToolProtocol; private requiredToolString; private dispatchDynamicToolCall; private isToolTurnActive; private toolResult; private replyDisabledTool; private replyToolError; private reply; private handleStderr; private redact; private toError; private refreshTurnIdleTimeout; private failTurn; private timeoutTurn; private getOrCreateTurnStartReconciliation; private completeTurnStartReconciliation; private reconcileAcknowledgedTurn; private handleLateTurnStartResponse; private clearTurnCallbacks; private failAll; private failProcess; private restart; private shutdown; private performShutdown; private detach; } //# sourceMappingURL=codex-app-server-process.d.ts.map