import yaml, json
from pathlib import Path

SCENARIO_DIR = Path("scenarios")
SCENARIO_DIR.mkdir(exist_ok=True)

def load_scenarios():
    scenarios = {}
    for file in SCENARIO_DIR.glob("*.yaml"):
        data = yaml.safe_load(file.read_text(encoding="utf-8"))
        scenarios[data["id"]] = data
    for file in SCENARIO_DIR.glob("*.json"):
        data = json.loads(file.read_text(encoding="utf-8"))
        scenarios[data["id"]] = data
    return scenarios
