/** * Pipeline Cache (Layer 1) * * Per-run pipeline cache that stores outputs for each pipeline step. * Organized by input file with datetime and file hash for versioning. * * Directory structure: * ``` * chat-to-map/cache/chats//-/ * ├── chat.txt * ├── messages.json * ├── candidates.heuristics.json * ├── candidates.embeddings.json * ├── candidates.all.json * ├── scraped_urls.json * ├── classifications.json * └── place_lookups.json * ``` * * The sha256 is computed from the input file bytes (NOT content). */ type PipelineStage = 'chat' | 'messages' | 'parse_stats' | 'scan_stats' | 'filter_stats' | 'preview_stats' | 'preview_activities' | 'embed_stats' | 'scrape_stats' | 'scrape_metadata' | 'classify_stats' | 'place_lookup_stats' | 'resolve_links_stats' | 'resolved_links' | 'resolved_entities' | 'scrape_previews_stats' | 'scraped_previews' | 'fetch_images_stats' | 'candidates.heuristics' | 'candidates.embeddings' | 'candidates.all' | 'classifications' | 'place_lookups' | 'images'; interface PipelineRunMeta { inputFile: string; fileHash: string; createdAt: string; runDir: string; } /** * Calculate SHA256 hash of file bytes. */ export declare function hashFileBytes(filePath: string): string; /** * Pipeline cache for per-run stage outputs. */ export declare class PipelineCache { private readonly chatsDir; private currentRun; constructor(cacheDir: string); /** * Find or create a run for this input file. * Reuses existing run if hash matches, otherwise creates new. */ getOrCreateRun(inputFilename: string, fileHash: string): PipelineRunMeta; /** * Initialize a new pipeline run for an input file. * Creates the run directory based on datetime and file hash. */ initRun(inputFilename: string, fileHash: string): PipelineRunMeta; /** * Find the most recent run for a given input file and hash. * Returns null if no matching run exists. */ findLatestRun(inputFilename: string, fileHash: string): PipelineRunMeta | null; /** * Get the file path for a pipeline stage. */ private getStagePath; /** * Check if a pipeline stage has cached output. */ hasStage(stage: PipelineStage): boolean; /** * Get cached output for a pipeline stage. */ getStage(stage: PipelineStage): T | null; /** * Save output for a pipeline stage. */ setStage(stage: PipelineStage, data: T): void; /** * Get the current run directory. */ getRunDir(): string | null; /** * Get current run metadata. */ getCurrentRun(): PipelineRunMeta | null; /** * List all runs for an input file. */ listRuns(inputFilename: string): PipelineRunMeta[]; } export {}; //# sourceMappingURL=pipeline.d.ts.map