Skip to main content

synwire_agent/middleware/
git.rs

1//! Git middleware — exposes git operations as agent tools.
2
3use synwire_core::agents::middleware::Middleware;
4use synwire_core::tools::Tool;
5
6/// Middleware that exposes git operations to the agent.
7#[derive(Debug, Default)]
8pub struct GitMiddleware;
9
10impl Middleware for GitMiddleware {
11    fn name(&self) -> &'static str {
12        "git"
13    }
14
15    fn tools(&self) -> Vec<Box<dyn Tool>> {
16        Vec::new()
17    }
18
19    fn system_prompt_additions(&self) -> Vec<String> {
20        vec![
21            "You have access to git tools: git_status, git_diff, git_log, git_commit, git_push, git_pull, git_branch.".to_string(),
22        ]
23    }
24}