from fastapi import APIRouter from fastapi.responses import HTMLResponse from app.plugins import PLUGINS, Plugin from app.render import render router = APIRouter(prefix="/api/plugins", tags=["plugins"]) @router.get("") async def plugins_index(): """Render the Plugins tab: a skeleton fragment for every registered plugin. A plugin whose skeleton() raises gets an inline error card instead of taking down the whole page. Returns: The rendered plugins.html as an HTMLResponse. """ items: list[dict[str, Plugin | str]] = [] for p in PLUGINS: try: body = await p.skeleton() except Exception as e: # noqa body = f"