pub struct BlockConfig {
pub script_path: PathBuf,
pub project_root: PathBuf,
pub relay_url: Option<String>,
pub secret_key: Option<String>,
pub mcp_rpc_timeout: Duration,
pub prompt: Option<String>,
pub context: Option<String>,
pub host_handlers: HashMap<String, Arc<dyn Handler>>,
}Fields§
§script_path: PathBuf§project_root: PathBuf§relay_url: Option<String>§secret_key: Option<String>Ed25519 secret key (64 hex chars). If None, a random keypair is
generated. Required to talk to registry/ACL-gated hosted meshes.
mcp_rpc_timeout: DurationPer-RPC timeout for every MCP round-trip (connect / list / call).
Defaults to agent_block_mcp::DEFAULT_RPC_TIMEOUT.
prompt: Option<String>Prompt string injected as _PROMPT Lua global. None = global not set.
context: Option<String>Context string injected as _CONTEXT Lua global. None = global not set.
host_handlers: HashMap<String, Arc<dyn Handler>>Host-side Rust handlers pre-installed on the EventBus before the user
script starts. Each entry registers handler against kind via
EventBus::on, so a script-side bus.emit(kind, payload) is
captured by the Rust handler rather than dispatched to a Lua function.
Intended for SDK consumers that embed agent-block-core and need to
receive script output programmatically (e.g. a Spawner adapter that
turns LLM script output into a typed WorkerResult). Lua-side
bus.on(kind, fn) registrations layered on top of the handler Isle
are still possible, but the EventBus dispatches a single handler per
kind (last-write-wins), so host-side and Lua-side registrations on
the same kind collide; choose one side per routing key.
Defaults to an empty map (no host handlers).
Auto Trait Implementations§
impl !RefUnwindSafe for BlockConfig
impl !UnwindSafe for BlockConfig
impl Freeze for BlockConfig
impl Send for BlockConfig
impl Sync for BlockConfig
impl Unpin for BlockConfig
impl UnsafeUnpin for BlockConfig
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