osborn 0.9.187 → 0.9.188
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 +25 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4196,6 +4196,31 @@ async function main() {
|
|
|
4196
4196
|
if (ev.newState === 'listening' && voiceQueue.length > 0) {
|
|
4197
4197
|
setTimeout(() => processVoiceQueue(), 500);
|
|
4198
4198
|
}
|
|
4199
|
+
// Suppressed-text replay: if TTS was suppressed while user was speaking
|
|
4200
|
+
// and no new user turn arrives within 1.2s, replay the suppressed text directly.
|
|
4201
|
+
// Without this, both sides go silent: agent has no transcript to react to,
|
|
4202
|
+
// user has no audio — deadlock.
|
|
4203
|
+
if (ev.newState === 'listening' && lastInterruption?.suppressedText) {
|
|
4204
|
+
const capturedInterruption = lastInterruption;
|
|
4205
|
+
const capturedText = lastInterruption.suppressedText;
|
|
4206
|
+
setTimeout(() => {
|
|
4207
|
+
if (lastInterruption === capturedInterruption &&
|
|
4208
|
+
lastInterruption.suppressedText === capturedText &&
|
|
4209
|
+
agentState === 'listening' &&
|
|
4210
|
+
userState === 'listening' &&
|
|
4211
|
+
currentSession) {
|
|
4212
|
+
console.log(`🔁 Replaying suppressed text (${capturedText.length} chars) — user returned to listening, no new turn arrived`);
|
|
4213
|
+
lastInterruption.suppressedText = '';
|
|
4214
|
+
try {
|
|
4215
|
+
;
|
|
4216
|
+
currentSession.say(capturedText);
|
|
4217
|
+
}
|
|
4218
|
+
catch (err) {
|
|
4219
|
+
console.warn('⚠️ Suppressed text replay failed:', err instanceof Error ? err.message : err);
|
|
4220
|
+
}
|
|
4221
|
+
}
|
|
4222
|
+
}, 1200);
|
|
4223
|
+
}
|
|
4199
4224
|
});
|
|
4200
4225
|
// ============================================================
|
|
4201
4226
|
// Interrupt-debug instrumentation (0.9.63) — log every SDK event
|