lattice_ai/acp/
providers.rs1#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct ProviderConfig {
7 pub command: String,
9 pub args: Vec<String>,
11 pub env: Vec<(String, String)>,
13 pub display_name: &'static str,
15}
16
17impl ProviderConfig {
18 pub fn opencode() -> Self {
20 Self {
21 command: "opencode".to_string(),
22 args: vec!["acp".to_string()],
23 env: Vec::new(),
24 display_name: "opencode",
25 }
26 }
27}
28
29#[cfg(test)]
30mod tests {
31 use super::*;
32
33 #[test]
34 fn opencode_config_names_the_binary_and_display() {
35 let p = ProviderConfig::opencode();
36 assert_eq!(p.command, "opencode");
37 assert_eq!(p.display_name, "opencode");
38 assert!(!p.args.is_empty(), "must pass the ACP-mode flag");
39 }
40}