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

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.4 build /home/runner/work/mastra/mastra/voice/openai-realtime-api
2
+ > @mastra/voice-openai-realtime@0.2.0-alpha.6 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 7973ms
9
+ TSC ⚡️ Build success in 7916ms
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 10979ms
16
+ DTS ⚡️ Build success in 11394ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
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
20
+ CJS dist/index.cjs 19.12 KB
21
+ CJS ⚡️ Build success in 1059ms
22
+ ESM dist/index.js 19.06 KB
23
+ ESM ⚡️ Build success in 1065ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @mastra/voice-openai-realtime
2
2
 
3
+ ## 0.2.0-alpha.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7e92011]
8
+ - @mastra/core@0.9.0-alpha.4
9
+
10
+ ## 0.2.0-alpha.5
11
+
12
+ ### Patch Changes
13
+
14
+ - 6cf1417: Voice reference and tool-call-start
15
+ - Updated dependencies [fe3ae4d]
16
+ - @mastra/core@0.9.0-alpha.3
17
+
3
18
  ## 0.2.0-alpha.4
4
19
 
5
20
  ### Minor Changes
package/README.md CHANGED
@@ -20,6 +20,7 @@ OPENAI_API_KEY=your_api_key
20
20
 
21
21
  ```typescript
22
22
  import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime';
23
+ import { getMicrophoneStream } from '@mastra/node-audio';
23
24
 
24
25
  // Create a voice instance with default configuration
25
26
  const voice = new OpenAIRealtimeVoice();
package/dist/index.cjs CHANGED
@@ -548,16 +548,25 @@ var OpenAIRealtimeVoice = class extends voice.MastraVoice {
548
548
  console.warn(`Tool "${output.name}" not found`);
549
549
  return;
550
550
  }
551
+ if (tool?.execute) {
552
+ this.emit("tool-call-start", {
553
+ toolCallId: output.call_id,
554
+ toolName: output.name,
555
+ toolDescription: tool.description,
556
+ args: context
557
+ });
558
+ }
551
559
  const result = await tool?.execute?.(
552
560
  { context },
553
561
  {
554
- toolCallId: "unknown",
562
+ toolCallId: output.call_id,
555
563
  messages: []
556
564
  }
557
565
  );
558
- this.emit("tool-result", {
566
+ this.emit("tool-call-result", {
559
567
  toolCallId: output.call_id,
560
568
  toolName: output.name,
569
+ toolDescription: tool.description,
561
570
  args: context,
562
571
  result
563
572
  });
package/dist/index.js CHANGED
@@ -546,16 +546,25 @@ var OpenAIRealtimeVoice = class extends MastraVoice {
546
546
  console.warn(`Tool "${output.name}" not found`);
547
547
  return;
548
548
  }
549
+ if (tool?.execute) {
550
+ this.emit("tool-call-start", {
551
+ toolCallId: output.call_id,
552
+ toolName: output.name,
553
+ toolDescription: tool.description,
554
+ args: context
555
+ });
556
+ }
549
557
  const result = await tool?.execute?.(
550
558
  { context },
551
559
  {
552
- toolCallId: "unknown",
560
+ toolCallId: output.call_id,
553
561
  messages: []
554
562
  }
555
563
  );
556
- this.emit("tool-result", {
564
+ this.emit("tool-call-result", {
557
565
  toolCallId: output.call_id,
558
566
  toolName: output.name,
567
+ toolDescription: tool.description,
559
568
  args: context,
560
569
  result
561
570
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/voice-openai-realtime",
3
- "version": "0.2.0-alpha.4",
3
+ "version": "0.2.0-alpha.6",
4
4
  "description": "Mastra OpenAI Realtime API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "openai-realtime-api": "^1.0.7",
24
24
  "ws": "^8.18.1",
25
25
  "zod-to-json-schema": "^3.24.5",
26
- "@mastra/core": "^0.8.4-alpha.2"
26
+ "@mastra/core": "^0.9.0-alpha.4"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@microsoft/api-extractor": "^7.52.2",
package/src/index.ts CHANGED
@@ -627,19 +627,32 @@ export class OpenAIRealtimeVoice extends MastraVoice {
627
627
  console.warn(`Tool "${output.name}" not found`);
628
628
  return;
629
629
  }
630
+
631
+ if (tool?.execute) {
632
+ this.emit('tool-call-start', {
633
+ toolCallId: output.call_id,
634
+ toolName: output.name,
635
+ toolDescription: tool.description,
636
+ args: context,
637
+ });
638
+ }
639
+
630
640
  const result = await tool?.execute?.(
631
641
  { context },
632
642
  {
633
- toolCallId: 'unknown',
643
+ toolCallId: output.call_id,
634
644
  messages: [],
635
645
  },
636
646
  );
637
- this.emit('tool-result', {
647
+
648
+ this.emit('tool-call-result', {
638
649
  toolCallId: output.call_id,
639
650
  toolName: output.name,
651
+ toolDescription: tool.description,
640
652
  args: context,
641
653
  result,
642
654
  });
655
+
643
656
  this.sendEvent('conversation.item.create', {
644
657
  item: {
645
658
  type: 'function_call_output',