Skip to main content

ToolExecutionComponent

Struct ToolExecutionComponent 

Source
pub struct ToolExecutionComponent { /* private fields */ }
Expand description

Component that displays a tool execution.

Mirrors TypeScript ToolExecutionComponent class (simplified).

Implementations§

Source§

impl ToolExecutionComponent

Source

pub fn new(name: &str, args: &str) -> Self

Create a new tool execution component.

Source

pub fn set_args(&self, args: &str)

Set the tool arguments.

Source

pub fn set_result(&self, result: &str, is_error: bool)

Set the tool result.

Source

pub fn set_running(&self)

Mark as running.

Source

pub fn set_expanded(&self, expanded: bool)

Set expanded state.

Source

pub fn is_expanded(&self) -> bool

Whether the component is currently expanded (for toggle helpers).

Source

pub fn status(&self) -> ToolStatus

Get the status.

Source

pub fn name(&self) -> String

Get the tool name.

Source

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.

Source

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.

Source

pub fn is_skill(&self) -> bool

Whether this component displays a skill invocation (see Self::set_skill_name).

Source

pub fn skill_name(&self) -> Option<String>

The skill name when this component is a skill invocation.

Source

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.

Source

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.

Source

pub fn set_todo_state(&self, rows: Vec<(String, String)>)

Install plain task rows; the host owns plugin snapshot parsing.

Source

pub fn is_todo_list(&self) -> bool

Source

pub fn set_plan_state(&self, plan: String, active: bool)

Source

pub fn is_plan_panel(&self) -> bool

Trait Implementations§

Source§

impl Component for ToolExecutionComponent

Source§

fn render(&self, width: usize) -> Vec<String>

Render the component to lines for the given viewport width. Read more
Source§

fn invalidate(&self)

Invalidate any cached rendering state. Called when theme changes or when component needs to re-render from scratch.
Source§

fn as_any(&self) -> &dyn Any

Downcast to Any for runtime type checking. This enables the layout system to check for LayoutNodeProvider.
Source§

fn handle_input(&self, _data: &str) -> bool

Optional handler for keyboard input when component has focus. Read more
Source§

fn wants_key_release(&self) -> bool

If true, component receives key release events (Kitty protocol). Default is false - release events are filtered out.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.