@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.
- package/dist/_types/@internal_voice/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +371 -29
- package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts +35 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v3/ZodError.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/checks.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/compat.d.ts +9 -11
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/deep-partial.d.ts +14 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/errors.d.ts +3 -4
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/external.d.ts +5 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/in-out.d.ts +8 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/index.d.ts +1 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/iso.d.ts +2 -17
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/parse.d.ts +17 -4
- package/dist/_types/@internal_voice/dist/_types/zod/v4/classic/schemas.d.ts +68 -19
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/api.d.ts +22 -12
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/checks.d.ts +29 -13
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/compile.d.ts +65 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/core.d.ts +16 -4
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/doc.d.ts +3 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/errors.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/index.d.ts +3 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/json-schema.d.ts +2 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/memoizer.d.ts +15 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/parse.d.ts +14 -11
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/regexes.d.ts +5 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/schemas.d.ts +123 -34
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/to-json-schema.d.ts +45 -5
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/util.d.ts +79 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/core/versions.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/_types/zod/v4/index.d.cts +2 -2
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/bn.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ckb.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/gu.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/hi.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/index.d.ts +11 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/kn.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/ne.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/nn.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/pt-BR.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/sk.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tg.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/_types/zod/v4/locales/tk.d.ts +4 -0
- package/dist/_types/@internal_voice/dist/index.d.ts +2 -2
- package/dist/_types/@internal_voice/dist/voice/aisdk/speech.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/voice/aisdk/transcription.d.ts +1 -1
- package/dist/_types/@internal_voice/dist/voice/composite-voice.d.ts +2 -2
- package/dist/_types/@internal_voice/dist/voice/voice.d.ts +2 -2
- package/dist/_types/@internal_voice/package.json +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-voice-overview.md +25 -0
- package/dist/index.cjs +4 -5
- 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 +4 -5
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/dist/_types/@internal_voice/dist/_types/zod/v3/index.d.cts +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MastraVoice } from './_types/@internal_voice/dist/index.
|
|
2
|
-
import type { ToolsInput, RequestContext, VoiceConfig, VoiceEventType } from './_types/@internal_voice/dist/index.
|
|
1
|
+
import { MastraVoice } from './_types/@internal_voice/dist/index.js';
|
|
2
|
+
import type { ToolsInput, RequestContext, VoiceConfig, VoiceEventType } from './_types/@internal_voice/dist/index.js';
|
|
3
3
|
import type { NovaSonicVoiceConfig as ConfigType, NovaSonicVoiceOptions, NovaSonicEventMap } from './types.js';
|
|
4
4
|
export { NovaSonicError } from './utils/errors.js';
|
|
5
5
|
export { NovaSonicErrorCode } from './types.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE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C,IAAI;IAkBZ;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAEjD;IAED;;OAEG;IACH,OAAO,CAAC,GAAG;CAKZ"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { randomUUID } from "crypto";
|
|
2
1
|
import { PassThrough } from "stream";
|
|
3
2
|
import { BedrockRuntimeClient, InvokeModelWithBidirectionalStreamCommand } from "@aws-sdk/client-bedrock-runtime";
|
|
4
3
|
import { NodeHttp2Handler } from "@smithy/node-http-handler";
|
|
@@ -959,7 +958,7 @@ var NovaSonicVoice = class extends MastraVoice {
|
|
|
959
958
|
const eventQueue = this._eventQueue;
|
|
960
959
|
if (!eventQueue) throw new NovaSonicError("connection_failed", "Event queue must be initialized before enqueueing session events");
|
|
961
960
|
this.log("Pre-populating queue with sessionStart and promptStart events...");
|
|
962
|
-
const promptName = randomUUID();
|
|
961
|
+
const promptName = globalThis.crypto.randomUUID();
|
|
963
962
|
this._promptName = promptName;
|
|
964
963
|
const sessionStartEvent = {};
|
|
965
964
|
if (this.sessionConfig) {
|
|
@@ -1020,7 +1019,7 @@ var NovaSonicVoice = class extends MastraVoice {
|
|
|
1020
1019
|
else if (this.sessionConfig?.toolChoice) promptStartEvent.toolConfiguration = { toolChoice: this.sessionConfig.toolChoice };
|
|
1021
1020
|
eventQueue.push({ event: { promptStart: promptStartEvent } });
|
|
1022
1021
|
this.promptStarted = true;
|
|
1023
|
-
const systemContentName = randomUUID();
|
|
1022
|
+
const systemContentName = globalThis.crypto.randomUUID();
|
|
1024
1023
|
eventQueue.push({ event: { contentStart: {
|
|
1025
1024
|
promptName,
|
|
1026
1025
|
contentName: systemContentName,
|
|
@@ -1591,7 +1590,7 @@ var NovaSonicVoice = class extends MastraVoice {
|
|
|
1591
1590
|
const promptName = this._promptName;
|
|
1592
1591
|
if (!promptName) throw new NovaSonicError("not_connected", "Prompt name not initialized. Connection may not be fully established.");
|
|
1593
1592
|
if (!this.promptStarted) throw new NovaSonicError("invalid_state", "Prompt not started. This should not happen - prompt should be started during connection.");
|
|
1594
|
-
const contentName = randomUUID();
|
|
1593
|
+
const contentName = globalThis.crypto.randomUUID();
|
|
1595
1594
|
await this.sendClientEvent({ contentStart: {
|
|
1596
1595
|
promptName,
|
|
1597
1596
|
contentName,
|
|
@@ -1649,7 +1648,7 @@ var NovaSonicVoice = class extends MastraVoice {
|
|
|
1649
1648
|
const promptName = this._promptName;
|
|
1650
1649
|
if (!promptName) throw new NovaSonicError("not_connected", "Prompt name not initialized. Connection may not be fully established.");
|
|
1651
1650
|
if (!this.audioContentStarted) {
|
|
1652
|
-
const audioContentId = randomUUID();
|
|
1651
|
+
const audioContentId = globalThis.crypto.randomUUID();
|
|
1653
1652
|
this.audioContentName = audioContentId;
|
|
1654
1653
|
this.log(`[send] First audio send - sending AUDIO contentStart with contentName: ${audioContentId}`);
|
|
1655
1654
|
await this.sendClientEvent({ contentStart: {
|