Struct TextBrowserTool
pub struct TextBrowserTool { /* private fields */ }Expand description
Text browser tool: renders web pages as plain text using text-based browsers (lynx, links, w3m). Ideal for headless/SSH environments where graphical browsers are unavailable.
The selected external browser owns its transport, resolves DNS again, and
follows redirects without ZeroClaw revalidating each destination. Unlike
web_fetch, this tool cannot pin the preflight answer. The resolved-address
checks are defense in depth, not a DNS-rebinding or redirect boundary.
Prefer web_fetch for attacker-controlled URLs.
Implementations§
Source§impl TextBrowserTool
impl TextBrowserTool
Sourcepub fn new(
security: Arc<SecurityPolicy>,
preferred_browser: Option<String>,
timeout_secs: u64,
nat64_prefixes: Vec<String>,
) -> Result<TextBrowserTool, Error>
pub fn new( security: Arc<SecurityPolicy>, preferred_browser: Option<String>, timeout_secs: u64, nat64_prefixes: Vec<String>, ) -> Result<TextBrowserTool, Error>
Construct with no private-host opt-in (deny-by-default). Use
Self::new_with_private_hosts to allow specific private hosts.
Sourcepub fn new_with_private_hosts(
security: Arc<SecurityPolicy>,
preferred_browser: Option<String>,
timeout_secs: u64,
allowed_private_hosts: Vec<String>,
nat64_prefixes: Vec<String>,
) -> Result<TextBrowserTool, Error>
pub fn new_with_private_hosts( security: Arc<SecurityPolicy>, preferred_browser: Option<String>, timeout_secs: u64, allowed_private_hosts: Vec<String>, nat64_prefixes: Vec<String>, ) -> Result<TextBrowserTool, Error>
Construct with an explicit allowed_private_hosts opt-in list (mirrors
the browser/browser_open/http_request pattern from PRsand
Trait Implementations§
Source§impl Attributable for TextBrowserTool
impl Attributable for TextBrowserTool
fn role(&self) -> Role
fn alias(&self) -> &str
Source§fn tool_provenance(&self) -> ToolProvenance
fn tool_provenance(&self) -> ToolProvenance
Source§impl Tool for TextBrowserTool
impl Tool for TextBrowserTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TextBrowserTool: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TextBrowserTool: 'async_trait,
Source§fn output_schema(&self) -> Option<Value>
fn output_schema(&self) -> Option<Value>
ToolOutput::data, when it declares one. None means the tool
emits display text only; authoring surfaces fall back to
sample-derived shapes from captured runs.Source§fn param_domains(&self) -> Vec<(&'static str, OptionDomain)>
fn param_domains(&self) -> Vec<(&'static str, OptionDomain)>
Source§fn invocation_triggers(&self) -> Vec<String>
fn invocation_triggers(&self) -> Vec<String>
Source§fn spec(&self) -> ToolSpec
fn spec(&self) -> ToolSpec
parameters_schema() and allocates a fresh Arc per call, so tools
with large stored schemas override it to hand out Arc::clone
instead (see McpToolWrapper). Delegating wrappers around a
dyn Tool MUST forward spec() to the inner tool — relying on this
default silently reintroduces a per-iteration deep clone of the
inner schema and breaks Arc identity for downstream sharing.Auto Trait Implementations§
impl !RefUnwindSafe for TextBrowserTool
impl !UnwindSafe for TextBrowserTool
impl Freeze for TextBrowserTool
impl Send for TextBrowserTool
impl Sync for TextBrowserTool
impl Unpin for TextBrowserTool
impl UnsafeUnpin for TextBrowserTool
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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