import type { ResponsesReasoningConfig, ResponsesTextConfig, RemoteCompactionData, } from "./remote-compaction.ts"; export interface PendingFormalRemote { sourceLeafId: string; reason: "manual" | "threshold" | "overflow"; willRetry: boolean; coverageThroughEntryId: string; controller: AbortController; promise: Promise; } export interface RequestShapeState { reasoning?: ResponsesReasoningConfig; text?: ResponsesTextConfig; } export interface RuntimeState { pendingFormal?: PendingFormalRemote; requestShape?: RequestShapeState; configWarningShown: boolean; } export function createRuntimeState(): RuntimeState { return { configWarningShown: false }; } export function clearPendingFormal(state: RuntimeState): void { state.pendingFormal?.controller.abort(); state.pendingFormal = undefined; } export function clearSessionState(state: RuntimeState): void { clearPendingFormal(state); state.requestShape = undefined; }