devflow_core/agents/opencode.rs
1//! OpenCode agent adapter.
2//!
3//! Launches `opencode run "<prompt>"` in non-interactive mode.
4
5use super::AgentAdapter;
6
7pub struct OpenCodeAgent;
8
9impl AgentAdapter for OpenCodeAgent {
10 fn name(&self) -> &'static str {
11 "OpenCode"
12 }
13
14 fn exec_command(
15 &self,
16 _phase: u32,
17 prompt: &str,
18 _extra_writable_roots: &[std::path::PathBuf],
19 ) -> (&'static str, Vec<String>) {
20 ("opencode", vec!["run".into(), prompt.to_string()])
21 }
22
23 fn completion_signal_detected(&self, _output: &str) -> bool {
24 false
25 }
26}