"""Domain-specific plugin interface for word-level audio-text alignment"""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/forced_alignment_interface.ipynb.

# %% auto #0
__all__ = ['ForcedAlignmentPlugin']

# %% ../nbs/forced_alignment_interface.ipynb #cell-imports
from abc import abstractmethod
from pathlib import Path
from typing import List, Union

from cjm_plugin_system.core.interface import PluginInterface

from .core import AudioData
from .forced_alignment_core import ForcedAlignResult

# %% ../nbs/forced_alignment_interface.ipynb #cell-interface
class ForcedAlignmentPlugin(PluginInterface):
    """
    Abstract base class for all forced alignment plugins.

    Extends PluginInterface with forced-alignment-specific requirements:
    - `supported_formats`: List of audio file extensions this plugin can handle
    - `execute`: Accepts audio path and transcript text, returns ForcedAlignResult

    NOTE: When running via RemotePluginProxy, AudioData objects are automatically
    serialized to temp files via FileBackedDTO, so the Worker receives a file path.
    """

    entry_point_group = "transcription.forced_alignment_plugins"

    @property
    @abstractmethod
    def supported_formats(self) -> List[str]:  # e.g., ['wav', 'mp3', 'flac']
        """List of supported audio file extensions (without the dot)."""
        ...

    @abstractmethod
    def execute(
        self,
        audio: Union[AudioData, str, Path],  # Audio data or file path
        text: str,                            # Transcript text to align against
        **kwargs
    ) -> ForcedAlignResult:  # Word-level alignment result
        """
        Perform forced alignment of text against audio.

        When called via Proxy, AudioData is auto-converted to a file path string
        before reaching this method in the Worker process.
        """
        ...
