Parse platforms.toml into Platform records, keyed by platform name.
()
| 347 | |
| 348 | |
| 349 | def load_platforms() -> dict[str, Platform]: |
| 350 | """Parse platforms.toml into Platform records, keyed by platform name.""" |
| 351 | data = tomllib.loads(PLATFORMS_TOML.read_text(encoding="utf-8")) |
| 352 | out: dict[str, Platform] = {} |
| 353 | for key, cfg in data.get("platform", {}).items(): |
| 354 | out[key] = Platform( |
| 355 | key=key, |
| 356 | bucket=cfg["bucket"], |
| 357 | skill_dst=cfg["skill_dst"], |
| 358 | core=cfg.get("core"), |
| 359 | refs_dst=cfg.get("refs_dst"), |
| 360 | name=cfg.get("name", "graphify"), |
| 361 | description=cfg.get("description"), |
| 362 | trigger=cfg.get("trigger"), |
| 363 | dispatch=cfg.get("dispatch"), |
| 364 | extraction=cfg.get("extraction", "verbose"), |
| 365 | shell=cfg.get("shell", "posix"), |
| 366 | claude_md=bool(cfg.get("claude_md", False)), |
| 367 | hooks_variant=cfg.get("hooks_variant", "claude-md"), |
| 368 | extra_sections=tuple(cfg.get("extra_sections", [])), |
| 369 | monolith=cfg.get("monolith"), |
| 370 | roundtrip_ref=cfg.get("roundtrip_ref"), |
| 371 | ) |
| 372 | return out |
| 373 | |
| 374 | |
| 375 | def _read_fragment(rel: str) -> str: |