import type { ChatMessage, ProviderId, ToolDefinition } from "../../types.js"; import type { resolveToolDialect } from "../../llm/capabilities.js"; export interface CompactionAdmissionPorts { readonly messages: readonly ChatMessage[]; readonly provider: ProviderId; readonly model: string; readonly dialect: ReturnType; readonly keepRecent: number; readonly contextLimitTokens: number | undefined; readonly estimateRequestTokens: (messages: readonly ChatMessage[]) => number; readonly selectTools: () => readonly ToolDefinition[] | undefined; readonly buildDurableEnvelope: () => Promise; readonly isSuppressed: (attemptKey: string) => boolean; readonly isExhausted?: ((attemptKey: string) => boolean) | undefined; } export type CompactionAdmission = { readonly admitted: false; } | { readonly admitted: true; readonly beforeTokens: number; readonly compactTrigger: number; readonly durableEnvelope: string | undefined; readonly attemptKey: string; }; export interface CompactionAdmissionOptions { readonly bypassThreshold?: boolean | undefined; readonly retrySuppressed?: boolean | undefined; } export declare const planCompactionAdmission: (ports: CompactionAdmissionPorts, options?: CompactionAdmissionOptions) => Promise;