export type CodexRunnerFreshnessState = 'current' | 'stale_waiting_idle' | 'restarting_fresh' | 'failed' | 'unknown'; export interface CodexRunnerFreshnessDecision { state: CodexRunnerFreshnessState; reason: 'not_codex_app' | 'adopt_session' | 'fresh_spawn' | 'build_match' | 'persisted_build_missing' | 'build_mismatch' | 'replacement_reattached' | 'current_build_unknown'; persistOnReady: boolean; } export declare function decideCodexRunnerFreshness(input: { cliId: string; adoptMode: boolean; persistentReattach: boolean; replacementExpectedFresh?: boolean; currentBuildId?: string; persistedBuildId?: string; }): CodexRunnerFreshnessDecision; export declare function shouldHoldCodexRunnerInput(state: CodexRunnerFreshnessState): boolean; export declare function transitionOnCodexRunnerPrompt(state: CodexRunnerFreshnessState): { state: CodexRunnerFreshnessState; action: 'publish_ready' | 'reload' | 'ignore'; }; /** * Worker-owned input queues whose dequeue boundary is fenced by runner * freshness. Keeping this small seam outside worker.ts makes the stale-runner * contract executable without importing the worker process (which installs * IPC handlers and starts runtime services at module load). */ export declare class CodexRunnerFreshnessInputQueue { private readonly getState; private readonly setState; readonly normal: TNormal[]; readonly raw: TRaw[]; constructor(getState: () => CodexRunnerFreshnessState, setState: (state: CodexRunnerFreshnessState) => void); enqueueNormal(input: TNormal): void; enqueueRaw(input: TRaw): void; takeNormal(): TNormal | undefined; takeRaw(): TRaw | undefined; onPromptReady(): 'publish_ready' | 'reload' | 'ignore'; onReplacementFailed(): void; } //# sourceMappingURL=codex-runner-freshness.d.ts.map