Multi-product operational notifications with guarded Telegram interactions and approval-based WhatsApp group routing — without turning an accepted message into a delivery promise.
A notification is useful only when it reaches the right authorized audience and can be retried without duplicating unrelated channels. Notify is a reusable operational event and channel-routing layer; Xeption supplies the first real business events and retains its durable notification outbox.
flowchart LR
X[Xeption source outbox] --> C[Notify event contract]
C --> P[Project policy and channel opt-in]
P --> W[Cloudflare Worker]
W --> D[(Approved D1 group routes)]
D --> A[WAHA / WhatsApp groups]
T[Telegram Mini App] --> S[Signed Telegram identity + linked Xeption staff]
A discovered WhatsApp group is only a candidate. Explicit admin approval is required; repeat attempts reuse delivery receipts and a permitted fallback never silently changes tenant ownership. Staff Mini App access depends on both Telegram-signed identity and Xeption account authorization. Routing evidence · Source outbox and cutover.
Beta. Contract validation, multigroup routing and Telegram staging UI are implemented, but an HTTP 202 only indicates the provider accepted the event — not that staff read it. Duplicate delivery remains possible after failure between transport acceptance and durable receipt. The Telegram staging write flag remains disabled pending separate validation; neither automated conversational agents nor unsupervised group routing are claimed.
Current readiness is documented in shared channels and Mini App security.
A reusable staff-notification and interaction service, bootstrapped by Trigenys AppFactory. Xeption is its first consuming application.
This repo now includes a mobile-first Telegram Mini App for the existing Xeption staff bot. The staging UI and its Xeption delegated API are deployed on Cloudflare; ERP ↔ Telegram linking and protected staff actions are being finalized separately.
GET /miniapp: responsive Telegram interface (built-in static assets)GET /v1/miniapp/public-config: public Supabase URL and anon key onlyGET /v1/miniapp/session: Telegram HMAC identity + verified linked Xeption staffPOST /v1/miniapp/link: attach a Telegram user to an authenticated Xeption staff memberGET /v1/miniapp/items?category=alerts|stock|images|trocs|marketplace: role-aware and PII-minimized viewsPOST /v1/miniapp/ack: audited acknowledgment (feature-flagged)POST /v1/miniapp/troc-action: guardedcontactedorrefusedtransitionsPOST /v1/miniapp/marketplace-sold: guarded active → sold state change
Product dispatch routes (scoped key per project and channel, idempotent on the event id):
POST /v1/dispatch/{project}/telegram: opt-in private callback-button delivery using the existing product bot (contract)POST /v1/dispatch/{project}/email: transactional email through the configured SMTP relayPOST /v1/dispatch/{project}/whatsapp-direct: one WhatsApp text to an E.164 number through WAHA, rate limited per project and per recipient (contract)POST /v1/dispatch/xeption/whatsapp: staff group routing along approved D1 routes
Direct mutations are OFF until the Xeption migration and staging security tests pass. Inventory updates and photo uploads remain in Xeption ERP.
The Mini App verifies Telegram's signed initData server-side and requires a one-to-one binding to a current, real Xeption staff account. A Telegram group member without Xeption staff permission cannot access the data.
Requires Node.js 24+.
npm install
npm run check
npm run devCopy and securely configure .env.example. Node does not automatically load the file for npm run dev; provide host environment variables (or use Node's --env-file when explicitly launching Node in local development). Never commit a bot token or Supabase service-role key.
Main references:
-
Scalability and platform roadmap — proposed reliability, platform, notification intelligence and SaaS phases.
-
Bounded native staging execution — actual NTF-09 hosted phase probe, verified rollback and configuration propagation evidence.
-
Prolonged native scheduled endurance — completed 24-slot hosted profile: 107 accepted-once synthetic jobs, 214 acknowledged references, replayable evidence and verified teardown. The approved real Telegram producer/provider pilot remains open in #163.
-
Transactional email through SMTP: scoped product API, centrally configured sender/credentials and D1 receipts. Commerce Factory is the first email consumer; activation remains off until Spacemail credentials and real delivery are verified.
-
Individual WhatsApp dispatch to E.164 numbers: per-project key, hourly limits, D1 receipts without phone numbers; disabled until a project is enabled
-
Staff actions from WhatsApp groups: reactions and quoted replies under an alert, relayed signed to the emitting project; disabled until enabled
-
Reusable event contract, tenant policies and optional WAHA adapter
-
Generic WhatsApp group dispatch:
POST /v1/dispatch/{project}/whatsapp, same envelope and per-project auth as email, delivery only to the project's declared@g.usgroups. Trigenys Studio is declared, disabled until its « Studio Comm » group exists. -
Central WhatsApp dispatch owned by Trigenys Notify — opt-in, remains disabled until security cutover
-
Meta Cloud API officielle pour Atelier Maître — adaptateur et route privée, désactivés par défaut
-
Manually run live staging checks or use
npm run smoke:staging(read-only).
Xeption already has Telegram sending, persistent admin_notifications, per-channel retries, de-duplication and scheduled relay. A parallel sender would duplicate messages and create split delivery histories. Trigenys Notify extends the existing bot with operational workflows, then extracts reusable shared contracts for other Trigenys products.
AppFactory project: provisioned. Mini App interface: deployed in Cloudflare staging. Xeption notification sending remains in the original Supabase relay. Reusable core contracts, tenants and optional Telegram/WAHA transport adapters are available as library code only, with no additional sender switched on by default; interactive Telegram dispatch requires a coordinated opt-in. The ERP ↔ Telegram account-linking flow is a separate, ongoing change. The staging write flag remains disabled; this repository does not attempt to deploy SQL or bot credentials.