export type DesktopMetadataRow = Record; export type DesktopMetadataKind = "desktop_catalog" | "state"; export interface DesktopMetadataSource { database: string; codexHome: string; kind: DesktopMetadataKind; status: "ok" | "absent" | "error"; rowCount?: number; pageCount?: number; columns?: string[]; error?: string; snapshot?: "stable_copy"; } export interface DesktopMetadataBatch { source: DesktopMetadataSource; rows: DesktopMetadataRow[]; hosts?: Record; } export type DesktopMetadataReader = (codexHome: string) => Promise; export type DesktopSnapshotQuery = (database: string, sql: string) => Promise; export interface DesktopMetadataReaderOptions { querySnapshot?: DesktopSnapshotQuery; temporaryRoot?: string; maxRows?: number; } /** Reads metadata only. Original SQLite files are never opened by SQLite. */ export declare function readDesktopMetadata(codexHome: string, options?: DesktopMetadataReaderOptions): Promise; /** Sequential DB/WAL copy with stat guards, not an atomic SQLite backup. */ export declare function withDesktopMetadataSnapshot(database: string, read: (copy: string) => Promise, temporaryRoot?: string): Promise; export declare function queryDesktopSnapshot(database: string, sql: string): Promise;