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 costs(&self) -> AttentionCosts

The attention price band the queue ranks by (DESIGN.md §7).

Source

pub fn max_running(&self) -> i64

The dispatch WIP cap (DESIGN.md §7): how many tasks may be running before the queue stops offering dispatches.

Source

pub fn max_running_from_file(&self) -> Option<i64>

The cap as voro.toml spells it, None when the file names none — the provenance the Config screen’s settings list shows beside the value (DESIGN.md §5), which the resolved max_running alone cannot tell apart from a cap that happens to equal the default.

Source

pub fn default_agent_from_file(&self) -> Option<&str>

default_agent as the file spells it, before the PATH probe that default_name falls back to.

Source

pub fn default_viewer_from_file(&self) -> Option<&str>

default_viewer as the file spells it, before the resolution rules default_viewer_name falls back to.

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 user’s [viewers.*] tables, sorted: the editable set, which is why the built-ins are not in it. Everything that offers a viewer to run — the TUI’s viewer picker, viewer list — wants viewer_entries instead.

Source

pub fn viewer_entries(&self) -> Vec<(&str, &str, Provenance)>

Every effective viewer as (name, cmd, provenance), sorted by name — the built-ins with the user’s tables layered over them, mirroring the agents’ entries. What viewer list, the Config screen and the default/review-action pickers show, since a built-in is a legitimate thing to run, star, or pin a project to.

Source

pub fn anonymous_viewer_cmd(&self) -> Option<&str>

The anonymous [viewer] table’s command, if the file defines one — the legacy default the Config screen surfaces read-only, since it carries no name to edit or delete by.

Source

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

The name of the viewer open will run when nothing picks one by name, for viewer list and the Config screen to star: the user’s default_viewer when set (honoured even if it names a missing viewer), else the sole [viewers.*] entry, else the first built-in found on PATH. 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). User configuration always wins: with a name, the [viewers.<name>] table, falling back to the built-in of that name; without one, default_viewer, else the anonymous [viewer] table, else the sole [viewers.*] entry, else the first built-in viewer found on PATH. Errors carry what to install or run.

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.