Skip to main content

load_dir

Function load_dir 

Source
pub fn load_dir(
    dir: impl AsRef<Path>,
    kind: AgentKind,
) -> Result<Vec<AgentDef>, LoadError>
Expand description

Load every *.md under dir. Sorted ascending by file name.

Files without frontmatter — explanatory docs that are not agents — are skipped; NoFrontmatter is not turned into an error. Files that have frontmatter but fail to parse or lack name do propagate their errors.

kind applies uniformly to every file — the global default for this directory scope. To differentiate per file, the caller calls load_file(path, per_file_kind) directly.