pub struct Config {Show 14 fields
pub default_provider: String,
pub providers: BTreeMap<String, ProviderConfig>,
pub agent: AgentConfig,
pub tools: ToolsConfig,
pub security: SecurityConfig,
pub sandbox: SandboxConfig,
pub mcp: Vec<McpServerConfig>,
pub subagents: Vec<SubagentProfile>,
pub search: Vec<SearchBackendConfig>,
pub hooks: Vec<HookConfig>,
pub outbox: OutboxConfig,
pub work: WorkConfig,
pub slack: SlackConfig,
pub messages: MessagesConfig,
}Fields§
§default_provider: StringWhich entry in providers to use when --provider isn’t given.
providers: BTreeMap<String, ProviderConfig>§agent: AgentConfig§tools: ToolsConfig§security: SecurityConfig§sandbox: SandboxConfigHow shell is confined. See crate::sandbox.
mcp: Vec<McpServerConfig>MCP servers to connect to at startup.
subagents: Vec<SubagentProfile>Subagents the parent may delegate to, each exposed as one tool.
search: Vec<SearchBackendConfig>Search backends, in preference order. The chain falls through on failure, which is what makes stacking two free tiers viable.
hooks: Vec<HookConfig>User commands run at loop lifecycle points. See crate::hooks.
outbox: OutboxConfigOutbound tools staged for user review instead of executed. See
crate::outbox.
work: WorkConfigRetention for ~/.mecha/work/. See crate::work.
slack: SlackConfigTunables for mecha slack. Global-file only; see SlackConfig.
messages: MessagesConfigInter-agent messages between mecha sessions on this machine. See
crate::mailbox.
Implementations§
Source§impl Config
impl Config
pub const PROJECT_FILE: &'static str = "mecha.toml"
pub fn global_path() -> Option<PathBuf>
Sourcepub fn load(project_dir: &Path) -> Result<Self>
pub fn load(project_dir: &Path) -> Result<Self>
Load defaults, then the global file, then the project file, then env.
Sourcepub fn load_global() -> Result<Self>
pub fn load_global() -> Result<Self>
Defaults plus ~/.mecha/config.toml plus env — no project layer.
For runs that must not be configurable by whatever directory they happen
to start in. A mecha.toml arrives with a cloned repository, and it can
name MCP servers to spawn, hooks to execute and tools to enable; that is
a reasonable bargain when a person is sitting there having just decided
to work in that repository, and not one at all for a
crate::trigger firing at 03:00 with nobody watching.