Formatting utilities for tool call display in the app.
This module handles rendering tool calls and tool messages for the TUI.
Imported at module level by textual_adapter (itself deferred from the startup
path). Heavy SDK dependencies (e.g., backends) are deferred to function bodies.
Character limit for tool argument values in the UI.
Longer values are truncated with an ellipsis by truncate_value
in tool_display.
Width at which the js_eval header truncates the first code line.
Shared with messages.py so the "header truncates the first line" cutoff and
the "offer a collapsible code block" threshold stay in lock-step from a single
source of truth.
Get the glyph set for the current charset mode.
Remove known dangerous/invisible Unicode characters from text.
Truncate a string value if it exceeds max_length.
Format tool calls for display with tool-specific smart formatting.
Shows the most relevant information for each tool type rather than all arguments.
Convert ToolMessage content into a printable string.