Skip to main content

synwire_agent/middleware/
process.rs

1//! Process middleware — exposes process management as agent tools.
2
3use synwire_core::agents::middleware::Middleware;
4use synwire_core::tools::Tool;
5
6/// Middleware that exposes process management tools with safety guards.
7#[derive(Debug, Default)]
8pub struct ProcessMiddleware;
9
10impl Middleware for ProcessMiddleware {
11    fn name(&self) -> &'static str {
12        "process"
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 process tools: list_processes, kill_process, spawn_background, list_jobs, execute_command.".to_string(),
22            "Warning: Use process operations carefully. Killing system processes may cause instability.".to_string(),
23        ]
24    }
25}