# Plan: Hearing — Audio Stream Monitoring & Meeting Summarization **Goal:** Maven can "hear" ambient audio from workpc — microphone input during meetings, system audio — and on demand (or on trigger) produce transcripts, summaries, or extract action items. A typical use case: "Maven, запиши встречу" starts capture, "хватит" stops it, and Maven writes a summary note. **Done when:** - `internal/audio/capture.go` — remote microphone capture client (receives PCM stream from workpc over WebSocket or the existing voice TCP protocol) - `internal/stt/` — streaming transcription (uses existing `stt.Transcriber` interface, extended with streaming support) - Meeting capture triggered by voice command (IntentCapture) or configurable keyword ("maven record") - Raw audio is either streamed to STT in real-time or saved to a WAV file and transcribed after capture ends - Transcription + LLM summary is written as a note (`source:capture:meeting`) through `ipc.CoreAPI` - New `mavheary` module (`cmd/mavheard/`) — the workpc-side agent that captures mic/speaker audio and streams it to mavend **Scope:** - New `cmd/mavheard/` — workpc-side agent: captures microphone (PortAudio or ALSA `arecord`), streams over WebSocket to mavend - `internal/audio/` extended with capture types: `MicCapture`, `SystemCapture`, `FileCapture` - `internal/stt/stt.go` extended with `StreamingTranscriber` interface (or reuse existing with chunked input) - Router: new `IntentCapture` intent for start/stop commands - Reuses `internal/llm.Client` for summarization - Reuses `internal/voice/server.go` TCP protocol for streaming audio **Steps:** 1. Create `cmd/mavheard/main.go` — workpc-side daemon: captures microphone via `arecord` pipe or PortAudio, opens WebSocket or TCP connection to mavend, streams PCM frames 2. Create `internal/audio/capture.go` — `Capture` interface: `Start()`, `Stop()`, `AudioCh <-chan Audio`; implement `MicCapture` (reads from `mavheard` stream) and `FileCapture` (reads WAV) 3. Extend `internal/stt/stt.go` — add `TranscribeStream(ctx, audio <-chan Audio) (string, error)` to `Transcriber` interface; `Stub` returns empty; `Remote` forwards chunks to worker socket 4. Add `IntentCapture` to `internal/router/intent.go` — slots: `Action` ("start"/"stop"/"status"), `Duration` 5. Wire capture handler in `cmd/mavend/voice.go:reactiveHandler` — start = spawn goroutine receiving audio, stream to STT; stop = finalize, send to LLM for summarization, write note via `WriteNote` 6. Add capture config to `voice` block in `config.Config` — `{capture_enabled, capture_timeout}` 7. Test with a recorded WAV file — simulate a meeting, verify transcription + summary note is created