"""Canonical execution layer types.

Extracted from execution/api_client.py in CP-2 Phase 8. Hosts the
GenerationResult dataclass — the unified output shape returned by
every model client and provider adapter.

Imported by VideoModelClient, StepRunner, and (via re-export) by the
api_client.py stub for legacy callers.
"""

from dataclasses import dataclass, field
from typing import Optional


@dataclass
class GenerationResult:
    """Result from a generation call, regardless of model."""
    success: bool
    image_data: Optional[bytes] = None   # For stills
    video_data: Optional[bytes] = None   # For video (if returned as bytes)
    video_url: Optional[str] = None      # If model returns URL instead of bytes
    model: str = ""
    cost: float = 0.0
    error: Optional[str] = None
    metadata: dict = field(default_factory=dict)


__all__ = ["GenerationResult"]
