Skip to main content

ag_agent/
lib.rs

1//! External-agent adapters implementing the `ag-contracts` execution contracts.
2//!
3//! This crate owns provider discovery, prompt translation, CLI/app-server
4//! transports, retries, and resource cleanup. Shared execution contracts live
5//! in `ag-contracts`; the built-in selection catalog lives in
6//! `ag-session`. Only `ag-runtime` constructs these adapters; application
7//! workflows receive worker clients instead of concrete transports.
8
9mod agent;
10mod app_server;
11pub(crate) mod app_server_transport;
12mod channel;
13mod model;
14
15pub(crate) use ag_contracts::is_input_size_error;
16#[cfg(any(test, feature = "test-utils"))]
17pub use agent::MockAgentBackend;
18pub use agent::{
19    AgentAvailabilityProbe, AgentBackend, AgentBackendError, AgentTransport, BuildCommandRequest,
20    RealAgentAvailabilityProbe, RealOneShotClient, StaticAgentAvailabilityProbe,
21    cleanup_session_worktree_artifacts, create_app_server_client, create_backend, executable_name,
22    instruction_bootstrap_key, transport_mode,
23};
24#[cfg(any(test, feature = "test-utils"))]
25pub use app_server::MockAppServerClient;
26pub use app_server::{
27    AppServerClient, AppServerError, AppServerFuture, AppServerStreamEvent, AppServerTurnRequest,
28    AppServerTurnResponse,
29};
30pub use channel::create_agent_channel;
31#[cfg(any(test, feature = "test-utils"))]
32pub use channel::create_cli_agent_channel_with_backend;
33pub use model::agent::{AgentCliInfo, AgentCliVersion};