import type { CacheMetadataRepository } from "../../db/repositories/cacheMetadata.repository"; import type { ConversationsRepository } from "../../db/repositories/conversations.repository"; export interface ShouldRefreshOptions { /** Override the disk path checked for drift. Defaults to ~/.claude/projects. */ projectsDir?: string; /** Additional project roots (e.g. per-profile `configDir/projects`). */ projectsDirs?: string[]; } /** * Newest mtime across a projects root and its immediate child directories. * * POSIX directory mtime updates when direct entries are added/removed/renamed, * not when a file inside a child is appended. Checking one level of children * catches new JSONLs in an existing project without stating every file. */ export declare function maxProjectsTreeMtimeMs(projectsDir: string): number | null; /** * Decide whether the projects/conversations cache needs a refresh. * * Returns true when either: * 1. The cache has orphan rows — conversations with a project_path but no * project_id. These need a backfill pass to become visible to * /project-chats (which filters out null project_id). * 2. A watched projects tree on disk has changed since the last scanner pass — * max(root mtime, child-dir mtimes) is newer than * cache_metadata.conversations_last_indexed_at. This catches new JSONLs * that the file watcher missed (including under existing project dirs). * * Appends to existing JSONLs still rely on the directory watcher flipping * scannerStale; this mtime gate does not see in-place file growth. */ export declare function shouldRefreshProjectsFromHdd(conversationsRepo: ConversationsRepository, cacheMetadataRepo: CacheMetadataRepository, opts?: ShouldRefreshOptions): boolean; //# sourceMappingURL=shouldRefreshProjectsFromHdd.d.ts.map