Skip to main content

vv_agent/tools/handlers/
bash.rs

1mod env;
2mod execution;
3mod shell_defaults;
4
5use std::sync::Arc;
6
7use crate::tools::base::{ToolContext, ToolSpec};
8use crate::types::{ToolArguments, ToolExecutionResult};
9
10use execution::execute_bash_command;
11
12pub fn run_bash_command(
13    context: &mut ToolContext,
14    arguments: &ToolArguments,
15) -> ToolExecutionResult {
16    execute_bash_command(context, arguments)
17}
18
19pub(crate) fn bash_tool() -> ToolSpec {
20    let mut spec = ToolSpec::new(
21        "bash",
22        "Run a shell command in the current workspace.",
23        Arc::new(execute_bash_command),
24    );
25    if let Some(schema) = super::super::schemas::schema_for("bash") {
26        spec.schema = schema;
27    }
28    spec
29}