pub struct SubprocessDef {
pub name: String,
pub argv: Vec<String>,
pub stdin: Option<String>,
pub env: BTreeMap<String, String>,
pub cwd: Option<String>,
pub output: Option<SubprocessOutput>,
pub stream_mode: Option<String>,
}Expand description
GH #83 — one declarative CLI invocation template: how a materialized worker payload (system prompt + task + model/tools/cwd) is rendered into a child-process invocation, and how its stdout is normalized back into the worker-result shape.
Deliberately a flat struct — no internal variant/kind
discriminator. Adding support for a new CLI backend means adding one
more named entry to Blueprint::subprocesses, never a new enum arm
or spawner branch (the AgentKind closed enum already owns the kind
axis; nesting a second “backend” hierarchy under it is the exact
complexity this shape refuses).
argv / stdin / env values / cwd may contain {placeholder}
tokens drawn from a closed, logic-free set ({system} /
{system_file} / {prompt} / {model} / {tools_csv} /
{work_dir} / {task_id} / {attempt}). Rendering is pure string
substitution — no conditionals, no loops, no expression language; the
engine-side consumer validates tokens against the closed set at
compile time. This crate stores the templates as plain strings only
(IN-immutability: no execution logic here).
Fields§
§name: StringRegistry key, referenced by Runner::Subprocess { template }.
argv: Vec<String>Program + arguments. argv[0] is the binary; every element may
carry placeholder tokens.
stdin: Option<String>Rendered and piped to the child’s stdin when Some; None = no
stdin write (EOF immediately).
env: BTreeMap<String, String>Extra environment variables (appended to the engine’s MSE_*
token exports). Values may carry placeholder tokens. BTreeMap
for a deterministic wire order.
cwd: Option<String>Child working directory (may carry placeholder tokens). None =
the spawn-time {work_dir} source decides (or the engine default
when no source exists).
output: Option<SubprocessOutput>stdout normalization declaration. None = the engine’s historical
JSON-or-raw behavior, byte-for-byte.
stream_mode: Option<String>Streaming wire protocol for stdout ("ndjson_lines" /
"sse_events" / "length_prefixed" — same vocabulary as the
spec-based Subprocess path). None = plain mode.
Trait Implementations§
Source§impl Clone for SubprocessDef
impl Clone for SubprocessDef
Source§fn clone(&self) -> SubprocessDef
fn clone(&self) -> SubprocessDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubprocessDef
impl Debug for SubprocessDef
Source§impl<'de> Deserialize<'de> for SubprocessDef
impl<'de> Deserialize<'de> for SubprocessDef
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SubprocessDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SubprocessDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for SubprocessDef
Source§impl JsonSchema for SubprocessDef
impl JsonSchema for SubprocessDef
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 PartialEq for SubprocessDef
impl PartialEq for SubprocessDef
Source§impl Serialize for SubprocessDef
impl Serialize for SubprocessDef
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 SubprocessDef
Auto Trait Implementations§
impl Freeze for SubprocessDef
impl RefUnwindSafe for SubprocessDef
impl Send for SubprocessDef
impl Sync for SubprocessDef
impl Unpin for SubprocessDef
impl UnsafeUnpin for SubprocessDef
impl UnwindSafe for SubprocessDef
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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