/**
 * companion-chat-persistence.ts
 *
 * Disk-backed session store for CompanionChatManager.
 *
 * Design:
 * - Sessions and their messages are stored as individual JSON files under
 *   `<sessionsDir>/<sessionId>.json` using atomic tmp-file + rename writes.
 * - The store is loaded eagerly at construction time (async init()) and
 *   thereafter kept in sync with every createSession / updateSession /
 *   appendMessage / closeSession mutation.
 * - Default storage root: ~/.goodvibes/companion-chat/sessions/
 */
import type { CompanionChatMessage, CompanionChatSession } from './companion-chat-types.js';
export interface PersistedChatSession {
    readonly meta: CompanionChatSession;
    readonly messages: CompanionChatMessage[];
}
export declare function defaultSessionsDir(): string;
export declare class CompanionChatPersistence {
    private readonly sessionsDir;
    constructor(sessionsDir?: string);
    /** Ensure the sessions directory exists. */
    private ensureDir;
    private filePath;
    /** Load all persisted sessions from disk. Returns an empty array on directory failure. */
    loadAll(): Promise<PersistedChatSession[]>;
    /** Atomically persist a single session to disk. Rejects when the write fails. */
    save(session: PersistedChatSession): Promise<void>;
    /** Delete a session file from disk (called when a closed session is GC'd). Rejects on unlink failure. */
    delete(sessionId: string): Promise<void>;
}
//# sourceMappingURL=companion-chat-persistence.d.ts.map