pub struct SessionProfile {
pub name: String,
pub tool_extras: Vec<Arc<dyn Tool>>,
pub tool_overrides: HashMap<String, Arc<dyn Tool>>,
pub tool_hidden: HashSet<String>,
pub tool_aliases: HashMap<String, String>,
pub resource_extras: Vec<Arc<dyn Resource>>,
pub resource_overrides: HashMap<String, Arc<dyn Resource>>,
pub resource_hidden: HashSet<String>,
pub prompt_extras: Vec<Arc<dyn Prompt>>,
pub prompt_overrides: HashMap<String, Arc<dyn Prompt>>,
pub prompt_hidden: HashSet<String>,
}Expand description
Session profile for role-based capability configuration
A profile defines a set of modifications to apply to a session:
- Extra tools/resources/prompts to add
- Overrides for existing tools (same name, different implementation)
- Tools/resources/prompts to hide
- Aliases for ergonomic name mappings
Fields§
§name: StringProfile name (e.g., “admin”, “vip”, “guest”)
tool_extras: Vec<Arc<dyn Tool>>Extra tools to add to the session
tool_overrides: HashMap<String, Arc<dyn Tool>>Tool overrides (same name, different implementation)
Tools to hide from the session
tool_aliases: HashMap<String, String>Tool aliases (alias -> actual name)
resource_extras: Vec<Arc<dyn Resource>>Extra resources to add to the session
resource_overrides: HashMap<String, Arc<dyn Resource>>Resource overrides (same URI, different implementation)
Resources to hide from the session
prompt_extras: Vec<Arc<dyn Prompt>>Extra prompts to add to the session
prompt_overrides: HashMap<String, Arc<dyn Prompt>>Prompt overrides (same name, different implementation)
Prompts to hide from the session
Implementations§
Source§impl SessionProfile
impl SessionProfile
Sourcepub fn override_tool(
&mut self,
name: impl Into<String>,
tool: Arc<dyn Tool>,
) -> &mut Self
pub fn override_tool( &mut self, name: impl Into<String>, tool: Arc<dyn Tool>, ) -> &mut Self
Override a tool (same name, different implementation)
Sourcepub fn hide_tool(&mut self, name: impl Into<String>) -> &mut Self
pub fn hide_tool(&mut self, name: impl Into<String>) -> &mut Self
Hide a tool from sessions with this profile
Sourcepub fn hide_tools(
&mut self,
names: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn hide_tools( &mut self, names: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Hide multiple tools
Sourcepub fn alias_tool(
&mut self,
alias: impl Into<String>,
target: impl Into<String>,
) -> &mut Self
pub fn alias_tool( &mut self, alias: impl Into<String>, target: impl Into<String>, ) -> &mut Self
Add a tool alias (alias -> target)
Sourcepub fn add_resource(&mut self, resource: Arc<dyn Resource>) -> &mut Self
pub fn add_resource(&mut self, resource: Arc<dyn Resource>) -> &mut Self
Add an extra resource to the profile
Sourcepub fn override_resource(
&mut self,
uri: impl Into<String>,
resource: Arc<dyn Resource>,
) -> &mut Self
pub fn override_resource( &mut self, uri: impl Into<String>, resource: Arc<dyn Resource>, ) -> &mut Self
Override a resource (same URI, different implementation)
Sourcepub fn hide_resource(&mut self, uri: impl Into<String>) -> &mut Self
pub fn hide_resource(&mut self, uri: impl Into<String>) -> &mut Self
Hide a resource from sessions with this profile
Sourcepub fn hide_resources(
&mut self,
uris: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn hide_resources( &mut self, uris: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Hide multiple resources
Sourcepub fn add_prompt(&mut self, prompt: Arc<dyn Prompt>) -> &mut Self
pub fn add_prompt(&mut self, prompt: Arc<dyn Prompt>) -> &mut Self
Add an extra prompt to the profile
Sourcepub fn override_prompt(
&mut self,
name: impl Into<String>,
prompt: Arc<dyn Prompt>,
) -> &mut Self
pub fn override_prompt( &mut self, name: impl Into<String>, prompt: Arc<dyn Prompt>, ) -> &mut Self
Override a prompt (same name, different implementation)
Sourcepub fn hide_prompt(&mut self, name: impl Into<String>) -> &mut Self
pub fn hide_prompt(&mut self, name: impl Into<String>) -> &mut Self
Hide a prompt from sessions with this profile
Sourcepub fn hide_prompts(
&mut self,
names: impl IntoIterator<Item = impl Into<String>>,
) -> &mut Self
pub fn hide_prompts( &mut self, names: impl IntoIterator<Item = impl Into<String>>, ) -> &mut Self
Hide multiple prompts
Sourcepub fn merge(&mut self, other: &SessionProfile) -> &mut Self
pub fn merge(&mut self, other: &SessionProfile) -> &mut Self
Merge another profile into this one
Later profiles take precedence for overrides and hidden items