#!/usr/bin/env bash
# Kimi usage collector (local Playwright, no SSH needed)
# Called from crontab (every 10 min)
set -euo pipefail

LOG="/home/hmo/AgentsMeeting/gateway/logs/kimi_collect.log"
SCRIPT="/home/hmo/AgentsMeeting/gateway/scripts/usage_collector_kimi_local.py"
PY="/home/hmo/agentsmeeting-venv/bin/python3"

echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting local Kimi collection..." >> "$LOG"
"$PY" "$SCRIPT" >> "$LOG" 2>&1
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Done (rc=$?)" >> "$LOG"
