1use std::path::Path;
2
3use ag_contracts::AgentError;
4use ag_session::{AgentAvailabilityProbe, AgentCliInfo, AgentKind, AgentModel};
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 fn native_harness_default_model(&self) -> Option<AgentModel> {
19 ag_agent::RealAgentAvailabilityProbe.native_harness_default_model()
20 }
21}
22
23pub fn setup_backend(kind: AgentKind, folder: &Path) -> Result<(), AgentError> {
28 ag_agent::create_backend(kind)
29 .setup(folder)
30 .map_err(Into::into)
31}
32
33pub fn uses_persistent_session(kind: AgentKind) -> bool {
35 ag_agent::transport_mode(kind).uses_app_server()
36}
37
38pub fn cleanup_session_worktree_artifacts(folder: &Path) -> Result<(), AgentError> {
43 ag_agent::cleanup_session_worktree_artifacts(folder).map_err(Into::into)
44}