Opening a report or podcast link now establishes an authenticated starting reference for the conversation. Users can select other accessible content or compare reports while retaining the original link, and TALKFIRST greetings can name the verified report or podcast. Release notes: - Added authenticated report and episode link resolution with bounded lookups and unavailable-content handling - Added explicit conversation selection without restricting searches or changing the reference during comparisons - Added contextual TALKFIRST greetings through both voice-proxy and HTTP reasoning paths - Preserved backend permission checks, conversation isolation, cancellation, and the existing speech protocol Reviewed-on: AquaPortal/s2s#2
51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
"""Contracts owned by the optional authenticated MCP integration."""
|
|
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field, SecretStr
|
|
|
|
from vocero_api.models.content import ContentId
|
|
|
|
|
|
class ConversationRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
phoneNumber: str = Field(min_length=8, max_length=40)
|
|
report_id: ContentId | None = None
|
|
episode_id: ContentId | None = None
|
|
|
|
|
|
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
|