from typing import Optional
import numpy as np

from .base import FailureRecoveryCoordinatorBase
from models.recovery import (
    SearchSession,
    ConfidenceAssessment,
    UserAnchor,
    UserInputRequest,
)
from models.core import GPSPoint
from models.satellite import TileCandidate


class FailureRecoveryCoordinator(FailureRecoveryCoordinatorBase):
    async def start_search_session(
        self,
        flight_id: str,
        frame_id: int,
        estimated_center: GPSPoint,
    ) -> SearchSession:
        raise NotImplementedError

    async def expand_search(
        self, session_id: str
    ) -> Optional[list[TileCandidate]]:
        raise NotImplementedError

    async def assess_confidence(
        self, flight_id: str, frame_id: int
    ) -> ConfidenceAssessment:
        raise NotImplementedError

    async def request_user_input(
        self,
        flight_id: str,
        frame_id: int,
        uav_image: np.ndarray,
        candidates: list[TileCandidate],
    ) -> UserInputRequest:
        raise NotImplementedError

    async def process_user_anchor(
        self, flight_id: str, anchor: UserAnchor
    ) -> bool:
        raise NotImplementedError

    async def is_recovery_needed(
        self, confidence: ConfidenceAssessment
    ) -> bool:
        raise NotImplementedError

    async def get_active_session(
        self, flight_id: str
    ) -> Optional[SearchSession]:
        raise NotImplementedError

    async def cancel_session(self, session_id: str) -> bool:
        raise NotImplementedError

