import type { DatabaseSync } from "node:sqlite"; import type { CreateSessionInput, SessionDbRecord } from "./databaseTypes.js"; /** * Sessions repository backed by SQLite without caching. * Expects: schema migrations already applied for sessions. */ export declare class SessionsRepository { private readonly db; constructor(db: DatabaseSync); findById(id: string): Promise; findByAgentId(agentId: string): Promise; create(input: CreateSessionInput): Promise; /** * Marks a session as ended by setting ended_at. * Expects: sessionId is valid. */ endSession(sessionId: string, endedAt: number): Promise; /** * Marks a session as needing memory processing. * Sets invalidated_at only if null or if historyId is larger. * Expects: sessionId and historyId are valid. */ invalidate(sessionId: string, historyId: number): Promise; /** * Returns sessions that need memory processing, ordered by invalidated_at ASC. * Expects: limit > 0. */ findInvalidated(limit: number): Promise; /** * CAS update: clears invalidated_at and sets processed_until, * but only if invalidated_at still matches the expected value. * Returns true if the update was applied. */ markProcessed(sessionId: string, processedUntil: number, expectedInvalidatedAt: number): Promise; private sessionParse; } //# sourceMappingURL=sessionsRepository.d.ts.map