pub struct HookOutput {
pub continue_: Option<bool>,
pub suppress_output: Option<bool>,
pub stop_reason: Option<String>,
pub decision: Option<HookDecision>,
pub system_message: Option<String>,
pub reason: Option<String>,
pub hook_specific_output: Option<Value>,
}Expand description
Hook result — the same JSON a shell hook prints on stdout. Source: binary hook-output schema (continue, suppressOutput, stopReason, decision, systemMessage, reason, hookSpecificOutput).
Fields§
§continue_: Option<bool>false stops the whole agent loop.
suppress_output: Option<bool>§stop_reason: Option<String>§decision: Option<HookDecision>§system_message: Option<String>Warning shown to the user.
reason: Option<String>Reason fed back to the model when decision is block.
hook_specific_output: Option<Value>Event-specific output; must carry hookEventName.
Implementations§
Source§impl HookOutput
impl HookOutput
Sourcepub fn block(reason: impl Into<String>) -> Self
pub fn block(reason: impl Into<String>) -> Self
Block the action; reason is shown to the model.
Sourcepub fn with_context(event: HookEventKind, context: impl Into<String>) -> Self
pub fn with_context(event: HookEventKind, context: impl Into<String>) -> Self
Inject additionalContext for the given event.
Sourcepub fn watch_paths(event: HookEventKind, paths: Vec<String>) -> Self
pub fn watch_paths(event: HookEventKind, paths: Vec<String>) -> Self
Register watchPaths for FileChanged hooks (valid for CwdChanged / FileChanged).
pub fn is_block(&self) -> bool
Trait Implementations§
Source§impl Clone for HookOutput
impl Clone for HookOutput
Source§impl Debug for HookOutput
impl Debug for HookOutput
Source§impl Default for HookOutput
impl Default for HookOutput
Source§impl<'de> Deserialize<'de> for HookOutput
impl<'de> Deserialize<'de> for HookOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for HookOutput
impl Freeze for HookOutput
impl Move for HookOutput
impl RefUnwindSafe for HookOutput
impl Send for HookOutput
impl Sync for HookOutput
impl Unpin for HookOutput
impl UnsafeUnpin for HookOutput
impl UnwindSafe for HookOutput
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