How brightwav3/agent-face works
Agent Face is a dependency-free JavaScript library for rendering expressive, animated SVG faces. The main workflow is: an integrator creates a face in a container, configures its shape, state and appearance, then updates it through the API; the library tracks gaze and animation and renders the result. The sampled source shows DOM setup, pointer sharing, visibility handling and rendering in one runtime file, so these are internal responsibilities rather than separate modules. The README documents additional capabilities that the excerpts do not show in detail.
Main entry points: agent-face.src.js AgentFace runtime
Components 7
Face API
- AgentFace runtime
src/agent-face.src.js
Interaction and motion
- Shared pointer
src/agent-face.src.js - Visibility and theme
src/agent-face.src.js - Face animation
src/agent-face.src.js
SVG rendering
- SVG setup
src/agent-face.src.js - SVG rendering
src/agent-face.src.js
Other components
- Integrator
Connections 7
- Integrator → AgentFace runtime: creates and updates
README.md - AgentFace runtime → SVG setup: builds DOM
src/agent-face.src.js - AgentFace runtime → Shared pointer: binds when tracking
src/agent-face.src.js - AgentFace runtime → Visibility and theme: observes face and theme
src/agent-face.src.js - Face animation → SVG rendering: renders each frame
src/agent-face.src.js - Shared pointer → Face animation: kicks live faces
src/agent-face.src.js - Visibility and theme → Face animation: kicks when visible
src/agent-face.src.js