import type { Api, Model, SimpleStreamOptions } from '@earendil-works/pi-ai/compat'; export declare const COMPACTION_CONTEXT_MARGIN = 4096; export declare const COMPACTION_REPAIR_RESERVE = 1024; export declare class CompactionRequestError extends Error { readonly kind: 'length' | 'empty' | 'budget' | 'provider' | 'timeout'; constructor(kind: 'length' | 'empty' | 'budget' | 'provider' | 'timeout', message: string); } export declare function compactionOutputLimit(model: Model, configured: number): number; /** Start large prompts closer to their likely delta size while retaining room to double on truncation. */ export declare function initialCompactionOutputLimit(systemPrompt: string, prompt: string, outputLimit: number): number; export declare function compactionPromptFits(model: Model, systemPrompt: string, prompt: string, outputLimit: number): boolean; /** Bound the final provider payload, including adapters that add a thinking budget. */ export declare function compactionPayloadGuard(limit: number, onBudget: (actual: number) => void): NonNullable; export declare function isPermanentCompactionError(error: unknown): boolean;