pub enum ScriptSource {
Path(PathBuf),
Inline {
source: String,
name: String,
},
DefaultAgent,
}Expand description
How the Lua script source for run() is supplied.
Path matches the CLI form (agent-block -s <path>), reading from
the filesystem at start. Inline lets SDK consumers pass a script
they hold in memory (compile-time include_str!, dynamically built
string, etc.) without writing it to a tempfile. DefaultAgent uses
an embedded invoker that runs the StdPkg agent module with the
caller-supplied prompt/context and emits the result via
bus.emit("agent_result", ...).
Variants§
Path(PathBuf)
Read the script from a filesystem path at start.
Inline
Use the supplied source code directly.
Fields
DefaultAgent
Use the embedded default agent invoker. prompt / context
are forwarded as _PROMPT / _CONTEXT Lua globals and the
agent result is emitted on the EventBus under a neutral label
("_"). SDK consumers should pair this with
BlockConfig::host_handler (the kind-agnostic single sink)
and auto_serve_bus = true. The emit-kind is intentionally
meaningless; consumers that need string-keyed routing should
supply ScriptSource::Inline with their own invoker.
Trait Implementations§
Source§impl Clone for ScriptSource
impl Clone for ScriptSource
Source§fn clone(&self) -> ScriptSource
fn clone(&self) -> ScriptSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ScriptSource
impl RefUnwindSafe for ScriptSource
impl Send for ScriptSource
impl Sync for ScriptSource
impl Unpin for ScriptSource
impl UnsafeUnpin for ScriptSource
impl UnwindSafe for ScriptSource
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,
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