Repository navigation
feat: add Hazel as an alert destination type - #27
Merged
Merged
Conversation
Adds a dedicated "hazel" destination alongside slack/pagerduty/webhook so Maple alerts can be posted into a Hazel chat channel. The receiver-side endpoint in Hazel parses Maple's existing buildPayload JSON, so no parallel payload schema is introduced. - Schema: extend AlertDestinationType union and the create/update request variants with a hazel arm (webhookUrl + optional signing secret) - Hydration: add hazel arm to DestinationSecretConfigSchema - AlertsService: build public/secret config and update flow for hazel - Dispatch: POST the existing payloadJson to the configured Hazel URL with x-maple-event-type / x-maple-delivery-key / optional HMAC signature - Web: surface "Hazel" in the destination type picker with a webhook URL field and helper text pointing to the Hazel setup screen Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"hazel"destination type alongsideslack/pagerduty/webhookso Maple alerts can be delivered into a Hazel chat channel.buildPayload()JSON unchanged — Hazel parses Maple's standard webhook payload directly, so there's no parallel schema to maintain.Changes
Domain / contract (
packages/domain/src/http/alerts.ts)AlertDestinationTypeliteral with"hazel".HazelAlertDestinationConfigandUpdateHazelAlertDestinationConfig.hazelvariant toAlertDestinationCreateRequestandAlertDestinationUpdateRequest(fields:webhookUrl, optionalsigningSecret, optionalenabled).API services
AlertDestinationHydration.ts— addhazelarm toDestinationSecretConfigSchema(mirrorswebhookshape with a renamed URL key).AlertsService.ts— wirehazelthroughbuildPublicConfig,buildSecretConfig, and the update-destination switch (preserving the existing url/secret on partial updates).AlertDeliveryDispatch.ts— addhazelcase to the exhaustiveMatchdispatch. POSTs the existingpayloadJsonwithx-maple-event-type,x-maple-delivery-key, and (when configured) an HMACx-maple-signatureheader.Web
destination-dialog.tsx—Hazeloption in the type picker plus conditional fields (Hazel webhook URL + optional signing secret) with helper copy.form-utils.ts—hazelWebhookUrlfield onDestinationFormState,Hazellabel, and create/update payload builders for the new type.Reviewer notes
hazelflows through the same encrypt/decrypt as the other types.POST /destinations/:id/test) automatically works for Hazel destinations via the same code path; the synthetic test payload is justeventType: "test"throughbuildPayload./maplewebhook receiver, embed builder, and integration UI) is in a separate PR on the Hazel repo.alertDestinationstable holds the hazel destination just like any other type.Test plan
bun typecheckpasses (verified locally — 17/17 packages).…/webhooks/incoming/{id}/{token}/mapleURL from Hazel, and save.success: truewithresponseCode: 200andproviderMessage: "Delivered to Hazel".triggerandresolveevents.🤖 Generated with Claude Code