Spaces:
Sleeping
Sleeping
| from typing import Any, Dict, List | |
| from database.db import DatabaseManager | |
| from schemas.models import RegisterPluginRequest | |
| class PluginManager: | |
| """Dynamic Plugin Registry for Colony Extensions.""" | |
| def __init__(self, db: DatabaseManager): | |
| self.db = db | |
| async def register_plugin(self, req: RegisterPluginRequest) -> str: | |
| return await self.db.save_plugin(req.name, req.version, req.description, req.entry_point, req.permissions) | |
| async def list_plugins(self) -> List[Dict[str, Any]]: | |
| return await self.db.get_all_plugins() | |