Skip to main content

mars_agents/target/
pi.rs

1/// `.pi` target adapter stub.
2///
3/// Future: Pi-native agent lowering and config-entry writing.
4///
5/// V0: stub only — no per-target behavior yet.
6use std::path::PathBuf;
7
8use crate::lock::ItemKind;
9use crate::types::DestPath;
10
11use super::{HookFragmentMode, TargetAdapter};
12
13#[derive(Debug)]
14pub struct PiAdapter;
15
16impl TargetAdapter for PiAdapter {
17    fn name(&self) -> &str {
18        ".pi"
19    }
20
21    fn hook_fragment_mode(&self) -> Option<HookFragmentMode> {
22        Some(HookFragmentMode::File)
23    }
24
25    fn hook_file_dest_path(&self, name: &str) -> Option<PathBuf> {
26        Some(PathBuf::from(format!("extensions/mars-{name}.ts")))
27    }
28
29    fn skill_variant_key(&self) -> Option<&str> {
30        Some("pi")
31    }
32
33    fn default_dest_path(&self, kind: ItemKind, name: &str) -> Option<DestPath> {
34        match kind {
35            ItemKind::Skill => Some(DestPath::from(format!("skills/{name}").as_str())),
36            _ => None,
37        }
38    }
39}