Skip to main content

AgentsConfig

Struct AgentsConfig 

Source
pub struct AgentsConfig { /* private fields */ }
Expand description

The effective agent config: the built-in agents with any voro.toml merged on top, plus the user’s default_agent and viewers. Each agent carries its Provenance so agent list can show where it came from.

Implementations§

Source§

impl AgentsConfig

Source

pub fn default_path() -> PathBuf

The config path dispatch reads: $XDG_CONFIG_HOME/voro/voro.toml, defaulting to ~/.config. A fresh install resolves here even before the file exists — that is the path agent init writes.

Source

pub fn load(path: &Path) -> Result<AgentsConfig>

Load the effective config: the built-in agents, with the user file layered on top if it exists. A missing file is not an error — the built-ins alone dispatch — so a fresh install needs no agent init.

Source

pub fn agent_names(&self) -> Vec<String>

Every agent name defined in the config, for the TUI’s dispatch picker (DESIGN.md §8/§9). agents is a BTreeMap, so this is already sorted.

Source

pub fn agent(&self, name: &str) -> Option<&AgentTemplate>

The verb templates of a named agent, if it is configured. Used where a session already records which agent ran it — jump-in, reconciliation — so no default/override resolution applies.

Source

pub fn resolve(&self, task_override: Option<&str>) -> Result<ResolvedAgent>

The agent for a task: its agent override if set, otherwise the resolved default (§8). An override or default naming an agent absent from the config is an error here, not a panic at spawn time.

Source

pub fn viewer_names(&self) -> Vec<String>

The names of the [viewers.*] tables, sorted, for the TUI’s review-action picker and viewer list.

Source

pub fn default_viewer_name(&self) -> Option<String>

The name of the viewer used when nothing picks one by name, for viewer list to flag: the user’s default_viewer when set (honoured even if it names a missing viewer), else the sole [viewers.*] entry. The anonymous [viewer] table has no name, so it yields None here even though it resolves.

Source

pub fn viewer_cmd(&self, name: Option<&str>) -> Result<&str>

Resolve a viewer command (DESIGN.md §11a): the named [viewers.<name>] when a name is given, otherwise the default — default_viewer when set, else the anonymous [viewer] table, else the sole [viewers.*] entry. Errors carry what to configure.

Source

pub fn default_name(&self) -> Option<String>

The name of the agent used when a task has no override, for the CLI’s agent list to flag it. None when no default is set and no built-in is on PATH — the same condition resolve errors on.

Source

pub fn provenance(&self, name: &str) -> Option<Provenance>

The provenance of a named agent, if it is configured.

Source

pub fn override_missing_verbs(&self, name: &str) -> Vec<&'static str>

For a user override of a built-in, the verbs the built-in defines that the override drops — the one case layering can’t fix (§8), so agent list can warn that those verbs stopped working. Empty for built-in or purely-additive user agents.

Source

pub fn entries( &self, ) -> impl Iterator<Item = (&str, &AgentTemplate, Provenance)>

Every agent as (name, template, provenance), sorted by name, for agent list.

Source

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

Write the [starter_config] skeleton to path, creating parent directories. Refuses to overwrite an existing file so a hand-tuned config is never clobbered.

Trait Implementations§

Source§

impl Clone for AgentsConfig

Source§

fn clone(&self) -> AgentsConfig

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 AgentsConfig

Source§

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

Formats the value using the given formatter. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.