/** * Emergency Content Truncation * * When message-level removal (sliding window) can't fit context into budget, * this truncates the CONTENT of the longest messages as a last resort. */ import type { ChatMessage } from "../types/index.js"; /** * Emergency content truncation: truncate the content of the longest messages * to fit within the available token budget. * * Strategy: Sort messages by content length (descending), truncate each * to a proportional share of the available budget until total fits. */ export declare function emergencyContentTruncation(messages: ChatMessage[], availableTokensForHistory: number, breakdown: { systemPrompt: number; conversationHistory: number; currentPrompt: number; toolDefinitions: number; fileAttachments: number; }, provider?: string): ChatMessage[];