HookPresenter(
self,
notice: HookNoticeCallback | None = None,
status: HookStatusCallback | None =| Name | Type |
|---|---|
| notice | HookNoticeCallback | None |
| status | HookStatusCallback | None |
| _active_statuses | dict[str, str] |
Present hook output consistently across interactive and headless clients.
Rebind the output sinks without replacing the presenter.
Lets a client that loaded hooks before its UI existed start surfacing output, while every runtime and service keeps the same instance.
Present common side effects from a reduced hook decision.
Log diagnostics and surface each warning or error once per invocation.
Deduplication is scoped to a single presentation call so a recurring diagnostic is still shown on later invocations. A notice is marked delivered only after the sink accepts it, so a failed delivery stays eligible for retry.
Update the currently visible hook-owned status.
Concurrent handlers share one status slot. The most recently activated handler wins until it completes; when the last active handler finishes, the slot is released with an empty message.
Attribute a hook-owned permission decision to the hook.
This text is user-facing only. Model-visible HITL rejection payloads must carry the raw hook reason without this attribution prefix.