Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
Show 25 fields pub config_version: Option<String>, pub streams: BTreeMap<String, StreamCfg>, pub services: BTreeMap<String, Service>, pub vars: BTreeMap<String, Value>, pub agent: Agent, pub intelligence: Intelligence, pub mcp: Mcp, pub tools: Tools, pub store: Store, pub memory: Memory, pub context: Context, pub knowledge: Knowledge, pub search: Search, pub skills: Skills, pub workflows: Vec<Value>, pub limits: Limits, pub lifecycle: Lifecycle, pub subagents: Subagents, pub a2a: A2a, pub interface: Interface, pub webhooks: Webhooks, pub goal: Option<Goal>, pub observability: Observability, pub security: Security, pub identity: Identity,
}
Expand description

The typed v2 settings document. Every object is deny_unknown_fields; every section defaults so a minimal document (agent.instruction alone) is complete.

Fields§

§config_version: Option<String>§streams: BTreeMap<String, StreamCfg>

Named durable event streams: {name: {retention: {max_events, max_age}}}. A stream must be declared before an emit or stream node may reference it — an undeclared name is refused at startup rather than silently creating a stream nothing retains.

§services: BTreeMap<String, Service>

The service catalog: the named external services this deployment may use. Entries carry connection settings, one shared credential, authoritative trifecta tags and a tool-surface ceiling; mcp.servers entries reference them via service:. An absent catalog imposes no constraints at all.

§vars: BTreeMap<String, Value>

Operator-defined constants, referenced anywhere in this document and in workflow definitions as {{config.NAME}} (dotted paths reach into nested values). The template prefix is config. and NOT vars. because vars.* already names a RUN’s own variables — two things called vars in one template language would be a permanent trap.

Substitution is fail-closed: a reference to an undefined name refuses startup naming every unresolved reference at once. In workflows the values fold in at LOAD time, so they participate in the definition hash — a var change is a definition change, and in-flight runs stay pinned to the definition they started with.

§agent: Agent§intelligence: Intelligence§mcp: Mcp§tools: Tools§store: Store§memory: Memory§context: Context§knowledge: Knowledge§search: Search§skills: Skills§workflows: Vec<Value>

Inline workflow definitions or {name, file|uri} references — kept as raw documents here and typed by the workflow engine, so config loading never has to know the node registry.

§limits: Limits§lifecycle: Lifecycle§subagents: Subagents

Subagent templates + spawn policy: operator-declared definitions the model may instantiate (filling declared params only), section-wide defaults, and the freeform-spawn switch.

§a2a: A2a§interface: Interface

The display-client surface: opt-in TUI/web-UI methods on the A2A listener (the global SubscribeToEvents feed + interface read ops).

§webhooks: Webhooks

The inbound webhook HTTP surface: a dedicated listener for webhook start nodes and wait: {on: webhook} callbacks.

§goal: Option<Goal>

The self-correcting goal watchdog: a periodic check of whether the configured goal is achieved (or the agent is stuck).

§observability: Observability§security: Security§identity: Identity

Who work is done ON BEHALF OF, and what travels with it.

Implementations§

Source§

impl Settings

Source

pub fn from_document(doc: Value, source: &str) -> Result<Settings, String>

Type a settings document. source names it in errors.

{{config.*}} substitution happens here, before typing — so a var can sit anywhere a string can: an endpoint, a path, a header. The workflows array is deliberately left alone; workflow documents are substituted at LOAD time instead (load_workflows), where the ones arriving from files, URLs and directories can be treated identically to inline ones.

Source

pub fn instance_name(&self) -> String

The agent.name fallback chain: config › downward-API instance › hostname › agentd.

Source

pub fn is_long_lived(&self) -> bool

Whether this instance OUTLIVES a single run — it serves A2A or webhooks, watches a goal, or owns a workflow with a long-lived start node (loop/schedule/subscribe/signal/event/a2a/webhook).

This is the durability predicate: a job-shaped run can lose its state and simply be re-run, while an instance that keeps running cannot. Two callers need exactly the same answer — load, which defaults such an instance to the file store, and validate, which refuses an EXPLICIT store.kind: none here — so the predicate lives in one place instead of being spelled out twice and diverging.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

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 Settings

Source§

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

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

impl Default for Settings

Source§

fn default() -> Settings

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

impl<'de> Deserialize<'de> for Settings

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 Settings

Source§

fn eq(&self, other: &Settings) -> 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 Settings

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