import type { Project } from './project-types.js'; export interface ProjectStoreOptions { /** Overrideable for tests. Defaults to PROJECTS_DIR from @core/paths. */ projectsDir?: string; /** Disable fs.watch — for tests that manipulate dirs synchronously. Defaults to true. */ watchEnabled?: boolean; } export declare class ProjectStore { private readonly projectsDir; private readonly watchEnabled; private projects; private initialized; private watcher; private debounceTimer; constructor(opts?: ProjectStoreOptions); /** * Scan PROJECTS_DIR, scaffold general if absent, build cache, start watcher. * Idempotent — safe to call multiple times. */ initialize(): Promise; /** Return all known projects. Always includes "general". */ list(): Project[]; /** Look up a project by id. Returns undefined for unknown ids. */ get(id: string): Project | undefined; /** True if a project with the given id exists. */ exists(id: string): boolean; /** Return the "general" umbrella project. Always present. */ getDefault(): Project; /** * Resolve a project from a message string using heuristic patterns. * * Priority: * 1. [project:xxx] explicit tag — always wins * 2. Case-insensitive substring match against scanned project ids * (longest match wins when multiple project names appear in the message) * 3. 'general' fallback * * Returns the matching Project or the default general project. */ resolveFromMessage(msg: string | null | undefined): Project | null; /** Force a rescan of PROJECTS_DIR (e.g. after watcher event or manual trigger). */ refresh(): void; /** Stop the fs.watch watcher and release resources. */ destroy(): void; /** Create general/ scaffold if the directory does not exist. */ private scaffoldGeneral; /** Read PROJECTS_DIR and rebuild the in-memory cache. */ private scan; private makeGeneralProject; /** Watch PROJECTS_DIR for add/remove of subdirectories. */ private startWatcher; private debouncedRescan; } export declare const projectStore: ProjectStore;