/** * Session lifecycle management */ import type { SessionCreateOptions, SessionResumeOptions, SessionSummary } from '../types/session.types.js'; import type { SessionStore } from './store.js'; import { SessionContextManager } from './context.js'; export declare class SessionLifecycle { private currentSession; private lastPersistSessionId; private lastPersistTime; private persistTimer; private store; constructor(store: SessionStore); /** * Determine if we should use extended debounce for rapid same-session commands */ private shouldUseExtendedDebounce; /** * Create a new session */ create(options?: SessionCreateOptions): Promise; /** * Resume an existing session * Attempts to load snapshot first for essential context, then loads full session */ resume(options: SessionResumeOptions): Promise; /** * Get or create session */ getOrCreate(sessionId?: string): Promise; /** * Persist current session with debouncing for performance * @param immediate - If true, persist immediately; if false, debounce the persistence (fire-and-forget) */ persist(immediate?: false): void; persist(immediate: true): Promise; /** * Persist current session immediately (no debouncing) */ private persistImmediate; /** * Complete current session */ complete(): Promise; /** * Fail current session */ fail(error?: string): Promise; /** * Pause current session */ pause(): Promise; /** * Get current session */ getCurrentSession(): null | SessionContextManager; /** * Has active session */ hasActiveSession(): boolean; /** * Get recent session or create new one */ getRecentOrCreate(): Promise; /** * List all sessions */ listSessions(): Promise; /** * Archive old sessions */ archiveOldSessions(daysOld?: number): Promise; /** * Cleanup old sessions */ cleanupOldSessions(daysOld?: number): Promise; /** * Delete a session */ deleteSession(sessionId: string): Promise; /** * Flush any pending debounced persistence * Should be called before destroying the SessionLifecycle instance */ flushPendingPersistence(): Promise; } //# sourceMappingURL=lifecycle.d.ts.map