type Row = Record; export interface OpenCodeDump { sessions: Row[]; projects: Row[]; workspaces: Row[]; messages: Row[]; parts: Row[]; } export declare function opencodeDbPath(): string; /** Dump every row that belongs to the session(s) rooted at `root`, or null. */ export declare function dumpOpenCodeSessions(root: string): OpenCodeDump | null; /** Insert a dump into the destination DB, rewriting paths to `destRoot`. */ export declare function restoreOpenCodeSessions(destRoot: string, dump: OpenCodeDump): number; /** List sessions for a workspace with id + title + updated (for UI). */ export declare function listOpenCodeSessionsDetailed(root: string): Array<{ id: string; title: string; updated: number; }>; /** ALL opencode sessions across every workspace (newest first), carrying each * row's own `directory` as cwd. Same store as {@link listOpenCodeSessionsDetailed} * but unfiltered — for global cross-workspace discovery. `updated` is epoch ms. */ export declare function listAllOpenCodeSessions(): Array<{ id: string; title: string; updated: number; cwd: string; }>; export interface TranscriptMsg { role: 'user' | 'assistant' | 'system' | 'tool'; text: string; ts?: number; } /** * Read an opencode session's messages into a normalized array. A message's * role lives in the `message.data` JSON; its rendered text is assembled from * the child `part` rows (part.data = {type:'text'|'tool'|…, text?, …}). Ordered * by creation time; returns at most `limit` messages (the tail). [] on any miss. */ export declare function readOpenCodeTranscript(sessionId: string, limit?: number): TranscriptMsg[]; export {};