@bytexbyte/nxtlinq-ai-agent-sdk 1.6.18 → 1.6.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/lib/useSpeechToTextFromMic/index.ts"],"names":[],"mappings":"AAIA,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,SAAS,EACT,mBAA0B,GAC3B,EAAE,KAAK,GAAG,4BAA4B,CA4EtC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/lib/useSpeechToTextFromMic/index.ts"],"names":[],"mappings":"AAIA,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,SAAS,EACT,mBAA0B,GAC3B,EAAE,KAAK,GAAG,4BAA4B,CAsGtC"}
@@ -48,6 +48,30 @@ export function useSpeechToTextFromMic({ apiKey, apiSecret, autoClearTranscript
48
48
  setIsMicEnabled(false);
49
49
  setRecognizer(undefined);
50
50
  }, [recognizer, setRecognizer]);
51
+ // Keep UI state in sync if recognizer stops or gets canceled by the SDK/browser
52
+ useEffect(() => {
53
+ if (!recognizer)
54
+ return;
55
+ const prevCanceled = recognizer.canceled;
56
+ const prevSessionStopped = recognizer.sessionStopped;
57
+ recognizer.canceled = (s, e) => {
58
+ setIsMicEnabled(false);
59
+ if (prevCanceled)
60
+ prevCanceled(s, e);
61
+ };
62
+ recognizer.sessionStopped = (s, e) => {
63
+ setIsMicEnabled(false);
64
+ if (prevSessionStopped)
65
+ prevSessionStopped(s, e);
66
+ };
67
+ return () => {
68
+ // No explicit detach API; restoring previous handlers to avoid leaks
69
+ if (recognizer) {
70
+ recognizer.canceled = prevCanceled;
71
+ recognizer.sessionStopped = prevSessionStopped;
72
+ }
73
+ };
74
+ }, [recognizer]);
51
75
  useEffect(() => {
52
76
  if (autoClearTranscript && transcriptArray.length > 0) {
53
77
  const timer = setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/nxtlinq-ai-agent-sdk",
3
- "version": "1.6.18",
3
+ "version": "1.6.19",
4
4
  "description": "Nxtlinq AI Agent SDK - Proprietary Software with enhanced async operation handling",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",