Understand the LiveSessionController and LiveSessionState architecture
mainThe LiveSessionController is the central authority for managing active recording sessions. It replaces business logic previously held in the view layer (ContentView).
Key Responsibilities:
- Manages the 100ms polling loop.
- Publishes
LiveSessionStateto the UI. - Handles utterance ingestion (both local and remote).
- Reacts to settings changes (e.g., updating Knowledge Base paths).
- Processes external commands for starting and stopping sessions.
- Coordinates with
AppCoordinatorfor state transitions (callingcoordinator.handle()rather thantransition()directly).
Critical Implementation Rules:
startSession()must set the state synchronously via the coordinator; noawaitshould occur before the phase change.state.isRunningmust mirror thetranscriptionEngine.isRunningstatus, not thesessionPhase.
ContentView should be a pure projection of LiveSessionController.state and should contain zero business logic.
struct LiveSessionState: Equatable {
var isRunning: Bool = false
var sessionPhase: MeetingState = .idle
var audioLevel: Float = 0
var liveTranscript: [Utterance] = []
var volatileYouText: String = ""
var volatileThemText: String = ""
var suggestions: [Suggestion] = []
var isGeneratingSuggestions: Bool = false
var batchStatus: BatchTranscriptionEngine.Status = .idle
var lastEndedSession: String? = nil
var lastSessionHasNotes: Bool = false
var kbIndexingProgress: String = ""
var statusMessage: String? = nil
var errorMessage: String? = nil
var needsDownload: Bool = false
var transcriptionPrompt: String? = nil
var modelDisplayName: String = ""
}