export interface TrimResult {
    trimmedLines: number;
    keptLines: number;
    archivePath: string | null;
    fileChanged: boolean;
}
/**
 * Derive the archive path from a transcript path by inserting
 * `.archive.<date>` before the final `.jsonl` extension.
 *
 * The date defaults to today (local time) if not provided.  Date-stamped
 * archive files enable date-based filtering at collection time and prevent
 * a single archive file from growing unboundedly.
 *
 * Examples:
 *   /path/to/abc123.jsonl       →  /path/to/abc123.archive.2026-03-25.jsonl
 *   /path/to/abc123             →  /path/to/abc123.archive.2026-03-25.jsonl
 *   deriveArchivePath(p, "2026-01-01")  →  *.archive.2026-01-01.jsonl
 */
export declare function deriveArchivePath(transcriptPath: string, date?: string): string;
/**
 * After a compaction event, trim the JSONL transcript to remove all content
 * BEFORE the last compaction boundary line. Claude transcripts use a
 * `system`/`compact_boundary` record; Pi Coding transcripts use a top-level
 * `compaction` record. The removed (pre-compaction) content is appended to an
 * archive file for history preservation.
 *
 * This keeps the live transcript small so that:
 *  - `pruneSessionImages()` only scans post-compaction lines
 *  - The SDK resumes from a much smaller file (both with and without
 *    CLAUDE_CODE_SKIP_PRECOMPACT_LOAD)
 *
 * Safety: the trim is only performed when a supported compaction boundary is
 * found at index > 0, meaning there is actually pre-compaction content to
 * remove.
 */
export declare function trimTranscriptAfterCompaction(options: {
    transcriptPath: string;
    archivePath: string;
}): Promise<TrimResult>;
/**
 * Delete old transcript archive files and sub-agent transcripts that exceed
 * the retention period.
 *
 * What gets cleaned:
 *  - Date-stamped archives: `*.archive.YYYY-MM-DD.jsonl`, `*.image-archive.YYYY-MM-DD.jsonl`
 *    → deleted if embedded date < cutoff
 *  - Legacy undated archives: `*.archive.jsonl`, `*.image-archive.jsonl`
 *    → deleted if file mtime < cutoff
 *  - Sub-agent transcripts: `<sessionId>/subagents/agent-*.jsonl`
 *    → deleted if file mtime < cutoff; empty directories pruned
 *  - Live transcripts (`<sessionId>.jsonl`): NOT deleted (managed by SDK)
 */
export declare function cleanupOldTranscripts(transcriptDir: string, retentionDays?: number): void;
//# sourceMappingURL=session-trimmer.d.ts.map