Skip to main content

Crate zeroclaw_config

Crate zeroclaw_config 

Source
Expand description

Configuration schema, secrets, and related types for ZeroClaw.

Modules§

api_error
Structured error type for the gateway HTTP CRUD surface and its CLI peer.
autonomy
comment_writer
Shared TOML comment-writing helpers used by both the gateway HTTP CRUD handlers and the CLI zeroclaw config set --comment / zeroclaw config patch flow. Walks a toml_edit::DocumentMut to a leaf key by dotted path and decorates its leading whitespace with # {comment}\n. Empty comment string strips comment lines from the existing prefix.
config
Shim module so Configurable derive macro’s generated crate::config::* paths resolve. The macro was written assuming it runs inside the root crate where mod config exists.
cost
domain_matcher
env_overrides
V0.8.0 env-var override mechanism.
helpers
Property helpers used by the Configurable derive macro and the zeroclaw config CLI.
migration
multi_agent
Multi-agent runtime types: alias newtypes, access-mode enum, peer external entries, and the nested config structs that wire into crate::schema::AliasedAgentConfig and crate::schema::Config.
pairing
paths
Shared path helpers used by both schema-tier validation and the scoped file browser. Single source of truth for “lexically normalize a path” and “resolve a relative input under a fixed root with no escape”.
platform
policy
provider_aliases
ModelProvider alias functions used by config validation.
providers
scattered_types
Config types that were originally defined in their home modules (agent, channels, tools, trust) but are needed by the config schema. Moved here to break circular dependencies.
schema
secrets
sections
Onboarding sections surface — a flat ordered set of Sections the operator walks (new install) or scans (returning user) to configure a working ZeroClaw deployment.
security
Shim module so Configurable derive macro’s generated crate::security::* paths resolve.
skill_bundles
Skill-bundle directory rules and helpers.
traits
typed_value
Strictly-typed JSON-to-Config::set_prop value coercion.
validation_warnings
Non-fatal validation warnings — config that loads and validates successfully (i.e. Config::validate() returns Ok(())) but will fail at agent runtime because of a logical inconsistency the schema can’t enforce structurally.

Macros§

define_provider_ref
for_each_model_provider_slot
Macro that expands to a single source of truth for the per-provider-type slot list on ModelProviders. Every helper that needs to walk every slot (first_model_provider, iter_entries, is_empty, etc.) goes through this macro so adding a new model_provider type is a one-line addition here, not a shotgun edit across multiple helpers.
for_each_transcription_provider_slot
Slot list for transcription providers.
for_each_tts_provider_slot
Slot list for TTS providers. Single source of truth shared between the typed-provider wrapper and the cost-rates wrapper — adding a TTS family is a one-line edit here.
validation_bail
Per-bail-site shorthand for emitting a structured ConfigApiError inside a validate() chain that returns anyhow::Result<()>. Wraps the structured error as the anyhow source so ConfigApiError::from_validation downcasts to it without having to re-classify the message text. Pattern: