pub enum HookResult {
Continue,
Mutated,
Allow,
Deny {
reason: String,
},
Ask,
InjectContext {
text: String,
},
WithContext {
result: Box<HookResult>,
text: String,
},
Suspend {
reason: String,
},
Abort {
reason: String,
},
}Expand description
Result of running a hook.
Variants§
Continue
Continue with normal flow (no modifications).
Mutated
State was mutated; downstream should re-read.
Allow
Explicitly allow the operation represented by the payload.
Deny
Deny the operation represented by the payload.
Ask
Ask the owning parent agent to review the operation.
The engine never turns this into an unowned/manual approval. Tool seams route it through a parent approval delegate/proxy and fail closed when no such route exists.
InjectContext
Add durable context for the remaining run.
WithContext
Apply a control result and inject context from the same hook response.
Config-driven shell hooks use this when stdout includes both a
decision and additional_context. The runner unwraps the control
result before returning its aggregate outcome.
Suspend
Pause execution; set suspension state.
Abort
Abort the agent run.
Trait Implementations§
Source§impl Clone for HookResult
impl Clone for HookResult
Source§fn clone(&self) -> HookResult
fn clone(&self) -> HookResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HookResult
impl Debug for HookResult
Source§impl Default for HookResult
impl Default for HookResult
Source§fn default() -> HookResult
fn default() -> HookResult
Source§impl<'de> Deserialize<'de> for HookResult
impl<'de> Deserialize<'de> for HookResult
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for HookResult
Source§impl PartialEq for HookResult
impl PartialEq for HookResult
Source§impl Serialize for HookResult
impl Serialize for HookResult
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,
impl StructuralPartialEq for HookResult
Auto Trait Implementations§
impl Freeze for HookResult
impl RefUnwindSafe for HookResult
impl Send for HookResult
impl Sync for HookResult
impl Unpin for HookResult
impl UnsafeUnpin for HookResult
impl UnwindSafe for HookResult
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.