import type { DrizzleDataStore } from '@opensip-cli/datastore/internal'; /** Hard ceiling for one bounded Session-retention transaction. */ export declare const MAX_SESSION_MAINTENANCE_BATCH_SIZE = 500; /** Transactional bounded pruning operations for persisted Tool Sessions. */ export declare class SessionMaintenanceRepo { private readonly datastore; constructor(datastore: DrizzleDataStore); /** * Keep the newest `keep` sessions by start time and delete the rest. * `keep <= 0` disables count pruning. Foreign-key cascades remove sibling * host-metrics and payload rows. */ pruneToCount(keep: number): number; /** * Delete at most `batchSize` of the oldest sessions exceeding `keep`. * * Selection and deletion share one datastore write lock and SQLite * transaction. Equal timestamps are ordered by opaque Session ID so repeated * calls make deterministic progress without an unbounded ID query. */ pruneToCountBatch(keep: number, batchSize?: number): number; /** Delete sessions older than the given Date. Returns affected rowcount. */ purge(before: Date): number; /** * Delete at most `batchSize` sessions older than `before`, oldest first. * * Selection and deletion share one datastore write lock and SQLite * transaction. Equal timestamps are ordered by opaque Session ID so repeated * calls make deterministic progress without an unbounded ID query. */ purgeBatch(before: Date, batchSize?: number): number; /** Delete every session. Returns affected rowcount. */ clearAll(): number; /** * Delete ONE tool's sessions (`tools data purge`, ADR-0042). Associated * `session_tool_payload` rows go via the schema's `onDelete: 'cascade'` FK * (the sqlite backend runs `PRAGMA foreign_keys = ON`). Returns the deleted * session count. */ clearForTool(toolId: string): number; } //# sourceMappingURL=session-maintenance-repo.d.ts.map