pub struct Compiler { /* private fields */ }Expand description
Turns a Blueprint into a CompiledBlueprint by resolving every
AgentDef against a SpawnerRegistry. One-shot: build a fresh
Compiler per compile() call (or reuse it — it holds no
per-compile state).
Implementations§
Source§impl Compiler
impl Compiler
Sourcepub fn new(registry: SpawnerRegistry) -> Self
pub fn new(registry: SpawnerRegistry) -> Self
Build a Compiler around the given SpawnerRegistry, with no
default spawner (unresolved flow refs are an error unless
with_default is chained on).
Sourcepub fn with_default(self, sp: Arc<dyn SpawnerAdapter>) -> Self
pub fn with_default(self, sp: Arc<dyn SpawnerAdapter>) -> Self
Set a default spawner — used for flow refs (and unregistered
AgentKinds under non-strict strategy) that don’t resolve
against any AgentDef/SpawnerRegistry entry.
Sourcepub fn compile(&self, bp: &Blueprint) -> Result<CompiledBlueprint, CompileError>
pub fn compile(&self, bp: &Blueprint) -> Result<CompiledBlueprint, CompileError>
Resolve every Blueprint.agents entry through the registry,
validate operator_refs and flow refs per Blueprint.strategy,
and return the routing table alongside the untouched flow and
metadata.
Sourcepub fn compile_bound(
&self,
bp: &Blueprint,
bound_agents: &[BoundAgent],
) -> Result<CompiledBlueprint, CompileError>
pub fn compile_bound( &self, bp: &Blueprint, bound_agents: &[BoundAgent], ) -> Result<CompiledBlueprint, CompileError>
Compile with an already-resolved immutable binding snapshot. Resume paths use this entry point so a mutable Blueprint registry cannot silently change the Runner, prompt, contract, or static context policy between the original Run and its continuation.
Sourcepub fn compile_bound_pinned(
&self,
bp: &Blueprint,
bound_agents: &[BoundAgent],
operator_pin: Option<&str>,
) -> Result<CompiledBlueprint, CompileError>
pub fn compile_bound_pinned( &self, bp: &Blueprint, bound_agents: &[BoundAgent], operator_pin: Option<&str>, ) -> Result<CompiledBlueprint, CompileError>
Self::compile_bound plus a launch-scoped Operator session pin.
operator_pin is the session id (S-<hex>) this launch is bound to.
When Some, every kind = Operator agent is compiled against that
session instead of whichever session currently holds the agent’s
spec.operator_ref role — the Blueprint keeps naming the logical
role, and which session it means becomes a launch-time fact. The pin
travels as a compile-synthesized build hint (same mechanism as the
Subprocess template hint, see [resolve_subprocess_template_hint]);
spec.operator_ref itself is never rewritten, so design-time
validation and the OperatorDef.kind cascade keep reading the
declared role.
None reproduces Self::compile_bound byte-for-byte.
Auto Trait Implementations§
impl !RefUnwindSafe for Compiler
impl !UnwindSafe for Compiler
impl Freeze for Compiler
impl Send for Compiler
impl Sync for Compiler
impl Unpin for Compiler
impl UnsafeUnpin for Compiler
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> 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