Skip to main content

Module hooks

Module hooks 

Source
Expand description

Hook callback wire-data - input payloads, output decisions, and the lifecycle plumbing.

Workspace-shared shapes: HookKind, HookContext, HookDecision, plus every input/output payload. The callback machinery (HookCallback trait, ErasedHookCallback type-erasure adapter, Hooks builder/registry) stays SDK-side because it owns Arc<dyn …> pointers.

Submodule split:

  • inputs - BaseHookInput, SubagentContext, the ten *Input payload structs.
  • outputs - the PreToolUse / UserPromptSubmit hookSpecificOutput wrappers and their hookEventName tag ZSTs.

Re-exports§

pub use inputs::BaseHookInput;
pub use inputs::NotificationInput;
pub use inputs::PermissionRequestInput;
pub use inputs::PostToolUseFailureInput;
pub use inputs::PostToolUseInput;
pub use inputs::PreCompactInput;
pub use inputs::PreToolUseInput;
pub use inputs::StopInput;
pub use inputs::SubagentContext;
pub use inputs::SubagentStartInput;
pub use inputs::SubagentStopInput;
pub use inputs::UserPromptSubmitInput;
pub use outputs::PreToolUseHookSpecificOutput;
pub use outputs::UserPromptSubmitHookSpecificOutput;

Modules§

inputs
Typed input payloads for each hook event.
outputs
hookSpecificOutput typed wrappers for the two hook kinds forge answers with an input override.

Structs§

HookContext
Context carried alongside every hook invocation.

Enums§

HookKind
Identifies which hook point a callback is registered for. Sixteen event kinds mirrored from the CLI v0.1.64, plus Unknown as a fallback for forward-compatibility.