pub struct Settings {
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>,
}Expand description
User settings loaded from ~/.config/harness/config.toml and optionally
merged with a project-level .harnessrc.toml.
Fields§
§default_agent: Option<String>Default agent to use if --agent is omitted.
default_model: Option<String>Default model to use if --model is omitted.
default_permissions: Option<String>Default permission mode (full-access or read-only).
default_timeout_secs: Option<u64>Default timeout in seconds.
log_level: Option<String>Log level for tracing output (e.g. “debug”, “info”, “warn”).
agents: HashMap<String, AgentSettings>Per-agent configuration overrides.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn load() -> Self
pub fn load() -> Self
Load settings from the default config file, optionally merged with a
project-level .harnessrc.toml found by walking up from cwd.
Sourcepub fn load_with_project(cwd: Option<&Path>) -> Self
pub fn load_with_project(cwd: Option<&Path>) -> Self
Load global settings, then merge project-level overrides from cwd.
Sourcepub fn load_project(start: &Path) -> Option<Self>
pub fn load_project(start: &Path) -> Option<Self>
Walk up from start looking for .harnessrc.toml. Returns the parsed
settings if found, None otherwise.
Sourcepub fn merge(&self, other: &Settings) -> Settings
pub fn merge(&self, other: &Settings) -> Settings
Merge another settings into this one. other (project) wins for scalar
fields; extra_args in agent settings are concatenated.
Sourcepub fn config_path() -> Option<PathBuf>
pub fn config_path() -> Option<PathBuf>
Default config file path: ~/.config/harness/config.toml.
Sourcepub fn resolve_default_agent(&self) -> Option<AgentKind>
pub fn resolve_default_agent(&self) -> Option<AgentKind>
Resolve the default agent from settings.
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 from settings.
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 from settings.
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 from settings.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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 Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
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