Skip to main content

devflow_core/agents/
opencode.rs

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