from dataclasses import dataclass
from pathlib import Path
from typing import Protocol


@dataclass
class Alert:
    # flat union: "trigger"|"heartbeat"|"levels"|"warn"|"arm"|"prime"|"late_start"|"screenshot"|"status"
    kind: str
    title: str
    body: str
    image_path: Path | None = None  # annotated screenshot
    direction: str | None = None    # "BUY"/"SELL" when kind=trigger
    silent: bool = False            # disable_notification for Telegram; ignored by Discord


class Notifier(Protocol):
    name: str

    def send(self, alert: Alert) -> None: ...  # raises on failure
