Files

62 lines
2.0 KiB
Python

#!/usr/bin/env python3
"""Hermes environment diagnostic utility - quick inspection of key systems."""
import os
import sys
import json
from pathlib import Path
def check_hermes_profile():
"""Check Hermes profile directory."""
profile_path = Path("/root/.hermes/profiles/spark")
if profile_path.exists():
dirs = list(profile_path.iterdir())
return {"exists": True, "items": len(dirs), "skills_count": len([d for d in dirs if d.is_dir() and d.name != "__pycache__"])}
return {"exists": False}
def check_hermes_skills():
"""Count available skills."""
skills_path = Path("/root/.hermes/profiles/spark/skills")
if skills_path.exists():
skill_dirs = [d for d in skills_path.iterdir() if d.is_dir()]
return {"exists": True, "count": len(skill_dirs)}
return {"exists": False}
def check_file_structure():
"""Check key Hermes directories."""
paths = [
"/root/.hermes/profiles/spark/skills",
"/root/.hermes/profiles/spark/memories",
"/root/.hermes/profiles/spark/plugins",
"/root/.hermes/profiles/spark/cron",
"/root/.hermes/profiles/spark/scratch",
]
result = {}
for p in paths:
path = Path(p)
result[p] = {"exists": path.exists(), "is_dir": path.is_dir() if path.exists() else False}
return result
def check_python_env():
"""Check Python environment."""
return {
"python_version": sys.version.split()[0],
"executable": sys.executable,
}
def check_forge_token():
"""Check if FORGE_TOKEN is set."""
token = os.environ.get('FORGE_TOKEN', '')
return {"set": bool(token), "length": len(token)}
def main():
report = {
"hermes_profile": check_hermes_profile(),
"hermes_skills": check_hermes_skills(),
"file_structure": check_file_structure(),
"python_env": check_python_env(),
"forge_token": check_forge_token(),
}
print(json.dumps(report, indent=2))
if __name__ == "__main__":
main()