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
impl AgentsConfig
Sourcepub fn default_path() -> PathBuf
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.
Sourcepub fn load(path: &Path) -> Result<AgentsConfig>
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.
Sourcepub fn agent_names(&self) -> Vec<String>
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.
Sourcepub fn agent(&self, name: &str) -> Option<&AgentTemplate>
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.
Sourcepub fn resolve(&self, task_override: Option<&str>) -> Result<ResolvedAgent>
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.
Sourcepub fn viewer_names(&self) -> Vec<String>
pub fn viewer_names(&self) -> Vec<String>
The names of the [viewers.*] tables, sorted, for the TUI’s
review-action picker and viewer list.
Sourcepub fn default_viewer_name(&self) -> Option<String>
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.
Sourcepub fn viewer_cmd(&self, name: Option<&str>) -> Result<&str>
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.
Sourcepub fn default_name(&self) -> Option<String>
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.
Sourcepub fn provenance(&self, name: &str) -> Option<Provenance>
pub fn provenance(&self, name: &str) -> Option<Provenance>
The provenance of a named agent, if it is configured.
Sourcepub fn override_missing_verbs(&self, name: &str) -> Vec<&'static str>
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.
Sourcepub fn entries(
&self,
) -> impl Iterator<Item = (&str, &AgentTemplate, Provenance)>
pub fn entries( &self, ) -> impl Iterator<Item = (&str, &AgentTemplate, Provenance)>
Every agent as (name, template, provenance), sorted by name, for
agent list.
Sourcepub fn write_starter(path: &Path) -> Result<()>
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
impl Clone for AgentsConfig
Source§fn clone(&self) -> AgentsConfig
fn clone(&self) -> AgentsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more