pub struct ToolContext {
pub puppet: Arc<RwLock<Option<WebPuppet>>>,
pub permissions: Arc<PermissionGuard>,
pub screening_config: ScreeningConfig,
pub intervention_handler: Arc<RwLock<InterventionHandler>>,
pub headless: bool,
}Expand description
Context passed to tools during execution.
Fields§
§puppet: Arc<RwLock<Option<WebPuppet>>>WebPuppet instance (lazy-initialized).
permissions: Arc<PermissionGuard>Permission guard.
screening_config: ScreeningConfigScreening configuration.
intervention_handler: Arc<RwLock<InterventionHandler>>Intervention handler for human-in-the-loop.
headless: boolWhether to run browser in headless mode (default: true).
Implementations§
Source§impl ToolContext
impl ToolContext
Sourcepub fn new(permissions: PermissionGuard) -> Self
pub fn new(permissions: PermissionGuard) -> Self
Create a new tool context.
Sourcepub fn with_visible_browser(permissions: PermissionGuard) -> Self
pub fn with_visible_browser(permissions: PermissionGuard) -> Self
Create a new tool context with visible browser (non-headless).
Sourcepub async fn get_puppet(&self) -> Result<WebPuppet>
pub async fn get_puppet(&self) -> Result<WebPuppet>
Get or create the WebPuppet instance.
Auto Trait Implementations§
impl Freeze for ToolContext
impl !RefUnwindSafe for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl !UnwindSafe for ToolContext
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
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