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: VersionSchema version (= tied to this crate’s semver). Default = CURRENT_SCHEMA_VERSION.
Serialized as a semver string (e.g. "0.1.0").
id: StringBlueprint identifier (= unique key within the caller’s namespace).
flow: NodeEmbeds 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: CompilerHintsSwarm extension layer: per-agent hints (interpreted by the Compiler).
strategy: CompilerStrategySwarm extension layer: Compiler behavior strategy (strict / lenient).
metadata: BlueprintMetadataBlueprint metadata (description / origin / tags / ttl / version label / alias).
spawner_hints: SpawnerHintsSwarm 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: AgentKindBP-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)
- Runtime Agent-level (per-agent override supplied at task-launch time)
- Runtime Global (the launch-time
operator_kindrequest) - BP Agent-level (
OperatorDef.kind, resolved viaAgentDef.spec.operator_ref) - BP Global (this field)
- 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<'de> Deserialize<'de> for Blueprint
impl<'de> Deserialize<'de> for Blueprint
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Blueprint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Blueprint, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Blueprint
impl JsonSchema for Blueprint
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Blueprint
impl Serialize for Blueprint
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Blueprint
Auto Trait Implementations§
impl Freeze for Blueprint
impl RefUnwindSafe for Blueprint
impl Send for Blueprint
impl Sync for Blueprint
impl Unpin for Blueprint
impl UnsafeUnpin for Blueprint
impl UnwindSafe for Blueprint
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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