/**
 * OwlCoda Native Session Persistence
 *
 * Save and load conversation sessions as JSON files.
 * Sessions are stored in ~/.owlcoda/native-sessions/.
 */
import type { Conversation, ConversationTurn, PendingRetryState, TaskExecutionState } from './protocol/types.js';
/** Serializable session format. */
export interface SessionFile {
    version: 1;
    id: string;
    model: string;
    system: string;
    maxTokens: number;
    temperature?: number;
    turns: ConversationTurn[];
    createdAt: number;
    updatedAt: number;
    title?: string;
    cwd?: string;
    tags?: string[];
    parentId?: string;
    branchName?: string;
    pendingRetry?: PendingRetryState;
    taskState?: TaskExecutionState;
}
/** Save a conversation to disk. Returns the file path on success, or an
 *  empty string if persistence failed (disk full, permission denied, etc.).
 *  A one-time warning is printed on the first failure; subsequent saves
 *  fail silently so the REPL isn't spammed every turn. The in-memory
 *  conversation is never affected by persistence failure. */
export declare function saveSession(conversation: Conversation, title?: string): string;
/** Load a session from disk. Returns null if not found. */
export declare function loadSession(id: string): SessionFile | null;
/** Restore a Conversation object from a saved session. */
export declare function restoreConversation(session: SessionFile, tools: Array<{
    name: string;
    description?: string;
    input_schema: Record<string, unknown>;
}>): Conversation;
/** List all saved sessions, newest first. */
export declare function listSessions(): SessionFile[];
/** Delete a saved session. Returns true if deleted. */
export declare function deleteSession(id: string): boolean;
/** Add a tag to a saved session. Returns false if session not found or tag already exists. */
export declare function addSessionTag(id: string, tag: string): boolean;
/** Remove a tag from a saved session. Returns false if session not found or tag not present. */
export declare function removeSessionTag(id: string, tag: string): boolean;
/** Get tags for a session. */
export declare function getSessionTags(id: string): string[];
/** Find sessions by tag. */
export declare function findSessionsByTag(tag: string): SessionFile[];
/** Branch (deep copy) a session. Returns the new session ID. */
export declare function branchSession(id: string, branchName?: string): string;
/** List branches of a session. */
export declare function listBranches(id: string): SessionFile[];
export interface CompressResult {
    originalMessages: number;
    compressedMessages: number;
    method: 'trim' | 'llm';
    backupPath: string;
}
/** Trim a session to keep only the last N turns. Creates a backup first. */
export declare function trimSessionTurns(id: string, keepLast?: number): CompressResult;
/** Compress a session using LLM summarization. */
export declare function compressSessionWithLLM(id: string, proxyUrl: string, model: string, keepLast?: number): Promise<CompressResult>;
/** Rename a session title. */
export declare function renameSession(id: string, newTitle: string): boolean;
/** Get the sessions directory path (for testing). */
export declare function getSessionsDir(): string;
