@echo off
REM Check current status of ClaudeTools API on RMM server

echo ============================================================
echo ClaudeTools API Status Check
echo ============================================================
echo.

echo [1] API Service Status:
plink guru@172.16.3.30 "sudo systemctl status claudetools-api --no-pager | head -15"
echo.

echo [2] Current Code Version (checking for search_term parameter):
plink guru@172.16.3.30 "grep -c 'search_term.*Query' /opt/claudetools/api/routers/conversation_contexts.py"
echo (0 = OLD CODE, 1+ = NEW CODE)
echo.

echo [3] File Last Modified:
plink guru@172.16.3.30 "ls -lh /opt/claudetools/api/routers/conversation_contexts.py"
echo.

echo [4] API Response Format:
python -c "import requests; jwt='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJpbXBvcnQtc2NyaXB0Iiwic2NvcGVzIjpbImFkbWluIiwiaW1wb3J0Il0sImV4cCI6MTc3MTI3NTEyOX0.-DJF50tq0MaNwVQBdO7cGYNuO5pQuXte-tTj5DpHi2U'; r=requests.get('http://172.16.3.30:8001/api/conversation-contexts/recall', headers={'Authorization': f'Bearer {jwt}'}, params={'limit': 1}); print(f'Response keys: {list(r.json().keys())}'); print('Format: NEW' if 'contexts' in r.json() else 'Format: OLD')"
echo.

echo ============================================================
pause
