import type { ChatMessage, ToolCall } from "../../../types.js"; import type { SessionPlan } from "../../../store/plan.js"; import type { LoopGuardStopInfo } from "../../turn-outcome.js"; import type { ResponderNotification } from "../../../tools/jobs.js"; export interface RoundBoundCall { readonly id: string; readonly call: ToolCall; } export interface RoundCloseoutState { consecutiveSynthesizedRounds: number; } export interface RoundCloseoutPorts { readonly messages: ChatMessage[]; readonly recordedNativeIds: Set; readonly historyNativeCalls: readonly { id: string; name: string; }[]; readonly deferReason: string; readonly priorObservation: (call: ToolCall) => string | undefined; readonly completeActionSequence: (eligible: boolean, outcome: string) => void; readonly currentSignature: () => string | undefined; readonly drainResponderLedger: () => ResponderNotification[]; readonly refreshInstructions: () => Promise; readonly refreshSessionState: (plan: SessionPlan | null | undefined) => void; readonly recoveryUserMessage: (content: string) => ChatMessage; readonly drainDeferredMessages: () => ChatMessage[]; } export interface RoundCloseoutInput { readonly bound: readonly RoundBoundCall[]; readonly runIds: ReadonlySet; readonly outcomes: ReadonlyMap; readonly sequenceEligible: boolean; readonly executedCount: number; readonly plannedCount: number; readonly runCount: number; readonly suppressedCount: number; readonly aborted: boolean; readonly awaitingPlanApproval: boolean; readonly instructionsChanged: boolean; readonly pendingSessionStatePlan: SessionPlan | null | undefined; readonly responderWakeTurn: boolean; readonly unreadResponderResults: boolean; readonly calledResponderRead: boolean; } export interface RoundCloseoutStop { readonly kind: "stop"; readonly answer: string; readonly remainingCriteria: readonly string[]; readonly reason: string; readonly loopGuardStop: LoopGuardStopInfo; } export type RoundCloseoutDecision = { readonly kind: "proceed"; } | RoundCloseoutStop; export declare const closeOutRound: (ports: RoundCloseoutPorts, state: RoundCloseoutState, input: RoundCloseoutInput) => Promise;