/** * GraphReducer - Transforms event log into graph snapshot * * Implements a fold operation over the append-only event log * to produce the current state of the graph. * * All operations are pure and idempotent. */ import type { GraphEvent, GraphSnapshot, GraphStats } from '../../types/graph.js'; /** * Reduces an array of events into a snapshot * * @param events Array of graph events (must start with marker) * @param storeId Store identifier for snapshot metadata * @returns Result with snapshot or error */ export declare function reduceEventsToSnapshot(events: readonly GraphEvent[], storeId: string): { success: true; snapshot: GraphSnapshot; } | { success: false; error: string; }; /** * Parses JSONL content and reduces to snapshot * * @param jsonlContent Raw JSONL file content * @param storeId Store identifier * @returns Result with snapshot or error */ export declare function reduceJsonlToSnapshot(jsonlContent: string, storeId: string): { success: true; snapshot: GraphSnapshot; } | { success: false; error: string; }; /** * Calculates statistics from a snapshot */ export declare function calculateStats(snapshot: GraphSnapshot): GraphStats; /** * Merges a new snapshot into an existing one * Useful for incremental updates without full rebuild */ export declare function mergeSnapshots(existing: GraphSnapshot, updates: GraphSnapshot): GraphSnapshot; /** * Creates empty snapshot with just metadata */ export declare function createEmptySnapshot(storeId: string): GraphSnapshot; /** * Filters snapshot by entity types */ export declare function filterByEntityTypes(snapshot: GraphSnapshot, entityTypes: readonly string[]): GraphSnapshot; /** * Gets the line count from JSONL content */ export declare function getEventLineCount(jsonlContent: string): number; //# sourceMappingURL=GraphReducer.d.ts.map