import type { AgentToolResult } from "@earendil-works/pi-agent-core";
import type { ContextCompactionStats, ContextDeletionTarget } from "../session-manager.ts";
import type { CompactableTranscript } from "./context-compaction-types.ts";
import type { ContextCompactionBudgetToolDetails } from "./context-deletion-tool-definitions.ts";
import type { ContextCompactionParameters, ValidatedContextDeletionResult } from "./context-compaction-types.ts";
export declare function formatErrorMessage(error: unknown): string;
export declare function createContextDeletionToolResult<TDetails>(text: string, details: TDetails): AgentToolResult<TDetails>;
export declare function roundPercent(value: number): number;
export declare function percentOf(part: number, total: number): number;
export declare function finitePositiveNumber(value: number | undefined): number | undefined;
export declare function contextCompactionTargetReductionPercent(parameters: ContextCompactionParameters): number;
export declare function contextCompactionTargetLabel(parameters: ContextCompactionParameters): string;
export declare function createContextCompactionBudgetDetails(stats: ContextCompactionStats, callCount: number, contextWindow: number | undefined, parameters: ContextCompactionParameters, remainingImageTokens: number, imageBlockCount: number): ContextCompactionBudgetToolDetails;
export declare function contextCompactionTargetMet(result: ValidatedContextDeletionResult | undefined, parameters: ContextCompactionParameters): result is ValidatedContextDeletionResult;
export declare function contextCompactionProgressKey(result: ValidatedContextDeletionResult | undefined): string;
export declare function contextCompactionProgressPercent(result: ValidatedContextDeletionResult | undefined): number;
/**
 * Sum the token estimates of image content blocks that remain after applying the
 * current deletion targets. Deleted entries and individually-deleted image blocks
 * are excluded so the budget tool always reflects the live working set.
 */
export declare function sumRemainingImageTokens(transcript: CompactableTranscript, targets: readonly ContextDeletionTarget[]): number;
/**
 * Count the image content blocks that remain after applying the current deletion
 * targets. Deleted entries and individually-deleted image blocks are excluded.
 */
export declare function countRemainingImageBlocks(transcript: CompactableTranscript, targets: readonly ContextDeletionTarget[]): number;
//# sourceMappingURL=context-compaction-metrics.d.ts.map