How classiccosta/emma works
Emma is a local macOS voice assistant: the user speaks a wake phrase and request, Emma transcribes and routes it to a stock response or local model, then speaks and displays the reply. The graph preserves the documented audio, conversation, model, speech, settings, and panel capabilities. Some links reflect the README’s stage descriptions; unsampled modules are included where documented, without assuming their internal call relationships.
Main entry points: AssistantEngine.swift Assistant engine · AudioCapture.swift Audio capture · LocalLLMClient.swift Local model client · ServiceSupervisor.swift Service supervisor
Components 25
App orchestration
- Assistant engine
Sources/Emma/App/AssistantEngine.swift - Assistant phase
Sources/Emma/App/Phase.swift
Audio input
- Audio capture
Sources/Emma/Audio/AudioCapture.swift - Endpointer
Sources/Emma/Audio/Endpointer.swift - Wake detection
Sources/Emma/Audio/WakeWordDetector.swift - Transcription
Sources/Emma/Audio/Transcriber.swift
Conversation and replies
- Reply routing
Sources/Emma/Conversation/ReplyRouter.swift - Stock replies
Sources/Emma/Conversation/StockReplies.swift - Chat history
Sources/Emma/Conversation/ChatHistory.swift - Conversation log
Sources/Emma/Conversation/ConversationLog.swift - Reply session
Sources/Emma/App/ReplySession.swift - Reply rules
Sources/Emma/ReplyRules/PersonaPrompt.swift - Model text filter
Sources/Emma/ReplyRules/ModelTextFilter.swift - Local model client
Sources/Emma/LLM/LocalLLMClient.swift
Speech and local services
- LM Studio
Sources/Emma/LLM/LMStudio.swift - Service supervisor
Sources/Emma/App/ServiceSupervisor.swift - Kokoro server client
Sources/Emma/Speech/KokoroServer.swift - Kokoro sidecar
sidecars/kokoro/tts_server.py - Voice selection
Sources/Emma/Speech/Voice.swift - Kokoro speech
Sources/Emma/Speech/KokoroSpeech.swift - Apple speech fallback
Sources/Emma/Speech/AppleSpeech.swift
Settings and interface
- Assistant settings
Sources/Emma/Settings/Settings.swift - Settings window
Sources/Emma/Settings/SettingsWindow.swift - Menu bar panel
Sources/Emma/UI/PanelView.swift
Other components
- User
Connections 29
- User → Audio capture: speaks to
README.md - Audio capture → Endpointer: segments audio
Sources/Emma/Audio/AudioCapture.swift - Audio capture → Wake detection: forwards audio
Sources/Emma/Audio/AudioCapture.swift - Audio capture → Transcription: provides audio
README.md - Wake detection → Assistant engine: signals wake
Sources/Emma/App/AssistantEngine.swift - Transcription → Assistant engine: returns transcript
Sources/Emma/App/AssistantEngine.swift - Assistant engine → Reply routing: routes utterance
Sources/Emma/App/AssistantEngine.swift - Reply routing → Stock replies: selects stock reply
Sources/Emma/App/AssistantEngine.swift - Assistant engine → Chat history: uses context
Sources/Emma/App/AssistantEngine.swift - Assistant engine → Local model client: requests reply
Sources/Emma/App/AssistantEngine.swift - Local model client → Reply rules: uses prompt
- Local model client → LM Studio: sends completion request
Sources/Emma/LLM/LocalLLMClient.swift - Assistant engine → Model text filter: filters reply
Sources/Emma/App/AssistantEngine.swift - Assistant engine → Reply session: streams reply
Sources/Emma/App/AssistantEngine.swift - Assistant engine → Conversation log: records conversation
Sources/Emma/App/AssistantEngine.swift - Assistant engine → Service supervisor: checks services
Sources/Emma/App/AssistantEngine.swift - Service supervisor → LM Studio: starts and warms
Sources/Emma/App/ServiceSupervisor.swift - Service supervisor → Kokoro server client: starts voice service
Sources/Emma/App/ServiceSupervisor.swift - Kokoro server client → Kokoro sidecar: sends synthesis requests
Sources/Emma/Speech/KokoroServer.swift - Assistant engine → Voice selection: speaks response
Sources/Emma/App/AssistantEngine.swift - Voice selection → Kokoro speech: selects Kokoro
Sources/Emma/Speech/Voice.swift - Voice selection → Apple speech fallback: selects fallback
Sources/Emma/Speech/Voice.swift - Kokoro speech → Kokoro server client: synthesizes speech
Sources/Emma/Speech/KokoroSpeech.swift - Kokoro speech → Apple speech fallback: falls back to
Sources/Emma/Speech/KokoroSpeech.swift - Assistant engine → Assistant phase: updates phase
Sources/Emma/App/AssistantEngine.swift - Menu bar panel → Assistant engine: displays state
Sources/Emma/UI/PanelView.swift - Settings window → Assistant settings: edits settings
Sources/Emma/Settings/SettingsWindow.swift - Settings window → Assistant engine: applies changes
Sources/Emma/Settings/SettingsWindow.swift - Assistant engine → Assistant settings: reads configuration
Sources/Emma/App/AssistantEngine.swift