import { NextRequest } from 'next/server'; import { S as ServeHandlerOptions } from '../index-BvRGmHFw.js'; export { C as Client, N as NovuRequestHandler, a as agent, i as isFromWorkflow, w as workflow } from '../index-BvRGmHFw.js'; export { C as ClientOptions, a as CronExpression, E as ExecuteInput, S as SeverityLevelEnum, W as Workflow } from '../health-check.types-DORn4djx.js'; export { C as ContextResolved, E as EnvironmentSystemVariables, S as Subscriber, p as providerSchemas } from '../subscriber.types-Drf26WPA.js'; import { S as SupportedFrameworkName } from '../server.types-Cc6o5eYH.js'; export { Actions, Button, Card, CardChild, CardElement, CardLink, CardText, Divider, Image, ImageElement, Select, SelectOption, TextInput } from 'chat'; export { A as Agent, a as AgentAction, b as AgentActionContext, c as AgentAttachment, d as AgentContext, e as AgentContextPayload, f as AgentContextValue, g as AgentConversation, h as AgentDeliveryError, i as AgentError, j as AgentHandlerContext, k as AgentHandlers, l as AgentHistoryEntry, m as AgentHumanResponse, n as AgentMessage, o as AgentMessageAuthor, p as AgentMessageContext, q as AgentNotification, r as AgentPlatformContext, s as AgentReaction, t as AgentReactionContext, u as AgentResolveContext, v as AgentSubscriber, w as AgentSubscriberAccess, x as AgentToolCall, F as FileRef, H as HumanAskApproveOptions, y as HumanChooseOptions, z as HumanInteractionKind, B as HumanTellOptions, M as MessageContent, R as ReplyHandle, T as ToolApprovalCard, C as ToolApprovalConfig, D as ToolApprovalDecision, E as toAgentError } from '../agent.types-DFLG1_vb.js'; export { AnyStepResolver, ChatStepResolver, EmailStepResolver, InAppStepResolver, PushStepResolver, SmsStepResolver, StepResolverContext, ToolStepResolver, step } from '../step-resolver.js'; import '../util.types-DaFfsxgy.js'; import '../base.schema.types-BApIn9jr.js'; import 'json-schema-to-ts'; import 'zod'; declare const frameworkName: SupportedFrameworkName; /** * Defines a request handler for Next.js 12+. * * The argument types are kept abstract due to varying type checks across * Next.js versions. Next.js 15 uses `RouteContext` for the second argument, * while versions 13 and 14 omit it, and version 12 uses `NextApiResponse`, * which varies by environment (edge vs serverless). */ type RequestHandler = (expectedReq: NextRequest, res: unknown) => Promise; /** * In Next.js, serve and register any declared workflows with Novu, making * them available to be triggered by events. * * Supports Next.js 12+, both serverless and edge. * * On Next.js >= 15.1 (App Router), background agent turns are kept alive after * the acknowledgement response via `after()` from `next/server`, so agents work * on serverless platforms such as Vercel without extra configuration. On older * versions, pass `waitUntil` to `serve()` when deploying to serverless. * * @example Next.js <=12 or the pages router can export the handler directly * ```ts * import { serve } from "@novu/framework/next"; * import { myWorkflow } from "./src/novu/workflows"; // Your workflows * * export default serve({ workflows: [myWorkflow] }); * ``` * * @example Next.js >=13 with the `app` dir must export individual methods * ```ts * import { serve } from "@novu/framework/next"; * import { myWorkflow } from "./src/novu/workflows"; * * export const { GET, POST, OPTIONS } = serve({ workflows: [myWorkflow] }); * ``` */ declare const serve: (options: ServeHandlerOptions) => RequestHandler & { GET: RequestHandler; POST: RequestHandler; OPTIONS: RequestHandler; }; export { type RequestHandler, ServeHandlerOptions, frameworkName, serve };