Refactor exporter into modules

This commit is contained in:
2026-07-09 10:21:37 +00:00
parent dc8aa26893
commit 43be027b5d
9 changed files with 821 additions and 720 deletions
+12
View File
@@ -0,0 +1,12 @@
from __future__ import annotations
import os
from pathlib import Path
from zoneinfo import ZoneInfo
SESSIONS_DIR = Path(os.environ.get("OPENCLAW_SESSIONS_DIR", "/root/.openclaw/agents/main/sessions"))
TIMEZONE = ZoneInfo(os.environ.get("OPENCLAW_EXPORTER_TZ", "Europe/Berlin"))
SESSIONS_INDEX_PATH = Path(os.environ.get("OPENCLAW_SESSIONS_INDEX", str(SESSIONS_DIR / "sessions.json")))
USAGE_COST_CACHE_PATH = Path(os.environ.get("OPENCLAW_USAGE_COST_CACHE", str(SESSIONS_DIR / ".usage-cost-cache.json")))
HISTORY_DAYS = max(1, int(os.environ.get("OPENCLAW_HISTORY_DAYS", "30")))
HISTORY_HOURS = max(1, int(os.environ.get("OPENCLAW_HISTORY_HOURS", "168")))