mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 07:37:26 +01:00
Cat Bot has to be a complete equivalent of Grok Bot, which has a voice mode. The chat could take dictation and read an answer aloud, but not hold a spoken conversation. - VoiceMode (the screen), useVoiceMode (the loop), voiceModeReducer (the rules, pure): listening -> thinking -> speaking -> listening. One big button ends the person's turn (a pause ends it by itself where the browser's recogniser runs) and cuts in while the answer is read. The app passes onTurn(text) => Promise<answer> and, if it has one, a studio speaker. - The microphone and the voice follow the phase and nothing else (voiceModeWants): never both open, neither open when the call is off. Two empty takes, a failed transcription or an answer that never comes each end the call in words, with "Talk again". - Fix, useDictation: a second start() before the browser had handed the microphone over opened a second microphone and orphaned the first, whose track stayed live with nothing left to stop it. One request at a time now, and a take cancelled while the microphone was still opening closes it where it arrives. Found by this change's browser test. - Its styles are their own section and styles/voice.css, so the embedded chat sheet stays inside its 11 KB budget. test/voice-mode.test.js (8) and test/browser-voice.mjs (a real browser, a fake-device microphone, every opened track counted). pnpm run verify passes. Claude-Session: https://claude.ai/code/session_019MDtmt4p1jMfJnbJtpeNhi Co-authored-by: Claude <noreply@anthropic.com>
1 line
1.5 KiB
Plaintext
1 line
1.5 KiB
Plaintext
{"version":3,"file":"use-dictation.d.ts","sourceRoot":"","sources":["../../src/react/use-dictation.ts"],"names":[],"mappings":"AAGA,OAAO,EAoBL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AAoCzB,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,wDAAwD;IACxD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;0DAEsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;8EAG0E;IAC1E,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC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