Verbrauch-Tab: Tokens/Kosten pro Pool und Projekt aus Transcripts

- usage_stats: streamt <pool>/projects/*/*.jsonl, zählt message.usage,
  Dedup über message.id+requestId, Zeitfilter (eigener RFC3339-Parser),
  Projektpfad-Mapping wie claudes Ordnerkodierung
- Preistabelle je Modell (Fable/Opus/Sonnet/Haiku, Cache 1.25x/0.1x),
  Kosten als API-Gegenwert ausgewiesen
- UI-Tab mit 7/30-Tage-Filter: Pool-Zeilen aggregiert, Projekte
  aufklappbar darunter, Summenzeile; i18n de/en
- Tests: Aggregation+Dedup+Zeitfilter, leerer Fall, parse_ts-Referenz
This commit is contained in:
marcus.hinz
2026-07-04 14:10:53 +02:00
parent 62ce802465
commit f8fcd8d033
5 changed files with 558 additions and 2 deletions
+32
View File
@@ -4,8 +4,24 @@ const de = {
app: {
projects: "Projekte",
pools: "Pools",
usage: "Verbrauch",
autostart: "Autostart",
},
usage: {
days7: "7 Tage",
days30: "30 Tage",
pool: "Pool",
project: "Projekt",
input: "Input",
output: "Output",
cacheWrite: "Cache ↑",
cacheRead: "Cache ↓",
cost: "≈ Kosten",
total: "Summe",
empty: "Keine Verbrauchsdaten im Zeitraum.",
estimateNote:
"API-Gegenwert aus den lokalen Transcripts — keine Abrechnung, Historie nur solange claude sie vorhält.",
},
projects: {
project: "Projekt",
pool: "Pool",
@@ -76,8 +92,24 @@ const en: typeof de = {
app: {
projects: "Projects",
pools: "Pools",
usage: "Usage",
autostart: "Autostart",
},
usage: {
days7: "7 days",
days30: "30 days",
pool: "Pool",
project: "Project",
input: "Input",
output: "Output",
cacheWrite: "Cache ↑",
cacheRead: "Cache ↓",
cost: "≈ cost",
total: "Total",
empty: "No usage data in this period.",
estimateNote:
"API equivalent from local transcripts — not a bill; history only as long as claude keeps it.",
},
projects: {
project: "Project",
pool: "Pool",