@volley/recognition-client-sdk 0.1.707 → 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/index.js CHANGED
@@ -3747,6 +3747,8 @@ var RecognitionProvider;
3747
3747
  RecognitionProvider2["CARTESIA"] = "cartesia";
3748
3748
  RecognitionProvider2["DASHSCOPE"] = "dashscope";
3749
3749
  RecognitionProvider2["BEDROCK"] = "bedrock";
3750
+ RecognitionProvider2["INWORLD_STT"] = "inworld-stt";
3751
+ RecognitionProvider2["AWS_TRANSCRIBE"] = "aws-transcribe";
3750
3752
  RecognitionProvider2["TEST_ASR_PROVIDER_QUOTA"] = "test-asr-provider-quota";
3751
3753
  RecognitionProvider2["TEST_ASR_STREAMING"] = "test-asr-streaming";
3752
3754
  })(RecognitionProvider || (RecognitionProvider = {}));
@@ -3819,6 +3821,14 @@ var BedrockModel;
3819
3821
  BedrockModel2["VOXTRAL_MINI_3B_2507"] = "mistral.voxtral-mini-3b-2507";
3820
3822
  BedrockModel2["VOXTRAL_SMALL_24B_2507"] = "mistral.voxtral-small-24b-2507";
3821
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 = {}));
3822
3832
  var SelfServeVllmModel;
3823
3833
  (function(SelfServeVllmModel2) {
3824
3834
  SelfServeVllmModel2["QWEN3_ASR_1_7B"] = "qwen3-asr-1.7b";
@@ -3944,9 +3954,9 @@ var ErrorResultSchemaV1 = z.object({
3944
3954
  // Detailed description
3945
3955
  });
3946
3956
  var ClientControlActionV1;
3947
- (function(ClientControlActionV13) {
3948
- ClientControlActionV13["READY_FOR_UPLOADING_RECORDING"] = "ready_for_uploading_recording";
3949
- ClientControlActionV13["STOP_RECORDING"] = "stop_recording";
3957
+ (function(ClientControlActionV12) {
3958
+ ClientControlActionV12["READY_FOR_UPLOADING_RECORDING"] = "ready_for_uploading_recording";
3959
+ ClientControlActionV12["STOP_RECORDING"] = "stop_recording";
3950
3960
  })(ClientControlActionV1 || (ClientControlActionV1 = {}));
3951
3961
  var ClientControlActionsV1 = z.nativeEnum(ClientControlActionV1);
3952
3962
  var ClientControlMessageSchemaV1 = z.object({
@@ -3979,6 +3989,8 @@ var AudioMetricsResultSchemaV1 = z.object({
3979
3989
  maxVolume: z.number(),
3980
3990
  minVolume: z.number(),
3981
3991
  avgVolume: z.number(),
3992
+ peakVolumeDb: z.number().nullable(),
3993
+ avgVolumeDb: z.number().nullable(),
3982
3994
  silenceRatio: z.number(),
3983
3995
  clippingRatio: z.number(),
3984
3996
  snrEstimate: z.number().nullable(),
@@ -3995,7 +4007,8 @@ var RecognitionResultSchemaV1 = z.discriminatedUnion("type", [
3995
4007
  // P1 - P2
3996
4008
  FunctionCallResultSchemaV1,
3997
4009
  ClientControlMessageSchemaV1,
3998
- SessionConfiguredSchemaV1
4010
+ SessionConfiguredSchemaV1,
4011
+ AudioMetricsResultSchemaV1
3999
4012
  ]);
4000
4013
 
4001
4014
  // ../../libs/types/dist/provider-transcription.types.js
@@ -4441,6 +4454,9 @@ var ASRRequestSchemaV1 = z.object({
4441
4454
  prefixMode: z.nativeEnum(PrefixMode).optional().default(PrefixMode.NONE),
4442
4455
  prefixId: z.string().optional(),
4443
4456
  prefixTextToRemove: z.array(z.string()).optional(),
4457
+ // Streaming audio metrics opt-in: when > 0, server emits AudioMetrics results throttled to this interval (ms).
4458
+ // Undefined / 0 disables streaming audio metrics (final metrics still embedded in Metadata).
4459
+ audioMetricsIntervalMs: z.number().optional(),
4444
4460
  // Debug options (FOR DEBUG/TESTING ONLY - not for production use)
4445
4461
  debugCommand: RequestDebugCommandSchema
4446
4462
  });
@@ -5289,6 +5305,7 @@ var MessageHandler = class {
5289
5305
  /**
5290
5306
  * Handle incoming WebSocket message
5291
5307
  */
5308
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5292
5309
  handleMessage(msg) {
5293
5310
  if (this.callbacks.logger) {
5294
5311
  this.callbacks.logger("debug", "[RecogSDK] Received WebSocket message", {
@@ -5327,6 +5344,9 @@ var MessageHandler = class {
5327
5344
  case RecognitionResultTypeV1.SESSION_CONFIGURED:
5328
5345
  this.callbacks.onSessionConfigured?.(msgData);
5329
5346
  break;
5347
+ case RecognitionResultTypeV1.AUDIO_METRICS:
5348
+ this.callbacks.onAudioMetrics?.(msgData);
5349
+ break;
5330
5350
  default:
5331
5351
  if (this.callbacks.logger) {
5332
5352
  this.callbacks.logger("debug", "[RecogSDK] Unknown message type", { type: msgType });
@@ -5474,6 +5494,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
5474
5494
  onMetadata: config.onMetadata || (() => {
5475
5495
  }),
5476
5496
  onSessionConfigured: config.onSessionConfigured,
5497
+ onAudioMetrics: config.onAudioMetrics,
5477
5498
  onError: config.onError || (() => {
5478
5499
  }),
5479
5500
  onConnected: config.onConnected || (() => {
@@ -5502,6 +5523,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
5502
5523
  onError: this.config.onError,
5503
5524
  onControlMessage: this.handleControlMessage.bind(this),
5504
5525
  onSessionConfigured: this.config.onSessionConfigured,
5526
+ onAudioMetrics: this.config.onAudioMetrics,
5505
5527
  ...this.config.logger && { logger: this.config.logger }
5506
5528
  });
5507
5529
  }
@@ -5827,6 +5849,10 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
5827
5849
  // Include prefix text to remove if provided (for server-side prefix text removal)
5828
5850
  ...this.config.asrRequestConfig.prefixTextToRemove && {
5829
5851
  prefixTextToRemove: this.config.asrRequestConfig.prefixTextToRemove
5852
+ },
5853
+ // Streaming audio metrics opt-in (ms interval). Server only forwards metrics if > 0.
5854
+ ...this.config.asrRequestConfig.audioMetricsIntervalMs !== void 0 && {
5855
+ audioMetricsIntervalMs: this.config.asrRequestConfig.audioMetricsIntervalMs
5830
5856
  }
5831
5857
  };
5832
5858
  super.sendMessage(
@@ -6181,6 +6207,14 @@ var ConfigBuilder = class {
6181
6207
  this.config.onSessionConfigured = callback;
6182
6208
  return this;
6183
6209
  }
6210
+ /**
6211
+ * Set streaming audio metrics callback (optional).
6212
+ * Only fires when `asrRequestConfig.audioMetricsIntervalMs > 0`.
6213
+ */
6214
+ onAudioMetrics(callback) {
6215
+ this.config.onAudioMetrics = callback;
6216
+ return this;
6217
+ }
6184
6218
  /**
6185
6219
  * Set error callback
6186
6220
  */
@@ -6233,6 +6267,7 @@ var ConfigBuilder = class {
6233
6267
  /**
6234
6268
  * Set logger function
6235
6269
  */
6270
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6236
6271
  logger(logger) {
6237
6272
  this.config.logger = logger;
6238
6273
  return this;
@@ -6670,6 +6705,7 @@ function createSimplifiedVGFClient(config) {
6670
6705
  }
6671
6706
  export {
6672
6707
  AudioEncoding,
6708
+ AwsTranscribeModel,
6673
6709
  BedrockModel,
6674
6710
  CartesiaModel,
6675
6711
  ClientControlActionV1,