How litorian113/irobot works
V.I.K.I. is a browser-based voice-agent experience that gives spoken AI replies animated, selectable 3D characters. The main flow runs from the mic orb through token issuance and the AssemblyAI WebSocket session, then routes speech/audio events into captions, lip-sync, and the rendered face. The rendering branch supports VIKI’s optical cube, Dust particles, Max’s lattice, and LEIRA’s simpler scene; configuration and in-app docs are additional product capabilities. Some renderer internals are unsampled, so their connections are limited to documented or indexed references.
Main entry points: App.tsx App coordinator · ParticleFace.ts Particle face renderer · useVoiceSession.ts Voice session hook · voiceAgent.ts Voice WebSocket client
Components 32
Interaction & settings
- App coordinator
src/App.tsx - Mic control
src/MicControl.tsx - Captions
src/Captions.tsx - Radial menu
src/RadialMenu.tsx - Config panel
src/ConfigPanel.tsx - Head configuration
src/viki/config.ts - In-app essay
src/DocsPage.tsx
Voice conversation
- Voice session hook
src/useVoiceSession.ts - Token endpoint
api/token.js - AssemblyAI Voice Agent
- Voice WebSocket client
src/viki/voiceAgent.ts - Agent event router
src/viki/agentEvents.ts - PCM capture worklet
public/audio/pcm-capture-worklet.mjs - PCM encoding
src/viki/pcm.ts - PCM playback
src/viki/PcmPlayer.ts
Face & speech animation
- Speech output
src/viki/SpeechOutput.ts - Lip sync
src/viki/lipsync.ts - Viseme mapping
src/viki/visemes.ts - Rigged head
src/viki/HeadRig.ts - Head deformation shader
src/viki/headShader.ts - Preview mode
src/previewMode.ts
Character scenes
- Renderer interface
src/viki/HeadRenderer.ts - Particle face renderer
src/viki/ParticleFace.ts - Dust surface style
src/viki/styles.ts - Layered portrait
src/viki/LayeredPortrait.ts - VIKI cube scene
src/viki/VikiCube.ts - Cube interior
src/viki/VikiInterior.ts - Cube assembly
src/viki/VikiAssembly.ts - Tile dynamics
src/viki/TileDynamics.ts - Tile targets
src/viki/tileTarget.ts - LEIRA renderer
src/viki/LeiraFace.ts
Other components
- Visitor
Connections 43
- Visitor → Mic control: activates
- App coordinator → Mic control: renders
src/App.tsx - App coordinator → Radial menu: renders
src/App.tsx - App coordinator → Captions: renders
src/App.tsx - App coordinator → Config panel: renders
src/App.tsx - App coordinator → In-app essay: opens
src/App.tsx - Radial menu → App coordinator: selects style
src/App.tsx - Config panel → Head configuration: edits
src/ConfigPanel.tsx - App coordinator → Head configuration: loads config
src/App.tsx - App coordinator → Renderer interface: creates scene
src/App.tsx - App coordinator → Voice session hook: starts session
src/App.tsx - App coordinator → Preview mode: applies preview
src/App.tsx - Voice session hook → Token endpoint: requests token
README.md - Token endpoint → AssemblyAI Voice Agent: mints token
api/token.js - Voice session hook → Voice WebSocket client: connects
src/useVoiceSession.ts - Voice WebSocket client → AssemblyAI Voice Agent: streams audio
README.md - Voice WebSocket client → PCM capture worklet: loads worklet
src/viki/voiceAgent.ts - Voice WebSocket client → PCM encoding: encodes input
src/viki/voiceAgent.ts - Voice WebSocket client → PCM playback: plays reply audio
src/viki/voiceAgent.ts - Voice WebSocket client → Agent event router: routes events
src/viki/voiceAgent.ts - Voice session hook → Speech output: constructs
src/useVoiceSession.ts - Voice session hook → Lip sync: constructs
src/useVoiceSession.ts - Speech output → Lip sync: uses
src/viki/SpeechOutput.ts - Speech output → Viseme mapping: maps speech
src/viki/SpeechOutput.ts - Voice session hook → Captions: provides text
src/App.tsx - App coordinator → Particle face renderer: selects renderer
src/App.tsx - App coordinator → LEIRA renderer: selects renderer
src/App.tsx - Renderer interface → Particle face renderer: defines controls
src/viki/HeadRenderer.ts - Particle face renderer → Rigged head: builds rig
src/viki/ParticleFace.ts - Rigged head → Viseme mapping: uses morph mapping
src/viki/HeadRig.ts - Particle face renderer → Dust surface style: uses style shaders
src/viki/ParticleFace.ts - Particle face renderer → Layered portrait: uses portrait
src/viki/ParticleFace.ts - Particle face renderer → VIKI cube scene: uses cube scene
src/viki/ParticleFace.ts - Particle face renderer → Cube interior: uses enclosure
src/viki/ParticleFace.ts - VIKI cube scene → Cube interior: builds interior
src/viki/VikiCube.ts - VIKI cube scene → Cube assembly: uses assembly
src/viki/VikiCube.ts - Layered portrait → Tile dynamics: uses dynamics
src/viki/LayeredPortrait.ts - Tile dynamics → Tile targets: reads targets
src/viki/TileDynamics.ts - Dust surface style → Head deformation shader: uses deformation
src/viki/styles.ts - Layered portrait → Head deformation shader: uses deformation
src/viki/LayeredPortrait.ts - LEIRA renderer → Rigged head: builds rig
src/viki/LeiraFace.ts - LEIRA renderer → Head configuration: applies defaults
src/viki/LeiraFace.ts - Preview mode → Viseme mapping: selects pose
src/previewMode.ts