pub struct SubprocessProcessSpawnerFactory;Expand description
Factory for AgentKind::Subprocess. Turns the spec into a
ProcessSpawner.
Naming convention: <WorkerIMPL><AdapterType>SpawnerFactory. Factory
names carry both the worker implementation and the host adapter so
they are not confused with each other; the old
ShellSpawnerFactory was renamed to this.
Spec shape:
{ "program": "agent-block", "args": ["-s","s.lua"],
"use_stdin": true, // optional, default = true
"stream_mode": "ndjson_lines" | "sse_events" | "length_prefixed" | null // optional, default = null (plain)
}§GH #83 — EmbedAgent template mode
When the build hint carries a subprocess_template key (synthesized
by Compiler::compile from a resolved Runner::Subprocess — see
[resolve_subprocess_template_hint]), the factory switches to the
EmbedAgent path instead: it bakes agent_def.profile
(system_prompt / model / tools, same compile-time bake shape as
OperatorSpawnerFactory), validates the template’s placeholder tokens
against the closed set, and returns a ProcessSpawner whose embed
field drives the render → exec → normalize spawn. The spec-based
shape above stays byte-for-byte untouched when no such hint is
present.
Trait Implementations§
Source§impl SpawnerFactory for SubprocessProcessSpawnerFactory
impl SpawnerFactory for SubprocessProcessSpawnerFactory
Source§fn build(
&self,
agent_def: &AgentDef,
hint: Option<&Value>,
) -> Result<Arc<dyn SpawnerAdapter>, CompileError>
fn build( &self, agent_def: &AgentDef, hint: Option<&Value>, ) -> Result<Arc<dyn SpawnerAdapter>, CompileError>
SpawnerAdapter for one AgentDef. hint is
the matching entry (if any) from Blueprint.hints.per_agent.Source§impl SpawnerFactoryKind for SubprocessProcessSpawnerFactory
impl SpawnerFactoryKind for SubprocessProcessSpawnerFactory
Source§const KIND: AgentKind = AgentKind::Subprocess
const KIND: AgentKind = AgentKind::Subprocess
AgentKind this factory handles — used as the HashMap key
by SpawnerRegistry::register.Source§type Worker = ProcessWorker
type Worker = ProcessWorker
AgentKind — this
binds the type chain all the way from AgentKind down to Worker.
Every factory declares it so the AgentKind → Worker mapping is
explicit across all four layers. It is the source of truth for
preserving the concrete type right up until SpawnerAdapter::spawn
erases it into Box<dyn Worker>.Auto Trait Implementations§
impl Freeze for SubprocessProcessSpawnerFactory
impl RefUnwindSafe for SubprocessProcessSpawnerFactory
impl Send for SubprocessProcessSpawnerFactory
impl Sync for SubprocessProcessSpawnerFactory
impl Unpin for SubprocessProcessSpawnerFactory
impl UnsafeUnpin for SubprocessProcessSpawnerFactory
impl UnwindSafe for SubprocessProcessSpawnerFactory
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