22 lines
758 B
Python
Executable File
22 lines
758 B
Python
Executable File
# [DEF:PluginsRouter:Module]
|
|
# @SEMANTICS: api, router, plugins, list
|
|
# @PURPOSE: Defines the FastAPI router for plugin-related endpoints, allowing clients to list available plugins.
|
|
# @LAYER: UI (API)
|
|
# @RELATION: Depends on the PluginLoader and PluginConfig. It is included by the main app.
|
|
from typing import List
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from ...core.plugin_base import PluginConfig
|
|
from ...dependencies import get_plugin_loader
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("", response_model=List[PluginConfig])
|
|
async def list_plugins(
|
|
plugin_loader = Depends(get_plugin_loader)
|
|
):
|
|
"""
|
|
Retrieve a list of all available plugins.
|
|
"""
|
|
return plugin_loader.get_all_plugin_configs()
|
|
# [/DEF:PluginsRouter:Module] |