Expand description
Shared notification-delivery wire types + send primitives.
This crate is the narrow surface that both Core (the kernel notification
store + fan-out orchestration in apps/core/src/notify) and the
out-of-process monitors engine (apps-store/monitors/backend) need in
common: the channel-target enum and the dep-light HTTP send functions. It has
ZERO dependency on apps/core.
Placement (Core vs Gateway): a notification decides what runs (open a
delivery socket) → Core-side. Nothing here is policy. The store,
deliver_user_notification, dedupe, and the tiered notify_all fan-out that
wires in the desktop event bus / plugin hooks / BYO SMTP live in Core; only the
shared types + primitives live here.
The set of targets is an extensible enum — the “nothing hardcoded, everything swappable” rule applied to channels: a webhook covers Slack/Discord/any HTTP endpoint, Telegram is a direct Bot-API send, Expo handles mobile, and Email carries only the recipient (the SMTP transport is a shared node resource resolved once at the Core call site, never stored per-target).
Every send is best-effort unless its name ends in _text: those return
Ok(()) only on a 2xx so a workflow node can surface a failed delivery.
Structs§
- Alert
Delivery Targets - Node-level alert delivery targets (self-host): the fan-out channels
(webhook / Telegram / Expo push) + email recipients that policy alerts
deliver to. Distinct from per-monitor targets, which are scoped to one
watched site. Persisted in the Core notify store (
alert_deliverytable).
Enums§
- Notify
Target - A notification destination (per-monitor or node-level policy-alert channel).
Functions§
- push_
expo_ message - Send a plain title/body push to a set of Expo tokens. Best-effort: a failure
is logged, never propagated.
datarides through to the device payload. - send_
telegram_ alert - Best-effort Telegram alert send (with a bell emoji prefix).
- send_
telegram_ text - Send a plain-text message via the Telegram Bot API (
sendMessage). ReturnsOk(())only on a 2xx so a workflow node can surface a failed send. - send_
webhook_ alert - Best-effort webhook alert send:
{text, content, alert}so both Slack/Discord framing and the structured payload ride one URL.alertis the full JSON carrier (embedded under"alert"). - send_
webhook_ text - Post a plain-text message to a Slack/Discord/generic incoming webhook. Sends
both
text(Slack) andcontent(Discord) so one URL fits either service. ReturnsOk(())only on a 2xx response.