#[non_exhaustive]pub struct ToolSurface {
pub allow: Option<Vec<ToolPattern>>,
pub deny: Vec<ToolPattern>,
pub deferred: Vec<String>,
}Expand description
Which tools a session in the scene may have, and which of them are advertised by name only.
allow and deny are one ToolSelector layer: a deny always holds, and
allow: None allows every tool the deny list leaves. Both only narrow the
registry the host assembled; SceneSpec::extra_tools is how a scene adds
to it.
deferred tools stay allowed and callable, but are advertised to the model
by name and one-line description only, the schema fetched on demand via
ToolSearch. Names the session does not have are ignored. The list
becomes the session’s EngineConfig::deferred_tools, and covers MCP tools
that arrive later in the session too.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.allow: Option<Vec<ToolPattern>>§deny: Vec<ToolPattern>§deferred: Vec<String>Implementations§
Source§impl ToolSurface
impl ToolSurface
Sourcepub fn from_lists(allow: &[impl AsRef<str>], deny: &[impl AsRef<str>]) -> Self
pub fn from_lists(allow: &[impl AsRef<str>], deny: &[impl AsRef<str>]) -> Self
Lists as configured, an empty allow allowing every tool.
pub fn allowing(allow: &[impl AsRef<str>]) -> Self
pub fn denying(deny: &[impl AsRef<str>]) -> Self
pub fn deferring(self, deferred: &[impl AsRef<str>]) -> Self
pub fn selector(&self) -> ToolSelector
pub fn permits(&self, name: &str, origin: &ToolOrigin) -> bool
Trait Implementations§
Source§impl Clone for ToolSurface
impl Clone for ToolSurface
Source§impl Debug for ToolSurface
impl Debug for ToolSurface
Source§impl Default for ToolSurface
impl Default for ToolSurface
impl Eq for ToolSurface
Source§impl PartialEq for ToolSurface
impl PartialEq for ToolSurface
impl StructuralPartialEq for ToolSurface
Auto Trait Implementations§
impl Forget for ToolSurface
impl Freeze for ToolSurface
impl Move for ToolSurface
impl RefUnwindSafe for ToolSurface
impl Send for ToolSurface
impl Sync for ToolSurface
impl Unpin for ToolSurface
impl UnsafeUnpin for ToolSurface
impl UnwindSafe for ToolSurface
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