osborn 0.9.58 → 0.9.60
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 +24 -22
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -2116,28 +2116,32 @@ async function main() {
|
|
|
2116
2116
|
const session = new voice.AgentSession({
|
|
2117
2117
|
turnDetection: 'stt',
|
|
2118
2118
|
preemptiveGeneration: false, // Only fire LLM on final committed transcript, not partial preemptives
|
|
2119
|
+
// First-line echo defense: drop mic frames from BOTH the recognition stream
|
|
2120
|
+
// and the realtime audio stream for this many ms after the agent first
|
|
2121
|
+
// enters 'speaking' state. STT receives no audio during the warmup → no
|
|
2122
|
+
// interim/final transcripts can fire → echo cannot trigger an interrupt.
|
|
2123
|
+
// 1.4.x default is 3000; bumping to 5000 widens the safe zone at session start.
|
|
2124
|
+
// One-shot per session (NOT re-armed each turn), so this protects only the
|
|
2125
|
+
// first agent response. After that the in-block interruption settings handle it.
|
|
2126
|
+
aecWarmupDuration: 5000,
|
|
2119
2127
|
turnHandling: {
|
|
2120
2128
|
endpointing: {
|
|
2121
2129
|
mode: 'fixed',
|
|
2122
2130
|
minDelay: 500, // Wait 500ms after STT commits before generating reply
|
|
2123
2131
|
maxDelay: 2000, // Force end-of-turn after 2s to prevent hangs
|
|
2124
2132
|
},
|
|
2125
|
-
//
|
|
2126
|
-
//
|
|
2127
|
-
//
|
|
2128
|
-
//
|
|
2129
|
-
// accumulate a clean silence, which helps when echo or ambient noise
|
|
2130
|
-
// keeps resetting the 2s window. Other tunables in this same block
|
|
2131
|
-
// (NOT changed yet — try the timeout first, escalate if needed):
|
|
2132
|
-
// - minDuration (default 500ms) — minimum sustained speech to count
|
|
2133
|
-
// - minWords (default 0) — minimum word count in interim transcript
|
|
2134
|
-
// - enabled (default true) — kept ON (auto-interrupt path active)
|
|
2135
|
-
// - resumeFalseInterruption (default true) — auto-resume kept ON
|
|
2136
|
-
// - discardAudioIfUninterruptible (default true)
|
|
2133
|
+
// 1.4.x SDK fully wires these — minDuration now applies to the STT path
|
|
2134
|
+
// (not just VAD), falseInterruptionTimeout actually fires the
|
|
2135
|
+
// agentFalseInterruption event with auto-resume, discardAudioIfUninterruptible
|
|
2136
|
+
// is checked at runtime. All inert in 1.2.1; live in 1.4.x.
|
|
2137
2137
|
interruption: {
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2138
|
+
// enabled defaults true — kept default (don't set to false; cascades into
|
|
2139
|
+
// allowInterruptions:false which breaks manual interrupt() calls).
|
|
2140
|
+
minDuration: 1000, // 1.4.x: now gates STT-path; require 1s sustained speech
|
|
2141
|
+
minWords: 3, // require ≥3 words in interim transcript
|
|
2142
|
+
falseInterruptionTimeout: 2000, // emit agentFalseInterruption after 2s silence
|
|
2143
|
+
resumeFalseInterruption: true, // auto-resume TTS on false interrupt detection
|
|
2144
|
+
discardAudioIfUninterruptible: true, // drop buffered echo audio
|
|
2141
2145
|
},
|
|
2142
2146
|
},
|
|
2143
2147
|
});
|
|
@@ -3041,13 +3045,11 @@ async function main() {
|
|
|
3041
3045
|
userState = ev.newState;
|
|
3042
3046
|
console.log(`👤 User state: ${prev} → ${ev.newState} (agent: ${agentState})`);
|
|
3043
3047
|
if (ev.newState === 'speaking' && agentState === 'speaking' && sessionVoiceMode !== 'realtime') {
|
|
3044
|
-
//
|
|
3045
|
-
//
|
|
3046
|
-
//
|
|
3047
|
-
//
|
|
3048
|
-
//
|
|
3049
|
-
// (2 of 3 interrupts that session were from this handler firing on echo).
|
|
3050
|
-
// Echo prevention moved to browser AEC on the publisher side.
|
|
3048
|
+
// Simple manual interrupt for echo-side defense fallback. With 1.4.x
|
|
3049
|
+
// the SDK's interrupt-by-audio-activity path is properly gated by
|
|
3050
|
+
// turnHandling.interruption.{minDuration, minWords, falseInterruptionTimeout},
|
|
3051
|
+
// and resumeFalseInterruption auto-recovers if echo was misclassified.
|
|
3052
|
+
// This handler stays as a secondary trigger only.
|
|
3051
3053
|
try {
|
|
3052
3054
|
console.log('🎤 user_state_changed=speaking + agent speaking → interrupting TTS');
|
|
3053
3055
|
currentSession?.interrupt();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "osborn",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.60",
|
|
4
4
|
"description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"@anthropic-ai/claude-agent-sdk": "^0.2.91",
|
|
34
34
|
"@anthropic-ai/sdk": "^0.80.0",
|
|
35
35
|
"@google/genai": "^1.0.0",
|
|
36
|
-
"@livekit/agents": "1.
|
|
37
|
-
"@livekit/agents-plugin-deepgram": "1.
|
|
38
|
-
"@livekit/agents-plugin-elevenlabs": "1.
|
|
39
|
-
"@livekit/agents-plugin-google": "1.
|
|
40
|
-
"@livekit/agents-plugin-livekit": "1.
|
|
41
|
-
"@livekit/agents-plugin-openai": "1.
|
|
42
|
-
"@livekit/agents-plugin-silero": "1.
|
|
43
|
-
"@livekit/rtc-node": "0.13.
|
|
36
|
+
"@livekit/agents": "1.4.6",
|
|
37
|
+
"@livekit/agents-plugin-deepgram": "1.4.6",
|
|
38
|
+
"@livekit/agents-plugin-elevenlabs": "1.4.6",
|
|
39
|
+
"@livekit/agents-plugin-google": "1.4.6",
|
|
40
|
+
"@livekit/agents-plugin-livekit": "1.4.6",
|
|
41
|
+
"@livekit/agents-plugin-openai": "1.4.6",
|
|
42
|
+
"@livekit/agents-plugin-silero": "1.4.6",
|
|
43
|
+
"@livekit/rtc-node": "0.13.29",
|
|
44
44
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
45
45
|
"@openai/codex-sdk": "^0.77.0",
|
|
46
46
|
"@smithery/api": "^0.48.0",
|