pub struct ExitPlanModeTool { /* private fields */ }Expand description
Tool that exits plan mode and presents the agent’s plan for human review.
Execution blocks until the human reviewer calls
PlanApprovalGate::approve or PlanApprovalGate::reject. The tool
returns {"approved": true} or {"approved": false, "reason": "…"} so
the agent can branch on the outcome.
Implementations§
Source§impl ExitPlanModeTool
impl ExitPlanModeTool
Sourcepub fn new(gate: Arc<PlanApprovalGate>, event_sink: Arc<dyn EventSink>) -> Self
pub fn new(gate: Arc<PlanApprovalGate>, event_sink: Arc<dyn EventSink>) -> Self
Create a new ExitPlanModeTool.
gate— shared withEnterPlanModeToolandAgentRuntime.event_sink— emitsAgentEvent::PlanProposedto TUI / HTTP.
Sourcepub fn with_permissions(self, permissions: Arc<PermissionsConfig>) -> Self
pub fn with_permissions(self, permissions: Arc<PermissionsConfig>) -> Self
Attach a permissions config so the tool can validate that the plan
covers tools in Plan mode.
Trait Implementations§
Source§impl Tool for ExitPlanModeTool
impl Tool for ExitPlanModeTool
fn spec(&self) -> ToolSpec
fn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn side_effect_class(&self) -> ToolSideEffect
fn side_effect_class(&self) -> ToolSideEffect
Classify this tool’s observable side-effects. Default is the most
conservative value (
External) so any unannotated tool is treated
as risky on resume. Override to ReadOnly or Mutating for
built-in tools; MCP tools derive this from their annotations.Source§fn is_readonly(&self) -> bool
fn is_readonly(&self) -> bool
Convenience: a tool is read-only iff it classifies as
ReadOnly.
Used by the parallel-dispatch path in agent.rs. Override only if
you have an unusual reason (you almost never should — override
side_effect_class instead and let this default through).Auto Trait Implementations§
impl !RefUnwindSafe for ExitPlanModeTool
impl !UnwindSafe for ExitPlanModeTool
impl Freeze for ExitPlanModeTool
impl Send for ExitPlanModeTool
impl Sync for ExitPlanModeTool
impl Unpin for ExitPlanModeTool
impl UnsafeUnpin for ExitPlanModeTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more