SagentsLiveDebugger.Live.Components.MessageComponents
(Sagents LiveDebugger v0.4.0-rc.2)
Copy Markdown
Shared components for rendering messages and tools.
These components are used by both the main AgentListLive and SubagentsTab to provide consistent message and tool rendering with expandable/collapsible UI.
Summary
Functions
Renders a single content part (text, thinking, image, etc.).
Build the display payload for a middleware's config section.
Inspect values for debug display.
Renders a single message item with role emoji, content, tool calls/results, and metadata.
Renders the middleware config display, dispatching on the shape of the
payload returned by display_config/1.
Renders a single config entry within middleware.
Renders a single middleware item with expandable configuration. Expects a MiddlewareEntry struct with id and config fields.
Renders a model configuration within middleware.
Renders a middleware section with a list of middleware entries. Expects an agent struct with a middleware field containing MiddlewareEntry structs.
Renders message content, handling both binary and multimodal content.
Renders a tool call item.
Renders a tool item with expandable description and parameters. Expects a tool struct or map with name, description, parameters, and async fields.
Renders a tool result item.
Functions
Renders a single content part (text, thinking, image, etc.).
Attributes
part(:map) (required)prefix(:string) - Defaults to"".
Build the display payload for a middleware's config section.
Returns:
{:map, map}— render as a key/value config table{:string, text}— render as a single highlighted code block
Prefers the middleware module's own Sagents.Middleware.debug_summary/1
callback when exported. The callback owns the decision of what's useful to
surface; falling back to the raw config is the safe default for middleware
that hasn't opted in.
Inspect values for debug display.
Uses bounded :limit and :printable_limit so that an unexpectedly large
middleware config (or any other value) cannot dominate render time and DOM
size. Middleware modules that hold large structures should implement
Sagents.Middleware.debug_summary/1 to provide a curated view; this
function is the safety net for everything else.
Renders a single message item with role emoji, content, tool calls/results, and metadata.
Attributes
message(:map) (required)index(:integer) - Defaults tonil.
Renders the middleware config display, dispatching on the shape of the
payload returned by display_config/1.
Multi-clause function components let us pick the template at compile time
via pattern matching, instead of a runtime case inside HEEx.
Attributes
display(:any) (required)
Renders a single config entry within middleware.
Attributes
key(:any) (required)value(:any) (required)
Renders a single middleware item with expandable configuration. Expects a MiddlewareEntry struct with id and config fields.
The prefix attribute is used to create unique DOM IDs when the same middleware is displayed in multiple contexts (e.g., main agent vs sub-agent views).
Attributes
entry(:map) (required)prefix(:string) - Defaults to"".
Renders a model configuration within middleware.
Attributes
model(:map) (required)entry_id(:any) (required)prefix(:string) - Defaults to"".
Renders a middleware section with a list of middleware entries. Expects an agent struct with a middleware field containing MiddlewareEntry structs.
The prefix attribute is used to create unique DOM IDs when middleware is displayed in multiple contexts (e.g., main agent vs sub-agent views).
Attributes
agent(:map) (required)prefix(:string) - Defaults to"".
Renders message content, handling both binary and multimodal content.
Renders a tool call item.
Attributes
tool_call(:map) (required)
Renders a tool item with expandable description and parameters. Expects a tool struct or map with name, description, parameters, and async fields.
The prefix attribute is used to create unique DOM IDs when the same tool is displayed in multiple contexts (e.g., main agent vs sub-agent views).
Attributes
tool(:map) (required)prefix(:string) - Defaults to"".
Renders a tool result item.
Attributes
tool_result(:map) (required)