Skip to main content

ConfigFile

Struct ConfigFile 

Source
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

Source

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).

Source

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.

Source

pub fn load(path: &str) -> Result<ConfigFile, String>

Load + parse a config file from a local path (no network) — YAML or JSON by extension, sniffed otherwise.

Trait Implementations§

Source§

impl Clone for ConfigFile

Source§

fn clone(&self) -> ConfigFile

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigFile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ConfigFile

Source§

fn default() -> ConfigFile

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ConfigFile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ConfigFile

Source§

fn eq(&self, other: &ConfigFile) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConfigFile

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more