Skip to main content

AoConfig

Struct AoConfig 

Source
pub struct AoConfig {
    pub port: u16,
    pub terminal_port: Option<u16>,
    pub direct_terminal_port: Option<u16>,
    pub ready_threshold_ms: u64,
    pub poll_interval: u64,
    pub power: Option<PowerConfig>,
    pub defaults: Option<DefaultsConfig>,
    pub projects: HashMap<String, ProjectConfig>,
    pub reactions: HashMap<String, ReactionConfig>,
    pub notification_routing: NotificationRouting,
    pub notifiers: HashMap<String, PluginConfig>,
    pub plugins: Vec<HashMap<String, Value>>,
}
Expand description

Top-level ao-rs config file shape. All fields use #[serde(default)] so partial config files parse without error.

Fields§

§port: u16

Dashboard port (TS: port).

§terminal_port: Option<u16>

Terminal server ports (TS: terminalPort, directTerminalPort).

§direct_terminal_port: Option<u16>§ready_threshold_ms: u64

Milliseconds before a “ready” session becomes “idle” (TS: readyThresholdMs, default 300000).

§poll_interval: u64

Lifecycle polling interval in seconds (default 10).

§power: Option<PowerConfig>

Power management settings.

§defaults: Option<DefaultsConfig>

Orchestrator-wide plugin defaults.

§projects: HashMap<String, ProjectConfig>

Per-project configs keyed by project id.

§reactions: HashMap<String, ReactionConfig>

Map from reaction key (e.g. "ci-failed") to its config.

§notification_routing: NotificationRouting

Priority-based notification routing table.

§notifiers: HashMap<String, PluginConfig>

Notifier plugin configurations (TS: notifiers).

§plugins: Vec<HashMap<String, Value>>

External plugins list (installer-managed). Currently stored for parity only.

Implementations§

Source§

impl AoConfig

Source

pub fn validate(&self, config_path: &Path) -> Result<()>

Validate config semantics (beyond YAML parsing).

Returns Ok(()) when valid, otherwise a AoError::Config with an actionable, field-scoped message including the config file path.

Source§

impl AoConfig

Source

pub const CONFIG_FILENAME: &str = "ao-rs.yaml"

Config file name in the project directory (like TS’s agent-orchestrator.yaml).

Source

pub fn load_from_with_warnings(path: &Path) -> Result<LoadedConfig>

Read and parse a config file at an explicit path, collecting warnings for unknown fields and validating the supported subset.

Source

pub fn load_from_or_default_with_warnings(path: &Path) -> Result<LoadedConfig>

Read a config file at an explicit path, or return an empty config if the file doesn’t exist, collecting warnings and validating.

Source

pub fn load_from(path: &Path) -> Result<Self>

Read and parse a config file at an explicit path.

Distinct from load_default because tests should never touch ~/.ao-rs/config.yaml — they pass a tempfile instead.

Source

pub fn load_from_or_default(path: &Path) -> Result<Self>

Read a config file at an explicit path, or return an empty config if the file doesn’t exist. Any other I/O or parse error propagates.

Only NotFound short-circuits to Default::default() — a permission denied or unreadable file should still error, since silently pretending there’s no config would mask a real misconfiguration.

Takes an explicit path (rather than always using default_path()) so tests can exercise both branches without touching $HOME.

Source

pub fn load_default() -> Result<Self>

Load config from the current directory’s ao-rs.yaml, or return an empty config if the file doesn’t exist.

Source

pub fn local_path() -> PathBuf

Config file path discovered from the current working directory.

Source

pub fn path_in(dir: &Path) -> PathBuf

Config file path in a specific directory.

Source

pub fn save_to(&self, path: &Path) -> Result<()>

Write this config to disk as YAML, creating parent dirs if needed.

Trait Implementations§

Source§

impl Clone for AoConfig

Source§

fn clone(&self) -> AoConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AoConfig

Source§

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

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

impl Default for AoConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for AoConfig

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 AoConfig

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AoConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for AoConfig

Source§

impl StructuralPartialEq for AoConfig

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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 = Infallible

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
Source§

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