@lokutor/sdk 1.1.34 → 1.1.36
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 +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +1 -1
- package/src/browser-audio.ts +4 -0
- package/src/client.ts +4 -5
package/dist/index.js
CHANGED
|
@@ -408,6 +408,9 @@ var BrowserAudioManager = class {
|
|
|
408
408
|
console.warn("AudioContext not initialized");
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
|
+
if (this.audioContext.state === "suspended") {
|
|
412
|
+
this.audioContext.resume();
|
|
413
|
+
}
|
|
411
414
|
if (pcm16Data.length % 2 !== 0) {
|
|
412
415
|
console.warn(`Discarding odd-length PCM buffer (${pcm16Data.length} bytes)`);
|
|
413
416
|
return;
|
|
@@ -906,9 +909,8 @@ var VoiceAgentClient = class {
|
|
|
906
909
|
if (msg.data === "thinking") {
|
|
907
910
|
const newGen = msg.generation || 0;
|
|
908
911
|
if (newGen > this.currentGeneration) {
|
|
909
|
-
console.log(`\u{1F9E0} New thought (Gen ${newGen})
|
|
912
|
+
console.log(`\u{1F9E0} New thought (Gen ${newGen})`);
|
|
910
913
|
this.currentGeneration = newGen;
|
|
911
|
-
if (this.audioManager) this.audioManager.stopPlayback();
|
|
912
914
|
}
|
|
913
915
|
}
|
|
914
916
|
if (msg.data === "interrupted" && this.audioManager) {
|
package/dist/index.mjs
CHANGED
|
@@ -361,6 +361,9 @@ var BrowserAudioManager = class {
|
|
|
361
361
|
console.warn("AudioContext not initialized");
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
|
+
if (this.audioContext.state === "suspended") {
|
|
365
|
+
this.audioContext.resume();
|
|
366
|
+
}
|
|
364
367
|
if (pcm16Data.length % 2 !== 0) {
|
|
365
368
|
console.warn(`Discarding odd-length PCM buffer (${pcm16Data.length} bytes)`);
|
|
366
369
|
return;
|
|
@@ -859,9 +862,8 @@ var VoiceAgentClient = class {
|
|
|
859
862
|
if (msg.data === "thinking") {
|
|
860
863
|
const newGen = msg.generation || 0;
|
|
861
864
|
if (newGen > this.currentGeneration) {
|
|
862
|
-
console.log(`\u{1F9E0} New thought (Gen ${newGen})
|
|
865
|
+
console.log(`\u{1F9E0} New thought (Gen ${newGen})`);
|
|
863
866
|
this.currentGeneration = newGen;
|
|
864
|
-
if (this.audioManager) this.audioManager.stopPlayback();
|
|
865
867
|
}
|
|
866
868
|
}
|
|
867
869
|
if (msg.data === "interrupted" && this.audioManager) {
|
package/package.json
CHANGED
package/src/browser-audio.ts
CHANGED
|
@@ -230,6 +230,10 @@ export class BrowserAudioManager {
|
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
if (this.audioContext.state === 'suspended') {
|
|
234
|
+
this.audioContext.resume();
|
|
235
|
+
}
|
|
236
|
+
|
|
233
237
|
if (pcm16Data.length % 2 !== 0) {
|
|
234
238
|
console.warn(`Discarding odd-length PCM buffer (${pcm16Data.length} bytes)`);
|
|
235
239
|
return;
|
package/src/client.ts
CHANGED
|
@@ -467,11 +467,10 @@ export class VoiceAgentClient {
|
|
|
467
467
|
case 'status':
|
|
468
468
|
if (msg.data === 'thinking') {
|
|
469
469
|
const newGen = msg.generation || 0;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
470
|
+
if (newGen > this.currentGeneration) {
|
|
471
|
+
console.log(`🧠 New thought (Gen ${newGen})`);
|
|
472
|
+
this.currentGeneration = newGen;
|
|
473
|
+
}
|
|
475
474
|
}
|
|
476
475
|
if (msg.data === 'interrupted' && this.audioManager) {
|
|
477
476
|
this.audioManager.stopPlayback();
|