/** * Tree-based deduplication for Claude Code session files with fork support. * * Unlike the linear chain approach, this handles cases where conversations * can fork into multiple branches from any point. */ import type { SessionData, SessionNode, SessionTreesResult, LatestSession, SessionMessage } from '@shared/claude/types'; /** * Extract all message UUIDs and content from a session file */ export declare function extractSessionData(filepath: string): Promise; /** * Determine parent-child relationships between sessions */ export declare function findSessionRelationships(sessionsData: SessionData[]): { relationships: Map; children: Map>; }; /** * Build a tree structure from the relationships */ export declare function buildSessionTree(sessionsData: SessionData[], relationships: Map, children: Map>): SessionNode[]; /** * Get session trees with full metadata */ export declare function getSessionTreesJSON(directory?: string): Promise; /** * Get only the latest sessions (all leaf nodes from all trees) * Returns an array of latest sessions, handling forks by including all branch endpoints */ export declare function getLatestSessions(directory?: string): Promise; /** * Get all messages for a specific session * @param projectName - The encoded project name (e.g., "-Users-username-repos-project") * @param sessionId - The UUID of the session to load messages for * @param baseDir - Optional base directory (defaults to ~/.claude/projects) * @returns Array of session messages sorted by timestamp */ export declare function getSessionMessages(projectName: string, sessionId: string, baseDir?: string): Promise; /** * Get the latest descendant session ID for a given session in a project. * If the session has no descendants, returns the input session ID. * * @param projectName - The encoded project name (e.g., "-Users-username-repos-project") * @param sessionId - The UUID of the session to find descendants for * @param baseDir - Optional base directory (defaults to ~/.claude/projects) * @returns The session ID of the most recently updated descendant (or the input sessionId if no descendants) */ export declare function getLatestDescendant(projectName: string, sessionId: string, baseDir?: string): Promise; //# sourceMappingURL=sessions.d.ts.map