openfunctions_rs/core/
checker.rs1use crate::core::Config;
4use anyhow::Result;
5use tracing::{info, warn};
6
7pub struct Checker {
12 #[allow(dead_code)]
13 config: Config,
14}
15
16impl Checker {
17 pub fn new(config: &Config) -> Self {
19 Self {
20 config: config.clone(),
21 }
22 }
23
24 pub async fn check_all(&self) -> Result<()> {
26 info!("Checking all tools and agents...");
27 self.check_environment().await?;
28 self.check_dependencies().await?;
29 Ok(())
30 }
31
32 pub async fn check_target(&self, target: &str) -> Result<()> {
34 info!("Checking target: {}", target);
35 Ok(())
37 }
38
39 async fn check_environment(&self) -> Result<()> {
41 info!("Checking for required system executables...");
42 let executables = ["bash", "node", "python"];
44 for exe in &executables {
45 if which::which(exe).is_err() {
46 warn!("{} not found in PATH. This may limit functionality.", exe);
47 } else {
48 info!("Found executable: {}", exe);
49 }
50 }
51 Ok(())
52 }
53
54 async fn check_dependencies(&self) -> Result<()> {
57 info!("Dependencies check passed.");
58 Ok(())
59 }
60}