Skip to main content

ResolveConfig

Struct ResolveConfig 

Source
pub struct ResolveConfig {
    pub base: PathBuf,
    pub in_bp_includes: Vec<PathBuf>,
    pub env_includes: Vec<PathBuf>,
    pub cli_includes: Vec<PathBuf>,
    pub config_includes: Vec<PathBuf>,
    pub bundled_default: Option<PathBuf>,
}
Expand description

Resolution config for $agent_md / $file refs. Ordered list of directories the linker walks first-hit-wins across 6 tiers.

Tier order (highest priority first):

  1. base — bp.lua parent directory (always tier 1).
  2. in_bp_includes — in-bp declared blueprint_ref_includes (relative to base).
  3. env_includes — env MSE_BLUEPRINT_INCLUDES (:- or ;- separated absolute paths).
  4. cli_includes — CLI --include <path> repeatable.
  5. config_includes — server / config-file blueprint_ref_includes.
  6. bundled_default — bundled fallback (typically crates/mlua-swarm-cli/src/mcp/resources/samples/agents/).

Callers construct the config via ResolveConfig::new and layer additional tiers through the builder methods, then pass the config to expand_file_refs_with_config.

Fields§

§base: PathBuf

bp.lua parent directory (always tier 1, always first).

§in_bp_includes: Vec<PathBuf>

In-bp declared includes (tier 2, relative to base).

§env_includes: Vec<PathBuf>

Env MSE_BLUEPRINT_INCLUDES (tier 3).

§cli_includes: Vec<PathBuf>

CLI --include <path> repeatable (tier 4).

§config_includes: Vec<PathBuf>

Server / config-file blueprint_ref_includes (tier 5).

§bundled_default: Option<PathBuf>

Bundled default (tier 6). None = no bundled fallback (typical for server-side use, where the server never ships authoring files).

Implementations§

Source§

impl ResolveConfig

Source

pub fn new(base: impl Into<PathBuf>) -> Self

Build a config with only the base tier set. Callers layer the remaining tiers via builder methods.

Source

pub fn with_in_bp_includes(self, v: Vec<PathBuf>) -> Self

Set the in-bp include list (tier 2). Paths are resolved relative to base at search time.

Source

pub fn with_env_includes(self, v: Vec<PathBuf>) -> Self

Set the env include list (tier 3).

Source

pub fn with_cli_includes(self, v: Vec<PathBuf>) -> Self

Set the CLI include list (tier 4).

Source

pub fn with_config_includes(self, v: Vec<PathBuf>) -> Self

Set the config-file include list (tier 5).

Source

pub fn with_bundled_default(self, p: Option<PathBuf>) -> Self

Set the bundled-default fallback (tier 6). Pass None to disable the fallback (server-side default).

Source

pub fn search_paths(&self) -> impl Iterator<Item = PathBuf> + '_

Iterate every configured directory in cascade order (tier 1 → 6). in_bp_includes entries are joined onto base at iteration time so callers can pass in relative paths as declared in the bp.lua source.

Trait Implementations§

Source§

impl Clone for ResolveConfig

Source§

fn clone(&self) -> ResolveConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ResolveConfig

Source§

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

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

impl Default for ResolveConfig

Source§

fn default() -> ResolveConfig

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

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T

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.