assistant2: Show scripting tool in the tool selector (#26484)

This PR adds the scripting tool to the tool selector.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-11 17:35:39 -04:00 committed by GitHub
parent a90f80725f
commit e8208643bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 58 additions and 14 deletions

View file

@ -20,6 +20,7 @@ struct WorkingSetState {
context_server_tools_by_id: HashMap<ToolId, Arc<dyn Tool>>,
context_server_tools_by_name: HashMap<String, Arc<dyn Tool>>,
disabled_tools_by_source: HashMap<ToolSource, HashSet<Arc<str>>>,
is_scripting_tool_disabled: bool,
next_tool_id: ToolId,
}
@ -122,6 +123,21 @@ impl ToolWorkingSet {
.retain(|id, _| !tool_ids_to_remove.contains(id));
state.tools_changed();
}
pub fn is_scripting_tool_enabled(&self) -> bool {
let state = self.state.lock();
!state.is_scripting_tool_disabled
}
pub fn enable_scripting_tool(&self) {
let mut state = self.state.lock();
state.is_scripting_tool_disabled = false;
}
pub fn disable_scripting_tool(&self) {
let mut state = self.state.lock();
state.is_scripting_tool_disabled = true;
}
}
impl WorkingSetState {