Skip to main content

ag_agent/
lib.rs

1//! Agent backend transports and provider-neutral contracts.
2//!
3//! This crate owns the agent execution boundary used by Agentty: provider
4//! model metadata, turn prompt payloads, CLI/app-server transports, and
5//! channel contracts. It intentionally avoids depending on the `agentty`
6//! application crate so provider-specific dependencies compile in a leaf
7//! workspace member.
8
9mod agent;
10mod app_server;
11pub(crate) mod app_server_transport;
12mod channel;
13mod model;
14
15#[cfg(any(test, feature = "test-utils"))]
16pub use agent::MockAgentBackend;
17pub use agent::{
18    AgentAvailabilityProbe, AgentBackend, AgentBackendError, AgentTransport, BuildCommandRequest,
19    OneShotRequest, OneShotSubmission, RealAgentAvailabilityProbe, StaticAgentAvailabilityProbe,
20    cleanup_session_worktree_artifacts, create_app_server_client, create_backend, diff_fence,
21    executable_name, normalize_instruction_conversation_id, submit_one_shot,
22    submit_one_shot_with_app_server_client, submit_one_shot_with_backend, 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::{
31    AgentChannel, AgentError, AgentFuture, AgentRequestKind, LiveTranscript, SessionRef,
32    StartSessionRequest, TurnEvent, TurnRequest, TurnResult, create_agent_channel,
33};
34#[cfg(any(test, feature = "test-utils"))]
35pub use channel::{MockAgentChannel, create_cli_agent_channel_with_backend};
36pub use model::agent::{
37    AgentCliInfo, AgentCliVersion, AgentKind, AgentModel, AgentSelection, AgentSelectionMetadata,
38    ReasoningLevel, parse_persisted_session_agent_model, resolve_agent_kind_for_model,
39    resolve_agent_selection_for_model, resolve_model_for_available_agent_kinds,
40    resolve_prompt_model_agent_kind, selectable_models_for_agent_kinds,
41};
42pub use model::permission::PermissionMode;
43pub use model::session::SessionStats;