| 1 | from helpers.api import ApiHandler |
| 2 | from flask import Request, Response |
| 3 | from agent import AgentContext |
| 4 | |
| 5 | |
| 6 | class NotificationsHistory(ApiHandler): |
| 7 | @classmethod |
| 8 | def requires_auth(cls) -> bool: |
| 9 | return True |
| 10 | |
| 11 | async def process(self, input: dict, request: Request) -> dict | Response: |
| 12 | # Get the global notification manager |
| 13 | notification_manager = AgentContext.get_notification_manager() |
| 14 | |
| 15 | # Return all notifications for history modal |
| 16 | notifications = notification_manager.output_all() |
| 17 | return { |
| 18 | "notifications": notifications, |
| 19 | "guid": notification_manager.guid, |
| 20 | "count": len(notifications), |
| 21 | } |