"""Response models for suss. MCP server."""

from __future__ import annotations

from pydantic import BaseModel, Field


class TrustSignal(BaseModel):
    """A single trust signal with evidence."""
    signal: str
    detail: str = ""


class TrustResult(BaseModel):
    """Domain trust assessment result."""
    domain: str
    trust_score: int = Field(ge=0, le=100, description="Trust score 0-100")
    trust_level: str = Field(description="verified|established|moderate|new|unknown|suspicious")
    signals: list[str] = Field(default_factory=list)
    summary: str = ""
    evidence: list[dict] = Field(default_factory=list)
    missing: list[str] = Field(default_factory=list)
    risk_score: float | None = None
    cached: bool = False


class ScanResult(BaseModel):
    """Scam detection scan result."""
    score: float = Field(ge=0.0, le=1.0, description="Scam probability 0-1")
    bucket: str = Field(description="HIGH|MEDIUM|LOW")
    risk_signals: list[str] = Field(default_factory=list)
    category: str = ""
    trust: TrustResult | None = None
    contextual_guidance: dict | None = None
    request_id: str = ""


class VerifyResult(BaseModel):
    """Fast verification result (agent-optimized)."""
    score: float = Field(ge=0.0, le=1.0)
    bucket: str
    risk_signals: list[str] = Field(default_factory=list)
    trust: dict | None = None
    entities: dict | None = None
    entity_risk: dict | None = None
    latency_ms: int = 0
    cached: bool = False


class EntityResult(BaseModel):
    """Entity lookup result."""
    found: bool
    entity_type: str
    value: str
    times_reported: int = 0
    risk_level: str = "unknown"
    risk_score: float = 0.0
    scam_types: list[str] = Field(default_factory=list)
    first_seen: str | None = None
    last_seen: str | None = None
    linked_entities: list[dict] = Field(default_factory=list)


class BatchTrustResult(BaseModel):
    """Batch trust check result."""
    results: list[TrustResult]
    checked: int
    failed: int = 0


class FeedbackResult(BaseModel):
    """Feedback submission result."""
    success: bool
    message: str = ""
