"""Pydantic models for Android ADB MCP Server."""

from pydantic import BaseModel, Field


class DeviceInfo(BaseModel):
    """Android device information returned by ADB."""

    device_id: str = Field(description="Unique device identifier/serial number")
    status: str = Field(
        description="Device connection status",
        json_schema_extra={
            "examples": ["device", "offline", "unauthorized", "no permissions"]
        },
    )
    model: str | None = Field(None, description="Device model name")
    product: str | None = Field(None, description="Product name")


class CommandResult(BaseModel):
    """Result of an ADB command execution."""

    success: bool = Field(description="Whether the command succeeded")
    stdout: str = Field(default="", description="Standard output from command")
    stderr: str = Field(default="", description="Standard error from command")
    returncode: int = Field(description="Command exit code")


class ScreenshotResult(BaseModel):
    """Screenshot capture operation result."""

    success: bool = Field(description="Whether screenshot was captured successfully")
    local_path: str | None = Field(
        None, description="Absolute path to the saved screenshot file"
    )
    error: str | None = Field(None, description="Error message if operation failed")
