feat(voice): harden Gemini Live provider integration

This commit is contained in:
manjunath committed 2026-10-16 17:09:03 +05:30
1 parent d4492d8f8c
commit 4fde920665
102 files changed
+28528 -1581

No files matched your search

+9 -2
View File
@@ -330,10 +330,17 @@ export function createPointerTracker({
* (open mic only when it moved recently: `recentMs`). The result becomes
* the turn's referent (null when stale).
*/
beginTurn(at, { recentMs = POINTER_FRESH_MS } = {}) {
beginTurn(at, { recentMs = POINTER_FRESH_MS, capturedSnapshot } = {}) {
const reuse =
at !== 'text' && held && now() - held.heldAt <= POINTER_HOLD_MS;
const snapshot = reuse ? held.snapshot : capture(at, { recentMs });
// A delayed worklet admission may arrive after Space release. The
// provider owns this previously captured, local gesture snapshot.
const snapshot =
capturedSnapshot !== undefined
? capturedSnapshot
: reuse
? held.snapshot
: capture(at, { recentMs });
if (!reuse && at !== 'text') held = null;
active = snapshot?.fresh ? snapshot : null;
return snapshot;