"""Provider interfaces for vulnerability enrichment."""

from __future__ import annotations

from dataclasses import dataclass
from typing import Protocol

from sentra.models import SoftwareComponent, VulnerabilityMatch


@dataclass(frozen=True)
class VulnerabilityMatchContext:
    component: SoftwareComponent
    evidence_refs: tuple[str, ...] = ()


class VulnerabilityProvider(Protocol):
    name: str

    def match(self, component: SoftwareComponent) -> list[VulnerabilityMatch]:
        """Return vulnerability matches for a normalized software component."""


class OfflineVulnerabilityProvider(VulnerabilityProvider, Protocol):
    feed_name: str


class FutureOnlineVulnerabilityProvider(VulnerabilityProvider, Protocol):
    requires_network: bool

