@mastra/voice-aws-nova-sonic 0.0.0 → 0.1.0-alpha.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 +16 -13
- package/LICENSE.md +30 -0
- package/README.md +6 -5
- package/dist/docs/SKILL.md +27 -0
- package/dist/docs/assets/SOURCE_MAP.json +6 -0
- package/dist/docs/references/docs-voice-overview.md +1028 -0
- package/dist/docs/references/docs-voice-speech-to-speech.md +146 -0
- package/dist/docs/references/reference-voice-aws-nova-sonic.md +247 -0
- package/dist/index.cjs +157 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +157 -77
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/auth.d.ts.map +1 -1
- package/package.json +21 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mastra/voice-aws-nova-sonic
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 0.1.0-alpha.0
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
|
+
### Minor Changes
|
|
7
6
|
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
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
|
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',
|
|
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-alpha.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.
|