@mastra/voice-aws-nova-sonic 0.0.0 → 0.1.0

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,17 +1,44 @@
1
- # Changelog
1
+ # @mastra/voice-aws-nova-sonic
2
2
 
3
- All notable changes to this package will be documented in this file.
3
+ ## 0.1.0
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+ ### Minor Changes
7
6
 
8
- ## [0.12.0-beta.0] - 2026-02-18
7
+ - Add new `@mastra/voice-aws-nova-sonic` voice provider for AWS Bedrock Nova 2 Sonic. ([#13232](https://github.com/mastra-ai/mastra/pull/13232))
9
8
 
10
- ### Added
9
+ The provider exposes a real-time bidirectional voice interface backed by the
10
+ `InvokeModelWithBidirectionalStreamCommand` API on AWS Bedrock, including:
11
+ - Live microphone streaming (`send` / `listen`) and assistant audio playback
12
+ via `speaking` events
13
+ - Live transcription via `writing` events with `SPECULATIVE` / `FINAL`
14
+ generation stages
15
+ - Barge-in / interrupt detection
16
+ - Speaker selection across all 18 Nova Sonic voices and configurable
17
+ endpointing sensitivity
18
+ - Tool calling with per-session `RequestContext`
19
+ - Configurable AWS region, model id, credentials (or default credential
20
+ provider chain), and inference / turn-detection parameters
11
21
 
12
- - Initial release of AWS Nova 2 Sonic voice integration
13
- - Support for bidirectional streaming speech-to-speech
14
- - AWS SigV4 authentication for WebSocket connections
15
- - Polyglot voice support with multiple languages
16
- - Tool/function calling support
17
- - Cross-modal input (audio and text)
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [[`1723e09`](https://github.com/mastra-ai/mastra/commit/1723e099829892419ddbfe49287acfeac2522724), [`629f9e9`](https://github.com/mastra-ai/mastra/commit/629f9e9a7e56aa8f129515a3923c5813298790c7), [`25168fb`](https://github.com/mastra-ai/mastra/commit/25168fb9c1de9db7f8171df4f58ceb842c53aa29), [`ab34b5a`](https://github.com/mastra-ai/mastra/commit/ab34b5a2191b8e4353df1dbf7b9155e7d6628d79), [`5fb6c2a`](https://github.com/mastra-ai/mastra/commit/5fb6c2a95c1843cc231704b91354311fc1f34a71), [`2b0f355`](https://github.com/mastra-ai/mastra/commit/2b0f3553be3e9e5524da539a66e5cf82668440a4), [`394f0cf`](https://github.com/mastra-ai/mastra/commit/394f0cfc31e6b4d801219fdef2e9cc69e5bc8682), [`b2deb29`](https://github.com/mastra-ai/mastra/commit/b2deb29412b300c868655b5840463614fbb7962d), [`66644be`](https://github.com/mastra-ai/mastra/commit/66644beac1aa560f0e417956ff007c89341dc382), [`e109607`](https://github.com/mastra-ai/mastra/commit/e10960749251e34d46b480a20648c490fd30381b), [`310b953`](https://github.com/mastra-ai/mastra/commit/310b95345f302dcd5ba3ed862bdc96f059d44122), [`3d7f709`](https://github.com/mastra-ai/mastra/commit/3d7f709b615e588050bb6283c4ee5cfe2978cbde), [`48a42f1`](https://github.com/mastra-ai/mastra/commit/48a42f114a4006a95e0b7a1b5ad1a24815a175c2), [`8091c7c`](https://github.com/mastra-ai/mastra/commit/8091c7c944d15e13fef6d61b6cfd903f158d4006), [`2c83efc`](https://github.com/mastra-ai/mastra/commit/2c83efc4482b3efe50830e3b8b4ba9a8d219edff), [`43f0e1d`](https://github.com/mastra-ai/mastra/commit/43f0e1d5d5a74ba6fc746f2ad89ebe0c64777a7d), [`da0b9e2`](https://github.com/mastra-ai/mastra/commit/da0b9e2ba7ecc560213b426d6c097fe63946086e), [`282a10c`](https://github.com/mastra-ai/mastra/commit/282a10c9446e9922afe80e10e3770481c8ac8a28), [`04151c7`](https://github.com/mastra-ai/mastra/commit/04151c7dcea934b4fe9076708a23fac161195414), [`8091c7c`](https://github.com/mastra-ai/mastra/commit/8091c7c944d15e13fef6d61b6cfd903f158d4006)]:
25
+ - @mastra/core@1.31.0
26
+
27
+ ## 0.1.0-alpha.0
28
+
29
+ ### Minor Changes
30
+
31
+ - Add new `@mastra/voice-aws-nova-sonic` voice provider for AWS Bedrock Nova 2 Sonic. ([#13232](https://github.com/mastra-ai/mastra/pull/13232))
32
+
33
+ The provider exposes a real-time bidirectional voice interface backed by the
34
+ `InvokeModelWithBidirectionalStreamCommand` API on AWS Bedrock, including:
35
+ - Live microphone streaming (`send` / `listen`) and assistant audio playback
36
+ via `speaking` events
37
+ - Live transcription via `writing` events with `SPECULATIVE` / `FINAL`
38
+ generation stages
39
+ - Barge-in / interrupt detection
40
+ - Speaker selection across all 18 Nova Sonic voices and configurable
41
+ endpointing sensitivity
42
+ - Tool calling with per-session `RequestContext`
43
+ - Configurable AWS region, model id, credentials (or default credential
44
+ provider chain), and inference / turn-detection parameters
package/LICENSE.md ADDED
@@ -0,0 +1,30 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named "ee/" within this
4
+ repository, including but not limited to:
5
+ - `packages/core/src/auth/ee/`
6
+ - `packages/server/src/server/auth/ee/`
7
+ is licensed under the license defined in `ee/LICENSE`.
8
+
9
+ - All third-party components incorporated into the Mastra Software are
10
+ licensed under the original license provided by the owner of the
11
+ applicable component.
12
+
13
+ - Content outside of the above-mentioned directories or restrictions is
14
+ available under the "Apache License 2.0" as defined below.
15
+
16
+ # Apache License 2.0
17
+
18
+ Copyright (c) 2025 Kepler Software, Inc.
19
+
20
+ Licensed under the Apache License, Version 2.0 (the "License");
21
+ you may not use this file except in compliance with the License.
22
+ You may obtain a copy of the License at
23
+
24
+ http://www.apache.org/licenses/LICENSE-2.0
25
+
26
+ Unless required by applicable law or agreed to in writing, software
27
+ distributed under the License is distributed on an "AS IS" BASIS,
28
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ See the License for the specific language governing permissions and
30
+ limitations under the License.
package/README.md CHANGED
@@ -44,6 +44,7 @@ yarn add @mastra/voice-aws-nova-sonic
44
44
  You can configure AWS credentials in several ways:
45
45
 
46
46
  **Option 1: Environment Variables**
47
+
47
48
  ```bash
48
49
  export AWS_ACCESS_KEY_ID=your-access-key-id
49
50
  export AWS_SECRET_ACCESS_KEY=your-secret-access-key
@@ -51,6 +52,7 @@ export AWS_REGION=us-east-1
51
52
  ```
52
53
 
53
54
  **Option 2: AWS Credentials File**
55
+
54
56
  ```ini
55
57
  # ~/.aws/credentials
56
58
  [default]
@@ -59,9 +61,11 @@ aws_secret_access_key = your-secret-access-key
59
61
  ```
60
62
 
61
63
  **Option 3: IAM Role** (for EC2/Lambda)
64
+
62
65
  - Attach an IAM role with Bedrock permissions to your EC2 instance or Lambda function
63
66
 
64
67
  **Option 4: Explicit Credentials in Code**
68
+
65
69
  ```typescript
66
70
  import { NovaSonicVoice } from '@mastra/voice-aws-nova-sonic';
67
71
 
@@ -84,10 +88,7 @@ Your AWS credentials need the following IAM permissions:
84
88
  "Statement": [
85
89
  {
86
90
  "Effect": "Allow",
87
- "Action": [
88
- "bedrock:InvokeModel",
89
- "bedrock:InvokeModelWithBidirectionalStream"
90
- ],
91
+ "Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithBidirectionalStream"],
91
92
  "Resource": "arn:aws:bedrock:*::foundation-model/amazon.nova-2-sonic-v1:0"
92
93
  }
93
94
  ]
@@ -116,7 +117,7 @@ const agent = new Agent({
116
117
  await agent.voice.connect();
117
118
 
118
119
  // Listen for agent audio responses (stream of audio data)
119
- agent.voice.on('speaker', (audioStream) => {
120
+ agent.voice.on('speaker', audioStream => {
120
121
  // Pipe to your audio output (e.g., speaker, WebSocket, file)
121
122
  audioStream.pipe(yourAudioOutput);
122
123
  });
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: mastra-voice-aws-nova-sonic
3
+ description: Documentation for @mastra/voice-aws-nova-sonic. Use when working with @mastra/voice-aws-nova-sonic APIs, configuration, or implementation.
4
+ metadata:
5
+ package: "@mastra/voice-aws-nova-sonic"
6
+ version: "0.1.0"
7
+ ---
8
+
9
+ ## When to use
10
+
11
+ Use this skill whenever you are working with @mastra/voice-aws-nova-sonic to obtain the domain-specific knowledge.
12
+
13
+ ## How to use
14
+
15
+ Read the individual reference documents for detailed explanations and code examples.
16
+
17
+ ### Docs
18
+
19
+ - [Voice in Mastra](references/docs-voice-overview.md) - Overview of voice capabilities in Mastra, including text-to-speech, speech-to-text, and real-time speech-to-speech interactions.
20
+ - [Speech-to-Speech capabilities in Mastra](references/docs-voice-speech-to-speech.md) - Overview of speech-to-speech capabilities in Mastra, including real-time interactions and event-driven architecture.
21
+
22
+ ### Reference
23
+
24
+ - [Reference: AWS Nova Sonic voice](references/reference-voice-aws-nova-sonic.md) - Documentation for the NovaSonicVoice class, providing real-time speech-to-speech capabilities via AWS Bedrock Nova 2 Sonic.
25
+
26
+
27
+ Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "package": "@mastra/voice-aws-nova-sonic",
4
+ "exports": {},
5
+ "modules": {}
6
+ }