@mastra/voice-openai-realtime 0.2.0-alpha.3 → 0.2.0-alpha.4

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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/voice-openai-realtime@0.2.0-alpha.3 build /home/runner/work/mastra/mastra/voice/openai-realtime-api
2
+ > @mastra/voice-openai-realtime@0.2.0-alpha.4 build /home/runner/work/mastra/mastra/voice/openai-realtime-api
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 10105ms
9
+ TSC ⚡️ Build success in 7973ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.2
13
13
  Writing package typings: /home/runner/work/mastra/mastra/voice/openai-realtime-api/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.2
15
15
  Writing package typings: /home/runner/work/mastra/mastra/voice/openai-realtime-api/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 11772ms
16
+ DTS ⚡️ Build success in 10979ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 18.72 KB
21
- ESM ⚡️ Build success in 762ms
22
- CJS dist/index.cjs 18.77 KB
23
- CJS ⚡️ Build success in 764ms
20
+ ESM dist/index.js 18.79 KB
21
+ ESM ⚡️ Build success in 851ms
22
+ CJS dist/index.cjs 18.84 KB
23
+ CJS ⚡️ Build success in 859ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @mastra/voice-openai-realtime
2
2
 
3
+ ## 0.2.0-alpha.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 1ef0f1f: Disconnect
8
+
3
9
  ## 0.2.0-alpha.3
4
10
 
5
11
  ### Minor Changes
@@ -221,6 +221,7 @@ export declare class OpenAIRealtimeVoice extends MastraVoice {
221
221
  * ```
222
222
  */
223
223
  connect(): Promise<void>;
224
+ disconnect(): void;
224
225
  /**
225
226
  * Streams audio data in real-time to the OpenAI service.
226
227
  * Useful for continuous audio streaming scenarios like live microphone input.
@@ -221,6 +221,7 @@ export declare class OpenAIRealtimeVoice extends MastraVoice {
221
221
  * ```
222
222
  */
223
223
  connect(): Promise<void>;
224
+ disconnect(): void;
224
225
  /**
225
226
  * Streams audio data in real-time to the OpenAI service.
226
227
  * Useful for continuous audio streaming scenarios like live microphone input.
package/dist/index.cjs CHANGED
@@ -322,8 +322,7 @@ var OpenAIRealtimeVoice = class extends voice.MastraVoice {
322
322
  }
323
323
  });
324
324
  this.setupEventListeners();
325
- await this.waitForOpen();
326
- await this.waitForSessionCreated();
325
+ await Promise.all([this.waitForOpen(), this.waitForSessionCreated()]);
327
326
  const openaiTools = transformTools(this.tools);
328
327
  this.updateConfig({
329
328
  instructions: this.instructions,
@@ -335,6 +334,10 @@ var OpenAIRealtimeVoice = class extends voice.MastraVoice {
335
334
  });
336
335
  this.state = "open";
337
336
  }
337
+ disconnect() {
338
+ this.state = "close";
339
+ this.ws?.close();
340
+ }
338
341
  /**
339
342
  * Streams audio data in real-time to the OpenAI service.
340
343
  * Useful for continuous audio streaming scenarios like live microphone input.
package/dist/index.js CHANGED
@@ -320,8 +320,7 @@ var OpenAIRealtimeVoice = class extends MastraVoice {
320
320
  }
321
321
  });
322
322
  this.setupEventListeners();
323
- await this.waitForOpen();
324
- await this.waitForSessionCreated();
323
+ await Promise.all([this.waitForOpen(), this.waitForSessionCreated()]);
325
324
  const openaiTools = transformTools(this.tools);
326
325
  this.updateConfig({
327
326
  instructions: this.instructions,
@@ -333,6 +332,10 @@ var OpenAIRealtimeVoice = class extends MastraVoice {
333
332
  });
334
333
  this.state = "open";
335
334
  }
335
+ disconnect() {
336
+ this.state = "close";
337
+ this.ws?.close();
338
+ }
336
339
  /**
337
340
  * Streams audio data in real-time to the OpenAI service.
338
341
  * Useful for continuous audio streaming scenarios like live microphone input.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/voice-openai-realtime",
3
- "version": "0.2.0-alpha.3",
3
+ "version": "0.2.0-alpha.4",
4
4
  "description": "Mastra OpenAI Realtime API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -378,8 +378,7 @@ export class OpenAIRealtimeVoice extends MastraVoice {
378
378
  });
379
379
 
380
380
  this.setupEventListeners();
381
- await this.waitForOpen();
382
- await this.waitForSessionCreated();
381
+ await Promise.all([this.waitForOpen(), this.waitForSessionCreated()]);
383
382
 
384
383
  const openaiTools = transformTools(this.tools);
385
384
  this.updateConfig({
@@ -393,6 +392,11 @@ export class OpenAIRealtimeVoice extends MastraVoice {
393
392
  this.state = 'open';
394
393
  }
395
394
 
395
+ disconnect() {
396
+ this.state = 'close';
397
+ this.ws?.close();
398
+ }
399
+
396
400
  /**
397
401
  * Streams audio data in real-time to the OpenAI service.
398
402
  * Useful for continuous audio streaming scenarios like live microphone input.