How hal-ucsb/xarp works
XARP is a Python toolkit for building XR applications and exposing XR capabilities to AI agents. Its main workflow is: a developer supplies an application, the server opens a client session, and the application uses the XR facade to request sensing or device information and update the virtual scene. A WebSocket transport carries command bundles and responses to the XR client. Separate capabilities include agent/MCP integration, gesture support, and spatial data models. Edges are limited to relationships visible in excerpts, the source index, or the README; unsampled implementations are not inferred.
Main entry points: express.py XR application facade · remote.py WebSocket transport · server.py Session server · spatial.py Spatial math
Components 18
Application runtime
- Session server
src/xarp/server.py - XR application facade
src/xarp/express.py - Runtime settings
src/xarp/settings.py
Client protocol
- WebSocket transport
src/xarp/remote.py - Command protocol
src/xarp/commands/__init__.py - Scene commands
src/xarp/commands/entities.py - Device info command
src/xarp/commands/info.py - Sensing commands
src/xarp/commands/sensing.py - UI commands
src/xarp/commands/ui.py - Timestamp utility
src/xarp/time.py
XR scene and spatial data
- Device and hand models
src/xarp/data_models.py - Assets and elements
src/xarp/entities.py - Gesture support
src/xarp/gestures.py - Spatial math
src/xarp/spatial.py - Icon assets
src/xarp/icons.py
Agent capabilities
- Agent tools and MCP
src/xarp/agents.py
Other components
- XR application developer
- XR client
Connections 27
- XR application developer → Session server: starts app
README.md - Session server → Runtime settings: loads settings
src/xarp/server.py - Session server → WebSocket transport: opens session
src/xarp/server.py - Session server → XR application facade: provides facade
src/xarp/server.py - XR application facade → WebSocket transport: executes bundles
src/xarp/express.py - XR application facade → Scene commands: issues scene commands
src/xarp/express.py - XR application facade → Device info command: requests device info
src/xarp/express.py - XR application facade → Sensing commands: requests sensing
src/xarp/express.py - XR application facade → UI commands: issues UI commands
src/xarp/express.py - WebSocket transport → XR client: exchanges messages
src/xarp/remote.py - WebSocket transport → Command protocol: parses protocol
src/xarp/remote.py - WebSocket transport → Timestamp utility: timestamps messages
src/xarp/remote.py - WebSocket transport → Runtime settings: reads settings
src/xarp/server.py - Scene commands → Assets and elements: serializes scene data
src/xarp/commands/entities.py - Device info command → Device and hand models: validates info
src/xarp/commands/info.py - Sensing commands → Device and hand models: validates hand data
src/xarp/commands/sensing.py - Sensing commands → Assets and elements: builds image assets
src/xarp/commands/sensing.py - Sensing commands → Spatial math: validates poses
src/xarp/commands/sensing.py - Device and hand models → Spatial math: uses spatial types
src/xarp/data_models.py - Assets and elements → Spatial math: uses transforms
src/xarp/entities.py - Gesture support → Device and hand models: uses hand models
src/xarp/gestures.py - Gesture support → Spatial math: uses spatial types
src/xarp/gestures.py - Icon assets → Assets and elements: creates assets
src/xarp/icons.py - Icon assets → Spatial math: uses spatial types
src/xarp/icons.py - Agent tools and MCP → XR application facade: exposes XR tools
README.md - Agent tools and MCP → Session server: integrates runtime
src/xarp/agents.py - Agent tools and MCP → WebSocket transport: uses client transport
src/xarp/agents.py