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#[cfg(test)]
15#[path = "telemetry_test.rs"]
16mod telemetry;
17
18pub(crate) use ag_contracts::is_input_size_error;
19#[cfg(any(test, feature = "test-utils"))]
20pub use agent::MockAgentBackend;
21pub use agent::{
22    AgentAvailabilityProbe, AgentBackend, AgentBackendError, AgentTransport, BuildCommandRequest,
23    NativeHarnessConfig, RealAgentAvailabilityProbe, RealOneShotClient,
24    StaticAgentAvailabilityProbe, cleanup_session_worktree_artifacts, create_app_server_client,
25    create_backend, executable_name, instruction_bootstrap_key, transport_mode,
26};
27#[cfg(any(test, feature = "test-utils"))]
28pub use app_server::MockAppServerClient;
29pub use app_server::{
30    AppServerClient, AppServerError, AppServerFuture, AppServerStreamEvent, AppServerTurnRequest,
31    AppServerTurnResponse,
32};
33pub use channel::create_agent_channel;
34#[cfg(any(test, feature = "test-utils"))]
35pub use channel::create_cli_agent_channel_with_backend;
36pub use model::agent::{AgentCliInfo, AgentCliVersion};