Skip to main content

Module trigger_registry

Module trigger_registry 

Expand description

Trigger-source registry projected for the SOP authoring surfaces.

Walks the backend enums (SopTriggerSource, ChannelKind, FilesystemEventKind) so editors render whatever the runtime supports instead of hardcoding option lists. Served via sops/trigger-sources (RPC) and the gateway’s SOP authoring routes.

Structs§

BoundTriggerSource
A non-channel trigger source and the fields needed to configure it.
ChannelAlias
One configured channel instance an SOP channel trigger can bind to.
ChannelTriggerKind
One channel type row: every inbound-capable ChannelKind appears, configured or not, so editors can offer setup for missing ones.
ConditionField
One field of a trigger payload a condition can reference. path is the JSON path suffix after $. (empty for a scalar payload compared directly), label is the human name, value_type drives the value control, and options carries the choices when value_type is Enum.
ConfiguredChannel
Config-derived channel instance used as input to build_registry; decoupled from zeroclaw_config so the walk is testable without a full Config.
PayloadContract
The set of payload fields a condition may reference for a given source. open marks sources whose payload is arbitrary user JSON (MQTT, AMQP, webhook body, channel message): the surface offers a guided path/op/value builder plus a sample-payload probe rather than a fixed field list. direct marks a scalar payload (peripheral signal) compared with the bare op value form and no path.
TriggerField
One editable field of a trigger source (e.g. topic for MQTT).
TriggerSourceRegistry
Everything an authoring surface needs to offer trigger configuration: the full ordered source list, the bound (non-channel) sources with their field shapes, and per-channel availability. Channel is special-cased into channels because its options depend on live config, not just the enum; sources still names it so surfaces render the picker from one backend-walked list instead of reconstructing it.

Enums§

ConditionValueType
Value-input widget hint for one condition field, so the authoring surface renders the right control (text box, number, checkbox, enum select) and quotes string comparands correctly.
TriggerFieldKind
Input widget hint for a trigger field.

Functions§

build_registry
Every SopTriggerSource except Channel becomes a bound source whose field specs come from the source’s own TriggerBehavior; every inbound-capable ChannelKind becomes a channel row with whatever configured aliases match it. No per-source field list lives here: the source describes its own fields.
registry_from_config
Build the registry from live config: collects configured channel aliases (normalizing - to _ to match ChannelKind wire names) and delegates to build_registry.