@mastra/voice-openai-realtime 0.13.2 → 0.13.3-alpha.1

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,18 @@
1
1
  # @mastra/voice-openai-realtime
2
2
 
3
+ ## 0.13.3-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated the ws dependency to ^8.21.0 to pull in fixes for an uninitialized memory disclosure (GHSA-58qx-3vcg-4xpx) and a memory exhaustion denial-of-service (GHSA-96hv-2xvq-fx4p) in the WebSocket server. ([#18789](https://github.com/mastra-ai/mastra/pull/18789))
8
+
9
+ ## 0.13.3-alpha.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`1042cb4`](https://github.com/mastra-ai/mastra/commit/1042cb4da227c0a1315a6362262be3058866c5f8)]:
14
+ - @mastra/schema-compat@1.3.3-alpha.0
15
+
3
16
  ## 0.13.2
4
17
 
5
18
  ### Patch Changes
@@ -129,6 +129,16 @@ declare class RequestContext<Values extends Record<string, any> | unknown = unkn
129
129
  * a clean JSON-safe dict for cross-context cycles.
130
130
  */
131
131
  private isSerializable;
132
+ /**
133
+ * Custom span serialization to prevent leaking internal state (like auth
134
+ * tokens stored in the private `registry` Map) into observability spans.
135
+ *
136
+ * `deepClean` in `@mastra/observability` calls this method before falling
137
+ * back to `Object.keys()` — which would walk the runtime-enumerable
138
+ * `registry` field and serialize its raw Map entries (including any
139
+ * bearer tokens) into exported spans.
140
+ */
141
+ serializeForSpan(): Record<string, unknown>;
132
142
  /**
133
143
  * Get all values as a typed object for destructuring.
134
144
  * Returns Record<string, any> when untyped, or the Values type when typed.
@@ -3,7 +3,7 @@ name: mastra-voice-openai-realtime
3
3
  description: Documentation for @mastra/voice-openai-realtime. Use when working with @mastra/voice-openai-realtime APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/voice-openai-realtime"
6
- version: "0.13.2"
6
+ version: "0.13.3-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.13.2",
2
+ "version": "0.13.3-alpha.1",
3
3
  "package": "@mastra/voice-openai-realtime",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # Voice
2
4
 
3
5
  Mastra agents can be enhanced with voice capabilities, allowing them to speak responses and listen to user input. You can configure an agent to use either a single voice provider or combine multiple providers for different operations.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # Voice in Mastra
2
4
 
3
5
  Mastra's Voice system provides a unified interface for voice interactions, enabling text-to-speech (TTS), speech-to-text (STT), and real-time speech-to-speech (STS) capabilities in your applications.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # Speech-to-Speech capabilities in Mastra
2
4
 
3
5
  ## Introduction
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # OpenAI Realtime voice
2
4
 
3
5
  The OpenAIRealtimeVoice class provides real-time voice interaction capabilities using OpenAI's WebSocket-based API. It supports real time speech to speech, voice activity detection, and event-based audio streaming.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.addInstructions()
2
4
 
3
5
  The `addInstructions()` method equips a voice provider with instructions that guide the model's behavior during real-time interactions. This is particularly useful for real-time voice providers that maintain context across a conversation.
@@ -18,6 +20,7 @@ const voice = new OpenAIRealtimeVoice({
18
20
 
19
21
  // Create an agent with the voice provider
20
22
  const agent = new Agent({
23
+ id: 'customer-support-agent',
21
24
  name: 'Customer Support Agent',
22
25
  instructions: 'You are a helpful customer support agent for a software company.',
23
26
  model: 'openai/gpt-5.5',
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.addTools()
2
4
 
3
5
  The `addTools()` method equips a voice provider with tools (functions) that can be called by the model during real-time interactions. This enables voice assistants to perform actions like searching for information, making calculations, or interacting with external systems.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.answer()
2
4
 
3
5
  The `answer()` method is used in real-time voice providers to trigger the AI to generate a response. This method is particularly useful in speech-to-speech conversations where you need to explicitly signal the AI to respond after receiving user input.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.close()
2
4
 
3
5
  The `close()` method disconnects from a real-time voice service and cleans up resources. This is important for properly ending voice sessions and preventing resource leaks.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.connect()
2
4
 
3
5
  The `connect()` method establishes a WebSocket or WebRTC connection for real-time speech-to-speech communication. This method must be called before using other real-time features like `send()` or `answer()`.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.listen()
2
4
 
3
5
  The `listen()` method is a core function available in all Mastra voice providers that converts speech to text. It takes an audio stream as input and returns the transcribed text.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.off()
2
4
 
3
5
  The `off()` method removes event listeners previously registered with the `on()` method. This is particularly useful for cleaning up resources and preventing memory leaks in long-running applications with real-time voice capabilities.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.on()
2
4
 
3
5
  The `on()` method registers event listeners for various voice events. This is particularly important for real-time voice providers, where events are used to communicate transcribed text, audio responses, and other state changes.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.send()
2
4
 
3
5
  The `send()` method streams audio data in real-time to voice providers for continuous processing. This method is essential for real-time speech-to-speech conversations, allowing you to send microphone input directly to the AI service.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.speak()
2
4
 
3
5
  The `speak()` method is a core function available in all Mastra voice providers that converts text to speech. It takes text input and returns an audio stream that can be played or saved.
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # voice.updateConfig()
2
4
 
3
5
  The `updateConfig()` method allows you to update the configuration of a voice provider at runtime. This is useful for changing voice settings, API keys, or other provider-specific options without creating a new instance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/voice-openai-realtime",
3
- "version": "0.13.2",
3
+ "version": "0.13.3-alpha.1",
4
4
  "description": "Mastra OpenAI Realtime API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,8 +25,8 @@
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
27
  "openai-realtime-api": "^1.0.8",
28
- "ws": "^8.20.0",
29
- "@mastra/schema-compat": "1.3.2"
28
+ "ws": "^8.21.0",
29
+ "@mastra/schema-compat": "1.3.3-alpha.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "22.19.21",