pub struct ComponentsConfig {
pub load: Vec<String>,
pub experimental: Vec<String>,
pub paths: Vec<PathBuf>,
pub builtins_dir: PathBuf,
pub settings: HashMap<String, Value>,
}Expand description
Component loading configuration.
Controls which components are loaded at startup and where to find them.
§Example TOML
[components]
load = ["agent_mgr", "skill_manager", "profile_manager", "shell", "tool"]
experimental = ["life_game"]
paths = ["~/.orcs/components"]
builtins_dir = "~/.orcs/builtins"Fields§
§load: Vec<String>Component names to load at startup.
Each name is resolved via ScriptLoader from paths (user-first)
then from the versioned builtins directory.
experimental: Vec<String>Experimental component names.
These are only loaded when the --experimental CLI flag or
ORCS_EXPERIMENTAL=true environment variable is set.
They are appended to load at config resolution time.
paths: Vec<PathBuf>User component search directories (priority order, searched first).
Supports ~ expansion.
builtins_dir: PathBufDirectory for builtin scripts (expanded from embedded on first run).
Supports ~ expansion. Defaults to ~/.orcs/builtins.
settings: HashMap<String, Value>Per-component settings, keyed by component name.
Values are passed to Component::init(config) at startup as a Lua table.
Each key maps to an arbitrary JSON object (no schema enforcement on the
Rust side — each Lua component validates its own keys).
§Data Flow
config.toml [components.settings.<name>]
→ serde → HashMap<String, serde_json::Value>
→ component_settings(name) → serde_json::Value
→ builder.rs injects cfg._global (OrcsConfig::global_config_for_lua())
→ ChannelRunner.with_component_config()
→ LuaComponent::init(json) → lua.to_value(json)
→ Lua: init(cfg)§Global Config (cfg._global)
Every component receives global config under cfg._global, injected
by OrcsAppBuilder::build(). See OrcsConfig::global_config_for_lua()
for the full field list. Components access it as:
init = function(cfg)
local debug = cfg._global.debug
local model = cfg._global.model.default
end§Known Component Settings
§agent_mgr
| Key | Type | Default | Description |
|---|---|---|---|
prompt_placement | "top"|"both"|"bottom" | "both" | Where skills/tools appear in the prompt |
llm_provider | "ollama"|"openai"|"anthropic" | "ollama" | LLM provider for agent conversation |
llm_model | string | provider default | Model name |
llm_base_url | string | provider default | Provider base URL |
llm_api_key | string | env var fallback | API key |
llm_temperature | number | none | Sampling temperature |
llm_max_tokens | number | none | Max completion tokens |
llm_timeout | number | 120 | Request timeout (seconds) |
ping_timeout_ms | number | 5000 | External agent ping timeout (ms) |
§lua_sandbox
| Key | Type | Default | Description |
|---|---|---|---|
sandbox_timeout_ms | number | 30000 | Sandbox execution timeout (ms) |
§skill_manager
| Key | Type | Default | Description |
|---|---|---|---|
recommend_skill | bool | true | Enable LLM-based skill recommendation (false = keyword fallback) |
recommend_llm_provider | "ollama"|"openai"|"anthropic" | "ollama" | LLM provider for recommend |
recommend_llm_model | string | provider default | Model name for recommend |
recommend_llm_base_url | string | provider default | Provider base URL for recommend |
recommend_llm_api_key | string | env var fallback | API key for recommend |
recommend_llm_temperature | number | none | Sampling temperature for recommend |
recommend_llm_max_tokens | number | none | Max tokens for recommend |
recommend_llm_timeout | number | 120 | Timeout for recommend (seconds) |
§Example (TOML)
[components.settings.agent_mgr]
prompt_placement = "both"
llm_provider = "ollama"
llm_model = "qwen2.5-coder:1.5b"
[components.settings.skill_manager]
recommend_skill = true
recommend_llm_provider = "ollama"
recommend_llm_model = "qwen2.5-coder:1.5b"Implementations§
Source§impl ComponentsConfig
impl ComponentsConfig
Sourcepub fn resolved_builtins_dir(&self) -> PathBuf
pub fn resolved_builtins_dir(&self) -> PathBuf
Resolves builtins_dir with tilde expansion.
Sourcepub fn resolved_paths(&self) -> Vec<PathBuf>
pub fn resolved_paths(&self) -> Vec<PathBuf>
Resolves user component paths with tilde expansion.
Non-existent directories are included (they may be created later).
Sourcepub fn activate_experimental(&mut self)
pub fn activate_experimental(&mut self)
Appends experimental component names to load, deduplicating.
Called by config resolvers when --experimental or ORCS_EXPERIMENTAL=true is set.
Sourcepub fn component_settings(&self, name: &str) -> Value
pub fn component_settings(&self, name: &str) -> Value
Returns the per-component settings for name, or an empty JSON object.
This returns only [components.settings.<name>] from config.toml.
Global config (_global) is injected separately by the builder
(see OrcsConfig::global_config_for_lua()).
Trait Implementations§
Source§impl Clone for ComponentsConfig
impl Clone for ComponentsConfig
Source§fn clone(&self) -> ComponentsConfig
fn clone(&self) -> ComponentsConfig
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 ComponentsConfig
impl Debug for ComponentsConfig
Source§impl Default for ComponentsConfig
impl Default for ComponentsConfig
Source§fn default() -> ComponentsConfig
fn default() -> ComponentsConfig
Source§impl<'de> Deserialize<'de> for ComponentsConfigwhere
ComponentsConfig: Default,
impl<'de> Deserialize<'de> for ComponentsConfigwhere
ComponentsConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComponentsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComponentsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ComponentsConfig
impl PartialEq for ComponentsConfig
Source§impl Serialize for ComponentsConfig
impl Serialize for ComponentsConfig
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 ComponentsConfig
Auto Trait Implementations§
impl Freeze for ComponentsConfig
impl RefUnwindSafe for ComponentsConfig
impl Send for ComponentsConfig
impl Sync for ComponentsConfig
impl Unpin for ComponentsConfig
impl UnsafeUnpin for ComponentsConfig
impl UnwindSafe for ComponentsConfig
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