Skip to main content

Module outputs

Module outputs 

Source
Expand description

hookSpecificOutput typed wrappers for the two hook kinds forge answers with an input override.

Each carries a zero-sized event_name field that serde always emits as the correct hookEventName string, so the discriminator is present however the wrapper is serialised.

Re-exportsยง

use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde_json::Value; ๐Ÿ”’
use super::HookKind; ๐Ÿ”’

Macrosยง

declare_event_name_tag ๐Ÿ”’
Tag ZST helpers that serialise as a fixed hookEventName string and ignore the actual value on the way back in. One ZST per event kind keeps the wrapper structs Default, Clone, and roundtrip-safe without requiring nightly-only const-generic string parameters.

Structsยง

PreToolUseHookSpecificOutput
hookSpecificOutput shape for PreToolUse hook responses.
PreToolUseTag
Zero-sized tag that always serialises as "PreToolUse".
UserPromptSubmitHookSpecificOutput
hookSpecificOutput shape for UserPromptSubmit.
UserPromptSubmitTag
Zero-sized tag that always serialises as "UserPromptSubmit".

Functionsยง

encode_updated_input_wrapper
Encode a replace_input forge_sdk::HookDecision into a hookSpecificOutput wrapper for the given hook kind.