import type { AgentMessage } from "@mariozechner/pi-agent-core";
declare function makeMissingToolResult(params: {
    toolCallId: string;
    toolName?: string;
}): Extract<AgentMessage, {
    role: "toolResult";
}>;
export { makeMissingToolResult };
/**
 * True when an assistant message has no tool calls and only empty/whitespace
 * text or thinking blocks.  This happens when a stream fails before any
 * content arrives — the blank entry is otherwise persisted and produces
 * consecutive same-role messages, which strict providers (vLLM) reject with
 * "role must alternate" errors that poison the session for every future turn.
 */
export declare function isEmptyAssistantMessage(message: unknown): boolean;
export type ToolCallInputRepairReport = {
    messages: AgentMessage[];
    droppedToolCalls: number;
    droppedAssistantMessages: number;
};
export declare function stripToolResultDetails(messages: AgentMessage[]): AgentMessage[];
export declare function repairToolCallInputs(messages: AgentMessage[]): ToolCallInputRepairReport;
export declare function sanitizeToolCallInputs(messages: AgentMessage[]): AgentMessage[];
export declare function sanitizeToolUseResultPairing(messages: AgentMessage[]): AgentMessage[];
export type ToolUseRepairReport = {
    messages: AgentMessage[];
    added: Array<Extract<AgentMessage, {
        role: "toolResult";
    }>>;
    droppedDuplicateCount: number;
    droppedOrphanCount: number;
    moved: boolean;
};
export declare function repairToolUseResultPairing(messages: AgentMessage[]): ToolUseRepairReport;
