## Description
Adds `@mastra/voice-mistral`, a new voice provider backed by Mistral's
Voxtral audio models, so agents can use a Mistral-centered stack for
speech via the existing `MastraVoice` / `CompositeVoice` patterns.
- `speak()` for text-to-speech using `voxtral-mini-tts-2603`, with
buffered and streaming output (`stream: true`), multiple audio formats
(mp3, wav, pcm, flac, opus), and one-off voice cloning via `refAudio`
- `listen()` for batch speech-to-text using `voxtral-mini-latest`, with
language, speaker diarization, context biasing, and timestamp
granularity options
- `getSpeakers()` fetches available preset voices from the Mistral
Voices API
- `MISTRAL_API_KEY` as the default environment variable, with per-model
`apiKey` overrides
- Package follows the `voice/openai` structure: `@internal/voice` base
class bundled at build time, no runtime `@mastra/core` dependency,
eslint guard against `@mastra/core` imports
- Reference docs page at `reference/voice/mistral` registered in the
docs sidebar
- Integration test suite (12 tests) covering TTS, STT roundtrip,
speakers, and error handling
## Related Issue(s)
Fixes#18920
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have addressed all Coderabbit comments on this PR
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR adds a new “Mistral” voice helper to Mastra. It lets your app
turn text into speech, turn speech into text, and fetch a list of
available voices—using `MISTRAL_API_KEY`.
## What changed
- Added a new `@mastra/voice-mistral` package implementing Mastra’s
`MastraVoice` / `CompositeVoice` patterns.
- Implemented **text-to-speech** (`speak()` with Voxtral TTS):
- Buffered and streaming output
- Multiple audio formats (`responseFormat`)
- One-off voice cloning via `refAudio`
- Per-call options (speaker/model/format, plus streaming)
- Supports `MISTRAL_API_KEY` by default, with per-model `apiKey`
overrides
- Implemented **speech-to-text** (`listen()` with Voxtral STT):
- Batch transcription with options for `language`, `diarize`,
`contextBias`, and `timestampGranularities`
- `filetype` hint support for the input audio payload
- Implemented **voice discovery** (`getSpeakers()`) using Mistral’s
Voices API (returns preset voices with `voiceId` and `name`, plus
optional metadata).
- Added package/developer support:
- ESLint guard in the `voice/mistral` package to prevent importing
`@mastra/core`
- Package docs and reference docs, plus registration in the Docusaurus
voice sidebar
- Build/test/lint configuration for the new package (Vitest + tsup + TS
configs)
- Type generation for the `@internal/voice` scope
- Added integration/e2e tests covering:
- `getSpeakers()`, `speak()` (buffered + streaming, options, invalid
empty input), `listen()` (including language override), `getListener()`,
and missing `MISTRAL_API_KEY` error behavior
- Added a minor changeset announcing `@mastra/voice-mistral`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->