pub struct ConfigLoader {
pub paths: ConfigPaths,
/* private fields */
}Expand description
Configuration loader that handles tier-based merging.
Fields§
§paths: ConfigPathsPaths for each tier
Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn find_file(&self, relative_path: &str) -> Option<ResolvedFile>
pub fn find_file(&self, relative_path: &str) -> Option<ResolvedFile>
Find a file by relative path, searching from highest tier to lowest.
Returns the first file found, or None if not found in any tier.
Sourcepub fn find_file_path(&self, relative_path: &str) -> Option<PathBuf>
pub fn find_file_path(&self, relative_path: &str) -> Option<PathBuf>
Find a file, returning the path if found on disk.
Sourcepub fn file_exists(&self, relative_path: &str) -> bool
pub fn file_exists(&self, relative_path: &str) -> bool
Check if a file exists in any tier.
Sourcepub fn file_tier(&self, relative_path: &str) -> Option<ConfigTier>
pub fn file_tier(&self, relative_path: &str) -> Option<ConfigTier>
Get the tier where a file would be found.
Sourcepub fn list_files(&self, relative_dir: &str) -> Vec<(String, FileSource)>
pub fn list_files(&self, relative_dir: &str) -> Vec<(String, FileSource)>
List files in a directory across all tiers.
Returns a deduplicated list where higher-tier files shadow lower-tier ones.
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn load_with_paths(paths: ConfigPaths) -> Result<Self>
pub fn load_with_paths(paths: ConfigPaths) -> Result<Self>
Load configuration with explicit paths.
Sourcepub fn load_prompts(&self) -> Prompts
pub fn load_prompts(&self) -> Prompts
Load prompts configuration with tier merging.
Sourcepub fn load_workflows(&self) -> WorkflowsConfig
pub fn load_workflows(&self) -> WorkflowsConfig
Load workflows configuration with tier merging.
Loads from embedded defaults, then project workflows.yaml, then user workflows.yaml. Later tiers override earlier ones (objects are deep-merged, prompts are replaced).
Sourcepub fn config_mut(&mut self) -> &mut Config
pub fn config_mut(&mut self) -> &mut Config
Get mutable access to the configuration.
Sourcepub fn into_config(self) -> Config
pub fn into_config(self) -> Config
Consume the loader and return the configuration.
Sourcepub fn config_path(&self) -> Option<&Path>
pub fn config_path(&self) -> Option<&Path>
Get the config file path that was used.
Sourcepub fn is_using_deprecated(&self) -> bool
pub fn is_using_deprecated(&self) -> bool
Check if using deprecated paths.
Sourcepub fn project_dir(&self) -> Option<&Path>
pub fn project_dir(&self) -> Option<&Path>
Get the effective project directory.
Sourcepub fn skills_dir(&self) -> PathBuf
pub fn skills_dir(&self) -> PathBuf
Get the skills directory, checking all tiers.
Sourcepub fn load_workflow_by_name(&self, name: &str) -> Result<WorkflowsConfig>
pub fn load_workflow_by_name(&self, name: &str) -> Result<WorkflowsConfig>
Load a named workflow file (workflow-{name}.yaml).
Searches in order: user directory, project directory, install directory, embedded. User overrides project, project overrides install, install overrides embedded. Returns the merged workflow config (defaults + named workflow).
Sourcepub fn list_workflows(&self) -> Vec<String>
pub fn list_workflows(&self) -> Vec<String>
List available named workflows.
Returns workflow names (e.g., “solo”, “swarm”) found in user, project, install directories, and embedded defaults. Embedded workflows are always available as fallbacks.
Sourcepub fn list_overlays(&self) -> Vec<String>
pub fn list_overlays(&self) -> Vec<String>
List available overlay files (overlay-*.yaml).
Returns overlay names (e.g., “git”, “troubleshooting”) found in user, project, install directories, and embedded defaults. Embedded overlays are always available as fallbacks.
Sourcepub fn load_overlay_by_name(&self, name: &str) -> Result<WorkflowsConfig>
pub fn load_overlay_by_name(&self, name: &str) -> Result<WorkflowsConfig>
Load an overlay by name (overlay-{name}.yaml).
Unlike load_workflow_by_name, overlays are loaded as raw deltas WITHOUT
merging with defaults. This prevents double-appending prompts when
the overlay is later applied via apply_overlay().
Searches in order: user directory, project directory, install directory, embedded.
Trait Implementations§
Source§impl Clone for ConfigLoader
impl Clone for ConfigLoader
Source§fn clone(&self) -> ConfigLoader
fn clone(&self) -> ConfigLoader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ConfigLoader
impl RefUnwindSafe for ConfigLoader
impl Send for ConfigLoader
impl Sync for ConfigLoader
impl Unpin for ConfigLoader
impl UnsafeUnpin for ConfigLoader
impl UnwindSafe for ConfigLoader
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,
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