import type { AgentMessage } from "../../sdk/agent-core/index.js"; import { type CompactionPolicy } from "../../sdk/coding-agent/core/compaction/index.js"; import { type ExtensionAPI } from "../../sdk/coding-agent/index.js"; import type { Runtime } from "../runtime.js"; export declare const COMPACT_CONTEXT_TOOL_NAME = "compact_context"; export interface AutoPruneFrozen { /** Session identity used to invalidate the frozen cut after branch/session switches. */ sessionId: string; /** Index into the provider message array for the first kept message. */ cutIndex: number; /** Stable AgentMessage reference at `cutIndex`, used as an O(1) identity anchor. */ anchor: AgentMessage; /** Deterministic DCP-lite summary generated at the original prune. */ summary: string; /** Original tokensBefore for the frozen compaction summary message. */ tokensBefore: number; /** Original compaction timestamp for the frozen compaction summary message. */ timestamp: string; /** Keep-recent token budget that produced this cut (policy-change invalidation). */ keepRecentTokensUsed: number; /** Token estimate of the kept tail at the moment the cut was frozen. */ tailTokensAtFreeze: number; } /** Request-time DCP adapter for isolated loops: it borrows only pure policy helpers. */ export declare function buildIsolatedRequestTimePrunedMessages(currentMessages: AgentMessage[], policy?: CompactionPolicy, keepRecentTokens?: number): AgentMessage[]; export interface IsolatedRequestTimePruneResult { messages: AgentMessage[]; frozen: AutoPruneFrozen | null; } /** * Stateful per-run variant of {@link buildIsolatedRequestTimePrunedMessages}. * * The subagent loop owns the returned `frozen` value across provider requests. * On the first prune we freeze the deterministic summary + cut, then reuse that * exact prefix until the kept-tail anchor reference changes or the tail grows * past the window-relative hysteresis budget. */ export declare function buildIsolatedRequestTimePrunedMessagesResult(currentMessages: AgentMessage[], policy?: CompactionPolicy, keepRecentTokens?: number, frozen?: AutoPruneFrozen | null, contextWindow?: number | null): IsolatedRequestTimePruneResult; export declare function registerCompactContextTool(ext: ExtensionAPI, runtime: Runtime): void; //# sourceMappingURL=compact-context.d.ts.map