/** * session command - Session tracking and external change detection * * Tracks session start/end times and detects files changed outside of sessions. * This enables: * - "What did we do last session?" queries using time filtering * - Automatic detection of externally modified files that need re-indexing */ import { type SchedulerResult } from './global/global-scheduler.js'; export interface SessionParams { path: string; } export interface SessionInfo { lastSessionStart: number | null; lastSessionEnd: number | null; currentSessionStart: number | null; } export interface ChangedFile { path: string; reason: 'modified' | 'deleted' | 'new'; } export interface UpdateInfo { previousVersion: string; currentVersion: string; highlights: string[]; } export interface EmbeddingsSessionStatus { enabled: boolean; modelId: string | null; totalEmbeddings: number; filesChangedSince: number; lastFullEmbedAt: number | null; /** "stale", "drifting", "fresh", null when not enabled */ health: 'stale' | 'drifting' | 'fresh' | null; /** Suggestion text shown to the user/AI ("consider re-indexing", etc.) */ hint: string | null; /** Welcome banner for the first session after install/update (null otherwise). */ updateBanner: string | null; } export interface SessionResult { success: boolean; isNewSession: boolean; sessionInfo: SessionInfo; externalChanges: ChangedFile[]; reindexed: string[]; note: string | null; updateInfo: UpdateInfo | null; schedulerResult: SchedulerResult | null; embeddings?: EmbeddingsSessionStatus; error?: string; } /** * Start or continue a session. * - If new session: detect external changes, store previous session times * - Always: update session_end timestamp */ export declare function session(params: SessionParams): SessionResult; /** * Update session heartbeat (call periodically during session) */ export declare function updateSessionHeartbeat(projectPath: string): void; /** * Get session info without starting/updating */ export declare function getSessionInfo(projectPath: string): SessionInfo | null; /** * Format session time for display */ export declare function formatSessionTime(timestamp: number | null): string; /** * Format duration between two timestamps */ export declare function formatDuration(startMs: number, endMs: number): string; //# sourceMappingURL=session.d.ts.map