pub struct ProjectConfig {
pub default_agent: Option<String>,
pub default_model: Option<String>,
pub default_permissions: Option<String>,
pub default_timeout_secs: Option<u64>,
pub log_level: Option<String>,
pub agents: HashMap<String, AgentSettings>,
pub models: HashMap<String, ModelEntry>,
}Expand description
Project-level configuration loaded from harness.toml in the project directory.
This is the new config format — replaces ~/.config/harness/config.toml (global)
and .harnessrc.toml (walk-up). Contains the same fields as Settings plus a
[models] section for project-level model overrides.
Fields§
§default_agent: Option<String>§default_model: Option<String>§default_permissions: Option<String>§default_timeout_secs: Option<u64>§log_level: Option<String>§agents: HashMap<String, AgentSettings>Per-agent configuration overrides.
models: HashMap<String, ModelEntry>Project-level model overrides / additions.
Implementations§
Source§impl ProjectConfig
impl ProjectConfig
Sourcepub fn load(dir: &Path) -> Option<Self>
pub fn load(dir: &Path) -> Option<Self>
Load harness.toml by walking up from dir to find the nearest one.
Sourcepub fn load_with_path(dir: &Path) -> Option<(Self, PathBuf)>
pub fn load_with_path(dir: &Path) -> Option<(Self, PathBuf)>
Load harness.toml by walking up from dir, returning both the config
and the path where it was found.
Sourcepub fn model_registry(&self) -> ModelRegistry
pub fn model_registry(&self) -> ModelRegistry
Extract the [models] section as a ModelRegistry.
Sourcepub fn resolve_default_agent(&self) -> Option<AgentKind>
pub fn resolve_default_agent(&self) -> Option<AgentKind>
Resolve the default agent from this config.
Sourcepub fn agent_settings(&self, kind: AgentKind) -> Option<&AgentSettings>
pub fn agent_settings(&self, kind: AgentKind) -> Option<&AgentSettings>
Get agent-specific settings.
Sourcepub fn agent_binary(&self, kind: AgentKind) -> Option<PathBuf>
pub fn agent_binary(&self, kind: AgentKind) -> Option<PathBuf>
Resolve the binary path for a given agent.
Sourcepub fn agent_model(&self, kind: AgentKind) -> Option<String>
pub fn agent_model(&self, kind: AgentKind) -> Option<String>
Resolve the model for a given agent.
Sourcepub fn agent_extra_args(&self, kind: AgentKind) -> Vec<String>
pub fn agent_extra_args(&self, kind: AgentKind) -> Vec<String>
Get agent-specific extra_args.
Trait Implementations§
Source§impl Clone for ProjectConfig
impl Clone for ProjectConfig
Source§fn clone(&self) -> ProjectConfig
fn clone(&self) -> ProjectConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectConfig
impl Debug for ProjectConfig
Source§impl Default for ProjectConfig
impl Default for ProjectConfig
Source§fn default() -> ProjectConfig
fn default() -> ProjectConfig
Source§impl<'de> Deserialize<'de> for ProjectConfig
impl<'de> Deserialize<'de> for ProjectConfig
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 ProjectConfig
impl RefUnwindSafe for ProjectConfig
impl Send for ProjectConfig
impl Sync for ProjectConfig
impl Unpin for ProjectConfig
impl UnwindSafe for ProjectConfig
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,
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