/** * Session storage for takt * * Manages persona sessions and input history persistence. */ /** * Write file atomically using temp file + rename. * This prevents corruption when multiple processes write simultaneously. */ export declare function writeFileAtomic(filePath: string, content: string, mode?: number): void; /** Get path for storing input history */ export declare function getInputHistoryPath(projectDir: string): string; /** Maximum number of input history entries to keep */ export declare const MAX_INPUT_HISTORY = 100; /** Load input history */ export declare function loadInputHistory(projectDir: string): string[]; /** Save input history (atomic write) */ export declare function saveInputHistory(projectDir: string, history: string[]): void; /** Add an entry to input history */ export declare function addToInputHistory(projectDir: string, input: string): void; import type { PersonaSessionData } from '../types.js'; export type { PersonaSessionData }; /** Get path for storing persona sessions */ export declare function getPersonaSessionsPath(projectDir: string, storageDirectory?: string): string; /** Load saved persona sessions. Returns empty if provider has changed. */ export declare function loadPersonaSessions(projectDir: string, currentProvider?: string, storageDirectory?: string): Record; /** * Resolve persona session ID with provider-aware key fallback. * * Priority: * 1) "{persona}:{provider}" (collision-safe key) * 2) "{persona}" (legacy/simple key) */ export declare function resolvePersonaSessionId(sessions: Record, persona: string, provider?: string): string | undefined; /** Save persona sessions (atomic write) */ export declare function savePersonaSessions(projectDir: string, sessions: Record, provider?: string, storageDirectory?: string): void; /** * Update a single persona session atomically. * Uses read-modify-write with atomic file operations. */ export declare function updatePersonaSession(projectDir: string, persona: string, sessionId: string | undefined, provider?: string, storageDirectory?: string): void; /** Clear all saved persona sessions */ export declare function clearPersonaSessions(projectDir: string): void; /** Get the worktree sessions directory */ export declare function getWorktreeSessionsDir(projectDir: string, storageDirectory?: string): string; /** Encode a worktree path to a safe filename */ export declare function encodeWorktreePath(worktreePath: string): string; /** Get path for a worktree's session file */ export declare function getWorktreeSessionPath(projectDir: string, worktreePath: string, storageDirectory?: string): string; /** Load saved persona sessions for a worktree. Returns empty if provider has changed. */ export declare function loadWorktreeSessions(projectDir: string, worktreePath: string, currentProvider?: string, storageDirectory?: string): Record; /** Update a single persona session for a worktree (atomic) */ export declare function updateWorktreeSession(projectDir: string, worktreePath: string, personaName: string, sessionId: string | undefined, provider?: string, storageDirectory?: string): void; /** * Get the Claude CLI project session directory path. * Claude CLI stores sessions in ~/.claude/projects/{encoded-project-path}/ */ export declare function getClaudeProjectSessionsDir(projectDir: string): string; /** * Clear Claude CLI project sessions. * Removes all session files (*.jsonl) from the project's session directory. */ export declare function clearClaudeProjectSessions(projectDir: string): void; //# sourceMappingURL=sessionStore.d.ts.map