import type { RelayReactionEvent, RelayWebhookEnvelope, RelayWebhookEventType, RelayWebhookMessageEvent } from "./types.js"; export declare const MAX_WEBHOOK_BODY_BYTES: number; /** * Whether this release knows `eventType`. Relay adds event types over time * and a new one reaches a deployed agent before the agent upgrades, so the * parser accepts any event type and the adapter skips the unknown ones. */ export declare function isKnownWebhookEventType(eventType: string): eventType is RelayWebhookEventType; /** * Validate a Relay webhook envelope. An `event_type` this release does not * know is accepted here (check it with `isKnownWebhookEventType`); anything * else malformed is a ValidationError. */ export declare function parseWebhookEnvelope(value: unknown): RelayWebhookEnvelope; /** * The Chat a message event belongs to: `chat_id`, which matches the Message * object, else `chat.id`, the only Chat key servers before 2026-10-04 send. */ export declare function messageEventChatId(data: { chat?: RelayWebhookMessageEvent["chat"]; chat_id?: string; }): string | undefined; /** * The sender of a message event: `from_handle`, which matches the Message * object, else the deprecated `sender_handle` that servers before 2026-10-04 send. */ export declare function messageEventSender(data: Pick): RelayWebhookMessageEvent["from_handle"]; export declare function parseWebhookMessageEvent(data: Record): RelayWebhookMessageEvent; export declare function parseReactionEvent(data: Record): RelayReactionEvent; export declare function assertExhaustiveEvent(eventType: never): never; export declare function readWebhookBody(request: Request): Promise; export declare function isMessageEventType(value: RelayWebhookEventType): value is "message.sent" | "message.received" | "message.read" | "message.delivered" | "message.failed"; //# sourceMappingURL=webhook.d.ts.map