WorkflowEvent
Type, in @jr2/orchestrator/src/setup.ts. 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.
type WorkflowEvent<TDefs extends readonly EventDef[]> =
| (EventFrom<TDefs[number]> & { readonly sender?: Sender })
| MechanismEvent;The type of event in a Machine that jr2Setup makes: each workflow event in its events, and each Mechanism event. A workflow event that an Agent or a Gate sent has event.sender. An event that the Machine sent to itself (raise, sendTo) has no sender.
Forms: it is one of these objects.
Form 1:
type,sendertype:Nsender(optional):Sender
Form 2:
type,instanceId,reasontype:"agent.fault"instanceId:stringThe Instance ID of the Agent's conversation that failed: the same id on each Turn that continues it.
reason:stringWhy the Turn failed, as text for a person or a log: the Harness's error, or that the Agent ended its Turns without a pick after every nudge. Route on the event, not on this text.
Form 3:
type,reason,messagetype:"workspace.lost"reason(optional):stringWhy the Sandbox is gone, for a person or a log: the pod's reason (
Evicted,NodeShutdown), the operator's (PodDeleted,NodeLost), orDeleted. A body can act without it.message(optional):stringMore text about the loss, when jr2 has it.