import * as node_http from 'node:http'; import { c as StreamCallbacks } from '../types-DWYKzKYF.js'; import '../vault.interface-BZt4wlVo.js'; type SessionEventsFactory = (sessionId: string, runId: string, metadata: Record) => StreamCallbacks; interface WebhookHandlerOptions { secret: string; /** Signature timestamp tolerance in seconds (default: 300). */ tolerance?: number; onSessionEvents: SessionEventsFactory; } interface WebhookHandlerResult { status: number; body: string | null; } interface WebhookHandler { /** Web standard Request/Response (Cloudflare Workers, Bun, Deno, Next.js). */ handle(req: Request): Promise; /** Node.js raw http adapter (Express, Koa, plain http). */ express(req: node_http.IncomingMessage, res: node_http.ServerResponse): Promise; /** Framework-agnostic: pass raw body + signature, get back status + body. */ handleRaw(rawBody: string, signatureHeader: string | null): Promise; } declare function createWebhookHandler(options: WebhookHandlerOptions): WebhookHandler; export { type SessionEventsFactory, type WebhookHandler, type WebhookHandlerOptions, type WebhookHandlerResult, createWebhookHandler };