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)
| exit | stdout | result |
|---|---|---|
0 | {} or {"action":"noop"} | HookAction::Noop |
0 | {"action":"mutate", ...} | HookAction::Mutate(patch) |
2 | {"message":"..."} or plain text | HookAction::Block(reason) |
| any other | — | Err(HookIssue { class: Execution }) |
§Exit-code contract (PostHook)
| exit | result |
|---|---|
0 | Ok(()) |
| any other | Err(HookIssue { class: Execution }) |
Structs§
- Shell
Command Hook - An external shell command registered as a
PreHookorPostHook.