#[non_exhaustive]pub enum Event<'a> {
Show 29 variants
SessionStart {
source: SessionSource,
},
SessionEnd,
PreToolUse {
action: &'a Action,
},
PostToolUse {
action: &'a Action,
result: &'a ToolResult,
},
PermissionRequest {
action: &'a Action,
},
PreCompact {
stage: CompactionStage,
},
PostCompact {
stage: CompactionStage,
},
PreGuide {
guide: &'a String,
},
PostGuide {
guide: &'a String,
},
PreSensor {
sensor: &'a String,
},
PostSensor {
sensor: &'a String,
signals: &'a [Signal],
},
PreAutoFix {
patch: &'a FixPatch,
},
PostAutoFix {
patch: &'a FixPatch,
applied: bool,
},
PreModel {
ctx: &'a Context,
},
PostModel {
out: &'a ModelOutput,
},
ModelTokenDelta {
text: &'a str,
},
SubagentStart {
name: &'a str,
},
SubagentReport {
status: SubagentStatus,
},
FileChanged {
path: &'a PathBuf,
},
CwdChanged {
from: &'a PathBuf,
to: &'a PathBuf,
},
BlueprintNodeEnter {
node: &'a str,
},
BlueprintNodeExit {
node: &'a str,
},
TaskCompleted,
BudgetWarning {
ratio: f32,
},
Notification {
kind: NotificationKind,
},
Error {
message: &'a str,
},
Stop,
Heartbeat {
iter: u32,
},
Custom {
name: &'a str,
data: &'a Value,
},
}Expand description
All 27 lifecycle events the framework emits (DESIGN.md §10).
Lifetimes are intentionally borrowed: hooks must not own these references past the call.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SessionStart
Fields
§
source: SessionSourceSessionEnd
PreToolUse
PostToolUse
PermissionRequest
PreCompact
Fields
§
stage: CompactionStagePostCompact
Fields
§
stage: CompactionStagePreGuide
PostGuide
PreSensor
PostSensor
PreAutoFix
PostAutoFix
PreModel
PostModel
Fields
§
out: &'a ModelOutputModelTokenDelta
Streaming-only: a text fragment arrived from Model::stream(). Fires
0..N times between PreModel and PostModel when the AgentLoop is
in streaming mode. text is the new fragment (not the accumulator).
Tool-call deltas are NOT surfaced here — the loop assembles those
and emits the final PostModel with full tool_calls.
SubagentStart
SubagentReport
Fields
§
status: SubagentStatusFileChanged
CwdChanged
BlueprintNodeEnter
BlueprintNodeExit
TaskCompleted
BudgetWarning
Notification
Fields
§
kind: NotificationKindError
Stop
Heartbeat
Custom
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Event<'a>
impl<'a> RefUnwindSafe for Event<'a>
impl<'a> Send for Event<'a>
impl<'a> Sync for Event<'a>
impl<'a> Unpin for Event<'a>
impl<'a> UnsafeUnpin for Event<'a>
impl<'a> UnwindSafe for Event<'a>
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