Parse platforms.toml into Platform records, keyed by platform name.
()
| 299 | |
| 300 | |
| 301 | def load_platforms() -> dict[str, Platform]: |
| 302 | """Parse platforms.toml into Platform records, keyed by platform name.""" |
| 303 | data = tomllib.loads(PLATFORMS_TOML.read_text(encoding="utf-8")) |
| 304 | out: dict[str, Platform] = {} |
| 305 | for key, cfg in data.get("platform", {}).items(): |
| 306 | out[key] = Platform( |
| 307 | key=key, |
| 308 | bucket=cfg["bucket"], |
| 309 | skill_dst=cfg["skill_dst"], |
| 310 | core=cfg.get("core"), |
| 311 | refs_dst=cfg.get("refs_dst"), |
| 312 | name=cfg.get("name", "graphify"), |
| 313 | description=cfg.get("description"), |
| 314 | trigger=cfg.get("trigger"), |
| 315 | dispatch=cfg.get("dispatch"), |
| 316 | extraction=cfg.get("extraction", "verbose"), |
| 317 | shell=cfg.get("shell", "posix"), |
| 318 | claude_md=bool(cfg.get("claude_md", False)), |
| 319 | hooks_variant=cfg.get("hooks_variant", "claude-md"), |
| 320 | extra_sections=tuple(cfg.get("extra_sections", [])), |
| 321 | monolith=cfg.get("monolith"), |
| 322 | roundtrip_ref=cfg.get("roundtrip_ref"), |
| 323 | ) |
| 324 | return out |
| 325 | |
| 326 | |
| 327 | def _read_fragment(rel: str) -> str: |