INNER CODE UNIT · Python

get_root

softaworks/agent-toolkit · scripts/build_plugins.py:23

def get_root() -> Path:
    """Get the project root directory."""
    script_dir = Path(__file__).parent
    return script_dir.parent


def load_json(path: Path) -> dict:
    """Load a JSON file."""
    with open(path, "r") as f:
        return json.load(f)


def save_json(path: Path, data: dict) -> None:
    """Save a JSON file with proper formatting."""
    with open(path, "w") as f:
        json.dump(data, f, indent=2)
        f.write("\n")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…