from __future__ import annotations

from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any

from app.core.api.domain.models.agent_request import AgentRequest
from app.core.api.domain.models.agent_session import AgentSession
from app.infra.observability.module_trace import RequestTraceContext

if TYPE_CHECKING:
    from app.core.agent.runtime.publisher import RuntimeEventPublisher


@dataclass(slots=True)
class RuntimeExecutionContext:
    request: AgentRequest
    session: AgentSession
    publisher: "RuntimeEventPublisher"
    trace: RequestTraceContext
    state: dict[str, Any] = field(default_factory=dict)
