ref(backend): Centralize deps and add mypy

Extract reusable API dependencies and activity logging helpers.\nAdd mypy configuration and dev dependency for type checking.\n\nCo-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Abhimanyu Saharan
2026-02-04 03:57:19 +05:30
parent 7fd079e4f1
commit b24e3e1dcd
12 changed files with 205 additions and 189 deletions

View File

@@ -0,0 +1,25 @@
from __future__ import annotations
from uuid import UUID
from sqlmodel import Session
from app.models.activity_events import ActivityEvent
def record_activity(
session: Session,
*,
event_type: str,
message: str,
agent_id: UUID | None = None,
task_id: UUID | None = None,
) -> ActivityEvent:
event = ActivityEvent(
event_type=event_type,
message=message,
agent_id=agent_id,
task_id=task_id,
)
session.add(event)
return event