Documentation
¶
Overview ¶
Package tool builds the TUI view for a tool call message.
A small lookup table (builders) maps each tool's name to a constructor. Lookup order is: exact tool name, then "category:<category>", then a defaulttool fallback.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns the appropriate tool view for the given message. Lookup order: exact tool name, then "category:<category>", then default. At each tier a registered custom renderer wins over the built-in one.
func Register ¶ added in v1.88.0
Register installs a custom renderer for the given key, which is a tool name (e.g. "add") or a "category:<name>" key (e.g. "category:compute"). Registering a key that already exists replaces the previous renderer. Registered renderers take precedence over the built-in ones.
Register is safe for concurrent use, but is normally called once at startup (e.g. via tui.WithToolRenderers) before the TUI begins rendering.