Files
task-team/scripts/weekly-report.sh
Admin 5751ab832f UI fix + Data Export + Weekly Report + WebSocket
- Header: groups+status on one row
- GET /auth/export-data (GDPR data download)
- Weekly AI report cron (Monday 8:00)
- WebSocket /ws endpoint (real-time notifications)
- @fastify/websocket installed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 00:17:57 +00:00

16 lines
849 B
Bash
Executable File

#!/bin/bash
# AI Weekly Report — runs every Monday 8:00 AM
export ANTHROPIC_API_KEY="$(grep ANTHROPIC_API_KEY /opt/task-team/api/.env | cut -d= -f2)"
# Get task stats
STATS=$(curl -s http://localhost:3000/api/v1/system/health | python3 -c "import sys,json; d=json.load(sys.stdin); print(json.dumps(d.get(tasks,{})))" 2>/dev/null || echo "{}")
# Generate AI report
REPORT=$(curl -s -X POST http://localhost:3000/api/v1/chat \
-H "Content-Type: application/json" \
-d "{\"message\":\"Vytvor tydeni report. Stats: $STATS. Shrn co se podarilo, co je treba zlepsit, doporuceni na pristi tyden. Odpovez v cestine, strucne.\"}" | python3 -c "import sys,json; print(json.load(sys.stdin).get(data,{}).get(reply,No report))" 2>/dev/null || echo "Report generation failed")
# Log
echo "$(date): $REPORT" >> /var/log/taskteam-weekly.log
echo "$REPORT"