Skip to main content

ComponentsConfig

Struct ComponentsConfig 

Source
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: PathBuf

Directory 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

KeyTypeDefaultDescription
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_modelstringprovider defaultModel name
llm_base_urlstringprovider defaultProvider base URL
llm_api_keystringenv var fallbackAPI key
llm_temperaturenumbernoneSampling temperature
llm_max_tokensnumbernoneMax completion tokens
llm_timeoutnumber120Request timeout (seconds)

§skill_manager

KeyTypeDefaultDescription
recommend_skillbooltrueEnable LLM-based skill recommendation (false = keyword fallback)
recommend_llm_provider"ollama"|"openai"|"anthropic""ollama"LLM provider for recommend
recommend_llm_modelstringprovider defaultModel name for recommend
recommend_llm_base_urlstringprovider defaultProvider base URL for recommend
recommend_llm_api_keystringenv var fallbackAPI key for recommend
recommend_llm_temperaturenumbernoneSampling temperature for recommend
recommend_llm_max_tokensnumbernoneMax tokens for recommend
recommend_llm_timeoutnumber120Timeout 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

Source

pub fn resolved_builtins_dir(&self) -> PathBuf

Resolves builtins_dir with tilde expansion.

Source

pub fn resolved_paths(&self) -> Vec<PathBuf>

Resolves user component paths with tilde expansion.

Non-existent directories are included (they may be created later).

Source

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.

Source

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

Source§

fn clone(&self) -> ComponentsConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ComponentsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ComponentsConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ComponentsConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ComponentsConfig

Source§

fn eq(&self, other: &ComponentsConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ComponentsConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ComponentsConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,