use std::path::Path;
use std::process::Command;
use ag_contracts::SessionStats;
use super::backend::{AgentBackend, AgentBackendError, BuildCommandRequest};
use super::response_parser::ParsedResponse;
pub(super) const HARNESS_UNAVAILABLE_MESSAGE: &str =
"Harness sessions run only when Agentty starts with `--experimental-harness`.";
pub(super) struct HarnessBackend;
impl AgentBackend for HarnessBackend {
fn setup(&self, _folder: &Path) -> Result<(), AgentBackendError> {
Ok(())
}
fn build_command<'request>(
&'request self,
_request: BuildCommandRequest<'request>,
) -> Result<Command, AgentBackendError> {
Err(AgentBackendError::CommandBuild(
HARNESS_UNAVAILABLE_MESSAGE.to_string(),
))
}
}
pub(super) fn parse_response(_stdout: &str, _stderr: &str) -> ParsedResponse {
ParsedResponse {
content: String::new(),
stats: SessionStats::default(),
}
}
pub(super) fn parse_stream_payload(_payload: &serde_json::Value) -> Option<(String, bool)> {
None
}
#[cfg(test)]
#[path = "harness_test.rs"]
mod tests;