Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AIBattery/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.8.5</string>
<string>1.9.0</string>
<key>CFBundleVersion</key>
<string>1.8.5</string>
<string>1.9.0</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>CFBundleIconFile</key>
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ Click the ✦ icon to open the dashboard:
| 📊 **Rate Limits** | 5-hour burst + 7-day sustained — utilization %, reset countdown, binding indicator, predictive time-to-limit |
| 🧠 **Context Health** | 5 most recent sessions with `< 1/5 >` chevron + swipe navigation |
| 🔤 **Tokens** | Per-model breakdown with input/output/cache read/cache write · optional API cost |
| 📈 **Insights** | Today's stats with trend arrow + projection, all-time stats with busiest day |
| 📉 **Activity** | Sparkline chart — 12H · 7D · 12M toggle |
| 📁 **Projects** | Per-project token usage with sort (tokens/cost/name), search, expand/collapse |
| 📉 **Activity** | Sparkline chart — 24H · 7D · 12M toggle · insight rows (All Time, Longest, Period) |

---

Expand Down Expand Up @@ -485,13 +485,13 @@ If it saves you time or helps you get more out of your Claude subscription, cons

## 🧪 Test Coverage

**624 tests** across 42 test files.
**638 tests** across 42 test files.

| Area | Tests | What's covered |
|------|-------|----------------|
| Models | 186 | Token summaries, project token summaries, compact cost formatting, rate limit parsing (predictive estimates, fresh window guard, unknown claim defaults, countdown formatter, throttled header parsing, per-window throttle detection, utilization clamping, past reset guard, threshold boundary), health status, metric modes, API profiles (org ID validation: empty, too long, special chars, hyphens/underscores), session entries (service_tier decode), account records, stats cache, usage snapshots (trends, busiest day, auto-resolved mode with priority tiers and edge cases, urgency score piecewise interpolation with midpoint verification and clamping, context health fallback chain, single-pass activity stats), model pricing (cache correctness for unknown models), health config |
| Models | 191 | Token summaries, project token summaries (id, display name, zero/large tokens, Other grouping, cost), compact cost formatting, rate limit parsing (predictive estimates, fresh window guard, unknown claim defaults, countdown formatter, throttled header parsing, per-window throttle detection, utilization clamping, past reset guard, threshold boundary), health status, metric modes, API profiles (org ID validation: empty, too long, special chars, hyphens/underscores), session entries (service_tier decode), account records, stats cache, usage snapshots (trends, busiest day, auto-resolved mode with priority tiers and edge cases, urgency score piecewise interpolation with midpoint verification and clamping, context health fallback chain, single-pass activity stats), model pricing (cache correctness for unknown models), health config |
| Services | 236 | Token ledger (high-water-mark merge, historical model restoration, per-account isolation, persistence, sort order, all token types, file size guard), version checker (semver comparison, tag stripping, cache behavior, force check, stale cache discard, persistence keys), Sparkle update service (automatic checks disabled, automatic downloads disabled, check interval zero, feed URL, singleton identity, canCheckForUpdates), notification manager (alert thresholds, alert key migration), token health monitor (band classification, warnings, anomalies, velocity, rapid consumption, custom config, idle session inclusion), status checker (severity ordering, incident escalation, known components catalog, status string parsing), status indicator (dot colors, label text), session log reader (entry decoding, makeUsageEntry, symlink boundary check), account store (multi-account CRUD, persistence, merge metadata preservation), stats cache reader (decode, caching, invalidation, full payload, file size guard, symlink boundary check, prefix traversal attack), usage aggregator (empty state, stats-only, JSONL-only, rate limit pass-through, model filtering, deduplication, stats+JSONL merge, all-time mode, redundant aggregation skip, hourly merge, peak hour update, totalMessages dedup, old model visibility, all-dates daily merge, todayHourCounts separation, project token grouping by cwd, nil-cwd grouping as Other, per-entry cost aggregation, empty project tokens, cross-session project merge), rate limit fetcher (cache expiry, stale marking, multi-account isolation, Retry-After parsing), OAuth manager (AuthError messages, transient error classification) |
| Views | 43 | Activity chart data transformations (daily 7-day generation, gap filling, chronological ordering, hourly 24-hour window, full-day coverage, month totals aggregation, invalid date handling, monthly 12-month generation, current-month projection, early-month projection skip, past-month no projection), activity trend computation (vs-yesterday positive/negative/same/nil, month change projection/nil/early-month, copy text formatting), session info formatter (label parts with project/branch/HEAD/empty, ID prefix truncation/nil/short, bottom parts with duration/velocity/fallback, stale idle detection by band/recency, detail tooltip content, time formatting just-now/minutes/today) |
| Views | 49 | Activity chart data transformations (daily 7-day generation, gap filling, chronological ordering, hourly 24-hour window, full-day coverage, month totals aggregation, invalid date handling, monthly 12-month generation, current-month projection, early-month projection skip, past-month no projection), activity trend computation (vs-yesterday positive/negative/same/nil, month change projection/nil/early-month, copy text formatting), session info formatter (label parts with project/branch/HEAD/empty, ID prefix truncation/nil/short, bottom parts with duration/velocity/fallback, stale idle detection by band/recency, detail tooltip content, time formatting just-now/minutes/today, copyable details with exact tokens/model/project/empty field omission) |
| ViewModels | 26 | UsageViewModel static helpers (refresh interval clamping, error message logic, adaptive polling data-change detection, throttle event recording with dedup + exhaustion detection, throttle count filtering + string timestamp parsing) |
| Utilities | 136 | Token formatter (K/M suffixes, boundaries), model name mapper (display names, versions, date stripping, result cache), Claude paths (suffixes, URLs), theme colors (standard + colorblind palettes, NSColor, semantic colors, danger), UserDefaults keys (prefix, uniqueness), date formatters (format strings, round-trips, locale pinning, date range formatting), adaptive polling state (threshold behavior, progressive doubling, caps, reset), secure networking (ephemeral session config, singleton, size limit, cookie policy, resource timeout), duration formatter (compact format, boundaries, 24h edge case, days/hours/minutes/seconds), menu bar icon (breathing animation, recovery sparkle effect, quantized caching, broken star fragments, pulse steps, cache identity, sparkle/broken/normal key isolation, context health colors), throttle tracker (transition detection, recovery-then-throttle, exhaustion detection, no double-count, timestamp parsing for doubles/strings/ints/mixed, append-and-prune with 30-day cutoff, count filtering) |

Expand Down