One render unit parsed from platforms.toml.
| 263 | |
| 264 | @dataclass(frozen=True) |
| 265 | class Platform: |
| 266 | """One render unit parsed from platforms.toml.""" |
| 267 | |
| 268 | key: str |
| 269 | bucket: str |
| 270 | skill_dst: str |
| 271 | # split-only template inputs |
| 272 | core: str | None = None |
| 273 | refs_dst: str | None = None |
| 274 | name: str = "graphify" |
| 275 | description: str | None = None |
| 276 | trigger: str | None = None # removed — not part of Agent Skills spec (#1180) |
| 277 | dispatch: str | None = None |
| 278 | extraction: str = "verbose" |
| 279 | shell: str = "posix" |
| 280 | claude_md: bool = False |
| 281 | hooks_variant: str = "claude-md" |
| 282 | extra_sections: tuple[str, ...] = () |
| 283 | # monolith-only inputs |
| 284 | monolith: str | None = None |
| 285 | roundtrip_ref: str | None = None |
| 286 | |
| 287 | def reference_sources(self) -> dict[str, str]: |
| 288 | """Resolve the rendered-name -> source-fragment map for this split platform.""" |
| 289 | refs = dict(_SHARED_REFERENCES) |
| 290 | refs["extraction-spec"] = _EXTRACTION_SOURCE[self.extraction] |
| 291 | refs["query"] = _QUERY_REFERENCE |
| 292 | refs["hooks"] = _HOOKS_SOURCE[self.hooks_variant] |
| 293 | return refs |
| 294 | |
| 295 | @property |
| 296 | def hooks_target(self) -> str: |
| 297 | """The prose file name the lean-core hooks pointer names for this host.""" |
| 298 | return _HOOKS_TARGET[self.hooks_variant] |
| 299 | |
| 300 | |
| 301 | def load_platforms() -> dict[str, Platform]: |