from __future__ import annotations

from pathlib import Path


def ensure_data_dirs(home: Path) -> dict[str, Path]:
    dirs = {
        "root": home,
        "brainstem": home / "brainstem",
        "left": home / "left",
        "cerebellum": home / "cerebellum",
        "hippocampus": home / "hippocampus",
        "state": home / "state",
        "sync": home / "sync",
    }
    for d in dirs.values():
        d.mkdir(parents=True, exist_ok=True)
    meta = home / "meta.json"
    if not meta.exists():
        meta.write_text('{"version": "0.1.0"}\n', encoding="utf-8")
    return dirs
