Read-only MCP server and tool viewer modal.
Sentinel returned by MCPViewerScreen.dismiss to request a reconnect.
The null-byte prefix makes the value un-collidable with any valid MCP
server name returned by MCPServerInfo.name, so callers can branch on
this exact string without weakening the existing server-name dispatch.
Textual Binding key for the in-viewer reconnect action.
Kept as a module constant so the footer hint and the help-text rendered in server headers stay in sync with the bound chord.
Display label for MCP_RECONNECT_KEY.
Shown in the footer hint chip and inline header prompts so the user sees the same chord text the binding will fire on.
Copy text to the system clipboard.
Get the glyph set for the current charset mode.
Check whether the terminal is in ASCII charset mode.
Convenience wrapper so widgets can branch on charset without importing
both _detect_charset_mode and CharsetMode.
Neutralize control characters and deceptive Unicode in untrusted text.
Untrusted strings (MCP server errors, config-file contents, tool output)
can carry ANSI escape sequences, other control characters, or invisible
Unicode that corrupts the terminal, breaks out of a layout, or injects fake
lines into logs and prompts. This first removes the invisible/bidi code
points flagged by strip_dangerous_unicode, then replaces every remaining
Unicode "Other" (control/format) character with a space.
Character glyphs for TUI display.
A selectable tool item in the MCP viewer.
Read-only modal for a failed MCP server's error details.
A selectable server-header row in the MCP viewer.
Cursor-selectable so users can navigate to every server — even those
in unauthenticated or error states which have no tool rows by the
MCPServerInfo invariant — and activate login, re-authentication, or
error details. Server headers are not expandable.
Modal viewer for active MCP servers and their tools.
Displays servers grouped by name with transport type and tool count. Navigate with arrow keys, Enter to expand/collapse tool descriptions, start in-app OAuth login or re-authentication, or inspect a failed server. Ctrl+R requests a reconnect, F2 on a server header toggles its disabled state, and Escape closes the modal.
Dismisses with None when closed without action, the server name to
drive in-TUI OAuth when the user activates a login-capable server header,
or MCP_VIEWER_RECONNECT_REQUEST for a reconnect. The disable/enable
toggle (F2) is handled in-place via the on_toggle_disable callback so
the screen never tears down — see the constructor.
LangChain brand colors and semantic constants for the app.
Single source of truth for color values used in Python code (Rich markup,
Content.styled, Content.from_markup). CSS-side styling should reference
Textual CSS variables: built-in variables
($primary, $background, $text-muted, $error-muted, etc.) are set via
register_theme() in DeepAgentsApp.__init__, while the few app-specific
variables ($mode-bash, $mode-command, $mode-incognito, $skill,
$skill-hover, $tool, $tool-hover) are backed by these constants via
App.get_theme_variable_defaults().
Code that needs custom CSS variable values should call
get_css_variable_defaults(dark=...). For the full semantic color palette, look
up the ThemeColors instance via get_registry().
Users can define custom themes in ~/.deepagents/config.toml under
[themes.<name>] sections. Each new theme section must include label (str);
dark (bool) defaults to False if omitted (set to True for dark themes).
Color fields are optional and fall back to the built-in dark/light palette based
on the dark flag. Sections whose name matches a built-in theme override its
colors without replacing it. See _load_user_themes() for details.