Skip to main content

ag_agent/
agent.rs

1//! Agent backend wiring split into provider-specific submodules.
2//!
3//! This module keeps the public API stable while delegating command building
4//! and response parsing to focused files under `infra/agent/` using the
5//! standard `agent.rs` + `agent/` module layout.
6
7mod antigravity;
8pub(crate) mod app_server;
9mod availability;
10mod backend;
11mod claude;
12pub(crate) mod cli;
13mod codex;
14mod gemini;
15mod instruction;
16mod prompt;
17mod provider;
18mod response_parser;
19mod submission;
20
21pub use availability::{
22    AgentAvailabilityProbe, RealAgentAvailabilityProbe, StaticAgentAvailabilityProbe,
23    executable_name,
24};
25pub use backend::{AgentBackend, AgentBackendError, AgentTransport, BuildCommandRequest};
26pub use instruction::{
27    InstructionDeliveryMode, normalize_instruction_conversation_id,
28    plan_app_server_instruction_delivery,
29};
30pub use prompt::{PromptPreparationRequest, diff_fence, prepare_prompt_text};
31pub use provider::{
32    build_command_stdin_payload, cleanup_session_worktree_artifacts, create_app_server_client,
33    create_backend, is_app_server_thought_chunk, parse_response, parse_stream_output_line,
34    parse_turn_response, protocol_schema_instruction_mode, provider_kind_for_model, transport_mode,
35};
36pub use response_parser::{
37    ParsedResponse, compact_codex_progress_message, is_codex_completion_status_message,
38};
39pub use submission::{
40    OneShotRequest, OneShotSubmission, submit_one_shot, submit_one_shot_with_app_server_client,
41    submit_one_shot_with_backend,
42};
43#[cfg(any(test, feature = "test-utils"))]
44pub mod tests {
45    //! Test-only exports for agent backend mocks.
46
47    pub use super::backend::MockAgentBackend;
48}