pub struct ConfigFile {
pub config_version: Option<String>,
pub intelligence: Option<String>,
pub model_swap: Option<String>,
pub model: Option<String>,
pub max_tokens: Option<u64>,
pub limits: Option<LimitsFile>,
pub mcp_servers: Vec<McpServerFile>,
pub subscribe: Vec<String>,
pub a2a_peers: Vec<A2aPeerFile>,
pub log_level: Option<String>,
pub intelligence_headers: BTreeMap<String, String>,
}Expand description
The deserialized config-file shape — one source of truth for the loader, the
validator, and the --config-schema generator. serde only.
deny_unknown_fields rejects a typo’d key at parse time (exit 2). A flattened
catch-all is INTENTIONALLY ABSENT — deny_unknown_fields is the guard.
Fields§
§config_version: Option<String>Optional; pins the file to a schema major agentctl validated against.
intelligence: Option<String>--intelligence / AGENTD_INTELLIGENCE — the ordered intelligence
endpoint list URI. File-settable and reloadable so a ConfigMap
update can repoint the endpoint list as a hot swap: the reload fans
ctrl/swap_intel to in-flight work and re-points new spawns. The
transport SCHEME is data, not a secret; the per-endpoint credential is
NEVER inline here — it comes from env or a _FILE path, so a config
document can be committed and mounted without carrying a credential.
model_swap: Option<String>--model-swap / AGENTD_MODEL_SWAP — the model hot-swap policy
(finish-on-old | restart-turn), deciding what an in-flight turn does
when the model changes under it. Reloadable. Validated against
crate::config::SwapPolicy.
model: Option<String>--model / AGENTD_MODEL (reloadable param, never the transport).
max_tokens: Option<u64>--max-tokens / AGENTD_MAX_TOKENS.
limits: Option<LimitsFile>Bounds on the model loop (--max-steps / --max-depth / --deadline).
mcp_servers: Vec<McpServerFile>The MCP server inventory — one object per --mcp name=cmd … --mcp-tags ….
subscribe: Vec<String>Declared subscriptions (reactive mode) — each string == one --subscribe URI.
a2a_peers: Vec<A2aPeerFile>Declared remote-A2A delegation peers — each == one --a2a-peer name=endpoint.
log_level: Option<String>--log-level / AGENTD_LOG_LEVEL (a string; validated against Level).
intelligence_headers: BTreeMap<String, String>Declared intelligence HTTP headers. Values MAY interpolate
{{secret:NAME}} / {{secret-file:PATH}}; the resolved secret never
lands in this struct or in a log — only the reference does. A value that
looks like an inline secret is rejected outright, so a credential cannot
be committed to a config file by accident.
Implementations§
Source§impl ConfigFile
impl ConfigFile
Sourcepub fn parse(text: &str) -> Result<ConfigFile, String>
pub fn parse(text: &str) -> Result<ConfigFile, String>
Parse config text (YAML or JSON — sniffed, since there is no path). A
malformed document is an Err with a message the caller maps to exit 2
— before any side effect. JSON-with-comments is tolerated (// and
/* */ are stripped first, matching the jsonc shown in the RFC set).
Sourcepub fn from_document(doc: Value, source: &str) -> Result<ConfigFile, String>
pub fn from_document(doc: Value, source: &str) -> Result<ConfigFile, String>
Type a config DOCUMENT (from a file, or the env/flag path layers —
source names it in errors). Unknown keys are rejected
(deny_unknown_fields); the error names the offending key.
Trait Implementations§
Source§impl Clone for ConfigFile
impl Clone for ConfigFile
Source§fn clone(&self) -> ConfigFile
fn clone(&self) -> ConfigFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more