sequenceDiagram
participant A as Actor
participant B as Browser App
participant C as CLM Server
participant H as Hume EVI
Note over B,C: SESSION SETUP
A->>B: Pick script and characters
B->>C: POST /init-session with script text
C-->>B: OK - 12 lines total, 6 agent lines
B->>H: WebSocket connect with CLM config
B->>H: sendSessionSettings with auth key
A->>B: Tap Start, grant mic
Note over A,H: TURN 1
A->>H: Speaks line into mic
H->>H: Transcribes speech to text
H->>B: user_message event
H->>C: POST /chat/completions?custom_session_id=xxx
C->>C: Look up session, get next agent line
C-->>H: SSE stream with exact scripted line
H->>H: Convert text to speech
H->>B: assistant_message event
H->>B: audio_output chunks
B->>A: Plays agent line through speaker
Note over A,H: TURN 2 - same flow repeats
A->>H: Speaks next line
H->>C: POST /chat/completions
C-->>H: Next agent line
H->>B: Audio of that line
Note over C: When no lines left
C-->>H: Scene complete