import { type MutableRefObject } from "react";
import type { Message, Provider } from "@kenkaiiii/gg-ai";
import type { SessionManager } from "../../core/session-manager.js";
import type { SessionStats } from "../session-summary.js";
/** Minimal session-store surface the persistence layer mirrors into. */
interface PersistenceSessionStore {
    messages: Message[];
    sessionPath?: string;
    sessionId?: string;
}
interface UseSessionPersistenceOptions {
    sessionManagerRef: MutableRefObject<SessionManager | null>;
    sessionPathRef: MutableRefObject<string | undefined>;
    sessionStatsRef: MutableRefObject<SessionStats>;
    persistedIndexRef: MutableRefObject<number>;
    messagesRef: MutableRefObject<Message[]>;
    cwdRef: MutableRefObject<string>;
    currentProvider: Provider;
    currentModel: string;
    sessionStore?: PersistenceSessionStore;
}
export interface SessionPersistence {
    appendMessagesToSession: (sessionPath: string, messages: readonly Message[], startIndex: number) => Promise<void>;
    persistCompactedSession: (compactedMessages: readonly Message[]) => Promise<void>;
    persistNewMessages: () => Promise<void>;
}
/**
 * Owns session message persistence: appending new turn messages, persisting a
 * compacted checkpoint, and keeping `persistedIndexRef`/`sessionStatsRef`/the
 * session store in sync. Extracted verbatim from `App.tsx`.
 */
export declare function useSessionPersistence({ sessionManagerRef, sessionPathRef, sessionStatsRef, persistedIndexRef, messagesRef, cwdRef, currentProvider, currentModel, sessionStore, }: UseSessionPersistenceOptions): SessionPersistence;
export {};
//# sourceMappingURL=useSessionPersistence.d.ts.map