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) |
§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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more