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 (RFC 0018 §3.1). File-settable + reloadable so a
ConfigMap update can repoint the endpoint list as a hot-swap (RFC 0018 §5):
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 (env/_FILE only, RFC 0012 §3.7).
model_swap: Option<String>--model-swap / AGENTD_MODEL_SWAP (RFC 0018 §5.3): the model hot-swap
policy (finish-on-old | restart-turn). 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 (RFC 0006 §3). Values MAY interpolate
{{secret:NAME}} / {{secret-file:PATH}} (§6); the resolved secret never
lands here or in a log. An inline secret-shaped value is rejected (§3.1).
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