from __future__ import annotations

from pathlib import Path
import sys

ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "scripts"))

from runtime import load_role_names, load_role_config, build_meeting_plan


def test_load_role_names_contains_real_powell() -> None:
    names = load_role_names()
    assert "real_powell" in names
    assert len(names) >= 1


def test_load_role_config_real_powell() -> None:
    cfg = load_role_config("real_powell")
    assert cfg.name == "real_powell"
    assert "Powell" in cfg.role
    assert cfg.system_prompt


def test_build_meeting_plan_defaults() -> None:
    plan = build_meeting_plan(topic="Test topic", roles=["real_powell"], context="Some context")
    assert plan.topic == "Test topic"
    assert plan.roles == ["real_powell"]
    assert plan.context == "Some context"
    assert plan.max_rounds == 10
