pub struct ToolRoster(/* private fields */);Expand description
Which tools the model is offered, for
WorkspaceBuilder::with_tool_roster.
A thin wrapper over mentra’s ToolProfile rather than a re-export of it:
ToolRoster::default is the one construction this crate has an opinion
about (today’s exact hidden set), and wrapping it is what lets that default
live beside the constant it is built from instead of at every call site
that wants “basis’s usual roster, plus…”.
Implementations§
Source§impl ToolRoster
impl ToolRoster
Sourcepub fn hide(names: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn hide(names: impl IntoIterator<Item = impl Into<String>>) -> Self
ToolRoster::default’s set, plus names.
Extends rather than replaces, so narrowing a roster is additive: a
caller hiding one more tool never has to restate spawn’s replaced
doors or the unsurfaced intrinsics to keep them hidden too. Call
only for a denylist built from nothing instead of from
basis’s own.
Sourcepub fn only(names: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn only(names: impl IntoIterator<Item = impl Into<String>>) -> Self
Offers exactly names, mapped straight to mentra’s own
ToolProfile::only — an allow-list rather than hide’s
denylist, and basis states no opinion of its own on top of it.
Three honest caveats, each pinned by a test beside this one:
- Cannot itself un-register the file tools — that is a runtime
decision, not a roster one. A roster is per-workspace; which file
tools a runtime carries at all is fixed once, per-runtime, at
RuntimeBuilder::with_file_tools— basis’s own default ofSplit, or a host’sBatched,Both, orNone.onlycannot reach across and change that from a workspace. What it can do, and does, is stop offering whatever the runtime carries: a set that names none ofread/ls/grep/glob/write/editmakesToolProfile::allowsrefuse every one of them for this workspace’s agents, exactly as it refuses any other name left out — seeonly_hides_the_file_tools_but_cannot_reach_the_runtimes_profile. A host that wants the tools gone from the registry too — so a sibling workspace sharing this runtime, or mentra’s own APIs reached throughRuntime::mentra_runtime, cannot find them either — builds that runtime withwith_file_tools(FileToolProfile::None)in the first place; there is no way to reach the same effect from a roster alone. - Does not imply
spawn. A set that omitscrate::tools::SPAWNis a legitimate roster — a knowledge agent with no delegation and no command door is a real shape — but it is also a model with no route to a subagent or a shell command at all. Name it if the agent needs either. - Does not imply
load_skill. Skills are basis’s own on-demand convention; a set that omits it is a model that cannot load one, no matter how many are registered.
Trait Implementations§
Source§impl Clone for ToolRoster
impl Clone for ToolRoster
Source§impl Debug for ToolRoster
impl Debug for ToolRoster
Source§impl Default for ToolRoster
impl Default for ToolRoster
Source§fn default() -> Self
fn default() -> Self
What every workspace has offered before this type existed: spawn’s
two replaced doors (REPLACED_TOOLS) and the intrinsics basis has
never deliberately surfaced (UNSURFACED_TOOLS), hidden; everything
else mentra’s runtime registers — the file tools, load_skill,
compact, and whatever a host’s own tools or an MCP server add —
offered.
Pinned by the_default_roster_is_exactly_this and its neighbors in
workspace::builder::tests: this has to keep producing that exact set
for those tests to mean anything.
impl Eq for ToolRoster
Source§impl PartialEq for ToolRoster
impl PartialEq for ToolRoster
impl StructuralPartialEq for ToolRoster
Auto Trait Implementations§
impl Freeze for ToolRoster
impl RefUnwindSafe for ToolRoster
impl Send for ToolRoster
impl Sync for ToolRoster
impl Unpin for ToolRoster
impl UnsafeUnpin for ToolRoster
impl UnwindSafe for ToolRoster
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.