24 lines
690 B
Python
24 lines
690 B
Python
"""Plugin platform HTTP surface (SPEC §11).
|
|||
|
|
|
||
|
|
Currently just the aggregated UI manifest the frontend loader fetches on boot.
|
||
|
|
Individual plugin routers are mounted separately at ``/api/plugins/{name}`` by
|
||
|
|
:func:`app.plugins.loader.mount_routers`.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any
|
||
|
|
|
||
|
|
from fastapi import APIRouter
|
||
|
|
|
||
|
|
from app.identity.deps import CurrentUser
|
||
|
|
from app.plugins import loader
|
||
|
|
|
||
|
|
router = APIRouter(prefix="/plugins", tags=["plugins"])
|
||
|
|
|
||
|
|
|
||
|
|
@router.get("/ui-manifest")
|
||
|
|
async def ui_manifest(user: CurrentUser) -> dict[str, Any]:
|
||
|
|
"""Slots, pages, and capabilities declared by all installed plugins (SPEC §11.3)."""
|
||
|
|
return loader.build_ui_manifest()
|