@mastra/voice-murf 0.12.1 → 0.12.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/_types/@internal_voice/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +8888 -0
  3. package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/base/index.d.ts +31 -0
  4. package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/logger/index.d.ts +217 -0
  5. package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts +147 -0
  6. package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/types/index.d.ts +3 -0
  7. package/dist/_types/@internal_voice/dist/_types/zod/v3/ZodError.d.ts +164 -0
  8. package/dist/_types/@internal_voice/dist/_types/zod/v3/errors.d.ts +5 -0
  9. package/dist/_types/@internal_voice/dist/_types/zod/v3/external.d.ts +6 -0
  10. package/dist/_types/@internal_voice/dist/_types/zod/v3/helpers/enumUtil.d.ts +8 -0
  11. package/dist/_types/@internal_voice/dist/_types/zod/v3/helpers/errorUtil.d.ts +9 -0
  12. package/dist/_types/@internal_voice/dist/_types/zod/v3/helpers/parseUtil.d.ts +78 -0
  13. package/dist/_types/@internal_voice/dist/_types/zod/v3/helpers/partialUtil.d.ts +8 -0
  14. package/dist/_types/@internal_voice/dist/_types/zod/v3/helpers/typeAliases.d.ts +2 -0
  15. package/dist/_types/@internal_voice/dist/_types/zod/v3/helpers/util.d.ts +85 -0
  16. package/dist/_types/@internal_voice/dist/_types/zod/v3/index.d.cts +4 -0
  17. package/dist/_types/@internal_voice/dist/_types/zod/v3/index.d.ts +4 -0
  18. package/dist/_types/@internal_voice/dist/_types/zod/v3/locales/en.d.ts +3 -0
  19. package/dist/_types/@internal_voice/dist/_types/zod/v3/standard-schema.d.ts +102 -0
  20. package/dist/_types/@internal_voice/dist/_types/zod/v3/types.d.ts +1034 -0
  21. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/checks.d.ts +1 -0
  22. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/coerce.d.ts +17 -0
  23. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/compat.d.ts +50 -0
  24. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/errors.d.ts +30 -0
  25. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/external.d.ts +16 -0
  26. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/from-json-schema.d.ts +12 -0
  27. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/index.d.ts +4 -0
  28. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/iso.d.ts +22 -0
  29. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/parse.d.ts +31 -0
  30. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/schemas.d.ts +767 -0
  31. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/api.d.ts +325 -0
  32. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/checks.d.ts +278 -0
  33. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/core.d.ts +70 -0
  34. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/doc.d.ts +14 -0
  35. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/errors.d.ts +221 -0
  36. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/index.d.ts +16 -0
  37. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-generator.d.ts +65 -0
  38. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-processors.d.ts +49 -0
  39. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema.d.ts +88 -0
  40. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/parse.d.ts +49 -0
  41. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/regexes.d.ts +85 -0
  42. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/registries.d.ts +35 -0
  43. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/schemas.d.ts +1184 -0
  44. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/standard-schema.d.ts +126 -0
  45. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/to-json-schema.d.ts +114 -0
  46. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/util.d.ts +200 -0
  47. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/versions.d.ts +5 -0
  48. package/dist/_types/@internal_voice/dist/_types/zod/v4/index.d.cts +3 -0
  49. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ar.d.ts +4 -0
  50. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/az.d.ts +4 -0
  51. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/be.d.ts +4 -0
  52. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/bg.d.ts +4 -0
  53. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ca.d.ts +4 -0
  54. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/cs.d.ts +4 -0
  55. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/da.d.ts +4 -0
  56. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/de.d.ts +4 -0
  57. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/el.d.ts +4 -0
  58. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/en.d.ts +4 -0
  59. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/eo.d.ts +4 -0
  60. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/es.d.ts +4 -0
  61. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/fa.d.ts +4 -0
  62. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/fi.d.ts +4 -0
  63. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/fr-CA.d.ts +4 -0
  64. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/fr.d.ts +4 -0
  65. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/he.d.ts +4 -0
  66. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/hr.d.ts +4 -0
  67. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/hu.d.ts +4 -0
  68. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/hy.d.ts +4 -0
  69. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/id.d.ts +4 -0
  70. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/index.d.ts +52 -0
  71. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/is.d.ts +4 -0
  72. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/it.d.ts +4 -0
  73. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ja.d.ts +4 -0
  74. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ka.d.ts +4 -0
  75. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/kh.d.ts +5 -0
  76. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/km.d.ts +4 -0
  77. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ko.d.ts +4 -0
  78. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/lt.d.ts +4 -0
  79. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/mk.d.ts +4 -0
  80. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ms.d.ts +4 -0
  81. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/nl.d.ts +4 -0
  82. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/no.d.ts +4 -0
  83. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ota.d.ts +4 -0
  84. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/pl.d.ts +4 -0
  85. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ps.d.ts +4 -0
  86. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/pt.d.ts +4 -0
  87. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ro.d.ts +4 -0
  88. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ru.d.ts +4 -0
  89. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/sl.d.ts +4 -0
  90. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/sv.d.ts +4 -0
  91. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ta.d.ts +4 -0
  92. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/th.d.ts +4 -0
  93. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tr.d.ts +4 -0
  94. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ua.d.ts +5 -0
  95. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/uk.d.ts +4 -0
  96. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ur.d.ts +4 -0
  97. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/uz.d.ts +4 -0
  98. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/vi.d.ts +4 -0
  99. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/yo.d.ts +4 -0
  100. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/zh-CN.d.ts +4 -0
  101. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/zh-TW.d.ts +4 -0
  102. package/dist/_types/@internal_voice/dist/index.d.ts +16 -0
  103. package/dist/_types/@internal_voice/dist/voice/aisdk/index.d.ts +3 -0
  104. package/dist/_types/@internal_voice/dist/voice/aisdk/speech.d.ts +23 -0
  105. package/dist/_types/@internal_voice/dist/voice/aisdk/transcription.d.ts +22 -0
  106. package/dist/_types/@internal_voice/dist/voice/composite-voice.d.ts +72 -0
  107. package/dist/_types/@internal_voice/dist/voice/default-voice.d.ts +13 -0
  108. package/dist/_types/@internal_voice/dist/voice/index.d.ts +5 -0
  109. package/dist/_types/@internal_voice/dist/voice/voice.d.ts +172 -0
  110. package/dist/docs/SKILL.md +1 -1
  111. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  112. package/dist/docs/references/docs-agents-adding-voice.md +37 -6
  113. package/dist/docs/references/docs-voice-overview.md +86 -24
  114. package/dist/index.cjs +260 -2
  115. package/dist/index.cjs.map +1 -1
  116. package/dist/index.d.ts +1 -1
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/index.js +259 -1
  119. package/dist/index.js.map +1 -1
  120. package/package.json +4 -5
@@ -16,7 +16,7 @@ const voiceAgent = new Agent({
16
16
  id: 'voice-agent',
17
17
  name: 'Voice Agent',
18
18
  instructions: 'You are a voice assistant that can help users with their tasks.',
19
- model: 'openai/gpt-5.4',
19
+ model: 'openai/gpt-5.5',
20
20
  voice: new OpenAIVoice(),
21
21
  })
22
22
  ```
@@ -40,7 +40,7 @@ const voiceAgent = new Agent({
40
40
  id: 'voice-agent',
41
41
  name: 'Voice Agent',
42
42
  instructions: 'You are a voice assistant that can help users with their tasks.',
43
- model: 'openai/gpt-5.4',
43
+ model: 'openai/gpt-5.5',
44
44
  voice: new OpenAIVoice(),
45
45
  })
46
46
 
@@ -68,7 +68,7 @@ const voiceAgent = new Agent({
68
68
  id: 'voice-agent',
69
69
  name: 'Voice Agent',
70
70
  instructions: 'You are a voice assistant that can help users with their tasks.',
71
- model: 'openai/gpt-5.4',
71
+ model: 'openai/gpt-5.5',
72
72
  voice: new AzureVoice(),
73
73
  })
74
74
 
@@ -95,7 +95,7 @@ const voiceAgent = new Agent({
95
95
  id: 'voice-agent',
96
96
  name: 'Voice Agent',
97
97
  instructions: 'You are a voice assistant that can help users with their tasks.',
98
- model: 'openai/gpt-5.4',
98
+ model: 'openai/gpt-5.5',
99
99
  voice: new ElevenLabsVoice(),
100
100
  })
101
101
 
@@ -122,7 +122,7 @@ const voiceAgent = new Agent({
122
122
  id: 'voice-agent',
123
123
  name: 'Voice Agent',
124
124
  instructions: 'You are a voice assistant that can help users with their tasks.',
125
- model: 'openai/gpt-5.4',
125
+ model: 'openai/gpt-5.5',
126
126
  voice: new PlayAIVoice(),
127
127
  })
128
128
 
@@ -149,7 +149,7 @@ const voiceAgent = new Agent({
149
149
  id: 'voice-agent',
150
150
  name: 'Voice Agent',
151
151
  instructions: 'You are a voice assistant that can help users with their tasks.',
152
- model: 'openai/gpt-5.4',
152
+ model: 'openai/gpt-5.5',
153
153
  voice: new GoogleVoice(),
154
154
  })
155
155
 
@@ -176,7 +176,7 @@ const voiceAgent = new Agent({
176
176
  id: 'voice-agent',
177
177
  name: 'Voice Agent',
178
178
  instructions: 'You are a voice assistant that can help users with their tasks.',
179
- model: 'openai/gpt-5.4',
179
+ model: 'openai/gpt-5.5',
180
180
  voice: new CloudflareVoice(),
181
181
  })
182
182
 
@@ -203,7 +203,7 @@ const voiceAgent = new Agent({
203
203
  id: 'voice-agent',
204
204
  name: 'Voice Agent',
205
205
  instructions: 'You are a voice assistant that can help users with their tasks.',
206
- model: 'openai/gpt-5.4',
206
+ model: 'openai/gpt-5.5',
207
207
  voice: new DeepgramVoice(),
208
208
  })
209
209
 
@@ -230,7 +230,7 @@ const voiceAgent = new Agent({
230
230
  id: 'voice-agent',
231
231
  name: 'Voice Agent',
232
232
  instructions: 'You are a voice assistant that can help users with their tasks.',
233
- model: 'openai/gpt-5.4',
233
+ model: 'openai/gpt-5.5',
234
234
  voice: new InworldVoice(),
235
235
  })
236
236
 
@@ -257,7 +257,7 @@ const voiceAgent = new Agent({
257
257
  id: 'voice-agent',
258
258
  name: 'Voice Agent',
259
259
  instructions: 'You are a voice assistant that can help users with their tasks.',
260
- model: 'openai/gpt-5.4',
260
+ model: 'openai/gpt-5.5',
261
261
  voice: new SpeechifyVoice(),
262
262
  })
263
263
 
@@ -284,7 +284,7 @@ const voiceAgent = new Agent({
284
284
  id: 'voice-agent',
285
285
  name: 'Voice Agent',
286
286
  instructions: 'You are a voice assistant that can help users with their tasks.',
287
- model: 'openai/gpt-5.4',
287
+ model: 'openai/gpt-5.5',
288
288
  voice: new SarvamVoice(),
289
289
  })
290
290
 
@@ -311,7 +311,7 @@ const voiceAgent = new Agent({
311
311
  id: 'voice-agent',
312
312
  name: 'Voice Agent',
313
313
  instructions: 'You are a voice assistant that can help users with their tasks.',
314
- model: 'openai/gpt-5.4',
314
+ model: 'openai/gpt-5.5',
315
315
  voice: new MurfVoice(),
316
316
  })
317
317
 
@@ -346,7 +346,7 @@ const voiceAgent = new Agent({
346
346
  id: 'voice-agent',
347
347
  name: 'Voice Agent',
348
348
  instructions: 'You are a voice assistant that can help users with their tasks.',
349
- model: 'openai/gpt-5.4',
349
+ model: 'openai/gpt-5.5',
350
350
  voice: new OpenAIVoice(),
351
351
  })
352
352
 
@@ -375,7 +375,7 @@ const voiceAgent = new Agent({
375
375
  id: 'voice-agent',
376
376
  name: 'Voice Agent',
377
377
  instructions: 'You are a voice assistant that can help users with their tasks.',
378
- model: 'openai/gpt-5.4',
378
+ model: 'openai/gpt-5.5',
379
379
  voice: new AzureVoice(),
380
380
  })
381
381
 
@@ -403,7 +403,7 @@ const voiceAgent = new Agent({
403
403
  id: 'voice-agent',
404
404
  name: 'Voice Agent',
405
405
  instructions: 'You are a voice assistant that can help users with their tasks.',
406
- model: 'openai/gpt-5.4',
406
+ model: 'openai/gpt-5.5',
407
407
  voice: new ElevenLabsVoice(),
408
408
  })
409
409
 
@@ -431,7 +431,7 @@ const voiceAgent = new Agent({
431
431
  id: 'voice-agent',
432
432
  name: 'Voice Agent',
433
433
  instructions: 'You are a voice assistant that can help users with their tasks.',
434
- model: 'openai/gpt-5.4',
434
+ model: 'openai/gpt-5.5',
435
435
  voice: new GoogleVoice(),
436
436
  })
437
437
 
@@ -459,7 +459,7 @@ const voiceAgent = new Agent({
459
459
  id: 'voice-agent',
460
460
  name: 'Voice Agent',
461
461
  instructions: 'You are a voice assistant that can help users with their tasks.',
462
- model: 'openai/gpt-5.4',
462
+ model: 'openai/gpt-5.5',
463
463
  voice: new CloudflareVoice(),
464
464
  })
465
465
 
@@ -487,7 +487,7 @@ const voiceAgent = new Agent({
487
487
  id: 'voice-agent',
488
488
  name: 'Voice Agent',
489
489
  instructions: 'You are a voice assistant that can help users with their tasks.',
490
- model: 'openai/gpt-5.4',
490
+ model: 'openai/gpt-5.5',
491
491
  voice: new DeepgramVoice(),
492
492
  })
493
493
 
@@ -515,7 +515,7 @@ const voiceAgent = new Agent({
515
515
  id: 'voice-agent',
516
516
  name: 'Voice Agent',
517
517
  instructions: 'You are a voice assistant that can help users with their tasks.',
518
- model: 'openai/gpt-5.4',
518
+ model: 'openai/gpt-5.5',
519
519
  voice: new InworldVoice(),
520
520
  })
521
521
 
@@ -543,7 +543,7 @@ const voiceAgent = new Agent({
543
543
  id: 'voice-agent',
544
544
  name: 'Voice Agent',
545
545
  instructions: 'You are a voice assistant that can help users with their tasks.',
546
- model: 'openai/gpt-5.4',
546
+ model: 'openai/gpt-5.5',
547
547
  voice: new SarvamVoice(),
548
548
  })
549
549
 
@@ -575,7 +575,7 @@ const voiceAgent = new Agent({
575
575
  id: 'voice-agent',
576
576
  name: 'Voice Agent',
577
577
  instructions: 'You are a voice assistant that can help users with their tasks.',
578
- model: 'openai/gpt-5.4',
578
+ model: 'openai/gpt-5.5',
579
579
  voice: new OpenAIRealtimeVoice(),
580
580
  })
581
581
 
@@ -605,7 +605,7 @@ const voiceAgent = new Agent({
605
605
  id: 'voice-agent',
606
606
  name: 'Voice Agent',
607
607
  instructions: 'You are a voice assistant that can help users with their tasks.',
608
- model: 'openai/gpt-5.4',
608
+ model: 'openai/gpt-5.5',
609
609
  voice: new GeminiLiveVoice({
610
610
  // Live API mode
611
611
  apiKey: process.env.GOOGLE_API_KEY,
@@ -654,7 +654,7 @@ const voiceAgent = new Agent({
654
654
  id: 'voice-agent',
655
655
  name: 'Voice Agent',
656
656
  instructions: 'You are a voice assistant that can help users with their tasks.',
657
- model: 'openai/gpt-5.4',
657
+ model: 'openai/gpt-5.5',
658
658
  voice: new NovaSonicVoice({
659
659
  region: 'us-east-1',
660
660
  speaker: 'matthew',
@@ -686,6 +686,48 @@ await voiceAgent.voice.send(micStream)
686
686
 
687
687
  Visit the [AWS Nova Sonic Reference](https://mastra.ai/reference/voice/aws-nova-sonic) for more information on the AWS Nova Sonic voice provider.
688
688
 
689
+ **Inworld Realtime**:
690
+
691
+ ```typescript
692
+ import { Agent } from '@mastra/core/agent'
693
+ import { playAudio, getMicrophoneStream } from '@mastra/node-audio'
694
+ import { InworldRealtimeVoice } from '@mastra/voice-inworld'
695
+
696
+ const voiceAgent = new Agent({
697
+ id: 'voice-agent',
698
+ name: 'Voice Agent',
699
+ instructions: 'You are a voice assistant that can help users with their tasks.',
700
+ model: 'openai/gpt-5.5',
701
+ voice: new InworldRealtimeVoice({
702
+ apiKey: process.env.INWORLD_API_KEY,
703
+ model: 'inworld/models/gemma-4-26b-a4b-it',
704
+ speaker: 'Sarah',
705
+ }),
706
+ })
707
+
708
+ // Connect before using speak/send
709
+ await voiceAgent.voice.connect()
710
+
711
+ // Listen for agent audio (PCM stream)
712
+ voiceAgent.voice.on('speaker', stream => {
713
+ playAudio(stream)
714
+ })
715
+
716
+ // Listen for text responses and transcriptions
717
+ voiceAgent.voice.on('writing', ({ text, role }) => {
718
+ console.log(`${role}: ${text}`)
719
+ })
720
+
721
+ // Initiate the conversation
722
+ await voiceAgent.voice.speak('How can I help you today?')
723
+
724
+ // Send continuous audio from the microphone
725
+ const micStream = getMicrophoneStream()
726
+ await voiceAgent.voice.send(micStream)
727
+ ```
728
+
729
+ Visit the [Inworld Realtime Reference](https://mastra.ai/reference/voice/inworld-realtime) for more information on the Inworld Realtime voice provider.
730
+
689
731
  **xAI**:
690
732
 
691
733
  ```typescript
@@ -1051,6 +1093,26 @@ const voice = new NovaSonicVoice({
1051
1093
 
1052
1094
  Visit the [AWS Nova Sonic Reference](https://mastra.ai/reference/voice/aws-nova-sonic) for more information on the AWS Nova Sonic voice provider.
1053
1095
 
1096
+ **Inworld Realtime**:
1097
+
1098
+ ```typescript
1099
+ // Inworld Realtime Voice Configuration
1100
+ const voice = new InworldRealtimeVoice({
1101
+ apiKey: process.env.INWORLD_API_KEY,
1102
+ model: 'inworld/models/gemma-4-26b-a4b-it',
1103
+ speaker: 'Sarah',
1104
+ // Typed Inworld realtime knobs (semantic VAD, playback speed, MCP tool routing, ...)
1105
+ session: {
1106
+ audio: {
1107
+ output: { speed: 1.1 },
1108
+ input: { turn_detection: { type: 'semantic_vad', eagerness: 'high' } },
1109
+ },
1110
+ },
1111
+ })
1112
+ ```
1113
+
1114
+ Visit the [Inworld Realtime Reference](https://mastra.ai/reference/voice/inworld-realtime) for more information on the Inworld Realtime voice provider.
1115
+
1054
1116
  **AI SDK**:
1055
1117
 
1056
1118
  ```typescript
@@ -1070,7 +1132,7 @@ const voiceAgent = new Agent({
1070
1132
  id: 'aisdk-voice-agent',
1071
1133
  name: 'AI SDK Voice Agent',
1072
1134
  instructions: 'You are a helpful assistant with voice capabilities.',
1073
- model: 'openai/gpt-5.4',
1135
+ model: 'openai/gpt-5.5',
1074
1136
  voice,
1075
1137
  })
1076
1138
  ```
package/dist/index.cjs CHANGED
@@ -1,10 +1,268 @@
1
1
  'use strict';
2
2
 
3
3
  var stream = require('stream');
4
- var voice = require('@mastra/core/voice');
5
4
 
6
5
  // src/index.ts
7
6
 
7
+ // ../../packages/_internal-core/dist/chunk-HDURQPU2.js
8
+ var RegisteredLogger = {
9
+ LLM: "LLM"};
10
+ var LogLevel = {
11
+ DEBUG: "debug",
12
+ INFO: "info",
13
+ WARN: "warn",
14
+ ERROR: "error"};
15
+ var MastraLogger = class {
16
+ name;
17
+ level;
18
+ transports;
19
+ constructor(options = {}) {
20
+ this.name = options.name || "Mastra";
21
+ this.level = options.level || LogLevel.ERROR;
22
+ this.transports = new Map(Object.entries(options.transports || {}));
23
+ }
24
+ getTransports() {
25
+ return this.transports;
26
+ }
27
+ trackException(_error, _metadata) {
28
+ }
29
+ async listLogs(transportId, params) {
30
+ if (!transportId || !this.transports.has(transportId)) {
31
+ return { logs: [], total: 0, page: params?.page ?? 1, perPage: params?.perPage ?? 100, hasMore: false };
32
+ }
33
+ return this.transports.get(transportId).listLogs?.(params) ?? {
34
+ logs: [],
35
+ total: 0,
36
+ page: params?.page ?? 1,
37
+ perPage: params?.perPage ?? 100,
38
+ hasMore: false
39
+ };
40
+ }
41
+ async listLogsByRunId({
42
+ transportId,
43
+ runId,
44
+ fromDate,
45
+ toDate,
46
+ logLevel,
47
+ filters,
48
+ page,
49
+ perPage
50
+ }) {
51
+ if (!transportId || !this.transports.has(transportId) || !runId) {
52
+ return { logs: [], total: 0, page: page ?? 1, perPage: perPage ?? 100, hasMore: false };
53
+ }
54
+ return this.transports.get(transportId).listLogsByRunId?.({ runId, fromDate, toDate, logLevel, filters, page, perPage }) ?? {
55
+ logs: [],
56
+ total: 0,
57
+ page: page ?? 1,
58
+ perPage: perPage ?? 100,
59
+ hasMore: false
60
+ };
61
+ }
62
+ };
63
+ var ConsoleLogger = class _ConsoleLogger extends MastraLogger {
64
+ component;
65
+ filter;
66
+ constructor(options = {}) {
67
+ super(options);
68
+ this.component = options.component;
69
+ this.filter = options.filter;
70
+ }
71
+ child(componentOrBindings) {
72
+ const component = typeof componentOrBindings === "string" ? componentOrBindings : componentOrBindings?.component ?? this.component;
73
+ return new _ConsoleLogger({
74
+ name: this.name,
75
+ level: this.level,
76
+ component,
77
+ filter: this.filter
78
+ });
79
+ }
80
+ shouldLog(level, message, args) {
81
+ if (!this.filter) return true;
82
+ try {
83
+ return this.filter({ component: this.component, level, message, args });
84
+ } catch (e) {
85
+ console.error(`[Logger] Filter error for component=${this.component} level=${level}:`, e);
86
+ return true;
87
+ }
88
+ }
89
+ prefix() {
90
+ return this.component ? `[${this.component}] ` : "";
91
+ }
92
+ debug(message, ...args) {
93
+ if (this.level === LogLevel.DEBUG && this.shouldLog(LogLevel.DEBUG, message, args)) {
94
+ console.info(`${this.prefix()}${message}`, ...args);
95
+ }
96
+ }
97
+ info(message, ...args) {
98
+ if ((this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) && this.shouldLog(LogLevel.INFO, message, args)) {
99
+ console.info(`${this.prefix()}${message}`, ...args);
100
+ }
101
+ }
102
+ warn(message, ...args) {
103
+ if ((this.level === LogLevel.WARN || this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) && this.shouldLog(LogLevel.WARN, message, args)) {
104
+ console.info(`${this.prefix()}${message}`, ...args);
105
+ }
106
+ }
107
+ error(message, ...args) {
108
+ if ((this.level === LogLevel.ERROR || this.level === LogLevel.WARN || this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) && this.shouldLog(LogLevel.ERROR, message, args)) {
109
+ console.error(`${this.prefix()}${message}`, ...args);
110
+ }
111
+ }
112
+ async listLogs(_transportId, _params) {
113
+ return { logs: [], total: 0, page: _params?.page ?? 1, perPage: _params?.perPage ?? 100, hasMore: false };
114
+ }
115
+ async listLogsByRunId(_args) {
116
+ return { logs: [], total: 0, page: _args.page ?? 1, perPage: _args.perPage ?? 100, hasMore: false };
117
+ }
118
+ };
119
+
120
+ // ../../packages/_internal-core/dist/base/index.js
121
+ var MastraBase = class {
122
+ component = RegisteredLogger.LLM;
123
+ logger;
124
+ name;
125
+ #rawConfig;
126
+ constructor({
127
+ component,
128
+ name,
129
+ rawConfig
130
+ }) {
131
+ this.component = component || RegisteredLogger.LLM;
132
+ this.name = name;
133
+ this.#rawConfig = rawConfig;
134
+ this.logger = new ConsoleLogger({ name: `${this.component} - ${this.name}` });
135
+ }
136
+ /**
137
+ * Returns the raw storage configuration this primitive was created from,
138
+ * or undefined if it was created from code.
139
+ */
140
+ toRawConfig() {
141
+ return this.#rawConfig;
142
+ }
143
+ /**
144
+ * Sets the raw storage configuration for this primitive.
145
+ * @internal
146
+ */
147
+ __setRawConfig(rawConfig) {
148
+ this.#rawConfig = rawConfig;
149
+ }
150
+ /**
151
+ * Set the logger for the agent
152
+ * @param logger
153
+ */
154
+ __setLogger(logger) {
155
+ this.logger = "child" in logger && typeof logger.child === "function" ? logger.child({ component: this.component }) : logger;
156
+ }
157
+ };
158
+
159
+ // ../../packages/_internals/voice/dist/chunk-NWNKSBZV.js
160
+ var MastraVoice = class extends MastraBase {
161
+ listeningModel;
162
+ speechModel;
163
+ speaker;
164
+ realtimeConfig;
165
+ constructor({ listeningModel, speechModel, speaker, realtimeConfig, name } = {}) {
166
+ super({
167
+ component: "VOICE",
168
+ name
169
+ });
170
+ this.listeningModel = listeningModel;
171
+ this.speechModel = speechModel;
172
+ this.speaker = speaker;
173
+ this.realtimeConfig = realtimeConfig;
174
+ }
175
+ /**
176
+ * Custom serialization for tracing/observability spans.
177
+ * Excludes `apiKey` from listeningModel / speechModel / realtimeConfig
178
+ * and any provider-specific state held by subclasses. Subclasses that
179
+ * need to expose additional non-sensitive fields can override.
180
+ */
181
+ serializeForSpan() {
182
+ return {
183
+ component: "VOICE",
184
+ name: this.name,
185
+ speaker: this.speaker,
186
+ listeningModel: this.listeningModel ? { name: this.listeningModel.name } : void 0,
187
+ speechModel: this.speechModel ? { name: this.speechModel.name } : void 0,
188
+ realtimeModel: this.realtimeConfig?.model
189
+ };
190
+ }
191
+ updateConfig(_options) {
192
+ this.logger.debug("updateConfig not implemented by this voice provider");
193
+ }
194
+ /**
195
+ * Initializes a WebSocket or WebRTC connection for real-time communication
196
+ * @returns Promise that resolves when the connection is established
197
+ */
198
+ async connect(_options) {
199
+ this.logger.debug("connect not implemented by this voice provider");
200
+ }
201
+ /**
202
+ * Relay audio data to the voice provider for real-time processing
203
+ * @param audioData Audio data to relay
204
+ */
205
+ async send(_audioData) {
206
+ this.logger.debug("relay not implemented by this voice provider");
207
+ }
208
+ /**
209
+ * Trigger voice providers to respond
210
+ */
211
+ async answer(_options) {
212
+ this.logger.debug("answer not implemented by this voice provider");
213
+ }
214
+ /**
215
+ * Equip the voice provider with instructions
216
+ * @param instructions Instructions to add
217
+ */
218
+ addInstructions(_instructions) {
219
+ }
220
+ /**
221
+ * Equip the voice provider with tools
222
+ * @param tools Array of tools to add
223
+ */
224
+ addTools(_tools) {
225
+ }
226
+ /**
227
+ * Disconnect from the WebSocket or WebRTC connection
228
+ */
229
+ close() {
230
+ this.logger.debug("close not implemented by this voice provider");
231
+ }
232
+ /**
233
+ * Register an event listener
234
+ * @param event Event name (e.g., 'speaking', 'writing', 'error')
235
+ * @param callback Callback function that receives event data
236
+ */
237
+ on(_event, _callback) {
238
+ this.logger.debug("on not implemented by this voice provider");
239
+ }
240
+ /**
241
+ * Remove an event listener
242
+ * @param event Event name (e.g., 'speaking', 'writing', 'error')
243
+ * @param callback Callback function to remove
244
+ */
245
+ off(_event, _callback) {
246
+ this.logger.debug("off not implemented by this voice provider");
247
+ }
248
+ /**
249
+ * Get available speakers/voices
250
+ * @returns Array of available voice IDs and their metadata
251
+ */
252
+ getSpeakers() {
253
+ this.logger.debug("getSpeakers not implemented by this voice provider");
254
+ return Promise.resolve([]);
255
+ }
256
+ /**
257
+ * Get available speakers/voices
258
+ * @returns Array of available voice IDs and their metadata
259
+ */
260
+ getListener() {
261
+ this.logger.debug("getListener not implemented by this voice provider");
262
+ return Promise.resolve({ enabled: false });
263
+ }
264
+ };
265
+
8
266
  // src/voices.ts
9
267
  var MURF_VOICES = [
10
268
  "en-UK-hazel",
@@ -152,7 +410,7 @@ var MURF_VOICES = [
152
410
  var DEFAULT_RETRY_COUNT = 2;
153
411
  var RETRY_STATUS_CODES = /* @__PURE__ */ new Set([408, 413, 429, 500, 502, 503, 504]);
154
412
  var RETRY_DELAY_MS = 300;
155
- var MurfVoice = class extends voice.MastraVoice {
413
+ var MurfVoice = class extends MastraVoice {
156
414
  baseUrl = "https://api.murf.ai";
157
415
  apiKey;
158
416
  defaultVoice;