pub struct HookDecision {
inner: HookDecisionKind,
}Expand description
A hook decision.
The shape (allow / deny / replace-input / passthrough) mirrors
the CLI’s SyncHookJSONOutput.decision field. See the hook-callback
contract docs for the full wire story.
Fields§
§inner: HookDecisionKindImplementations§
Source§impl HookDecision
impl HookDecision
fn with_inner(inner: HookDecisionKind) -> Self
Sourcepub fn replace_input(new_input: Value) -> Self
pub fn replace_input(new_input: Value) -> Self
Allow but substitute a new input payload (PreToolUse /
UserPromptSubmit).
Sourcepub fn passthrough() -> Self
pub fn passthrough() -> Self
Observational only - continue unchanged (typical PostToolUse /
Stop).
Sourcepub fn defer(timeout_ms: Option<u64>) -> Self
pub fn defer(timeout_ms: Option<u64>) -> Self
Defer the hook response. Emits the CLI’s AsyncHookJSONOutput
shape: {"async": true, "asyncTimeout": <ms>?}. Pass None for
no explicit timeout. The CLI will proceed without waiting for the
hook’s final verdict; the caller is expected to deliver the real
decision out-of-band (wiring that channel is follow-up work -
forge-sdk currently emits only the ACK shape).
Sourcepub fn is_deferred(&self) -> bool
pub fn is_deferred(&self) -> bool
True iff the decision was constructed via defer.
Sourcepub fn defer_timeout_ms(&self) -> Option<u64>
pub fn defer_timeout_ms(&self) -> Option<u64>
Optional timeout in milliseconds attached to a
defer decision.
Sourcepub fn updated_input(&self) -> Option<&Value>
pub fn updated_input(&self) -> Option<&Value>
Optional modified input.