pub struct Reply {
pub stdout: Option<Value>,
pub stderr: Option<String>,
pub exit_code: i32,
}Expand description
What a hook process writes: stdout JSON, stderr text and an exit code.
Fields§
§stdout: Option<Value>§stderr: Option<String>§exit_code: i32Implementations§
Source§impl Reply
impl Reply
pub fn is_none(&self) -> bool
Sourcepub fn additional_context(
kind: &EventKind,
context: &str,
) -> Result<Self, OutputError>
pub fn additional_context( kind: &EventKind, context: &str, ) -> Result<Self, OutputError>
Add context for the model. Only events in EventKind::takes_additional_context.
Sourcepub fn block_stop(reason: &str) -> Self
pub fn block_stop(reason: &str) -> Self
Keep a Stop run going: {"decision":"block","reason":R}.
Sourcepub fn deny_tool(wire: Wire, reason: &str) -> Self
pub fn deny_tool(wire: Wire, reason: &str) -> Self
Refuse a tool call. Claude: permissionDecision: "deny", exit 0. Codex: stderr and exit 2.
Sourcepub fn ask_tool(wire: Wire, reason: &str) -> Self
pub fn ask_tool(wire: Wire, reason: &str) -> Self
Ask the person to confirm a tool call. Claude: permissionDecision: "ask". Codex has no
ask outcome and denies.
Sourcepub fn with_system_message(self, message: &str) -> Self
pub fn with_system_message(self, message: &str) -> Self
Add the top-level systemMessage the host shows to the person.
Sourcepub fn stdout_line(&self) -> Option<String>
pub fn stdout_line(&self) -> Option<String>
The single stdout line, if any.
Trait Implementations§
impl StructuralPartialEq for Reply
Auto Trait Implementations§
impl Freeze for Reply
impl RefUnwindSafe for Reply
impl Send for Reply
impl Sync for Reply
impl Unpin for Reply
impl UnsafeUnpin for Reply
impl UnwindSafe for Reply
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