Expand description
Baseline agent — the canonical RustFn worker for bootstrap and
smoke tests.
The library-layer source of truth that structurally removes the
pattern of each binary (server / MCP adapter / one-shot runner) inlining
its own “let’s just wire up a quick echo” duplicate. Same shape as
enhance/blueprint.rs:
- Export the agent name as a role-literal const (
AG_IDENTITY). The naming reflects the function itself — an identity / passthrough ofctx— and deliberately avoids demo / echo framing. - Bake the real implementation (
extend_with_baseline). Not a false-positive fake — a straightforward passthrough that returns the input prompt in the value field, so callers can build smoke tests around “the baseline agent exists”. - A builder (
extend_with_baseline) that adds the RustFn to an existingRustFnInProcessSpawnerFactory. Same shape asenhance::blueprint::extend_factory.
§Usage
ⓘ
use mlua_swarm_engine_core::baseline::{extend_with_baseline, AG_IDENTITY};
use mlua_swarm_engine_core::RustFnInProcessSpawnerFactory;
let factory = extend_with_baseline(RustFnInProcessSpawnerFactory::new());
// The factory now has a RustFn registered under fn_id = AG_IDENTITY ("identity").Blueprint flows reference it as spec: {"fn_id": baseline::AG_IDENTITY}
(or the literal "identity").
Constants§
- AG_
IDENTITY - The baseline
RustFnagent name —"identity".
Functions§
- extend_
with_ baseline - Builder that adds the baseline
RustFnto a base factory.