feat: add real-time voice dictation to composer

Adds dictation support using OpenAI's Realtime API over WebRTC:

Relay:
- New /transcribe/status and /transcribe/session endpoints
- BUZZ_OPENAI_API_KEY env var gates the feature (hidden when absent)
- Proxies ephemeral client-secret minting from OpenAI

Desktop:
- New features/dictation module with:
  - AudioWorklet for 24kHz PCM capture + buffering
  - WebRTC peer connection to OpenAI Realtime API
  - Real-time transcript merging into composer
  - Auto-submit on trigger phrase ('submit')
  - Mic button in composer toolbar (red pulse when recording)
- Integrated into MessageComposer via useComposerDictation hook

Signed-off-by: klopez4212 <klopez4212@gmail.com>
This commit is contained in:
klopez4212
2026-07-11 16:18:04 +01:00
parent 51234bd89f
commit f7ee8ff980
16 changed files with 1003 additions and 2 deletions
+8
View File
@@ -51,6 +51,14 @@ RELAY_URL=ws://localhost:3000
# (use `just web` for Vite HMR instead).
# BUZZ_WEB_DIR=./web/dist
# -----------------------------------------------------------------------------
# Transcription (dictation)
# -----------------------------------------------------------------------------
# OpenAI API key for real-time voice transcription in the composer.
# When absent, the dictation mic button is hidden.
# BUZZ_OPENAI_API_KEY=sk-...
# BUZZ_TRANSCRIPTION_MODEL=whisper-1
# -----------------------------------------------------------------------------
# Git (NIP-34 bare repositories)
# -----------------------------------------------------------------------------