Skip to main content

Blueprint

Struct Blueprint 

Source
pub struct Blueprint {
    pub schema_version: Version,
    pub id: String,
    pub flow: Node,
    pub agents: Vec<AgentDef>,
    pub operators: Vec<OperatorDef>,
    pub hints: CompilerHints,
    pub strategy: CompilerStrategy,
    pub metadata: BlueprintMetadata,
    pub spawner_hints: SpawnerHints,
    pub default_agent_kind: AgentKind,
    pub default_operator_kind: Option<OperatorKind>,
}
Expand description

Unified package of flow.ir + Swarm extension layers. The entry-point type of Swarm.

Fields§

§schema_version: Version

Schema version (= tied to this crate’s semver). Default = CURRENT_SCHEMA_VERSION. Serialized as a semver string (e.g. "0.1.0").

§id: String

Blueprint identifier (= unique key within the caller’s namespace).

§flow: Node

Embeds the flow.ir Node verbatim (= keeps flow.ir side unpolluted). Opaque in the JSON Schema (the Node shape is owned by the mlua-flow-ir crate, a separate repo; see its docs for the Node / Expr grammar).

§agents: Vec<AgentDef>

Swarm extension layer: agent → backend mapping.

§operators: Vec<OperatorDef>

Swarm extension layer: design-time definition of Operator roles (first-class).

AgentDef.spec.operator_ref references an OperatorDef.name (logical role name) in this vec. Embedding runtime-generated IDs such as sid into the BP is forbidden (= collapses the design-time vs runtime boundary). Runtime backend bindings are established via the attach / register path; the BP side holds only logical names.

Every kind = Operator agent must have its spec.operator_ref present in this list — the compiler validates it at compile() time. May be [] only when the Blueprint declares no Operator agents.

§hints: CompilerHints

Swarm extension layer: per-agent hints (interpreted by the Compiler).

§strategy: CompilerStrategy

Swarm extension layer: Compiler behavior strategy (strict / lenient).

§metadata: BlueprintMetadata

Blueprint metadata (description / origin / tags / ttl / version label / alias).

§spawner_hints: SpawnerHints

Swarm extension layer: hint keys of the layers to wrap around the SpawnerStack. Resolved by the LayerRegistry at engine bind time (= unregistered keys are silently skipped). Flow / Blueprint do not hold middleware implementations (e.g. MainAIMiddleware) directly; they only declare required capabilities as string keys (= implementations live in the engine-side LayerRegistry).

§default_agent_kind: AgentKind

BP-wide default AgentKind (= fallback when AgentDef.kind is omitted). Four-layer cascade: (1) Schema impl Default = Operator, (2) CLI --default-agent-kind, (3) this field (BP JSON literal), (4) AgentDef.kind (per-agent literal). (5) CompilerHints.kind_override allows runtime override. All default resolution flows through this path.

§default_operator_kind: Option<OperatorKind>

BP-wide default OperatorKind (= the “BP Global” tier of the 4-tier OperatorKind cascade). None when the Blueprint author does not declare a default; the caller-side resolver then falls through to the hardcoded OperatorKind::default() (Automate).

§4-tier cascade (highest to lowest priority)

  1. Runtime Agent-level (per-agent override supplied at task-launch time)
  2. Runtime Global (the launch-time operator_kind request)
  3. BP Agent-level (OperatorDef.kind, resolved via AgentDef.spec.operator_ref)
  4. BP Global (this field)
  5. Default Fallback (OperatorKind::default() = Automate)

The collapse itself is implemented once on the engine side and consumed per-agent when resolving operator info.

Trait Implementations§

Source§

impl Clone for Blueprint

Source§

fn clone(&self) -> Blueprint

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 Blueprint

Source§

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

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

impl<'de> Deserialize<'de> for Blueprint

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 JsonSchema for Blueprint

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Blueprint

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Blueprint

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 Blueprint

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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.