INNER CODE UNIT · Python
load_json
softaworks/agent-toolkit · scripts/build_plugins.py:29
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")
def extract_paths(plugin: dict) -> list[tuple[str, str]]:
"""Extract (source_path, type) pairs from a plugin entry.
Returns list of (relative_path, component_type) where component_type
is 'skill_dir', 'agent_file', or 'command_file'.