Skip to main content

Module chat

Module chat 

Source

StructsΒ§

AudioSettingsPage πŸ”’
ChatConfig πŸ”’
Persisted user choices for rbnx chat, written to ~/.robonix/chat.yaml.
ChatMessage πŸ”’
ForestView πŸ”’
Live RTDL forest state for the right-side panel. Fed by PilotEvent task_state / plan / node_state / batch_result events; rendered every frame.
PlanView πŸ”’

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 πŸ”’
cap_short_name πŸ”’
The standard LLM-facing capability name, exactly as pilot presents it to the model and as the model emits it in do.cap: provider_id.<area>_<leaf> β€” e.g. tiago_camera.camera_snapshot, tiago_lidar.lidar_snapshot, explore.explore_status, executor.builtin_read_file. The <area>_<leaf> part mirrors robonix_pilot::discovery::llm_name (kept in sync here since rbnx-cli doesn’t depend on the pilot crate); the <area> prefix is what disambiguates the shared snapshot / status leaves across providers.
chat_config_path πŸ”’
compact_call_label πŸ”’
Compact one-line label for a do node: provider.leaf(short args). Collapses whitespace/newlines (run_command args are whole shell scripts) and elides past ~48 chars so the tree stays readable in both the log and the panel.
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.”
forest_node_lines πŸ”’
forest_panel_lines πŸ”’
Render the whole forest panel (goal + status + every tree with per-node live state) as styled lines.
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.
node_state_glyph πŸ”’
Glyph + style for one node given its executor state (None = pending).
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”.
render_plan_node πŸ”’
render_plan_tree πŸ”’
Render a Plan arena as an ASCII tree, e.g.
run_audio_settings_page πŸ”’
run_text_intent_with_esc_abort πŸ”’
run_tui πŸ”’
run_voice_session_with_esc_abort πŸ”’
save_chat_config πŸ”’
send_steer πŸ”’
Submit text as a mid-task steer on an already-running session. Pilot routes it to the live turn’s steer queue and returns an empty stream, which we drain.
spawn_voice_steer πŸ”’
Fire-and-forget a mid-turn VOICE steer (Ctrl+V during a running turn): record + ASR another utterance via a fresh voice session and let its transcript submit β€” Pilot steers it into the active turn. TTS is disabled here (the per-segment playback rides the main turn’s stream); we just drain this session’s events on a spawned task.
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.