from __future__ import annotations

from collections.abc import Sequence

from app.domain.observability import SystemEvent


class SystemEventRepository:
    """Temporary event repository for runtime/system telemetry."""

    _events: list[SystemEvent] = []

    async def add(self, event: SystemEvent) -> SystemEvent:
        self._events.append(event)
        return event

    async def list_recent(self, limit: int = 100) -> Sequence[SystemEvent]:
        return self._events[-limit:]

