pub struct OrcsConfig {
pub debug: bool,
pub model: ModelConfig,
pub hil: HilConfig,
pub paths: PathsConfig,
pub ui: UiConfig,
pub scripts: ScriptsConfig,
pub components: ComponentsConfig,
pub hooks: HooksConfig,
pub mcp: McpConfig,
pub timeouts: TimeoutsConfig,
}Expand description
Main configuration structure.
This is the unified configuration after merging all layers.
§Serialization
Serializes to TOML for file storage. Fields with #[serde(default)]
are optional in the config file.
§Example
use orcs_runtime::config::OrcsConfig;
let config = OrcsConfig::default();
assert!(!config.debug);Fields§
§debug: boolEnable debug mode (verbose logging, diagnostics).
model: ModelConfigModel configuration.
hil: HilConfigHuman-in-the-loop configuration.
paths: PathsConfigPath configuration.
ui: UiConfigUI configuration.
scripts: ScriptsConfigScript configuration.
components: ComponentsConfigComponent loading configuration.
hooks: HooksConfigHooks configuration.
mcp: McpConfigMCP (Model Context Protocol) server configuration.
timeouts: TimeoutsConfigTimeout configuration.
Implementations§
Source§impl OrcsConfig
impl OrcsConfig
Sourcepub fn new() -> OrcsConfig
pub fn new() -> OrcsConfig
Creates a new config with default values.
Sourcepub fn global_config_for_lua(&self) -> Value
pub fn global_config_for_lua(&self) -> Value
Returns global config fields as a JSON value for Lua component injection.
This is injected into each component’s init(cfg) table under the _global key
by OrcsAppBuilder::build(), so Lua components can access it as cfg._global.
§Included fields
| Key | Type | Description |
|---|---|---|
debug | bool | Debug mode flag |
model.default | string | Default model name |
model.temperature | number | Default sampling temperature |
model.max_tokens | number|null | Default max completion tokens |
hil.auto_approve | bool | Auto-approve requests |
hil.timeout_ms | number | Approval timeout (ms) |
ui.verbose | bool | Verbose output |
ui.color | bool | Color output |
ui.emoji | bool | Emoji output |
timeouts.delegate_ms | number | Delegate task timeout (ms) |
§Excluded fields
paths, scripts, components, hooks are excluded (internal/sensitive).
Sourcepub fn merge(&mut self, other: &OrcsConfig)
pub fn merge(&mut self, other: &OrcsConfig)
Merges another config into this one.
Values from other override values in self only if they
differ from the default. This enables layered configuration.
Trait Implementations§
Source§impl Clone for OrcsConfig
impl Clone for OrcsConfig
Source§fn clone(&self) -> OrcsConfig
fn clone(&self) -> OrcsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrcsConfig
impl Debug for OrcsConfig
Source§impl Default for OrcsConfig
impl Default for OrcsConfig
Source§fn default() -> OrcsConfig
fn default() -> OrcsConfig
Source§impl<'de> Deserialize<'de> for OrcsConfigwhere
OrcsConfig: Default,
impl<'de> Deserialize<'de> for OrcsConfigwhere
OrcsConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OrcsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OrcsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OrcsConfig
impl PartialEq for OrcsConfig
Source§impl Serialize for OrcsConfig
impl Serialize for OrcsConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for OrcsConfig
Auto Trait Implementations§
impl Freeze for OrcsConfig
impl RefUnwindSafe for OrcsConfig
impl Send for OrcsConfig
impl Sync for OrcsConfig
impl Unpin for OrcsConfig
impl UnsafeUnpin for OrcsConfig
impl UnwindSafe for OrcsConfig
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