from __future__ import annotations

from dataclasses import dataclass
from typing import Any


@dataclass(frozen=True, slots=True)
class NotifyBridgeDone:
    reason: str = "stage_done"


@dataclass(frozen=True, slots=True)
class NotifyBridgeStop:
    status: str
    reason: str
    resource: str = ""
    failed_resources: tuple[str, ...] = ()
    phase: str = "in_session"


@dataclass(frozen=True, slots=True)
class ExportSession:
    output: Any
    session_id: str


@dataclass(frozen=True, slots=True)
class EndServiceOnce:
    pass


@dataclass(frozen=True, slots=True)
class InjectIdleNudge:
    text: str


@dataclass(frozen=True, slots=True)
class SetPendingInterrupt:
    listened_text: str = ""
    skipped: bool = False
    speech_id: str = ""


@dataclass(frozen=True, slots=True)
class StartSpeech:
    text: str
    allow_interruptions: bool
    add_to_chat_ctx: bool = True
    audio: Any = None


@dataclass(frozen=True, slots=True)
class WaitForSpeechPlayout:
    handle: Any


@dataclass(frozen=True, slots=True)
class InterruptSpeech:
    handle: Any
    force: bool = False


@dataclass(frozen=True, slots=True)
class ExtractSpokenText:
    handle: Any


@dataclass(frozen=True, slots=True)
class SetPipelineInterruption:
    interrupted: bool
    listened_text: str = ""
    skipped: bool = False
    speech_id: str = ""


@dataclass(frozen=True, slots=True)
class SetPipelineProcessingInterruption:
    listened_text: str = ""
    skipped: bool = False
    speech_id: str = ""


@dataclass(frozen=True, slots=True)
class RunPipelineInput:
    user_input: Any


@dataclass(frozen=True, slots=True)
class StartSession:
    room: Any
    room_options: Any
