Skip to main content
Native interceptors integrate into the same operation chain as Script interceptors but always run first. They can observe, modify, cancel, or replace operation payloads before any Script-level handler sees them.

API

Call context.intercept() inside onLoad:
AetherModOperationInterceptor is a fun interface with one method:
ParameterDescription
operationThe operation name to intercept, or "*" to intercept every operation.
priorityHigher-priority interceptors run first within the Native interceptor tier.
interceptorAetherModOperationInterceptor receiving the current payload and an operation context object; returns an AetherModOperationDecision.

Decision types

Your handler must return an AetherModOperationDecision that tells the chain what to do:
DecisionEffect
AetherModOperationDecision(payload = ...)Pass the operation through with a modified payload.
AetherModOperationDecision(cancelled = true, reason = "...")Cancel the operation. No further interceptors or built-in handlers run.
AetherModOperationDecision(payload = payload)Pass through with the payload unchanged.
You can also use the context.cancelOperation() extension function as a shorthand:

Built-in operations

OperationTriggered by
chat.newA new chat turn starting.
skills.selectionThe user or an extension changing the active skill selection.
Use "*" to intercept every operation dispatched through the kernel — useful for diagnostics, logging, or blanket policy enforcement.

Example — modifying chat.new

Clear the selected skill IDs before every new chat turn:

Example — wildcard observer

Log every operation without modifying it:

Example — cancelling an operation

Prevent a specific skill from being deselected:
Native interceptors run before Script interceptors for the same operation and priority. Within the Native tier, interceptors are ordered by their priority value — higher values run first.