Modal dialog for switching between available agents.
Displays agents found in ~/.deepagents/ in an OptionList. Returns the
selected agent name on Enter, or None on Esc (no change).
Ctrl+S toggles the highlighted agent as the persisted default
([agents].default), mirroring the model selector's affordance.
The name of the currently active agent (to highlight).
May be None when no agent is active.
Sorted list of available agent names to display.
The persisted default agent name from
[agents].default, or None if no default is set.
Key bindings for the selector.
Esc dismisses without switching agents. Arrow keys, Enter, and letter
navigation are handled natively by the embedded OptionList; Tab /
Shift+Tab are bound here to advance the cursor for consistency with
other selector screens. Ctrl+S toggles the highlighted agent as the
persisted default.
Styling for the centered modal shell, title, option list, and help footer.
Compose the screen layout.
Apply ASCII border if needed.
Dismiss with the selected agent name.
Cancel without switching agents.
Move the option list cursor down (Tab).
Move the option list cursor up (Shift+Tab).
Toggle the highlighted agent as the persisted default.
If the highlighted agent is already the default, clears it.
Otherwise sets it as the new default. Disk I/O is offloaded to a
thread so the modal stays responsive. The help line shows a
transient confirmation/error message; the option list is rebuilt
in place so the (default) marker tracks the new state.