webhooks: add rawMode config for raw JSON payload delivery#18
Merged
Conversation
Adds hooks.webhooks.rawMode — an optional array of preset names that receive the full JSON payload string instead of a formatted markdown message. Useful for automation where downstream processing needs complete entity data not included in the transform. - Config type and Zod schema updated with rawMode field - resolveWebhooksConfig passes rawMode through to WebhooksConfigResolved - Handler skips transform and JSON.stringifies payload when rawMode enabled - Session keys extracted from entity_id / id / session_id with unknown fallback - 4 new test cases covering raw, fallback, unknown, and mixed-mode dispatch - Docs updated with Raw JSON Mode section and example Version: bump to 2026.3.27-18 for PR #18 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Adds an m365-email webhook preset that handles Microsoft Graph API change notifications for mailbox monitoring. - New transform (m365-email.ts): extracts mailbox address and message ID from the resource path, formats an agent message with next steps - Validation handshake: HTTP handler now responds to ?validationToken=... with plain text 200 before any transform/rawMode logic runs - Registered in the webhook transform registry - 7 unit tests for the transform + 1 integration test for the handshake - Docs: new m365-email section with subscription setup, payload example, and renewal notes Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Prod config has hooks.webhooks.agentRoutes which maps preset names to agent IDs. Adding the field to the type and Zod schema so gateway starts without a config validation error. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Two changes to prevent missing-tool failures on fresh staging deploys: 1. Dockerfile: add @googleworkspace/cli to the npm install -g block so gws is always available in the image regardless of volume state. 2. staging-up.sh: add a data-sync step that copies from prod after deploy: - OAuth/API token JSON files (/data/*.json) - Google Workspace CLI config (/data/gws-config/) - gh CLI auth (/data/config/gh/hosts.yml) These files live only on the persistent volume and are not in git, so fresh staging volumes were missing them and agent tool checks would fail. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
5 tasks
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.
Hey! Here's a feature I put together to solve a real pain point with the webhook preset system — when you need the complete JSON payload rather than the formatted markdown message, the current transforms throw away data you might need for automation.
Summary
hooks.webhooks.rawMode— an optional array of preset names that bypass the transform and deliver the full JSON payload as a formatted stringentity_id,id,session_id) with anunknownfallbackrawModekeeps all existing behavior exactly as-isagentRoutes, so you can raw-mode a preset and route it to a specific agentConfig example
Changes
src/config/types.hooks.tsrawMode?: string[]toWebhooksConfigsrc/config/zod-schema.tsrawModefield to Zod webhooks schemasrc/gateway/hooks.tsrawModethroughresolveWebhooksConfigsrc/gateway/webhooks-http.tssrc/gateway/webhooks-http.test.tsdocs/automation/webhooks-external.mdTest plan
pnpm buildpassespnpm check— 0 warnings, 0 errorsJSON.stringify(payload, null, 2)verbatimentity_id→id→session_id→unknownin order🤖 Generated with Claude Code