Spaces:
Running
Running
Agent Guide for registry/
Context
GenUI (Generative UI) component registry. These React components are rendered dynamically when the backend emits ui.component WebSocket events. The LLM decides which component to show via backend tool calls.
Structure & Navigation
Components are registered in index.tsx and rendered by ComponentOverlay / ChatInterface.
Component β Backend Tool Mapping
| GenUI Component | Triggered By (Backend Tool) | Tool Location |
|---|---|---|
OnboardingProgress |
show_onboarding_step, get_onboarding_status |
profiles/_locked_profile/show_onboarding_step.py, get_onboarding_status.py |
OnboardingReview |
show_onboarding_review |
profiles/_locked_profile/show_onboarding_review.py |
OnboardingSummary |
complete_onboarding |
profiles/_locked_profile/complete_onboarding.py |
ProfileCard |
complete_onboarding |
profiles/_locked_profile/complete_onboarding.py |
MedicationCard |
setup_medication, update_my_medication |
profiles/_locked_profile/setup_medication.py, update_my_medication.py |
MedLog |
start_medication_entry, update_medication_entry |
profiles/_locked_profile/start_medication_entry.py, update_medication_entry.py |
HeadacheLog |
start_headache_entry, update_headache_entry |
profiles/_locked_profile/start_headache_entry.py, update_headache_entry.py |
ConfirmationCard |
save_current_entry |
profiles/_locked_profile/save_current_entry.py |
EntryCard |
entry_control |
profiles/_locked_profile/entry_control.py |
HistoryTimeline |
get_recent_entries |
profiles/_locked_profile/get_recent_entries.py |
MyMedsList |
get_my_medications, update_my_medication |
profiles/_locked_profile/get_my_medications.py, update_my_medication.py |
OptionsPicker |
entry_control |
profiles/_locked_profile/entry_control.py |
QuickReply |
log_entry |
profiles/_locked_profile/log_entry.py |
ReportPreview / ReportConfirmation |
send_report |
profiles/_locked_profile/send_report.py |
TrendChart |
query_health_history |
tools/query_health_history.py |
SessionSummary |
session_summary tool |
tools/session_summary.py |
DailySnapshot |
check_medication |
tools/check_medication.py |
CheckInCard |
check_medication |
tools/check_medication.py |
MedStatus |
check_medication, log_entry |
tools/check_medication.py, profiles/_locked_profile/log_entry.py |
MusicPicker |
media_control, list_music |
tools/media_control.py, tools/list_music.py |
NowPlaying |
media_control, resume_music, pause_music, stop_music |
tools/media_control.py, resume_music.py, etc. |
VolumeControl |
set_volume |
tools/set_volume.py |
SettingsConfirmation |
update_settings |
profiles/_locked_profile/update_settings.py |
Rendering Pipeline
Backend tool calls emit_ui_component(name, props)
β WebSocket broadcasts {type: "ui.component", name, props}
β useConversation receives event
β ComponentOverlay renders ComponentRegistry[name](props)
Dependencies & Connections
- Backend: Every component is triggered by
emit_ui_component()instream_api.py - Hook:
useConversationhandlesui.componentevents and tracks latest component - Component:
ComponentOverlayrenders the active GenUI component
Adding a New GenUI Component
- Create
NewComponent.tsxin this directory - Import and register in
index.tsx - Create or modify backend tool to call
await emit_ui_component("NewComponent", {...props}) - Test: trigger via voice command β verify component renders in overlay
- Update this
AGENT.mdtable