//! Agent backend wiring split into provider-specific submodules.
//!
//! This module feeds the curated crate-root API while keeping provider
//! command builders, parsers, and transport policy descriptors private.

use std::path::Path;

mod antigravity;
pub(crate) mod app_server;
mod availability;
mod backend;
mod claude;
pub(crate) mod cli;
mod codex;
mod gemini;
mod instruction;
mod prompt;
mod provider;
mod response_parser;
mod submission;

pub use availability::{
    AgentAvailabilityProbe, RealAgentAvailabilityProbe, StaticAgentAvailabilityProbe,
    executable_name,
};
#[cfg(any(test, feature = "test-utils"))]
pub use backend::MockAgentBackend;
pub use backend::{AgentBackend, AgentBackendError, AgentTransport, BuildCommandRequest};
pub use instruction::normalize_instruction_conversation_id;
pub(crate) use instruction::{InstructionDeliveryMode, plan_app_server_instruction_delivery};
pub use prompt::diff_fence;
pub(crate) use prompt::{PromptPreparationRequest, prepare_prompt_text};
pub(crate) use provider::{
    build_command_stdin_payload, is_app_server_thought_chunk, parse_response,
    parse_stream_output_line, parse_turn_response, protocol_schema_instruction_mode,
};
pub use provider::{create_app_server_client, create_backend, transport_mode};
pub(crate) use response_parser::{
    ParsedResponse, compact_codex_progress_message, is_codex_completion_status_message,
};
pub use submission::{
    OneShotRequest, OneShotSubmission, submit_one_shot, submit_one_shot_with_app_server_client,
    submit_one_shot_with_backend,
};

/// Removes provider-owned worktree artifacts derived from one session folder.
///
/// Current providers keep setup state inside the session worktree or git
/// metadata, so there is no external provider artifact to remove.
///
/// # Errors
/// This function currently never returns an error.
pub fn cleanup_session_worktree_artifacts(_folder: &Path) -> Result<(), AgentBackendError> {
    Ok(())
}
