1use warpgate_api::{api_enum, api_struct, ExecCommandInput, VirtualPath};
2
3api_struct!(
4 pub struct MoonContext {
6 pub working_dir: VirtualPath,
8
9 pub workspace_root: VirtualPath,
11 }
12);
13
14impl MoonContext {
15 pub fn get_absolute_path<T: AsRef<std::path::Path>>(&self, path: T) -> VirtualPath {
19 let path = path.as_ref();
20
21 if path.is_absolute() {
22 return VirtualPath::OnlyReal(path.to_owned());
23 }
24
25 self.working_dir.join(path)
26 }
27}
28
29api_enum!(
30 #[serde(tag = "type", rename_all = "kebab-case")]
32 pub enum Operation {
33 ProcessExecution(ExecCommandInput),
34 }
35);