import type { WriteReceipt } from "../action.js"; import type { AgentLoopFinalResponseGuardResult } from "./production-agent.js"; export type ToolWriteReceipt = WriteReceipt & { tool: string; }; export interface WriteReceiptGuard { retryMessage: string; fallbackMessage: string; exhaustedDraftPrefix: string; maxRetries: number; } /** * Reads the reserved `_receipt` off an action's raw result. A receipt that is * present but unreadable is `unverified`, never silently clean. */ export declare function readWriteReceipt(result: unknown): WriteReceipt | undefined; /** * A receipt that says nothing was written, or that the effect did not hold, * forces one retry per turn. `unverified` alone only annotates the answer. */ export declare function writeReceiptGuard(receipts: readonly ToolWriteReceipt[], alreadyRetried: boolean): WriteReceiptGuard | null; /** * One guard result from the receipt guard and the app's guard. The retry * counter is shared, so the larger budget wins and both messages are sent in * the same retry. */ export declare function mergeFinalResponseGuards(receipt: WriteReceiptGuard, app: AgentLoopFinalResponseGuardResult): AgentLoopFinalResponseGuardResult;