AgentEventHooksMixin#

Build extensions, choose hooks, and manage request-scoped state. See the guide.

class zett_agent.extensions.base.AgentEventHooksMixin[源代码]#

Hooks for internal notifications and external input.

accept(config, event)[源代码]#

Handle one external event and report whether it was accepted.

The Agent broadcasts each event to every registered extension. Override this synchronous hook when an extension waits for input from another thread, HTTP request, TUI, or Web UI. The default ignores the event. Config is passed separately and can be None before initialization. Each extension decides whether the supplied identity and payload match its protocol. Return True to include this extension's name in the broadcast result; returning False does not stop later receivers.

参数:
返回类型:

bool

async on_event(context, event)[源代码]#

Process a published notification; inspect its concrete type with match.

参数:
返回类型:

None