init repo

This commit is contained in:
2026-04-25 19:25:22 +08:00
commit c7533eada2
50 changed files with 3732 additions and 0 deletions

22
app/middleware/base.py Normal file
View File

@@ -0,0 +1,22 @@
"""Middleware base class — before/after hooks around graph execution."""
from __future__ import annotations
from abc import ABC, abstractmethod
from app.graph.state import ReportState
class Middleware(ABC):
"""Base middleware. Subclasses override before() and/or after()."""
name: str = "base"
enabled: bool = True
async def before(self, state: ReportState) -> ReportState:
"""Called before graph execution. Modify state as needed."""
return state
async def after(self, state: ReportState) -> ReportState:
"""Called after graph execution. Modify state as needed."""
return state