/** * Memory Journal MCP Server - Analytics Digest * * Computes and persists analytical snapshots for proactive insight surfacing. * Uses the same SQL patterns as statistics.ts and importance.ts. */ import type { Database } from 'better-sqlite3'; /** A single stale project entry */ export interface StaleProject { projectNumber: number; lastEntryDate: string; daysSilent: number; } /** A top-importance entry summary */ export interface TopImportanceEntry { id: number; score: number; preview: string; } /** Full digest snapshot structure */ export interface DigestSnapshot { computedAt: string; currentPeriodEntries: number; previousPeriodEntries: number; activityGrowthPercent: number | null; currentPeriodSignificant: number; historicalAvgSignificant: number; significanceMultiplier: number | null; staleProjects: StaleProject[]; currentRelDensity: number; previousRelDensity: number; topImportanceEntries: TopImportanceEntry[]; } /** * Compute a full DigestSnapshot from the database. * All queries are synchronous (better-sqlite3) and individually lightweight. */ export declare function computeDigest(db: Database, workspaceId?: string): DigestSnapshot; /** * Save an analytics snapshot to the database. * Returns the inserted row ID. */ export declare function saveAnalyticsSnapshot(db: Database, type: string, data: Record): number; /** * Get the latest analytics snapshot of a given type. */ export declare function getLatestAnalyticsSnapshot(db: Database, type: string): { id: number; createdAt: string; data: Record; } | null; /** * Get multiple analytics snapshots of a given type (for historical comparison). */ export declare function getAnalyticsSnapshots(db: Database, type: string, limit?: number): { id: number; createdAt: string; data: Record; }[]; //# sourceMappingURL=digest.d.ts.map