pub enum ToolListChange {
Added(ToolDescriptor),
Removed(ToolDescriptor),
NodeCountChanged {
descriptor: ToolDescriptor,
prev_node_count: u32,
},
}Expand description
One change in the set of tools visible to the local capability
fold, surfaced by crate::adapter::net::MeshNode::watch_tools.
Adapter packages re-emit these to the agent runtime so the
model’s tool list stays in sync with the mesh.
Identity for diffing is (tool_id, version); the same tool_id
across two versions is two independent slots. Added and
Removed carry the full descriptor; NodeCountChanged carries
the latest descriptor with the new aggregated node_count plus
the previous count.
Plan: see docs/plans/NRPC_AI_TOOL_CALLING_AND_AGENT_DX.md,
slice A-5.
Variants§
Added(ToolDescriptor)
A (tool_id, version) slot just appeared in the local fold.
First-arrival event — the agent should add this tool to its
tool list. node_count is the publisher count observed at
arrival (typically 1 unless multiple publishers landed in
the same diff window).
Removed(ToolDescriptor)
A (tool_id, version) slot disappeared from the local fold —
every publisher dropped it (registry removal + announce, or
TTL expiry across the board). Carries the last-known
descriptor so the adapter has the full shape on hand to do
cleanup (e.g. remove from Anthropic tools array by name).
NodeCountChanged
The publisher count for a (tool_id, version) slot changed,
but the slot itself stayed present. descriptor.node_count
is the new count; prev_node_count was the previously
observed value. Useful for load-balancing UI (“3 nodes can
serve this tool, up from 1”).
Fields
descriptor: ToolDescriptorLatest descriptor — node_count is the new aggregated
publisher count.
Trait Implementations§
Source§impl Clone for ToolListChange
impl Clone for ToolListChange
Source§fn clone(&self) -> ToolListChange
fn clone(&self) -> ToolListChange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolListChange
impl Debug for ToolListChange
Source§impl PartialEq for ToolListChange
impl PartialEq for ToolListChange
Source§fn eq(&self, other: &ToolListChange) -> bool
fn eq(&self, other: &ToolListChange) -> bool
self and other values to be equal, and is used by ==.