import type { ChatMessage } from "../../types.js"; import type { LoopGuardStopInfo } from "../turn-outcome.js"; import type { TurnOutcome, TurnOutcomeStatus } from "../turn-outcome.js"; export interface TurnFinalizerPorts { readonly releaseResponderClaims: () => void; readonly liveMessages: () => ChatMessage[]; readonly diagnostics: () => boolean; readonly writeAssistantMessage: (text: string) => void; readonly emitEmptyAssistantMessage: () => void; readonly emitTurnEnd: (input: { outcome: TurnOutcome; finalAnswer: string; steps: number; }) => void; readonly onMessages: ((messages: ChatMessage[]) => void) | undefined; readonly onOutcome: ((outcome: TurnOutcome) => void) | undefined; } export interface TurnFinalizerInput { readonly answer: string; readonly steps: number; readonly status: TurnOutcomeStatus; readonly remainingCriteria: readonly string[]; readonly reason: string | undefined; readonly displayAnswer: string | undefined; readonly loopGuardStop: LoopGuardStopInfo | undefined; } export declare const finalizeTurn: (ports: TurnFinalizerPorts, input: TurnFinalizerInput) => TurnOutcome; export declare const createTurnFinisher: (ports: TurnFinalizerPorts) => (answer: string, steps: number, status?: TurnOutcomeStatus, remainingCriteria?: readonly string[], reason?: string, displayAnswer?: string, loopGuardStop?: LoopGuardStopInfo) => TurnOutcome;