Skip to main content

Module registry

Module registry 

Source
Expand description

Hook registry - stores callbacks, mints opaque callback_ids, and renders the hooks field of the initialize control_request payload.

Re-exportsΒ§

use std::marker::PhantomData; πŸ”’
use std::sync::Arc; πŸ”’
use super::callback::ErasedCallback; πŸ”’
use super::callback::ErasedHookCallback; πŸ”’
use super::callback::HookCallback; πŸ”’
use forge_primitives::hooks::HookKind; πŸ”’
use forge_primitives::hooks::inputs::NotificationInput; πŸ”’
use forge_primitives::hooks::inputs::PermissionRequestInput; πŸ”’
use forge_primitives::hooks::inputs::PostToolUseFailureInput; πŸ”’
use forge_primitives::hooks::inputs::PostToolUseInput; πŸ”’
use forge_primitives::hooks::inputs::PreCompactInput; πŸ”’
use forge_primitives::hooks::inputs::PreToolUseInput; πŸ”’
use forge_primitives::hooks::inputs::StopInput; πŸ”’
use forge_primitives::hooks::inputs::SubagentStartInput; πŸ”’
use forge_primitives::hooks::inputs::SubagentStopInput; πŸ”’
use forge_primitives::hooks::inputs::UserPromptSubmitInput; πŸ”’

StructsΒ§

HookRegistry πŸ”’
Internal bundle mapping opaque ids to erased callbacks, with parallel metadata for the initialize payload.
HookRegistryEntry πŸ”’
One entry describing a minted hook id.
Hooks
Registry of hook callbacks. Construct with HooksBuilder, attach to OptionsBuilder via .hooks(...).
HooksBuilder
Builder for Hooks.

ConstantsΒ§

DEFAULT_HOOK_TIMEOUT_SECS πŸ”’
Timeout (seconds) emitted per hook matcher when HooksBuilder::default_timeout_secs is unset. Raised from the CLI’s per-matcher default of 30 so a hook response already written by forge survives a CLI stdin pump wedged on an inline get_context_usage computation.