from session_hub_fastapi.models.session_hub import (
    HostInfo,
    MessageRow,
    MessageSearchResult,
    SessionDetail,
    SessionRow,
    SessionSearchResult,
    Stats,
)

from session_hub_core.models import (
    HostInfo as CoreHostInfo,
)
from session_hub_core.models import (
    MessageRow as CoreMessageRow,
)
from session_hub_core.models import (
    MessageSearchResult as CoreMessageSearchResult,
)
from session_hub_core.models import (
    SessionDetail as CoreSessionDetail,
)
from session_hub_core.models import (
    SessionRow as CoreSessionRow,
)
from session_hub_core.models import (
    SessionSearchResult as CoreSessionSearchResult,
)
from session_hub_core.models import (
    Stats as CoreStats,
)


def session_row(row: CoreSessionRow) -> SessionRow:
    return SessionRow(**row.model_dump())


def session_detail(detail: CoreSessionDetail) -> SessionDetail:
    return SessionDetail(**detail.model_dump())


def message_row(message: CoreMessageRow) -> MessageRow:
    return MessageRow(**message.model_dump())


def message_search_result(result: CoreMessageSearchResult) -> MessageSearchResult:
    return MessageSearchResult(**result.model_dump())


def session_search_result(result: CoreSessionSearchResult) -> SessionSearchResult:
    return SessionSearchResult(**result.model_dump())


def stats(stats: CoreStats) -> Stats:
    return Stats(**stats.model_dump())


def host_info(info: CoreHostInfo) -> HostInfo:
    return HostInfo(**info.model_dump())
