@mastra/voice-aws-nova-sonic 0.2.2 → 0.2.3

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.
Files changed (60) hide show
  1. package/dist/_types/@internal_voice/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +371 -29
  2. package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts +35 -1
  3. package/dist/_types/@internal_voice/dist/_types/zod/v3/ZodError.d.ts +1 -1
  4. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/checks.d.ts +1 -1
  5. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/compat.d.ts +9 -11
  6. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/deep-partial.d.ts +14 -0
  7. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/errors.d.ts +3 -4
  8. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/external.d.ts +5 -2
  9. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/in-out.d.ts +8 -0
  10. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/index.d.ts +1 -2
  11. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/iso.d.ts +2 -17
  12. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/parse.d.ts +17 -4
  13. package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/schemas.d.ts +68 -19
  14. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/api.d.ts +22 -12
  15. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/checks.d.ts +29 -13
  16. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/compile.d.ts +65 -0
  17. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/core.d.ts +16 -4
  18. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/doc.d.ts +3 -1
  19. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/errors.d.ts +4 -0
  20. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/index.d.ts +3 -0
  21. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-generator.d.ts +2 -2
  22. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-processors.d.ts +16 -0
  23. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema.d.ts +2 -1
  24. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/memoizer.d.ts +15 -0
  25. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/parse.d.ts +14 -11
  26. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/regexes.d.ts +5 -0
  27. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/schemas.d.ts +123 -34
  28. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/to-json-schema.d.ts +45 -5
  29. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/util.d.ts +79 -1
  30. package/dist/_types/@internal_voice/dist/_types/zod/v4/core/versions.d.ts +1 -1
  31. package/dist/_types/@internal_voice/dist/_types/zod/v4/index.d.cts +2 -2
  32. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/bn.d.ts +4 -0
  33. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ckb.d.ts +4 -0
  34. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/gu.d.ts +4 -0
  35. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/hi.d.ts +4 -0
  36. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/index.d.ts +11 -0
  37. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/kn.d.ts +4 -0
  38. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ne.d.ts +4 -0
  39. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/nn.d.ts +4 -0
  40. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/pt-BR.d.ts +4 -0
  41. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/sk.d.ts +4 -0
  42. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tg.d.ts +4 -0
  43. package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tk.d.ts +4 -0
  44. package/dist/_types/@internal_voice/dist/index.d.ts +2 -2
  45. package/dist/_types/@internal_voice/dist/voice/aisdk/speech.d.ts +1 -1
  46. package/dist/_types/@internal_voice/dist/voice/aisdk/transcription.d.ts +1 -1
  47. package/dist/_types/@internal_voice/dist/voice/composite-voice.d.ts +2 -2
  48. package/dist/_types/@internal_voice/dist/voice/voice.d.ts +2 -2
  49. package/dist/_types/@internal_voice/package.json +1 -0
  50. package/dist/docs/SKILL.md +1 -1
  51. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  52. package/dist/docs/references/reference-voice-overview.md +25 -0
  53. package/dist/index.cjs +4 -5
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +4 -5
  58. package/dist/index.js.map +1 -1
  59. package/package.json +8 -8
  60. package/dist/_types/@internal_voice/dist/_types/zod/v3/index.d.cts +0 -4
@@ -2,7 +2,9 @@ export { default as ar } from "./ar.js";
2
2
  export { default as az } from "./az.js";
3
3
  export { default as be } from "./be.js";
4
4
  export { default as bg } from "./bg.js";
5
+ export { default as bn } from "./bn.js";
5
6
  export { default as ca } from "./ca.js";
7
+ export { default as ckb } from "./ckb.js";
6
8
  export { default as cs } from "./cs.js";
7
9
  export { default as da } from "./da.js";
8
10
  export { default as de } from "./de.js";
@@ -14,7 +16,9 @@ export { default as fa } from "./fa.js";
14
16
  export { default as fi } from "./fi.js";
15
17
  export { default as fr } from "./fr.js";
16
18
  export { default as frCA } from "./fr-CA.js";
19
+ export { default as gu } from "./gu.js";
17
20
  export { default as he } from "./he.js";
21
+ export { default as hi } from "./hi.js";
18
22
  export { default as hr } from "./hr.js";
19
23
  export { default as hu } from "./hu.js";
20
24
  export { default as hy } from "./hy.js";
@@ -25,22 +29,29 @@ export { default as ja } from "./ja.js";
25
29
  export { default as ka } from "./ka.js";
26
30
  export { default as kh } from "./kh.js";
27
31
  export { default as km } from "./km.js";
32
+ export { default as kn } from "./kn.js";
28
33
  export { default as ko } from "./ko.js";
29
34
  export { default as lt } from "./lt.js";
30
35
  export { default as mk } from "./mk.js";
31
36
  export { default as ms } from "./ms.js";
37
+ export { default as ne } from "./ne.js";
32
38
  export { default as nl } from "./nl.js";
39
+ export { default as nn } from "./nn.js";
33
40
  export { default as no } from "./no.js";
34
41
  export { default as ota } from "./ota.js";
35
42
  export { default as ps } from "./ps.js";
36
43
  export { default as pl } from "./pl.js";
37
44
  export { default as pt } from "./pt.js";
45
+ export { default as ptBR } from "./pt-BR.js";
38
46
  export { default as ro } from "./ro.js";
39
47
  export { default as ru } from "./ru.js";
48
+ export { default as sk } from "./sk.js";
40
49
  export { default as sl } from "./sl.js";
41
50
  export { default as sv } from "./sv.js";
42
51
  export { default as ta } from "./ta.js";
52
+ export { default as tg } from "./tg.js";
43
53
  export { default as th } from "./th.js";
54
+ export { default as tk } from "./tk.js";
44
55
  export { default as tr } from "./tr.js";
45
56
  export { default as ua } from "./ua.js";
46
57
  export { default as uk } from "./uk.js";
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -1,6 +1,6 @@
1
1
  export * from './voice/index.js';
2
- export type { RequestContext } from './_types/@internal_core/dist/request-context/index.d.ts';
3
- export type { ToolsInput } from './_types/@internal_core/dist/types/index.d.ts';
2
+ export type { RequestContext } from './_types/@internal_core/dist/request-context/index.js';
3
+ export type { ToolsInput } from './_types/@internal_core/dist/types/index.js';
4
4
  type InferToolInput<TInputSchema> = TInputSchema extends {
5
5
  _input: infer TInput;
6
6
  } ? TInput : unknown;
@@ -1,4 +1,4 @@
1
- import type { SpeechModel } from '../../_types/@internal_ai-sdk-v5/dist/index.d.ts';
1
+ import type { SpeechModel } from '../../_types/@internal_ai-sdk-v5/dist/index.js';
2
2
  import { MastraVoice } from '../voice.js';
3
3
  export declare class AISDKSpeech extends MastraVoice {
4
4
  private model;
@@ -1,4 +1,4 @@
1
- import type { TranscriptionModel } from '../../_types/@internal_ai-sdk-v5/dist/index.d.ts';
1
+ import type { TranscriptionModel } from '../../_types/@internal_ai-sdk-v5/dist/index.js';
2
2
  import { MastraVoice } from '../voice.js';
3
3
  export declare class AISDKTranscription extends MastraVoice {
4
4
  private model;
@@ -1,5 +1,5 @@
1
- import type { TranscriptionModel, SpeechModel } from '../_types/@internal_ai-sdk-v5/dist/index.d.ts';
2
- import type { ToolsInput } from '../_types/@internal_core/dist/types/index.d.ts';
1
+ import type { TranscriptionModel, SpeechModel } from '../_types/@internal_ai-sdk-v5/dist/index.js';
2
+ import type { ToolsInput } from '../_types/@internal_core/dist/types/index.js';
3
3
  import { MastraVoice } from './voice.js';
4
4
  import type { VoiceEventType, VoiceEventMap } from '.';
5
5
  export declare class CompositeVoice extends MastraVoice<unknown, unknown, unknown, ToolsInput, VoiceEventMap> {
@@ -1,5 +1,5 @@
1
- import { MastraBase } from '../_types/@internal_core/dist/base/index.d.ts';
2
- import type { ToolsInput } from '../_types/@internal_core/dist/types/index.d.ts';
1
+ import { MastraBase } from '../_types/@internal_core/dist/base/index.js';
2
+ import type { ToolsInput } from '../_types/@internal_core/dist/types/index.js';
3
3
  export type VoiceEventType = 'speaking' | 'writing' | 'error' | string;
4
4
  export interface VoiceEventMap {
5
5
  speaker: NodeJS.ReadableStream;
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -3,7 +3,7 @@ name: mastra-voice-aws-nova-sonic
3
3
  description: Documentation for @mastra/voice-aws-nova-sonic. Use when working with @mastra/voice-aws-nova-sonic APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/voice-aws-nova-sonic"
6
- version: "0.2.2"
6
+ version: "0.2.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.2",
2
+ "version": "0.2.3",
3
3
  "package": "@mastra/voice-aws-nova-sonic",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -882,6 +882,18 @@ const voice = new DeepgramVoice({
882
882
 
883
883
  Visit the [Deepgram Voice Reference](https://mastra.ai/integrations/voice/deepgram) for more information on the Deepgram voice provider.
884
884
 
885
+ **Gladia**:
886
+
887
+ ```typescript
888
+ const voice = new GladiaVoice({
889
+ listeningModel: {
890
+ apiKey: process.env.GLADIA_API_KEY,
891
+ },
892
+ })
893
+ ```
894
+
895
+ Visit the [Gladia Voice integration](https://mastra.ai/integrations/voice/gladia) for configuration and transcription options.
896
+
885
897
  **Inworld**:
886
898
 
887
899
  ```typescript
@@ -965,6 +977,19 @@ const voice = new MurfVoice({
965
977
 
966
978
  Visit the [Murf Voice Reference](https://mastra.ai/integrations/voice/murf) for more information on the Murf voice provider.
967
979
 
980
+ **ModelsLab**:
981
+
982
+ ```typescript
983
+ const voice = new ModelsLabVoice({
984
+ speechModel: {
985
+ apiKey: process.env.MODELSLAB_API_KEY,
986
+ },
987
+ speaker: '5',
988
+ })
989
+ ```
990
+
991
+ Visit the [ModelsLab Voice integration](https://mastra.ai/integrations/voice/modelslab) for configuration and synthesis options.
992
+
968
993
  **OpenAI Realtime**:
969
994
 
970
995
  ```typescript
package/dist/index.cjs CHANGED
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let crypto = require("crypto");
3
2
  let stream = require("stream");
4
3
  let _aws_sdk_client_bedrock_runtime = require("@aws-sdk/client-bedrock-runtime");
5
4
  let _smithy_node_http_handler = require("@smithy/node-http-handler");
@@ -960,7 +959,7 @@ var NovaSonicVoice = class extends MastraVoice {
960
959
  const eventQueue = this._eventQueue;
961
960
  if (!eventQueue) throw new NovaSonicError("connection_failed", "Event queue must be initialized before enqueueing session events");
962
961
  this.log("Pre-populating queue with sessionStart and promptStart events...");
963
- const promptName = (0, crypto.randomUUID)();
962
+ const promptName = globalThis.crypto.randomUUID();
964
963
  this._promptName = promptName;
965
964
  const sessionStartEvent = {};
966
965
  if (this.sessionConfig) {
@@ -1021,7 +1020,7 @@ var NovaSonicVoice = class extends MastraVoice {
1021
1020
  else if (this.sessionConfig?.toolChoice) promptStartEvent.toolConfiguration = { toolChoice: this.sessionConfig.toolChoice };
1022
1021
  eventQueue.push({ event: { promptStart: promptStartEvent } });
1023
1022
  this.promptStarted = true;
1024
- const systemContentName = (0, crypto.randomUUID)();
1023
+ const systemContentName = globalThis.crypto.randomUUID();
1025
1024
  eventQueue.push({ event: { contentStart: {
1026
1025
  promptName,
1027
1026
  contentName: systemContentName,
@@ -1592,7 +1591,7 @@ var NovaSonicVoice = class extends MastraVoice {
1592
1591
  const promptName = this._promptName;
1593
1592
  if (!promptName) throw new NovaSonicError("not_connected", "Prompt name not initialized. Connection may not be fully established.");
1594
1593
  if (!this.promptStarted) throw new NovaSonicError("invalid_state", "Prompt not started. This should not happen - prompt should be started during connection.");
1595
- const contentName = (0, crypto.randomUUID)();
1594
+ const contentName = globalThis.crypto.randomUUID();
1596
1595
  await this.sendClientEvent({ contentStart: {
1597
1596
  promptName,
1598
1597
  contentName,
@@ -1650,7 +1649,7 @@ var NovaSonicVoice = class extends MastraVoice {
1650
1649
  const promptName = this._promptName;
1651
1650
  if (!promptName) throw new NovaSonicError("not_connected", "Prompt name not initialized. Connection may not be fully established.");
1652
1651
  if (!this.audioContentStarted) {
1653
- const audioContentId = (0, crypto.randomUUID)();
1652
+ const audioContentId = globalThis.crypto.randomUUID();
1654
1653
  this.audioContentName = audioContentId;
1655
1654
  this.log(`[send] First audio send - sending AUDIO contentStart with contentName: ${audioContentId}`);
1656
1655
  await this.sendClientEvent({ contentStart: {