1use std::path::Path;
2
3use ag_contracts::AgentError;
4use ag_session::{AgentAvailabilityProbe, AgentCliInfo, AgentKind};
5
6pub struct RealAgentAvailabilityProbe;
8
9impl AgentAvailabilityProbe for RealAgentAvailabilityProbe {
10 fn available_agent_kinds(&self) -> Vec<AgentKind> {
11 ag_agent::RealAgentAvailabilityProbe.available_agent_kinds()
12 }
13
14 fn available_agent_clis(&self) -> Vec<AgentCliInfo> {
15 ag_agent::RealAgentAvailabilityProbe.available_agent_clis()
16 }
17}
18
19pub fn setup_backend(kind: AgentKind, folder: &Path) -> Result<(), AgentError> {
24 ag_agent::create_backend(kind)
25 .setup(folder)
26 .map_err(Into::into)
27}
28
29pub fn uses_persistent_session(kind: AgentKind) -> bool {
31 ag_agent::transport_mode(kind).uses_app_server()
32}
33
34pub fn cleanup_session_worktree_artifacts(folder: &Path) -> Result<(), AgentError> {
39 ag_agent::cleanup_session_worktree_artifacts(folder).map_err(Into::into)
40}