import type { DatabaseSync } from "node:sqlite"; /** * full / incremental / reconcile indexer。 */ export interface IndexRunResult { scannedFiles: number; indexedSessions: number; skippedExcluded: number; chunksUpserted: number; dispositions: Record; } /** * setup:写入 root、标记 setup 完成并启用 indexing。 */ export declare function setupIndex(db: DatabaseSync, roots: Array<{ id: string; path: string; source: "agent-dir" | "runtime-session-dir" | "user-added"; }>): void; /** * 对已注册 roots 执行索引(尊重 exclusions 与 indexing_enabled)。 */ export declare function runIndex(db: DatabaseSync, options?: { rootPath?: string; forceFull?: boolean; }): IndexRunResult; /** * rebuild:lease + partial gate + 清空正文后强制全量。 */ export declare function rebuildIndex(db: DatabaseSync): IndexRunResult; /** * purge-index:清空正文并关闭 indexing/auto。 */ export declare function purgeIndexData(db: DatabaseSync): void; /** * 解析当前 cwd 的 project key(供 search scope=project)。 */ export declare function currentProjectKey(cwd?: string): string; /** * 索引单个 session 文件(供 extension 有界增量使用)。 */ export declare function indexSingleFile(db: DatabaseSync, filePath: string, options?: { rootId?: string; forceFull?: boolean; }): { indexed: boolean; disposition: string; chunksUpserted: number; sessionId: string | null; }; /** * 确保 runtime session dir 已注册为 root(路径已存在则只启用)。 */ export declare function ensureRuntimeSessionRoot(db: DatabaseSync, sessionDir: string): void; //# sourceMappingURL=indexer.d.ts.map