Validate plugin structure (backward compatibility).
(plugin_name: str)
| 198 | |
| 199 | # Backward compatibility - expose the old plugin system functions |
| 200 | def validate_plugin_structure(plugin_name: str) -> dict[str, bool]: |
| 201 | """Validate plugin structure (backward compatibility).""" |
| 202 | config = get_plugin_config(plugin_name) |
| 203 | plugin_path = config.get("plugin_path", "") |
| 204 | |
| 205 | if not plugin_path: |
| 206 | return {"exists": False} |
| 207 | |
| 208 | # Convert module path to file path for validation |
| 209 | try: |
| 210 | module_parts = plugin_path.split(".") |
| 211 | if len(module_parts) >= 3 and module_parts[0] == "workers": |
| 212 | # e.g. workers.plugins.manual_review -> workers/plugins/manual_review |
| 213 | plugin_dir = Path(__file__).parent / "/".join(module_parts[1:]) |
| 214 | |
| 215 | return { |
| 216 | "exists": plugin_dir.exists(), |
| 217 | "has_init": (plugin_dir / "__init__.py").exists(), |
| 218 | "has_client": (plugin_dir / "client.py").exists(), |
| 219 | "has_tasks": (plugin_dir / "tasks.py").exists(), |
| 220 | "has_dto": (plugin_dir / "dto.py").exists(), |
| 221 | "has_readme": (plugin_dir / "README.md").exists(), |
| 222 | } |
| 223 | except Exception: |
| 224 | pass |
| 225 | |
| 226 | return {"exists": False} |
| 227 | |
| 228 | |
| 229 | __all__ = [ |
no test coverage detected