from __future__ import annotations

from typing import Any

from blackbox.models import SessionAudit, SessionMeta


def make_meta(**kw: Any) -> SessionMeta:
    defaults: dict[str, Any] = {
        "session_id": "abcd1234-5678-9012-3456-789012345678",
        "project_path": "/tmp/project",
        "transcript_path": "/tmp/project/.claude/sessions/abc.jsonl",
        "start_time": 1700000000.0,
        "end_time": 1700003600.0,
        "duration_s": 3600.0,
        "user_messages": 10,
        "assistant_messages": 12,
        "tool_calls": 25,
    }
    defaults.update(kw)
    return SessionMeta(**defaults)


def make_audit(**kw: Any) -> SessionAudit:
    defaults: dict[str, Any] = {
        "session_id": "abcd1234-5678-9012-3456-789012345678",
        "outcome": "mostly_achieved",
        "satisfaction": "satisfied",
    }
    defaults.update(kw)
    return SessionAudit(**defaults)


def pair(
    meta_kw: dict[str, Any] | None = None,
    audit_kw: dict[str, Any] | None = None,
) -> tuple[SessionMeta, SessionAudit]:
    return make_meta(**(meta_kw or {})), make_audit(**(audit_kw or {}))
