export type BrvState = "dreaming" | "curating" | "idle"; /** * Walk up from `startCwd` looking for a `.brv` directory. * Returns the absolute path to `.brv` when found, or undefined when no * ancestor contains one. Closest match wins. */ export declare function findBrvDir(startCwd: string): string | undefined; /** * Inspect the daemon's persisted activity and classify the project state. * Pure filesystem inspection — no daemon RPC. * * Two storage locations are checked because the daemon writes them in * different baseDirs (project-local vs global): * - dream-log + dream.lock → `/dream-log/`, `/dream.lock` * - curate-log → `/curate-log/` * * Precedence (confident signals first, weak signals last): * 1. dream-log latest === "processing" → dreaming (confident) * 2. curate-log latest === "processing" → curating (confident) * 3. dream.lock present, fresh, log isn't "completed" → dreaming (weak fallback) * 4. otherwise → idle * * Confident signals (active log entries) outrank the weak dream.lock fallback * so that an active curate isn't masked by a stale dream.lock. Real concurrent * dream + curate is preserved (rule 1 wins). Stale-lock false-positives are * bounded by `STALE_LOCK_THRESHOLD_MS`. * * `cwd` is needed to resolve the daemon's per-project storage directory; it * defaults to the parent of `brvDir` (the project root). */ export declare function detectState(brvDir: string, cwd?: string): BrvState;