@volley/recognition-client-sdk 0.1.381 → 0.1.383

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
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
1
+ // ../../node_modules/.pnpm/zod@3.22.5/node_modules/zod/lib/index.mjs
2
2
  var util;
3
3
  (function(util2) {
4
4
  util2.assertEqual = (val) => val;
@@ -4770,7 +4770,7 @@ var WebSocketAudioClient = class {
4770
4770
  // ../../libs/websocket/dist/core/audio-upload-websocket-server.js
4771
4771
  import { WebSocketServer, WebSocket as WebSocket2 } from "ws";
4772
4772
 
4773
- // ../../node_modules/.pnpm/uuid@11.0.0/node_modules/uuid/dist/esm-browser/stringify.js
4773
+ // ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.js
4774
4774
  var byteToHex = [];
4775
4775
  for (let i = 0; i < 256; ++i) {
4776
4776
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -4779,7 +4779,7 @@ function unsafeStringify(arr, offset = 0) {
4779
4779
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
4780
4780
  }
4781
4781
 
4782
- // ../../node_modules/.pnpm/uuid@11.0.0/node_modules/uuid/dist/esm-browser/rng.js
4782
+ // ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.js
4783
4783
  var getRandomValues;
4784
4784
  var rnds8 = new Uint8Array(16);
4785
4785
  function rng() {
@@ -4792,21 +4792,27 @@ function rng() {
4792
4792
  return getRandomValues(rnds8);
4793
4793
  }
4794
4794
 
4795
- // ../../node_modules/.pnpm/uuid@11.0.0/node_modules/uuid/dist/esm-browser/native.js
4795
+ // ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.js
4796
4796
  var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
4797
4797
  var native_default = { randomUUID };
4798
4798
 
4799
- // ../../node_modules/.pnpm/uuid@11.0.0/node_modules/uuid/dist/esm-browser/v4.js
4799
+ // ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.js
4800
4800
  function v4(options, buf, offset) {
4801
4801
  if (native_default.randomUUID && !buf && !options) {
4802
4802
  return native_default.randomUUID();
4803
4803
  }
4804
4804
  options = options || {};
4805
- const rnds = options.random || (options.rng || rng)();
4805
+ const rnds = options.random ?? options.rng?.() ?? rng();
4806
+ if (rnds.length < 16) {
4807
+ throw new Error("Random bytes length must be >= 16");
4808
+ }
4806
4809
  rnds[6] = rnds[6] & 15 | 64;
4807
4810
  rnds[8] = rnds[8] & 63 | 128;
4808
4811
  if (buf) {
4809
4812
  offset = offset || 0;
4813
+ if (offset < 0 || offset + 16 > buf.length) {
4814
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
4815
+ }
4810
4816
  for (let i = 0; i < 16; ++i) {
4811
4817
  buf[offset + i] = rnds[i];
4812
4818
  }
@@ -6054,9 +6060,9 @@ var SimplifiedVGFRecognitionClient = class {
6054
6060
  this.stateChangeCallback = onStateChange;
6055
6061
  this.logger = clientConfig.logger;
6056
6062
  if (initialState) {
6057
- const needsNewUuid = !initialState.audioUtteranceId || initialState.audioUtteranceId === "" || initialState.transcriptionStatus === TranscriptionStatus.ABORTED || initialState.transcriptionStatus === TranscriptionStatus.FINALIZED;
6063
+ const needsNewUuid = !initialState.audioUtteranceId || initialState.audioUtteranceId === "" || initialState.transcriptionStatus === TranscriptionStatus.ABORTED || initialState.transcriptionStatus === TranscriptionStatus.FINALIZED || initialState.transcriptionStatus === TranscriptionStatus.ERROR || initialState.recognitionActionProcessingState !== RecognitionActionProcessingState.COMPLETED;
6058
6064
  if (needsNewUuid) {
6059
- const newUUID = crypto.randomUUID();
6065
+ const newUUID = v4_default();
6060
6066
  if (clientConfig.logger) {
6061
6067
  const reason = !initialState.audioUtteranceId ? "Missing UUID" : initialState.audioUtteranceId === "" ? "Empty UUID" : `Terminal session (${initialState.transcriptionStatus})`;
6062
6068
  clientConfig.logger("info", `${reason} detected, generating new UUID: ${newUUID}`);
@@ -6064,12 +6070,9 @@ var SimplifiedVGFRecognitionClient = class {
6064
6070
  this.state = {
6065
6071
  ...initialState,
6066
6072
  audioUtteranceId: newUUID,
6067
- // Reset status fields for fresh session if terminal state
6068
- ...initialState.transcriptionStatus === TranscriptionStatus.ABORTED || initialState.transcriptionStatus === TranscriptionStatus.FINALIZED ? {
6069
- transcriptionStatus: TranscriptionStatus.NOT_STARTED,
6070
- startRecordingStatus: RecordingStatus.READY,
6071
- finalTranscript: void 0
6072
- } : {}
6073
+ transcriptionStatus: TranscriptionStatus.NOT_STARTED,
6074
+ startRecordingStatus: RecordingStatus.READY,
6075
+ finalTranscript: void 0
6073
6076
  };
6074
6077
  clientConfig.audioUtteranceId = newUUID;
6075
6078
  if (onStateChange) {