Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637"""Content hash of the packaged python tree.
The remote plugin stages a bundle under this hash, and a detached kernel andits bridge announce it, so the daemon can tell when a kernel runs older codethan the daemon's own tree."""
from __future__ import annotations
import osimport hashlibfrom pathlib import Path
ROOT = Path(__file__).resolve().parent
def digest(root: Path = ROOT) -> str: """Hash Python sources and the kernel requirements lock in path order.""" hasher = hashlib.sha256() files: list[Path] = [] for directory, dirs, names in os.walk(root): dirs[:] = [d for d in dirs if d != ".venv"] base = Path(directory) files.extend( base / n for n in names if n.endswith(".py") or (base == root and n in {"pyproject.toml", "uv.lock"}) ) for path in sorted(files): hasher.update(str(path.relative_to(root)).encode()) with path.open("rb") as source: # Keep the path/contents digest stable while bounding each read. while chunk := source.read(64 * 1024): hasher.update(chunk) return hasher.hexdigest()