pub struct LocalTools { /* private fields */ }Expand description
The built-in local tool set, confined to root:
exec—{ "argv": [..], "cwd"?: string, "timeout_ms"?: u64 }(side-effecting; runs viaLocalExecBackend).fs_list—{ "path": string }(relative toroot)fs_read—{ "path": string }fs_write—{ "path": string, "content": string }(side-effecting)
Tool names are dotless: strict OpenAI-compatible endpoints
validate tools[n].function.name against ^[a-zA-Z0-9_-]+$ and
reject the pre-rename dotted spelling (fs.list et al.) with HTTP
400. The dotted legacy names are still ACCEPTED by [ToolProvider:: invoke] (but never advertised) so sessions recorded before the
rename keep working when replayed.
Tool schemas are exposed sorted by name — the request-body
serialization freezes the tools array order (contract), so the
built-in set must be deterministic.
Implementations§
Source§impl LocalTools
impl LocalTools
Sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Creates the tool set rooted at root (the directory is created if
missing). Call this at assembly time, not inside a drain.
pub fn with_exec_timeout(self, timeout_ms: u64) -> Self
Sourcepub fn with_env_policy(self, policy: ExecEnvPolicy) -> Self
pub fn with_env_policy(self, policy: ExecEnvPolicy) -> Self
sets the exec child environment policy (forwarded to
the inner LocalExecBackend).
Sourcepub fn with_redactor(self, redactor: SecretRedactor) -> Self
pub fn with_redactor(self, redactor: SecretRedactor) -> Self
sets the exec output redactor (forwarded to the inner
LocalExecBackend).
pub fn root(&self) -> &Path
Trait Implementations§
Source§impl Clone for LocalTools
impl Clone for LocalTools
Source§impl Debug for LocalTools
impl Debug for LocalTools
Source§impl ToolProvider for LocalTools
impl ToolProvider for LocalTools
Auto Trait Implementations§
impl Forget for LocalTools
impl Freeze for LocalToolswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, SetValZST> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, SetValZST)>>: Freeze,
PhantomData<(String, String)>: Freeze,
impl Move for LocalTools
impl RefUnwindSafe for LocalTools
impl Send for LocalTools
impl Sync for LocalTools
impl Unpin for LocalTools
impl UnsafeUnpin for LocalToolswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, SetValZST> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
impl UnwindSafe for LocalTools
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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