/** * SUTRA-5.1 — watch mode: debounced re-scan on file changes. * Re-runs static scan only — not a runtime monitor. */ import { type SutraGraph } from "./types.js"; export interface ScanTimings { walkMs: number; parseMs: number; checksMs: number; writeMs: number; totalMs: number; } export interface ScanPipelineOptions { profile?: boolean; onProfile?: (timings: ScanTimings) => void; } export interface ScanPipelineResult { graph: SutraGraph; graphPath: string; diffSummary?: string; profile?: ScanTimings; flowStats?: { confirmed: number; candidate: number; }; cacheStats?: { hits: number; misses: number; }; } export interface WatchOptions { repoRoot: string; cwd: string; commit: string; debounceMs?: number; onRescan?: (result: ScanPipelineResult) => void; } /** Run full scan pipeline and write graph.json. Optionally snapshots prev + diff. */ export declare function runScanPipeline(repoRoot: string, cwd: string, commit: string, options?: ScanPipelineOptions): ScanPipelineResult; /** Collect watchable source files under repoRoot. */ export declare function collectWatchFiles(repoRoot: string): string[]; /** Debounced watch — returns cleanup function. Exported for testing via onRescan callback. */ export declare function startWatch(opts: WatchOptions): () => void;