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§
- Bound
Trigger Source - A non-channel trigger source and the fields needed to configure it.
- Channel
Alias - One configured channel instance an SOP channel trigger can bind to.
- Channel
Trigger Kind - One channel type row: every inbound-capable
ChannelKindappears, configured or not, so editors can offer setup for missing ones. - Condition
Field - One field of a trigger payload a condition can reference.
pathis the JSON path suffix after$.(empty for a scalar payload compared directly),labelis the human name,value_typedrives the value control, andoptionscarries the choices whenvalue_typeisEnum. - Configured
Channel - Config-derived channel instance used as input to
build_registry; decoupled fromzeroclaw_configso the walk is testable without a fullConfig. - Payload
Contract - The set of payload fields a condition may reference for a given source.
openmarks 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.directmarks a scalar payload (peripheral signal) compared with the bareop valueform and no path. - Trigger
Field - One editable field of a trigger source (e.g.
topicfor MQTT). - Trigger
Source Registry - 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.
Channelis special-cased intochannelsbecause its options depend on live config, not just the enum;sourcesstill names it so surfaces render the picker from one backend-walked list instead of reconstructing it.
Enums§
- Condition
Value Type - 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.
- Trigger
Field Kind - Input widget hint for a trigger field.
Functions§
- build_
registry - Every
SopTriggerSourceexceptChannelbecomes a bound source whose field specs come from the source’s ownTriggerBehavior; every inbound-capableChannelKindbecomes 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 matchChannelKindwire names) and delegates tobuild_registry.