Bun.serve) defined in packages/core/src/gateway/server.ts. It normalizes incoming webhooks from five sources into a unified Signal format stored in the signals table for the Forge to process.
Endpoints
WhatsApp also handles
GET /hooks/whatsapp for the webhook verification challenge.
Signature Verification
Discord
Discord uses Ed25519 signatures verified with the Web Crypto API:GRIND_DISCORD_PUBLIC_KEY. Requests failing verification return 401.
WhatsApp Cloud API
WhatsApp signs payloads with HMAC-SHA256 using the app secret:Telegram
Telegram does not sign individual payloads. The bot token in the webhook URL path acts as the secret.Signal Normalization
gateway/normalize.ts converts each platform’s payload into a unified Signal:
signals table and consumed by the Forge daemon on its next tick.
Configuration
See Environment Reference for the complete list including webhook paths and host binding.
Adding a New Webhook Source
- Add a new endpoint case in
gateway/server.ts - Implement signature verification if required
- Add a normalizer in
gateway/normalize.ts - Handle the new signal type in
forge/engine.ts