/** * Story 1.5 — incremental scan cache (content-hash per file). * Stores per-file node/edge contributions under .sutra/cache/index.json. */ import { type SutraEdge, type SutraNode } from "./types.js"; export declare const CACHE_VERSION = 1; export declare const CACHE_DIR = "cache"; export declare const CACHE_INDEX = "index.json"; export interface CacheEntry { contentHash: string; graphVersion: number; cacheVersion: number; nodes: SutraNode[]; edges: SutraEdge[]; } export interface CacheIndex { cacheVersion: number; entries: Record; } export interface CacheStats { hits: number; misses: number; } export declare function hashContent(content: string | Buffer): string; export declare function cacheIndexPath(cacheRoot: string): string; /** Read cache index; returns empty index on missing/corrupt/version mismatch. Never throws. */ export declare function loadCache(cacheRoot: string): CacheIndex; /** Write cache index with key-sorted entries for byte stability. */ export declare function saveCache(cacheRoot: string, index: CacheIndex): void; export declare function isCacheHit(entry: CacheEntry | undefined, contentHash: string): boolean; export declare function sortNodes(nodes: SutraNode[]): SutraNode[]; export declare function sortEdges(edges: SutraEdge[]): SutraEdge[];