"""Browser Worker configuration."""

from pydantic_settings import BaseSettings, SettingsConfigDict


class WorkerSettings(BaseSettings):
    WORKER_SECRET: str = ""
    WORKER_BIND: str = "0.0.0.0:8443"
    WORKER_MAX_SESSIONS: int = 2
    WORKER_IDLE_TIMEOUT_SEC: int = 1800
    # POST /v1/sessions without WS attach — reclaim zombie reservations
    WORKER_RESERVE_TIMEOUT_SEC: int = 120
    # false + Xvfb — better for 阿里云等验证码；true 省资源
    WORKER_HEADLESS: str = "false"
    WORKER_SCREENCAST_QUALITY: int = 90
    WORKER_DEFAULT_VIEWPORT_W: int = 1280
    WORKER_DEFAULT_VIEWPORT_H: int = 720

    model_config = SettingsConfigDict(env_file=".env", extra="ignore")


settings = WorkerSettings()
