pub struct Config {
pub agents: Vec<AgentSpec>,
pub roles: Roles,
pub graph: Graph,
pub blind: Blind,
pub verify: Verify,
pub merge: Merge,
pub update: Update,
pub prompts: Prompts,
pub notify: Notify,
pub repos: Repos,
}Expand description
Top-level configuration.
Fields§
§agents: Vec<AgentSpec>Agent roster.
roles: RolesRole assignment.
graph: GraphGraph shape.
blind: BlindBlindness policy.
verify: VerifyVerification commands.
merge: MergeMerge policy.
update: UpdateSelf-update policy.
prompts: PromptsProject-specific text appended to the node prompts.
notify: NotifyHow the operator is told a run is waiting on them.
repos: ReposLocal repositories the plan surface can start or derive a conversation against.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Load one file through teravars: Tera rendering, [vars] resolution,
and the include = [...] directive.
Sourcepub fn load_layers(paths: &[PathBuf]) -> Result<Self>
pub fn load_layers(paths: &[PathBuf]) -> Result<Self>
Load and deep-merge a stack of config files, later files winning.
This is why the config is TOML-through-teravars rather than plain serde:
the roster is a machine fact (which CLIs and plans you pay for) while
the gate is a repository fact (cargo make check here, pnpm test
there). Picking one file and ignoring the other would force every repo
to restate the roster.
Sourcepub fn layers(repo: &Path) -> Vec<PathBuf>
pub fn layers(repo: &Path) -> Vec<PathBuf>
Every config layer that applies to repo, in increasing precedence.
Sourcepub fn discover(
repo: &Path,
explicit: Option<&Path>,
) -> Result<(Self, Vec<PathBuf>)>
pub fn discover( repo: &Path, explicit: Option<&Path>, ) -> Result<(Self, Vec<PathBuf>)>
Resolve the config for repo, honouring an explicit --config path.
Returns the config and the layers it came from, empty for built-in defaults.
Sourcepub fn autodetected() -> Self
pub fn autodetected() -> Self
Built-in config whose roster is the agent CLIs found on PATH.
Sourcepub fn resolve_roles(&self) -> Result<ResolvedRoles>
pub fn resolve_roles(&self) -> Result<ResolvedRoles>
Fill the roles out to the configured widths.
An empty role list rotates through the whole roster, so a three-agent
roster with candidates = 3 gives one implementation per agent, and
judges = 3 rotates the judge seats by one so that judge i is not the
author of candidate i whenever the roster has more than one agent.
Sourcepub fn starter_toml() -> String
pub fn starter_toml() -> String
Starter config, as written by magi init.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more