Interface HookEvent

All Known Subinterfaces:
ActionHookEvent, AgentHookEvent, CapabilityHookEvent, ChatHookEvent, PluginHookEvent, SessionHookEvent
All Known Implementing Classes:
AgentInit, AgentStart, AgentStop, OnActionError, OnCapabilityDispatch, OnChunk, OnNotification, OnSessionIdle, OnSPILoad, OnStateTransition, PostAction, PostChat, PreAction, PreChat, SessionEnd, SessionStart

Root of the hook event hierarchy (issue #58). Sealed to a fixed list of category sub-interfaces — Tool, Action, Chat, Agent, Capability, Memory, Group, Session, Plugin — each in its own follow-up PR (#59 tool/action, #60 chat/agent, #61 memory, #62 group, #63 session/plugin).

Sealing is intentional: callers that switch over HookEvent get compile-time exhaustiveness, and adding a new category in a follow-up PR forces every consumer to acknowledge it. The cost is that adding a category here is a minor breaking change for switch consumers — that's the right trade-off for a safety-critical interception layer.

Categories landed so far:

Remaining categories — Memory (#61), Group (#62) — extend the permits clause in their feature PRs.
Since:
0.5.0 (issue #58)
  • Method Summary

    Modifier and Type
    Method
    Description
    Surrounding context — tenant / agent / role / group / trace / etc.
    Stable per-event id (ULID-shaped) for correlation across logs.
    default String
    Short stable string identifier of the event kind, e.g.
    When the event was created.
  • Method Details

    • eventId

      String eventId()
      Stable per-event id (ULID-shaped) for correlation across logs.
    • timestamp

      Instant timestamp()
      When the event was created.
    • context

      HookContext context()
      Surrounding context — tenant / agent / role / group / trace / etc.
    • eventType

      default String eventType()
      Short stable string identifier of the event kind, e.g. "PreToolUse". Default implementation derives it from the concrete record's simple class name; concrete records may override if a different naming is desirable.