import { type SessionLookupOptions, type Session, type SessionInsert, type Message, type ToolCall, type ParsedSession, type StagedParsedSession } from "../types/index.js"; /** Upsert a session keyed by (source, source_id). Returns the stored row. */ export declare function upsertSession(input: SessionInsert): Session; export declare function getSession(id: string): Session; export declare function getSessionBySource(source: string, sourceId: string): Session | null; /** Resolve a session by full id or a unique id/source_id prefix. Throws on ambiguous matches. */ export declare function getSessionByPrefix(idOrPrefix: string, opts?: SessionLookupOptions): Session | null; /** * Set a session's title (the "rename" operation), resolving by full id or a * unique id/source_id prefix. Updates both the `sessions` row and the FTS index. * Returns the updated Session, or null when no unique match exists. */ export declare function updateSessionTitle(idOrPrefix: string, title: string, opts?: SessionLookupOptions): Session | null; export interface ListSessionsOptions { source?: string; project_path?: string; machine?: string; limit?: number; offset?: number; } export declare function listSessions(opts?: ListSessionsOptions): Session[]; export declare function getRecentSessions(limit?: number): Session[]; export declare function getMessages(sessionId: string): Message[]; export declare function getToolCalls(sessionId: string): ToolCall[]; export interface ProjectStat { project_path: string; project_name: string | null; session_count: number; } export declare function getProjectStats(): ProjectStat[]; export declare function deleteSession(id: string): void; export interface RelocateDbResult { /** Number of `sessions` rows whose project_path was rewritten. */ rowsUpdated: number; } /** * Rewrite session paths after a project directory move (old -> new). * Updates `sessions.project_path`, `sessions.source_path`, and the * path-encoded `ingestion_state.file_path`. This is the local (SQLite) * implementation behind the Store's `relocatePaths` — the ONLY seam a * relocate command uses to touch the index (no `new Database(...)`). */ export declare function relocatePathsInDb(oldPath: string, newPath: string): RelocateDbResult; /** * Persist a fully-parsed session: upsert the session row, replace its messages * and tool calls, and recompute aggregate counts/token totals. Idempotent — * re-ingesting the same session replaces its children rather than duplicating. */ export declare function saveParsedSession(parsed: ParsedSession, opts?: { preservePreferredSnapshot?: boolean; }): Session; export interface SaveStagedParsedSessionResult { session: Session; maxBatchRecords: number; } /** * Persist a disk-staged session by replacing its visible children inside one * transaction while reading bounded batches from the staging store. */ export declare function saveStagedParsedSession(staged: StagedParsedSession, opts?: { batchSize?: number; preservePreferredSnapshot?: boolean; }): SaveStagedParsedSessionResult; //# sourceMappingURL=sessions.d.ts.map