Skip to main content

Module chat

Module chat 

Source

StructsΒ§

AudioSettingsPage πŸ”’
ChatConfig πŸ”’
Persisted user choices for rbnx chat, written to ~/.robonix/chat.yaml.
ChatMessage πŸ”’

EnumsΒ§

AudioSection πŸ”’
PickMode πŸ”’
Pick mode for the legacy modal picker chain (FirstRun only β€” the Ctrl+A path now uses the dashboard via run_audio_settings_page). Reconfigure is kept so the older code paths that still take a PickMode parameter compile cleanly even though nothing constructs it.
Role πŸ”’

ConstantsΒ§

CONSUMER_ID πŸ”’
DEFAULT_LIAISON_FALLBACK πŸ”’
LIAISON_CONTRACT_ID πŸ”’
MIC_CONTRACT πŸ”’
Atlas contract ids for the audio primitives that have user-visible device choices on a multi-provider host (e.g. local ALSA driver vs the macOS bridge). asr/tts are software backends with one provider per box, so we don’t prompt for them.
SPEAKER_CONTRACT πŸ”’

FunctionsΒ§

abort_session πŸ”’
apply_pilot_event πŸ”’
apply_voice_event πŸ”’
build_control_task πŸ”’
build_text_task πŸ”’
call_select_device πŸ”’
chat_config_path πŸ”’
discover_liaison πŸ”’
Try to discover Liaison via Atlas, retrying for up to timeout_secs.
draw πŸ”’
ensure_audio_devices πŸ”’
Best-effort audio device discovery. Anything that goes wrong here (atlas unreachable, no providers registered, user pressed Esc) is downgraded to a chat-history warning β€” text mode keeps working.
execute
fetch_devices_filtered πŸ”’
flash_picker_message πŸ”’
Render a single-line status page and pause briefly so the user can read it before the next picker step (or the chat) takes over the screen. Long messages now sit for 1.4 s β€” the previous 400 ms felt like β€œthe page just flashed and disappeared.”
load_chat_config πŸ”’
localhost_to_ipv4_loopback πŸ”’
Pilot/Liaison bind IPv4 (0.0.0.0). Resolving localhost often prefers ::1, so the gRPC client hits IPv6 and gets connection refused β€” force IPv4 loopback.
notify_session_end πŸ”’
now_ms πŸ”’
pick_audio_settings πŸ”’
pick_device_for_cap πŸ”’
Connect to provider_id’s list_devices capability, ask for the device list, run a picker on the entries that match kind (input/output)
pick_device_tui πŸ”’
pick_tui πŸ”’
pin_exists_in_atlas πŸ”’
True iff atlas currently has a provider whose id (or namespace) matches the pin AND it provides contract over GRPC. Used at chat startup to detect stale pins from a prior deploy whose audio provider has since been renamed or removed β€” caller drops the pin and re-prompts the picker instead of silently letting voice fail with β€œno provider”.
plan_calls πŸ”’
run_audio_settings_page πŸ”’
run_text_intent_with_esc_abort πŸ”’
run_tui πŸ”’
run_voice_session_with_esc_abort πŸ”’
save_chat_config πŸ”’
try_discover_once πŸ”’
try_pick πŸ”’
Ok(Some((provider_id, device_id))) = picked both layers; device_id may be β€œβ€ when the impl returned UNIMPLEMENTED on list_devices. Ok(None) = no providers in atlas.
voice_language πŸ”’
voice_node πŸ”’
voice_node_with_cfg πŸ”’
Same as voice_node but falls back to cfg_value (from chat.yaml) when the env var is unset / empty. Empty result still means β€œlet liaison auto-pick from atlas”.
voice_record_seconds πŸ”’
voice_tts_enabled πŸ”’
whoami_username πŸ”’
Tiny username probe β€” avoids pulling in whoami for the CLI by reading $USER/$USERNAME with a β€œuser” fallback. Liaison uses the real whoami crate when it stamps the canonical local:<user> identity.