/** * Shared shapes between the index engine (search-core) and hydration (hydrate). * Keep this file types-only. */ /** A hydrated message returned by windows/read. */ export interface WindowMessage { entryId: string; role: string; content: string; timestamp: string; /** True when this message is the anchor of a scroll window. */ anchor?: boolean; } /** Metadata row for BROWSE mode (served from the index tables, not JSONL). */ export interface SessionRow { path: string; cwd: string; name?: string; startedAt?: string; preview?: string; } /** Indexed metadata selected for pattern-miner preparation. */ export interface PreparationSessionRow extends SessionRow { /** Stable one-hop fork identity used to avoid duplicate evidence. */ lineageId: string; } /** One metadata-only FTS discovery hit. */ export interface SearchHit { path: string; snippet: string; /** BM25 rank position (0 = best). */ rank: number; matchMessageId: string; role: string; timestamp: string; /** Session metadata joined from the sessions table. */ cwd?: string; name?: string; startedAt?: string; } export interface SyncResult { filesProcessed: number; /** Changed files still unindexed after this pass, including failures. */ backlogRemaining: number; /** False when the filesystem walk could not fully enumerate the tree — * indexed-but-unseen paths were NOT purged and results may be stale. */ walkComplete: boolean; }