"""Typed application errors.""" from __future__ import annotations from dataclasses import dataclass from typing import Any @dataclass class AppError(Exception): """Base application error with a code and message.""" code: str message: str details: dict[str, Any] | None = None class ValidationError(AppError): """Raised when client input is invalid.""" class SpeechError(AppError): """Raised when STT/TTS fails.""" class LLMError(AppError): """Raised when LLM call fails."""