feat: Installed ast-grep for the explore agent to use for better code exploration

This commit is contained in:
2026-07-04 12:59:05 -06:00
parent 9d2e936e7f
commit 09cdb40420
4 changed files with 115 additions and 2 deletions
+2 -1
View File
@@ -151,7 +151,7 @@ const SBX_VAULT_MIXINS_DIR_NAME: &str = "sbx-vault-mixins";
const SBX_MIXIN_KITS_DIR_NAME: &str = "sbx-mixin-kits";
const GIT_DIR_NAME: &str = ".git";
const GITIGNORE_FILE_NAME: &str = ".gitignore";
const DEFAULT_VISIBLE_TOOLS: [&str; 18] = [
const DEFAULT_VISIBLE_TOOLS: [&str; 19] = [
"execute_command.sh",
"execute_py_code.py",
"execute_sql_code.sh",
@@ -165,6 +165,7 @@ const DEFAULT_VISIBLE_TOOLS: [&str; 18] = [
"fs_read.sh",
"fs_rm.sh",
"fs_write.sh",
"ast_grep.sh",
"get_current_time.sh",
"get_current_weather.sh",
"search_wikipedia.sh",
+27
View File
@@ -1691,6 +1691,33 @@ mod tests {
assert!(f.declarations().is_empty());
}
#[test]
fn bundled_bash_tools_generate_declarations() {
let tools_dir =
std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("assets/functions/tools");
let mut checked = Vec::new();
for entry in std::fs::read_dir(&tools_dir).unwrap() {
let path = entry.unwrap().path();
if path.extension().and_then(OsStr::to_str) != Some("sh") {
continue;
}
let name = path.file_stem().unwrap().to_string_lossy().to_string();
let declarations = Functions::generate_declarations(&path)
.unwrap_or_else(|e| panic!("bundled tool '{name}' failed to parse: {e}"));
assert!(
!declarations.is_empty(),
"bundled tool '{name}' produced no function declaration"
);
checked.push(name);
}
for expected in ["fs_grep", "ast_grep", "execute_command"] {
assert!(
checked.iter().any(|n| n == expected),
"expected bundled tool '{expected}' to be checked; found {checked:?}"
);
}
}
#[test]
fn functions_append_todo_adds_declarations() {
let mut f = Functions::default();