| 7 | |
| 8 | |
| 9 | def _keys_semantics(value: object) -> dict[str, str] | None | str | None: |
| 10 | # Align to MASFactory Visualizer static parser semantics: |
| 11 | # - None -> null (inherit all keys) |
| 12 | # - {} -> "empty" (explicitly no keys) |
| 13 | # - {..} -> dict |
| 14 | if value is None: |
| 15 | return None |
| 16 | if isinstance(value, dict): |
| 17 | if len(value) == 0: |
| 18 | return "empty" |
| 19 | # keep as-is (usually key->description) |
| 20 | return {str(k): "" if v is None else str(v) for k, v in value.items()} |
| 21 | return None |
| 22 | |
| 23 | |
| 24 | def _safe_obj(value: object) -> object: |