import type { OutgoingMessage, WebhookRequestContext, WebhookResponse } from "./types.js"; export interface PlatformAdapter { name: string; handleWebhook(context: WebhookRequestContext): Promise; sendMessage(message: OutgoingMessage): Promise; } export function jsonResponse(body: unknown, status = 200): WebhookResponse { return { status, body }; } export function notImplemented(platform: string): WebhookResponse { return jsonResponse({ ok: false, error: `${platform} inbound webhook is not implemented in v1` }, 501); }