import type { Model } from "@earendil-works/pi-ai"; export type WorkflowCompactionPolicyName = "auto" | "default" | "aggressive-local" | "cache-preserving" | "off"; export type WorkflowCompactionCacheValue = "none" | "low" | "normal" | "high"; export interface WorkflowCompactionSettingsOverride { enabled: boolean; reserveTokens: number; keepRecentTokens: number; } export interface WorkflowCompactionPolicyDecision { policy: Exclude; cacheValue: WorkflowCompactionCacheValue; reason: string; settings?: WorkflowCompactionSettingsOverride; } export interface WorkflowCompactionPolicyInput { requested?: WorkflowCompactionPolicyName | null; modelSpec?: string; model?: Partial, "provider" | "id" | "contextWindow">>; contextWindow?: number; } /** * Resolve the workflow subagent compaction posture. * * The Pi SDK compacts when `contextTokens > contextWindow - reserveTokens`. * For local/no-cache workers, raising the reserve to ~35% makes compaction * proactive around 60-70% occupancy instead of near the end of the window. */ export declare function resolveWorkflowCompactionPolicy(input: WorkflowCompactionPolicyInput): WorkflowCompactionPolicyDecision;