Skip to main content

Module shell_hook

Module shell_hook 

Source
Expand description

Shell-command hook adapter.

Wraps an external process as a PreHook or PostHook. The process receives HookContext as JSON on stdin and signals its decision via exit code + stdout JSON.

§Exit-code contract (PreHook)

exitstdoutresult
0{} or {"action":"noop"}HookAction::Noop
0{"action":"mutate", ...}HookAction::Mutate(patch)
2{"message":"..."} or plain textHookAction::Block(reason)
any otherErr(HookIssue { class: Execution })

§Exit-code contract (PostHook)

exitresult
0Ok(())
any otherErr(HookIssue { class: Execution })

Structs§

ShellCommandHook
An external shell command registered as a PreHook or PostHook.