1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! `defect-cli` assembly library — reusable by the `defect` binary and downstream
//! developers.
//!
//! This crate aims to make "assembling an ACP server" a few lines of code: it translates
//! the typed configuration from `defect-config` into the runtime structures needed by
//! `defect-agent`, `defect-llm`, `defect-tools`, `defect-mcp`, and other modules.
//!
//! ## Extension points for downstream development
//!
//! - [`args::CliArgs`] / [`args::CliArgs::to_overrides`]: standard CLI arguments
//! - [`providers::build_registry`]: assembles [`ProviderRegistry`] + [`TurnConfig`]
//! - [`http_stack::build_http_stack_config`]: translates typed HTTP configuration into
//! `defect_http::HttpStackConfig`
//! - [`tools::build_process_tools`] / [`mcp_servers::build_default_mcp_servers`]
//! - [`hooks::build_engine_arc`]: assembles the hook engine
//! - [`policy::build_policy`] / [`paths::default_sessions_root`]
//! - tracing initialization has moved to `defect-obs` (`defect_obs::init_tracing`)
//!
//! The main binary `src/bin/cli.rs` only performs assembly and holds no helper
//! implementations — downstream consumers can replace any step without forking the entire
//! helper set.
//!
//! [`ProviderRegistry`]: defect_agent::llm::ProviderRegistry
//! [`TurnConfig`]: defect_agent::session::TurnConfig