Skip to main content

codetether_agent/tool/tetherscript/
tool.rs

1use std::path::{Path, PathBuf};
2
3pub struct TetherScriptPluginTool {
4    root: PathBuf,
5}
6
7impl TetherScriptPluginTool {
8    pub fn new() -> Self {
9        Self {
10            root: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")),
11        }
12    }
13
14    pub fn with_root(root: PathBuf) -> Self {
15        Self { root }
16    }
17
18    pub(crate) fn root(&self) -> &Path {
19        &self.root
20    }
21}
22
23impl Default for TetherScriptPluginTool {
24    fn default() -> Self {
25        Self::new()
26    }
27}