pub struct HooksConfig {
pub cwd_changed: Vec<HookDef>,
pub file_changed: Option<FileChangedConfig>,
pub permission_denied: Vec<HookDef>,
pub turn_complete: Vec<HookDef>,
}Expand description
Top-level hooks configuration section.
Each sub-section corresponds to a lifecycle event. All sections default to empty (no hooks). Events fire in the order hooks are listed.
Fields§
§cwd_changed: Vec<HookDef>Hooks fired when the agent’s working directory changes via set_working_directory.
file_changed: Option<FileChangedConfig>File-change watcher configuration with associated hooks.
permission_denied: Vec<HookDef>Hooks fired when a tool execution is blocked by a RuntimeLayer::before_tool check.
Environment variables set for Command hooks:
ZEPH_DENIED_TOOL— the name of the tool that was blocked.ZEPH_DENY_REASON— human-readable reason string from the layer.
turn_complete: Vec<HookDef>Hooks fired after each agent turn completes (#3327).
Runs regardless of the [notifications] config. When a [notifications] notifier is
also configured, these hooks share its should_fire gate (respecting min_turn_duration_ms,
only_on_error, and enabled). When no notifier is configured, hooks fire on every
completed turn.
Use min_duration_ms in a wrapper script or the [notifications].min_turn_duration_ms
gate to avoid firing on trivial responses.
Environment variables set for Command hooks:
ZEPH_TURN_DURATION_MS— wall-clock duration of the turn in milliseconds.ZEPH_TURN_STATUS—"success"or"error".ZEPH_TURN_PREVIEW— redacted first ≤ 160 chars of the assistant response.ZEPH_TURN_LLM_REQUESTS— number of completed LLM round-trips this turn.
Implementations§
Trait Implementations§
Source§impl Clone for HooksConfig
impl Clone for HooksConfig
Source§fn clone(&self) -> HooksConfig
fn clone(&self) -> HooksConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HooksConfig
impl Debug for HooksConfig
Source§impl Default for HooksConfig
impl Default for HooksConfig
Source§fn default() -> HooksConfig
fn default() -> HooksConfig
Source§impl<'de> Deserialize<'de> for HooksConfigwhere
HooksConfig: Default,
impl<'de> Deserialize<'de> for HooksConfigwhere
HooksConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HooksConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HooksConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for HooksConfig
impl Serialize for HooksConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for HooksConfig
impl RefUnwindSafe for HooksConfig
impl Send for HooksConfig
impl Sync for HooksConfig
impl Unpin for HooksConfig
impl UnsafeUnpin for HooksConfig
impl UnwindSafe for HooksConfig
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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request