#!/bin/bash
# NotebookLM Auth Checker
# Verifies if NotebookLM MCP authentication is valid

AUTH_FILE="$HOME/.notebooklm-mcp/auth.json"

echo "🔐 NotebookLM Auth Check"
echo "======================="

if [ ! -f "$AUTH_FILE" ]; then
    echo "❌ Not authenticated"
    echo "Run: notebooklm-mcp-auth"
    exit 1
fi

FILE_AGE=$((($(date +%s) - $(stat -f%m "$AUTH_FILE" 2>/dev/null || stat -c%Y "$AUTH_FILE")) / 3600))

echo "✅ Auth file found"
echo "📅 Age: $FILE_AGE hours"

if [ $FILE_AGE -gt 24 ]; then
    echo "⚠️  Auth >24h old, consider refreshing"
else
    echo "✅ Auth is recent"
fi

echo ""
echo "Test: mcp_notebooklm_notebook_list()"
