import type { FrontMcpLogger } from '../../common'; import type { ChannelInstance } from '../channel.instance'; import type { ChannelWebhookSource } from '../../common/metadata/channel.metadata'; /** * Webhook request context passed to channel handlers. */ export interface WebhookPayload { /** The raw request body */ body: unknown; /** Request headers (lowercase keys) */ headers: Record; /** HTTP method */ method: string; /** Query parameters */ query?: Record; } /** * Creates an Express/Fastify-compatible middleware handler for a webhook channel. * * The middleware: * 1. Accepts POST requests at the configured path * 2. Passes the request body as the payload to the channel's onEvent handler * 3. Pushes the resulting notification to all capable Claude Code sessions * 4. Returns 200 on success, 500 on error * * @param channel - The channel instance * @param sourceConfig - The webhook source configuration * @param logger - Logger instance * @returns A middleware function compatible with Express/Fastify */ export declare function createWebhookMiddleware(channel: ChannelInstance, sourceConfig: ChannelWebhookSource, logger: FrontMcpLogger): (req: { body?: unknown; headers?: Record; method?: string; query?: unknown; }, res: { status: (code: number) => { json: (body: unknown) => void; }; json?: (body: unknown) => void; }) => Promise; //# sourceMappingURL=webhook.source.d.ts.map