@mastra/voice-openai-realtime 0.0.0-revert-schema-20250416221206 → 0.0.0-vnextWorkflows-20250417075051

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,6 +1,6 @@
1
1
  # @mastra/voice-openai-realtime
2
2
 
3
- ## 0.0.0-revert-schema-20250416221206
3
+ ## 0.0.0-vnextWorkflows-20250417075051
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -10,12 +10,21 @@
10
10
 
11
11
  ### Patch Changes
12
12
 
13
+ - 6cf1417: Voice reference and tool-call-start
13
14
  - Updated dependencies [9ee4293]
14
15
  - Updated dependencies [03f3cd0]
15
16
  - Updated dependencies [8a8a73b]
16
17
  - Updated dependencies [fe3ae4d]
17
18
  - Updated dependencies [6f92295]
18
- - @mastra/core@0.0.0-revert-schema-20250416221206
19
+ - @mastra/core@0.0.0-vnextWorkflows-20250417075051
20
+
21
+ ## 0.2.0-alpha.5
22
+
23
+ ### Patch Changes
24
+
25
+ - 6cf1417: Voice reference and tool-call-start
26
+ - Updated dependencies [fe3ae4d]
27
+ - @mastra/core@0.9.0-alpha.3
19
28
 
20
29
  ## 0.2.0-alpha.4
21
30
 
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,14 +548,22 @@ 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,
561
569
  toolDescription: tool.description,
package/dist/index.js CHANGED
@@ -546,14 +546,22 @@ 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,
559
567
  toolDescription: tool.description,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/voice-openai-realtime",
3
- "version": "0.0.0-revert-schema-20250416221206",
3
+ "version": "0.0.0-vnextWorkflows-20250417075051",
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.0.0-revert-schema-20250416221206"
26
+ "@mastra/core": "0.0.0-vnextWorkflows-20250417075051"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@microsoft/api-extractor": "^7.52.2",
package/src/index.ts CHANGED
@@ -627,20 +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,
640
651
  toolDescription: tool.description,
641
652
  args: context,
642
653
  result,
643
654
  });
655
+
644
656
  this.sendEvent('conversation.item.create', {
645
657
  item: {
646
658
  type: 'function_call_output',