pub struct BeforeIngest {
pub source: IngestSource,
pub input: Vec<ContentBlock>,
}Expand description
before Ingest: called before ingesting the current turn’s input. Can rewrite the
entire pending input or Break to reject the turn.
This is a mutation hook — the short-circuit is Break (reject), not “fill a result”
(there is no separable output). On an empty ingestion turn, input is empty.
The verdict supports two rewriting modes (not mutually exclusive; both can be given):
input(String/ array ofString): fully replace the pending input.prepend_input(String/ array ofString): prepend text blocks before the existing input, preserving original blocks (including non-text blocks like images). Used to inject context (e.g., a skill’s auto-activated L1 prompt) before the user’s prompt without losing the original multimodal content.
Fields§
§source: IngestSource§input: Vec<ContentBlock>The input to be ingested, which can be rewritten.
Trait Implementations§
Source§impl Clone for BeforeIngest
impl Clone for BeforeIngest
Source§fn clone(&self) -> BeforeIngest
fn clone(&self) -> BeforeIngest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BeforeIngest
impl Debug for BeforeIngest
Source§impl HookStep for BeforeIngest
impl HookStep for BeforeIngest
Source§fn event_name(&self) -> &'static str
fn event_name(&self) -> &'static str
Event name (snake_case). Used in envelope headers and matchers.
Source§fn to_envelope(&self) -> Value
fn to_envelope(&self) -> Value
Projects the step into an input envelope — fed to command stdin / prompt
templates. Contains a common header plus step-specific fields.
Source§fn apply_verdict(
&mut self,
verdict: &Value,
) -> Result<HookControl, VerdictError>
fn apply_verdict( &mut self, verdict: &Value, ) -> Result<HookControl, VerdictError>
Apply the handler’s output verdict (JSON) back to this step: parse the common
control / additional_context fields, then handle the step-specific “fill
output” fields. Returns a control directive. Read moreAuto Trait Implementations§
impl Freeze for BeforeIngest
impl RefUnwindSafe for BeforeIngest
impl Send for BeforeIngest
impl Sync for BeforeIngest
impl Unpin for BeforeIngest
impl UnsafeUnpin for BeforeIngest
impl UnwindSafe for BeforeIngest
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
Mutably borrows from an owned value. Read more