/** * Bounded retention for the session checkpoint list (`state.checkpoints`). * * Mirrors the dual-budget pattern of history-retention.ts: the checkpoint * list is a display index into the canonical session record, not the record * itself. The JSONL session log still carries every `checkpoint` event, so * pruning old in-memory rows loses nothing — `/rewind` simply shows the * newest slice. Without a bound, resuming a long session rebuilt every * checkpoint ever written into memory (see buildRestoredCheckpoints) and * the live `checkpointReceived` reducer appended forever. * * This module is pure TypeScript — no React, no Ink. */ import type { State } from './app-state.js'; export type CheckpointEntry = State['checkpoints'][number]; /** Default maximum number of retained checkpoints. */ export declare const TUI_CHECKPOINTS_MAX_ENTRIES = 200; /** Default maximum serialized bytes across all retained checkpoints. */ export declare const TUI_CHECKPOINTS_MAX_BYTES: number; export interface CheckpointBudget { maxEntries?: number | undefined; maxBytes?: number | undefined; } /** * Retain the newest checkpoints within both a count and serialized-byte * budget. Checkpoints are chronological (ascending promptIndex), so the * newest entries are at the end of the array. Like retainTuiHistory, at * least one entry is always kept — dropping the only checkpoint would make * `/rewind` report "no checkpoints" for a session that has one. * * Returns the ORIGINAL array reference when nothing needs pruning so * reducer callers can bail out without scheduling another render. */ export declare function retainCheckpoints(checkpoints: CheckpointEntry[], budget?: CheckpointBudget): CheckpointEntry[]; //# sourceMappingURL=checkpoint-retention.d.ts.map