/** * Request-time pruning of stale tool results. * * Large tool outputs (a 50 KB `read`, a long `bash` log) are only useful for a * few turns. Long before compaction triggers they are dead weight in every * provider request. This module replaces the content of old, large tool * results with a short placeholder right before the request is built. * * It is a pure transform: the session file, compaction, and in-memory history * are never touched. The model can re-read or re-run whenever it needs the * original output. */ import type { AgentMessage } from "@elyracode/agent-core"; export interface ContextPruningSettings { /** Master switch. When false, messages pass through untouched. */ enabled: boolean; /** A tool result is stale once this many assistant messages follow it. */ keepRecentTurns: number; /** Only prune tool results whose text content is at least this long. */ minChars: number; } export declare const DEFAULT_CONTEXT_PRUNING: ContextPruningSettings; export interface ContextPruningStats { prunedMessages: number; charsRemoved: number; } /** * Replace the content of stale, large, non-error tool results with a short * placeholder. Input messages are never mutated. Untouched messages are * returned by reference so the cached prompt prefix stays byte-identical. * When nothing is pruned the input array itself is returned. */ export declare function pruneStaleToolResults(messages: readonly AgentMessage[], settings: ContextPruningSettings): AgentMessage[]; /** Dry run of {@link pruneStaleToolResults} that only reports what would be removed. */ export declare function countPrunableChars(messages: readonly AgentMessage[], settings: ContextPruningSettings): ContextPruningStats; //# sourceMappingURL=context-pruning.d.ts.map