utils/stats/stats_manager library
Statistics tracking and caching for Neomage sessions.
Ported from:
- neomage/src/utils/stats.ts (1061 LOC)
- neomage/src/utils/statsCache.ts (434 LOC)
Provides aggregation of session statistics, daily activity tracking, streak calculations, model usage tracking, and a disk-persisted cache to avoid reprocessing historical data.
Classes
- DailyActivity
- Daily activity aggregate for heatmap / trend display.
- DailyModelTokens
- Daily token usage per model for charts.
- ModelUsage
- Aggregated model usage.
- NeomageStats
-
Complete aggregated stats returned by
aggregateNeomageStats. - PersistedStatsCache
- Persisted stats cache stored on disk. Contains aggregated historical stats that won't change. All fields are bounded to prevent unbounded file growth.
- ProcessedStats
- Result of processing session files — intermediate stats that can be merged.
- ProcessOptions
- Options for processing session files.
- SessionStats
- Per-session aggregate.
- StatsManager
- Manages stats collection, caching, and aggregation.
- StreakInfo
- Streak calculation results.
Enums
- StatsDateRange
- Range filter for stats aggregation.
Constants
- statsCacheVersion → const int
- syntheticModel → const String