@mastra/voice-google 0.12.0-beta.0 → 0.12.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @mastra/voice-google
2
2
 
3
+ ## 0.12.0-beta.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Add embedded documentation support for Mastra packages ([#11472](https://github.com/mastra-ai/mastra/pull/11472))
8
+
9
+ Mastra packages now include embedded documentation in the published npm package under `dist/docs/`. This enables coding agents and AI assistants to understand and use the framework by reading documentation directly from `node_modules`.
10
+
11
+ Each package includes:
12
+ - **SKILL.md** - Entry point explaining the package's purpose and capabilities
13
+ - **SOURCE_MAP.json** - Machine-readable index mapping exports to types and implementation files
14
+ - **Topic folders** - Conceptual documentation organized by feature area
15
+
16
+ Documentation is driven by the `packages` frontmatter field in MDX files, which maps docs to their corresponding packages. CI validation ensures all docs include this field.
17
+
18
+ - Updated dependencies [[`d2d3e22`](https://github.com/mastra-ai/mastra/commit/d2d3e22a419ee243f8812a84e3453dd44365ecb0), [`bc72b52`](https://github.com/mastra-ai/mastra/commit/bc72b529ee4478fe89ecd85a8be47ce0127b82a0), [`05b8bee`](https://github.com/mastra-ai/mastra/commit/05b8bee9e50e6c2a4a2bf210eca25ee212ca24fa), [`c042bd0`](https://github.com/mastra-ai/mastra/commit/c042bd0b743e0e86199d0cb83344ca7690e34a9c), [`940a2b2`](https://github.com/mastra-ai/mastra/commit/940a2b27480626ed7e74f55806dcd2181c1dd0c2), [`e0941c3`](https://github.com/mastra-ai/mastra/commit/e0941c3d7fc75695d5d258e7008fd5d6e650800c), [`0c0580a`](https://github.com/mastra-ai/mastra/commit/0c0580a42f697cd2a7d5973f25bfe7da9055038a), [`28f5f89`](https://github.com/mastra-ai/mastra/commit/28f5f89705f2409921e3c45178796c0e0d0bbb64), [`e601b27`](https://github.com/mastra-ai/mastra/commit/e601b272c70f3a5ecca610373aa6223012704892), [`3d3366f`](https://github.com/mastra-ai/mastra/commit/3d3366f31683e7137d126a3a57174a222c5801fb), [`5a4953f`](https://github.com/mastra-ai/mastra/commit/5a4953f7d25bb15ca31ed16038092a39cb3f98b3), [`eb9e522`](https://github.com/mastra-ai/mastra/commit/eb9e522ce3070a405e5b949b7bf5609ca51d7fe2), [`20e6f19`](https://github.com/mastra-ai/mastra/commit/20e6f1971d51d3ff6dd7accad8aaaae826d540ed), [`4f0b3c6`](https://github.com/mastra-ai/mastra/commit/4f0b3c66f196c06448487f680ccbb614d281e2f7), [`74c4f22`](https://github.com/mastra-ai/mastra/commit/74c4f22ed4c71e72598eacc346ba95cdbc00294f), [`81b6a8f`](https://github.com/mastra-ai/mastra/commit/81b6a8ff79f49a7549d15d66624ac1a0b8f5f971), [`e4d366a`](https://github.com/mastra-ai/mastra/commit/e4d366aeb500371dd4210d6aa8361a4c21d87034), [`a4f010b`](https://github.com/mastra-ai/mastra/commit/a4f010b22e4355a5fdee70a1fe0f6e4a692cc29e), [`73b0bb3`](https://github.com/mastra-ai/mastra/commit/73b0bb394dba7c9482eb467a97ab283dbc0ef4db), [`5627a8c`](https://github.com/mastra-ai/mastra/commit/5627a8c6dc11fe3711b3fa7a6ffd6eb34100a306), [`3ff45d1`](https://github.com/mastra-ai/mastra/commit/3ff45d10e0c80c5335a957ab563da72feb623520), [`251df45`](https://github.com/mastra-ai/mastra/commit/251df4531407dfa46d805feb40ff3fb49769f455), [`f894d14`](https://github.com/mastra-ai/mastra/commit/f894d148946629af7b1f452d65a9cf864cec3765), [`c2b9547`](https://github.com/mastra-ai/mastra/commit/c2b9547bf435f56339f23625a743b2147ab1c7a6), [`580b592`](https://github.com/mastra-ai/mastra/commit/580b5927afc82fe460dfdf9a38a902511b6b7e7f), [`58e3931`](https://github.com/mastra-ai/mastra/commit/58e3931af9baa5921688566210f00fb0c10479fa), [`08bb631`](https://github.com/mastra-ai/mastra/commit/08bb631ae2b14684b2678e3549d0b399a6f0561e), [`4fba91b`](https://github.com/mastra-ai/mastra/commit/4fba91bec7c95911dc28e369437596b152b04cd0), [`12b0cc4`](https://github.com/mastra-ai/mastra/commit/12b0cc4077d886b1a552637dedb70a7ade93528c)]:
19
+ - @mastra/core@1.0.0-beta.20
20
+
21
+ ## 0.12.0-beta.1
22
+
23
+ ### Minor Changes
24
+
25
+ - Add Vertex AI support to GoogleVoice provider ([#10661](https://github.com/mastra-ai/mastra/pull/10661))
26
+ - Add `vertexAI`, `project`, and `location` configuration options
27
+ - Support Vertex AI authentication via project ID and service accounts
28
+ - Add helper methods: `isUsingVertexAI()`, `getProject()`, `getLocation()`
29
+ - Support `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` environment variables
30
+ - Update README with Vertex AI usage examples
31
+
32
+ This makes `@mastra/voice-google` consistent with `@mastra/voice-google-gemini-live` and enables enterprise deployments using Google Cloud project-based authentication instead of API keys.
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [[`ac0d2f4`](https://github.com/mastra-ai/mastra/commit/ac0d2f4ff8831f72c1c66c2be809706d17f65789), [`1a0d3fc`](https://github.com/mastra-ai/mastra/commit/1a0d3fc811482c9c376cdf79ee615c23bae9b2d6), [`85a628b`](https://github.com/mastra-ai/mastra/commit/85a628b1224a8f64cd82ea7f033774bf22df7a7e), [`c237233`](https://github.com/mastra-ai/mastra/commit/c23723399ccedf7f5744b3f40997b79246bfbe64), [`15f9e21`](https://github.com/mastra-ai/mastra/commit/15f9e216177201ea6e3f6d0bfb063fcc0953444f), [`ff94dea`](https://github.com/mastra-ai/mastra/commit/ff94dea935f4e34545c63bcb6c29804732698809), [`5b2ff46`](https://github.com/mastra-ai/mastra/commit/5b2ff4651df70c146523a7fca773f8eb0a2272f8), [`db41688`](https://github.com/mastra-ai/mastra/commit/db4168806d007417e2e60b4f68656dca4e5f40c9), [`5ca599d`](https://github.com/mastra-ai/mastra/commit/5ca599d0bb59a1595f19f58473fcd67cc71cef58), [`bff1145`](https://github.com/mastra-ai/mastra/commit/bff114556b3cbadad9b2768488708f8ad0e91475), [`5c8ca24`](https://github.com/mastra-ai/mastra/commit/5c8ca247094e0cc2cdbd7137822fb47241f86e77), [`e191844`](https://github.com/mastra-ai/mastra/commit/e1918444ca3f80e82feef1dad506cd4ec6e2875f), [`22553f1`](https://github.com/mastra-ai/mastra/commit/22553f11c63ee5e966a9c034a349822249584691), [`7237163`](https://github.com/mastra-ai/mastra/commit/72371635dbf96a87df4b073cc48fc655afbdce3d), [`2500740`](https://github.com/mastra-ai/mastra/commit/2500740ea23da067d6e50ec71c625ab3ce275e64), [`873ecbb`](https://github.com/mastra-ai/mastra/commit/873ecbb517586aa17d2f1e99283755b3ebb2863f), [`4f9bbe5`](https://github.com/mastra-ai/mastra/commit/4f9bbe5968f42c86f4930b8193de3c3c17e5bd36), [`02e51fe`](https://github.com/mastra-ai/mastra/commit/02e51feddb3d4155cfbcc42624fd0d0970d032c0), [`8f3fa3a`](https://github.com/mastra-ai/mastra/commit/8f3fa3a652bb77da092f913ec51ae46e3a7e27dc), [`cd29ad2`](https://github.com/mastra-ai/mastra/commit/cd29ad23a255534e8191f249593849ed29160886), [`bdf4d8c`](https://github.com/mastra-ai/mastra/commit/bdf4d8cdc656d8a2c21d81834bfa3bfa70f56c16), [`854e3da`](https://github.com/mastra-ai/mastra/commit/854e3dad5daac17a91a20986399d3a51f54bf68b), [`ce18d38`](https://github.com/mastra-ai/mastra/commit/ce18d38678c65870350d123955014a8432075fd9), [`cccf9c8`](https://github.com/mastra-ai/mastra/commit/cccf9c8b2d2dfc1a5e63919395b83d78c89682a0), [`61a5705`](https://github.com/mastra-ai/mastra/commit/61a570551278b6743e64243b3ce7d73de915ca8a), [`db70a48`](https://github.com/mastra-ai/mastra/commit/db70a48aeeeeb8e5f92007e8ede52c364ce15287), [`f0fdc14`](https://github.com/mastra-ai/mastra/commit/f0fdc14ee233d619266b3d2bbdeea7d25cfc6d13), [`db18bc9`](https://github.com/mastra-ai/mastra/commit/db18bc9c3825e2c1a0ad9a183cc9935f6691bfa1), [`9b37b56`](https://github.com/mastra-ai/mastra/commit/9b37b565e1f2a76c24f728945cc740c2b09be9da), [`41a23c3`](https://github.com/mastra-ai/mastra/commit/41a23c32f9877d71810f37e24930515df2ff7a0f), [`5d171ad`](https://github.com/mastra-ai/mastra/commit/5d171ad9ef340387276b77c2bb3e83e83332d729), [`f03ae60`](https://github.com/mastra-ai/mastra/commit/f03ae60500fe350c9d828621006cdafe1975fdd8), [`d1e74a0`](https://github.com/mastra-ai/mastra/commit/d1e74a0a293866dece31022047f5dbab65a304d0), [`39e7869`](https://github.com/mastra-ai/mastra/commit/39e7869bc7d0ee391077ce291474d8a84eedccff), [`5761926`](https://github.com/mastra-ai/mastra/commit/57619260c4a2cdd598763abbacd90de594c6bc76), [`c900fdd`](https://github.com/mastra-ai/mastra/commit/c900fdd504c41348efdffb205cfe80d48c38fa33), [`604a79f`](https://github.com/mastra-ai/mastra/commit/604a79fecf276e26a54a3fe01bb94e65315d2e0e), [`887f0b4`](https://github.com/mastra-ai/mastra/commit/887f0b4746cdbd7cb7d6b17ac9f82aeb58037ea5), [`2562143`](https://github.com/mastra-ai/mastra/commit/256214336b4faa78646c9c1776612393790d8784), [`ef11a61`](https://github.com/mastra-ai/mastra/commit/ef11a61920fa0ed08a5b7ceedd192875af119749)]:
37
+ - @mastra/core@1.0.0-beta.6
38
+
3
39
  ## 0.12.0-beta.0
4
40
 
5
41
  ### Minor Changes
package/README.md CHANGED
@@ -12,16 +12,50 @@ npm install @mastra/voice-google
12
12
 
13
13
  ## Configuration
14
14
 
15
- You can authenticate in one of the following ways:
15
+ The module supports multiple authentication methods:
16
+
17
+ ### Option 1: API Key (Development)
18
+
19
+ Use an API key from [Google Cloud Console](https://console.cloud.google.com/apis/credentials):
16
20
 
17
21
  ```bash
18
22
  GOOGLE_API_KEY=your_api_key
19
- # or provide a service account key picked up by ADC
23
+ ```
24
+
25
+ ### Option 2: Service Account (Recommended)
26
+
27
+ Use a service account key file:
28
+
29
+ ```bash
20
30
  GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
21
31
  ```
22
32
 
33
+ ### Option 3: Vertex AI (Recommended for Production)
34
+
35
+ Use OAuth authentication with Google Cloud Platform for enterprise deployments:
36
+
37
+ ```bash
38
+ # Set project ID
39
+ GOOGLE_CLOUD_PROJECT=your_project_id
40
+
41
+ # Optional: Set location (defaults to us-central1)
42
+ GOOGLE_CLOUD_LOCATION=us-central1
43
+
44
+ # Authenticate via gcloud CLI
45
+ gcloud auth application-default login
46
+ ```
47
+
48
+ Or use a service account:
49
+
50
+ ```bash
51
+ GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
52
+ GOOGLE_CLOUD_PROJECT=your_project_id
53
+ ```
54
+
23
55
  ## Usage
24
56
 
57
+ ### Standard Usage
58
+
25
59
  ```typescript
26
60
  import { GoogleVoice } from '@mastra/voice-google';
27
61
 
@@ -50,6 +84,129 @@ const audioStream = await voice.speak('Hello from Mastra!', {
50
84
  const text = await voice.listen(audioStream);
51
85
  ```
52
86
 
87
+ ### Vertex AI Mode
88
+
89
+ For enterprise deployments, use Vertex AI mode which provides better integration with Google Cloud infrastructure:
90
+
91
+ ```typescript
92
+ import { GoogleVoice } from '@mastra/voice-google';
93
+
94
+ // Initialize with Vertex AI
95
+ const voice = new GoogleVoice({
96
+ vertexAI: true,
97
+ project: 'your-gcp-project',
98
+ location: 'us-central1', // Optional, defaults to 'us-central1'
99
+ speaker: 'en-US-Studio-O',
100
+ });
101
+
102
+ // Works the same as standard mode
103
+ const audioStream = await voice.speak('Hello from Vertex AI!');
104
+ const text = await voice.listen(audioStream);
105
+
106
+ // Check if using Vertex AI
107
+ console.log(voice.isUsingVertexAI()); // true
108
+ console.log(voice.getProject()); // 'your-gcp-project'
109
+ console.log(voice.getLocation()); // 'us-central1'
110
+ ```
111
+
112
+ ### Vertex AI with Service Account
113
+
114
+ ```typescript
115
+ import { GoogleVoice } from '@mastra/voice-google';
116
+
117
+ const voice = new GoogleVoice({
118
+ vertexAI: true,
119
+ project: 'your-gcp-project',
120
+ location: 'us-central1',
121
+ speechModel: {
122
+ keyFilename: '/path/to/service-account.json',
123
+ },
124
+ listeningModel: {
125
+ keyFilename: '/path/to/service-account.json',
126
+ },
127
+ });
128
+ ```
129
+
130
+ ### Vertex AI with In-Memory Credentials
131
+
132
+ ```typescript
133
+ import { GoogleVoice } from '@mastra/voice-google';
134
+
135
+ const voice = new GoogleVoice({
136
+ vertexAI: true,
137
+ project: 'your-gcp-project',
138
+ speechModel: {
139
+ credentials: {
140
+ client_email: 'service-account@project.iam.gserviceaccount.com',
141
+ private_key: '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----',
142
+ },
143
+ },
144
+ });
145
+ ```
146
+
147
+ ## API Reference
148
+
149
+ ### Constructor Options
150
+
151
+ | Option | Type | Description |
152
+ | ---------------- | ------------------- | ------------------------------------------------ |
153
+ | `speechModel` | `GoogleModelConfig` | Configuration for TTS |
154
+ | `listeningModel` | `GoogleModelConfig` | Configuration for STT |
155
+ | `speaker` | `string` | Default voice ID (default: `'en-US-Casual-K'`) |
156
+ | `vertexAI` | `boolean` | Enable Vertex AI mode (default: `false`) |
157
+ | `project` | `string` | Google Cloud project ID (required for Vertex AI) |
158
+ | `location` | `string` | Google Cloud region (default: `'us-central1'`) |
159
+
160
+ ### GoogleModelConfig
161
+
162
+ | Option | Type | Description |
163
+ | ------------- | -------- | ------------------------------------- |
164
+ | `apiKey` | `string` | Google Cloud API key |
165
+ | `keyFilename` | `string` | Path to service account JSON key file |
166
+ | `credentials` | `object` | In-memory service account credentials |
167
+
168
+ ### Methods
169
+
170
+ #### `speak(input, options?)`
171
+
172
+ Converts text to speech.
173
+
174
+ - `input`: `string | NodeJS.ReadableStream` - Text to convert
175
+ - `options.speaker`: Override default voice
176
+ - `options.languageCode`: Language code (e.g., `'en-US'`)
177
+ - `options.audioConfig`: Audio encoding options
178
+
179
+ Returns: `Promise<NodeJS.ReadableStream>` - Audio stream
180
+
181
+ #### `listen(audioStream, options?)`
182
+
183
+ Converts speech to text.
184
+
185
+ - `audioStream`: `NodeJS.ReadableStream` - Audio to transcribe
186
+ - `options.config`: Recognition configuration
187
+
188
+ Returns: `Promise<string>` - Transcribed text
189
+
190
+ #### `getSpeakers(options?)`
191
+
192
+ Lists available voices.
193
+
194
+ - `options.languageCode`: Filter by language (default: `'en-US'`)
195
+
196
+ Returns: `Promise<Array<{ voiceId: string, languageCodes: string[] }>>`
197
+
198
+ #### `isUsingVertexAI()`
199
+
200
+ Returns `true` if Vertex AI mode is enabled.
201
+
202
+ #### `getProject()`
203
+
204
+ Returns the configured Google Cloud project ID.
205
+
206
+ #### `getLocation()`
207
+
208
+ Returns the configured Google Cloud location/region.
209
+
53
210
  ## Features
54
211
 
55
212
  - Neural Text-to-Speech synthesis
@@ -58,6 +215,35 @@ const text = await voice.listen(audioStream);
58
215
  - Streaming support for both speech and transcription
59
216
  - High-quality audio processing
60
217
  - Natural-sounding voice synthesis
218
+ - **Vertex AI support for enterprise deployments**
219
+
220
+ ## Required Permissions for Vertex AI
221
+
222
+ When using Vertex AI, ensure your service account or user has the appropriate IAM roles and OAuth scopes:
223
+
224
+ ### IAM Roles
225
+
226
+ **For Text-to-Speech:**
227
+
228
+ - `roles/texttospeech.admin` - Text-to-Speech Admin (full access)
229
+ - `roles/texttospeech.editor` - Text-to-Speech Editor (create and manage)
230
+ - `roles/texttospeech.viewer` - Text-to-Speech Viewer (read-only)
231
+
232
+ **For Speech-to-Text:**
233
+
234
+ - `roles/speech.client` - Speech-to-Text Client
235
+
236
+ ### OAuth Scopes
237
+
238
+ **For synchronous Text-to-Speech synthesis:**
239
+
240
+ - `https://www.googleapis.com/auth/cloud-platform` - Full access to Google Cloud Platform services
241
+
242
+ **For long-audio Text-to-Speech operations:**
243
+
244
+ - `locations.longAudioSynthesize` - Create long-audio synthesis operations
245
+ - `operations.get` - Get operation status
246
+ - `operations.list` - List operations
61
247
 
62
248
  ## Voice Options
63
249
 
@@ -0,0 +1,32 @@
1
+ # @mastra/voice-google Documentation
2
+
3
+ > Embedded documentation for coding agents
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # Read the skill overview
9
+ cat docs/SKILL.md
10
+
11
+ # Get the source map
12
+ cat docs/SOURCE_MAP.json
13
+
14
+ # Read topic documentation
15
+ cat docs/<topic>/01-overview.md
16
+ ```
17
+
18
+ ## Structure
19
+
20
+ ```
21
+ docs/
22
+ ├── SKILL.md # Entry point
23
+ ├── README.md # This file
24
+ ├── SOURCE_MAP.json # Export index
25
+ ├── agents/ (1 files)
26
+ ├── voice/ (2 files)
27
+ ```
28
+
29
+ ## Version
30
+
31
+ Package: @mastra/voice-google
32
+ Version: 0.12.0-beta.2
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: mastra-voice-google-docs
3
+ description: Documentation for @mastra/voice-google. Includes links to type definitions and readable implementation code in dist/.
4
+ ---
5
+
6
+ # @mastra/voice-google Documentation
7
+
8
+ > **Version**: 0.12.0-beta.2
9
+ > **Package**: @mastra/voice-google
10
+
11
+ ## Quick Navigation
12
+
13
+ Use SOURCE_MAP.json to find any export:
14
+
15
+ ```bash
16
+ cat docs/SOURCE_MAP.json
17
+ ```
18
+
19
+ Each export maps to:
20
+ - **types**: `.d.ts` file with JSDoc and API signatures
21
+ - **implementation**: `.js` chunk file with readable source
22
+ - **docs**: Conceptual documentation in `docs/`
23
+
24
+ ## Top Exports
25
+
26
+
27
+
28
+ See SOURCE_MAP.json for the complete list.
29
+
30
+ ## Available Topics
31
+
32
+ - [Agents](agents/) - 1 file(s)
33
+ - [Voice](voice/) - 2 file(s)
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": "0.12.0-beta.2",
3
+ "package": "@mastra/voice-google",
4
+ "exports": {},
5
+ "modules": {}
6
+ }