pub struct ToolExecutionComponent { /* private fields */ }Expand description
Component that displays a tool execution.
Mirrors TypeScript ToolExecutionComponent class (simplified).
Implementations§
Source§impl ToolExecutionComponent
impl ToolExecutionComponent
Sourcepub fn set_result(&self, result: &str, is_error: bool)
pub fn set_result(&self, result: &str, is_error: bool)
Set the tool result.
Sourcepub fn set_running(&self)
pub fn set_running(&self)
Mark as running.
Sourcepub fn set_expanded(&self, expanded: bool)
pub fn set_expanded(&self, expanded: bool)
Set expanded state.
Sourcepub fn is_expanded(&self) -> bool
pub fn is_expanded(&self) -> bool
Whether the component is currently expanded (for toggle helpers).
Sourcepub fn status(&self) -> ToolStatus
pub fn status(&self) -> ToolStatus
Get the status.
Sourcepub fn set_display_title(&self, title: impl Into<String>)
pub fn set_display_title(&self, title: impl Into<String>)
Override the title shown in the header without changing the underlying tool name used to summarize arguments and route updates.
Sourcepub fn set_skill_name(&self, name: impl Into<String>)
pub fn set_skill_name(&self, name: impl Into<String>)
Mark this component as a skill-invocation read: it renders in the
native-Pi [skill] <name> box style (custom-message background,
collapsible to the full skill markdown). Pass the skill name.
Sourcepub fn is_skill(&self) -> bool
pub fn is_skill(&self) -> bool
Whether this component displays a skill invocation (see
Self::set_skill_name).
Sourcepub fn skill_name(&self) -> Option<String>
pub fn skill_name(&self) -> Option<String>
The skill name when this component is a skill invocation.
Sourcepub fn set_diff(&self, lines: Vec<String>)
pub fn set_diff(&self, lines: Vec<String>)
Attach a pre-rendered colored diff (from crate::diff::render_diff).
When set, the diff lines are always shown (regardless of expanded)
so an edit’s changes are visible directly in the transcript.
Sourcepub fn set_result_markdown(&self, enabled: bool)
pub fn set_result_markdown(&self, enabled: bool)
Render the result body as markdown instead of plain indented text.
The host turns this on when a tool result carries details.markdown = true, so a tool whose payload is markdown (a todo table, a report)
gets its tables/lists/bold rendered by the shared markdown component
rather than printed literally. Markdown rows already wrap themselves to
the panel width, so they are not re-wrapped here.
Sourcepub fn set_todo_state(&self, rows: Vec<(String, String)>)
pub fn set_todo_state(&self, rows: Vec<(String, String)>)
Install plain task rows; the host owns plugin snapshot parsing.