pub struct CapabilitySet(/* private fields */);Expand description
A set of Capabilitys. Small, Copy, and closed under the usual set
algebra — the decision engine works only through these operations.
Implementations§
Source§impl CapabilitySet
impl CapabilitySet
Sourcepub const fn native_search_grounding_requirements() -> Self
pub const fn native_search_grounding_requirements() -> Self
The capabilities the provider’s native web-search-grounding primitive
(NATIVE_SEARCH_GROUNDING) requires.
The classic exfiltration channel, the same floor as the built-in web
fetchers (web_fetch, paid_fetch). Unlike every other tool, this
primitive is never a polyc_llm::ToolSpec the model calls
explicitly, so there is no per-call tool_use for the ordinary
classification path (required_capabilities) to inspect — the call
site that decides whether to turn grounding on for a step compares
this constant against granted_capabilities directly, via the same
decide every real tool call goes through.
Sourcepub const fn all() -> Self
pub const fn all() -> Self
The full privileged set — every member of the taxonomy. This is the fail-closed requirement for an unclassifiable tool.
Sourcepub const fn of(capability: Capability) -> Self
pub const fn of(capability: Capability) -> Self
The set containing exactly capability.
Sourcepub const fn with(self, capability: Capability) -> Self
pub const fn with(self, capability: Capability) -> Self
This set plus capability.
Sourcepub const fn contains(self, capability: Capability) -> bool
pub const fn contains(self, capability: Capability) -> bool
Whether capability is in this set.
Sourcepub const fn is_subset_of(self, other: Self) -> bool
pub const fn is_subset_of(self, other: Self) -> bool
Whether every member of this set is also in other.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Set intersection.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Set difference: the members of this set that are not in other.
Sourcepub fn iter(self) -> impl Iterator<Item = Capability>
pub fn iter(self) -> impl Iterator<Item = Capability>
The members of this set, in Capability::ALL order.
Sourcepub fn from_names<'a, I: IntoIterator<Item = &'a str>>(
names: I,
) -> (Self, Vec<String>)
pub fn from_names<'a, I: IntoIterator<Item = &'a str>>( names: I, ) -> (Self, Vec<String>)
Build a set from stable kebab-case names (e.g. an Agent custom resource’s taint-resilient list or the harness wire). Unrecognized names are NOT granted — they are returned separately so the caller can log them — which is the fail-closed direction: a typo in operator config grants nothing rather than something unintended.
Sourcepub fn names(self) -> Vec<&'static str>
pub fn names(self) -> Vec<&'static str>
The stable kebab-case names of this set’s members, in
Capability::ALL order — the inverse of Self::from_names.
Trait Implementations§
Source§impl Clone for CapabilitySet
impl Clone for CapabilitySet
Source§fn clone(&self) -> CapabilitySet
fn clone(&self) -> CapabilitySet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more