pub enum AgentKind {
Lua,
RustFn,
AgentBlock,
Subprocess,
Operator,
}Expand description
SoT of the Worker IMPL axis. A closed enum managed inside Swarm and extended by variant addition through explicit maintenance. String lookup / escape hatches are deliberately not adopted.
This enum expresses Worker IMPL directly; dispatching to a host Spawner adapter is resolved by an internal Resolver on the compiler side (= callers see only the Worker IMPL viewpoint).
§Internal Resolver mapping (= currently a fixed 1:1, carry: priority list form)
| AgentKind | Host Spawner adapter |
|---|---|
Lua | InProcSpawner (mlua VM eval) |
RustFn | InProcSpawner (Rust closure) |
AgentBlock | InProcSpawner (agent-block-core SDK in-process) |
Subprocess | ProcessSpawner (child process launch) |
Operator | OperatorSpawner (interactive role / Human-MainAI delegation) |
Variants§
Lua
Lua script eval through the mlua VM (= factory-side registry looked up by spec.fn_id).
RustFn
Rust closure (= factory-side registry looked up by spec.fn_id).
AgentBlock
Headless LLM agent via the agent-block-core SDK (in-process).
Pairs with a Runner::AgentBlockInProcess. Its spec contract
(GH #86 — every key optional):
| key | meaning |
|---|---|
script_path | Absent → PromptBasedAgent mode (the host embeds an invoker that calls the SDK’s agent module). Present → ScriptBasedAgent mode (that Lua script runs instead). |
project_root | Compile-time fallback cwd. Overridden per launch by init_ctx.work_dir / init_ctx.project_root. |
mcp_rpc_timeout_ms | MCP RPC timeout; default 30000. |
mcp_servers | [{name, command, args}] pool the tool grant selects from. |
The step’s evaluated in reaches the agent as the _PROMPT Lua
global and profile.system_prompt as _CONTEXT — not through the
server process env. A script returns its result by calling
bus.emit(<kind>, payload); the host reads payload.content, else
payload.response, else the whole payload, as the step OUTPUT body
(which is what a VerdictChannel::Body contract compares).
Subprocess
Child-process launch (= spec.program + args, via the ProcessSpawner path).
Operator
Interactive Operator role (= MainAI / Human delegation, spec.operator_ref).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentKind
impl<'de> Deserialize<'de> for AgentKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for AgentKind
Source§impl JsonSchema for AgentKind
impl JsonSchema for AgentKind
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 AgentKind
impl Serialize for AgentKind
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 AgentKind
Auto Trait Implementations§
impl Freeze for AgentKind
impl RefUnwindSafe for AgentKind
impl Send for AgentKind
impl Sync for AgentKind
impl Unpin for AgentKind
impl UnsafeUnpin for AgentKind
impl UnwindSafe for AgentKind
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