import userAuth from "@/src/functions/backend/auth/user-auth"; import grabSpeakableMessage from "@/src/functions/backend/db/bots/grab-speakable-message"; import speakText from "@/src/harness/audio/speak-text"; import HarnessError from "@/src/harness/harness-error"; import { SpeakBotMessageRequestSchema } from "@/src/schemas/bot-schema"; import AppError from "@/src/utils/app-error"; import parseWithSchema from "@/src/utils/parse-with-schema"; import safeErrorMessage from "@/src/utils/safe-error-message"; import speechText from "@/src/utils/speech-text"; import type { APIResponseObject, BunextAPIRouteHandler, } from "@moduletrace/bunext/types"; /** * `GET ?message_id=`: reads one of the bot's messages in the user's own * conversation aloud with the bot's speech model and voice, streamed as * the provider makes it, so an `