/**
 * OwlCoda session persistence — save/load/list conversation sessions.
 * Storage: ~/.owlcoda/sessions/<id>.json
 */
export interface SessionMessage {
    role: 'user' | 'assistant';
    content: unknown;
    timestamp: string;
}
export interface SessionMeta {
    id: string;
    model: string;
    createdAt: string;
    updatedAt: string;
    messageCount: number;
    /** First user message (for display) */
    preview: string;
    cwd: string;
    tags?: string[];
    parentId?: string;
    branchName?: string;
}
export interface Session {
    meta: SessionMeta;
    messages: SessionMessage[];
}
/**
 * Create a new session and return its ID.
 */
export declare function createSession(model: string, cwd: string): Promise<string>;
/**
 * Save a message to an existing session.
 */
export declare function saveMessage(sessionId: string, role: 'user' | 'assistant', content: unknown): Promise<void>;
/**
 * Load a session by ID.
 */
export declare function loadSession(sessionId: string): Promise<Session | null>;
/**
 * Get the last used session ID.
 */
export declare function getLastSessionId(): Promise<string | null>;
/**
 * List all sessions, sorted by updatedAt descending.
 */
export declare function listSessions(limit?: number): Promise<SessionMeta[]>;
/**
 * Update the model on an existing session (e.g. after /model switch in REPL).
 */
export declare function updateSessionModel(sessionId: string, model: string): Promise<void>;
/**
 * Delete a session by ID.
 */
export declare function deleteSession(sessionId: string): Promise<boolean>;
export declare function addSessionTag(sessionId: string, tag: string): Promise<boolean>;
export declare function removeSessionTag(sessionId: string, tag: string): Promise<boolean>;
export declare function findSessionsByTag(tag: string, limit?: number): Promise<SessionMeta[]>;
export interface SearchResult {
    meta: SessionMeta;
    matchedPreview: string;
}
export declare function searchSessions(query: string, limit?: number): Promise<SearchResult[]>;
/**
 * Branch (deep copy) a session. Creates a new session linked to the parent.
 */
export declare function branchSession(sourceId: string, branchName?: string): Promise<string>;
/**
 * List all sessions that were branched from a given session.
 */
export declare function listBranches(sessionId: string): Promise<SessionMeta[]>;
