_jsonfile.py
_jsonfile.pyBrowse 18 files
111 tokens
496 bytes
Token encoding: o200k_base
Snapshot 24fd22b
← Back to SKILL.md
1"""Tiny JSON read helper shared by the bot, process manager, node registry and node server."""2 3from __future__ import annotations4 5import json6from pathlib import Path7from typing import Any, Optional8 9 10def read_json(path: Path) -> Optional[Any]:11 """Parsed JSON from *path*, or None when missing/unreadable/malformed."""12 if not path.is_file():13 return None14 try:15 return json.loads(path.read_text(encoding="utf-8"))16 except (OSError, ValueError):17 return None18