import type { Message } from '../types/core.js';
interface UseSessionAutosaveProps {
    messages: Message[];
    currentProvider: string;
    currentModel: string;
    currentSessionId: string | null;
    setCurrentSessionId: (id: string | null) => void;
}
/**
 * Hook to handle automatic session saving.
 * Updates the current session when currentSessionId is set; otherwise creates a new session.
 * Clears currentSessionId when messages are cleared.
 *
 * Race safety: saves are serialised through a single chained promise stored in
 * saveChainRef. A new save does not start until the previous one resolves.
 * Critically, doSave reads currentSessionIdRef.current AFTER the
 * initPromiseRef await so it sees the value set by any prior save in the same
 * chain - not the stale captured value from effect-fire time. This guarantees
 * at most one createSession() call per conversation even when the effect fires
 * several times before React flushes any setCurrentSessionId update.
 *
 * Persistence integrity: the full message array is always written to disk.
 * maxMessages bounds only what is sent to the model (enforced in the
 * conversation loop before the LLM call), not what is stored in the
 * session file.
 */
export declare function useSessionAutosave({ messages, currentProvider, currentModel, currentSessionId, setCurrentSessionId, }: UseSessionAutosaveProps): void;
export {};
//# sourceMappingURL=useSessionAutosave.d.ts.map