Skip to content

EventAudience ​

Type, in src/define-event.ts of @jr2/agent-protocol, a dependency of @jr2/orchestrator. The signature of an export, or a type that it names, names this type. The Authoring surface page lists each export. This type is not an export of @jr2/orchestrator, so a workflow module does not import it by name.

ts
type EventAudience = "agent" | "external" | "any";

Who may send an event: "agent" (an Agent, as a pick from its Menu), "external" (the caller of a Gate), or "any" (both).

Leave it unset in most cases. Then the position of each on key decides: the event belongs to the party that its state, or the nearest state above it, invokes. An on key on a state that invokes no party, with no such state above it, belongs to both. Set an audience only to give an event to the other party too ("any"). Or set it to keep an event on the root from one party ("agent" or "external").

See also

The docs of Kit version 0.5.1. Each page is also at its .md URL.