"""Contracts owned by the optional authenticated MCP integration.""" from typing import Any from pydantic import BaseModel, ConfigDict, Field, SecretStr class ConversationRequest(BaseModel): model_config = ConfigDict(extra="forbid") phoneNumber: str = Field(min_length=8, max_length=40) class CallerIdentity(BaseModel): id: str = Field(min_length=1) name: str class BackendLogin(BaseModel): sessionToken: SecretStr = Field(min_length=1) user: CallerIdentity class ConversationResponse(BaseModel): conversationId: str expiresIn: int profile: CallerIdentity class McpToolDefinition(BaseModel): name: str description: str = "" parameters: dict[str, Any] requires_auth: bool = True class McpCatalogResponse(BaseModel): tools: list[McpToolDefinition] class IntegrationError(Exception): """Safe public errors, never containing upstream credentials or bodies.""" def __init__(self, status: int, message: str) -> None: super().__init__(message) self.status = status self.message = message