import type { Message, GrawkusConfig } from './types.js';
/**
 * Estimate tokens accounting for content type and message overhead.
 * - English prose: ~3.5 chars per token
 * - Code: ~3 chars per token (more special chars)
 * - Message overhead: ~4 tokens per message for role/structure
 */
export declare function estimateTokens(messages: Message[]): number;
export interface CompactionConfig {
    enabled: boolean;
    triggerTokens: number;
    keepRecentMessages: number;
    targetTokens: number;
}
export declare const DEFAULT_COMPACTION: CompactionConfig;
export declare function shouldCompact(messages: Message[], config: CompactionConfig): boolean;
export declare function getCompactionStats(messages: Message[]): {
    messageCount: number;
    estimatedTokens: number;
    needsCompaction: boolean;
};
/**
 * Compact messages by summarizing older ones with the AI model.
 * Returns a new messages array with a summary + recent messages.
 */
export declare function compactMessages(messages: Message[], config: GrawkusConfig, compactionConfig?: CompactionConfig): Promise<Message[]>;
/**
 * Quick local compaction without API call — just truncates tool results.
 */
export declare function quickCompact(messages: Message[]): Message[];
