feat(MAT-174): Add cron job scheduler and executors

Cron package that syncs jobs from matrixhost portal API, schedules execution
with timezone-aware timing, and posts results to Matrix rooms. Includes
Brave Search, reminder, and browser scrape (placeholder) executors with
formatter. 31 pytest tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-03-16 09:31:19 +02:00
parent 21b8a4efb1
commit 4d8ea44b3d
15 changed files with 1009 additions and 0 deletions

20
cron/reminder.py Normal file
View File

@@ -0,0 +1,20 @@
"""Simple reminder executor for cron jobs."""
import logging
logger = logging.getLogger(__name__)
async def execute_reminder(job: dict, send_text, **_kwargs) -> dict:
"""Post a reminder message to a Matrix room."""
config = job.get("config", {})
message = config.get("message", "")
target_room = job["targetRoom"]
if not message:
return {"status": "error", "error": "No reminder message configured"}
text = f"\u23f0 **{job['name']}:** {message}"
await send_text(target_room, text)
return {"status": "success"}