import type { AgentMessage } from "@earendil-works/pi-agent-core";
import type { ContextDeletionTarget } from "../session-manager.ts";
import type { CompactableTranscript } from "./context-compaction-types.ts";
export interface EntryTextRow {
    entry_id: string;
    text: string;
    is_protected: number;
    has_assistant_thinking_blocks: number;
}
export interface EntryReadRow extends EntryTextRow {
    role: string;
    token_estimate: number;
}
export interface ContentBlockTextRow {
    entry_id: string;
    block_index: number;
    role: AgentMessage["role"];
    type: string;
    text: string;
    entry_protected: number;
    block_protected: number;
    block_count: number;
    has_assistant_thinking_blocks: number;
}
export interface ContentBlockReadRow extends ContentBlockTextRow {
    token_estimate: number;
}
export interface StoredTranscriptEntry {
    entryId: string;
    role: AgentMessage["role"];
    protected: boolean;
    hasAssistantThinkingBlocks: boolean;
    tokenEstimate: number;
    text: string;
}
export interface StoredContentBlock {
    entryPosition: number;
    entryId: string;
    blockIndex: number;
    role: AgentMessage["role"];
    type: string;
    protected: boolean;
    hasAssistantThinkingBlocks: boolean;
    tokenEstimate: number;
    text: string;
}
export interface ContextDeletionMemorySnapshot {
    deletionTargets: ContextDeletionTarget[];
    callCount: number;
    lastError?: string;
}
export declare class ContextDeletionMemoryStore {
    private readonly entries;
    private readonly entriesById;
    private readonly contentBlocks;
    private readonly contentBlockCountByEntryId;
    private deletionTargets;
    private callCount;
    private lastError;
    constructor(transcript: CompactableTranscript);
    transaction<T>(operation: () => T): T;
    readTargets(): ContextDeletionTarget[];
    replaceTargets(targets: readonly ContextDeletionTarget[]): void;
    listEntriesForGrep(): EntryTextRow[];
    listContentBlocksForGrep(): ContentBlockTextRow[];
    getEntryForRead(entryId: string): EntryReadRow | undefined;
    getContentBlockForRead(entryId: string, blockIndex: number): ContentBlockReadRow | undefined;
    getGrepScanTextLength(target: "entry" | "content_block"): number;
    incrementCallCount(): number;
    getCallCount(): number;
    setLastError(message: string): void;
    clearLastError(): void;
    getLastError(): string | undefined;
    private snapshot;
    private restore;
}
export declare function createContextDeletionStore(transcript: CompactableTranscript): ContextDeletionMemoryStore;
//# sourceMappingURL=context-deletion-store.d.ts.map