/** * Session Manager for Claude-Flow Memory Integration * SMI-641: Session ID Storage in Claude-Flow Memory * SMI-1518: V3 API Migration - Use direct API calls instead of spawn * SMI-2741: Split to meet 500-line standard * * Manages session lifecycle with persistent storage in claude-flow memory * to enable context restoration across sessions. */ import type { SessionData, Checkpoint } from './SessionContext.js'; import type { CommandExecutor, SessionOptions } from './SessionManager.types.js'; export type { CommandExecutor, MemoryResult, SessionOptions } from './SessionManager.types.js'; export { DefaultCommandExecutor } from './SessionManager.helpers.js'; export { storeMemoryEntry, retrieveMemoryEntry, deleteMemoryEntry, runPreTaskHook, runPostTaskHook, } from './SessionManager.memory.js'; /** * Session Manager for claude-flow memory integration * * Provides session lifecycle management: * - Start sessions with unique IDs * - Create checkpoints for recovery points * - End sessions with cleanup * - Recover sessions from memory * * Thread Safety: * - Uses mutex lock for concurrent operations (SMI-675) * - Implements rollback on partial failures (SMI-676) */ export declare class SessionManager { private executor; private currentSession; /** * Mutex lock for serializing session modifications * Prevents race conditions when multiple operations run concurrently */ private sessionLock; constructor(executor?: CommandExecutor); /** * Execute a function with exclusive access to session state * Serializes concurrent operations to prevent race conditions */ private withLock; /** * Generate a unique session ID using crypto.randomUUID (per standards.md ยง4.8) */ generateSessionId(): string; /** * Start a new session and store in claude-flow memory */ startSession(options?: SessionOptions): Promise; /** * Create a checkpoint in the current session * * SMI-675: Uses mutex lock to prevent race conditions * SMI-676: Stores checkpoint memory FIRST, rolls back on failure */ createCheckpoint(description: string): Promise; /** * Record a modified file in the current session * SMI-675: Uses mutex lock to prevent race conditions */ recordFileModified(filePath: string): Promise; /** * End the current session */ endSession(): Promise; /** * Get the current active session */ getCurrentSession(): SessionData | null; /** * Retrieve a session from memory by ID */ getSession(sessionId: string): Promise; /** * Get the ID of the current session from memory */ getCurrentSessionId(): Promise; /** * Store session data in claude-flow memory */ private storeSession; /** * Set the current session pointer */ private setCurrentSession; /** * Clear the current session pointer */ private clearCurrentSession; } //# sourceMappingURL=SessionManager.d.ts.map