pub struct TOOL_CONFIRMATIONS { /* private fields */ }Expand description
Global confirmation manager used by the agent pipeline and UI commands.
Methods from Deref<Target = ToolConfirmationManager>§
Sourcepub fn register(
&self,
confirmation_id: String,
session_id: Option<String>,
tool_name: String,
tool_args: String,
) -> Receiver<ToolConfirmationDecision>
pub fn register( &self, confirmation_id: String, session_id: Option<String>, tool_name: String, tool_args: String, ) -> Receiver<ToolConfirmationDecision>
Register a new confirmation request and return a receiver for the decision.
If a confirmation with the same id already exists, it is replaced.
Sourcepub fn resolve(
&self,
confirmation_id: &str,
session_id: Option<&str>,
approved: bool,
) -> Result<(), String>
pub fn resolve( &self, confirmation_id: &str, session_id: Option<&str>, approved: bool, ) -> Result<(), String>
Resolve a pending confirmation.
Returns an error if the confirmation id is unknown, or if a session id is required and does not match.
Sourcepub fn resolve_decision(
&self,
confirmation_id: &str,
session_id: Option<&str>,
decision: ToolConfirmationDecision,
) -> Result<(), String>
pub fn resolve_decision( &self, confirmation_id: &str, session_id: Option<&str>, decision: ToolConfirmationDecision, ) -> Result<(), String>
Resolve a pending confirmation with a scoped decision.
Returns an error if the confirmation id is unknown, or if a session id is required and does not match.
Sourcepub fn apply_session_policy_decision(
&self,
session_id: &str,
tool_name: &str,
decision: ToolConfirmationDecision,
)
pub fn apply_session_policy_decision( &self, session_id: &str, tool_name: &str, decision: ToolConfirmationDecision, )
Apply a scoped decision to session-level tool policy caches.
This enables “Allow for session” and “Deny for session” semantics to be respected by the pipeline when processing later tool calls.
Sourcepub fn is_tool_allowed_for_session(
&self,
session_id: &str,
tool_name: &str,
) -> bool
pub fn is_tool_allowed_for_session( &self, session_id: &str, tool_name: &str, ) -> bool
Return true if the tool has been allowed for this session.
Sourcepub fn is_tool_blocked_for_session(
&self,
session_id: &str,
tool_name: &str,
) -> bool
pub fn is_tool_blocked_for_session( &self, session_id: &str, tool_name: &str, ) -> bool
Return true if the tool has been blocked for this session.
Sourcepub fn abandon(&self, confirmation_id: &str)
pub fn abandon(&self, confirmation_id: &str)
Remove a pending confirmation without resolving it.
This is useful on timeout/cancel to avoid leaking entries.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Return the number of currently pending confirmations.
Trait Implementations§
Source§impl Deref for TOOL_CONFIRMATIONS
impl Deref for TOOL_CONFIRMATIONS
Source§type Target = ToolConfirmationManager
type Target = ToolConfirmationManager
Source§fn deref(&self) -> &ToolConfirmationManager
fn deref(&self) -> &ToolConfirmationManager
impl LazyStatic for TOOL_CONFIRMATIONS
Auto Trait Implementations§
impl Freeze for TOOL_CONFIRMATIONS
impl RefUnwindSafe for TOOL_CONFIRMATIONS
impl Send for TOOL_CONFIRMATIONS
impl Sync for TOOL_CONFIRMATIONS
impl Unpin for TOOL_CONFIRMATIONS
impl UnwindSafe for TOOL_CONFIRMATIONS
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].