@volley/recognition-client-sdk 0.1.689 → 0.1.767
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/browser.bundled.d.ts +102 -1
- package/dist/config-builder.d.ts +11 -1
- package/dist/config-builder.d.ts.map +1 -1
- package/dist/index.bundled.d.ts +117 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -7
- package/dist/index.js.map +3 -3
- package/dist/recog-client-sdk.browser.js +44 -7
- package/dist/recog-client-sdk.browser.js.map +3 -3
- package/dist/recognition-client.d.ts.map +1 -1
- package/dist/recognition-client.types.d.ts +9 -1
- package/dist/recognition-client.types.d.ts.map +1 -1
- package/dist/utils/message-handler.d.ts +2 -1
- package/dist/utils/message-handler.d.ts.map +1 -1
- package/dist/utils/url-builder.d.ts +2 -0
- package/dist/utils/url-builder.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/config-builder.ts +20 -0
- package/src/index.ts +3 -0
- package/src/recognition-client.ts +11 -1
- package/src/recognition-client.types.ts +12 -0
- package/src/utils/message-handler.ts +14 -3
- package/src/utils/url-builder.spec.ts +43 -0
- package/src/utils/url-builder.ts +7 -0
|
@@ -3746,6 +3746,9 @@ var RecognitionProvider;
|
|
|
3746
3746
|
RecognitionProvider2["MISTRAL_VOXTRAL"] = "mistral-voxtral";
|
|
3747
3747
|
RecognitionProvider2["CARTESIA"] = "cartesia";
|
|
3748
3748
|
RecognitionProvider2["DASHSCOPE"] = "dashscope";
|
|
3749
|
+
RecognitionProvider2["BEDROCK"] = "bedrock";
|
|
3750
|
+
RecognitionProvider2["INWORLD_STT"] = "inworld-stt";
|
|
3751
|
+
RecognitionProvider2["AWS_TRANSCRIBE"] = "aws-transcribe";
|
|
3749
3752
|
RecognitionProvider2["TEST_ASR_PROVIDER_QUOTA"] = "test-asr-provider-quota";
|
|
3750
3753
|
RecognitionProvider2["TEST_ASR_STREAMING"] = "test-asr-streaming";
|
|
3751
3754
|
})(RecognitionProvider || (RecognitionProvider = {}));
|
|
@@ -3813,6 +3816,19 @@ var DashScopeModel;
|
|
|
3813
3816
|
DashScopeModel2["QWEN3_ASR_FLASH_REALTIME_2602"] = "qwen3-asr-flash-realtime-2026-02-10";
|
|
3814
3817
|
DashScopeModel2["QWEN3_ASR_FLASH_REALTIME"] = "qwen3-asr-flash-realtime";
|
|
3815
3818
|
})(DashScopeModel || (DashScopeModel = {}));
|
|
3819
|
+
var BedrockModel;
|
|
3820
|
+
(function(BedrockModel2) {
|
|
3821
|
+
BedrockModel2["VOXTRAL_MINI_3B_2507"] = "mistral.voxtral-mini-3b-2507";
|
|
3822
|
+
BedrockModel2["VOXTRAL_SMALL_24B_2507"] = "mistral.voxtral-small-24b-2507";
|
|
3823
|
+
})(BedrockModel || (BedrockModel = {}));
|
|
3824
|
+
var InworldSttModel;
|
|
3825
|
+
(function(InworldSttModel2) {
|
|
3826
|
+
InworldSttModel2["INWORLD_STT_1"] = "inworld/inworld-stt-1";
|
|
3827
|
+
})(InworldSttModel || (InworldSttModel = {}));
|
|
3828
|
+
var AwsTranscribeModel;
|
|
3829
|
+
(function(AwsTranscribeModel2) {
|
|
3830
|
+
AwsTranscribeModel2["DEFAULT"] = "default";
|
|
3831
|
+
})(AwsTranscribeModel || (AwsTranscribeModel = {}));
|
|
3816
3832
|
var SelfServeVllmModel;
|
|
3817
3833
|
(function(SelfServeVllmModel2) {
|
|
3818
3834
|
SelfServeVllmModel2["QWEN3_ASR_1_7B"] = "qwen3-asr-1.7b";
|
|
@@ -3938,9 +3954,9 @@ var ErrorResultSchemaV1 = z.object({
|
|
|
3938
3954
|
// Detailed description
|
|
3939
3955
|
});
|
|
3940
3956
|
var ClientControlActionV1;
|
|
3941
|
-
(function(
|
|
3942
|
-
|
|
3943
|
-
|
|
3957
|
+
(function(ClientControlActionV12) {
|
|
3958
|
+
ClientControlActionV12["READY_FOR_UPLOADING_RECORDING"] = "ready_for_uploading_recording";
|
|
3959
|
+
ClientControlActionV12["STOP_RECORDING"] = "stop_recording";
|
|
3944
3960
|
})(ClientControlActionV1 || (ClientControlActionV1 = {}));
|
|
3945
3961
|
var ClientControlActionsV1 = z.nativeEnum(ClientControlActionV1);
|
|
3946
3962
|
var ClientControlMessageSchemaV1 = z.object({
|
|
@@ -3973,6 +3989,8 @@ var AudioMetricsResultSchemaV1 = z.object({
|
|
|
3973
3989
|
maxVolume: z.number(),
|
|
3974
3990
|
minVolume: z.number(),
|
|
3975
3991
|
avgVolume: z.number(),
|
|
3992
|
+
peakVolumeDb: z.number().nullable(),
|
|
3993
|
+
avgVolumeDb: z.number().nullable(),
|
|
3976
3994
|
silenceRatio: z.number(),
|
|
3977
3995
|
clippingRatio: z.number(),
|
|
3978
3996
|
snrEstimate: z.number().nullable(),
|
|
@@ -3989,7 +4007,8 @@ var RecognitionResultSchemaV1 = z.discriminatedUnion("type", [
|
|
|
3989
4007
|
// P1 - P2
|
|
3990
4008
|
FunctionCallResultSchemaV1,
|
|
3991
4009
|
ClientControlMessageSchemaV1,
|
|
3992
|
-
SessionConfiguredSchemaV1
|
|
4010
|
+
SessionConfiguredSchemaV1,
|
|
4011
|
+
AudioMetricsResultSchemaV1
|
|
3993
4012
|
]);
|
|
3994
4013
|
|
|
3995
4014
|
// ../../libs/types/dist/provider-transcription.types.js
|
|
@@ -4412,6 +4431,9 @@ var ASRRequestSchemaV1 = z.object({
|
|
|
4412
4431
|
prefixMode: z.nativeEnum(PrefixMode).optional().default(PrefixMode.NONE),
|
|
4413
4432
|
prefixId: z.string().optional(),
|
|
4414
4433
|
prefixTextToRemove: z.array(z.string()).optional(),
|
|
4434
|
+
// Streaming audio metrics opt-in: when > 0, server emits AudioMetrics results throttled to this interval (ms).
|
|
4435
|
+
// Undefined / 0 disables streaming audio metrics (final metrics still embedded in Metadata).
|
|
4436
|
+
audioMetricsIntervalMs: z.number().optional(),
|
|
4415
4437
|
// Debug options (FOR DEBUG/TESTING ONLY - not for production use)
|
|
4416
4438
|
debugCommand: RequestDebugCommandSchema
|
|
4417
4439
|
});
|
|
@@ -4433,8 +4455,9 @@ var RecognitionGameInfoSchema = z.object({
|
|
|
4433
4455
|
/** @deprecated Use questionAskedId instead. Kept for backward compatibility during migration. */
|
|
4434
4456
|
questionAnswerId: z.string().optional(),
|
|
4435
4457
|
platform: z.string().optional(),
|
|
4436
|
-
experimentCohort: z.enum(["treatment", "control"]).optional()
|
|
4437
|
-
|
|
4458
|
+
experimentCohort: z.enum(["treatment", "control"]).optional(),
|
|
4459
|
+
experimentMajorVersion: z.number().int().optional()
|
|
4460
|
+
// Explicit major version for ASR config selection (e.g. 1, 3)
|
|
4438
4461
|
});
|
|
4439
4462
|
var RecognitionQueryMetadataSchema = z.object({
|
|
4440
4463
|
audioUtteranceId: z.string(),
|
|
@@ -5064,6 +5087,9 @@ function buildWebSocketUrl(config) {
|
|
|
5064
5087
|
if (config.experimentCohort) {
|
|
5065
5088
|
url.searchParams.set("experimentCohort", config.experimentCohort);
|
|
5066
5089
|
}
|
|
5090
|
+
if (config.experimentMajorVersion !== void 0) {
|
|
5091
|
+
url.searchParams.set("experimentMajorVersion", String(config.experimentMajorVersion));
|
|
5092
|
+
}
|
|
5067
5093
|
return url.toString();
|
|
5068
5094
|
}
|
|
5069
5095
|
|
|
@@ -5211,6 +5237,7 @@ var MessageHandler = class {
|
|
|
5211
5237
|
/**
|
|
5212
5238
|
* Handle incoming WebSocket message
|
|
5213
5239
|
*/
|
|
5240
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5214
5241
|
handleMessage(msg) {
|
|
5215
5242
|
if (this.callbacks.logger) {
|
|
5216
5243
|
this.callbacks.logger("debug", "[RecogSDK] Received WebSocket message", {
|
|
@@ -5249,6 +5276,9 @@ var MessageHandler = class {
|
|
|
5249
5276
|
case RecognitionResultTypeV1.SESSION_CONFIGURED:
|
|
5250
5277
|
this.callbacks.onSessionConfigured?.(msgData);
|
|
5251
5278
|
break;
|
|
5279
|
+
case RecognitionResultTypeV1.AUDIO_METRICS:
|
|
5280
|
+
this.callbacks.onAudioMetrics?.(msgData);
|
|
5281
|
+
break;
|
|
5252
5282
|
default:
|
|
5253
5283
|
if (this.callbacks.logger) {
|
|
5254
5284
|
this.callbacks.logger("debug", "[RecogSDK] Unknown message type", { type: msgType });
|
|
@@ -5335,7 +5365,8 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5335
5365
|
...config.platform && { platform: config.platform },
|
|
5336
5366
|
...config.gameContext && { gameContext: config.gameContext },
|
|
5337
5367
|
...config.gameId && { gameId: config.gameId },
|
|
5338
|
-
...config.experimentCohort && { experimentCohort: config.experimentCohort }
|
|
5368
|
+
...config.experimentCohort && { experimentCohort: config.experimentCohort },
|
|
5369
|
+
...config.experimentMajorVersion !== void 0 && { experimentMajorVersion: config.experimentMajorVersion }
|
|
5339
5370
|
});
|
|
5340
5371
|
super({
|
|
5341
5372
|
url,
|
|
@@ -5369,6 +5400,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5369
5400
|
onMetadata: config.onMetadata || (() => {
|
|
5370
5401
|
}),
|
|
5371
5402
|
onSessionConfigured: config.onSessionConfigured,
|
|
5403
|
+
onAudioMetrics: config.onAudioMetrics,
|
|
5372
5404
|
onError: config.onError || (() => {
|
|
5373
5405
|
}),
|
|
5374
5406
|
onConnected: config.onConnected || (() => {
|
|
@@ -5397,6 +5429,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5397
5429
|
onError: this.config.onError,
|
|
5398
5430
|
onControlMessage: this.handleControlMessage.bind(this),
|
|
5399
5431
|
onSessionConfigured: this.config.onSessionConfigured,
|
|
5432
|
+
onAudioMetrics: this.config.onAudioMetrics,
|
|
5400
5433
|
...this.config.logger && { logger: this.config.logger }
|
|
5401
5434
|
});
|
|
5402
5435
|
}
|
|
@@ -5722,6 +5755,10 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5722
5755
|
// Include prefix text to remove if provided (for server-side prefix text removal)
|
|
5723
5756
|
...this.config.asrRequestConfig.prefixTextToRemove && {
|
|
5724
5757
|
prefixTextToRemove: this.config.asrRequestConfig.prefixTextToRemove
|
|
5758
|
+
},
|
|
5759
|
+
// Streaming audio metrics opt-in (ms interval). Server only forwards metrics if > 0.
|
|
5760
|
+
...this.config.asrRequestConfig.audioMetricsIntervalMs !== void 0 && {
|
|
5761
|
+
audioMetricsIntervalMs: this.config.asrRequestConfig.audioMetricsIntervalMs
|
|
5725
5762
|
}
|
|
5726
5763
|
};
|
|
5727
5764
|
super.sendMessage(
|