Skip to main content

PersonaTool

Struct PersonaTool 

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

Agent tool for persona management.

Wraps the PersonaApi domain of the KernelHandle. Allows agents to query and switch between active personas.

§Actions

ActionDescriptionRequired params
listList all personas
getGet persona by IDid
set_activeSet the active personaid

Implementations§

Source§

impl PersonaTool

Source

pub fn from_kernel(kernel: &KernelHandle) -> Self

Create a new PersonaTool from a KernelHandle.

Extracts the PersonaManager Arc from the kernel’s Persona API.

Trait Implementations§

Source§

impl AgentTool for PersonaTool

Source§

fn name(&self) -> &str

Tool name (used in function calls)
Source§

fn label(&self) -> &str

Human-readable label
Source§

fn description(&self) -> &'static str

Description for the model
Source§

fn parameters_schema(&self) -> Value

JSON Schema for parameters
Source§

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _tool_call_id: &'life1 str, params: Value, _signal: Option<Receiver<()>>, _ctx: &'life2 ToolContext, ) -> Pin<Box<dyn Future<Output = Result<AgentToolResult, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute the tool with the given tool call ID and parameters. Read more
Source§

fn essential(&self) -> bool

Whether this tool is essential (cannot be disabled). Essential tools: read, write, edit, bash, grep, find, ls Optional tools: web_search, github, subagent, etc.
Source§

fn on_progress(&self, _callback: Arc<dyn Fn(String) + Send + Sync>)

Called with progress updates during execution. Tools can override this to emit streaming updates.
Source§

fn on_browse_progress( &self, _callback: Arc<dyn Fn(BrowseProgress) + Send + Sync>, )

Structured browse progress callback for browser tool context enrichment. Default implementation is no-op. Only browse tools override this to register a callback that enriches ToolCallContext with structured data from BrowseProgress events.
Source§

fn render_call(&self, _params: &Value) -> Option<RenderOutput>

Custom rendering for tool call (TUI visualization). Return None to use the default tool_renderer.rs formatter.
Source§

fn render_result(&self, _result: &AgentToolResult) -> Option<RenderOutput>

Custom rendering for tool result (TUI visualization). Return None to use the default tool_renderer.rs formatter.
Source§

fn execution_mode(&self) -> ToolExecutionMode

Execution mode for parallel safety. Defaults to ParallelSafe. Override for file-mutating or sequential tools.
Source§

fn current_tab_id(&self) -> Option<Uuid>

Return the current active tab ID, if this tool manages browser tabs. Defaults to None. Browser tools override this to return the tab ID of the currently-open tab during execution, so the agent loop can populate ToolExecutionUpdate.tab_id.
Source§

fn set_tab_id_slot(&self, _slot: Arc<Mutex<RawMutex, Option<Uuid>>>)

Receive a shared slot where the tool can write the current tab ID. The agent loop creates the slot and passes it before on_progress; the tool writes Some(tab_id) when it opens a tab and None when it closes it. Defaults to a no-op — only tab-aware tools override.
Source§

fn to_definition(&self) -> ToolDefinition

Convert to ToolDefinition
Source§

impl Debug for PersonaTool

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more