"""Pydantic schemas for Armorer web API."""

from __future__ import annotations

from pydantic import BaseModel, Field


class InstallActionRequest(BaseModel):
    agent: str = Field(min_length=1)
    alias: str | None = None
    skipScan: bool = True


class RunActionRequest(BaseModel):
    agent: str = Field(min_length=1)
    mode: str = "background"
    command: str | None = None


class UninstallActionRequest(BaseModel):
    agent: str = Field(min_length=1)
    force: bool = True


class ChatRequest(BaseModel):
    prompt: str = Field(min_length=1)
    sessionId: str | None = None


class OpenClawChatRequest(BaseModel):
    prompt: str = Field(min_length=1)
    sessionId: str = Field(min_length=1)


class SettingsUpdateRequest(BaseModel):
    llm: dict | None = None
    daily_reports: dict | None = None
    telemetry: dict | None = None
    telegram: dict | None = None
    tailscale: dict | None = None
    security: dict | None = None
    restartTelegramGateway: bool | None = None


class OpenClawSetupApplyRequest(BaseModel):
    accessMode: str | None = None
    remoteHost: str | None = None
    provider: str = Field(min_length=1)
    model: str = Field(min_length=1)
    providerApiKey: str | None = None
    telegramEnabled: bool = True
    telegramBotToken: str | None = None
    reuseArmorerTelegramIdentity: bool = False
    enabledSkills: list[str] | None = None
    webSearchProvider: str | None = "disabled"
    webSearchApiKey: str | None = None
    pairingCode: str | None = None
