#!/usr/bin/env python3 """Verify Hermes cPanel Agent deployment and REST API availability.""" import json, sys, os def check_plugins(): """Verify plugin is installed and active via WP REST API.""" try: data = json.load(sys.stdin) except json.JSONDecodeError: return False, "Cannot parse WP REST API response" if isinstance(data, dict) and "code" in data: return False, f"WP API error: {data.get('message', str(data))}" if not isinstance(data, list): return False, f"Unexpected response: {type(data).__name__}" for p in data: if isinstance(p, dict) and p.get("textdomain") == "hermes-ai-bridge": status = p.get("status", "unknown") name = p.get("name", "?") ver = p.get("version", "?") return True, f"OK: {name} v{ver} status={status}" return False, "Plugin not found in WP plugins list" if __name__ == "__main__": ok, msg = check_plugins() print(msg) sys.exit(0 if ok else 1)