@lokutor/sdk 1.1.13 → 1.1.17

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
@@ -1039,8 +1039,15 @@ var TTSClient = class {
1039
1039
  }
1040
1040
  if (options.onAudio) options.onAudio(new Uint8Array(event.data));
1041
1041
  } else {
1042
+ const text = event.data.toString();
1043
+ if (text === "EOS") {
1044
+ if (activityTimeout) clearTimeout(activityTimeout);
1045
+ ws.close();
1046
+ resolve();
1047
+ return;
1048
+ }
1042
1049
  try {
1043
- const msg = JSON.parse(event.data.toString());
1050
+ const msg = JSON.parse(text);
1044
1051
  if (Array.isArray(msg) && options.onVisemes) {
1045
1052
  options.onVisemes(msg);
1046
1053
  }
package/dist/index.mjs CHANGED
@@ -839,8 +839,15 @@ var TTSClient = class {
839
839
  }
840
840
  if (options.onAudio) options.onAudio(new Uint8Array(event.data));
841
841
  } else {
842
+ const text = event.data.toString();
843
+ if (text === "EOS") {
844
+ if (activityTimeout) clearTimeout(activityTimeout);
845
+ ws.close();
846
+ resolve();
847
+ return;
848
+ }
842
849
  try {
843
- const msg = JSON.parse(event.data.toString());
850
+ const msg = JSON.parse(text);
844
851
  if (Array.isArray(msg) && options.onVisemes) {
845
852
  options.onVisemes(msg);
846
853
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokutor/sdk",
3
- "version": "1.1.13",
3
+ "version": "1.1.17",
4
4
  "description": "JavaScript/TypeScript SDK for Lokutor Real-time Voice AI",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",